Commit cf584618eac255a2b5ca8632c4c3d0fd03b7fadf
1 parent
1be743f3
效果发给客户端
Showing
3 changed files
with
19 additions
and
9 deletions
Show diff stats
src/adv/AdvBuff.lua
@@ -489,6 +489,7 @@ function Buff:createAfter(layer) | @@ -489,6 +489,7 @@ function Buff:createAfter(layer) | ||
489 | if self._init then | 489 | if self._init then |
490 | self:_init() | 490 | self:_init() |
491 | end | 491 | end |
492 | + self:pushBackEffect(1) | ||
492 | end | 493 | end |
493 | 494 | ||
494 | function Buff:initByDB(data) | 495 | function Buff:initByDB(data) |
@@ -620,11 +621,19 @@ function Buff:canEffect(...) | @@ -620,11 +621,19 @@ function Buff:canEffect(...) | ||
620 | return self:_canEffect(...) | 621 | return self:_canEffect(...) |
621 | end | 622 | end |
622 | 623 | ||
624 | +function Buff:pushBackEffect(etype) | ||
625 | + local shows = self.buffData.show:toTableArray(true) | ||
626 | + for _, one in ipairs(shows) do | ||
627 | + if one[1] == etype then | ||
628 | + self.owner.battle.adv:pushBackEvent(AdvBackEventType.BuffEffect, {etype = etype, id = self.id, blockId = self.owner.blockId, roomId = self.owner.roomId}) | ||
629 | + break | ||
630 | + end | ||
631 | + end | ||
632 | +end | ||
633 | + | ||
623 | function Buff:effect() | 634 | function Buff:effect() |
624 | self:decCount() | 635 | self:decCount() |
625 | - if self.buffData.show:sismember(2, " ") then | ||
626 | - self.owner.battle.adv:pushBackEvent(AdvBackEventType.BuffEffect, {etype = 2}) | ||
627 | - end | 636 | + self:pushBackEffect(2) |
628 | if self._effectValue then | 637 | if self._effectValue then |
629 | return self:_effectValue() | 638 | return self:_effectValue() |
630 | end | 639 | end |
@@ -698,6 +707,8 @@ function Buff:overlay(releaser, data, layer) | @@ -698,6 +707,8 @@ function Buff:overlay(releaser, data, layer) | ||
698 | if self._overlay then | 707 | if self._overlay then |
699 | self:_overlay() | 708 | self:_overlay() |
700 | end | 709 | end |
710 | + | ||
711 | + self:pushBackEffect(1) | ||
701 | end | 712 | end |
702 | end | 713 | end |
703 | 714 |
src/adv/AdvPassive.lua
@@ -339,6 +339,7 @@ function Passive:canEffect(effType, effValue) | @@ -339,6 +339,7 @@ function Passive:canEffect(effType, effValue) | ||
339 | end | 339 | end |
340 | 340 | ||
341 | function Passive:effect(triggerPms) | 341 | function Passive:effect(triggerPms) |
342 | + local hadEffect = false | ||
342 | for _, effect in ipairs(self.effects) do | 343 | for _, effect in ipairs(self.effects) do |
343 | local effType = effect[1] | 344 | local effType = effect[1] |
344 | local effValue = effect[2] | 345 | local effValue = effect[2] |
@@ -347,10 +348,13 @@ function Passive:effect(triggerPms) | @@ -347,10 +348,13 @@ function Passive:effect(triggerPms) | ||
347 | table.insert(otherPms, effect[i]) | 348 | table.insert(otherPms, effect[i]) |
348 | end | 349 | end |
349 | if self:canEffect(effType, effValue) then | 350 | if self:canEffect(effType, effValue) then |
351 | + hadEffect = true | ||
350 | self["effect" .. effType](self, effValue, triggerPms, table.unpack(otherPms)) | 352 | self["effect" .. effType](self, effValue, triggerPms, table.unpack(otherPms)) |
351 | end | 353 | end |
352 | end | 354 | end |
353 | - | 355 | + if hadEffect then |
356 | + self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {id = self.id, level = self.level, roomId = self.owner.roomId, blockId = self.owner.blockId}) | ||
357 | + end | ||
354 | if self.count > 0 then | 358 | if self.count > 0 then |
355 | self.count = self.count < 999 and self.count - 1 or self.count | 359 | self.count = self.count < 999 and self.count - 1 or self.count |
356 | self.round = self.passiveData.round | 360 | self.round = self.passiveData.round |
@@ -413,7 +417,6 @@ function Passive:trigger(condType, params) --触发检查 | @@ -413,7 +417,6 @@ function Passive:trigger(condType, params) --触发检查 | ||
413 | if self.round and self.round > 0 then -- cd | 417 | if self.round and self.round > 0 then -- cd |
414 | return | 418 | return |
415 | end | 419 | end |
416 | - self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {show = self.passiveData.show, roomId = self.owner.roomId, blockId = self.owner.blockId }) | ||
417 | self:effect(params) | 420 | self:effect(params) |
418 | end | 421 | end |
419 | 422 |
src/adv/AdvPlayer.lua
@@ -847,10 +847,6 @@ function Player:addBuff(buffId, releaser) | @@ -847,10 +847,6 @@ function Player:addBuff(buffId, releaser) | ||
847 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) | 847 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) |
848 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) | 848 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) |
849 | self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) | 849 | self.battle:triggerPassive(Passive.PLAYER_BUFF, {buffId = buffId}) |
850 | - local buffData = csvdb["adv_map_buffCsv"][buffId] | ||
851 | - if buffData and buffData.show:sismember(1, " ") then | ||
852 | - self.battle.adv:pushBackEvent(AdvBackEventType.BuffEffect, {etype = 1}) | ||
853 | - end | ||
854 | end | 850 | end |
855 | return status | 851 | return status |
856 | end | 852 | end |