From c6a4c4567fcbeb999beee5968d25b83d82f77287 Mon Sep 17 00:00:00 2001 From: liuzujun <307836273@qq.com> Date: Thu, 1 Apr 2021 13:31:16 +0800 Subject: [PATCH] boss挑战门票购买可以超出上限 --- src/actions/StoreAction.lua | 2 +- src/csvdata | 2 +- src/models/Activity.lua | 5 +++++ src/models/RoleLog.lua | 1 + src/models/RolePlugin.lua | 5 +++-- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/actions/StoreAction.lua b/src/actions/StoreAction.lua index f8e4708..efbca10 100644 --- a/src/actions/StoreAction.lua +++ b/src/actions/StoreAction.lua @@ -182,7 +182,7 @@ function _M.shopBuyRpc(agent , data) local cost = {[dataSet.icon] = dataSet.cost * count} - local desc = "unknown" + local desc = "unknowShop" if dataSet.shop == 1 then -- 普通商店 desc = "dailyShop" local dailySDD = role.dailyData:getProperty("dailySDD") diff --git a/src/csvdata b/src/csvdata index ec92ed5..2499d73 160000 --- a/src/csvdata +++ b/src/csvdata @@ -1 +1 @@ -Subproject commit ec92ed50d3d5ff9655b1715239e7fda48f8ef5cb +Subproject commit 2499d73adbdf6ea3562ce3a815d3189e3a3aab7c diff --git a/src/models/Activity.lua b/src/models/Activity.lua index d9ea70e..c27eca3 100644 --- a/src/models/Activity.lua +++ b/src/models/Activity.lua @@ -884,6 +884,11 @@ function Activity:getBattleTicket(actId) local ticketId, init, limit, duration = arr[1] or 0, arr[2] or 0, arr[3] or 0, arr[4] or 10000 local count = actData["ticket"] or init + if count >= limit then + actData["ts"] = timeNow + self:updateActData("ChallengeLevel", actData) + return + end local add = math.max(math.floor((timeNow - startTs) / (duration * 60)), 0) local newCount= math.min(count + add, limit) diff --git a/src/models/RoleLog.lua b/src/models/RoleLog.lua index 3abbfb6..95aae96 100644 --- a/src/models/RoleLog.lua +++ b/src/models/RoleLog.lua @@ -58,6 +58,7 @@ local ItemReason = { newSign = 142,-- 新的活动签到 advLevelStage = 143, -- 拾荒活动阶段奖励 towerBnous = 144, -- 爬塔到一定层数对某些功能的奖励 + unknowShop = 145, -- 未知商店 advHang = 301, -- 拾荒挂机 diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 16c7c9b..cb576fb 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -141,7 +141,9 @@ function RolePlugin.bind(Role) self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) end, [ItemType.BossTicket] = function () - if not self.activity:isOpen("ChallengeLevel") then return end + local isOpen, actId = self.activity:isOpen("ChallengeLevel") + if not isOpen then return end + self.activity:getBattleTicket(actId) local actData = self.activity:getActData("ChallengeLevel") actData["ticket"] = (actData["ticket"] or 0) + count self.activity:updateActData("ChallengeLevel", actData) @@ -852,7 +854,6 @@ function RolePlugin.bind(Role) if not params.notNotify then local response = {} table.insert(response, newSpark:data()) - dump(response) SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) end --self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) -- libgit2 0.21.2