Commit 1e6f6a8a474d96325174abc360a30c5c9cfb4625

Authored by zhouhaihai
1 parent 1229c24d

免疫 清除buff 增加新效果

Showing 2 changed files with 29 additions and 9 deletions   Show diff stats
src/adv/AdvBuff.lua
@@ -32,6 +32,7 @@ Buff.ITEM_GET_UP = 29 -- 获得道具数量增加 @@ -32,6 +32,7 @@ Buff.ITEM_GET_UP = 29 -- 获得道具数量增加
32 Buff.Buff_EFFECT_CHANGE = 30 -- 改变 buff 效果 32 Buff.Buff_EFFECT_CHANGE = 30 -- 改变 buff 效果
33 Buff.Buff_NO_PASSIVE_MONSTER = 31 -- 地图被动刷新不出来怪物 33 Buff.Buff_NO_PASSIVE_MONSTER = 31 -- 地图被动刷新不出来怪物
34 34
  35 +
35 --角色一些属性的变化 36 --角色一些属性的变化
36 local function commonAttr(_Buff, attrName) 37 local function commonAttr(_Buff, attrName)
37 _Buff._init = function(self, data) --初始化变化值 38 _Buff._init = function(self, data) --初始化变化值
@@ -238,11 +239,21 @@ local BuffFactory = { @@ -238,11 +239,21 @@ local BuffFactory = {
238 end, 239 end,
239 240
240 [Buff.IMMNUE_BUFF] = function(_Buff) 241 [Buff.IMMNUE_BUFF] = function(_Buff)
241 - _Buff._canEffect = function(self, buffId, buffGroup)  
242 - local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2  
243 - if buffData.dispel == 0 and (not cType or (cType == 0 and buffId == aim) or (cType == 1 and buffData.group == aim)) then  
244 - return true 242 + _Buff._canEffect = function(self, buffId)
  243 + local buffData = csvdb["adv_map_buffCsv"][buffId]
  244 + local cType, aim = self.buffData.effectValue1
  245 + if buffData.dispel ~= 0 then return end
  246 +
  247 + local dispel = false
  248 + if self.buffData.effectValue1 == 0 then
  249 + dispel = buffId == self.buffData.effectValue2
  250 + elseif self.buffData.effectValue1 == 1 then
  251 + dispel = buffData.group == self.buffData.effectValue2
  252 + elseif self.buffData.effectValue1 == 2 then
  253 + dispel = buffData.classify:sismember(self.buffData.effectValue2, " ")
245 end 254 end
  255 +
  256 + return dispel
246 end 257 end
247 end, 258 end,
248 259
@@ -259,10 +270,19 @@ local BuffFactory = { @@ -259,10 +270,19 @@ local BuffFactory = {
259 end 270 end
260 _Buff._canEffect = function(self, buffId) 271 _Buff._canEffect = function(self, buffId)
261 local buffData = csvdb["adv_map_buffCsv"][buffId] 272 local buffData = csvdb["adv_map_buffCsv"][buffId]
262 - local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2  
263 - if buffData.dispel == 0 and (not cType or (cType == 0 and buffId == aim) or (cType == 1 and buffData.group == aim)) then  
264 - return true 273 + local cType, aim = self.buffData.effectValue1
  274 + if buffData.dispel ~= 0 then return end
  275 +
  276 + local dispel = false
  277 + if self.buffData.effectValue1 == 0 then
  278 + dispel = buffId == self.buffData.effectValue2
  279 + elseif self.buffData.effectValue1 == 1 then
  280 + dispel = buffData.group == self.buffData.effectValue2
  281 + elseif self.buffData.effectValue1 == 2 then
  282 + dispel = buffData.classify:sismember(self.buffData.effectValue2, " ")
265 end 283 end
  284 +
  285 + return dispel
266 end 286 end
267 end, 287 end,
268 288
@@ -346,7 +366,7 @@ local BuffFactory = { @@ -346,7 +366,7 @@ local BuffFactory = {
346 _Buff._init = function(self) 366 _Buff._init = function(self)
347 -- 先给自己的buff 搞一下子 367 -- 先给自己的buff 搞一下子
348 for _, buff in ipairs(self.owner.buffs) do 368 for _, buff in ipairs(self.owner.buffs) do
349 - if not buff.isDel and (buff.buffData.classify:find(" " .. self.buffData.effectValue1) or buff.buffData.classify:find(self.buffData.effectValue1 .. " ")) then 369 + if not buff.isDel and buff.buffData.classify:sismember(self.buffData.effectValue1, " ") then
350 buff:effectChange() 370 buff:effectChange()
351 end 371 end
352 end 372 end
src/adv/AdvPassive.lua
@@ -146,7 +146,7 @@ PassiveCondFactory[Passive.SELF_HURT] = function(_Passive) @@ -146,7 +146,7 @@ PassiveCondFactory[Passive.SELF_HURT] = function(_Passive)
146 _Passive._trigger = function(self, params) 146 _Passive._trigger = function(self, params)
147 local buffId = params.buffId 147 local buffId = params.buffId
148 local data = csvdb["adv_map_buffCsv"][buffId] 148 local data = csvdb["adv_map_buffCsv"][buffId]
149 - if data.classify:find(" " .. self.passiveData.value) or data.classify:find(self.passiveData.value .. " ") then 149 + if data.classify:sismember(self.passiveData.value, " ") then
150 return true 150 return true
151 end 151 end
152 end 152 end