Commit 3139a1163b07e32d9371b0c7e6a19e94c88d80c8
1 parent
3c51e6d4
光环相关buff
Showing
2 changed files
with
44 additions
and
3 deletions
Show diff stats
src/adv/AdvBuff.lua
| ... | ... | @@ -36,6 +36,8 @@ Buff.SNEAK = 32 --潜行 |
| 36 | 36 | Buff.DROP_BUFF_BY_ENEMY = 33 -- 怪物掉落加成 -- 怪物使用 |
| 37 | 37 | Buff.GET_PASSIVE = 34 -- 获得 passive -- 结束失效 |
| 38 | 38 | Buff.OBSTACLE_CHANGE = 35 -- 看守类型改变 -- 怪物使用 0 - 1 |
| 39 | +Buff.DISABLE_AURA = 36 -- 禁用光环 | |
| 40 | +Buff.GET_AURA = 37 -- 获得光环 | |
| 39 | 41 | |
| 40 | 42 | |
| 41 | 43 | --角色一些属性的变化 |
| ... | ... | @@ -332,6 +334,18 @@ local BuffFactory = { |
| 332 | 334 | end |
| 333 | 335 | end, |
| 334 | 336 | |
| 337 | + [Buff.DISABLE_AURA] = function(_Buff) | |
| 338 | + _Buff._effectValue = function(self) | |
| 339 | + return self.buffData.effectValue1 | |
| 340 | + end | |
| 341 | + end, | |
| 342 | + | |
| 343 | + [Buff.GET_AURA] = function(_Buff) | |
| 344 | + _Buff._effectValue = function(self) | |
| 345 | + return self.buffData.effectValue1 | |
| 346 | + end | |
| 347 | + end, | |
| 348 | + | |
| 335 | 349 | [Buff.SP_MAX_CHANGE] = function(_Buff) |
| 336 | 350 | _Buff._init = function(self) --初始化变化值 |
| 337 | 351 | self.owner:reSetSpMax() | ... | ... |
src/adv/AdvPlayer.lua
| ... | ... | @@ -143,6 +143,19 @@ function BaseObject:getDisablePassiveCount() |
| 143 | 143 | return count |
| 144 | 144 | end |
| 145 | 145 | |
| 146 | +function BaseObject:getDisableAuraCount() | |
| 147 | + local count | |
| 148 | + for _, buff in ipairs(self.buffs) do | |
| 149 | + if not buff:isHide() and buff:getType() == Buff.DISABLE_AURA then | |
| 150 | + if buff:effect() == 0 then | |
| 151 | + return 0 | |
| 152 | + end | |
| 153 | + count = (count or 0) + buff:effect() | |
| 154 | + end | |
| 155 | + end | |
| 156 | + return count | |
| 157 | +end | |
| 158 | + | |
| 146 | 159 | function BaseObject:addBuff(buffId, releaser, layer) |
| 147 | 160 | layer = layer or 1 |
| 148 | 161 | local buffData = csvdb["adv_map_buffCsv"][buffId] |
| ... | ... | @@ -229,22 +242,36 @@ function BaseObject:checkAuraBuff(buffs) |
| 229 | 242 | end |
| 230 | 243 | |
| 231 | 244 | function BaseObject:getAuras() |
| 245 | + local disable = self:getDisableAuraCount() | |
| 232 | 246 | local auras = {} |
| 247 | + local function addAura(one) | |
| 248 | + if disable > 0 then | |
| 249 | + disable = disable - 1 | |
| 250 | + else | |
| 251 | + table.insert(auras, one) | |
| 252 | + end | |
| 253 | + end | |
| 233 | 254 | if self:is("Enemy") then |
| 234 | 255 | local halo = csvdb["event_monsterCsv"][self.monsterId].halo |
| 235 | 256 | if halo then |
| 236 | 257 | for _, one in ipairs(halo:toArray(true, "=")) do |
| 237 | - table.insert(auras, one) | |
| 258 | + addAura(one) | |
| 238 | 259 | end |
| 239 | 260 | end |
| 240 | 261 | elseif self:is("Build") then |
| 241 | 262 | local halo = csvdb["event_buildingCsv"][self.id].halo |
| 242 | 263 | if halo then |
| 243 | 264 | for _, one in ipairs(halo:toArray(true, "=")) do |
| 244 | - table.insert(auras, one) | |
| 265 | + addAura(one) | |
| 245 | 266 | end |
| 246 | 267 | end |
| 247 | - end | |
| 268 | + end | |
| 269 | + | |
| 270 | + for _, buff in ipairs(self.buffs) do | |
| 271 | + if not buff:isHide() and buff:getType() == Buff.GET_AURA then | |
| 272 | + addAura(buff:effect()) | |
| 273 | + end | |
| 274 | + end | |
| 248 | 275 | |
| 249 | 276 | return auras |
| 250 | 277 | end | ... | ... |