Commit 9e1a93c2798990cb65932d53e0d7a744f72883f2
1 parent
94e886cc
快速挂机掉落浮点数取整
Showing
2 changed files
with
9 additions
and
7 deletions
Show diff stats
src/actions/HangAction.lua
... | ... | @@ -39,9 +39,9 @@ local function checkReward(role) |
39 | 39 | |
40 | 40 | local items = role:getProperty("hangBag") |
41 | 41 | coinCount = coinCount + coinDoubleCount |
42 | - items[ItemId.Gold] = (items[ItemId.Gold] or 0) + coinCount * carbonData.money | |
43 | - items[ItemId.Exp] = (items[ItemId.Exp] or 0) + coinCount * carbonData.exp | |
44 | - items[ItemId.PlayerExp] = (items[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp | |
42 | + items[ItemId.Gold] = math.floor((items[ItemId.Gold] or 0) + coinCount * carbonData.money) | |
43 | + items[ItemId.Exp] = math.floor((items[ItemId.Exp] or 0) + coinCount * carbonData.exp) | |
44 | + items[ItemId.PlayerExp] = math.floor((items[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) | |
45 | 45 | |
46 | 46 | local pool = {} |
47 | 47 | for _, temp in pairs(carbonData.item:toArray()) do |
... | ... | @@ -417,8 +417,9 @@ function _M.quickRpc(agent , data) |
417 | 417 | |
418 | 418 | local coinCount = math.floor(time / globalCsv.idle_money_produce_cd) |
419 | 419 | local itemCount = math.floor(time / globalCsv.idle_item_produce_cd) |
420 | - reward[ItemId.Gold] = (reward[ItemId.Gold] or 0) + coinCount * carbonData.money | |
421 | - reward[ItemId.Exp] = (reward[ItemId.Exp] or 0) + coinCount * carbonData.exp | |
420 | + reward[ItemId.Gold] = math.floor((reward[ItemId.Gold] or 0) + coinCount * carbonData.money) | |
421 | + reward[ItemId.Exp] = math.floor((reward[ItemId.Exp] or 0) + coinCount * carbonData.exp) | |
422 | + reward[ItemId.PlayerExp] = math.floor((reward[ItemId.PlayerExp] or 0) + coinCount * carbonData.playerExp) | |
422 | 423 | |
423 | 424 | local pool = {} |
424 | 425 | for _, temp in pairs(carbonData.item:toArray()) do |
... | ... | @@ -429,11 +430,13 @@ function _M.quickRpc(agent , data) |
429 | 430 | reward[cur[1]] = (reward[cur[1]] or 0) + cur[2] |
430 | 431 | end |
431 | 432 | |
433 | + local doubleCoef = role.activity:isOpen("DoubleDrop") and 2 or 1 | |
434 | + | |
432 | 435 | -- 特权卡获取加速获得额外道具 |
433 | 436 | local coef = role.storeData:getProduceItemSpeedCoef() |
434 | 437 | if coef > 1 then |
435 | 438 | for k, cnt in pairs(reward) do |
436 | - reward[k] = math.floor(cnt * coef) | |
439 | + reward[k] = math.floor(cnt * coef * doubleCoef) | |
437 | 440 | end |
438 | 441 | end |
439 | 442 | ... | ... |
src/models/Activity.lua
... | ... | @@ -293,7 +293,6 @@ activityFunc[Activity.ActivityType.AdvDraw] = { |
293 | 293 | -- ["close"] = function(self, actType, notify) |
294 | 294 | -- end, |
295 | 295 | ["crossDay"] = function(self, actType, notify) |
296 | - print("cross day act adv cost") | |
297 | 296 | self.owner:sendMail(MailId.ActAdvDraw) |
298 | 297 | end, |
299 | 298 | } | ... | ... |