Commit c0c490987de5c0916b1a9335c18c781fe13888a8
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,6 +513,17 @@ function _M.quickRpc(agent , data) | ||
513 | end | 513 | end |
514 | end | 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 | local change | 527 | local change |
517 | reward, change = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) | 528 | reward, change = role:award(reward, {log = {desc = "quickHang", int1 = hangInfo.carbonId}}) |
518 | if reward[ItemId.Gold] then | 529 | if reward[ItemId.Gold] then |
src/models/Daily.lua
@@ -22,7 +22,6 @@ Daily.schema = { | @@ -22,7 +22,6 @@ Daily.schema = { | ||
22 | getFP = {"table", {}}, -- 领过谁的心心 | 22 | getFP = {"table", {}}, -- 领过谁的心心 |
23 | pvpFree = {"number", 0}, -- pvp使用免费次数 | 23 | pvpFree = {"number", 0}, -- pvp使用免费次数 |
24 | pvpFreeH = {"number", 0}, -- 高级pvp使用免费次数 | 24 | pvpFreeH = {"number", 0}, -- 高级pvp使用免费次数 |
25 | - pvpBought = {"number", 0}, -- pvp购买次数 | ||
26 | 25 | ||
27 | dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计 | 26 | dailySDC = {"table", {}}, -- daily shop diamond count {[id] = count} -- 每日商城购买次数统计 |
28 | dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计 | 27 | dailySDD = {"table", {}}, -- daily shop diamond disount {[id] = 1} -- 每日商城折扣统计 |
@@ -70,8 +69,6 @@ function Daily:refreshDailyData(notify) | @@ -70,8 +69,6 @@ function Daily:refreshDailyData(notify) | ||
70 | -- skip | 69 | -- skip |
71 | elseif field == "treasureList" then | 70 | elseif field == "treasureList" then |
72 | dataMap[field] = self:getTreasrueList() | 71 | dataMap[field] = self:getTreasrueList() |
73 | - elseif field == "pvpBought" then | ||
74 | - dataMap[field] = 0 | ||
75 | elseif field ~= "key" then | 72 | elseif field ~= "key" then |
76 | local typ, def = table.unpack(schema) | 73 | local typ, def = table.unpack(schema) |
77 | dataMap[field] = def | 74 | dataMap[field] = def |
@@ -136,6 +133,10 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) | @@ -136,6 +133,10 @@ function Daily:checkTreasureExpired(treasureAttr, treasureList) | ||
136 | end | 133 | end |
137 | curInfo = clone(treasureAttr) | 134 | curInfo = clone(treasureAttr) |
138 | end | 135 | end |
136 | + elseif curInfo["end_time"] then | ||
137 | + print("end_time") | ||
138 | + print(curInfo["end_time"]) | ||
139 | + print(skynet.timex()) | ||
139 | end | 140 | end |
140 | else | 141 | else |
141 | curInfo = clone(treasureAttr) | 142 | curInfo = clone(treasureAttr) |
@@ -357,6 +358,20 @@ function Daily:checkTreasureList(chapterId) | @@ -357,6 +358,20 @@ function Daily:checkTreasureList(chapterId) | ||
357 | return boughtTreasurer | 358 | return boughtTreasurer |
358 | end | 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 | function Daily:data() | 375 | function Daily:data() |
361 | return { | 376 | return { |
362 | hangQC = self:getProperty("hangQC"), | 377 | hangQC = self:getProperty("hangQC"), |
@@ -370,7 +385,6 @@ function Daily:data() | @@ -370,7 +385,6 @@ function Daily:data() | ||
370 | getFP = self:getProperty("getFP"), | 385 | getFP = self:getProperty("getFP"), |
371 | pvpFree = self:getProperty("pvpFree"), | 386 | pvpFree = self:getProperty("pvpFree"), |
372 | pvpFreeH = self:getProperty("pvpFreeH"), | 387 | pvpFreeH = self:getProperty("pvpFreeH"), |
373 | - pvpBought = self:getProperty("pvpBought"), | ||
374 | dailySDC = self:getProperty("dailySDC"), | 388 | dailySDC = self:getProperty("dailySDC"), |
375 | dailySDD = self:getProperty("dailySDD"), | 389 | dailySDD = self:getProperty("dailySDD"), |
376 | advSupRe = self:getProperty("advSupRe"), | 390 | advSupRe = self:getProperty("advSupRe"), |