移除冗余的 Calculate_Pre 调用注释,优化技能命中判断流程。 将 SkillID 赋值操作移动至命中条件判断内部,确保仅在技能命中时记录。 注释掉部分不再使用的接口方法定义,保持代码整洁。
61 lines
1.2 KiB
Go
61 lines
1.2 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) Skill_Hit() bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Hit_ex() 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) Skill_Useed() 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 //如果需要存活
|
|
}
|