Files
bl/logic/service/fight/effect/effect_459.go
xinian 9c6f3988de
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful
refactor: 重构 CurrentPet 为 CurPet
2026-04-04 04:34:43 +08:00

32 lines
755 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// Effect 459: 附加对手防御值{0}%的百分比伤害
type Effect459 struct {
node.EffectNode
}
func (e *Effect459) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
opponentDef := alpacadecimal.NewFromInt(int64(e.Ctx().Opp.CurPet[0].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.Skill, 459, &Effect459{})
}