特权
This commit is contained in:
parent
596731e57a
commit
d87d9068ab
@ -2,7 +2,8 @@ local recovery = {
|
||||
[3]={
|
||||
["type"]=1,
|
||||
["time"]=600,
|
||||
["limit"]=60
|
||||
["limit"]=60,
|
||||
["monthly_card"]=90
|
||||
},
|
||||
[8]={
|
||||
["type"]=2,
|
||||
|
||||
@ -319,7 +319,7 @@ function BattleBaseUI:initSpeedBtn()
|
||||
local spdBtn = self.uiMap["battle_ui.top_node.speed_btn"]
|
||||
local spdBtnImg = self.uiMap["battle_ui.top_node.speed_btn.img"]
|
||||
spdBtn:addClickListener(function()
|
||||
if not DataManager.PrivilegeCardData:getIsMonthlyCardOpen() then
|
||||
if not DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
|
||||
-- 月卡提示
|
||||
local params = {}
|
||||
params.content = I18N:getGlobalText(I18N.GlobalConst.CARD_MONTHLY_DESC_33)
|
||||
|
||||
@ -262,16 +262,23 @@ function IdleDropUI:refreshBtns()
|
||||
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
|
||||
self.getBtn:setTouchEnable(false)
|
||||
end
|
||||
local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes()
|
||||
self.quickTimesTx:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, "<color=#60FF4B>" .. quickTimes .."</color>"))
|
||||
if quickTimes > 0 then
|
||||
if DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
|
||||
self.quickTimesTx:setText("")
|
||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
|
||||
self.quickBtn:setTouchEnable(true)
|
||||
self:addQuickBtnRedPoint()
|
||||
-- self:removeQuickBtnRedPoint()
|
||||
else
|
||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
|
||||
self.quickBtn:setTouchEnable(false)
|
||||
self:removeQuickBtnRedPoint()
|
||||
local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes()
|
||||
self.quickTimesTx:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, "<color=#60FF4B>" .. quickTimes .."</color>"))
|
||||
if quickTimes > 0 then
|
||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
|
||||
self.quickBtn:setTouchEnable(true)
|
||||
-- self:addQuickBtnRedPoint()
|
||||
else
|
||||
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
|
||||
self.quickBtn:setTouchEnable(false)
|
||||
-- self:removeQuickBtnRedPoint()
|
||||
end
|
||||
end
|
||||
|
||||
local adRemainTimes = DataManager.IdleData:getQuickIdleAdRemainTimes()
|
||||
|
||||
@ -253,8 +253,9 @@ end
|
||||
|
||||
function MainComp:refreshRedPoint()
|
||||
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
|
||||
local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
|
||||
if time >= idleMaxTime or DataManager.IdleData:getQuickIdleRemainTimes() > 0 then
|
||||
-- local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
|
||||
local idleMaxTime = 3600
|
||||
if time >= idleMaxTime then
|
||||
self.leftBtn:addRedPoint(70, -36, 1)
|
||||
else
|
||||
self.leftBtn:removeRedPoint()
|
||||
|
||||
@ -49,6 +49,7 @@ function ItemData:init(data)
|
||||
id = v.id,
|
||||
ts = v.ts // 1000,
|
||||
limit = recoveryInfo.limit,
|
||||
monthlyCard = recoveryInfo.monthly_card,
|
||||
recoveryType = recoveryInfo.type,
|
||||
time = recoveryInfo.time
|
||||
}
|
||||
@ -279,7 +280,8 @@ function ItemData:recoveryItem(data)
|
||||
-- 计算已经达到上限
|
||||
local itemId = data.id
|
||||
local currNum = self:getItemNumById(itemId)
|
||||
if currNum >= data.limit then
|
||||
local maxLimit = DataManager.PrivilegeCardData:getIsMonthlyCardActive() and data.monthlyCard or data.limit
|
||||
if currNum >= maxLimit then
|
||||
return
|
||||
end
|
||||
-- 计算恢复间隔
|
||||
@ -296,8 +298,8 @@ function ItemData:recoveryItem(data)
|
||||
end
|
||||
-- 计算此次实际增加数量
|
||||
local addAfterNum = currNum + addCount
|
||||
if addAfterNum > data.limit then
|
||||
addCount = data.limit - currNum
|
||||
if addAfterNum > maxLimit then
|
||||
addCount = maxLimit - currNum
|
||||
end
|
||||
-- 根据实际增加的数量,计算恢复时间
|
||||
data.ts = data.ts + recoverTime * addCount
|
||||
|
||||
@ -120,10 +120,10 @@ function PlayerData:getVit()
|
||||
end
|
||||
|
||||
function PlayerData:getMaxVit()
|
||||
if self.maxVit == nil then
|
||||
self.maxVit = ConfigManager:getConfig("recovery")[GConst.ItemConst.ITEM_ID_VIT].limit
|
||||
end
|
||||
return self.maxVit
|
||||
local isCardOpen = DataManager.PrivilegeCardData:getIsMonthlyCardActive()
|
||||
local cfg = ConfigManager:getConfig("recovery")[GConst.ItemConst.ITEM_ID_VIT]
|
||||
local maxVit = isCardOpen and cfg.monthly_card or cfg.limit
|
||||
return maxVit
|
||||
end
|
||||
|
||||
function PlayerData:getMaxLv()
|
||||
|
||||
@ -246,8 +246,6 @@ function PrivilegeCardData:onGiftBuySuccess(cardId)
|
||||
self.cardData[cardId] = self.cardData[cardId] or {}
|
||||
self.cardData[cardId].expire_at = -1
|
||||
end
|
||||
-- 刷新广告图标
|
||||
UIManager:refreshAllAdImg()
|
||||
-- 局内事件
|
||||
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.NO_AD_ACTIVE)
|
||||
-- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user