Merge branch 'china/dev' of http://60.1.1.230/gaoxin/JL_Client into china/dev
commit
908e068f23
|
@ -233,6 +233,7 @@ ConfigName = {
|
||||||
RidingSwardResult = "RidingSwardResult",
|
RidingSwardResult = "RidingSwardResult",
|
||||||
RidingSwardSence = "RidingSwardSence",
|
RidingSwardSence = "RidingSwardSence",
|
||||||
WeekcardConfig = "WeekcardConfig",
|
WeekcardConfig = "WeekcardConfig",
|
||||||
|
GuideBattleConfig = "GuideBattleConfig",
|
||||||
}
|
}
|
||||||
|
|
||||||
require "Framework/GameDataBase"
|
require "Framework/GameDataBase"
|
||||||
|
@ -323,6 +324,16 @@ function ConfigManager.TryGetConfigDataByThreeKey(cfgType, key1, value1, key2, v
|
||||||
return configData
|
return configData
|
||||||
end
|
end
|
||||||
---获取某个key值为value的所有条目
|
---获取某个key值为value的所有条目
|
||||||
|
function ConfigManager.TryGetAllConfigsDataByKey(cfgType, key, value)
|
||||||
|
local expectList = {}
|
||||||
|
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(cfgType)) do
|
||||||
|
if configInfo[key] == value then
|
||||||
|
table.insert(expectList, configInfo)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return expectList
|
||||||
|
end
|
||||||
|
---获取某个key值为value的所有条目
|
||||||
function ConfigManager.GetAllConfigsDataByKey(cfgType, key, value)
|
function ConfigManager.GetAllConfigsDataByKey(cfgType, key, value)
|
||||||
local expectList = {}
|
local expectList = {}
|
||||||
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(cfgType)) do
|
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(cfgType)) do
|
||||||
|
|
|
@ -652,28 +652,48 @@ end
|
||||||
-- 从monsterGroup中获取灵兽数据
|
-- 从monsterGroup中获取灵兽数据
|
||||||
function this.GetMonsterDataFromGroup(gId, camp)
|
function this.GetMonsterDataFromGroup(gId, camp)
|
||||||
local list = {}
|
local list = {}
|
||||||
|
-- 灵兽
|
||||||
local Monsters = MonsterGroup[gId].Animal
|
local Monsters = MonsterGroup[gId].Animal
|
||||||
if not Monsters then
|
if Monsters then
|
||||||
return list
|
for i = 1, #Monsters do
|
||||||
end
|
local monster = Monsters[i]
|
||||||
for i = 1, #Monsters do
|
local id = monster[1]
|
||||||
local monster = Monsters[i]
|
local star = monster[2]
|
||||||
local id = monster[1]
|
local level = monster[3]
|
||||||
local star = monster[2]
|
|
||||||
local level = monster[3]
|
|
||||||
|
|
||||||
|
local mUnit = {
|
||||||
|
unitId = id,
|
||||||
|
position = i,
|
||||||
|
star = star,
|
||||||
|
playerSex = 0,
|
||||||
|
forceScore = 0
|
||||||
|
}
|
||||||
|
local pros = this.GetMonsterPros(id, level, star)
|
||||||
|
mUnit.property = pros
|
||||||
|
local mSkill = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalSkill, "SpiritAnimalMatch", id, "StarMatch", star)
|
||||||
|
mUnit.unitSkillIds = mSkill.Id
|
||||||
|
list[i] = this.PokemonUnitAdapter(mUnit, camp)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- 主角
|
||||||
|
local RoleSkills = MonsterGroup[gId].Role
|
||||||
|
if RoleSkills and #RoleSkills > 0 then
|
||||||
local mUnit = {
|
local mUnit = {
|
||||||
unitId = id,
|
unitId = 20100,
|
||||||
position = i,
|
position = 100,
|
||||||
star = star,
|
star = 1,
|
||||||
playerSex = 0,
|
playerSex = NameManager.roleSex,
|
||||||
forceScore = 0
|
forceScore = 0,
|
||||||
|
property = {}
|
||||||
}
|
}
|
||||||
local pros = this.GetMonsterPros(id, level, star)
|
for _, id in ipairs(RoleSkills) do
|
||||||
mUnit.property = pros
|
if not mUnit.unitSkillIds then
|
||||||
local mSkill = ConfigManager.GetConfigDataByDoubleKey(ConfigName.SpiritAnimalSkill, "SpiritAnimalMatch", id, "StarMatch", star)
|
mUnit.unitSkillIds = id
|
||||||
mUnit.unitSkillIds = mSkill.Id
|
else
|
||||||
list[i] = this.PokemonUnitAdapter(mUnit, camp)
|
mUnit.unitSkillIds = mUnit.unitSkillIds .. "#" .. id
|
||||||
|
end
|
||||||
|
end
|
||||||
|
list[#list+1] = this.PokemonUnitAdapter(mUnit, camp)
|
||||||
end
|
end
|
||||||
return list
|
return list
|
||||||
end
|
end
|
||||||
|
|
|
@ -413,6 +413,7 @@ function this.InitBattleEvent()
|
||||||
BattleLogic.Event:AddEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
BattleLogic.Event:AddEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
||||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
||||||
BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
||||||
|
BattleLogic.Event:AddEvent(BattleEventName.BattleStart, this.OnBattleStart)
|
||||||
|
|
||||||
end
|
end
|
||||||
-- 清除战斗数据
|
-- 清除战斗数据
|
||||||
|
@ -426,6 +427,7 @@ function this.ClearBattleEvent()
|
||||||
BattleLogic.Event:RemoveEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
BattleLogic.Event:RemoveEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
||||||
BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
||||||
BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
||||||
|
BattleLogic.Event:RemoveEvent(BattleEventName.BattleStart, this.OnBattleStart)
|
||||||
end
|
end
|
||||||
|
|
||||||
--敌军出现的表现
|
--敌军出现的表现
|
||||||
|
@ -489,6 +491,14 @@ function this.EnemyAppear(isStart)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- 战斗开始回调
|
||||||
|
function this.OnBattleStart()
|
||||||
|
-- 回调UI层
|
||||||
|
if this.root.OnBattleStart then
|
||||||
|
this.root.OnBattleStart()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
-- 角色轮转回调(不出手的位置不会回调)
|
-- 角色轮转回调(不出手的位置不会回调)
|
||||||
function this.RoleTurnChange(role)
|
function this.RoleTurnChange(role)
|
||||||
-- 回调UI层
|
-- 回调UI层
|
||||||
|
|
|
@ -1,66 +1,42 @@
|
||||||
local GuideBattleLogic = {}
|
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)
|
function GuideBattleLogic:Init(guideType)
|
||||||
|
if not guideType then
|
||||||
|
return
|
||||||
|
end
|
||||||
self.guideType = guideType
|
self.guideType = guideType
|
||||||
|
self.configList = ConfigManager.TryGetAllConfigsDataByKey(ConfigName.GuideBattleConfig, "GuideGroup", self.guideType)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
function GuideBattleLogic:RoleTurnChange(curRound, role)
|
function GuideBattleLogic:RoleTurnChange(curRound, role)
|
||||||
local curCamp = role.camp
|
local curCamp = role.camp
|
||||||
local curPos = role.position
|
local curPos = role.position
|
||||||
local _config = _GuideConfig[self.guideType]
|
-- 没有就不引导了
|
||||||
if not _config
|
if not self.configList or #self.configList <= 0 then
|
||||||
or not _config[curRound]
|
return
|
||||||
or not _config[curRound][curCamp]
|
end
|
||||||
or not _config[curRound][curCamp][curPos]
|
local _config = nil
|
||||||
then
|
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
|
return
|
||||||
end
|
end
|
||||||
-- 对话形式的引导
|
-- 对话形式的引导
|
||||||
if self.guideType == BattleGuideType.FakeBattle then
|
if _config.TriggerType == 1 then
|
||||||
BattleManager.SetGuidePause(true)
|
BattleManager.SetGuidePause(true)
|
||||||
local storyId = _config[curRound][curCamp][curPos]
|
local storyId = _config.TriggerId
|
||||||
StoryManager.EventTrigger(storyId, function()
|
StoryManager.EventTrigger(storyId, function()
|
||||||
BattleManager.SetGuidePause(false)
|
BattleManager.SetGuidePause(false)
|
||||||
end)
|
end)
|
||||||
-- 引导形式的引导
|
-- 引导形式的引导
|
||||||
elseif self.guideType == BattleGuideType.QuickFight then
|
elseif _config.TriggerType == 2 then
|
||||||
BattleManager.SetGuidePause(true)
|
BattleManager.SetGuidePause(true)
|
||||||
local guideId = _config[curRound][curCamp][curPos]
|
local guideId = _config.TriggerId
|
||||||
GuideManager.ShowGuide(guideId)
|
GuideManager.ShowGuide(guideId)
|
||||||
local function _onGuideDone()
|
local function _onGuideDone()
|
||||||
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone)
|
Game.GlobalEvent:RemoveEvent(GameEvent.Guide.BattleGuideDone, _onGuideDone)
|
||||||
|
@ -70,17 +46,64 @@ function GuideBattleLogic:RoleTurnChange(curRound, role)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function GuideBattleLogic:OnBattleEnd(func)
|
function GuideBattleLogic:OnBattleStart(func)
|
||||||
local _config = _GuideConfig[self.guideType]
|
-- 没有就不引导了
|
||||||
if not _config
|
if not self.configList or #self.configList <= 0 then
|
||||||
or not _config[-1]
|
if func then
|
||||||
or not _config[-1][1] then
|
func()
|
||||||
return
|
end
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local _config = nil
|
||||||
|
for _, con in ipairs(self.configList) do
|
||||||
|
if con.Round == -2 then -- 战前
|
||||||
|
_config = con
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
if not _config then
|
||||||
|
if func then
|
||||||
|
func()
|
||||||
|
end
|
||||||
|
return
|
||||||
end
|
end
|
||||||
-- 对话形式的引导
|
-- 对话形式的引导
|
||||||
if self.guideType == BattleGuideType.FakeBattle then
|
if _config.TriggerType == 1 then
|
||||||
BattleManager.SetGuidePause(true)
|
BattleManager.SetGuidePause(true)
|
||||||
local storyId = _config[-1][1]
|
local storyId = _config.TriggerId
|
||||||
|
StoryManager.EventTrigger(storyId, function()
|
||||||
|
BattleManager.SetGuidePause(false)
|
||||||
|
if func then
|
||||||
|
func()
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
function GuideBattleLogic:OnBattleEnd(func)
|
||||||
|
-- 没有就不引导了
|
||||||
|
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 _config.TriggerType == 1 then
|
||||||
|
BattleManager.SetGuidePause(true)
|
||||||
|
local storyId = _config.TriggerId
|
||||||
StoryManager.EventTrigger(storyId, function()
|
StoryManager.EventTrigger(storyId, function()
|
||||||
BattleManager.SetGuidePause(false)
|
BattleManager.SetGuidePause(false)
|
||||||
if func then
|
if func then
|
||||||
|
|
|
@ -86,7 +86,11 @@ function this:OnOpen(_fightData, _endFunc, guideType)
|
||||||
endFunc = _endFunc
|
endFunc = _endFunc
|
||||||
|
|
||||||
fightType = BATTLE_TYPE.Test --判定战斗类型
|
fightType = BATTLE_TYPE.Test --判定战斗类型
|
||||||
this.BG:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_zhandou_changjing_1005")
|
if guideType == 1 then
|
||||||
|
this.BG:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_zhandou_changjing_1005")
|
||||||
|
else
|
||||||
|
this.BG:GetComponent("Image").sprite = this.spLoader:LoadSprite("r_zhandou_changjing_2")
|
||||||
|
end
|
||||||
|
|
||||||
this.BtnGM:SetActive(true)
|
this.BtnGM:SetActive(true)
|
||||||
this.ButtonLock:SetActive(false)
|
this.ButtonLock:SetActive(false)
|
||||||
|
@ -159,6 +163,11 @@ function this.BattleEnd(result)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function this.OnBattleStart(order)
|
||||||
|
--显示波次
|
||||||
|
GuideBattleLogic:OnBattleStart()
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
function this.OnOrderChanged(order)
|
function this.OnOrderChanged(order)
|
||||||
--显示波次
|
--显示波次
|
||||||
|
|
|
@ -51,22 +51,22 @@ function this.EventTrigger(eventId, callBack)
|
||||||
elseif showType == 10 then -- 起名字界面
|
elseif showType == 10 then -- 起名字界面
|
||||||
UIManager.OpenPanel(UIName.CreateNamePopup, showType, eventId, showValues, options)
|
UIManager.OpenPanel(UIName.CreateNamePopup, showType, eventId, showValues, options)
|
||||||
elseif showType == 14 then -- 引导战斗
|
elseif showType == 14 then -- 引导战斗
|
||||||
local fdata, fseed = BattleManager.GetFakeBattleData(1017)
|
local fdata, fseed = BattleManager.GetFakeBattleData(options[1])
|
||||||
local testFightData = {
|
local testFightData = {
|
||||||
fightData = fdata,
|
fightData = fdata,
|
||||||
fightSeed = fseed,
|
fightSeed = fseed,
|
||||||
fightType = 0,
|
fightType = BATTLE_SERVER_TYPE.StoryFight,
|
||||||
maxRound = 20
|
maxRound = 20
|
||||||
}
|
}
|
||||||
local panel = UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
|
local panel = UIManager.OpenPanel(UIName.GuideBattlePanel, testFightData, function()
|
||||||
StoryManager.EventTrigger(100004)
|
StoryManager.StoryJumpType(options[3])
|
||||||
end, BattleGuideType.FakeBattle)
|
end, options[2])
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
elseif showType == 15 then -- 播放转场特效
|
elseif showType == 15 then -- 播放转场特效
|
||||||
SwitchPanel.PlayTransEffect(function()
|
SwitchPanel.PlayTransEffect(function()
|
||||||
this.StoryJumpType(options[1])
|
this.StoryJumpType(options[1], nil, callBack)
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -97,7 +97,7 @@ function this.DialogueTrigger(eventId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
-- 剧情跳转
|
-- 剧情跳转
|
||||||
function this.StoryJumpType(optionId, panel,callBack)
|
function this.StoryJumpType(optionId, panel, callBack)
|
||||||
local jumpType = chapterOptionData[optionId].JumpType
|
local jumpType = chapterOptionData[optionId].JumpType
|
||||||
if jumpType then
|
if jumpType then
|
||||||
if jumpType == 4 then -- 关闭所有界面,结束对话
|
if jumpType == 4 then -- 关闭所有界面,结束对话
|
||||||
|
@ -107,6 +107,10 @@ function this.StoryJumpType(optionId, panel,callBack)
|
||||||
if UIManager.IsOpen(UIName.StoryDialoguePanel) then
|
if UIManager.IsOpen(UIName.StoryDialoguePanel) then
|
||||||
UIManager.ClosePanel(UIName.StoryDialoguePanel)
|
UIManager.ClosePanel(UIName.StoryDialoguePanel)
|
||||||
end
|
end
|
||||||
|
--
|
||||||
|
if callBack then
|
||||||
|
callBack()
|
||||||
|
end
|
||||||
elseif jumpType == 5 then
|
elseif jumpType == 5 then
|
||||||
-- 打开主城
|
-- 打开主城
|
||||||
PatFaceManager.isLogin = true
|
PatFaceManager.isLogin = true
|
||||||
|
|
Loading…
Reference in New Issue