Commit 596ac19f01714e5889b3385bac0f464e9a18f15f
1 parent
25a376de
buff
Showing
3 changed files
with
20 additions
and
5 deletions
Show diff stats
src/adv/Adv.lua
... | ... | @@ -63,15 +63,15 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify) |
63 | 63 | self.maps = {} |
64 | 64 | self.maps[1] = AdvMap.new(self, 1, mapId) |
65 | 65 | |
66 | - if isToNext then | |
67 | - self:scoreChange(AdvScoreType.Level) --增加层级加分 | |
68 | - end | |
69 | - | |
70 | 66 | self:initBattle() |
71 | 67 | |
72 | 68 | self:initLayerTask() |
73 | 69 | |
74 | 70 | self:checkTask(Adv.TaskType.Arrive) |
71 | + if isToNext then | |
72 | + self.battle.player:afterLayer() -- 玩家的buff 清理一下 | |
73 | + self:scoreChange(AdvScoreType.Level) --增加层级加分 | |
74 | + end | |
75 | 75 | if not notNotify then |
76 | 76 | self:saveDB(notNotify) |
77 | 77 | end | ... | ... |
src/adv/AdvBuff.lua
... | ... | @@ -369,6 +369,13 @@ function Buff:decRound() |
369 | 369 | end |
370 | 370 | end |
371 | 371 | |
372 | +function Buff:afterLayer() | |
373 | + -- 持续一层 | |
374 | + if self.buffData.round == 0 then | |
375 | + self.isDel = true | |
376 | + end | |
377 | +end | |
378 | + | |
372 | 379 | function Buff:canEffect(...) |
373 | 380 | if not self._canEffect then |
374 | 381 | return true |
... | ... | @@ -414,7 +421,7 @@ function Buff:getDB() |
414 | 421 | if self.release and not self.release.isDead then |
415 | 422 | db.rele = self.release.id or 0 --释放者的id (0 为玩家) (不存在 则释放者不存在或者已经死亡) |
416 | 423 | end |
417 | - if self.buffData.round ~= 0 then | |
424 | + if self.buffData.round > 0 then | |
418 | 425 | db.round = self.round |
419 | 426 | end |
420 | 427 | db.roundSp = self.roundSpace | ... | ... |
src/adv/AdvPlayer.lua
... | ... | @@ -525,6 +525,14 @@ function Player:effectBattleBuff() |
525 | 525 | end |
526 | 526 | end |
527 | 527 | |
528 | +function Player:afterLayer() | |
529 | + for _, buff in ipairs(self.buffs) do | |
530 | + if not buff.isDel then | |
531 | + buff:afterLayer() | |
532 | + end | |
533 | + end | |
534 | +end | |
535 | + | |
528 | 536 | function Player:getDB() |
529 | 537 | local db = Player.super.getDB(self) |
530 | 538 | for _ , field in pairs({"level", "exp", "growth", "sp"}) do | ... | ... |