【新假战斗】

dev_chengFeng
gaoxin 2021-11-10 09:48:42 +08:00
parent 52475ee00b
commit c9e2ddcaf8
3 changed files with 48 additions and 56 deletions

View File

@ -233,6 +233,7 @@ ConfigName = {
RidingSwardResult = "RidingSwardResult",
RidingSwardSence = "RidingSwardSence",
WeekcardConfig = "WeekcardConfig",
GuideBattleConfig = "GuideBattleConfig",
}
require "Framework/GameDataBase"

View File

@ -1,66 +1,39 @@
local GuideBattleLogic = {}
-- 引导节点配置
local _GuideConfig = {
-- 轮数 = {阵营 = { 释放位置 = 对话id}}} 新手引导假战斗
[BattleGuideType.FakeBattle] = {
[-1] = {
-- [0] = {}, -- 战斗开始时
[1] = 300012, -- 战斗结束时
},
[1] = {
[0] = {
[2] = 300008,
[3] = 300010,
},
[1] = {
[1] = 300001,
},
},
-- [2] = {
-- [0] = {
-- [1] = 300001,
-- [2] = 300014,
-- [3] = 300016,
-- }
-- }
},
[BattleGuideType.QuickFight] = {
-- 轮数 = {阵营 = { 释放位置 = 引导id}}}
[1] = {
[0] = {
[1] = 200000,
}
},
}
}
function GuideBattleLogic:Init(guideType)
self.guideType = guideType
self.configList = ConfigManager.GetAllConfigsDataByKey(ConfigName.GuideBattleConfig, "GuideGroup", self.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
-- 没有就不引导了
if not self.configList or #self.configList <= 0 then
return
end
local _config = nil
for _, con in ipairs(self.configList) do
if con.Round == curRound and con.Camp == curCamp and con.Turn == curPos then
_config = con
break
end
end
if not _config then
return
end
-- 对话形式的引导
if self.guideType == BattleGuideType.FakeBattle then
if _config.TriggerType == 1 then
BattleManager.SetGuidePause(true)
local storyId = _config[curRound][curCamp][curPos]
local storyId = _config.TriggerId
StoryManager.EventTrigger(storyId, function()
BattleManager.SetGuidePause(false)
end)
-- 引导形式的引导
elseif self.guideType == BattleGuideType.QuickFight then
elseif _config.TriggerType == 2 then
BattleManager.SetGuidePause(true)
local guideId = _config[curRound][curCamp][curPos]
local guideId = _config.TriggerId
GuideManager.ShowGuide(guideId)
local function _onGuideDone()
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone)
@ -71,16 +44,30 @@ function GuideBattleLogic:RoleTurnChange(curRound, role)
end
function GuideBattleLogic:OnBattleEnd(func)
local _config = _GuideConfig[self.guideType]
if not _config
or not _config[-1]
or not _config[-1][1] then
return
-- 没有就不引导了
if not self.configList or #self.configList <= 0 then
if func then
func()
end
return
end
local _config = nil
for _, con in ipairs(self.configList) do
if con.Round == -1 then
_config = con
break
end
end
if not _config then
if func then
func()
end
return
end
-- 对话形式的引导
if self.guideType == BattleGuideType.FakeBattle then
if _config.TriggerType == 1 then
BattleManager.SetGuidePause(true)
local storyId = _config[-1][1]
local storyId = _config.TriggerId
StoryManager.EventTrigger(storyId, function()
BattleManager.SetGuidePause(false)
if func then

View File

@ -51,7 +51,7 @@ function this.EventTrigger(eventId, callBack)
elseif showType == 10 then -- 起名字界面
UIManager.OpenPanel(UIName.CreateNamePopup, showType, eventId, showValues, options)
elseif showType == 14 then -- 引导战斗
local fdata, fseed = BattleManager.GetFakeBattleData(1017)
local fdata, fseed = BattleManager.GetFakeBattleData(options[1])
local testFightData = {
fightData = fdata,
fightSeed = fseed,
@ -59,14 +59,14 @@ function this.EventTrigger(eventId, callBack)
maxRound = 20
}
local panel = UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
StoryManager.EventTrigger(100004)
end, BattleGuideType.FakeBattle)
StoryManager.StoryJumpType(options[3])
end, options[2])
elseif showType == 15 then -- 播放转场特效
SwitchPanel.PlayTransEffect(function()
this.StoryJumpType(options[1])
this.StoryJumpType(options[1], nil, callBack)
end)
end
else
@ -97,7 +97,7 @@ function this.DialogueTrigger(eventId, callback)
end
-- 剧情跳转
function this.StoryJumpType(optionId, panel,callBack)
function this.StoryJumpType(optionId, panel, callBack)
local jumpType = chapterOptionData[optionId].JumpType
if jumpType then
if jumpType == 4 then -- 关闭所有界面,结束对话
@ -107,6 +107,10 @@ function this.StoryJumpType(optionId, panel,callBack)
if UIManager.IsOpen(UIName.StoryDialoguePanel) then
UIManager.ClosePanel(UIName.StoryDialoguePanel)
end
--
if callBack then
callBack()
end
elseif jumpType == 5 then
-- 打开主城
PatFaceManager.isLogin = true