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

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

49 lines
877 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/action"
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* 下n回合对手使用体力药剂时效果变成减少相应的体力
*/
type Effect69 struct {
node.EffectNode
}
type Effect69_1 struct {
node.EffectNode
}
func init() {
t := &Effect69{
EffectNode: node.EffectNode{},
}
//t.Owner(true)
//t.Duration(5)
input.InitEffect(input.EffectType.Skill, 69, t)
}
func (e *Effect69) OnSkill(ctx input.Ctx) bool {
t := &Effect69_1{
EffectNode: node.EffectNode{},
}
t.SetArgs(e.Input, e.SideEffectArgs...)
t.Duration(e.SideEffectArgs[0])
ctx.AddEffect(t)
return true
}
func (e *Effect69_1) Heal_Pre(f action.BattleActionI, t *int) bool {
if _, ok := f.(*action.UseItemAction); ok {
*t = -*t // 把t指向的值取反直接作用于外部变量
}
return true
}