From d87d9068ab721be3bd93e577eb86c9a3bf224102 Mon Sep 17 00:00:00 2001
From: puxuan <413323644@qq.com>
Date: Mon, 20 Oct 2025 17:19:08 +0800
Subject: [PATCH] =?UTF-8?q?=E7=89=B9=E6=9D=83?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
lua/app/config/recovery.lua | 3 ++-
lua/app/ui/battle/battle_base_ui.lua | 2 +-
lua/app/ui/idle/idle_drop_ui.lua | 21 ++++++++++++-------
lua/app/ui/main_city/component/main_comp.lua | 5 +++--
lua/app/userdata/bag/item_data.lua | 8 ++++---
lua/app/userdata/player/player_data.lua | 8 +++----
.../privilege_card/privilege_card_data.lua | 2 --
7 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/lua/app/config/recovery.lua b/lua/app/config/recovery.lua
index 3b573948..a934d482 100644
--- a/lua/app/config/recovery.lua
+++ b/lua/app/config/recovery.lua
@@ -2,7 +2,8 @@ local recovery = {
[3]={
["type"]=1,
["time"]=600,
- ["limit"]=60
+ ["limit"]=60,
+ ["monthly_card"]=90
},
[8]={
["type"]=2,
diff --git a/lua/app/ui/battle/battle_base_ui.lua b/lua/app/ui/battle/battle_base_ui.lua
index bd4529b0..199f0dd9 100644
--- a/lua/app/ui/battle/battle_base_ui.lua
+++ b/lua/app/ui/battle/battle_base_ui.lua
@@ -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)
diff --git a/lua/app/ui/idle/idle_drop_ui.lua b/lua/app/ui/idle/idle_drop_ui.lua
index ccfa5867..e22ffb06 100644
--- a/lua/app/ui/idle/idle_drop_ui.lua
+++ b/lua/app/ui/idle/idle_drop_ui.lua
@@ -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, "" .. quickTimes ..""))
- 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, "" .. quickTimes ..""))
+ 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()
diff --git a/lua/app/ui/main_city/component/main_comp.lua b/lua/app/ui/main_city/component/main_comp.lua
index fc9ddf11..e110c514 100644
--- a/lua/app/ui/main_city/component/main_comp.lua
+++ b/lua/app/ui/main_city/component/main_comp.lua
@@ -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()
diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua
index 9bc64c60..de9ecae8 100644
--- a/lua/app/userdata/bag/item_data.lua
+++ b/lua/app/userdata/bag/item_data.lua
@@ -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
diff --git a/lua/app/userdata/player/player_data.lua b/lua/app/userdata/player/player_data.lua
index 1633dd61..04a72d69 100644
--- a/lua/app/userdata/player/player_data.lua
+++ b/lua/app/userdata/player/player_data.lua
@@ -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()
diff --git a/lua/app/userdata/privilege_card/privilege_card_data.lua b/lua/app/userdata/privilege_card/privilege_card_data.lua
index 984ab2cd..01405a2f 100644
--- a/lua/app/userdata/privilege_card/privilege_card_data.lua
+++ b/lua/app/userdata/privilege_card/privilege_card_data.lua
@@ -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