diff --git a/src/models/Daily.lua b/src/models/Daily.lua index af8f2fd..fbc4ab5 100644 --- a/src/models/Daily.lua +++ b/src/models/Daily.lua @@ -33,6 +33,7 @@ Daily.schema = { curPool = {"number", 0}, -- 属性卡池当前索引 drawHeroCnt = {"number", 0}, -- 每日抽卡次数 + treasureBase = {"number", 0}, -- 资源值 treasureList = {"table", {}}, --挂机图鉴 } @@ -142,8 +143,6 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) end curInfo = clone(treasureAttr) end - else - curInfo = clone(treasureAttr) end else curInfo = clone(treasureAttr) @@ -303,7 +302,7 @@ end function Daily:buyTreasure(treasureList) local boughtTreasurer = {} - local treasureBase = globalCsv.idle_treasure_base + local treasureBase = self:getProperty("treasureBase") for id, val in pairs(treasureList) do treasureBase = treasureBase - val.treasure_value if treasureBase < 0 then @@ -313,7 +312,7 @@ function Daily:buyTreasure(treasureList) boughtTreasurer[id] = val end end - --self:updateProperty({field = "treasureBase", value = treasureBase}) + self:updateProperty({field = "treasureBase", value = treasureBase}) return boughtTreasurer end @@ -340,6 +339,7 @@ function Daily:getTreasrueList() self:checkTreasureWeight(treasureList, tmptreasure, treasureBase) self:updateProperty({field = "treasureList", value = treasureList}) + self:updateProperty({field = "treasureBase", value = treasureBase}) return treasureList end -- libgit2 0.21.2