引导战斗添加

gaoxin 2020-09-08 11:58:34 +08:00
parent f451ac76f5
commit b65581fe71
7 changed files with 89 additions and 14 deletions

View File

@ -643,7 +643,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224208791220860236}
m_RootOrder: 2
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
@ -1059,7 +1059,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224208791220860236}
m_RootOrder: 3
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
@ -1210,9 +1210,9 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 224207229500578536}
- {fileID: 224668597310509170}
- {fileID: 224220640790156676}
- {fileID: 224709729234618838}
- {fileID: 224668597310509170}
- {fileID: 224067770939544360}
- {fileID: 224348206395964596}
- {fileID: 224518222973870546}
@ -1433,7 +1433,7 @@ RectTransform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 224208791220860236}
m_RootOrder: 1
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}

View File

@ -687,4 +687,13 @@ function this.GetBattleBg(fightType)
return "r_zhandou_changjing_"..tostring(index)
end
-- 引导战斗暂停控制
this.isGuidePause = false
function this.IsGuidePause()
return this.isGuidePause
end
function this.SetGuidePause(isPause)
this.isGuidePause = isPause
end
return this

View File

@ -43,6 +43,7 @@ function this.SetTurnRoundFunc(func)
this.TurnRoundFunc = func
end
function this.CheckTurnRound()
-- 如果正在释放技能
if this.IsSkilling then
return
end
@ -60,6 +61,10 @@ end
--
function this.Update()
-- 如果正在引导战斗
if BattleManager and BattleManager.IsGuidePause() then
return
end
--
if this.IsSkilling then
return

View File

@ -322,6 +322,7 @@ function this.InitBattleEvent()
BattleLogic.Event:AddEvent(BattleEventName.BattleEnd, this.EndBattle)
BattleLogic.Event:AddEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
end
-- 清除战斗数据
@ -332,6 +333,7 @@ function this.ClearBattleEvent()
BattleLogic.Event:RemoveEvent(BattleEventName.BattleEnd, this.EndBattle)
BattleLogic.Event:RemoveEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
end
--敌军出现的表现
@ -410,12 +412,19 @@ function this.EnemyAppear()
end
end
-- 角色轮转回调(不出手的位置不会回调)
function this.RoleTurnChange(role)
-- 回调UI层
if this.root.RoleTurnChange then
this.root.RoleTurnChange(role)
end
end
-- 回合变化
function this.BattleRoundChange(Round)
-- 回调UI层
this.root.OnRoundChanged(Round)
-- 异妖CD
if this.DiffMonsterFlag then
local slider = BattleLogic.GetTeamSkillCastSlider(0)
@ -636,6 +645,11 @@ function this.GuideCheckEnemyDead(role)
end
function this.OnUpdate()
-- 引导战斗暂停
if BattleManager.IsGuidePause() then
return
end
-- 判断是否结束
if BattleLogic.IsEnd then
-- 所有角色血条
for r, v in pairs(tbRoleDispose) do

View File

@ -165,22 +165,61 @@ function this.ShowBattleResult(result, msg)
end
end
-- 战斗波次变化回调
function this.OnOrderChanged(order)
-- body
--显示波次
this.orderText.text = string.format("%d/%d", order, BattleLogic.TotalOrder)
end
-- 战斗回合变化回调
this.curRound = 1
function this.OnRoundChanged(round)
-- body
-- 轮数变化
this.curRound = round
--显示波次
local curRound, maxRound = BattleLogic.GetCurRound()
this.roundText.text = string.format(Language[10252], curRound, maxRound)
end
-- 引导节点配置
local _GuideConfig = {
-- 轮数 = {阵营 = { 释放位置 = 对话id}}}
[1] = {
[0] = {
[1] = 300008,
[4] = 300010,
}
},
[2] = {
[0] = {
[1] = 300012,
[2] = 300014,
[3] = 300016,
}
}
}
-- 角色轮转回调
function this.RoleTurnChange(role)
local curCamp = role.camp
local curPos = role.position
if not _GuideConfig[this.curRound] then
return
end
if not _GuideConfig[this.curRound][curCamp] then
return
end
if not _GuideConfig[this.curRound][curCamp][curPos] then
return
end
BattleManager.SetGuidePause(true)
StoryManager.EventTrigger(_GuideConfig[this.curRound][curCamp][curPos], function()
BattleManager.SetGuidePause(false)
end)
end
-- 由BattleView驱动
function this.OnUpdate()

View File

@ -142,7 +142,13 @@ function this.RefreshPanel(eventId, isFirstOpen)
this.mask:SetActive(showMask)
-- 设置对话背景图
this.Bg.sprite = Util.LoadSprite(chapterEventPointData[eventId].DialogueBg)
local bgName = chapterEventPointData[eventId].DialogueBg
if not bgName or bgName == "" then
this.Bg.gameObject:SetActive(false)
else
this.Bg.gameObject:SetActive(true)
this.Bg.sprite = Util.LoadSprite(chapterEventPointData[eventId].DialogueBg)
end
StoryDialoguePanel:SetScenceEffect(eventId)
-- 跳转值

View File

@ -47,9 +47,9 @@ function this.EventTrigger(eventId, callBack)
elseif showType == 12 then -- 选择界面
UIManager.OpenPanel(UIName.StoryDialoguePanel, eventId, false)
--UIManager.OpenPanel(UIName.StoryOptionPopup, eventId)
elseif showType == 10 then -- 起名字界面
elseif showType == 10 then -- 起名字界面
UIManager.OpenPanel(UIName.CreateNamePopup, showType, eventId, showValues, options)
elseif showType == 14 then -- 引导战斗
elseif showType == 14 then -- 引导战斗
local fb = ConfigManager.GetConfigData(ConfigName.FakeBattle, 1004)
local testFightData = {
fightData = loadstring("return "..fb.FightData)(),
@ -58,7 +58,11 @@ function this.EventTrigger(eventId, callBack)
maxRound = 20
}
UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
StoryManager.EventTrigger(300017, callBack)
StoryManager.EventTrigger(300017, function ()
PatFaceManager.isLogin = true
UIManager.OpenPanel(UIName.FightPointPassMainPanel)
LoadingPanel.End()
end)
end)
end
else
@ -91,8 +95,6 @@ end
-- 剧情跳转
function this.StoryJumpType(optionId, panel)
local jumpType = chapterOptionData[optionId].JumpType
if jumpType then
if jumpType == 4 then -- 关闭所有界面,结束对话
if panel then