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,7 +120,7 @@ Passive.GET_BUFF = 28 --获得指定buff | ||
120 | Passive.OPEN_BLOCK = 29 --翻开格子 | 120 | Passive.OPEN_BLOCK = 29 --翻开格子 |
121 | Passive.OPEN_MONSTER = 30 --翻开怪物 | 121 | Passive.OPEN_MONSTER = 30 --翻开怪物 |
122 | Passive.PLAYER_BUFF = 31 --玩家获得buff | 122 | Passive.PLAYER_BUFF = 31 --玩家获得buff |
123 | - | 123 | +Passive.PLAYER_BUFF_CLASSIFY = 35 -- 获得指定标签的buff |
124 | 124 | ||
125 | -- 不同的开启条件 | 125 | -- 不同的开启条件 |
126 | local PassiveCondFactory = {} | 126 | local PassiveCondFactory = {} |
@@ -183,6 +183,14 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | @@ -183,6 +183,14 @@ PassiveCondFactory[Passive.GET_BUFF] = function(_Passive) | ||
183 | end | 183 | end |
184 | PassiveCondFactory[Passive.PLAYER_BUFF] = PassiveCondFactory[Passive.GET_BUFF] | 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 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) | 195 | PassiveCondFactory[Passive.BORN_ONCE] = function(_Passive) |
188 | _Passive._afterRound = function(self) | 196 | _Passive._afterRound = function(self) |
src/adv/AdvPlayer.lua
@@ -163,7 +163,8 @@ function BaseObject:addBuff(buffId, releaser) | @@ -163,7 +163,8 @@ function BaseObject:addBuff(buffId, releaser) | ||
163 | table.insert(self.buffs, buff) | 163 | table.insert(self.buffs, buff) |
164 | buff:createAfter() | 164 | buff:createAfter() |
165 | end | 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 | return true | 168 | return true |
168 | end | 169 | end |
169 | 170 |