Commit 06245e45bd46525692a57053a7df0b921700a780
1 parent
668f2960
bug 被动技
Showing
2 changed files
with
5 additions
and
3 deletions
 
Show diff stats
src/adv/AdvPassive.lua
| ... | ... | @@ -300,7 +300,8 @@ function Passive:canEffect(effType, effValue) | 
| 300 | 300 | return | 
| 301 | 301 | end | 
| 302 | 302 | --禁用被动技 | 
| 303 | - if self.owner:getDisablePassiveCount() == 0 or self.owner:getPassiveIdx(self) <= self.owner:getDisablePassiveCount() then | |
| 303 | + local count, bc = self.owner:getDisablePassiveCount() | |
| 304 | + if bc > 0 and (count == 0 or self.owner:getPassiveIdx(self) <= count) then | |
| 304 | 305 | return | 
| 305 | 306 | end | 
| 306 | 307 | return true | ... | ... | 
src/adv/AdvPlayer.lua
| ... | ... | @@ -114,13 +114,14 @@ function BaseObject:getPassiveIdx(passive) | 
| 114 | 114 | end | 
| 115 | 115 | |
| 116 | 116 | function BaseObject:getDisablePassiveCount() | 
| 117 | - local count = 0 | |
| 117 | + local count, bc = 0, 0 | |
| 118 | 118 | for _, buff in ipairs(self.buffs) do | 
| 119 | 119 | if not buff.isDel and buff:getType() == Buff.DISABLE_BUFF then | 
| 120 | 120 | count = count + buff:effect() | 
| 121 | + bc = bc + 1 | |
| 121 | 122 | end | 
| 122 | 123 | end | 
| 123 | - return count | |
| 124 | + return count, bc | |
| 124 | 125 | end | 
| 125 | 126 | |
| 126 | 127 | function BaseObject:addBuff(buffId, releaser) | ... | ... |