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,15 +63,15 @@ function Adv:initByChapter(chapterId, level, isToNext, notNotify) | ||
63 | self.maps = {} | 63 | self.maps = {} |
64 | self.maps[1] = AdvMap.new(self, 1, mapId) | 64 | self.maps[1] = AdvMap.new(self, 1, mapId) |
65 | 65 | ||
66 | - if isToNext then | ||
67 | - self:scoreChange(AdvScoreType.Level) --增加层级加分 | ||
68 | - end | ||
69 | - | ||
70 | self:initBattle() | 66 | self:initBattle() |
71 | 67 | ||
72 | self:initLayerTask() | 68 | self:initLayerTask() |
73 | 69 | ||
74 | self:checkTask(Adv.TaskType.Arrive) | 70 | self:checkTask(Adv.TaskType.Arrive) |
71 | + if isToNext then | ||
72 | + self.battle.player:afterLayer() -- 玩家的buff 清理一下 | ||
73 | + self:scoreChange(AdvScoreType.Level) --增加层级加分 | ||
74 | + end | ||
75 | if not notNotify then | 75 | if not notNotify then |
76 | self:saveDB(notNotify) | 76 | self:saveDB(notNotify) |
77 | end | 77 | end |
src/adv/AdvBuff.lua
@@ -369,6 +369,13 @@ function Buff:decRound() | @@ -369,6 +369,13 @@ function Buff:decRound() | ||
369 | end | 369 | end |
370 | end | 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 | function Buff:canEffect(...) | 379 | function Buff:canEffect(...) |
373 | if not self._canEffect then | 380 | if not self._canEffect then |
374 | return true | 381 | return true |
@@ -414,7 +421,7 @@ function Buff:getDB() | @@ -414,7 +421,7 @@ function Buff:getDB() | ||
414 | if self.release and not self.release.isDead then | 421 | if self.release and not self.release.isDead then |
415 | db.rele = self.release.id or 0 --释放者的id (0 为玩家) (不存在 则释放者不存在或者已经死亡) | 422 | db.rele = self.release.id or 0 --释放者的id (0 为玩家) (不存在 则释放者不存在或者已经死亡) |
416 | end | 423 | end |
417 | - if self.buffData.round ~= 0 then | 424 | + if self.buffData.round > 0 then |
418 | db.round = self.round | 425 | db.round = self.round |
419 | end | 426 | end |
420 | db.roundSp = self.roundSpace | 427 | db.roundSp = self.roundSpace |
src/adv/AdvPlayer.lua
@@ -525,6 +525,14 @@ function Player:effectBattleBuff() | @@ -525,6 +525,14 @@ function Player:effectBattleBuff() | ||
525 | end | 525 | end |
526 | end | 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 | function Player:getDB() | 536 | function Player:getDB() |
529 | local db = Player.super.getDB(self) | 537 | local db = Player.super.getDB(self) |
530 | for _ , field in pairs({"level", "exp", "growth", "sp"}) do | 538 | for _ , field in pairs({"level", "exp", "growth", "sp"}) do |