Commit 62920af9aa8dd90eeee13a2b159df9432bbd7a59
1 parent
2c6371cb
fix: 奖励关卡挑战卡消耗逻辑调整
bonusC 的数据结构修改为 {"c"=0, "b"=0}
Showing
2 changed files
with
8 additions
and
8 deletions
Show diff stats
src/actions/HangAction.lua
... | ... | @@ -570,18 +570,18 @@ function _M.buyBonusCountRpc(agent, data) |
570 | 570 | |
571 | 571 | local bonusC = role.dailyData:getProperty("bonusC") |
572 | 572 | local extraCnt = role.storeData:getBonusExtraFightCount() |
573 | - bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | |
573 | + --bonusC[btype] = bonusC[btype] or {c = 0, b = 0} | |
574 | 574 | --local lastCount = (globalCsv.bonus_daily_buy_count + role:getBnousChangeBuyCount()) * coef + extraCnt - bonusC[btype]["b"] |
575 | 575 | --if math.illegalNum(count, 1, lastCount) then return 1 end |
576 | 576 | |
577 | - local costCount = bonusC[btype]["b"] + count | |
577 | + local costCount = (bonusC["b"] or 0 )+ count | |
578 | 578 | local cost = table.findMinKeyByIndex(globalCsv.bonus_buy_cost, costCount, 1) |
579 | 579 | |
580 | 580 | if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end |
581 | 581 | |
582 | 582 | role:costItems({[ItemId.Jade] = cost}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}}) |
583 | - bonusC[btype]["b"] = costCount | |
584 | - bonusC[btype]["c"] = bonusC[btype]["c"] - count | |
583 | + bonusC["b"] = costCount | |
584 | + bonusC["c"] = (bonusC["c"] or 0) - count | |
585 | 585 | |
586 | 586 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
587 | 587 | |
... | ... | @@ -664,7 +664,7 @@ function _M.startBonusBattleRpc(agent, data) |
664 | 664 | |
665 | 665 | if bonusStar[id] and bonusStar[id] >= (1 << #bonusData.sweep_condition:toTableArray(true)) - 1 then |
666 | 666 | local bonusC = role.dailyData:getProperty("bonusC") |
667 | - bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | |
667 | + --bonusC[bonusData.type] = bonusC[bonusData.type] or {c = 0, b = 0} | |
668 | 668 | |
669 | 669 | local actData = csvdb["activity_ctrlCsv"][actId] |
670 | 670 | local extraCnt = role.storeData:getBonusExtraFightCount() |
... | ... | @@ -672,9 +672,9 @@ function _M.startBonusBattleRpc(agent, data) |
672 | 672 | if open and actData then |
673 | 673 | coef = tonumber(actData.condition2) |
674 | 674 | end |
675 | - if math.illegalNum(count, 1, (globalCsv.bonus_daily_count + role:getBnousChangeBaseCount()) * coef + extraCnt - bonusC[bonusData.type]["c"]) then return 7 end | |
675 | + if math.illegalNum(count, 1, (globalCsv.bonus_daily_count + role:getBnousChangeBaseCount()) * coef + extraCnt - (bonusC["c"] or 0)) then return 7 end | |
676 | 676 | |
677 | - bonusC[bonusData.type]["c"] = bonusC[bonusData.type]["c"] + count | |
677 | + bonusC["c"] = (bonusC["c"] or 0) + count | |
678 | 678 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
679 | 679 | |
680 | 680 | local reward, change = bonusWinReward(role, bonusData, 3, count, true) | ... | ... |
src/models/Daily.lua
... | ... | @@ -17,7 +17,7 @@ Daily.schema = { |
17 | 17 | advBC = {"number", 0}, -- 冒险次数购买次数(冒险体力购买次数) |
18 | 18 | advElBC = {"number", 0}, -- 无尽次数购买次数(冒险体力购买次数) |
19 | 19 | advWs = {"table", {}}, -- 冒险队工坊 |
20 | - bonusC = {"table", {}}, -- 奖励副本 次数 {[type] = {c = 0, b = 0}} | |
20 | + bonusC = {"table", {}}, -- 奖励副本 次数 {[type] = {c = 0, b = 0}} 修改为 {c=0, b=0} | |
21 | 21 | giveFP = {"table", {}}, -- 给谁送过心心 |
22 | 22 | getFP = {"table", {}}, -- 领过谁的心心 |
23 | 23 | pvpFree = {"number", 0}, -- pvp使用免费次数 | ... | ... |