Commit 3dd204eb2c22925414e4fa9fbdf0cdd10995e056

Authored by zhangqijia
2 parents d42dd693 f0de8a60

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,6 +33,7 @@ Daily.schema = {
33 curPool = {"number", 0}, -- 属性卡池当前索引 33 curPool = {"number", 0}, -- 属性卡池当前索引
34 drawHeroCnt = {"number", 0}, -- 每日抽卡次数 34 drawHeroCnt = {"number", 0}, -- 每日抽卡次数
35 35
  36 + treasureBase = {"number", 0}, -- 资源值
36 treasureList = {"table", {}}, --挂机图鉴 37 treasureList = {"table", {}}, --挂机图鉴
37 } 38 }
38 39
@@ -144,8 +145,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) @@ -144,8 +145,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList)
144 end 145 end
145 curInfo = clone(treasureAttr) 146 curInfo = clone(treasureAttr)
146 end 147 end
147 - else  
148 - curInfo = clone(treasureAttr)  
149 end 148 end
150 else 149 else
151 curInfo = clone(treasureAttr) 150 curInfo = clone(treasureAttr)
@@ -305,7 +304,7 @@ end @@ -305,7 +304,7 @@ end
305 304
306 function Daily:buyTreasure(treasureList) 305 function Daily:buyTreasure(treasureList)
307 local boughtTreasurer = {} 306 local boughtTreasurer = {}
308 - local treasureBase = globalCsv.idle_treasure_base 307 + local treasureBase = self:getProperty("treasureBase")
309 for id, val in pairs(treasureList) do 308 for id, val in pairs(treasureList) do
310 treasureBase = treasureBase - val.treasure_value 309 treasureBase = treasureBase - val.treasure_value
311 if treasureBase < 0 then 310 if treasureBase < 0 then
@@ -315,7 +314,7 @@ function Daily:buyTreasure(treasureList) @@ -315,7 +314,7 @@ function Daily:buyTreasure(treasureList)
315 boughtTreasurer[id] = val 314 boughtTreasurer[id] = val
316 end 315 end
317 end 316 end
318 - --self:updateProperty({field = "treasureBase", value = treasureBase}) 317 + self:updateProperty({field = "treasureBase", value = treasureBase})
319 return boughtTreasurer 318 return boughtTreasurer
320 end 319 end
321 320
@@ -342,6 +341,7 @@ function Daily:getTreasrueList() @@ -342,6 +341,7 @@ function Daily:getTreasrueList()
342 341
343 self:checkTreasureWeight(treasureList, tmptreasure, treasureBase) 342 self:checkTreasureWeight(treasureList, tmptreasure, treasureBase)
344 self:updateProperty({field = "treasureList", value = treasureList}) 343 self:updateProperty({field = "treasureList", value = treasureList})
  344 + self:updateProperty({field = "treasureBase", value = treasureBase})
345 return treasureList 345 return treasureList
346 end 346 end
347 347