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 | 59 | if not chapterData then return 1 end |
| 60 | 60 | |
| 61 | 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 | 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 | 202 | return "成功" |
| 203 | 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 | 228 | function _M.idlec(role, pms) |
| 206 | 229 | role:updateProperty({field = "hangTeam", value = {}}) |
| 207 | 230 | role:updateProperty({field = "hangInfo", value = {}}) | ... | ... |
src/adv/Adv.lua
| ... | ... | @@ -269,18 +269,12 @@ local function clickOut(self, room, block, params) |
| 269 | 269 | else --处于底层 |
| 270 | 270 | |
| 271 | 271 | local advPass = self.owner:getProperty("advPass") |
| 272 | + | |
| 272 | 273 | if self.level > (advPass[self.chapterId] or 0) then |
| 273 | 274 | self.owner:changeUpdates({{type = "advPass", field = self.chapterId, value = self.level}}) |
| 274 | 275 | end |
| 275 | 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 | 278 | end |
| 285 | 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 | 280 | self:over(true) | ... | ... |
src/adv/AdvBattle.lua
| ... | ... | @@ -57,7 +57,7 @@ function Battle:initPlayer() |
| 57 | 57 | player.exp = 0 |
| 58 | 58 | player.sp = 100 |
| 59 | 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 | 61 | for _, attr in pairs(AttsEnumEx) do |
| 62 | 62 | if baseAttr[attr] then |
| 63 | 63 | player[attr] = baseAttr[attr] + baseAttr[attr] * player.growth * (player.level - 1) | ... | ... |
src/adv/AdvMap.lua
| ... | ... | @@ -334,7 +334,6 @@ end |
| 334 | 334 | --关卡事件库 |
| 335 | 335 | getEventLib = function(self, needEventType) -- needEventType 需要的事件 |
| 336 | 336 | local chapterId, level = self.adv.chapterId, self.adv.level |
| 337 | - local chapter = math.floor(chapterId / 100) % 100 | |
| 338 | 337 | |
| 339 | 338 | local libsToType = { |
| 340 | 339 | ["event_monsterCsv"] = {AdvEventType.Monster, AdvEventType.BOSS, AdvEventType.Monster}, |
| ... | ... | @@ -365,7 +364,7 @@ getEventLib = function(self, needEventType) -- needEventType 需要的事件 |
| 365 | 364 | for id, data in pairs(csvdb[lib]) do |
| 366 | 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 | 368 | if AdvCommon.checkIsIn(level, data.leveltype, data.levellimit) then |
| 370 | 369 | eventLib[etype][data.BlockEventType] = eventLib[etype][data.BlockEventType] or {} |
| 371 | 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 | 71 | self.advMTask.id = self.advMTask.id or 1 |
| 72 | 72 | local mainTaskData = csvdb["adv_questCsv"][self.advMTask.id] |
| 73 | 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 | 75 | self.advMTask.lock = nil |
| 76 | 76 | self.advMTask.status = 0 |
| 77 | 77 | local ts = checkTaskStatus(self, mainTaskData, self.advMTask.status, 0) |
| ... | ... | @@ -84,7 +84,7 @@ function AdvTask.bind(Adv) |
| 84 | 84 | end |
| 85 | 85 | |
| 86 | 86 | function Adv:checkTask(taskType, count, cond) |
| 87 | - local chapter = math.floor(self.chapterId / 100) % 100 | |
| 87 | + local chapter = self.chapterId | |
| 88 | 88 | for taskId, status in pairs(self.advTask) do |
| 89 | 89 | local taskData = csvdb["event_questCsv"][taskId] |
| 90 | 90 | if taskData and taskData.levelchapter == chapter and taskType == taskData.condition then |
| ... | ... | @@ -149,7 +149,7 @@ function AdvTask.bind(Adv) |
| 149 | 149 | self.advMTask.id = self.advMTask.id + 1 |
| 150 | 150 | self.advMTask.status = 0 |
| 151 | 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 | 153 | self.advMTask.lock = true |
| 154 | 154 | else |
| 155 | 155 | local ts = checkTaskStatus(self, nextTaskData, self.advMTask.status, 0) | ... | ... |
src/models/RolePlugin.lua
| ... | ... | @@ -606,7 +606,6 @@ function RolePlugin.bind(Role) |
| 606 | 606 | end |
| 607 | 607 | |
| 608 | 608 | function Role:advChapterIsOpen(chapterId, layer) |
| 609 | - local chapter = math.floor(chapterId / 100) % 100 | |
| 610 | 609 | local exlayer = math.floor((layer - 1) / 10) * 10 + 1 |
| 611 | 610 | |
| 612 | 611 | if exlayer == 1 then --第一层判断前置 |
| ... | ... | @@ -620,7 +619,7 @@ function RolePlugin.bind(Role) |
| 620 | 619 | |
| 621 | 620 | local unlock = {} |
| 622 | 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 | 623 | return self:isFuncOpen(func) |
| 625 | 624 | end |
| 626 | 625 | end | ... | ... |