diff --git a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonOneResultPanel.lua b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonOneResultPanel.lua index 98179ff33c..97eedcc157 100644 --- a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonOneResultPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonOneResultPanel.lua @@ -10,6 +10,10 @@ local privilegeConfig=ConfigManager.GetConfig(ConfigName.PrivilegeTypeConfig) local artResourcesConfig =ConfigManager.GetConfig(ConfigName.ArtResourcesConfig) local itemNum=0 --抽卡小号道具数量 local isFree=false +local itemid = 0 +local itemnum = 0 +local RecruitMaxtimesId = 0 +local freeTimesId = 0 --活动抽卡类型(动态的数据) local drawtType={ FindFairySingle=0, @@ -50,20 +54,32 @@ function PokemonSummonOneResultPanel:BindEvent() self:ClosePanel() end) Util.AddClick(this.openOneAgainButton, function () - local maxtimesId=lotterySetting[this.recruitType].MaxTimes - local freeTimesId=lotterySetting[this.recruitType].FreeTimes - if(isFree or BagManager.GetItemCountById(1204)>=1 or BagManager.GetItemCountById(16)>=itemNum) then - self:ClosePanel() - RecruitManager.RecruitRequest(this.recruitType, function(msg) - PrivilegeManager.RefreshPrivilegeUsedTimes(maxtimesId,1)--记录抽卡次数 - UIManager.OpenPanel(UIName.PokemonSummonOneResultPanel,msg.drop,this.recruitType) - CheckRedPointStatus(RedPointType.QianKunBox) - end,freeTimesId) - else - --UIManager.OpenPanel(UIName.QuickPurchasePanel, { type = UpViewRechargeType.DemonCrystal })--应跳到充值界面,现在是用之前的货币换取妖晶 - PopupTipPanel.ShowTip(Language[11139]) - self:ClosePanel() + --是否超过每日最大上限 + if PrivilegeManager.GetPrivilegeUsedTimes(RecruitMaxtimesId) + 1 > privilegeConfig[RecruitMaxtimesId].Condition[1][2] then + PopupTipPanel.ShowTip(Language[11760]) + return end + --是否妖晶,是否超过每日妖晶最大上限 + if itemid == 16 then + if PrivilegeManager.GetPrivilegeUsedTimes(2006) + 1 > privilegeConfig[2006].Condition[1][2] then + PopupTipPanel.ShowTip("今日妖晶召唤次数不足!") + return + end + end + if not isFree then + if BagManager.GetItemCountById(itemid) < itemNum then + PopupTipPanel.ShowTip(ItemConfig[itemid].Name..Language[10492]) + return + end + end + RecruitManager.RecruitRequest(this.recruitType, function(msg) + PrivilegeManager.RefreshPrivilegeUsedTimes(RecruitMaxtimesId,1)--记录抽卡次数 + if itemid == 16 then + PrivilegeManager.RefreshPrivilegeUsedTimes(2006,1)--记录妖晶抽卡次数 + end + UIManager.OpenPanel(UIName.PokemonSingleResultPanel,this.recruitType,msg.drop) + --CheckRedPointStatus(RedPointType.QianKunBox) + end,freeTimesId,itemid,itemNum) end) end @@ -96,18 +112,21 @@ function PokemonSummonOneResultPanel:OnOpen(...) this.content3:SetActive(true) local itemId=0 local d + d = RecruitManager.GetExpendData(this.recruitType) itemId=d[1] itemNum=d[2] this.itemIcon3.sprite=Util.LoadSprite(artResourcesConfig[ItemConfig[itemId].ResourceID].Name) --是否激活特权 local isActive = PrivilegeManager.GetPrivilegeOpenStatusById(3004) - if itemNum>10 and isActive then + if itemId == 16 and isActive then itemNum=itemNum*(1+currPrivilege.Condition[1][2]/10000) end + --获取免费次数 local currLottery= ConfigManager.GetConfigData(ConfigName.LotterySetting,42) - local freeTimesId=currLottery.FreeTimes + freeTimesId=currLottery.FreeTimes + RecruitMaxtimesId = currLottery.MaxTimes local freeTime=0 if freeTimesId>0 then freeTime= PrivilegeManager.GetPrivilegeRemainValue(freeTimesId) @@ -128,9 +147,9 @@ function PokemonSummonOneResultPanel:OnOpen(...) this.itemDataList={} this.itemDataList=BagManager.GetTableByBackDropData(this.drop) --抽奖赠送物品 - local tenConfig=lotterySetting[42] - local id=0 - local num=0 + local tenConfig=lotterySetting[RecruitType.LingShowSingle] + itemid=0 + itemnum=0 local ishave=false if tenConfig then id=tenConfig.TenTimesMustGetItem[1][1] diff --git a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonPanel.lua b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonPanel.lua index 54669959ed..38be21fa5b 100644 --- a/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonPanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/Pokemon/PokemonSummonPanel.lua @@ -161,6 +161,7 @@ function PokemonSummonPanel:Recruit(id,RecruitMaxtimesId,itemId,itemNum,state,fr else num = 10 end + --是否超过每日最大上限 if PrivilegeManager.GetPrivilegeUsedTimes(RecruitMaxtimesId) + num > privilegeConfig[RecruitMaxtimesId].Condition[1][2] then PopupTipPanel.ShowTip(Language[11760])