Commit 04b84e1e7f490d76a701cd187a5e34ccfe1f3b87
1 parent
6dc64b07
被动
Showing
2 changed files
with
11 additions
and
2 deletions
Show diff stats
src/adv/AdvPassive.lua
| ... | ... | @@ -120,7 +120,7 @@ Passive.GET_BUFF = 28 --获得指定buff |
| 120 | 120 | Passive.OPEN_BLOCK = 29 --翻开格子 |
| 121 | 121 | Passive.OPEN_MONSTER = 30 --翻开怪物 |
| 122 | 122 | Passive.PLAYER_BUFF = 31 --玩家获得buff |
| 123 | - | |
| 123 | +Passive.PLAYER_BUFF_CLASSIFY = 35 -- 获得指定标签的buff | |
| 124 | 124 | |
| 125 | 125 | -- 不同的开启条件 |
| 126 | 126 | local PassiveCondFactory = {} |
| ... | ... | @@ -183,6 +183,14 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) |
| 183 | 183 | end |
| 184 | 184 | PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] |
| 185 | 185 | |
| 186 | +PassiveCondFactory[Passive.PLAYER_BUFF_CLASSIFY] = function(_Passive) | |
| 187 | + _Passive._trigger = function(self, params) | |
| 188 | + if params.classify:sismember(self.passiveData.value) then | |
| 189 | + return true | |
| 190 | + end | |
| 191 | + end | |
| 192 | +end | |
| 193 | + | |
| 186 | 194 | |
| 187 | 195 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) |
| 188 | 196 | _Passive._afterRound = function(self) | ... | ... |
src/adv/AdvPlayer.lua
| ... | ... | @@ -163,7 +163,8 @@ function BaseObject:addBuff(buffId, releaser) |
| 163 | 163 | table.insert(self.buffs, buff) |
| 164 | 164 | buff:createAfter() |
| 165 | 165 | end |
| 166 | - self:triggerPassive(Passive.GET_BUFF, {buffId = buffId}) | |
| 166 | + self:triggerPassive(Passive.GET_BUFF, {trigger = releaser, buffId = buffId}) | |
| 167 | + self:triggerPassive(Passive.PLAYER_BUFF_CLASSIFY, {trigger = releaser, classify = buffData.classify}) | |
| 167 | 168 | return true |
| 168 | 169 | end |
| 169 | 170 | ... | ... |