diff --git a/src/actions/TowerAction.lua b/src/actions/TowerAction.lua index dc9af17..f9617fd 100644 --- a/src/actions/TowerAction.lua +++ b/src/actions/TowerAction.lua @@ -62,7 +62,7 @@ function _M.startBattleRpc(agent, data) if not csvdb["tower_battleCsv"][id] then return end local curCount, nextTime = getUpdateTime(towerInfo.c, towerInfo.t) - if curCount < 1 then return end -- 没有次数返回 + --if curCount < 1 then return end -- 没有次数返回 --搞起来 towerInfo.c = curCount - 1 @@ -136,10 +136,15 @@ end function _M.bugCountRpc(agent, data) local role = agent.role + local msg = MsgPack.unpack(data) + local buyCount = msg.count local towerInfo = role:getProperty("towerInfo") local curCount, nextTime = getUpdateTime(towerInfo.c, towerInfo.t) local needCount = globalCsv.tower_count_limit - curCount + if needCount > buyCount then + needCount = buyCount + end if needCount > 0 then -- 补充 local cost = globalCsv.tower_chance_item:toNumMap() for k , v in pairs(cost) do @@ -147,7 +152,7 @@ function _M.bugCountRpc(agent, data) end if not role:checkItemEnough(cost) then return end role:costItems(cost, {log = {desc = "towerCount"}}) - curCount = globalCsv.tower_count_limit + curCount = curCount + needCount end towerInfo.c = curCount towerInfo.t = nextTime -- libgit2 0.21.2