法宝抽卡添加开启限制

dev_fengTi_And
PC-202302260912\Administrator 2023-07-17 14:27:56 +08:00
parent 04fc28856d
commit 15cce82e7a
3 changed files with 76 additions and 5 deletions

View File

@ -2837,6 +2837,7 @@ function CheckFunctionOpen(_funId)
end
-- 当前玩家等级
local playerLv = PlayerManager.level
local tip=""
--开启规则
--1关卡开启
--2玩家等级开启
@ -2846,7 +2847,7 @@ function CheckFunctionOpen(_funId)
if openRule then
if openRule[1] == 1 and not FightPointPassManager.IsFightPointPass(openRule[2]) then -- 关卡开启
return false
elseif openRule[1] == 2 and playerLv < openRule[2] then -- 等级开启
elseif openRule[1] == 2 and playerLv < openRule[2] then -- 等级开启
return false
elseif openRule[1] == 3 and HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv) < openRule[2] then -- 鸿蒙阵神将共鸣等级
return false
@ -2875,6 +2876,59 @@ function CheckFunctionOpen(_funId)
return true
end
function GetFunctionOpenTip(_funId)
local data = ConfigManager.GetConfigData(ConfigName.GlobalSystemConfig,_funId)
if data.IsOpen==0 then
return "功能未开启"
end
-- 当前玩家等级
local playerLv = PlayerManager.level
local tip=""
--开启规则
--1关卡开启
--2玩家等级开启
--3鸿蒙阵神将等级
--4购买礼包开启
local openRule = data.OpenRules
if openRule then
if openRule[1] == 1 and not FightPointPassManager.IsFightPointPass(openRule[2]) then -- 关卡开启
local name=ConfigManager.GetConfigData(ConfigName.MainLevelConfig,openRule[2]).Name or ""
tip=string.format(Language[10295], GetLanguageStrById(name))
return tip
elseif openRule[1] == 2 and playerLv < openRule[2] then -- 等级开启
tip=string.format(Language[10293],openRule[2])
return tip
elseif openRule[1] == 3 and HarmonyManager.GetSingleAdditions(HarmonyAddType.AddLv) < openRule[2] then -- 鸿蒙阵神将共鸣等级
tip=string.format("鸿蒙阵共鸣神将等级达到%s开启", openRule[2])
return tip
elseif openRule[1] == 4 and not OperatingManager.IsBuyGift(openRule[2]) then
return tip
elseif openRule[1] == 5 and GodsWayTowerManager.GetTowerFloorByType(1) < openRule[2] then
return tip
end
end
--1#创角
--2#开服
local curTime=GetTimeStamp()
if data.IfOpen then
local type=data.IfOpen[1]
local dayNum=data.IfOpen[2]
if type==1 then
if curTime<PlayerManager.userCreateTime+dayNum*24*60*60 then
tip=string.format("创角第%s天",dayNum)
return tip
end
elseif type==2 then
if curTime<PlayerManager.GetServerOpenTime()+dayNum*24*60*60 then
tip=string.format("开服第%s天开启",dayNum)
return tip
end
end
end
return tip
end
---获取神尊等级
function GetShenzunLv()
local expNum=BagManager.GetItemCountById(1352)

View File

@ -258,11 +258,11 @@ function RecruitEquipPanelNew:UpdataWishPanel()
end
self:CheckNewWishHero()
end)
--self.tenTip.gameObject:SetActive(true)
if RecruitManager.isTenRecruit == 0 then
self.tenTipText.text = "<color=#FFB83B><size=30>每次十连</size><color=#FEDA90><size=30>必得</size></color></color><color=#FFB83B><size=30>五星</size></color><color=#FEDA90><size=30>神将</size></color>"
self.tenTipText.text = "<color=#FFB83B><size=30>每次十连</size><color=#FEDA90><size=30>必得</size></color></color><color=#FFB83B><size=30>五星</size></color><color=#FEDA90><size=30>神将法宝</size></color>"
else
self.tenTipText.text = string.format("剩余<color=#31ff00>%s次</color>必得五星神将",RecruitManager.GetRecruit3MustCount())
self.tenTipText.text = string.format("剩余<color=#31ff00>%s次</color>必得五星神将法宝",RecruitManager.GetRecruit2MustCount())
end
end
@ -368,13 +368,19 @@ function RecruitEquipPanelNew:UpdatePanelData()
end
Util.AddOnceClick(m.btn,function()
local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
if isOpen==false then
PopupTipPanel.ShowTip(tip)
return
end
if not isFree then
if BagManager.GetItemCountById(itemId)<itemNum then
PopupTipPanel.ShowTip(itemConfig[itemId].Name.."数量不足!")
return
end
end
local state = PlayerPrefs.GetInt(PlayerManager.uid.."GeneralPopup_RecruitConfirm"..self.config.ShopData[3][2])
LogGreen("self.config.ShopData[3][2]:"..self.config.ShopData[3][2].." state:"..state)
local recrutId = n == 1 and self.singleConfig.Id or self.tenConfig.Id

View File

@ -397,11 +397,21 @@ function this:RefreshTabData()
this.itemList[i].pos = this.itemList[i].tran.anchoredPosition
this.itemList[i].index = i
this.itemList[i].img = Util.GetGameObject(this.itemList[i].go, "img"):GetComponent("Image")
this.itemList[i].tipObj=Util.GetGameObject(this.itemList[i].go,"tipObj")
this.itemList[i].tipTxt=Util.GetGameObject(this.itemList[i].go,"tipObj/Text"):GetComponent("Text")
this.itemList[i].redpot = Util.GetGameObject(this.itemList[i].go, "redpot")
this.itemList[i].pageIndex = i
end
this.itemList[i].go.gameObject:SetActive(true)
this.itemList[i].tipObj:SetActive(false)
this.itemList[i].img.sprite = this.spLoader:LoadSprite(self.dicData[i].Icon[1])
if self.dicData[i].ActId==2 then
local isOpen =CheckFunctionOpen(FUNCTION_OPEN_TYPE.EquipWish)
local tip=GetFunctionOpenTip(FUNCTION_OPEN_TYPE.EquipWish)
this.itemList[i].tipObj:SetActive(not isOpen)
this.itemList[i].tipTxt.text=tip
end
BindRedPointObject(self.dicData[i].RpType,this.itemList[i].redpot)
redPointTypeList[self.dicData[i].RpType] = this.itemList[i].redpot
end
@ -471,6 +481,7 @@ function this:PageOnChange(isShow)
this.select.transform:GetComponent("RectTransform").anchoredPosition = Vector3.zero
this.select.gameObject:SetActive(true)
this.selectIma.sprite = this.spLoader:LoadSprite(self.dicData[self.curPage].Icon[2])
this.itemList[i].tipObj.transform:SetAsLastSibling()
end
end
end