diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 092b0f9706..1fcc45a11b 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1090,6 +1090,7 @@ FORMATION_TYPE = { GUILD_DEATHPOS=19, XUANYUAN_MIRROR=20, GUILD_TRANSCRIPT=21, + FIGHTLEVEL=22, } --活动Type定义 @@ -2235,7 +2236,8 @@ BATTLE_TYPE = { XINJIANG = 16, --新将来袭 XIAOYAOYOU = 18, --逍遥游战斗 TASUILINGXIAO = 19, --踏碎凌霄 - FIGHTLEVEL = 20, --山河社稷图 + FIGHTLEVEL = 20, --山河社稷图主关卡 + FIGHT_ASSISTANT_LEVEL = 21, --山河社稷图副关卡战斗 BACK_BATTLE = 1000, -- 系统战斗回放 } rankKingList={ [1] = { bgImage = "r_zjm_paihangbang_banner04_zh", name = Language[12096] ,rankType = RANK_TYPE.FIGHT_LEVEL_RANK,activiteId = 0,isRankingMainPanelShow = true}, diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua index 460e3e3b6e..a54eb72596 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/FightLevelManager.lua @@ -109,13 +109,18 @@ end --开始战斗 local HardStageFightResponseMsg = {} function this.FightLevelFightBattle(_fightLevelData, callBack) - if _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel then - NetManager.HardStageFightRequest(_fightLevelData.nodeId, FormationTypeDef.FORMATION_NORMAL,function (msg)--FIGHT_LEVEL - local fightData = BattleManager.GetBattleServerData(msg,0) + NetManager.HardStageFightRequest(_fightLevelData.nodeId, FormationTypeDef.FIGHT_LEVEL,function (msg)--FIGHT_LEVEL + -- LogYellow("ssssssssssssssssssss 9") HardStageFightResponseMsg = msg - UIManager.OpenPanel(UIName.BattlePanel, fightData, BATTLE_TYPE.FIGHTLEVEL, callBack) - end) - end + if _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel or _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevel then + local fightData = BattleManager.GetBattleServerData(msg,0) + UIManager.OpenPanel(UIName.BattlePanel, fightData, _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.MainLevel and BATTLE_TYPE.FIGHTLEVEL or BATTLE_TYPE.FIGHT_ASSISTANT_LEVEL, callBack) + elseif _fightLevelData.config.StageType == FIGHTLEVEL_STAGETYPE.AssistantLevelReward then + UIManager.OpenPanel(UIName.RewardItemPopup,msg.drop,1,function() + --刷新数据刷新界面 + end) + end + end) end function this.GetHardStageFightResponseMsg() return HardStageFightResponseMsg diff --git a/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevel.lua b/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevel.lua index 313276370d..060378a637 100644 --- a/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevel.lua +++ b/Assets/ManagedResources/~Lua/Modules/FightLevel/View/FightLevelInfoPopup_MainLevel.lua @@ -6,7 +6,7 @@ local parent local sortingOrder=0 local fun local heroListGo = {} -local fightLevelData = 0 +local fightLevelData = {} local liveNodes = {} local liveNames = {} local condition = {} @@ -36,7 +36,7 @@ end function this:BindEvent() Util.AddClick(this.sureBtn, function() - FightLevelManager.FightLevelFightBattle(fightLevelData) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.FIGHTLEVEL,fightLevelData) end) Util.AddClick(this.backBtn, function() parent:ClosePanel() @@ -86,10 +86,7 @@ function this:ShoeCondition() noStarImage:SetActive(not FightLevelManager.GetCurLevelStarState(fightLevelData.state,i)) getStarImage:SetActive(FightLevelManager.GetCurLevelStarState(fightLevelData.state,i)) Util.GetGameObject(conditionGo[i], "Text"):GetComponent("Text").text = i - LogYellow("v "..v ) - local vIndex = tonumber(v) - Util.GetGameObject(conditionGo[i], "infolText"):GetComponent("Text").text = HardStageCondition[vIndex].Describe - LogYellow("HardStageCondition[v].Describe "..HardStageCondition[vIndex].Describe) + Util.GetGameObject(conditionGo[i], "infolText"):GetComponent("Text").text = HardStageCondition[v].Describe end end -- 编队数据匹配 diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua index 3a15654bab..f0a5679c8c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua +++ b/Assets/ManagedResources/~Lua/Modules/Formation/FormationPanelV2.lua @@ -59,6 +59,7 @@ this.PanelOptionView = { [FORMATION_TYPE.GUILD_DEATHPOS]="Modules/Formation/View/GuildDeathPosFormation", [FORMATION_TYPE.XUANYUAN_MIRROR]="Modules/Formation/View/XuanYuanMirrorFormation", [FORMATION_TYPE.GUILD_TRANSCRIPT]="Modules/Formation/View/GuildTranscriptFormation", + [FORMATION_TYPE.FIGHTLEVEL]="Modules/Formation/View/FightLevelFormation", } function this:InitComponent() orginLayer=0 diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua b/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua new file mode 100644 index 0000000000..149d816dd3 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua @@ -0,0 +1,72 @@ +----- 山河社稷图 ----- +local FightLevelFormation = {} +local this = FightLevelFormation +--- 是否需要切换编队的功能 +this.IsNeedChangeFormation = false +local hadClick = false +--local GetCurNodeInfo +this.nodeData = {} +--- 逻辑初始化 +function this.Init(root, _nodeData) + this.root = root + this.nodeData = _nodeData + this.InitView() +end +--- 获取需要显示的编队id +function this.GetFormationIndex() + --FormationManager.curFormationIndex = FormationTypeDef.FORMATION_NORMAL + return FormationTypeDef.FIGHT_LEVEL +end +--- btn1点击回调事件 + +function this.On_Btn1_Click() + this.root.SetOneKeyGoExpedition() +end + +function this.On_Btn2_Click() + if not hadClick then + hadClick = true + if this.root.order>=1 then + --保存编队 + FormationManager.RefreshFormation(this.root.curFormationIndex, this.root.choosedList, + FormationManager.formationList[this.root.curFormationIndex].teamPokemonInfos) + else + PopupTipPanel.ShowTip(string.format(Language[10699], 1)) + hadClick = false + return + end + -- 编队为空 + if #FormationManager.formationList[FormationTypeDef.FIGHT_LEVEL].teamHeroInfos == 0 then + PopupTipPanel.ShowTip(Language[10700]) + hadClick = false + return + end + this.StartFight() + end +end + +-- 初始化界面显示 +function this.InitView() + this.root.btn_1:SetActive(true) + this.root.btn_2:SetActive(true) + this.root.btn_1_lab.text = Language[10710] + this.root.btn_2_lab.text = Language[10706] + MapManager.isCarbonEnter = false + this.root.formTip:SetActive(true) + this.root.formTip:GetComponent("Text").text = Language[10717] ..20 .. Language[10718] + local costTip = this.root.costTip + costTip:SetActive(false) + hadClick = false + + this.root.UpView:OnOpen({ showType = UpViewOpenType.ShowLeft, panelType = PanelType.Main }) +end + + +-- 开始战斗 +function this.StartFight() + FightLevelManager.FightLevelFightBattle(this.nodeData,function() + this.root:ClosePanel() + end) +end + +return this \ No newline at end of file diff --git a/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua.meta b/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua.meta new file mode 100644 index 0000000000..bf3a44dca8 --- /dev/null +++ b/Assets/ManagedResources/~Lua/Modules/Formation/View/FightLevelFormation.lua.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 4d02fe74dfd496148944ac16133e6a45 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua index c57bfc1425..d41cf2038c 100644 --- a/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Net/NetManager.lua @@ -5006,6 +5006,36 @@ function NetManager.HardStageRequest(func) end end) end +--山河社稷图领取宝箱奖励 +function NetManager.GetHardStageChapterReward(_chapterId,_rewradId,func) + local data = PlayerInfoProto_pb.GetHardStageChapterReward() + data.chapterId = _chapterId + data.rewradId = _rewradId + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.HARD_STAGE_CHAPTER_REWARD_REQUEST, MessageTypeProto_pb.HARD_STAGE_CHAPTER_REWARD_RESPONSE, msg, function(buffer) + local data = buffer:DataByte() + local msg = PlayerInfoProto_pb.GetHardStageChapterRewardResponse() + msg:ParseFromString(data) + if func then + func(msg) + end + end) +end +--山河社稷图请求战斗回放 +function NetManager.HardStageReportRequset(_chapterId,_nodeId,func) + local data = PlayerInfoProto_pb.HardStageReportRequset() + data.chapterId = _chapterId; + data.nodeId = _nodeId; + local msg = data:SerializeToString() + Network:SendMessageWithCallBack(MessageTypeProto_pb.HARD_STAGE_REPORT_REQUEST, MessageTypeProto_pb.HARD_STAGE_REPORT_RESPONSE, msg, function(buffer) + local data = buffer:DataByte() + local msg = PlayerInfoProto_pb.HardStageReportResponse() + msg:ParseFromString(data) + if func then + func(msg) + end + end) +end --山河社稷图开始节点战斗操作 function NetManager.HardStageFightRequest(_nodeId,_teamId,_expInfo,func) local data = PlayerInfoProto_pb.HardStageFightRequest()