Commit f2bebfc417332b3d24bbbe47e1b5b6fb6d6a9495
Merge branch 'develop' of 120.26.43.151:wasteland/server into develop
Showing
4 changed files
with
32 additions
and
17 deletions
Show diff stats
config/nodenames.lua
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
... | ... | @@ -316,8 +316,19 @@ function Battle:afterRound() |
316 | 316 | build:afterRound("buffAfter") |
317 | 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 | 332 | self.player:clearRound() |
322 | 333 | for _, enemy in ipairs(self.enemys[mapIdx]) do |
323 | 334 | enemy:clearRound() |
... | ... | @@ -347,14 +358,6 @@ function Battle:afterRound() |
347 | 358 | build:clear() |
348 | 359 | end |
349 | 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 | 361 | end |
359 | 362 | |
360 | 363 | |
... | ... | @@ -429,7 +432,7 @@ function Battle:initMapEffect(ilayer) |
429 | 432 | end |
430 | 433 | |
431 | 434 | for _, buff in ipairs(buffs[1] or {}) do |
432 | - self.palyer:addBuff(buff) | |
435 | + self.player:addBuff(buff) | |
433 | 436 | end |
434 | 437 | |
435 | 438 | for _, buff in ipairs(buffs[2] or {}) do |
... | ... | @@ -450,12 +453,14 @@ function Battle:iLayerChange(oldMapIdx) |
450 | 453 | enemy:checkAuraBuff(enemyBuffs) |
451 | 454 | end |
452 | 455 | self:setMapAuras(auras) |
456 | + self:clearRound() | |
453 | 457 | end |
454 | 458 | |
455 | 459 | -- 新的 关卡 关闭旧的战斗模块 清理 玩家身上的光环效果 |
456 | 460 | function Battle:overBattle() |
457 | 461 | local buffs = self:checkDiffAuraBuff(self:getAurasByMap(), {}) |
458 | 462 | self.player:checkAuraBuff(buffs) |
463 | + self:clearRound() | |
459 | 464 | self.adv.owner:getProperty("advTeam").player = self.player:getDB() -- 临时缓存住 battle 的player |
460 | 465 | end |
461 | 466 | |
... | ... | @@ -463,9 +468,17 @@ end |
463 | 468 | function Battle:newBattle() |
464 | 469 | local auras = self:getActiveAuras() |
465 | 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 | 475 | self:setMapAuras(auras) |
467 | 476 | end |
468 | 477 | |
478 | +function Battle:loadBattle(info) | |
479 | + self.auras = info.auras or {} | |
480 | +end | |
481 | + | |
469 | 482 | -- 过了回合 检查光环 |
470 | 483 | function Battle:checkAura() |
471 | 484 | local auras = self:getActiveAuras() | ... | ... |
src/adv/AdvPlayer.lua
... | ... | @@ -144,7 +144,7 @@ function BaseObject:getDisablePassiveCount() |
144 | 144 | end |
145 | 145 | |
146 | 146 | function BaseObject:getDisableAuraCount() |
147 | - local count | |
147 | + local count = 0 | |
148 | 148 | for _, buff in ipairs(self.buffs) do |
149 | 149 | if not buff:isHide() and buff:getType() == Buff.DISABLE_AURA then |
150 | 150 | if buff:effect() == 0 then |
... | ... | @@ -699,7 +699,7 @@ function Enemy:checkAuraBuff(buffs) |
699 | 699 | if buff then |
700 | 700 | buff:uncover(info.exist and -info.count or -1, true) |
701 | 701 | end |
702 | - elseif count > 0 then | |
702 | + elseif info.count > 0 then | |
703 | 703 | self:addBuff(buffId, nil, info.count) |
704 | 704 | end |
705 | 705 | end | ... | ... |