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 | 1304 | |
1305 | 1305 | function Role:advChapterIsOpen(chapterId) |
1306 | 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 | 1314 | return true |
1309 | 1315 | end |
1310 | 1316 | |
1317 | + | |
1318 | + | |
1311 | 1319 | function Role:advEventOpenStatus() |
1312 | 1320 | local openStatus = {} |
1313 | 1321 | for func , data in pairs(csvdb["unlockCsv"]) do |
... | ... | @@ -2038,6 +2046,13 @@ function RolePlugin.bind(Role) |
2038 | 2046 | return (hangPass[diff] or 0) >= carbonId |
2039 | 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 | 2056 | function Role:hangFinish(carbonId) |
2042 | 2057 | local hangPass = self:getProperty("hangPass") |
2043 | 2058 | local diff = math.floor(carbonId / 10000) | ... | ... |