From b8788f584a1d0facc1252671e293edf759a73302 Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Mon, 15 Mar 2021 19:22:40 +0800 Subject: [PATCH] 海港贸易季委托增加魔导石加速完成 --- src/actions/SeaportAction.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/actions/SeaportAction.lua b/src/actions/SeaportAction.lua index 1c19f95..83ad0cf 100644 --- a/src/actions/SeaportAction.lua +++ b/src/actions/SeaportAction.lua @@ -128,7 +128,7 @@ function _M.taskRpc(agent, data) local data = TaskCsv[taskId][level] if oper == 1 then -- 开始委托 if team == "" then return 3 end - local conditions = data.conditions:toTableArray(true) + local conditions = data.condition:toTableArray(true) local heros = team:toNumMap() local UnitCsv = csvdb["unitCsv"] for _, conds in pairs(conditions) do @@ -167,8 +167,16 @@ function _M.taskRpc(agent, data) if not next(collects) or not next(collect) then return 5 end + local quick = msg.quick local endTime = data.time + collect.time - if endTime > skynet.timex() then return 6 end + local remainT = skynet.timex() - endTime + if not quick and remainT > 0 then return 6 end + + if quick and remainT > 0 then + local cost = math.ceil(remainT / 3600) * globalCsv.seaport_task_quick + if not role:checkItemEnough({[ItemId.Diamond] = cost}) then return 8 end + role:costItems({[ItemId.Diamond] = cost}, {log = {desc = "seaportTask", int1 = taskId, int2 = level}}) + end local carbonCsv = csvdb["idle_battleCsv"] local expCarbonId = role:getProperty("hangInfo").expCarbonId -- libgit2 0.21.2