Commit b8788f584a1d0facc1252671e293edf759a73302

Authored by chenyueqi
1 parent 65b551a7

海港贸易季委托增加魔导石加速完成

Showing 1 changed file with 10 additions and 2 deletions   Show diff stats
src/actions/SeaportAction.lua
... ... @@ -128,7 +128,7 @@ function _M.taskRpc(agent, data)
128 128 local data = TaskCsv[taskId][level]
129 129 if oper == 1 then -- 开始委托
130 130 if team == "" then return 3 end
131   - local conditions = data.conditions:toTableArray(true)
  131 + local conditions = data.condition:toTableArray(true)
132 132 local heros = team:toNumMap()
133 133 local UnitCsv = csvdb["unitCsv"]
134 134 for _, conds in pairs(conditions) do
... ... @@ -167,8 +167,16 @@ function _M.taskRpc(agent, data)
167 167 if not next(collects) or not next(collect) then
168 168 return 5
169 169 end
  170 + local quick = msg.quick
170 171 local endTime = data.time + collect.time
171   - if endTime > skynet.timex() then return 6 end
  172 + local remainT = skynet.timex() - endTime
  173 + if not quick and remainT > 0 then return 6 end
  174 +
  175 + if quick and remainT > 0 then
  176 + local cost = math.ceil(remainT / 3600) * globalCsv.seaport_task_quick
  177 + if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return 8 end
  178 + role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "seaportTask", int1 = taskId, int2 = level}})
  179 + end
172 180  
173 181 local carbonCsv = csvdb["idle_battleCsv"]
174 182 local expCarbonId = role:getProperty("hangInfo").expCarbonId
... ...