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,18 +570,18 @@ function _M.buyBonusCountRpc(agent, data) | ||
570 | 570 | ||
571 | local bonusC = role.dailyData:getProperty("bonusC") | 571 | local bonusC = role.dailyData:getProperty("bonusC") |
572 | local extraCnt = role.storeData:getBonusExtraFightCount() | 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 | --local lastCount = (globalCsv.bonus_daily_buy_count + role:getBnousChangeBuyCount()) * coef + extraCnt - bonusC[btype]["b"] | 574 | --local lastCount = (globalCsv.bonus_daily_buy_count + role:getBnousChangeBuyCount()) * coef + extraCnt - bonusC[btype]["b"] |
575 | --if math.illegalNum(count, 1, lastCount) then return 1 end | 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 | local cost = table.findMinKeyByIndex(globalCsv.bonus_buy_cost, costCount, 1) | 578 | local cost = table.findMinKeyByIndex(globalCsv.bonus_buy_cost, costCount, 1) |
579 | 579 | ||
580 | if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end | 580 | if not role:checkItemEnough({[ItemId.Jade] = cost}) then return 2 end |
581 | 581 | ||
582 | role:costItems({[ItemId.Jade] = cost}, {log = {desc = "buyBonusCount", int1 = btype, int2 = count}}) | 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 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 586 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
587 | 587 | ||
@@ -664,7 +664,7 @@ function _M.startBonusBattleRpc(agent, data) | @@ -664,7 +664,7 @@ function _M.startBonusBattleRpc(agent, data) | ||
664 | 664 | ||
665 | if bonusStar[id] and bonusStar[id] >= (1 << #bonusData.sweep_condition:toTableArray(true)) - 1 then | 665 | if bonusStar[id] and bonusStar[id] >= (1 << #bonusData.sweep_condition:toTableArray(true)) - 1 then |
666 | local bonusC = role.dailyData:getProperty("bonusC") | 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 | local actData = csvdb["activity_ctrlCsv"][actId] | 669 | local actData = csvdb["activity_ctrlCsv"][actId] |
670 | local extraCnt = role.storeData:getBonusExtraFightCount() | 670 | local extraCnt = role.storeData:getBonusExtraFightCount() |
@@ -672,9 +672,9 @@ function _M.startBonusBattleRpc(agent, data) | @@ -672,9 +672,9 @@ function _M.startBonusBattleRpc(agent, data) | ||
672 | if open and actData then | 672 | if open and actData then |
673 | coef = tonumber(actData.condition2) | 673 | coef = tonumber(actData.condition2) |
674 | end | 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 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) | 678 | role.dailyData:updateProperty({field = "bonusC", value = bonusC}) |
679 | 679 | ||
680 | local reward, change = bonusWinReward(role, bonusData, 3, count, true) | 680 | local reward, change = bonusWinReward(role, bonusData, 3, count, true) |
src/models/Daily.lua
@@ -17,7 +17,7 @@ Daily.schema = { | @@ -17,7 +17,7 @@ Daily.schema = { | ||
17 | advBC = {"number", 0}, -- 冒险次数购买次数(冒险体力购买次数) | 17 | advBC = {"number", 0}, -- 冒险次数购买次数(冒险体力购买次数) |
18 | advElBC = {"number", 0}, -- 无尽次数购买次数(冒险体力购买次数) | 18 | advElBC = {"number", 0}, -- 无尽次数购买次数(冒险体力购买次数) |
19 | advWs = {"table", {}}, -- 冒险队工坊 | 19 | advWs = {"table", {}}, -- 冒险队工坊 |
20 | - bonusC = {"table", {}}, -- 奖励副本 次数 {[type] = {c = 0, b = 0}} | 20 | + bonusC = {"table", {}}, -- 奖励副本 次数 {[type] = {c = 0, b = 0}} 修改为 {c=0, b=0} |
21 | giveFP = {"table", {}}, -- 给谁送过心心 | 21 | giveFP = {"table", {}}, -- 给谁送过心心 |
22 | getFP = {"table", {}}, -- 领过谁的心心 | 22 | getFP = {"table", {}}, -- 领过谁的心心 |
23 | pvpFree = {"number", 0}, -- pvp使用免费次数 | 23 | pvpFree = {"number", 0}, -- pvp使用免费次数 |