Files
bl/logic/service/fight/effect/effect_459.go
昔念 d367f9d1d4
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
41
2026-03-07 23:54:01 +08:00

32 lines
746 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 459 - 附加对手防御值m%的固定伤害
type Effect459 struct {
node.EffectNode
}
func (e *Effect459) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
opponentDef := alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurrentPet.Info.Prop[1]))
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
additionalDamage := opponentDef.Mul(percent)
e.Ctx().Opp.Damage(e.Ctx().Our, &info.DamageZone{Type: info.DamageType.Fixed, Damage: additionalDamage})
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 459, &Effect459{})
}