【抽卡概率】增加显示概率
parent
f2dd26a329
commit
01a6f7f277
|
@ -109,7 +109,7 @@ function ActivityDetail:ReculateUpNewHeroRate(id)
|
|||
local UpMonster=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.XIANG_YAO_UP)
|
||||
for n,m in ipairs(UpMonster) do
|
||||
if m and id==m.Reward[1] then
|
||||
return m.Weight
|
||||
return m.WeightShow
|
||||
end
|
||||
end
|
||||
return 0
|
||||
|
@ -184,7 +184,7 @@ function ActivityDetail:ReculateUpMonsterRate(id)
|
|||
local UpMonster=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.LING_SHOU_UP)
|
||||
for n,m in ipairs(UpMonster) do
|
||||
if m and id==m.Reward[1] then
|
||||
return m.Weight
|
||||
return m.WeightShow
|
||||
end
|
||||
end
|
||||
return 0
|
||||
|
@ -257,7 +257,7 @@ function ActivityDetail:ReculateUpSoulRate(id)
|
|||
local Soul=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.LOTTERY_SOUL)
|
||||
for n,m in ipairs(Soul) do
|
||||
if m and id==m.Reward[1] then
|
||||
return m.Weight
|
||||
return m.WeightShow
|
||||
end
|
||||
end
|
||||
return 0
|
||||
|
@ -330,7 +330,7 @@ function ActivityDetail:ReculateUpHeroRate(id)
|
|||
local Hero=RecruitManager.GetRewardPreviewData(PRE_REWARD_POOL_TYPE.TIME_LIMITED)
|
||||
for n,m in ipairs(Hero) do
|
||||
if m and id==m.Reward[1] then
|
||||
return m.Weight
|
||||
return m.WeightShow
|
||||
end
|
||||
end
|
||||
return 0
|
||||
|
@ -379,7 +379,7 @@ end
|
|||
function ActivityDetail:ReculateRate(list)
|
||||
local weight=0
|
||||
for index, v in ipairs(list) do
|
||||
weight=v.Weight+weight
|
||||
weight=v.WeightShow+weight
|
||||
end
|
||||
return weight
|
||||
end
|
||||
|
|
|
@ -143,7 +143,7 @@ function this:BuildRateData(actType,UpItem,upItemList)
|
|||
if m and m.Reward[1] == showData.monsterId then
|
||||
local _config = ConfigManager.GetConfigData(ConfigName.SpiritAnimal,m.Reward[1])
|
||||
local readingName = _config.ReadingName or _config.Name
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag="灵兽UP!",name = readingName,value = m.Weight})
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag="灵兽UP!",name = readingName,value = m.WeightShow})
|
||||
break
|
||||
end
|
||||
end
|
||||
|
@ -154,7 +154,7 @@ function this:BuildRateData(actType,UpItem,upItemList)
|
|||
if m and m.Reward[1] == showData.monsterId then
|
||||
local _config = ConfigManager.GetConfigData(ConfigName.HeroConfig,m.Reward[1])
|
||||
local readingName = _config.ReadingName or _config.Name
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag="5星UP!",name = readingName,value = m.Weight})
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag="5星UP!",name = readingName,value = m.WeightShow})
|
||||
break
|
||||
end
|
||||
end
|
||||
|
@ -162,12 +162,12 @@ function this:BuildRateData(actType,UpItem,upItemList)
|
|||
elseif actType == ActivityTypeDef.LimitUpHero then
|
||||
for n,m in ipairs(upItemList) do
|
||||
local itemConfig=ConfigManager.TryGetConfigData(ConfigName.ItemConfig, m.Reward[1])
|
||||
table.insert(rateList,{id = m.Reward[1],tag = "5星神将UP!", name=itemConfig.Name,value = m.Weight,color = "AD4152"})
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag = "5星神将UP!", name=itemConfig.Name,value = m.Weight})
|
||||
table.insert(rateList,{id = m.Reward[1],tag = "5星神将UP!", name=itemConfig.Name,value = m.WeightShow,color = "AD4152"})
|
||||
table.insert(_upRateList,{id = m.Reward[1],tag = "5星神将UP!", name=itemConfig.Name,value = m.WeightShow})
|
||||
end
|
||||
for n,m in ipairs(UpItem) do
|
||||
local itemConfig=ConfigManager.TryGetConfigData(ConfigName.ItemConfig, m.Reward[1])
|
||||
table.insert(rateList,{id = m.Reward[1],tag = itemConfig.Name, name=m.Reward[2],value = m.Weight,color = "BDB69C" })
|
||||
table.insert(rateList,{id = m.Reward[1],tag = itemConfig.Name, name=m.Reward[2],value = m.WeightShow,color = "BDB69C" })
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -196,7 +196,7 @@ end
|
|||
function this:ReculateRate(list)
|
||||
local weight=0
|
||||
for index, v in ipairs(list) do
|
||||
weight=v.Weight+weight
|
||||
weight=v.WeightShow+weight
|
||||
end
|
||||
return weight
|
||||
end
|
||||
|
@ -208,7 +208,7 @@ function this:ReculateUpHeroRate(itemList,UpItemList,_tag,config)
|
|||
if v.Reward[1] == m.Reward[1] then
|
||||
local _config = ConfigManager.GetConfigData(config,v.Reward[1])
|
||||
local readingName = _config.ReadingName or _config.Name
|
||||
table.insert(rateList,{id = m.Reward[1],tag=_tag,name = readingName,value = m.Weight,color = "AD4152"})
|
||||
table.insert(rateList,{id = m.Reward[1],tag=_tag,name = readingName,value = m.WeightShow,color = "AD4152"})
|
||||
break
|
||||
end
|
||||
end
|
||||
|
|
|
@ -111,19 +111,19 @@ function HeroPreviewPanel:OnOpen(...)
|
|||
if(v.Pool==11) then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView,this.waterGrid.transform)
|
||||
view:OnOpen(false, {v.Reward[1], v.Reward[2] },1.1,true)
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.Weight/100000)*100) .."%</color>"
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.WeightShow/100000)*100) .."%</color>"
|
||||
elseif(v.Pool==12) then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView,this.fireGrid.transform)
|
||||
view:OnOpen(false, {v.Reward[1], v.Reward[2] },1.1,true)
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.Weight/100000)*100) .."%</color>"
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.WeightShow/100000)*100) .."%</color>"
|
||||
elseif(v.Pool==13) then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView,this.windyGrid.transform)
|
||||
view:OnOpen(false, {v.Reward[1], v.Reward[2] },1.1,true)
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.Weight/100000)*100) .."%</color>"
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.WeightShow/100000)*100) .."%</color>"
|
||||
elseif(v.Pool==14) then
|
||||
local view = SubUIManager.Open(SubUIConfig.ItemView,this.groundGrid.transform)
|
||||
view:OnOpen(false, {v.Reward[1], v.Reward[2] },1.1,true)
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.Weight/100000)*100) .."%</color>"
|
||||
view.name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f",(v.WeightShow/100000)*100) .."%</color>"
|
||||
end
|
||||
end
|
||||
this.elementScroll:SetActive(true)
|
||||
|
@ -190,7 +190,7 @@ function this.SwitchView(index)
|
|||
this.List1[i] = SubUIManager.Open(SubUIConfig.ItemView,this.oneGrid.transform)
|
||||
end
|
||||
this.List1[i]:OnOpen(false, {oneData[i].Reward[1], oneData[i].Reward[2]}, 1.1, true)
|
||||
this.List1[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (oneData[i].Weight/100000)*100) .."%</color>"
|
||||
this.List1[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (oneData[i].WeightShow/100000)*100) .."%</color>"
|
||||
this.List1[i].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
@ -201,7 +201,7 @@ function this.SwitchView(index)
|
|||
this.List2[i] = SubUIManager.Open(SubUIConfig.ItemView,this.twoGrid.transform)
|
||||
end
|
||||
this.List2[i]:OnOpen(false, {twoData[i].Reward[1], twoData[i].Reward[2]}, 1.1, true)
|
||||
this.List2[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (twoData[i].Weight/100000)*100) .."%</color>"
|
||||
this.List2[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (twoData[i].WeightShow/100000)*100) .."%</color>"
|
||||
this.List2[i].gameObject:SetActive(true)
|
||||
end
|
||||
end
|
||||
|
@ -216,7 +216,7 @@ function this.SwitchView(index)
|
|||
this.List3[i].gameObject:SetActive(true)
|
||||
end
|
||||
this.List3[i]:OnOpen(false, {threeData[i].Reward[1], threeData[i].Reward[2]}, 1.1, true)
|
||||
this.List3[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (threeData[i].Weight/100000)*100) .."%</color>"
|
||||
this.List3[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (threeData[i].WeightShow/100000)*100) .."%</color>"
|
||||
this.List3[i].gameObject:SetActive(true)
|
||||
end
|
||||
for i = 1, #this.List4 do
|
||||
|
@ -230,7 +230,7 @@ function this.SwitchView(index)
|
|||
this.List4[i].gameObject:SetActive(true)
|
||||
end
|
||||
this.List4[i]:OnOpen(false, {fourData[i].Reward[1], fourData[i].Reward[2]}, 1.1, true)
|
||||
this.List4[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (fourData[i].Weight/100000)*100) .."%</color>"
|
||||
this.List4[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (fourData[i].WeightShow/100000)*100) .."%</color>"
|
||||
this.List4[i].gameObject:SetActive(true)
|
||||
end
|
||||
for i = 1, #this.List5 do
|
||||
|
@ -244,7 +244,7 @@ function this.SwitchView(index)
|
|||
this.List5[i].gameObject:SetActive(true)
|
||||
end
|
||||
this.List5[i]:OnOpen(false, {fiveData[i].Reward[1], fiveData[i].Reward[2]}, 1.1, true)
|
||||
this.List5[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (fiveData[i].Weight/100000)*100) .."%</color>"
|
||||
this.List5[i].name:GetComponent("Text").text="<color=#EDB64C>"..string.format("%.2f", (fiveData[i].WeightShow/100000)*100) .."%</color>"
|
||||
this.List5[i].gameObject:SetActive(true)
|
||||
end
|
||||
this.starGridSwitch(index)
|
||||
|
|
|
@ -310,7 +310,7 @@ function this.GetActivityPreviewData(type)--非常驻抽卡奖池预览
|
|||
end
|
||||
table.sort(previewData, function(a, b)
|
||||
if itemConfig[a.Reward[1]].Quantity == itemConfig[b.Reward[1]].Quantity then
|
||||
return a.Weight > b.Weight
|
||||
return a.WeightShow > b.WeightShow
|
||||
else
|
||||
return itemConfig[a.Reward[1]].Quantity > itemConfig[b.Reward[1]].Quantity
|
||||
end
|
||||
|
|
|
@ -163,7 +163,7 @@ function this.CreatePokemonInfo(showData)
|
|||
SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[1], "gird").transform)
|
||||
end
|
||||
this.List1[i]:OnOpen(false, {fiveData[i].Reward[1], fiveData[i].Reward[2]}, 1.1, true)
|
||||
this.List1[i].name:GetComponent("Text").text ="<color=#EDB64C>" .. string.format("%.2f", (fiveData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
this.List1[i].name:GetComponent("Text").text ="<color=#EDB64C>" .. string.format("%.2f", (fiveData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
this.List1[i].gameObject:SetActive(true)
|
||||
end
|
||||
|
||||
|
@ -173,7 +173,7 @@ function this.CreatePokemonInfo(showData)
|
|||
SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[2], "gird").transform)
|
||||
end
|
||||
this.List2[i]:OnOpen(false, {fourData[i].Reward[1], fourData[i].Reward[2]}, 1.1, true)
|
||||
this.List2[i].name:GetComponent("Text").text = "<color=#EDB64C>" .. string.format("%.2f", (fourData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
this.List2[i].name:GetComponent("Text").text = "<color=#EDB64C>" .. string.format("%.2f", (fourData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
this.List2[i].gameObject:SetActive(true)
|
||||
end
|
||||
|
||||
|
@ -183,7 +183,7 @@ function this.CreatePokemonInfo(showData)
|
|||
SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[3], "gird").transform)
|
||||
end
|
||||
this.List3[i]:OnOpen(false, {ThreeData[i].Reward[1], ThreeData[i].Reward[2]}, 1.1, true)
|
||||
this.List3[i].name:GetComponent("Text").text = "<color=#EDB64C>" .. string.format("%.2f", (ThreeData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
this.List3[i].name:GetComponent("Text").text = "<color=#EDB64C>" .. string.format("%.2f", (ThreeData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
end
|
||||
|
||||
for i = 1, #otherList do
|
||||
|
@ -191,7 +191,7 @@ function this.CreatePokemonInfo(showData)
|
|||
this.List4[i] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[4], "gird").transform)
|
||||
end
|
||||
this.List4[i]:OnOpen(false, {otherList[i].Reward[1], otherList[i].Reward[2] }, 1.1, true)
|
||||
this.List4[i].name:GetComponent("Text").text = "<color=#EDB64C>"..string.format("%.2f",(otherList[i].Weight/100000)*100) .."%</color>"
|
||||
this.List4[i].name:GetComponent("Text").text = "<color=#EDB64C>"..string.format("%.2f",(otherList[i].WeightShow/100000)*100) .."%</color>"
|
||||
end
|
||||
|
||||
end
|
||||
|
@ -230,7 +230,7 @@ function this.CreateEastGhostInfo(showData)
|
|||
end
|
||||
this.List1[i]:OnOpen(false, {fiveData[i].Reward[1], fiveData[i].Reward[2]}, 1.1, true)
|
||||
this.List1[i].name:GetComponent("Text").text =
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (fiveData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (fiveData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
this.List1[i].gameObject:SetActive(true)
|
||||
end
|
||||
|
||||
|
@ -241,7 +241,7 @@ function this.CreateEastGhostInfo(showData)
|
|||
end
|
||||
this.List2[i]:OnOpen(false, {fourData[i].Reward[1], fourData[i].Reward[2]}, 1.1, true)
|
||||
this.List2[i].name:GetComponent("Text").text =
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (fourData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (fourData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
this.List2[i].gameObject:SetActive(true)
|
||||
end
|
||||
|
||||
|
@ -252,7 +252,7 @@ function this.CreateEastGhostInfo(showData)
|
|||
end
|
||||
this.List3[i]:OnOpen(false, {ThreeData[i].Reward[1], ThreeData[i].Reward[2]}, 1.1, true)
|
||||
this.List3[i].name:GetComponent("Text").text =
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (ThreeData[i].Weight / 100000) * 100) .. "%</color>"
|
||||
"<color=#EDB64C>" .. string.format("%.2f", (ThreeData[i].WeightShow / 100000) * 100) .. "%</color>"
|
||||
end
|
||||
|
||||
for i = 1, #otherList do
|
||||
|
@ -260,7 +260,7 @@ function this.CreateEastGhostInfo(showData)
|
|||
this.List4[i] = SubUIManager.Open(SubUIConfig.ItemView, Util.GetGameObject(this.previewList[4], "gird").transform)
|
||||
end
|
||||
this.List4[i]:OnOpen(false, {otherList[i].Reward[1], otherList[i].Reward[2] }, 1.1, true)
|
||||
this.List4[i].name:GetComponent("Text").text = "<color=#EDB64C>"..string.format("%.2f",(otherList[i].Weight/100000)*100) .."%</color>"
|
||||
this.List4[i].name:GetComponent("Text").text = "<color=#EDB64C>"..string.format("%.2f",(otherList[i].WeightShow/100000)*100) .."%</color>"
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue