Files
bl/logic/service/fight/effect/effect_415.go
xinian 0cff02158b
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 统一效果接口方法名为Skill_Use
2026-03-08 20:07:59 +08:00

29 lines
700 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"
"github.com/alpacahq/alpacadecimal"
)
// 415 - 若造成的伤害大于m点则自身恢复n点体力
type Effect415 struct {
node.EffectNode
}
func (e *Effect415) Skill_Use() bool {
damageThreshold := int(e.Args()[0].IntPart())
healAmount := e.Args()[1].IntPart()
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(damageThreshold))) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, alpacadecimal.NewFromInt(int64(healAmount)))
}
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 415, &Effect415{})
}