package effect import ( "blazing/logic/service/fight/info" "blazing/logic/service/fight/input" "blazing/logic/service/fight/node" "github.com/alpacahq/alpacadecimal" ) // 491 - 3回合内对手造成的伤害降低m% type Effect491 struct { node.EffectNode } func (e *Effect491) DamageDivEx(t *info.DamageZone) bool { if t.Type != info.DamageType.Red { return true } damageReduction := alpacadecimal.NewFromInt(int64(e.Args()[1].IntPart())).Mul(t.Damage) if t.Damage.Cmp(damageReduction) > 0 { t.Damage = t.Damage.Sub(damageReduction) } else { t.Damage = alpacadecimal.Zero } return true } func (e *Effect491) SetArgs(t *input.Input, a ...int) { e.EffectNode.SetArgs(t, a...) e.EffectNode.Duration(a[0]) // 持续n回合 } func init() { input.InitEffect(input.EffectType.Skill, 491, &Effect491{}) }