- 将 InitEffect 重命名为 InitSkillEffect,用于初始化技能效果 - 修改技能效果的 ID,避免和普通效果 ID 冲突 - 优化战斗循环逻辑,增加战斗结束的判断条件 - 调整输入结构,移除未使用的属性和状态容器 - 重构技能解析和攻击处理逻辑,提高代码可读性和维护性
67 lines
1.3 KiB
Go
67 lines
1.3 KiB
Go
package effect
|
||
|
||
import (
|
||
"blazing/logic/service/fight/input"
|
||
"blazing/logic/service/fight/node"
|
||
)
|
||
|
||
/**
|
||
* n回合内没有击败,则对方死亡
|
||
*/
|
||
type Effect62 struct {
|
||
node.EffectNode
|
||
Hide bool // 是否隐藏 正常是命中就可用,镇魂歌是回合数到才可用
|
||
}
|
||
|
||
func init() {
|
||
input.InitSkillEffect(62, &Effect62{
|
||
EffectNode: node.EffectNode{
|
||
ArgSize: 1,
|
||
},
|
||
})
|
||
|
||
}
|
||
|
||
func (this *Effect62) OnDamage() bool {
|
||
|
||
if this.Hide { //如果本可用
|
||
|
||
//直接秒杀对方
|
||
|
||
}
|
||
|
||
return true
|
||
}
|
||
func (this *Effect62) TurnEnd() bool {
|
||
this.EffectNode.TurnEnd() //先调用回合
|
||
|
||
if this.Duration(0) != 1 { //说明还没到生效节点
|
||
this.Hide = true //隐藏效果
|
||
}
|
||
|
||
return true
|
||
}
|
||
|
||
func (this *Effect62) SkillUseEnd() bool {
|
||
if this.Hide { //如果还在隐藏,就直接返回
|
||
return true
|
||
}
|
||
defer func() { //延迟处理
|
||
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this) //如果生效就移除
|
||
}()
|
||
//否则触发秒杀 在对面使用技能后
|
||
return true
|
||
|
||
}
|
||
|
||
// 因为对方切精灵,这个效果也要无效掉
|
||
func (this *Effect62) OnSwitchIn() bool {
|
||
if this.Hide { //如果还在隐藏,就直接返回
|
||
return true
|
||
}
|
||
//this.GetBattle().Effects[this.GetInput().UserID].RemoveEffect(this)
|
||
//否则触发秒杀 在对面使用技能后
|
||
return true
|
||
|
||
}
|