Files
bl/logic/service/fight/effect/507.go
xinian a8cbe99873
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构技能效果实现
2026-03-08 14:55:53 +08:00

34 lines
749 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// 507 - 下回合若受到的伤害大于m则恢复自身所有体力
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{})
}