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 | 489 | if self._init then |
| 490 | 490 | self:_init() |
| 491 | 491 | end |
| 492 | + self:pushBackEffect(1) | |
| 492 | 493 | end |
| 493 | 494 | |
| 494 | 495 | function Buff:initByDB(data) |
| ... | ... | @@ -620,11 +621,19 @@ function Buff:canEffect(...) |
| 620 | 621 | return self:_canEffect(...) |
| 621 | 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 | 634 | function Buff:effect() |
| 624 | 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 | 637 | if self._effectValue then |
| 629 | 638 | return self:_effectValue() |
| 630 | 639 | end |
| ... | ... | @@ -698,6 +707,8 @@ function Buff:overlay(releaser, data, layer) |
| 698 | 707 | if self._overlay then |
| 699 | 708 | self:_overlay() |
| 700 | 709 | end |
| 710 | + | |
| 711 | + self:pushBackEffect(1) | |
| 701 | 712 | end |
| 702 | 713 | end |
| 703 | 714 | ... | ... |
src/adv/AdvPassive.lua
| ... | ... | @@ -339,6 +339,7 @@ function Passive:canEffect(effType, effValue) |
| 339 | 339 | end |
| 340 | 340 | |
| 341 | 341 | function Passive:effect(triggerPms) |
| 342 | + local hadEffect = false | |
| 342 | 343 | for _, effect in ipairs(self.effects) do |
| 343 | 344 | local effType = effect[1] |
| 344 | 345 | local effValue = effect[2] |
| ... | ... | @@ -347,10 +348,13 @@ function Passive:effect(triggerPms) |
| 347 | 348 | table.insert(otherPms, effect[i]) |
| 348 | 349 | end |
| 349 | 350 | if self:canEffect(effType, effValue) then |
| 351 | + hadEffect = true | |
| 350 | 352 | self["effect" .. effType](self, effValue, triggerPms, table.unpack(otherPms)) |
| 351 | 353 | end |
| 352 | 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 | 358 | if self.count > 0 then |
| 355 | 359 | self.count = self.count < 999 and self.count - 1 or self.count |
| 356 | 360 | self.round = self.passiveData.round |
| ... | ... | @@ -413,7 +417,6 @@ function Passive:trigger(condType, params) --触发检查 |
| 413 | 417 | if self.round and self.round > 0 then -- cd |
| 414 | 418 | return |
| 415 | 419 | end |
| 416 | - self.owner.battle.adv:pushBackEvent(AdvBackEventType.PassiveEffect, {show = self.passiveData.show, roomId = self.owner.roomId, blockId = self.owner.blockId }) | |
| 417 | 420 | self:effect(params) |
| 418 | 421 | end |
| 419 | 422 | ... | ... |
src/adv/AdvPlayer.lua
| ... | ... | @@ -847,10 +847,6 @@ function Player:addBuff(buffId, releaser) |
| 847 | 847 | self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) |
| 848 | 848 | self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId}) |
| 849 | 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 | 850 | end |
| 855 | 851 | return status |
| 856 | 852 | end | ... | ... |