diff --git a/src/actions/AdvAction.lua b/src/actions/AdvAction.lua index 8bb467a..7cc716f 100644 --- a/src/actions/AdvAction.lua +++ b/src/actions/AdvAction.lua @@ -91,7 +91,7 @@ function _M.startAdvRpc( agent, data ) --local format = msg.format --编队 local supportIdx = msg.supportIdx --选择的支援效果 if not role:isFuncUnlock(FuncUnlock.Adv) then return end - + --上一个关卡结束才可以开始新的关卡 if role:getAdvData():isRunning() then return 8 end local advHang = role:getProperty("advHang") @@ -107,8 +107,10 @@ function _M.startAdvRpc( agent, data ) actCfg = actCfg[chapterId] if not actCfg then return 22 end - local st = toUnixtime(actCfg["unlockTime"]..string_format("%02x", RESET_TIME)) - if st > skynet.timex() then return 23 end + if actCfg["unlockTime"] ~= 0 then + local st = toUnixtime(actCfg["unlockTime"]..string_format("%02x", RESET_TIME)) + if st > skynet.timex() then return 23 end + end if actCfg["prepose"] ~= "" then local type, cid = actCfg["prepose"]:toArray(true, "=") @@ -213,6 +215,38 @@ function _M.startHangRpc(agent, data) local campId = msg.campId or 2 --营地id local format = msg.format --编队 local index = msg.index or 1--时间索引id + local actid = msg.actid + + -- 检查活动正确性 + if actid then + if not role.activity:isOpenById(actid, "AdvLevel") then + return 20 + end + local actCfg = csvdb["activity_adv_chapterCsv"][actid] + if not actCfg then return 21 end + actCfg = actCfg[chapterId] + if not actCfg then return 22 end + + local st = toUnixtime(actCfg["unlockTime"]..string_format("%02x", RESET_TIME)) + if st > skynet.timex() then return 23 end + + if actCfg["prepose"] ~= "" then + local type, cid = actCfg["prepose"]:toArray(true, "=") + if type == 1 then + local actData = role.activity:getActData("ChallengeLevel") + local battleInfo = actData[cid] or {} + if (battleInfo["star"] or 0) == 0 then + return 24 + end + elseif type == 2 then + local actData = role.activity:getActData("AdvLevel") + local advInfo = actData[cid] or {} + if not advInfo["pass"] then + return 25 + end + end + end + end local chapterData = csvdb["adv_chapter_campsiteCsv"][chapterId] if not chapterData then return 1 end -- libgit2 0.21.2