diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua index 7e0b6617d7..cd1d6e9b84 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/BattleLogic.lua @@ -228,17 +228,28 @@ function BattleLogic.TurnRound(debugTurn) BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound) -- 开始 BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundStart, CurRound) - --轮数变化后延时0.2秒用于初始化监听回合数被动的初始化 - BattleLogic.WaitForTrigger(0.2,function() - -- 进入新轮 - BattleLogic.CheckBattleLogic() + + + -- 检测一次灵兽技能 + SkillManager.CheckMonsterSkill(function() + --轮数变化后延时0.2秒用于初始化监听回合数被动的初始化 + BattleLogic.WaitForTrigger(0.2,function() + -- 进入新轮 + BattleLogic.CheckBattleLogic() + end) end) else - -- 切换阵营 - CurCamp = (CurCamp + 1) % 2 - BattleLogic.CheckBattleLogic() + + -- 检测一次灵兽技能 + SkillManager.CheckMonsterSkill(function() + --轮数变化后延时0.2秒用于初始化监听回合数被动的初始化 + BattleLogic.WaitForTrigger(0.2,function() + -- 切换阵营 + CurCamp = (CurCamp + 1) % 2 + BattleLogic.CheckBattleLogic() + end) + end) end - end --检测战斗逻辑 @@ -310,8 +321,8 @@ function BattleLogic.CheckBattleLogic() BattleLogic.BuffMgr:TurnUpdate(3) -- 计算持续伤害(流血) BattleLogic.BuffMgr:TurnUpdate(4) -- 计算其他buff BattleLogic.BuffMgr:PassUpdate() -- 计算buff轮数 - SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束 - BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动 + SkillRole.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 行动结束 + BattleLogic.Event:DispatchEvent(BattleEventName.RoleTurnEnd, SkillRole) -- 开始行动 BattleLogic.TurnRoundNextFrame() end) end diff --git a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua index ad4d6bb44e..2765fe702d 100644 --- a/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Battle/Logic/SkillManager.lua @@ -74,6 +74,10 @@ function this.CheckTurnRound() if this.MonsterSkillList and #this.MonsterSkillList > 0 then return end + -- 检测一次灵兽技能 + this.CheckMonsterSkill(this.MonsterCheckFunc) + + -- if this.DeadSkillList and #this.DeadSkillList > 0 then return end @@ -89,6 +93,17 @@ function this.CheckTurnRound() end end +-- 检测是否需要等待灵兽技能 +function this.CheckMonsterSkill(func) + this.MonsterCheckFunc = func + if not this.MonsterSkillList or #this.MonsterSkillList == 0 then + if this.MonsterCheckFunc then + this.MonsterCheckFunc() + end + this.MonsterCheckFunc = nil + end +end + -- function this.Update() -- 如果正在引导战斗 @@ -169,7 +184,6 @@ function this.Clear() for _, skill in ipairs(this.SkillList) do skill:Dispose() skillPool:Put(skill) - end this.MonsterSkillList = {} this.DeadSkillList = {}