From 1e6f6a8a474d96325174abc360a30c5c9cfb4625 Mon Sep 17 00:00:00 2001 From: zhouhaihai Date: Thu, 5 Mar 2020 17:47:45 +0800 Subject: [PATCH] 免疫 清除buff 增加新效果 --- src/adv/AdvBuff.lua | 36 ++++++++++++++++++++++++++++-------- src/adv/AdvPassive.lua | 2 +- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/adv/AdvBuff.lua b/src/adv/AdvBuff.lua index fcdde4e..90567c0 100644 --- a/src/adv/AdvBuff.lua +++ b/src/adv/AdvBuff.lua @@ -32,6 +32,7 @@ Buff.ITEM_GET_UP = 29 -- 获得道具数量增加 Buff.Buff_EFFECT_CHANGE = 30 -- 改变 buff 效果 Buff.Buff_NO_PASSIVE_MONSTER = 31 -- 地图被动刷新不出来怪物 + --角色一些属性的变化 local function commonAttr(_Buff, attrName) _Buff._init = function(self, data) --初始化变化值 @@ -238,11 +239,21 @@ local BuffFactory = { end, [Buff.IMMNUE_BUFF] = function(_Buff) - _Buff._canEffect = function(self, buffId, buffGroup) - local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2 - if buffData.dispel == 0 and (not cType or (cType == 0 and buffId == aim) or (cType == 1 and buffData.group == aim)) then - return true + _Buff._canEffect = function(self, buffId) + local buffData = csvdb["adv_map_buffCsv"][buffId] + local cType, aim = self.buffData.effectValue1 + if buffData.dispel ~= 0 then return end + + local dispel = false + if self.buffData.effectValue1 == 0 then + dispel = buffId == self.buffData.effectValue2 + elseif self.buffData.effectValue1 == 1 then + dispel = buffData.group == self.buffData.effectValue2 + elseif self.buffData.effectValue1 == 2 then + dispel = buffData.classify:sismember(self.buffData.effectValue2, " ") end + + return dispel end end, @@ -259,10 +270,19 @@ local BuffFactory = { end _Buff._canEffect = function(self, buffId) local buffData = csvdb["adv_map_buffCsv"][buffId] - local cType, aim = self.buffData.effectValue1, self.buffData.effectValue2 - if buffData.dispel == 0 and (not cType or (cType == 0 and buffId == aim) or (cType == 1 and buffData.group == aim)) then - return true + local cType, aim = self.buffData.effectValue1 + if buffData.dispel ~= 0 then return end + + local dispel = false + if self.buffData.effectValue1 == 0 then + dispel = buffId == self.buffData.effectValue2 + elseif self.buffData.effectValue1 == 1 then + dispel = buffData.group == self.buffData.effectValue2 + elseif self.buffData.effectValue1 == 2 then + dispel = buffData.classify:sismember(self.buffData.effectValue2, " ") end + + return dispel end end, @@ -346,7 +366,7 @@ local BuffFactory = { _Buff._init = function(self) -- 先给自己的buff 搞一下子 for _, buff in ipairs(self.owner.buffs) do - if not buff.isDel and (buff.buffData.classify:find(" " .. self.buffData.effectValue1) or buff.buffData.classify:find(self.buffData.effectValue1 .. " ")) then + if not buff.isDel and buff.buffData.classify:sismember(self.buffData.effectValue1, " ") then buff:effectChange() end end diff --git a/src/adv/AdvPassive.lua b/src/adv/AdvPassive.lua index 09793c3..5fbef7d 100644 --- a/src/adv/AdvPassive.lua +++ b/src/adv/AdvPassive.lua @@ -146,7 +146,7 @@ PassiveCondFactory[Passive.SELF_HURT] = function(_Passive) _Passive._trigger = function(self, params) local buffId = params.buffId local data = csvdb["adv_map_buffCsv"][buffId] - if data.classify:find(" " .. self.passiveData.value) or data.classify:find(self.passiveData.value .. " ") then + if data.classify:sismember(self.passiveData.value, " ") then return true end end -- libgit2 0.21.2