Commit 400f1f914d6e7e85253b04154cb337c474c94a92

Authored by zhouhaihai
1 parent 22288eb6

auras

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