Commit 3ec5de90713c0d5ca09c893abbc8331568e4b30e

Authored by zhouhaihai
1 parent 400f1f91

光环 bug

Showing 1 changed file with 18 additions and 9 deletions   Show diff stats
src/adv/AdvBattle.lua
@@ -316,8 +316,19 @@ function Battle:afterRound() @@ -316,8 +316,19 @@ function Battle:afterRound()
316 build:afterRound("buffAfter") 316 build:afterRound("buffAfter")
317 end 317 end
318 318
  319 + self.player:triggerPassive(Passive.AFTER_ROUND)
  320 +
  321 + self:checkAura()
319 322
  323 + self:clearRound()
  324 +
  325 + if self.player.isDead then
  326 + self.adv:over(false, nil, -2)
  327 + end
  328 +end
320 329
  330 +function Battle:clearRound()
  331 + local mapIdx = self.adv:getCurMapIdx()
321 self.player:clearRound() 332 self.player:clearRound()
322 for _, enemy in ipairs(self.enemys[mapIdx]) do 333 for _, enemy in ipairs(self.enemys[mapIdx]) do
323 enemy:clearRound() 334 enemy:clearRound()
@@ -347,14 +358,6 @@ function Battle:afterRound() @@ -347,14 +358,6 @@ function Battle:afterRound()
347 build:clear() 358 build:clear()
348 end 359 end
349 end 360 end
350 -  
351 - self.player:triggerPassive(Passive.AFTER_ROUND)  
352 -  
353 - self:checkAura()  
354 -  
355 - if self.player.isDead then  
356 - self.adv:over(false, nil, -2)  
357 - end  
358 end 361 end
359 362
360 363
@@ -450,12 +453,14 @@ function Battle:iLayerChange(oldMapIdx) @@ -450,12 +453,14 @@ function Battle:iLayerChange(oldMapIdx)
450 enemy:checkAuraBuff(enemyBuffs) 453 enemy:checkAuraBuff(enemyBuffs)
451 end 454 end
452 self:setMapAuras(auras) 455 self:setMapAuras(auras)
  456 + self:clearRound()
453 end 457 end
454 458
455 -- 新的 关卡 关闭旧的战斗模块 清理 玩家身上的光环效果 459 -- 新的 关卡 关闭旧的战斗模块 清理 玩家身上的光环效果
456 function Battle:overBattle() 460 function Battle:overBattle()
457 local buffs = self:checkDiffAuraBuff(self:getAurasByMap(), {}) 461 local buffs = self:checkDiffAuraBuff(self:getAurasByMap(), {})
458 self.player:checkAuraBuff(buffs) 462 self.player:checkAuraBuff(buffs)
  463 + self:clearRound()
459 self.adv.owner:getProperty("advTeam").player = self.player:getDB() -- 临时缓存住 battle 的player 464 self.adv.owner:getProperty("advTeam").player = self.player:getDB() -- 临时缓存住 battle 的player
460 end 465 end
461 466
@@ -463,6 +468,10 @@ end @@ -463,6 +468,10 @@ end
463 function Battle:newBattle() 468 function Battle:newBattle()
464 local auras = self:getActiveAuras() 469 local auras = self:getActiveAuras()
465 local buffs = self:checkDiffAuraBuff({}, auras) 470 local buffs = self:checkDiffAuraBuff({}, auras)
  471 + self.player:checkAuraBuff(buffs)
  472 + for _, enemy in pairs(self.player:getTeam(2)) do
  473 + enemy:checkAuraBuff(buffs)
  474 + end
466 self:setMapAuras(auras) 475 self:setMapAuras(auras)
467 end 476 end
468 477
@@ -490,7 +499,7 @@ function Battle:checkDiffAuraBuff(oldAuras, newAuras) @@ -490,7 +499,7 @@ function Battle:checkDiffAuraBuff(oldAuras, newAuras)
490 for aurasId , count in pairs(newAuras) do 499 for aurasId , count in pairs(newAuras) do
491 auras[aurasId] = (auras[aurasId] or 0) + count 500 auras[aurasId] = (auras[aurasId] or 0) + count
492 end 501 end
493 - 502 +
494 local buffs = {} 503 local buffs = {}
495 for aurasId , count in pairs(auras) do 504 for aurasId , count in pairs(auras) do
496 local auraData = csvdb["adv_map_haloCsv"][aurasId] 505 local auraData = csvdb["adv_map_haloCsv"][aurasId]