【ID1009398】

【青龙秘宝】解锁秘宝界面显示奖励 ,无尽秘宝同理
dev_chengFeng
jiaoyangna 2021-06-08 17:57:59 +08:00
parent 9681a00816
commit 2ed4480d92
2 changed files with 60 additions and 10 deletions

View File

@ -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)

View File

@ -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