Commit d4ed4fa104fb7241a6f25dab746c95e132bf6d91
Merge branch 'tr/bugfix' into tr/publish/preview
* tr/bugfix: boss挑战门票购买可以超出上限 bug修复:扫荡会多给一次奖励 # Conflicts: # src/csvdata
Showing
5 changed files
with
16 additions
and
9 deletions
Show diff stats
src/actions/HangAction.lua
@@ -755,23 +755,23 @@ end | @@ -755,23 +755,23 @@ end | ||
755 | local function workWinReward(role, bonusData, rewardType, count, sweep) | 755 | local function workWinReward(role, bonusData, rewardType, count, sweep) |
756 | count = count or 1 | 756 | count = count or 1 |
757 | local reward, change = {} | 757 | local reward, change = {} |
758 | + | ||
759 | + | ||
760 | + reward = bonusData.reward:toNumMap() | ||
761 | + for itemId, c in pairs(reward) do | ||
762 | + reward[itemId] = c * count | ||
763 | + end | ||
758 | if rewardType == 2 or rewardType == 4 then | 764 | if rewardType == 2 or rewardType == 4 then |
759 | for k, v in pairs(bonusData.perfect_reward:toNumMap()) do | 765 | for k, v in pairs(bonusData.perfect_reward:toNumMap()) do |
760 | reward[k] = (reward[k] or 0) + v | 766 | reward[k] = (reward[k] or 0) + v |
761 | end | 767 | end |
762 | end | 768 | end |
763 | - | ||
764 | - reward = bonusData.reward:toNumMap() | ||
765 | - for itemId, c in pairs(reward) do | ||
766 | - reward[itemId] = (reward[itemId] or 0) + c * count | ||
767 | - end | ||
768 | for i = 1, count do | 769 | for i = 1, count do |
769 | local chance = bonusData.chance:randWeight(true) | 770 | local chance = bonusData.chance:randWeight(true) |
770 | if chance[1] ~= 0 then | 771 | if chance[1] ~= 0 then |
771 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] | 772 | reward[chance[1]] = (reward[chance[1]] or 0) + chance[2] |
772 | end | 773 | end |
773 | end | 774 | end |
774 | - | ||
775 | reward, change = role:award(reward, {log = {desc = "workBattle", int1 = bonusData.id}}) | 775 | reward, change = role:award(reward, {log = {desc = "workBattle", int1 = bonusData.id}}) |
776 | return reward, change | 776 | return reward, change |
777 | end | 777 | end |
src/actions/StoreAction.lua
@@ -183,7 +183,7 @@ function _M.shopBuyRpc(agent , data) | @@ -183,7 +183,7 @@ function _M.shopBuyRpc(agent , data) | ||
183 | 183 | ||
184 | local cost = {[dataSet.icon] = dataSet.cost * count} | 184 | local cost = {[dataSet.icon] = dataSet.cost * count} |
185 | 185 | ||
186 | - local desc = "unknown" | 186 | + local desc = "unknowShop" |
187 | if dataSet.shop == 1 then -- 普通商店 | 187 | if dataSet.shop == 1 then -- 普通商店 |
188 | desc = "dailyShop" | 188 | desc = "dailyShop" |
189 | local dailySDD = role.dailyData:getProperty("dailySDD") | 189 | local dailySDD = role.dailyData:getProperty("dailySDD") |
src/models/Activity.lua
@@ -884,6 +884,11 @@ function Activity:getBattleTicket(actId) | @@ -884,6 +884,11 @@ function Activity:getBattleTicket(actId) | ||
884 | local ticketId, init, limit, duration = arr[1] or 0, arr[2] or 0, arr[3] or 0, arr[4] or 10000 | 884 | local ticketId, init, limit, duration = arr[1] or 0, arr[2] or 0, arr[3] or 0, arr[4] or 10000 |
885 | 885 | ||
886 | local count = actData["ticket"] or init | 886 | local count = actData["ticket"] or init |
887 | + if count >= limit then | ||
888 | + actData["ts"] = timeNow | ||
889 | + self:updateActData("ChallengeLevel", actData) | ||
890 | + return | ||
891 | + end | ||
887 | local add = math.max(math.floor((timeNow - startTs) / (duration * 60)), 0) | 892 | local add = math.max(math.floor((timeNow - startTs) / (duration * 60)), 0) |
888 | 893 | ||
889 | local newCount= math.min(count + add, limit) | 894 | local newCount= math.min(count + add, limit) |
src/models/RoleLog.lua
@@ -58,6 +58,7 @@ local ItemReason = { | @@ -58,6 +58,7 @@ local ItemReason = { | ||
58 | newSign = 142,-- 新的活动签到 | 58 | newSign = 142,-- 新的活动签到 |
59 | advLevelStage = 143, -- 拾荒活动阶段奖励 | 59 | advLevelStage = 143, -- 拾荒活动阶段奖励 |
60 | towerBnous = 144, -- 爬塔到一定层数对某些功能的奖励 | 60 | towerBnous = 144, -- 爬塔到一定层数对某些功能的奖励 |
61 | + unknowShop = 145, -- 未知商店 | ||
61 | 62 | ||
62 | 63 | ||
63 | advHang = 301, -- 拾荒挂机 | 64 | advHang = 301, -- 拾荒挂机 |
src/models/RolePlugin.lua
@@ -141,7 +141,9 @@ function RolePlugin.bind(Role) | @@ -141,7 +141,9 @@ function RolePlugin.bind(Role) | ||
141 | self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) | 141 | self:addPotion({id = itemId, count = count, notNotify = pms.notNotify, log = pms.log}) |
142 | end, | 142 | end, |
143 | [ItemType.BossTicket] = function () | 143 | [ItemType.BossTicket] = function () |
144 | - if not self.activity:isOpen("ChallengeLevel") then return end | 144 | + local isOpen, actId = self.activity:isOpen("ChallengeLevel") |
145 | + if not isOpen then return end | ||
146 | + self.activity:getBattleTicket(actId) | ||
145 | local actData = self.activity:getActData("ChallengeLevel") | 147 | local actData = self.activity:getActData("ChallengeLevel") |
146 | actData["ticket"] = (actData["ticket"] or 0) + count | 148 | actData["ticket"] = (actData["ticket"] or 0) + count |
147 | self.activity:updateActData("ChallengeLevel", actData) | 149 | self.activity:updateActData("ChallengeLevel", actData) |
@@ -852,7 +854,6 @@ function RolePlugin.bind(Role) | @@ -852,7 +854,6 @@ function RolePlugin.bind(Role) | ||
852 | if not params.notNotify then | 854 | if not params.notNotify then |
853 | local response = {} | 855 | local response = {} |
854 | table.insert(response, newSpark:data()) | 856 | table.insert(response, newSpark:data()) |
855 | - dump(response) | ||
856 | SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) | 857 | SendPacket(actionCodes.Role_loadSparks, MsgPack.pack(response)) |
857 | end | 858 | end |
858 | --self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) | 859 | --self:checkTaskEnter("AddRune", {id = params.id, type = params.type, rarity = data.rarity}, params.notNotify) |