Commit 4d9435865634aadd6a18a4c77a8ddbc71aeef7c9
1 parent
4faef572
直通 advt gm
Showing
7 changed files
with
34 additions
and
30 deletions
Show diff stats
src/actions/AdvAction.lua
@@ -59,20 +59,9 @@ function _M.startAdvRpc( agent, data ) | @@ -59,20 +59,9 @@ function _M.startAdvRpc( agent, data ) | ||
59 | if not chapterData then return 1 end | 59 | if not chapterData then return 1 end |
60 | 60 | ||
61 | if role.dailyData:getProperty("advC") >= role:getAdvHangLimit() then return 2 end -- 是否有体力 | 61 | if role.dailyData:getProperty("advC") >= role:getAdvHangLimit() then return 2 end -- 是否有体力 |
62 | - | ||
63 | - local oklayer = false --层是否合法 | ||
64 | - if layer ~= 1 then | ||
65 | - for _, exLayer in ipairs(globalCsv.adv_can_out_layer) do | ||
66 | - if exLayer + 1 == layer then | ||
67 | - oklayer = true | ||
68 | - break | ||
69 | - end | ||
70 | - end | ||
71 | - else | ||
72 | - oklayer = true | ||
73 | - end | ||
74 | - | ||
75 | - if not oklayer then return 3 end | 62 | + |
63 | + if (layer - 1) % globalCsv.adv_can_out_layer_pre ~= 0 then return 3 end | ||
64 | + | ||
76 | if layer > chapterData.limitlevel then return 4 end | 65 | if layer > chapterData.limitlevel then return 4 end |
77 | 66 | ||
78 | -- 关卡开放判断 | 67 | -- 关卡开放判断 |
src/actions/GmAction.lua
@@ -202,6 +202,29 @@ function _M.adv(role, pms) | @@ -202,6 +202,29 @@ function _M.adv(role, pms) | ||
202 | return "成功" | 202 | return "成功" |
203 | end | 203 | end |
204 | 204 | ||
205 | +function _M.advt(role, pms) | ||
206 | + local chapterId = tonum(pms.pm1) | ||
207 | + local layer = tonum(pms.pm2) | ||
208 | + local advData = csvdb["adv_chapterCsv"][chapterId] | ||
209 | + if not advData then return "不存在的章节" end | ||
210 | + layer = math.min(layer, advData.limitlevel) | ||
211 | + local advData = role:getAdvData() | ||
212 | + | ||
213 | + if not advData.chapterId then | ||
214 | + return "先随便开启一关" | ||
215 | + end | ||
216 | + | ||
217 | + _M.adv(role, {pm1 = chapterId, pm2 = layer - 1}) | ||
218 | + | ||
219 | + | ||
220 | + advData.chapterId = chapterId | ||
221 | + advData.level = layer | ||
222 | + | ||
223 | + advData:saveDB() | ||
224 | + | ||
225 | + return "成功" | ||
226 | +end | ||
227 | + | ||
205 | function _M.idlec(role, pms) | 228 | function _M.idlec(role, pms) |
206 | role:updateProperty({field = "hangTeam", value = {}}) | 229 | role:updateProperty({field = "hangTeam", value = {}}) |
207 | role:updateProperty({field = "hangInfo", value = {}}) | 230 | role:updateProperty({field = "hangInfo", value = {}}) |
src/adv/Adv.lua
@@ -269,18 +269,12 @@ local function clickOut(self, room, block, params) | @@ -269,18 +269,12 @@ local function clickOut(self, room, block, params) | ||
269 | else --处于底层 | 269 | else --处于底层 |
270 | 270 | ||
271 | local advPass = self.owner:getProperty("advPass") | 271 | local advPass = self.owner:getProperty("advPass") |
272 | + | ||
272 | if self.level > (advPass[self.chapterId] or 0) then | 273 | if self.level > (advPass[self.chapterId] or 0) then |
273 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) | 274 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) |
274 | end | 275 | end |
275 | if params.relay then | 276 | if params.relay then |
276 | - local ok = false | ||
277 | - for _, exLayer in ipairs(globalCsv.adv_can_out_layer) do | ||
278 | - if exLayer == self.level then | ||
279 | - ok = true | ||
280 | - break | ||
281 | - end | ||
282 | - end | ||
283 | - if not ok then return end | 277 | + if self.level % globalCsv.adv_can_out_layer_pre ~= 0 or not self.owner:isFuncOpen(FuncOpenType.AdvRelay) then return end |
284 | end | 278 | end |
285 | if params.relay or self.level >= csvdb["adv_chapterCsv"][self.chapterId].limitlevel or not self.owner:advChapterIsOpen(self.chapterId, self.level + 1) then --关卡结束 | 279 | if params.relay or self.level >= csvdb["adv_chapterCsv"][self.chapterId].limitlevel or not self.owner:advChapterIsOpen(self.chapterId, self.level + 1) then --关卡结束 |
286 | self:over(true) | 280 | self:over(true) |
src/adv/AdvBattle.lua
@@ -57,7 +57,7 @@ function Battle:initPlayer() | @@ -57,7 +57,7 @@ function Battle:initPlayer() | ||
57 | player.exp = 0 | 57 | player.exp = 0 |
58 | player.sp = 100 | 58 | player.sp = 100 |
59 | local activeRelation = self.adv.owner:getHeroActiveRelation() | 59 | local activeRelation = self.adv.owner:getHeroActiveRelation() |
60 | - local baseAttr = csvdb["adv_unitCsv"][math.floor(self.adv.chapterId / 100)] | 60 | + local baseAttr = csvdb["adv_unitCsv"][self.adv.chapterId] |
61 | for _, attr in pairs(AttsEnumEx) do | 61 | for _, attr in pairs(AttsEnumEx) do |
62 | if baseAttr[attr] then | 62 | if baseAttr[attr] then |
63 | player[attr] = baseAttr[attr] + baseAttr[attr] * player.growth * (player.level - 1) | 63 | player[attr] = baseAttr[attr] + baseAttr[attr] * player.growth * (player.level - 1) |
src/adv/AdvMap.lua
@@ -334,7 +334,6 @@ end | @@ -334,7 +334,6 @@ end | ||
334 | --关卡事件库 | 334 | --关卡事件库 |
335 | getEventLib = function(self, needEventType) -- needEventType 需要的事件 | 335 | getEventLib = function(self, needEventType) -- needEventType 需要的事件 |
336 | local chapterId, level = self.adv.chapterId, self.adv.level | 336 | local chapterId, level = self.adv.chapterId, self.adv.level |
337 | - local chapter = math.floor(chapterId / 100) % 100 | ||
338 | 337 | ||
339 | local libsToType = { | 338 | local libsToType = { |
340 | ["event_monsterCsv"] = {AdvEventType.Monster, AdvEventType.BOSS, AdvEventType.Monster}, | 339 | ["event_monsterCsv"] = {AdvEventType.Monster, AdvEventType.BOSS, AdvEventType.Monster}, |
@@ -365,7 +364,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | @@ -365,7 +364,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 | ||
365 | for id, data in pairs(csvdb[lib]) do | 364 | for id, data in pairs(csvdb[lib]) do |
366 | local etype = type(eventType) == "table" and eventType[data.type] or eventType | 365 | local etype = type(eventType) == "table" and eventType[data.type] or eventType |
367 | 366 | ||
368 | - if data.levelchapter == chapter and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then | 367 | + if data.levelchapter == chapterId and (data.unlockType == 0 or (advEventOpenStatus[etype] or {})[data.unlockType]) then |
369 | if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then | 368 | if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then |
370 | eventLib[etype][data.BlockEventType] = eventLib[etype][data.BlockEventType] or {} | 369 | eventLib[etype][data.BlockEventType] = eventLib[etype][data.BlockEventType] or {} |
371 | eventLib[etype][data.BlockEventType][id] = {showup = data.showup, limit = data.limit} | 370 | eventLib[etype][data.BlockEventType][id] = {showup = data.showup, limit = data.limit} |
src/adv/AdvTask.lua
@@ -71,7 +71,7 @@ function AdvTask.bind(Adv) | @@ -71,7 +71,7 @@ function AdvTask.bind(Adv) | ||
71 | self.advMTask.id = self.advMTask.id or 1 | 71 | self.advMTask.id = self.advMTask.id or 1 |
72 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] | 72 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] |
73 | if mainTaskData and self.advMTask.lock then | 73 | if mainTaskData and self.advMTask.lock then |
74 | - if math.floor(self.chapterId / 100) % 100 == mainTaskData.chapter and self.level >= mainTaskData.level then --到达指定关卡解锁当前任务 | 74 | + if self.chapterId == mainTaskData.chapter and self.level >= mainTaskData.level then --到达指定关卡解锁当前任务 |
75 | self.advMTask.lock = nil | 75 | self.advMTask.lock = nil |
76 | self.advMTask.status = 0 | 76 | self.advMTask.status = 0 |
77 | local ts = checkTaskStatus(self, mainTaskData, self.advMTask.status, 0) | 77 | local ts = checkTaskStatus(self, mainTaskData, self.advMTask.status, 0) |
@@ -84,7 +84,7 @@ function AdvTask.bind(Adv) | @@ -84,7 +84,7 @@ function AdvTask.bind(Adv) | ||
84 | end | 84 | end |
85 | 85 | ||
86 | function Adv:checkTask(taskType, count, cond) | 86 | function Adv:checkTask(taskType, count, cond) |
87 | - local chapter = math.floor(self.chapterId / 100) % 100 | 87 | + local chapter = self.chapterId |
88 | for taskId, status in pairs(self.advTask) do | 88 | for taskId, status in pairs(self.advTask) do |
89 | local taskData = csvdb["event_questCsv"][taskId] | 89 | local taskData = csvdb["event_questCsv"][taskId] |
90 | if taskData and taskData.levelchapter == chapter and taskType == taskData.condition then | 90 | if taskData and taskData.levelchapter == chapter and taskType == taskData.condition then |
@@ -149,7 +149,7 @@ function AdvTask.bind(Adv) | @@ -149,7 +149,7 @@ function AdvTask.bind(Adv) | ||
149 | self.advMTask.id = self.advMTask.id + 1 | 149 | self.advMTask.id = self.advMTask.id + 1 |
150 | self.advMTask.status = 0 | 150 | self.advMTask.status = 0 |
151 | local nextTaskData = csvdb["adv_questCsv"][self.advMTask.id] | 151 | local nextTaskData = csvdb["adv_questCsv"][self.advMTask.id] |
152 | - if not nextTaskData or math.floor(self.chapterId / 100) % 100 ~= nextTaskData.chapter or self.level < nextTaskData.level then | 152 | + if not nextTaskData or self.chapterId ~= nextTaskData.chapter or self.level < nextTaskData.level then |
153 | self.advMTask.lock = true | 153 | self.advMTask.lock = true |
154 | else | 154 | else |
155 | local ts = checkTaskStatus(self, nextTaskData, self.advMTask.status, 0) | 155 | local ts = checkTaskStatus(self, nextTaskData, self.advMTask.status, 0) |
src/models/RolePlugin.lua
@@ -606,7 +606,6 @@ function RolePlugin.bind(Role) | @@ -606,7 +606,6 @@ function RolePlugin.bind(Role) | ||
606 | end | 606 | end |
607 | 607 | ||
608 | function Role:advChapterIsOpen(chapterId, layer) | 608 | function Role:advChapterIsOpen(chapterId, layer) |
609 | - local chapter = math.floor(chapterId / 100) % 100 | ||
610 | local exlayer = math.floor((layer - 1) / 10) * 10 + 1 | 609 | local exlayer = math.floor((layer - 1) / 10) * 10 + 1 |
611 | 610 | ||
612 | if exlayer == 1 then --第一层判断前置 | 611 | if exlayer == 1 then --第一层判断前置 |
@@ -620,7 +619,7 @@ function RolePlugin.bind(Role) | @@ -620,7 +619,7 @@ function RolePlugin.bind(Role) | ||
620 | 619 | ||
621 | local unlock = {} | 620 | local unlock = {} |
622 | for func , data in pairs(csvdb["unlockCsv"]) do | 621 | for func , data in pairs(csvdb["unlockCsv"]) do |
623 | - if data.type == 1 and chapter == data.value1 and exlayer == data.value2 then | 622 | + if data.type == 1 and chapterId == data.value1 and exlayer == data.value2 then |
624 | return self:isFuncOpen(func) | 623 | return self:isFuncOpen(func) |
625 | end | 624 | end |
626 | end | 625 | end |