feat(fight): 重构技能和受击触发逻辑,统一命名规范

- 将 `OnHit`、`AfterHit` 等方法重命名为 `AfterSkill` 和 `Attacked`,统一触发时机命名
- 调整 `BeforeSkill` 与 `PreSkill` 的职责,明确技能前处理逻辑
- 修改 `UseSkill` 为 `CanSkill`,增强语义清晰度
- 补充精灵切换时的触发方法 `OnSwitchOut` 与 `OnOwnerSwitchIn`
- 修复战斗中属性拷贝逻辑及状态持续回合计算的安全检查
- 增加捕获精灵后的日志输出,便于调试追踪
- 完善默认伤害效果节点的初始化逻辑
This commit is contained in:
2025-09-25 13:07:56 +08:00
parent d9d47b8d21
commit 07c08b767b
18 changed files with 115 additions and 105 deletions

View File

@@ -3,12 +3,12 @@ package node
// 切精灵返回false重写change方法来实现切换效果
// 精灵切换相关触发
func (e *EffectNode) OnSwitchIn() bool {
panic("not implemented") // TODO: Implement
return true
}
func (e *EffectNode) OnSwitchOut() bool {
//下场默认清除effect
if e.Owner {//清除对方的我方施加uff
if e.Owner { //清除对方的我方施加uff
e.NotALive()
}
return true
@@ -22,5 +22,5 @@ func (e *EffectNode) OnOwnerSwitchIn() bool {
}
func (e *EffectNode) OnOwnerSwitchOut() bool {
panic("not implemented") // TODO: Implement
return true
}

View File

@@ -5,35 +5,20 @@ import (
"blazing/logic/service/fight/input"
)
// 命中前 攻击伤害结算
func (e *EffectNode) BeforHit(opp *input.Input, skill *info.SkillEntity) {
}
// 命中前 攻击伤害结算
func (e *EffectNode) AfterHit(opp *input.Input, skill *info.SkillEntity) {
}
// 命中时
func (e *EffectNode) OnHit(opp *input.Input, skill *info.SkillEntity) {
}
// miss触发
func (e *EffectNode) OnMiss(opp *input.Input, skill *info.SkillEntity) {
}
// 加算区
func (e *EffectNode) AddZone(opp *input.Input, skill *input.EffectID) {
}
//乘算区
// 乘算区
func (e *EffectNode) MulZone(opp *input.Input, skill *input.EffectID) {
}
// 受击触发
func (this *EffectNode) AfterAttacked(opp *input.Input, skill *info.SkillEntity) {
func (this *EffectNode) Attacked(opp *input.Input, skill *info.SkillEntity) {
}
// 受击触发
func (this *EffectNode) BeforeAttacked(opp *input.Input, skill *info.SkillEntity) {
}

View File

@@ -5,19 +5,29 @@ import (
"blazing/logic/service/fight/input"
)
func (e *EffectNode) OnSkillPP() bool {
return true
}
// 使用技能前
func (e *EffectNode) UseSkill(opp *input.Input) bool {
func (e *EffectNode) CanSkill(opp *input.Input) bool {
return e.Input.CurrentPet.HP != 0
}
// 命中前 攻击伤害结算
func (e *EffectNode) PreSkill(opp *input.Input, skill *info.SkillEntity) {
}
func (e *EffectNode) BeforeSkill(opp *input.Input, skill *info.SkillEntity) {
}
// 使用技能时
func (e *EffectNode) OnSkill(opp *input.Input, skill *info.SkillEntity) {
}
func (e *EffectNode) OnSkillPP() bool {
return true
}
func (e *EffectNode) BeforeSkill(opp *input.Input, skill *info.SkillEntity) {
func (e *EffectNode) AfterSkill(opp *input.Input, skill *info.SkillEntity) {
}