Commit c992c911b083de1b9089b924fb5c421b8f4c35ba
1 parent
bbf64622
中继
Showing
3 changed files
with
32 additions
and
18 deletions
Show diff stats
src/actions/AdvAction.lua
@@ -452,11 +452,10 @@ function _M.wearArtifactRpc(agent, data) | @@ -452,11 +452,10 @@ function _M.wearArtifactRpc(agent, data) | ||
452 | local adv = role:getAdvData() | 452 | local adv = role:getAdvData() |
453 | 453 | ||
454 | if math.illegalNum(slot, 1, 5) then return 1 end | 454 | if math.illegalNum(slot, 1, 5) then return 1 end |
455 | - if not adv:isHaveArtifact(id) then return 2 end | ||
456 | - if adv:isWaitChooseArtifact() then return 3 end | 455 | + if adv:isWaitChooseArtifact() then return 2 end |
457 | 456 | ||
458 | local status = adv:wearArtifact(slot, id) | 457 | local status = adv:wearArtifact(slot, id) |
459 | - if not status then return 4 end | 458 | + if not status then return 3 end |
460 | adv:saveDB() | 459 | adv:saveDB() |
461 | 460 | ||
462 | SendPacket(actionCodes.Adv_wearArtifactRpc, '') | 461 | SendPacket(actionCodes.Adv_wearArtifactRpc, '') |
src/adv/Adv.lua
@@ -457,6 +457,12 @@ function Adv:wearArtifact(slot, id) | @@ -457,6 +457,12 @@ function Adv:wearArtifact(slot, id) | ||
457 | local advAFGet = self.owner:getProperty("advAFGet") | 457 | local advAFGet = self.owner:getProperty("advAFGet") |
458 | local advAFWear = self.owner:getProperty("advAFWear") | 458 | local advAFWear = self.owner:getProperty("advAFWear") |
459 | 459 | ||
460 | + if id == -1 then | ||
461 | + if not advAFWear[slot] then return end | ||
462 | + else | ||
463 | + if not advAFGet[id] then return end | ||
464 | + end | ||
465 | + | ||
460 | local curWear = {} | 466 | local curWear = {} |
461 | for _, _id in pairs(advAFWear) do | 467 | for _, _id in pairs(advAFWear) do |
462 | curWear[_id] = 1 | 468 | curWear[_id] = 1 |
@@ -484,23 +490,28 @@ function Adv:wearArtifact(slot, id) | @@ -484,23 +490,28 @@ function Adv:wearArtifact(slot, id) | ||
484 | curWear[advAFWear[slot]] = nil | 490 | curWear[advAFWear[slot]] = nil |
485 | end | 491 | end |
486 | 492 | ||
487 | - curWear[id] = 1 | ||
488 | - local newData = csvdb["adv_artifactCsv"][id][advAFGet[id]] | ||
489 | - self:addArtifactEffect(newData.effect) | ||
490 | - if newData.comboId ~= 0 then | ||
491 | - local comboData = csvdb["adv_artifact_comboCsv"][newData.comboId] | ||
492 | - if comboData then | ||
493 | - local isHaveCombo = true | ||
494 | - for _, _id in ipairs(comboData.artifactid:toArray(true)) do | ||
495 | - if not curWear[_id] then | ||
496 | - isHaveCombo = false | ||
497 | - break | 493 | + if id ~= -1 then |
494 | + curWear[id] = 1 | ||
495 | + local newData = csvdb["adv_artifactCsv"][id][advAFGet[id]] | ||
496 | + self:addArtifactEffect(newData.effect) | ||
497 | + | ||
498 | + if newData.comboId ~= 0 then | ||
499 | + local comboData = csvdb["adv_artifact_comboCsv"][newData.comboId] | ||
500 | + if comboData then | ||
501 | + local isHaveCombo = true | ||
502 | + for _, _id in ipairs(comboData.artifactid:toArray(true)) do | ||
503 | + if not curWear[_id] then | ||
504 | + isHaveCombo = false | ||
505 | + break | ||
506 | + end | ||
507 | + end | ||
508 | + if isHaveCombo then | ||
509 | + self:addArtifactEffect(comboData.effect) | ||
498 | end | 510 | end |
499 | - end | ||
500 | - if isHaveCombo then | ||
501 | - self:addArtifactEffect(comboData.effect) | ||
502 | end | 511 | end |
503 | end | 512 | end |
513 | + else | ||
514 | + id = nil | ||
504 | end | 515 | end |
505 | 516 | ||
506 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) | 517 | self.owner:changeUpdates({{type = "advAFWear", field = slot, value = id}}) |
src/adv/AdvMap.lua
@@ -271,7 +271,11 @@ createMap = function(self, mapId, isEnter, isNewRelay) | @@ -271,7 +271,11 @@ createMap = function(self, mapId, isEnter, isNewRelay) | ||
271 | --入口 | 271 | --入口 |
272 | randomFunc[AdvEventType.In] = function()end | 272 | randomFunc[AdvEventType.In] = function()end |
273 | --出口 | 273 | --出口 |
274 | - randomFunc[AdvEventType.Out] = function() end | 274 | + randomFunc[AdvEventType.Out] = function() |
275 | + if not self.adv:isEndless() and isNewRelay then | ||
276 | + return false | ||
277 | + end | ||
278 | + end | ||
275 | --中继点出口 | 279 | --中继点出口 |
276 | randomFunc[AdvEventType.Exit] = function() | 280 | randomFunc[AdvEventType.Exit] = function() |
277 | if not self.adv.isRelay or isEnter then return false end | 281 | if not self.adv.isRelay or isEnter then return false end |