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

32 lines
669 B
Go

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{})
}