28 lines
643 B
Go
28 lines
643 B
Go
package effect
|
|
|
|
import (
|
|
"blazing/logic/service/fight/action"
|
|
"blazing/logic/service/fight/input"
|
|
"blazing/logic/service/fight/node"
|
|
|
|
"github.com/alpacahq/alpacadecimal"
|
|
)
|
|
|
|
// Effect 415: 若造成的伤害大于{0}点,则自身恢复{1}点生命值
|
|
type Effect415 struct {
|
|
node.EffectNode
|
|
}
|
|
|
|
func (e *Effect415) Skill_Use() bool {
|
|
damageThreshold := int(e.Args()[0].IntPart())
|
|
|
|
if e.Ctx().Our.SumDamage.Cmp(alpacadecimal.NewFromInt(int64(damageThreshold))) > 0 {
|
|
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, e.Args()[1])
|
|
}
|
|
|
|
return true
|
|
}
|
|
func init() {
|
|
input.InitEffect(input.EffectType.Skill, 415, &Effect415{})
|
|
}
|