diff --git a/src/adv/AdvBuff.lua b/src/adv/AdvBuff.lua index 426a30c..1298257 100644 --- a/src/adv/AdvBuff.lua +++ b/src/adv/AdvBuff.lua @@ -36,6 +36,8 @@ Buff.SNEAK = 32 --潜行 Buff.DROP_BUFF_BY_ENEMY = 33 -- 怪物掉落加成 -- 怪物使用 Buff.GET_PASSIVE = 34 -- 获得 passive -- 结束失效 Buff.OBSTACLE_CHANGE = 35 -- 看守类型改变 -- 怪物使用 0 - 1 +Buff.DISABLE_AURA = 36 -- 禁用光环 +Buff.GET_AURA = 37 -- 获得光环 --角色一些属性的变化 @@ -332,6 +334,18 @@ local BuffFactory = { end end, + [Buff.DISABLE_AURA] = function(_Buff) + _Buff._effectValue = function(self) + return self.buffData.effectValue1 + end + end, + + [Buff.GET_AURA] = function(_Buff) + _Buff._effectValue = function(self) + return self.buffData.effectValue1 + end + end, + [Buff.SP_MAX_CHANGE] = function(_Buff) _Buff._init = function(self) --初始化变化值 self.owner:reSetSpMax() diff --git a/src/adv/AdvPlayer.lua b/src/adv/AdvPlayer.lua index a463731..1aaac50 100644 --- a/src/adv/AdvPlayer.lua +++ b/src/adv/AdvPlayer.lua @@ -143,6 +143,19 @@ function BaseObject:getDisablePassiveCount() return count end +function BaseObject:getDisableAuraCount() + local count + for _, buff in ipairs(self.buffs) do + if not buff:isHide() and buff:getType() == Buff.DISABLE_AURA then + if buff:effect() == 0 then + return 0 + end + count = (count or 0) + buff:effect() + end + end + return count +end + function BaseObject:addBuff(buffId, releaser, layer) layer = layer or 1 local buffData = csvdb["adv_map_buffCsv"][buffId] @@ -229,22 +242,36 @@ function BaseObject:checkAuraBuff(buffs) end function BaseObject:getAuras() + local disable = self:getDisableAuraCount() local auras = {} + local function addAura(one) + if disable > 0 then + disable = disable - 1 + else + table.insert(auras, one) + end + end if self:is("Enemy") then local halo = csvdb["event_monsterCsv"][self.monsterId].halo if halo then for _, one in ipairs(halo:toArray(true, "=")) do - table.insert(auras, one) + addAura(one) end end elseif self:is("Build") then local halo = csvdb["event_buildingCsv"][self.id].halo if halo then for _, one in ipairs(halo:toArray(true, "=")) do - table.insert(auras, one) + addAura(one) end end - end + end + + for _, buff in ipairs(self.buffs) do + if not buff:isHide() and buff:getType() == Buff.GET_AURA then + addAura(buff:effect()) + end + end return auras end -- libgit2 0.21.2