41
All checks were successful
ci/woodpecker/push/my-first-workflow Pipeline was successful

This commit is contained in:
昔念
2026-03-07 23:54:01 +08:00
parent 54a4876beb
commit d367f9d1d4
26 changed files with 3761 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
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{})
}