refactor(fight): 重构战斗系统

- 重构了 BattleSkillEntity 结构,改名为 SkillEntity
- 优化了 Input 结构,移除了冗余的 Effect 容器
- 调整了 Effect 接口,增加了 SetInput 和 Alive 方法
- 重构了战斗逻辑中的技能使用和效果处理流程
- 优化了代码结构,提高了可读性和可维护性
This commit is contained in:
2025-09-15 00:40:19 +08:00
parent 906bad9e21
commit d9f09aa96a
10 changed files with 108 additions and 94 deletions

View File

@@ -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