Commit c992c911b083de1b9089b924fb5c421b8f4c35ba

Authored by zhouhaihai
1 parent bbf64622

中继

src/actions/AdvAction.lua
... ... @@ -452,11 +452,10 @@ function _M.wearArtifactRpc(agent, data)
452 452 local adv = role:getAdvData()
453 453  
454 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 457 local status = adv:wearArtifact(slot, id)
459   - if not status then return 4 end
  458 + if not status then return 3 end
460 459 adv:saveDB()
461 460  
462 461 SendPacket(actionCodes.Adv_wearArtifactRpc, '')
... ...
src/adv/Adv.lua
... ... @@ -457,6 +457,12 @@ function Adv:wearArtifact(slot, id)
457 457 local advAFGet = self.owner:getProperty("advAFGet")
458 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 466 local curWear = {}
461 467 for _, _id in pairs(advAFWear) do
462 468 curWear[_id] = 1
... ... @@ -484,23 +490,28 @@ function Adv:wearArtifact(slot, id)
484 490 curWear[advAFWear[slot]] = nil
485 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 510 end
499   - end
500   - if isHaveCombo then
501   - self:addArtifactEffect(comboData.effect)
502 511 end
503 512 end
  513 + else
  514 + id = nil
504 515 end
505 516  
506 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 271 --入口
272 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 280 randomFunc[AdvEventType.Exit] = function()
277 281 if not self.adv.isRelay or isEnter then return false end
... ...