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,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
| @@ -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 | ||
| @@ -429,7 +432,7 @@ function Battle:initMapEffect(ilayer) | @@ -429,7 +432,7 @@ function Battle:initMapEffect(ilayer) | ||
| 429 | end | 432 | end |
| 430 | 433 | ||
| 431 | for _, buff in ipairs(buffs[1] or {}) do | 434 | for _, buff in ipairs(buffs[1] or {}) do |
| 432 | - self.palyer:addBuff(buff) | 435 | + self.player:addBuff(buff) |
| 433 | end | 436 | end |
| 434 | 437 | ||
| 435 | for _, buff in ipairs(buffs[2] or {}) do | 438 | for _, buff in ipairs(buffs[2] or {}) do |
| @@ -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,9 +468,17 @@ end | @@ -463,9 +468,17 @@ 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 | ||
| 478 | +function Battle:loadBattle(info) | ||
| 479 | + self.auras = info.auras or {} | ||
| 480 | +end | ||
| 481 | + | ||
| 469 | -- 过了回合 检查光环 | 482 | -- 过了回合 检查光环 |
| 470 | function Battle:checkAura() | 483 | function Battle:checkAura() |
| 471 | local auras = self:getActiveAuras() | 484 | local auras = self:getActiveAuras() |
src/adv/AdvPlayer.lua
| @@ -144,7 +144,7 @@ function BaseObject:getDisablePassiveCount() | @@ -144,7 +144,7 @@ function BaseObject:getDisablePassiveCount() | ||
| 144 | end | 144 | end |
| 145 | 145 | ||
| 146 | function BaseObject:getDisableAuraCount() | 146 | function BaseObject:getDisableAuraCount() |
| 147 | - local count | 147 | + local count = 0 |
| 148 | for _, buff in ipairs(self.buffs) do | 148 | for _, buff in ipairs(self.buffs) do |
| 149 | if not buff:isHide() and buff:getType() == Buff.DISABLE_AURA then | 149 | if not buff:isHide() and buff:getType() == Buff.DISABLE_AURA then |
| 150 | if buff:effect() == 0 then | 150 | if buff:effect() == 0 then |
| @@ -699,7 +699,7 @@ function Enemy:checkAuraBuff(buffs) | @@ -699,7 +699,7 @@ function Enemy:checkAuraBuff(buffs) | ||
| 699 | if buff then | 699 | if buff then |
| 700 | buff:uncover(info.exist and -info.count or -1, true) | 700 | buff:uncover(info.exist and -info.count or -1, true) |
| 701 | end | 701 | end |
| 702 | - elseif count > 0 then | 702 | + elseif info.count > 0 then |
| 703 | self:addBuff(buffId, nil, info.count) | 703 | self:addBuff(buffId, nil, info.count) |
| 704 | end | 704 | end |
| 705 | end | 705 | end |