32 lines
680 B
Go
32 lines
680 B
Go
|
|
package effect
|
|||
|
|
|
|||
|
|
import (
|
|||
|
|
"blazing/logic/service/fight/info"
|
|||
|
|
"blazing/logic/service/fight/input"
|
|||
|
|
"blazing/logic/service/fight/node"
|
|||
|
|
)
|
|||
|
|
|
|||
|
|
// 495 - 若对手处于XX状态,则30%几率秒杀对手
|
|||
|
|
type Effect495 struct {
|
|||
|
|
node.EffectNode
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func (e *Effect495) OnSkill() bool {
|
|||
|
|
if e.Ctx().Opp.StatEffect_Exist(info.EnumPetStatus(e.Args()[0].IntPart())) { // 对手处于异常状态
|
|||
|
|
chance := 30 // 固定30%
|
|||
|
|
success, _, _ := e.Input.Player.Roll(chance, 100)
|
|||
|
|
if success {
|
|||
|
|
// 秒杀对手
|
|||
|
|
e.Ctx().Opp.CurrentPet.Info.Hp = 0
|
|||
|
|
e.Ctx().Opp.CurrentPet.NotAlive = true
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
return true
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
func init() {
|
|||
|
|
input.InitEffect(input.EffectType.Skill, 495, &Effect495{})
|
|||
|
|
|
|||
|
|
}
|