34 lines
757 B
Go
34 lines
757 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
)
|
|
|
|
// Effect 507: 下回合若受到的伤害大于{0},则恢复自身所有体力
|
|
type Effect507 struct {
|
|
node.EffectNode
|
|
threshold int
|
|
triggered bool
|
|
}
|
|
|
|
func (e *Effect507) OnSkill() bool {
|
|
e.threshold = int(e.Args()[0].IntPart())
|
|
e.triggered = true
|
|
return true
|
|
}
|
|
|
|
func (e *Effect507) Skill_Use_ex() bool {
|
|
if e.triggered && e.Ctx().Our.SumDamage.IntPart() > int64(e.threshold) {
|
|
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, maxHp)
|
|
}
|
|
e.triggered = false
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 507, &Effect507{})
|
|
|
|
}
|