Files
bl/logic/service/fight/effect/effect_43.go
昔念 c916440033 ```
feat(fight): 完善战斗系统中道具使用逻辑与血量恢复机制

- 修改 item.go 中 Item 结构体,将 Bonus 字段类型由 string
2025-11-08 16:38:41 +08:00

35 lines
606 B
Go

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
"github.com/shopspring/decimal"
)
/**
* 恢复自身最大体力的1/n
*/
func init() {
input.InitEffect(input.EffectType.Skill, 43, &Effect43{
EffectNode: node.EffectNode{},
})
}
type Effect43 struct {
node.EffectNode
}
func (e *Effect43) OnSkill(ctx input.Ctx) bool {
if !e.Hit() {
return true
}
e.Input.Heal(&action.SelectSkillAction{}, decimal.NewFromInt(int64(e.Input.MaxHp)).Div(decimal.NewFromInt(int64(e.SideEffectArgs[0]))))
return true
}