Files
bl/logic/service/fight/effect/443.go

39 lines
954 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 443 - n回合内若受到的伤害超过m则对手疲惫x回合
type Effect443 struct {
node.EffectNode
}
func (e *Effect443) Skill_Use_ex() bool {
damageThreshold := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart()))
if e.Ctx().Our.SumDamage.Cmp(damageThreshold) > 0 {
// 对手疲惫x回合
tiredEffect := e.Ctx().Our.InitEffect(input.EffectType.Status, int(info.PetStatus.Tired))
if tiredEffect != nil {
tiredEffect.Duration(int(e.Args()[2].IntPart())) // x回合
e.Ctx().Opp.AddEffect(e.Ctx().Our, tiredEffect)
}
}
return true
}
func (e *Effect443) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(a[0]) // 持续n回合
}
func init() {
input.InitEffect(input.EffectType.Skill, 443, &Effect443{})
}