- 优化技能执行流程,统一使用 SelectSkillAction 作为技能载体 - 移除冗余的技能 ID 字段,简化数据结构 - 调整命中判断和技能效果触发机制,提升准确性 - 修改精灵切换与捕获相关方法参数格式 - 更新技能列表结构为动态数组以支持灵活长度 - 完善睡眠等异常状态的处理逻辑 - 修复战斗中技能 PP 扣减及副本还原问题 - 清理无用代码,如多余的 FindWithIndex 函数定义 - 强化验证码缓存键命名规则,增强安全性
32 lines
807 B
Go
32 lines
807 B
Go
package node
|
||
|
||
import "blazing/logic/service/fight/input"
|
||
|
||
// 切精灵返回false,重写change方法来实现切换效果
|
||
// 精灵切换相关触发
|
||
|
||
func (e *EffectNode) OnSwitchIn(ctx input.Ctx) bool {
|
||
panic("not implemented") // TODO: Implement
|
||
}
|
||
|
||
func (e *EffectNode) OnSwitchOut(ctx input.Ctx) bool {
|
||
//下场默认清除effect
|
||
if e.GetInput().UserID == ctx.Player.GetInfo().UserID { //清除对方的我方施加uff
|
||
e.NotALive()
|
||
}
|
||
return true
|
||
}
|
||
|
||
func (e *EffectNode) OnOwnerSwitchIn(ctx input.Ctx) bool {
|
||
return true
|
||
}
|
||
|
||
//自身下场,清除掉技能效果
|
||
func (e *EffectNode) OnOwnerSwitchOut(ctx input.Ctx) bool {
|
||
e.Input.AttackValue = nil
|
||
//自身下场清除掉自身的回合效果
|
||
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this)
|
||
e.NotALive()
|
||
return true
|
||
}
|