From 2ed4480d92f1519f00a50db15fcb1f151a769c28 Mon Sep 17 00:00:00 2001 From: jiaoyangna <3046463818@qq.com> Date: Tue, 8 Jun 2021 17:57:59 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ID1009398=E3=80=91=20=E3=80=90?= =?UTF-8?q?=E9=9D=92=E9=BE=99=E7=A7=98=E5=AE=9D=E3=80=91=E8=A7=A3=E9=94=81?= =?UTF-8?q?=E7=A7=98=E5=AE=9D=E7=95=8C=E9=9D=A2=E6=98=BE=E7=A4=BA=E5=A5=96?= =?UTF-8?q?=E5=8A=B1=20=EF=BC=8C=E6=97=A0=E5=B0=BD=E7=A7=98=E5=AE=9D?= =?UTF-8?q?=E5=90=8C=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../~Lua/Modules/Map/EndLessMapManager.lua | 27 +++++++++++- ...eralPopup_HeavenUnlockExtraRewardPanel.lua | 43 +++++++++++++++---- 2 files changed, 60 insertions(+), 10 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua b/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua index 6d5a091eb7..df8dc71fee 100644 --- a/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua +++ b/Assets/ManagedResources/~Lua/Modules/Map/EndLessMapManager.lua @@ -872,11 +872,36 @@ end function this.GetAllRewardData() local rewardData = {} local rewardData1 = {} + local caluteLv = function(count) + local id,moraleLv1 + for k,v in ConfigPairs(endlessTreasure) do + if not v.Integral or #v.Integral < 1 or #v.Integral[1] < 2 then + moraleLv1 = v.Level + id = v.Id + break + elseif count < v.Integral[1][2] then + moraleLv1 = v.Level + id = v.Id + break + end + end + return id,moraleLv1 + end + + local itemCount = BagManager.GetItemCountById(this.scoreValueId) + local config = ConfigManager.GetConfigData(ConfigName.RechargeCommodityConfig,107) + local willItemCount = itemCount + 0 + for i = 1,#config.BaseReward do + if config.BaseReward[i][1] == this.scoreValueId then + willItemCount = willItemCount + config.BaseReward[i][2] + end + end + local id,lv = caluteLv(willItemCount) or 0,0 for k,v in ipairs(this.treasureDataReward) do if v.Reward then for n,m in ipairs(v.Reward) do if m.type == 2 then - if this.treasureData.curDataId >= v.Id then + if id >= v.Id then table.insert(rewardData,m) else table.insert(rewardData1,m) diff --git a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HeavenUnlockExtraRewardPanel.lua b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HeavenUnlockExtraRewardPanel.lua index 79c84df2a2..fdc615a6c8 100644 --- a/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HeavenUnlockExtraRewardPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Popup/View/GeneralPopup_HeavenUnlockExtraRewardPanel.lua @@ -106,8 +106,7 @@ function this:showRewardTianGong() local direct = {} local indirect ={} - local curScore = TreasureOfHeavenManger.curScore--当前分数 - + local curScore = TreasureOfHeavenManger.curScore for i = 1, #rewardData do if curScore >= rewardData[i].Integral then if rewardStateData[i].state == 1 or rewardStateData[i].state == 0 then--已达成但不能领取的 @@ -153,7 +152,26 @@ end function this:showRewardQinglong() local direct = {} local indirect ={} - + local config = ConfigManager.GetConfigData(ConfigName.SpecialConfig,16) + local strs = string.split(config.Value,"|") + local curScore = BagManager.GetItemCountById(QinglongSerectTreasureManager.scoreId) + for i = 1,#strs do + local strs1 = string.split(strs[i],"#") + if tonumber(strs1[1]) == QinglongSerectTreasureManager.scoreId then + curScore = curScore + tonumber(strs1[2]) + end + end + local Getlv = function(curScore) + local lv = 0 + for k,v in ConfigPairs(ConfigManager.GetConfig(ConfigName.TreasureSunlongConfig)) do + if not v.Integral or v.Integral[1][2] > curScore then + return lv + else + lv = v.Level + end + end + end + local level = Getlv(curScore) for i = 1, #rewardData do -- body local reward = rewardData[i] @@ -162,15 +180,22 @@ function this:showRewardQinglong() local num = reward.Reward[j].item[2] if reward.Reward[j].type == 2 then if reward.state == 1 or reward.state == 0 then - if not direct[id] then + if not direct[id] then direct[id] = 0 end direct[id] = direct[id] + num elseif reward.state == -2 then - if not indirect[id] then - indirect[id] = 0 + if level >= reward.level then + if not direct[id] then + direct[id] = 0 + end + direct[id] = direct[id] + num + else + if not indirect[id] then + indirect[id] = 0 + end + indirect[id] = indirect[id] + num end - indirect[id] = indirect[id] + num end end end @@ -207,7 +232,7 @@ function this:SetItem(direct,indirect) local index = 1 for key, value in pairs(direct) do - LogGreen("direct key:"..key.." value:"..value) + --LogGreen("direct key:"..key.." value:"..value) if not this.taskList[index] then local item = SubUIManager.Open(SubUIConfig.ItemView, this.box1.transform) this.taskList[index] = item @@ -224,7 +249,7 @@ function this:SetItem(direct,indirect) Util.GetGameObject(this.Content, "empty").gameObject:SetActive(true) end for key, value in pairs(indirect) do - LogGreen("indirect key:"..key.." value:"..value) + --LogGreen("indirect key:"..key.." value:"..value) if not this.taskList[index] then local item = SubUIManager.Open(SubUIConfig.ItemView, this.box2.transform) this.taskList[index] = item