diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index a2aea2a..4cc4423 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -636,10 +636,10 @@ function _M.wheelSurfRpc(agent, data) local drawData = drawTypeData[role:getAdvWheelSurfLv(ptype)] if not drawData then return 4 end - local costs = drawData.cost:toNumMap() - for id, count_ in pairs(costs) do - costs[id] = count_ * count - end + local cost = drawData.cost:toArray(true, "=") + local costs = {[ItemId.OldCoin] = cost[ctype]} + if not next(costs) then return 6 end + if not role:checkItemEnough(costs) then return 5 end role:costItems(costs, {log = {desc = "advWheelSurf", int1 = ptype}}) @@ -648,10 +648,10 @@ function _M.wheelSurfRpc(agent, data) advDrawB[ptype] = (advDrawB[ptype] or 0) + count role:updateProperty({field = "advDrawB", value = advDrawB}) -- 随机池子 - local pool = drawData.weight:randWeight() local reward = {} local backReward = {} for i = 1, count do + local pool = drawData.weight:randWeight() local gift = drawData["pool" .. pool]:randWeight(true) reward[gift[1]] = (reward[gift[1]] or 0) + gift[2] table.insert(backReward, gift) -- libgit2 0.21.2