【引导战斗】添加第N回合开始时触发剧情

dev_chengFeng
gaoxin 2021-11-15 16:46:41 +08:00
parent f7a1ddbc94
commit 9c50acee09
2 changed files with 29 additions and 0 deletions

View File

@ -79,6 +79,33 @@ function GuideBattleLogic:OnBattleStart(func)
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)
-- 没有就不引导了
if not self.configList or #self.configList <= 0 then

View File

@ -183,6 +183,8 @@ function this.OnRoundChanged(round)
local curRound, maxRound = BattleLogic.GetCurRound()
this.roundText.text = string.format(Language[10211], curRound, maxRound)
--显示波次
GuideBattleLogic:OnRoundChanged(round)
end
-- 角色轮转回调