- 优化技能执行流程,统一使用 SelectSkillAction 作为技能载体 - 移除冗余的技能 ID 字段,简化数据结构 - 调整命中判断和技能效果触发机制,提升准确性 - 修改精灵切换与捕获相关方法参数格式 - 更新技能列表结构为动态数组以支持灵活长度 - 完善睡眠等异常状态的处理逻辑 - 修复战斗中技能 PP 扣减及副本还原问题 - 清理无用代码,如多余的 FindWithIndex 函数定义 - 强化验证码缓存键命名规则,增强安全性
63 lines
1.4 KiB
Go
63 lines
1.4 KiB
Go
package node
|
|
|
|
import (
|
|
"blazing/logic/service/fight/info"
|
|
"blazing/logic/service/fight/input"
|
|
)
|
|
|
|
func (e *EffectNode) Skill_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Calculate_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Hit_Pre(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Hit(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Hit_to(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) OnSkill(ctx input.Ctx) 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(ctx input.Ctx) bool {
|
|
|
|
return e.Input.CurrentPet.HP != 0
|
|
}
|
|
|
|
func (e *EffectNode) Skill_Use(ctx input.Ctx) bool {
|
|
return true
|
|
}
|
|
func (e *EffectNode) Skill_Useed(ctx input.Ctx) 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 //如果需要存活
|
|
}
|