- 移除 NodeManager 相关代码,改为使用 input 包中的 Effect - 重构 FightC 结构,添加 GetRand 方法 - 新增 BaseAction 结构和 NewBaseAction 函数 - 更新 effect 包中的 Effect 结构和相关方法 - 调整 BattleSkillEntity 中的 AttackTime 方法,增加 Hit 字段 - 更新 AttackValue 结构,保留原有的 AttackTime 字段 - 重构战斗逻辑,包括回合开始前的处理、技能使用、伤害计算等
27 lines
523 B
Go
27 lines
523 B
Go
package node
|
|
|
|
import "blazing/logic/service/fight/input"
|
|
|
|
// 回合开始前
|
|
func (this *EffectNode) PreTurnStart() bool {
|
|
return true
|
|
|
|
}
|
|
|
|
// 回合开始
|
|
func (this *EffectNode) OnTurnStart(attacker, defender *input.Input) bool {
|
|
return true
|
|
}
|
|
|
|
// 回合结束一次性effect清楚掉
|
|
|
|
func (this *EffectNode) TurnEnd() bool {
|
|
|
|
if this.duration != 0 { // 保留 (负数表示永久)
|
|
//this.GetBattle().Effects[this.GetInput().UserID].AddEffect(this) //重新添加buff到上下文
|
|
|
|
}
|
|
this.duration--
|
|
return true
|
|
}
|