From 466aee0b61f4e40534277d099f8305c35c336836 Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Tue, 19 Sep 2023 18:11:52 +0800 Subject: [PATCH] =?UTF-8?q?bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/app/module/item/item_const.lua | 1 + .../activity/act_pvp/act_pvp_match_result_ui.lua | 2 +- .../activity/act_boss_rush/act_boss_rush_data.lua | 13 ++++++++++++- lua/app/userdata/activity/act_pvp/act_pvp_data.lua | 14 +++++++++++++- lua/app/userdata/bag/item_data.lua | 9 +++++++++ lua/app/userdata/bag/item_entity.lua | 1 - 6 files changed, 36 insertions(+), 4 deletions(-) diff --git a/lua/app/module/item/item_const.lua b/lua/app/module/item/item_const.lua index 96390175..4a594adf 100644 --- a/lua/app/module/item/item_const.lua +++ b/lua/app/module/item/item_const.lua @@ -17,6 +17,7 @@ ItemConst.ITEM_ID_RANDOM_FRAGMENT = 19 ItemConst.ITEM_ID_ARENA_BOUNTY_EXP = 21 ItemConst.ITEM_ID_ARENA_TICKET = 22 ItemConst.ITEM_ID_FOURTEEN_DAY_EXCHANGE = 51 +ItemConst.ITEM_ID_BOSS_RUSH = 52 ItemConst.ITEM_ID_GLOD_WING = 49 ItemConst.ITEM_ID_SLIVER_WING = 50 ItemConst.ITEM_ID_RUNES = 55 diff --git a/lua/app/ui/activity/act_pvp/act_pvp_match_result_ui.lua b/lua/app/ui/activity/act_pvp/act_pvp_match_result_ui.lua index ed6807be..3e9957ff 100644 --- a/lua/app/ui/activity/act_pvp/act_pvp_match_result_ui.lua +++ b/lua/app/ui/activity/act_pvp/act_pvp_match_result_ui.lua @@ -125,7 +125,7 @@ function ActPvpMatchResultUI:refreshPlayerInfos() end if not self.playerHeadCell then - self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.match.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL) + self.playerHeadCell = CellManager:addCellComp(uiMap["act_pvp_match_result_ui.match_result.self.info.player_head_cell"], GConst.TYPEOF_LUA_CLASS.PLAYER_HEAD_CELL) end self.playerHeadCell:refresh(DataManager.PlayerData:getUsingAvatarId(), DataManager.PlayerData:getUsingFrameId()) uiMap["act_pvp_match_result_ui.match_result.self.info.tx_name"]:setText(DataManager.PlayerData:getNickname()) diff --git a/lua/app/userdata/activity/act_boss_rush/act_boss_rush_data.lua b/lua/app/userdata/activity/act_boss_rush/act_boss_rush_data.lua index c1a8a8d7..7623b413 100644 --- a/lua/app/userdata/activity/act_boss_rush/act_boss_rush_data.lua +++ b/lua/app/userdata/activity/act_boss_rush/act_boss_rush_data.lua @@ -173,20 +173,31 @@ end function ActBossRushData:getIsOpen() if GFunc.isShenhe() then + self.isOpen = false return false end if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then + self.isOpen = false return false end if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号,看不到 if self.fightCount > 0 or self.proBounght or self.utralBounght then -- 兼容已参与的玩家 else + self.isOpen = false return false end end local time = Time:getServerTime() - return self.endTime > time and time > self.startTime + local isOpen = false + if self.endTime > time and time > self.startTime then + isOpen = true + end + if self.isOpen == false and isOpen then -- 没开->开 + DataManager.BagData.ItemData:clearItemCount(GConst.ItemConst.ITEM_ID_BOSS_RUSH) + end + self.isOpen = isOpen + return isOpen end function ActBossRushData:getRp() diff --git a/lua/app/userdata/activity/act_pvp/act_pvp_data.lua b/lua/app/userdata/activity/act_pvp/act_pvp_data.lua index 677c77c4..ad32e499 100644 --- a/lua/app/userdata/activity/act_pvp/act_pvp_data.lua +++ b/lua/app/userdata/activity/act_pvp/act_pvp_data.lua @@ -116,17 +116,29 @@ end function ActPvpData:getIsOpen() if GFunc.isShenhe() or not self.endTime then + self.isOpen = false return false end if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.ACTIVITY, true) then + self.isOpen = false return false end if Time:getServerTime() <= DataManager:getRegisterTs() + self:getConditionDay() then -- 前14天的号,看不到 + self.isOpen = false return false end local time = Time:getServerTime() - return self.endTime > time and time > self.startTime + local isOpen = false + if self.endTime > time and time > self.startTime then + isOpen = true + end + if self.isOpen == false and isOpen then -- 没开->开 + DataManager.ShopData:resetGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, PRO_ACT_ID) + DataManager.ShopData:resetGiftBoughtNum(PayManager.PURCHARSE_TYPE.ACT_GIFT, UTRAL_ACT_ID) + end + self.isOpen = isOpen + return isOpen end function ActPvpData:getRemainTime() diff --git a/lua/app/userdata/bag/item_data.lua b/lua/app/userdata/bag/item_data.lua index 0b8264c7..878bcc5e 100644 --- a/lua/app/userdata/bag/item_data.lua +++ b/lua/app/userdata/bag/item_data.lua @@ -231,6 +231,15 @@ function ItemData:_addItemNumById(id, num) self:setDirty() end +-- 清空道具,用于活动重开的时候清除对应道具 +function ItemData:clearItemCount(id) + if not self.items[id] then + return + end + self.items[id]:setNum(0) + self:setDirty() +end + function ItemData:setDirty() self.data.dirty = not self.data.dirty end diff --git a/lua/app/userdata/bag/item_entity.lua b/lua/app/userdata/bag/item_entity.lua index bc48a0c1..5e7926e5 100644 --- a/lua/app/userdata/bag/item_entity.lua +++ b/lua/app/userdata/bag/item_entity.lua @@ -42,7 +42,6 @@ end -- 设置数量 function ItemEntity:setNum(num) - Logger.logHighlight("设置:"..num) self.data.num = num self:setDirty() end