Commit c0c490987de5c0916b1a9335c18c781fe13888a8

Authored by zhangqijia
1 parent 058b4f09

feat: 竞技场门票购买限制;挂机加速,宝藏奖励加速

Showing 2 changed files with 29 additions and 4 deletions   Show diff stats
src/actions/HangAction.lua
... ... @@ -513,6 +513,17 @@ function _M.quickRpc(agent , data)
513 513 end
514 514 end
515 515  
  516 + --宝藏加速
  517 + local treasureList= role.dailyData:quickTreasureList(hangInfo.carbonId, time) or {}
  518 + if next(treasureList) then
  519 + for id, val in pairs(treasureList) do
  520 + local award = val.award:toNumMap()
  521 + for k,v in pairs(award) do
  522 + reward[k] = (award[k] or 0) + v
  523 + end
  524 + end
  525 + end
  526 +
516 527 local change
517 528 reward, change = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}})
518 529 if reward[ItemId.Gold] then
... ...
src/models/Daily.lua
... ... @@ -22,7 +22,6 @@ Daily.schema = {
22 22 getFP = {"table", {}}, -- 领过谁的心心
23 23 pvpFree = {"number", 0}, -- pvp使用免费次数
24 24 pvpFreeH = {"number", 0}, -- 高级pvp使用免费次数
25   - pvpBought = {"number", 0}, -- pvp购买次数
26 25  
27 26 dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计
28 27 dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计
... ... @@ -70,8 +69,6 @@ function Daily:refreshDailyData(notify)
70 69 -- skip
71 70 elseif field == "treasureList" then
72 71 dataMap[field] = self:getTreasrueList()
73   - elseif field == "pvpBought" then
74   - dataMap[field] = 0
75 72 elseif field ~= "key" then
76 73 local typ, def = table.unpack(schema)
77 74 dataMap[field] = def
... ... @@ -136,6 +133,10 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList)
136 133 end
137 134 curInfo = clone(treasureAttr)
138 135 end
  136 + elseif curInfo["end_time"] then
  137 + print("end_time")
  138 + print(curInfo["end_time"])
  139 + print(skynet.timex())
139 140 end
140 141 else
141 142 curInfo = clone(treasureAttr)
... ... @@ -357,6 +358,20 @@ function Daily:checkTreasureList(chapterId)
357 358 return boughtTreasurer
358 359 end
359 360  
  361 +--宝藏加速
  362 +function Daily:quickTreasureList(chapterId, time)
  363 + local treasureList = self:getProperty("treasureList") or {}
  364 + if next(treasureList) then
  365 + for id, val in pairs(treasureList) do
  366 + if val["end_time"] and val["chapter_id"] and chapterId == val["chapter_id"] then
  367 + val["end_time"] = val["end_time"] - time
  368 + end
  369 + end
  370 + end
  371 + self:updateProperty({field = "treasureList", value = treasureList})
  372 + return self:checkTreasureList(chapterId)
  373 +end
  374 +
360 375 function Daily:data()
361 376 return {
362 377 hangQC = self:getProperty("hangQC"),
... ... @@ -370,7 +385,6 @@ function Daily:data()
370 385 getFP = self:getProperty("getFP"),
371 386 pvpFree = self:getProperty("pvpFree"),
372 387 pvpFreeH = self:getProperty("pvpFreeH"),
373   - pvpBought = self:getProperty("pvpBought"),
374 388 dailySDC = self:getProperty("dailySDC"),
375 389 dailySDD = self:getProperty("dailySDD"),
376 390 advSupRe = self:getProperty("advSupRe"),
... ...