Files
bl/logic/service/fight/effect/effect_519.go
昔念 d367f9d1d4
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
41
2026-03-07 23:54:01 +08:00

45 lines
989 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 519 - n回合内自身每处于一种能力强化或弱化状态时都会回复m点体力
type Effect519 struct {
node.EffectNode
}
func init() {
input.InitEffect(input.EffectType.Skill, 519, &Effect519{})
}
func (e *Effect519) Action_start() bool {
var buffCount int
for _, v := range e.Ctx().Our.Prop {
if v != 0 {
buffCount++
}
}
// 每种状态回复m点体力
healPerBuff := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
totalHeal := healPerBuff.Mul(alpacadecimal.NewFromInt(int64(buffCount)))
if totalHeal.Cmp(alpacadecimal.NewFromInt(0)) > 0 {
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, totalHeal)
}
return true
}
func (e *Effect519) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}