Commit fe5622155f777b398e837223f20114b696a810d5
1 parent
37f8fb69
拾荒章节解锁条件修改
Showing
1 changed file
with
16 additions
and
1 deletions
Show diff stats
src/models/RolePlugin.lua
@@ -1304,10 +1304,18 @@ function RolePlugin.bind(Role) | @@ -1304,10 +1304,18 @@ function RolePlugin.bind(Role) | ||
1304 | 1304 | ||
1305 | function Role:advChapterIsOpen(chapterId) | 1305 | function Role:advChapterIsOpen(chapterId) |
1306 | local chapterData = csvdb["adv_chapterCsv"][chapterId] | 1306 | local chapterData = csvdb["adv_chapterCsv"][chapterId] |
1307 | - if chapterData.prepose ~= 0 and not self:checkHangPass(chapterData.prepose) then return false end | 1307 | + if chapterData.prepose == "" then return true end |
1308 | + local prepose = chapterData.prepose:toArray(true,"=") | ||
1309 | + if prepose[1] == 1 then | ||
1310 | + if chapterData.prepose ~= 0 and not self:checkHangPass(prepose[2]) then return false end | ||
1311 | + else | ||
1312 | + return self:checkAdvChapterPass(prepose[2]) | ||
1313 | + end | ||
1308 | return true | 1314 | return true |
1309 | end | 1315 | end |
1310 | 1316 | ||
1317 | + | ||
1318 | + | ||
1311 | function Role:advEventOpenStatus() | 1319 | function Role:advEventOpenStatus() |
1312 | local openStatus = {} | 1320 | local openStatus = {} |
1313 | for func , data in pairs(csvdb["unlockCsv"]) do | 1321 | for func , data in pairs(csvdb["unlockCsv"]) do |
@@ -2038,6 +2046,13 @@ function RolePlugin.bind(Role) | @@ -2038,6 +2046,13 @@ function RolePlugin.bind(Role) | ||
2038 | return (hangPass[diff] or 0) >= carbonId | 2046 | return (hangPass[diff] or 0) >= carbonId |
2039 | end | 2047 | end |
2040 | 2048 | ||
2049 | + function Role:checkAdvChapterPass(chapterId) | ||
2050 | + local chapterData = csvdb["adv_chapterCsv"][chapterId] | ||
2051 | + local advPass = self:getProperty("advPass") or {} | ||
2052 | + local pass = advPass[chapterId] or 0 | ||
2053 | + return pass >= chapterData.limitlevel | ||
2054 | + end | ||
2055 | + | ||
2041 | function Role:hangFinish(carbonId) | 2056 | function Role:hangFinish(carbonId) |
2042 | local hangPass = self:getProperty("hangPass") | 2057 | local hangPass = self:getProperty("hangPass") |
2043 | local diff = math.floor(carbonId / 10000) | 2058 | local diff = math.floor(carbonId / 10000) |