Commit c5d9338f8876a147637c779647ba7c0a5c6a9175

Authored by zhouhaihai
1 parent b71a8190

通用方法 异常

src/adv/AdvBuff.lua
... ... @@ -95,7 +95,6 @@ local function commonAttCond(_Buff, attrName)
95 95 end
96 96  
97 97 _Buff._effectValue = function(self)
98   - print(self:_calculate() * self.layer)
99 98 return self.buffData.effectValue1, self:_calculate() * self.layer, attrName
100 99 end
101 100  
... ... @@ -230,7 +229,6 @@ local BuffFactory = {
230 229 elseif self.buffData.effectValue1 == 2 then
231 230 dispel = buffData.classify:sismember(self.buffData.effectValue2, " ")
232 231 end
233   -
234 232 return dispel
235 233 end
236 234 end,
... ...
src/adv/AdvPlayer.lua
... ... @@ -152,6 +152,7 @@ function BaseObject:addBuff(buffId, releaser)
152 152 end
153 153 self:triggerPassive(Passive.GET_BUFF, {buffId = buffId})
154 154 self.battle.adv:backBuff(self.monsterId, buffId)
  155 + return true
155 156 end
156 157  
157 158 function BaseObject:getBuffById(bId)
... ... @@ -647,9 +648,12 @@ function Player:afterLayer()
647 648 end
648 649  
649 650 function Player:addBuff(buffId, releaser)
650   - Player.super.addBuff(self, buffId, releaser)
651   - self.battle.player:attrChangeCondBuffCheck(2, buffId)
652   - self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId)
  651 + local status = Player.super.addBuff(self, buffId, releaser)
  652 + if status then
  653 + self.battle.player:attrChangeCondBuffCheck(2, buffId)
  654 + self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId)
  655 + end
  656 + return status
653 657 end
654 658  
655 659 function Player:attrChangeCondBuffCheck(etype, cond)
... ... @@ -663,7 +667,6 @@ function Player:attrChangeCondBuffCheck(etype, cond)
663 667  
664 668 end
665 669 end
666   - dump(effect)
667 670 for attrName, _ in pairs(effect) do
668 671 if attrName == "hp" then
669 672 self:reSetHpMax()
... ...
src/utils/StringUtil.lua
... ... @@ -269,7 +269,7 @@ v1;v2;v3;
269 269 function string.sismember(str, value, delimiter)
270 270 delimiter = delimiter or ";"
271 271 for _, v in ipairs(str:toArray(true, delimiter)) do
272   - if v == val then
  272 + if v == value then
273 273 return true
274 274 end
275 275 end
... ...