From fe5622155f777b398e837223f20114b696a810d5 Mon Sep 17 00:00:00 2001 From: chenyueqi Date: Sat, 8 May 2021 15:10:01 +0800 Subject: [PATCH] 拾荒章节解锁条件修改 --- src/models/RolePlugin.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index 1fcb367..2a94ef0 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -1304,10 +1304,18 @@ function RolePlugin.bind(Role) function Role:advChapterIsOpen(chapterId) local chapterData = csvdb["adv_chapterCsv"][chapterId] - if chapterData.prepose ~= 0 and not self:checkHangPass(chapterData.prepose) then return false end + if chapterData.prepose == "" then return true end + local prepose = chapterData.prepose:toArray(true,"=") + if prepose[1] == 1 then + if chapterData.prepose ~= 0 and not self:checkHangPass(prepose[2]) then return false end + else + return self:checkAdvChapterPass(prepose[2]) + end return true end + + function Role:advEventOpenStatus() local openStatus = {} for func , data in pairs(csvdb["unlockCsv"]) do @@ -2038,6 +2046,13 @@ function RolePlugin.bind(Role) return (hangPass[diff] or 0) >= carbonId end + function Role:checkAdvChapterPass(chapterId) + local chapterData = csvdb["adv_chapterCsv"][chapterId] + local advPass = self:getProperty("advPass") or {} + local pass = advPass[chapterId] or 0 + return pass >= chapterData.limitlevel + end + function Role:hangFinish(carbonId) local hangPass = self:getProperty("hangPass") local diff = math.floor(carbonId / 10000) -- libgit2 0.21.2