Files
bl/logic/service/fight/node/skill.go
昔念 4dd05726af ```
fix(socket): 修复socket广播和退出逻辑中的返回值错误

- 修正了Broadcast方法中错误的返回值true为false
- 修正了QuitSelf方法中player遍历的返回值从true改为false
- 在玩家退出时添加了睡眠模式错误码通知消息

feat(fight): 统一技能使用方法命名并修复战斗伤害计算逻辑

- 将所有技能使用方法名从Skill_Useed重命名为SkillUseed以保持一致性
2026-01-25 17:36:40 +08:00

65 lines
1.3 KiB
Go

package node
import (
"blazing/logic/service/fight/info"
"blazing/logic/service/fight/input"
)
func (e *EffectNode) Skill_Pre() bool {
return true
}
// func (e *EffectNode) Calculate_Pre() bool {
// return true
// }
func (e *EffectNode) SkillHit() bool {
return true
}
func (e *EffectNode) SkillHit_ex() bool {
return true
}
func (e *EffectNode) CalculatePre() bool {
return true
}
func (e *EffectNode) OnSkill() bool {
// if e.Effect != nil {
// if e.Hit() { //没命中
// e.Effect.OnHit(ctx.Input, ctx.SkillEntity)
// } else {
// e.Effect.OnMiss(ctx.Input, ctx.SkillEntity)
// }
// }
return true
}
func (e *EffectNode) Skill_Can() bool {
return e.Input.CurrentPet.HP != 0
}
func (e *EffectNode) Skill_Use_ex() bool {
return true
}
func (e *EffectNode) SkillUseed() bool {
// if e.Effect != nil {
// if e.Input.CurrentPet.Info.Hp == 0 {
// e.OnDefeat(ctx.Input, ctx.SkillEntity) //死亡
// } else {
// e.OnAlive(ctx.Input, ctx.SkillEntity) //存活
// }
// }
// return true
return true
}
type Effect interface {
OnMiss(opp *input.Input, skill *info.SkillEntity)
OnHit(opp *input.Input, skill *info.SkillEntity)
OnDefeat(opp *input.Input, skill *info.SkillEntity) bool //如果需要死亡
OnAlive(opp *input.Input, skill *info.SkillEntity) bool //如果需要存活
}