回合数变化以后,添加延时操作,用于一些监听回合变化消息的被动首先执行
parent
85dbe2d053
commit
81c39c7422
|
|
@ -197,18 +197,25 @@ function BattleLogic.TurnRound(debugTurn)
|
||||||
)
|
)
|
||||||
-- 轮数变化
|
-- 轮数变化
|
||||||
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound)
|
BattleLogic.Event:DispatchEvent(BattleEventName.BattleRoundChange, CurRound)
|
||||||
|
--轮数变化后延时0.2秒用于初始化监听回合数被动的初始化
|
||||||
|
BattleLogic.WaitForTrigger(0.2,function()
|
||||||
|
BattleLogic.CheckBattleLogic()
|
||||||
|
end)
|
||||||
else
|
else
|
||||||
-- 切换阵营
|
-- 切换阵营
|
||||||
CurCamp = (CurCamp + 1) % 2
|
CurCamp = (CurCamp + 1) % 2
|
||||||
|
BattleLogic.CheckBattleLogic()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
--检测战斗逻辑
|
||||||
|
function BattleLogic.CheckBattleLogic()
|
||||||
-- 这里再检测一次战斗结束
|
-- 这里再检测一次战斗结束
|
||||||
if CurRound > MaxRound then
|
if CurRound > MaxRound then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
BattleLogManager.Log(
|
||||||
--
|
|
||||||
BattleLogManager.Log(
|
|
||||||
"Camp Change",
|
"Camp Change",
|
||||||
"camp", CurCamp
|
"camp", CurCamp
|
||||||
)
|
)
|
||||||
|
|
@ -277,7 +284,6 @@ function BattleLogic.TurnRound(debugTurn)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function BattleLogic.WaitForTrigger(delayTime, action)
|
function BattleLogic.WaitForTrigger(delayTime, action)
|
||||||
delayTime = BattleUtil.ErrorCorrection(delayTime)
|
delayTime = BattleUtil.ErrorCorrection(delayTime)
|
||||||
local delayFrame = floor(delayTime * BattleLogic.GameFrameRate + 0.5)
|
local delayFrame = floor(delayTime * BattleLogic.GameFrameRate + 0.5)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue