local GuideBattleLogic = {} -- 引导节点配置 local _GuideConfig = { -- 轮数 = {阵营 = { 释放位置 = 对话id}}} 新手引导假战斗 [BattleGuideType.FakeBattle] = { [1] = { [0] = { [1] = 300008, [4] = 300010, } }, [2] = { [0] = { [1] = 300012, [2] = 300014, [3] = 300016, } } }, [BattleGuideType.QuickFight] = { -- 轮数 = {阵营 = { 释放位置 = 引导id}}} [1] = { [0] = { [1] = 200000, } }, } } function GuideBattleLogic:Init(guideType) self.guideType = guideType end function GuideBattleLogic:RoleTurnChange(curRound, role) local curCamp = role.camp local curPos = role.position local _config = _GuideConfig[self.guideType] if not _config or not _config[curRound] or not _config[curRound][curCamp] or not _config[curRound][curCamp][curPos] then return end -- 对话形式的引导 if self.guideType == BattleGuideType.FakeBattle then BattleManager.SetGuidePause(true) local storyId = _config[curRound][curCamp][curPos] StoryManager.EventTrigger(storyId, function() BattleManager.SetGuidePause(false) end) -- 引导形式的引导 elseif self.guideType == BattleGuideType.QuickFight then BattleManager.SetGuidePause(true) local guideId = _config[curRound][curCamp][curPos] GuideManager.ShowGuide(guideId) local function _onGuideDone() Game.GlobalEvent:RemoveEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone) BattleManager.SetGuidePause(false) end Game.GlobalEvent:AddEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone) end end return GuideBattleLogic