Commit 3dd204eb2c22925414e4fa9fbdf0cdd10995e056
Merge branch 'cn/develop_door' into cn/develop
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 | |
... | ... | @@ -144,8 +145,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) |
144 | 145 | end |
145 | 146 | curInfo = clone(treasureAttr) |
146 | 147 | end |
147 | - else | |
148 | - curInfo = clone(treasureAttr) | |
149 | 148 | end |
150 | 149 | else |
151 | 150 | curInfo = clone(treasureAttr) |
... | ... | @@ -305,7 +304,7 @@ end |
305 | 304 | |
306 | 305 | function Daily:buyTreasure(treasureList) |
307 | 306 | local boughtTreasurer = {} |
308 | - local treasureBase = globalCsv.idle_treasure_base | |
307 | + local treasureBase = self:getProperty("treasureBase") | |
309 | 308 | for id, val in pairs(treasureList) do |
310 | 309 | treasureBase = treasureBase - val.treasure_value |
311 | 310 | if treasureBase < 0 then |
... | ... | @@ -315,7 +314,7 @@ function Daily:buyTreasure(treasureList) |
315 | 314 | boughtTreasurer[id] = val |
316 | 315 | end |
317 | 316 | end |
318 | - --self:updateProperty({field = "treasureBase", value = treasureBase}) | |
317 | + self:updateProperty({field = "treasureBase", value = treasureBase}) | |
319 | 318 | return boughtTreasurer |
320 | 319 | end |
321 | 320 | |
... | ... | @@ -342,6 +341,7 @@ function Daily:getTreasrueList() |
342 | 341 | |
343 | 342 | self:checkTreasureWeight(treasureList, tmptreasure, treasureBase) |
344 | 343 | self:updateProperty({field = "treasureList", value = treasureList}) |
344 | + self:updateProperty({field = "treasureBase", value = treasureBase}) | |
345 | 345 | return treasureList |
346 | 346 | end |
347 | 347 | ... | ... |