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

37 lines
735 B
Go

package effect
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/alpacahq/alpacadecimal"
)
// 192 - 附加n%当前体力值的伤害
type Effect192 struct {
node.EffectNode
}
func (e *Effect192) OnSkill() bool {
if e.Ctx().SkillEntity == nil {
return true
}
currentHp := e.Ctx().Our.CurrentPet.GetHP()
percent := e.Args()[0].Div(alpacadecimal.NewFromInt(100))
additionalDamage := currentHp.Mul(percent)
damageZone := &info.DamageZone{
Type: info.DamageType.Fixed,
Damage: additionalDamage,
}
e.Ctx().Opp.Damage(e.Ctx().Our, damageZone)
return true
}
func init() {
input.InitEffect(input.EffectType.NewSel, 192, &Effect192{})
}