【引导战斗】添加第N回合开始时触发剧情
parent
f7a1ddbc94
commit
9c50acee09
|
@ -79,6 +79,33 @@ function GuideBattleLogic:OnBattleStart(func)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function GuideBattleLogic:OnRoundChanged(round)
|
||||||
|
-- 没有就不引导了
|
||||||
|
if not self.configList or #self.configList <= 0 then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local _config = nil
|
||||||
|
for _, con in ipairs(self.configList) do
|
||||||
|
if con.Round == -3 and con.Camp == round then -- 战中第n回合触发
|
||||||
|
_config = con
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not _config then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
-- 对话形式的引导
|
||||||
|
if _config.TriggerType == 1 then
|
||||||
|
BattleManager.SetGuidePause(true)
|
||||||
|
local storyId = _config.TriggerId
|
||||||
|
StoryManager.EventTrigger(storyId, function()
|
||||||
|
BattleManager.SetGuidePause(false)
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- 战斗结束
|
||||||
function GuideBattleLogic:OnBattleEnd(func)
|
function GuideBattleLogic:OnBattleEnd(func)
|
||||||
-- 没有就不引导了
|
-- 没有就不引导了
|
||||||
if not self.configList or #self.configList <= 0 then
|
if not self.configList or #self.configList <= 0 then
|
||||||
|
|
|
@ -183,6 +183,8 @@ function this.OnRoundChanged(round)
|
||||||
local curRound, maxRound = BattleLogic.GetCurRound()
|
local curRound, maxRound = BattleLogic.GetCurRound()
|
||||||
this.roundText.text = string.format(Language[10211], curRound, maxRound)
|
this.roundText.text = string.format(Language[10211], curRound, maxRound)
|
||||||
|
|
||||||
|
--显示波次
|
||||||
|
GuideBattleLogic:OnRoundChanged(round)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 角色轮转回调
|
-- 角色轮转回调
|
||||||
|
|
Loading…
Reference in New Issue