39 lines
831 B
Go
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
|
|
}
|