Commit c5d9338f8876a147637c779647ba7c0a5c6a9175

Authored by zhouhaihai
1 parent b71a8190

通用方法 异常

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