Files
bl/logic/service/fight/node/PetSwitch.go
昔念 07c08b767b feat(fight): 重构技能和受击触发逻辑,统一命名规范
- 将 `OnHit`、`AfterHit` 等方法重命名为 `AfterSkill` 和 `Attacked`,统一触发时机命名
- 调整 `BeforeSkill` 与 `PreSkill` 的职责,明确技能前处理逻辑
- 修改 `UseSkill` 为 `CanSkill`,增强语义清晰度
- 补充精灵切换时的触发方法 `OnSwitchOut` 与 `OnOwnerSwitchIn`
- 修复战斗中属性拷贝逻辑及状态持续回合计算的安全检查
- 增加捕获精灵后的日志输出,便于调试追踪
- 完善默认伤害效果节点的初始化逻辑
2025-09-25 13:07:56 +08:00

27 lines
571 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 node
// 切精灵返回false重写change方法来实现切换效果
// 精灵切换相关触发
func (e *EffectNode) OnSwitchIn() bool {
return true
}
func (e *EffectNode) OnSwitchOut() bool {
//下场默认清除effect
if e.Owner { //清除对方的我方施加uff
e.NotALive()
}
return true
}
func (e *EffectNode) OnOwnerSwitchIn() bool {
//自身下场清除掉自身的回合效果
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this)
e.NotALive()
return true
}
func (e *EffectNode) OnOwnerSwitchOut() bool {
return true
}