Commit f0de8a60203678f3488f9a117425f8656a5eb84f
1 parent
47343863
挖宝跨天,前一天天正在挖的宝被刷掉的bug ——没在挖的宝才刷新,资源值重置
Showing
1 changed file
with
4 additions
and
4 deletions
Show diff stats
src/models/Daily.lua
... | ... | @@ -33,6 +33,7 @@ Daily.schema = { |
33 | 33 | curPool = {"number", 0}, -- 属性卡池当前索引 |
34 | 34 | drawHeroCnt = {"number", 0}, -- 每日抽卡次数 |
35 | 35 | |
36 | + treasureBase = {"number", 0}, -- 资源值 | |
36 | 37 | treasureList = {"table", {}}, --挂机图鉴 |
37 | 38 | } |
38 | 39 | |
... | ... | @@ -142,8 +143,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) |
142 | 143 | end |
143 | 144 | curInfo = clone(treasureAttr) |
144 | 145 | end |
145 | - else | |
146 | - curInfo = clone(treasureAttr) | |
147 | 146 | end |
148 | 147 | else |
149 | 148 | curInfo = clone(treasureAttr) |
... | ... | @@ -303,7 +302,7 @@ end |
303 | 302 | |
304 | 303 | function Daily:buyTreasure(treasureList) |
305 | 304 | local boughtTreasurer = {} |
306 | - local treasureBase = globalCsv.idle_treasure_base | |
305 | + local treasureBase = self:getProperty("treasureBase") | |
307 | 306 | for id, val in pairs(treasureList) do |
308 | 307 | treasureBase = treasureBase - val.treasure_value |
309 | 308 | if treasureBase < 0 then |
... | ... | @@ -313,7 +312,7 @@ function Daily:buyTreasure(treasureList) |
313 | 312 | boughtTreasurer[id] = val |
314 | 313 | end |
315 | 314 | end |
316 | - --self:updateProperty({field = "treasureBase", value = treasureBase}) | |
315 | + self:updateProperty({field = "treasureBase", value = treasureBase}) | |
317 | 316 | return boughtTreasurer |
318 | 317 | end |
319 | 318 | |
... | ... | @@ -340,6 +339,7 @@ function Daily:getTreasrueList() |
340 | 339 | |
341 | 340 | self:checkTreasureWeight(treasureList, tmptreasure, treasureBase) |
342 | 341 | self:updateProperty({field = "treasureList", value = treasureList}) |
342 | + self:updateProperty({field = "treasureBase", value = treasureBase}) | |
343 | 343 | return treasureList |
344 | 344 | end |
345 | 345 | ... | ... |