From 9558c4c53ef4b794eebaf0cf653d7b430d46a889 Mon Sep 17 00:00:00 2001 From: wangzhenxing <1545929779@qq.com> Date: Fri, 21 Jun 2024 18:00:48 +0800 Subject: [PATCH] =?UTF-8?q?1=E5=B0=8F=E5=85=B5=E5=85=B3=E5=8D=A1=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E5=90=8E=E7=AB=AF=E6=A0=A1=E9=AA=8C=EF=BC=8C=E5=90=8E?= =?UTF-8?q?=E5=8F=B0=E4=B8=8D=E5=86=8D=E6=89=93=202=20=E6=8A=BD=E5=B0=8F?= =?UTF-8?q?=E5=85=B5=E6=B7=BB=E5=8A=A0=E9=99=90=E5=88=B6=20=203=E5=85=B3?= =?UTF-8?q?=E5=8D=A1=E7=BA=A2=E7=82=B9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Common/GlobalDefine.lua | 1 + .../Modules/Fight/FightPointPassMainPanel.lua | 82 +++++++---- .../Modules/Fight/FightPointPassManager.lua | 26 ++-- .../~Lua/Modules/Gem/SmallSoldierManager.lua | 137 +++++++++--------- .../~Lua/Modules/Player/RedpotManager.lua | 2 +- 5 files changed, 139 insertions(+), 109 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua index 0555f345cd..6113dfe16f 100644 --- a/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua +++ b/Assets/ManagedResources/~Lua/Common/GlobalDefine.lua @@ -1819,6 +1819,7 @@ FUNCTION_OPEN_TYPE = { TrainBuild = 151, --特训建筑 HelpFight = 152, --助阵 AutoSoliderDraw =154,--自动抽小兵 + SoliderDraw=155, --抽小兵 } diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua index 50ec0e9f36..8c17065344 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassMainPanel.lua @@ -372,6 +372,11 @@ function FightPointPassMainPanel:BindEvent() end end) Util.AddClick(this.btn_draw, function () + local isOpen=CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) + if isOpen==false then + PopupTipPanel.ShowTip(GetFunctionOpenTip(FUNCTION_OPEN_TYPE.SoliderDraw)) + return + end if BagManager.GetItemCountById(tonumber(cost[1]))0 then - this.bossObj:SetActive(true) + -- if #levelList>0 then + -- this.bossObj:SetActive(true) + -- this.bossNum.text=#levelList + -- this.fightLock:SetActive(false) + -- this.fightSaoGuang:SetActive(true) + -- --this.fightGuideEffect:SetActive(true) + -- this.fightRP:SetActive(true) + -- else + -- this.bossObj:SetActive(false) + -- this.fightLock:SetActive(true) + -- this.fightRP:SetActive(false) + -- this.fightSaoGuang:SetActive(false) + -- --this.fightGuideEffect:SetActive(false) + -- --this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId) + -- local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv) + -- LogError("tip======================="..tip) + -- LogError("btntxt============================="..btnTxt) + -- this.lockText.text=tip + -- end + local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv) + if isOk then + this.bossObj:SetActive(false) this.bossNum.text=#levelList this.fightLock:SetActive(false) this.fightSaoGuang:SetActive(true) @@ -544,11 +569,9 @@ function this.RefreshBossInfo() this.fightSaoGuang:SetActive(false) --this.fightGuideEffect:SetActive(false) --this.lockText.text=string.format("再推%s关后开启",nextBossLv-FightPointPassManager.soldierLayerId) - local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(nextLv) - LogError("tip======================="..tip) - LogError("btntxt============================="..btnTxt) this.lockText.text=tip end + this.openFun:SetActive(true) this.openFunNeedInfo.text=name this.fightText.text = "挑战Boss" @@ -594,8 +617,8 @@ function this.RefreshSoliderInfo() end local haveNum=BagManager.GetItemCountById(tonumber(cost[1])) this.costTxt.text=haveNum - this.chouRed:SetActive(haveNum>0) - this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() ) + this.chouRed:SetActive(haveNum>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw)) + this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) ) local openList=lotteryConfig.SoldierType local dataList=SmallSoldierManager.soldierList LogError("dataList=========================================================="..#dataList) @@ -936,9 +959,9 @@ function this.BattleLogic() this.battleTimer:Stop() --判断当前开服天数是否开启当前关卡 if curSoliderStageConfig.OpenRule[1][2]<=GetOpenServerDayNum() then - NetManager.SoldierFightCheckRequest(1,function(msg) + --NetManager.SoldierFightCheckRequest(1,function(msg) --战斗成功 - if msg.result==1 then + --if msg.result==1 then if curSoliderStageConfig.NextId~=0 then FightPointPassManager.soldierLayerId=curSoliderStageConfig.NextId this.floorTxt.text=string.format("第%s关",FightPointPassManager.soldierLayerId) @@ -961,18 +984,19 @@ function this.BattleLogic() this.bossLiveGO.transform.localScale=Vector3.one * roleConfig[curSoliderStageConfig.Hero].enemy_liveScale*0.5 bossSpine=this.bossLiveGO:GetComponent("SkeletonGraphic") end + PlayerPrefs.SetInt("SmallSoldierLevel"..PlayerManager.uid,FightPointPassManager.soldierLayerId) --刷新挂机奖励 --this.IntiReward() - this.UpdateOpenSeverWelfare() - else - --PopupTipPanel.ShowTip("服务器战斗验证失败") - if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then - if not GuideManager.IsInMainGuide() then - --UIManager.OpenPanel(UIName.SmallSoldierFailPop) - end - PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) - end - end + --this.UpdateOpenSeverWelfare() + -- else + -- --PopupTipPanel.ShowTip("服务器战斗验证失败") + -- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then + -- if not GuideManager.IsInMainGuide() then + -- --UIManager.OpenPanel(UIName.SmallSoldierFailPop) + -- end + -- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) + -- end + -- end if this.battleTimer then this.battleTimer:Start() end @@ -982,7 +1006,7 @@ function this.BattleLogic() --this.hpBar.fillAmount=bossHp/curSoliderStageConfig.Hp this.SetHp(curSoliderStageConfig.Hp,bossHp,curSoliderStageConfig.HpNumber) this.RefreshBossInfo() - end) + --end) else if this.battleTimer then this.battleTimer:Start() @@ -1564,17 +1588,17 @@ function this.ExcuteBattle() else -- 检测是否有前置引导 GuideManager.BeforeFightCheck(curFightId, function() - if #levelList<=0 then - LogError("没有要打的boss关卡") - return - end + -- if #levelList<=0 then + -- LogError("没有要打的boss关卡") + -- return + -- end --屏蔽弹怪追认的动画 --this.SetInitAnim() local isBoss = FightPointPassManager.IsFightBoss() local sound = isBoss and SoundConfig.Sound_FightArea_Boss or SoundConfig.Sound_FightArea_Monster SoundManager.PlaySound(sound, AUDIO_FADE_TYPE.FADE_OUT_NOT_IN, AUDIO_RUN_TYPE.CONC, nil, 20) - LogError("levelList[1]=================================="..levelList[1]) - UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, levelList[1]) + --LogError("levelList[1]=================================="..levelList[1]) + UIManager.OpenPanel(UIName.FormationPanelV2, FORMATION_TYPE.STORY, curFightId) end) end end @@ -1629,8 +1653,8 @@ function FightPointPassMainPanel:OnSortingOrderChange() local haveNum=BagManager.GetItemCountById(tonumber(cost[1])) this.costTxt.text=haveNum - this.chouRed:SetActive(haveNum>0) - this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() ) + this.chouRed:SetActive(haveNum>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw)) + this.fightGuideEffect:SetActive(haveNum>0 and not GuideManager.IsInMainGuide() and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) ) end --界面关闭时调用(用于子类重写) diff --git a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua index 0c86ec5a42..f8e3cddf17 100644 --- a/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Fight/FightPointPassManager.lua @@ -59,8 +59,12 @@ function this.InitAllFightPointState(msg) this.HangOnTime = msg.duration this.curOpenFight = msg.fightId this.soldierStartTime = msg.soldierStartTime - this.soldierLayerId = msg.soldierLayerId - LogError("msg.soldierLayerId========================================================="..msg.soldierLayerId) + local level=PlayerPrefs.GetInt("SmallSoldierLevel"..PlayerManager.uid,FightPointPassManager.soldierLayerId) + if level==0 then + level=1 + end + this.soldierLayerId =level --msg.soldierLayerId + --LogError("msg.soldierLayerId========================================================="..msg.soldierLayerId) if mainLevelConfig[this.curOpenFight].SortId-1 > 0 then this.lastPassFightId = ConfigManager.GetConfigDataByKey(ConfigName.MainLevelConfig,"SortId", mainLevelConfig[this.curOpenFight].SortId-1).Id LogError("this.lastPassFightId=="..this.lastPassFightId) @@ -425,18 +429,18 @@ end -- 判断是否显示关卡按钮红点 function this.IsShowFightRP() + local lotteryConfig=ConfigManager.GetConfigData(ConfigName.SoldiersLotteryConfig,SmallSoldierManager.level) + if BagManager.GetItemCountById(lotteryConfig.Soldiers[1])>lotteryConfig.Soldiers[2] then + return true + end + if BagManager.GetItemCountById(126)>0 and CheckFunctionOpen(FUNCTION_OPEN_TYPE.SoliderDraw) then + return true + end local curFight=FightPointPassManager.curOpenFight local nextLv=0 - for k,v in ConfigPairs(mainLevelConfig) do - local aa=v - if k>=curFight then - if aa.OpenRule and (aa.OpenRule[1][1]==9 or aa.OpenRule[1][1]==0 ) and FightPointPassManager.soldierLayerId>=aa.OpenRule[1][2] then - return true - end - end - end + local isOk, tip, btnTxt, lockState = FightPointPassManager.CheckFightOpenRule(curFight) --return this.IsCanFight(this.curOpenFight) - return false + return isOk end -- 挑战按钮的文字显示 diff --git a/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierManager.lua b/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierManager.lua index ca8901f48a..3d683efad6 100644 --- a/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Gem/SmallSoldierManager.lua @@ -44,80 +44,81 @@ function this.InitData(msg) --LogError("服务器发过来的小兵 this.soldierList=================len=="..#this.soldierList.." msg.soldiers===="..#msg.soldiers) HeroPropManager.SetFuncPropDirty(Func_Prop_Type.Solider) - local cd=10 - local attackCD=0 - local bossHp=0 - Timer.New(function() - if FightPointPassManager.soldierLayerId>1 then + --local cd=10 + --local attackCD=0 + --local bossHp=0 + -- Timer.New(function() + -- if FightPointPassManager.soldierLayerId>1 then - --LogError("cd============================"..cd) - --if cd<=0 then - if UIManager.GetOpenPanel(UIName.FightPointPassMainPanel)==nil then - if this.isFirst and SmallSoldierManager.bossInfo then - cd=SmallSoldierManager.bossInfo.time - bossHp=SmallSoldierManager.bossInfo.hp - this.isFirst=false - end - attackCD=attackCD+1 - --到达攻击间隔 - if attackCD>=timeStamp then - bossHp=bossHp - this.GetCurrAllAttack() - attackCD=0 - if bossHp<=0 then - -- LogError("后台挂机boss被击败------------------------------------") - end - end - cd=cd-1 - if cd<=0 or bossHp<=0 then - --LogError("发送小兵挂机战斗请求======================================================") - local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) - if curConfig.OpenRule[1][2]<=GetOpenServerDayNum() then - NetManager.SoldierFightCheckRequest(0,function (msg) + -- --LogError("cd============================"..cd) + -- --if cd<=0 then + -- if UIManager.GetOpenPanel(UIName.FightPointPassMainPanel)==nil then + -- if this.isFirst and SmallSoldierManager.bossInfo then + -- cd=SmallSoldierManager.bossInfo.time + -- bossHp=SmallSoldierManager.bossInfo.hp + -- this.isFirst=false + -- end + -- attackCD=attackCD+1 + -- --到达攻击间隔 + -- if attackCD>=timeStamp then + -- bossHp=bossHp - this.GetCurrAllAttack() + -- attackCD=0 + -- if bossHp<=0 then + -- -- LogError("后台挂机boss被击败------------------------------------") + -- end + -- end + -- cd=cd-1 + -- if cd<=0 or bossHp<=0 then + -- --LogError("发送小兵挂机战斗请求======================================================") + -- local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) + -- LogError("GetOpenServerDayNum()========================="..GetOpenServerDayNum().." FightPointPassManager.soldierLayerId=="..FightPointPassManager.soldierLayerId) + -- if curConfig.OpenRule[1][2]<=GetOpenServerDayNum() then + -- NetManager.SoldierFightCheckRequest(0,function (msg) - local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) - if msg.result==1 then - if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then - FightPointPassManager.soldierLayerId = lvConfig.NextId - local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) - if curConfig then - cd=curConfig.Time - end - bossHp=lvConfig.Hp - end - if cd==0 then - cd=lvConfig.Time - bossHp=lvConfig.Hp - end - else - cd=lvConfig.Time - bossHp=lvConfig.Hp - if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then - if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then - UIManager.OpenPanel(UIName.SmallSoldierFailPop) - end - PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) - end - end - end) - else - cd=curConfig.Time - bossHp=curConfig.Hp - if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then - if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then - UIManager.OpenPanel(UIName.SmallSoldierFailPop) - end - PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) - end - end + -- local lvConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) + -- if msg.result==1 then + -- if lvConfig and lvConfig.NextId and lvConfig.NextId~=0 then + -- FightPointPassManager.soldierLayerId = lvConfig.NextId + -- local curConfig=ConfigManager.GetConfigData(ConfigName.SoldierStageConfig,FightPointPassManager.soldierLayerId) + -- if curConfig then + -- cd=curConfig.Time + -- end + -- bossHp=lvConfig.Hp + -- end + -- if cd==0 then + -- cd=lvConfig.Time + -- bossHp=lvConfig.Hp + -- end + -- else + -- cd=lvConfig.Time + -- bossHp=lvConfig.Hp + -- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then + -- if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then + -- UIManager.OpenPanel(UIName.SmallSoldierFailPop) + -- end + -- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) + -- end + -- end + -- end) + -- else + -- cd=curConfig.Time + -- bossHp=curConfig.Hp + -- if PlayerPrefs.GetInt("SmallSoldierFailed"..PlayerManager.uid)~=FightPointPassManager.soldierLayerId then + -- if not GuideManager.IsInMainGuide() and UIManager.GetOpenPanel(UIName.BattlePanel)==nil and UIManager.GetOpenPanel(UIName.BattleWinPopup)==nil then + -- UIManager.OpenPanel(UIName.SmallSoldierFailPop) + -- end + -- PlayerPrefs.SetInt("SmallSoldierFailed"..PlayerManager.uid,FightPointPassManager.soldierLayerId) + -- end + -- end - end + -- end - end - --end - end + -- end + -- --end + -- end - end, 1, -1, true):Start() + -- end, 1, -1, true):Start() end diff --git a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua index 2de78ae72a..17a81d6274 100644 --- a/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Player/RedpotManager.lua @@ -182,7 +182,7 @@ function this.InitRedPointAllRelate() --逍遥游 RPData:SetParent(RedPointType.XiaoYaoYouRedPoint, RedPointType.SecretTer) - RPData:SetParent(RedPointType.tuijianzhenrong, RedPointType.SecretTer) + --RPData:SetParent(RedPointType.tuijianzhenrong, RedPointType.SecretTer) -- 外敌 RPData:SetParent(RedPointType.SecretTer_Boss, RedPointType.Alien) RPData:SetParent(RedPointType.SecretTer_CallAlianInvasionTime, RedPointType.Alien)