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

28 lines
626 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
// Effect 509: 恢复自身已损失体力值的1/{0}
type Effect509 struct {
node.EffectNode
}
func (e *Effect509) OnSkill() bool {
maxHp := e.Ctx().Our.CurrentPet.GetMaxHP()
currentHp := e.Ctx().Our.CurrentPet.GetHP()
lostHp := maxHp.Sub(currentHp)
healAmount := lostHp.Div(e.Args()[0]) // 受损体力值的1/m
e.Ctx().Our.Heal(e.Ctx().Our, &action.SelectSkillAction{}, healAmount)
return true
}
func init() {
input.InitEffect(input.EffectType.Skill, 509, &Effect509{})
}