Commit 206c38f5e136228134345c6ccf72d3253f10d8e8
Merge branch 'tr/bugfix' into tr/publish/release
Showing
4 changed files
with
16 additions
and
9 deletions
Show diff stats
src/adv/Adv.lua
@@ -1127,10 +1127,17 @@ function Adv:supplyPotion() | @@ -1127,10 +1127,17 @@ function Adv:supplyPotion() | ||
1127 | for potionId, set in pairs(potionCsv) do | 1127 | for potionId, set in pairs(potionCsv) do |
1128 | local count = potionBag[potionId] or 0 | 1128 | local count = potionBag[potionId] or 0 |
1129 | if count > 0 then | 1129 | if count > 0 then |
1130 | - local level = dishTree:getv(potionId,1) | ||
1131 | - local num = math.min(set[level].limit,count) | ||
1132 | - advItems = advItems:setv(potionId,num) | ||
1133 | - potionBag[potionId] = num ~= count and (count - num) or nil | 1130 | + local max = set[dishTree:getv(potionId,1)].limit |
1131 | + local old = advItems:getv(potionId,0) | ||
1132 | + local need = max - old | ||
1133 | + | ||
1134 | + if need < count then | ||
1135 | + advItems = advItems:setv(potionId,max) | ||
1136 | + potionBag[potionId] = count - need | ||
1137 | + else | ||
1138 | + advItems = advItems:setv(potionId,old + count) | ||
1139 | + potionBag[potionId] = nil | ||
1140 | + end | ||
1134 | end | 1141 | end |
1135 | end | 1142 | end |
1136 | self.owner:updateProperties({ | 1143 | self.owner:updateProperties({ |
src/models/Activity.lua
@@ -455,7 +455,7 @@ activityFunc[Activity.ActivityType.PayBack] = { | @@ -455,7 +455,7 @@ activityFunc[Activity.ActivityType.PayBack] = { | ||
455 | -- 英雄帖 | 455 | -- 英雄帖 |
456 | activityFunc[Activity.ActivityType.CalendaTask] = { | 456 | activityFunc[Activity.ActivityType.CalendaTask] = { |
457 | ["init"] = function(self, actType, isCrossDay, notify) | 457 | ["init"] = function(self, actType, isCrossDay, notify) |
458 | - local calTask = self.owner:getProperty("CalTask") | 458 | + local calTask = self.owner:getProperty("calTask") |
459 | calTask = {} | 459 | calTask = {} |
460 | local role = self.owner | 460 | local role = self.owner |
461 | local buildL = role.dinerData:getProperty("buildL") | 461 | local buildL = role.dinerData:getProperty("buildL") |
@@ -481,7 +481,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = { | @@ -481,7 +481,7 @@ activityFunc[Activity.ActivityType.CalendaTask] = { | ||
481 | 481 | ||
482 | end, | 482 | end, |
483 | ["close"] = function(self, actType, notify) | 483 | ["close"] = function(self, actType, notify) |
484 | - self.owner:updateProperty({field="CalTask", value={}}) | 484 | + self.owner:updateProperty({field="calTask", value={}}) |
485 | end, | 485 | end, |
486 | } | 486 | } |
487 | 487 | ||
@@ -874,7 +874,7 @@ activityFunc[Activity.ActivityType.CommonSignIn] = { | @@ -874,7 +874,7 @@ activityFunc[Activity.ActivityType.CommonSignIn] = { | ||
874 | ["crossDay"] = function(self, actType, notify, actId) | 874 | ["crossDay"] = function(self, actType, notify, actId) |
875 | local actCfg = csvdb["activity_ctrlCsv"][actId] | 875 | local actCfg = csvdb["activity_ctrlCsv"][actId] |
876 | if not actCfg then return end | 876 | if not actCfg then return end |
877 | - local conArr = actCfg.condition2:toArray("true", "=") | 877 | + local conArr = actCfg.condition2:toArray(true, "=") |
878 | -- 0 登录即可, 1 达到指定活跃度 | 878 | -- 0 登录即可, 1 达到指定活跃度 |
879 | if conArr[1] ~= 0 then | 879 | if conArr[1] ~= 0 then |
880 | return | 880 | return |
src/models/Diner.lua
@@ -201,7 +201,7 @@ function Diner:calSellReward(sell, delta, dishData) | @@ -201,7 +201,7 @@ function Diner:calSellReward(sell, delta, dishData) | ||
201 | upValue[ItemId.Gold] = (upValue[ItemId.Gold] or 0) + buildData.gold_up | 201 | upValue[ItemId.Gold] = (upValue[ItemId.Gold] or 0) + buildData.gold_up |
202 | end | 202 | end |
203 | if buildData.item_up > 0 then | 203 | if buildData.item_up > 0 then |
204 | - upValue[ItemId.DinerCoin] = (upValue[ItemId.DinerCoin] or 0) + buildData.gold_up | 204 | + upValue[ItemId.DinerCoin] = (upValue[ItemId.DinerCoin] or 0) + buildData.item_up |
205 | end | 205 | end |
206 | if buildData and buildData.famous_up > 0 then | 206 | if buildData and buildData.famous_up > 0 then |
207 | upValue[-1] = (upValue[-1] or 0) + buildData.famous_up | 207 | upValue[-1] = (upValue[-1] or 0) + buildData.famous_up |
src/models/RoleTask.lua
@@ -706,7 +706,7 @@ function RoleTask.bind(Role) | @@ -706,7 +706,7 @@ function RoleTask.bind(Role) | ||
706 | calTask[id] = count | 706 | calTask[id] = count |
707 | elseif cfg.type == 20 then -- 开启x品质时钟箱子 | 707 | elseif cfg.type == 20 then -- 开启x品质时钟箱子 |
708 | if cfg.condition2 <= (param2 or 0) then | 708 | if cfg.condition2 <= (param2 or 0) then |
709 | - calTask[id] = (calTask[id] or 0) + param2 | 709 | + calTask[id] = (calTask[id] or 0) + param1 |
710 | end | 710 | end |
711 | elseif cfg.type == 15 then -- 通关关卡 | 711 | elseif cfg.type == 15 then -- 通关关卡 |
712 | if (calTask[id] or 0) == 0 then | 712 | if (calTask[id] or 0) == 0 then |