- 移除 Player 结构中的 IsFighting 字段,使用 FightID 替代 - 优化 Move 结构,重新排序字段并添加注释 - 修改 EffectNode 和相关结构,统一使用 Ctx 字段名称 - 重构 Battle 和 BattlePetEntity 结构,简化属性并优化布局 - 更新战斗逻辑,调整效果应用和回合处理机制
26 lines
447 B
Go
26 lines
447 B
Go
package node
|
|
|
|
// 回合开始前
|
|
func (this *EffectNode) PreTurnStart() bool {
|
|
return true
|
|
|
|
}
|
|
|
|
// 回合开始
|
|
func (this *EffectNode) OnTurnStart() bool {
|
|
return true
|
|
}
|
|
|
|
// 回合结束一次性effect清楚掉
|
|
|
|
func (this *EffectNode) TurnEnd() bool {
|
|
this.duration--
|
|
|
|
if this.duration != 0 { // 保留 (负数表示永久)
|
|
this.GetBattle().Effects[this.GetInput().UserID].AddEffect(this) //重新添加buff到上下文
|
|
|
|
}
|
|
|
|
return true
|
|
}
|