礼包前置条件修改

(cherry picked from commit 276de265a5)
onepiece_demo_arena
PC-202302260912\Administrator 2023-12-05 11:40:59 +08:00 committed by wangzhenxing
parent e7d3248f19
commit b4b2d865f9
1 changed files with 18 additions and 4 deletions

View File

@ -66,14 +66,23 @@ function this.SetBasicValues(giftGoodsList)
end
--屏蔽前置礼包没有达成购买限制的
local removeList={}
for _, v in pairs(GoodsTypeDef) do
for key, value in pairs(giftGoodsInfoList[v]) do
if this.CheckGiftFrontIsOpen(value.goodsId)==false then
table.remove(giftGoodsInfoList[v], key)
if this.CheckGiftFrontIsOpen(value.goodsId)==false then
if removeList[v]==nil then
removeList[v]={}
end
table.insert(removeList[v],value)
end
end
end
--this.RemoveItemInfoByType
for k, v in pairs(removeList) do
for i=1,#v do
table.removebyvalue(giftGoodsInfoList[k],v[i])
end
end
Game.GlobalEvent:DispatchEvent(GameEvent.FindFairy.RefreshBuyOpenState)
end
@ -81,12 +90,15 @@ end
function this.CheckGiftFrontIsOpen(gift)
local isOpen=true
for k, v in ConfigPairs(rechargeOrder) do
if v.BehindCommodity==gift then
if gift == v.BehindCommodity then
--LogError("v.id======================="..v.Id)
if v.FrontCommodity>0 then
local time=this.GetLeftBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity)
local buyTime= this.GetGoodsBuyTime(rechargeConfig[v.FrontCommodity].Type, v.FrontCommodity)
--无限次
if time==-1 then
LogError("   "..gift)
return true
end
@ -97,6 +109,8 @@ function this.CheckGiftFrontIsOpen(gift)
end
end
end
return isOpen
end