Commit 498ca20083bdb051e62d2991342f9c27ae7e227a
1 parent
b3593354
取消爬塔次数
Showing
1 changed file
with
7 additions
and
2 deletions
Show diff stats
src/actions/TowerAction.lua
| ... | ... | @@ -62,7 +62,7 @@ function _M.startBattleRpc(agent, data) |
| 62 | 62 | |
| 63 | 63 | if not csvdb["tower_battleCsv"][id] then return end |
| 64 | 64 | local curCount, nextTime = getUpdateTime(towerInfo.c, towerInfo.t) |
| 65 | - if curCount < 1 then return end -- 没有次数返回 | |
| 65 | + --if curCount < 1 then return end -- 没有次数返回 | |
| 66 | 66 | |
| 67 | 67 | --搞起来 |
| 68 | 68 | towerInfo.c = curCount - 1 |
| ... | ... | @@ -136,10 +136,15 @@ end |
| 136 | 136 | |
| 137 | 137 | function _M.bugCountRpc(agent, data) |
| 138 | 138 | local role = agent.role |
| 139 | + local msg = MsgPack.unpack(data) | |
| 140 | + local buyCount = msg.count | |
| 139 | 141 | |
| 140 | 142 | local towerInfo = role:getProperty("towerInfo") |
| 141 | 143 | local curCount, nextTime = getUpdateTime(towerInfo.c, towerInfo.t) |
| 142 | 144 | local needCount = globalCsv.tower_count_limit - curCount |
| 145 | + if needCount > buyCount then | |
| 146 | + needCount = buyCount | |
| 147 | + end | |
| 143 | 148 | if needCount > 0 then -- 补充 |
| 144 | 149 | local cost = globalCsv.tower_chance_item:toNumMap() |
| 145 | 150 | for k , v in pairs(cost) do |
| ... | ... | @@ -147,7 +152,7 @@ function _M.bugCountRpc(agent, data) |
| 147 | 152 | end |
| 148 | 153 | if not role:checkItemEnough(cost) then return end |
| 149 | 154 | role:costItems(cost, {log = {desc = "towerCount"}}) |
| 150 | - curCount = globalCsv.tower_count_limit | |
| 155 | + curCount = curCount + needCount | |
| 151 | 156 | end |
| 152 | 157 | towerInfo.c = curCount |
| 153 | 158 | towerInfo.t = nextTime | ... | ... |