Files
bl/logic/service/fight/effect/effect_62.go
昔念 e75ecd413d feat(fight): 重构战斗系统技能逻辑与精灵切换功能
- 优化技能执行流程,统一使用 SelectSkillAction 作为技能载体
- 移除冗余的技能 ID 字段,简化数据结构
- 调整命中判断和技能效果触发机制,提升准确性
- 修改精灵切换与捕获相关方法参数格式
- 更新技能列表结构为动态数组以支持灵活长度
- 完善睡眠等异常状态的处理逻辑
- 修复战斗中技能 PP 扣减及副本还原问题
- 清理无用代码,如多余的 FindWithIndex 函数定义
- 强化验证码缓存键命名规则,增强安全性
2025-10-26 20:56:03 +08:00

68 lines
1.4 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package effect
import (
"blazing/logic/service/fight/input"
"blazing/logic/service/fight/node"
)
/**
* n回合内没有击败则对方死亡
*/
type Effect62 struct {
node.EffectNode
Hide bool // 是否隐藏 正常是命中就可用,镇魂歌是回合数到才可用
}
func init() {
t := &Effect62{
EffectNode: node.EffectNode{
Owner: true,
},
}
input.InitEffect(input.EffectType.Skill, 62, t)
}
func (e *Effect62) OnSkill(ctx input.Ctx) bool {
if !e.Hit() {
return true
}
if e.Duration() != 1 { //说明还没到生效节点
e.Hide = true //隐藏效果
} else {
e.Hide = false
}
if !e.Hide { //说明是自身回合//如果还在隐藏,就直接返回
//defer e.EffectNode.NotALive() //失效
//应该是对方固定伤害等于自身血量
//e.Input.Death() //本只死亡
//否则触发秒杀 在对面使用技能后
//return true
}
return false
}
// 默认添加回合
func (e *Effect62) SetArgs(t *input.Input, a ...int) {
e.EffectNode.SetArgs(t, a...)
e.EffectNode.Duration(e.EffectNode.SideEffectArgs[0])
}
// 因为对方切精灵,这个效果也要无效掉
func (this *Effect62) OnSwitchIn(input.Ctx) bool {
if this.Hide { //如果还在隐藏,就直接返回
return true
}
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this)
//否则触发秒杀 在对面使用技能后
return true
}