Commit 400f1f914d6e7e85253b04154cb337c474c94a92

Authored by zhouhaihai
1 parent 22288eb6

auras

Showing 2 changed files with 12 additions and 6 deletions   Show diff stats
src/adv/Adv.lua
... ... @@ -58,7 +58,7 @@ function Adv:initByInfo(advInfo)
58 58 self.maps[id] = AdvMap.new(self, id, map)
59 59 end
60 60  
61   - self:initBattle()
  61 + self:initBattle(advInfo)
62 62 end
63 63 -- 找出level 是否存在中继层
64 64 function Adv:isHaveRelay(level, chapterId)
... ... @@ -149,7 +149,7 @@ function Adv:initByChapter(params)
149 149 self.maps = {}
150 150 self.maps[1] = AdvMap.new(self, 1, mapId, isEnter, isNewRelay)
151 151  
152   - self:initBattle(true)
  152 + self:initBattle(nil)
153 153  
154 154 self:initLayerTask()
155 155  
... ... @@ -456,7 +456,7 @@ function Adv:clearAdvUnlockCache()
456 456 self.cacheUnlock = {}
457 457 end
458 458  
459   -function Adv:initBattle(notDb)
  459 +function Adv:initBattle(info)
460 460 self.battle = require("adv.AdvBattle").new(self)
461 461 for _, passiveC in ipairs(self.cachePassiveEvent or {}) do
462 462 self.battle:triggerPassive(passiveC[1], passiveC[2])
... ... @@ -468,13 +468,15 @@ function Adv:initBattle(notDb)
468 468 map:initBattleAfter()
469 469 end
470 470 --下层
471   - if notDb and self.level ~= 1 then
  471 + if not info and self.level ~= 1 then
472 472 self.battle.player:attrChangeCondBuffCheck(1)
473 473 end
474 474  
475 475 -- 初始化
476   - if notDb then
  476 + if not info then
477 477 self.battle:newBattle()
  478 + else
  479 + self.battle:loadBattle(info)
478 480 end
479 481 end
480 482  
... ...
src/adv/AdvBattle.lua
... ... @@ -466,6 +466,10 @@ function Battle:newBattle()
466 466 self:setMapAuras(auras)
467 467 end
468 468  
  469 +function Battle:loadBattle(info)
  470 + self.auras = info.auras or {}
  471 +end
  472 +
469 473 -- 过了回合 检查光环
470 474 function Battle:checkAura()
471 475 local auras = self:getActiveAuras()
... ... @@ -486,7 +490,7 @@ function Battle:checkDiffAuraBuff(oldAuras, newAuras)
486 490 for aurasId , count in pairs(newAuras) do
487 491 auras[aurasId] = (auras[aurasId] or 0) + count
488 492 end
489   -
  493 +
490 494 local buffs = {}
491 495 for aurasId , count in pairs(auras) do
492 496 local auraData = csvdb["adv_map_haloCsv"][aurasId]
... ...