refactor(fight): 重构战斗系统
- 重构了 BattleSkillEntity 结构,改名为 SkillEntity - 优化了 Input 结构,移除了冗余的 Effect 容器 - 调整了 Effect 接口,增加了 SetInput 和 Alive 方法 - 重构了战斗逻辑中的技能使用和效果处理流程 - 优化了代码结构,提高了可读性和可维护性
This commit is contained in:
@@ -9,7 +9,10 @@ func (this *EffectNode) PreTurnStart() bool {
|
||||
}
|
||||
|
||||
// 回合开始
|
||||
func (this *EffectNode) OnTurnStart(attacker, defender *input.Input) bool {
|
||||
func (this *EffectNode) OnTurnStart(opp *input.Input) bool {
|
||||
|
||||
//处理异常状态
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -17,9 +20,8 @@ func (this *EffectNode) OnTurnStart(attacker, defender *input.Input) bool {
|
||||
|
||||
func (this *EffectNode) TurnEnd() bool {
|
||||
|
||||
if this.duration != 0 { // 保留 (负数表示永久)
|
||||
//this.GetBattle().Effects[this.GetInput().UserID].AddEffect(this) //重新添加buff到上下文
|
||||
|
||||
if this.duration == 0 { // 保留 (负数表示永久)
|
||||
this.NotAlive = true
|
||||
}
|
||||
this.duration--
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user