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",
|
||||
RidingSwardSence = "RidingSwardSence",
|
||||
WeekcardConfig = "WeekcardConfig",
|
||||
GuideBattleConfig = "GuideBattleConfig",
|
||||
}
|
||||
|
||||
require "Framework/GameDataBase"
|
||||
|
@ -323,6 +324,16 @@ function ConfigManager.TryGetConfigDataByThreeKey(cfgType, key1, value1, key2, v
|
|||
return configData
|
||||
end
|
||||
---获取某个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)
|
||||
local expectList = {}
|
||||
for _, configInfo in ConfigPairs(ConfigManager.GetConfig(cfgType)) do
|
||||
|
|
|
@ -652,28 +652,48 @@ end
|
|||
-- 从monsterGroup中获取灵兽数据
|
||||
function this.GetMonsterDataFromGroup(gId, camp)
|
||||
local list = {}
|
||||
-- 灵兽
|
||||
local Monsters = MonsterGroup[gId].Animal
|
||||
if not Monsters then
|
||||
return list
|
||||
end
|
||||
for i = 1, #Monsters do
|
||||
local monster = Monsters[i]
|
||||
local id = monster[1]
|
||||
local star = monster[2]
|
||||
local level = monster[3]
|
||||
if Monsters then
|
||||
for i = 1, #Monsters do
|
||||
local monster = Monsters[i]
|
||||
local id = monster[1]
|
||||
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 = {
|
||||
unitId = id,
|
||||
position = i,
|
||||
star = star,
|
||||
playerSex = 0,
|
||||
forceScore = 0
|
||||
unitId = 20100,
|
||||
position = 100,
|
||||
star = 1,
|
||||
playerSex = NameManager.roleSex,
|
||||
forceScore = 0,
|
||||
property = {}
|
||||
}
|
||||
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)
|
||||
for _, id in ipairs(RoleSkills) do
|
||||
if not mUnit.unitSkillIds then
|
||||
mUnit.unitSkillIds = id
|
||||
else
|
||||
mUnit.unitSkillIds = mUnit.unitSkillIds .. "#" .. id
|
||||
end
|
||||
end
|
||||
list[#list+1] = this.PokemonUnitAdapter(mUnit, camp)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
|
|
@ -413,6 +413,7 @@ function this.InitBattleEvent()
|
|||
BattleLogic.Event:AddEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
||||
BattleLogic.Event:AddEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
||||
BattleLogic.Event:AddEvent(BattleEventName.BattleStart, this.OnBattleStart)
|
||||
|
||||
end
|
||||
-- 清除战斗数据
|
||||
|
@ -426,6 +427,7 @@ function this.ClearBattleEvent()
|
|||
BattleLogic.Event:RemoveEvent(BattleEventName.BattleOrderChange, this.BattleOrderChange)
|
||||
BattleLogic.Event:RemoveEvent(BattleEventName.BattleRoundChange, this.BattleRoundChange)
|
||||
BattleLogic.Event:RemoveEvent(BattleEventName.RoleTurnStart, this.RoleTurnChange)
|
||||
BattleLogic.Event:RemoveEvent(BattleEventName.BattleStart, this.OnBattleStart)
|
||||
end
|
||||
|
||||
--敌军出现的表现
|
||||
|
@ -489,6 +491,14 @@ function this.EnemyAppear(isStart)
|
|||
end
|
||||
end
|
||||
|
||||
-- 战斗开始回调
|
||||
function this.OnBattleStart()
|
||||
-- 回调UI层
|
||||
if this.root.OnBattleStart then
|
||||
this.root.OnBattleStart()
|
||||
end
|
||||
end
|
||||
|
||||
-- 角色轮转回调(不出手的位置不会回调)
|
||||
function this.RoleTurnChange(role)
|
||||
-- 回调UI层
|
||||
|
|
|
@ -1,66 +1,42 @@
|
|||
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)
|
||||
if not guideType then
|
||||
return
|
||||
end
|
||||
self.guideType = guideType
|
||||
self.configList = ConfigManager.TryGetAllConfigsDataByKey(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)
|
||||
|
@ -70,17 +46,64 @@ function GuideBattleLogic:RoleTurnChange(curRound, role)
|
|||
end
|
||||
end
|
||||
|
||||
function GuideBattleLogic:OnBattleEnd(func)
|
||||
local _config = _GuideConfig[self.guideType]
|
||||
if not _config
|
||||
or not _config[-1]
|
||||
or not _config[-1][1] then
|
||||
return
|
||||
function GuideBattleLogic:OnBattleStart(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 == -2 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
|
||||
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()
|
||||
BattleManager.SetGuidePause(false)
|
||||
if func then
|
||||
|
|
|
@ -86,7 +86,11 @@ function this:OnOpen(_fightData, _endFunc, guideType)
|
|||
endFunc = _endFunc
|
||||
|
||||
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.ButtonLock:SetActive(false)
|
||||
|
@ -159,6 +163,11 @@ function this.BattleEnd(result)
|
|||
end)
|
||||
end
|
||||
|
||||
function this.OnBattleStart(order)
|
||||
--显示波次
|
||||
GuideBattleLogic:OnBattleStart()
|
||||
end
|
||||
|
||||
|
||||
function this.OnOrderChanged(order)
|
||||
--显示波次
|
||||
|
|
|
@ -51,22 +51,22 @@ 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,
|
||||
fightType = 0,
|
||||
fightType = BATTLE_SERVER_TYPE.StoryFight,
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue