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

32 lines
669 B
Go
Raw Normal View History

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"github.com/alpacahq/alpacadecimal"
)
// Effect 491: {0}回合内对手造成的伤害降低{1}%
type Effect491 struct {
RoundEffectArg0Base
}
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 init() {
input.InitEffect(input.EffectType.Skill, 491, &Effect491{})
}