Files
bl/logic/service/fight/effect/effect_519.go
xinian 875ad668aa
Some checks failed
ci/woodpecker/push/my-first-workflow Pipeline failed
feat: 实现战斗效果逻辑和接口重构
2026-03-28 21:57:22 +08:00

39 lines
831 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// Effect 519: {0}回合内自身每处于一种能力提升或下降状态时都会回复{1}点体力
type Effect519 struct {
RoundEffectArg0Base
}
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
}