This commit is contained in:
puxuan 2025-10-20 17:19:08 +08:00
parent 596731e57a
commit d87d9068ab
7 changed files with 29 additions and 20 deletions

View File

@ -2,7 +2,8 @@ local recovery = {
[3]={ [3]={
["type"]=1, ["type"]=1,
["time"]=600, ["time"]=600,
["limit"]=60 ["limit"]=60,
["monthly_card"]=90
}, },
[8]={ [8]={
["type"]=2, ["type"]=2,

View File

@ -319,7 +319,7 @@ function BattleBaseUI:initSpeedBtn()
local spdBtn = self.uiMap["battle_ui.top_node.speed_btn"] local spdBtn = self.uiMap["battle_ui.top_node.speed_btn"]
local spdBtnImg = self.uiMap["battle_ui.top_node.speed_btn.img"] local spdBtnImg = self.uiMap["battle_ui.top_node.speed_btn.img"]
spdBtn:addClickListener(function() spdBtn:addClickListener(function()
if not DataManager.PrivilegeCardData:getIsMonthlyCardOpen() then if not DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
-- 月卡提示 -- 月卡提示
local params = {} local params = {}
params.content = I18N:getGlobalText(I18N.GlobalConst.CARD_MONTHLY_DESC_33) params.content = I18N:getGlobalText(I18N.GlobalConst.CARD_MONTHLY_DESC_33)

View File

@ -262,16 +262,23 @@ function IdleDropUI:refreshBtns()
self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1") self.getBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
self.getBtn:setTouchEnable(false) self.getBtn:setTouchEnable(false)
end end
if DataManager.PrivilegeCardData:getIsMonthlyCardActive() then
self.quickTimesTx:setText("")
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
self.quickBtn:setTouchEnable(true)
-- self:removeQuickBtnRedPoint()
else
local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes() local quickTimes = DataManager.IdleData:getQuickIdleVitRemainTimes()
self.quickTimesTx:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, "<color=#60FF4B>" .. quickTimes .."</color>")) self.quickTimesTx:setText(I18N:getGlobalText(I18N.GlobalConst.TODAY_REMAIN_TIMES, "<color=#60FF4B>" .. quickTimes .."</color>"))
if quickTimes > 0 then if quickTimes > 0 then
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1") self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_blue_1")
self.quickBtn:setTouchEnable(true) self.quickBtn:setTouchEnable(true)
self:addQuickBtnRedPoint() -- self:addQuickBtnRedPoint()
else else
self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1") self.quickBtn:setSprite(GConst.ATLAS_PATH.COMMON, "common_btn_grey_1")
self.quickBtn:setTouchEnable(false) self.quickBtn:setTouchEnable(false)
self:removeQuickBtnRedPoint() -- self:removeQuickBtnRedPoint()
end
end end
local adRemainTimes = DataManager.IdleData:getQuickIdleAdRemainTimes() local adRemainTimes = DataManager.IdleData:getQuickIdleAdRemainTimes()

View File

@ -253,8 +253,9 @@ end
function MainComp:refreshRedPoint() function MainComp:refreshRedPoint()
local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime() local time = Time:getServerTime() - DataManager.IdleData:getLastDropTime()
local idleMaxTime = DataManager.IdleData:getIdleMaxTime() -- local idleMaxTime = DataManager.IdleData:getIdleMaxTime()
if time >= idleMaxTime or DataManager.IdleData:getQuickIdleRemainTimes() > 0 then local idleMaxTime = 3600
if time >= idleMaxTime then
self.leftBtn:addRedPoint(70, -36, 1) self.leftBtn:addRedPoint(70, -36, 1)
else else
self.leftBtn:removeRedPoint() self.leftBtn:removeRedPoint()

View File

@ -49,6 +49,7 @@ function ItemData:init(data)
id = v.id, id = v.id,
ts = v.ts // 1000, ts = v.ts // 1000,
limit = recoveryInfo.limit, limit = recoveryInfo.limit,
monthlyCard = recoveryInfo.monthly_card,
recoveryType = recoveryInfo.type, recoveryType = recoveryInfo.type,
time = recoveryInfo.time time = recoveryInfo.time
} }
@ -279,7 +280,8 @@ function ItemData:recoveryItem(data)
-- 计算已经达到上限 -- 计算已经达到上限
local itemId = data.id local itemId = data.id
local currNum = self:getItemNumById(itemId) 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 return
end end
-- 计算恢复间隔 -- 计算恢复间隔
@ -296,8 +298,8 @@ function ItemData:recoveryItem(data)
end end
-- 计算此次实际增加数量 -- 计算此次实际增加数量
local addAfterNum = currNum + addCount local addAfterNum = currNum + addCount
if addAfterNum > data.limit then if addAfterNum > maxLimit then
addCount = data.limit - currNum addCount = maxLimit - currNum
end end
-- 根据实际增加的数量,计算恢复时间 -- 根据实际增加的数量,计算恢复时间
data.ts = data.ts + recoverTime * addCount data.ts = data.ts + recoverTime * addCount

View File

@ -120,10 +120,10 @@ function PlayerData:getVit()
end end
function PlayerData:getMaxVit() function PlayerData:getMaxVit()
if self.maxVit == nil then local isCardOpen = DataManager.PrivilegeCardData:getIsMonthlyCardActive()
self.maxVit = ConfigManager:getConfig("recovery")[GConst.ItemConst.ITEM_ID_VIT].limit local cfg = ConfigManager:getConfig("recovery")[GConst.ItemConst.ITEM_ID_VIT]
end local maxVit = isCardOpen and cfg.monthly_card or cfg.limit
return self.maxVit return maxVit
end end
function PlayerData:getMaxLv() function PlayerData:getMaxLv()

View File

@ -246,8 +246,6 @@ function PrivilegeCardData:onGiftBuySuccess(cardId)
self.cardData[cardId] = self.cardData[cardId] or {} self.cardData[cardId] = self.cardData[cardId] or {}
self.cardData[cardId].expire_at = -1 self.cardData[cardId].expire_at = -1
end end
-- 刷新广告图标
UIManager:refreshAllAdImg()
-- 局内事件 -- 局内事件
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.NO_AD_ACTIVE) EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.NO_AD_ACTIVE)
-- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then -- elseif cardId == GConst.ShopConst.PRIVILEGE_CARD_ID.LIFETIME_CARD then