Commit b6a2b78b45cbcccf4acd6a14658c13af03c41371
1 parent
e1b238dd
冒险 buff 类型 34 35
Showing
4 changed files
with
48 additions
and
1 deletions
Show diff stats
src/adv/AdvBlock.lua
| ... | ... | @@ -209,6 +209,13 @@ function Block:randomEvent() |
| 209 | 209 | e:addBuff(buffId) |
| 210 | 210 | end |
| 211 | 211 | end |
| 212 | + elseif data.target == 4 then | |
| 213 | + local enemys = self.room.map.adv:getCurMap():openBlocksIsMonsterByRoom(self.room.roomId) | |
| 214 | + for _, e in ipairs(enemys) do | |
| 215 | + for _, buffId in ipairs(buffs) do | |
| 216 | + e:addBuff(buffId) | |
| 217 | + end | |
| 218 | + end | |
| 212 | 219 | end |
| 213 | 220 | |
| 214 | 221 | if data.specialEff ~= "" then |
| ... | ... | @@ -279,6 +286,10 @@ function Block:quickDrop() |
| 279 | 286 | end |
| 280 | 287 | |
| 281 | 288 | function Block:getObstacle() |
| 289 | + if self:isMonster() then | |
| 290 | + local enemy = self.room.map.adv.battle:getEnemy(self.room.roomId, self.blockId) | |
| 291 | + return enemy:getObstacle() | |
| 292 | + end | |
| 282 | 293 | local data = self:getEventData() |
| 283 | 294 | if not data then return 0 end |
| 284 | 295 | return data.obstacle or 0 | ... | ... |
src/adv/AdvBuff.lua
| ... | ... | @@ -34,6 +34,8 @@ Buff.Buff_EFFECT_CHANGE = 30 -- 改变 buff 效果 |
| 34 | 34 | Buff.Buff_NO_PASSIVE_MONSTER = 31 -- 地图被动刷新不出来怪物 |
| 35 | 35 | Buff.SNEAK = 32 --潜行 |
| 36 | 36 | Buff.DROP_BUFF_BY_ENEMY = 33 -- 怪物掉落加成 -- 怪物使用 |
| 37 | +Buff.GET_PASSIVE = 34 -- 获得 passive -- 结束失效 | |
| 38 | +Buff.OBSTACLE_CHANGE = 35 -- 看守类型改变 -- 怪物使用 0 - 1 | |
| 37 | 39 | |
| 38 | 40 | |
| 39 | 41 | --角色一些属性的变化 |
| ... | ... | @@ -378,6 +380,14 @@ local BuffFactory = { |
| 378 | 380 | self.layer = self.buffData.effectValue1 |
| 379 | 381 | end |
| 380 | 382 | end, |
| 383 | + [Buff.GET_PASSIVE] = function( _Buff ) | |
| 384 | + _Buff._init = function(self) | |
| 385 | + self.owner:addPassive({id = self.buffData.effectValue1}) | |
| 386 | + end | |
| 387 | + _Buff._endBuff = function(self) | |
| 388 | + self.owner:delPassiveById(self.buffData.effectValue1) | |
| 389 | + end | |
| 390 | + end | |
| 381 | 391 | } |
| 382 | 392 | |
| 383 | 393 | -- 同样的返回 effectValue1, effectValue2 * self.layer 类型的buff | ... | ... |
src/adv/AdvMap.lua
| ... | ... | @@ -272,8 +272,8 @@ function Map:openBlock(roomId, blockId, isPlayer, ignoreBack) |
| 272 | 272 | if not ignoreBack then |
| 273 | 273 | self.adv:backBlockChange(roomId, blockId) |
| 274 | 274 | end |
| 275 | - | |
| 276 | 275 | end |
| 276 | + return status | |
| 277 | 277 | end |
| 278 | 278 | |
| 279 | 279 | function Map:openBlocksBySize(roomId, blockId, size, isPlayer, ignoreBack) |
| ... | ... | @@ -292,6 +292,24 @@ function Map:openBlocksByRoom(roomId, isPlayer, ignoreBack) |
| 292 | 292 | end |
| 293 | 293 | end |
| 294 | 294 | |
| 295 | +function Map:openBlocksIsMonsterByRoom(roomId, isPlayer, ignoreBack) | |
| 296 | + local room = self.rooms[roomId] | |
| 297 | + if not room then return end | |
| 298 | + | |
| 299 | + local enemys = {} | |
| 300 | + for blockId, block in pairs(room.blocks) do | |
| 301 | + if block:isMonster() then | |
| 302 | + if self:openBlock(roomId, blockId, isPlayer, ignoreBack) then | |
| 303 | + local e = self.adv.battle:getEnemy(block.room.roomId, block.blockId) | |
| 304 | + if e then | |
| 305 | + table.insert(enemys, e) | |
| 306 | + end | |
| 307 | + end | |
| 308 | + end | |
| 309 | + end | |
| 310 | + return enemys | |
| 311 | +end | |
| 312 | + | |
| 295 | 313 | function Map:openAllBlocks(isPlayer, ignoreBack) |
| 296 | 314 | for roomId, room in pairs(self.rooms) do |
| 297 | 315 | self:openBlocksByRoom(room.roomId, isPlayer, ignoreBack) | ... | ... |
src/adv/AdvPlayer.lua
| ... | ... | @@ -557,6 +557,14 @@ function Enemy:isEnemy() |
| 557 | 557 | return true |
| 558 | 558 | end |
| 559 | 559 | |
| 560 | +function Enemy:getObstacle() | |
| 561 | + local obstacle = csvdb["event_monsterCsv"][self.monsterId].obstacle | |
| 562 | + if obstacle == 0 and self:hadBuff(Buff.OBSTACLE_CHANGE) then | |
| 563 | + obstacle = 1 | |
| 564 | + end | |
| 565 | + return obstacle | |
| 566 | +end | |
| 567 | + | |
| 560 | 568 | function Enemy:kill() |
| 561 | 569 | self:hurt(self.hp, self.battle.player, {hurtType = 5}) |
| 562 | 570 | end | ... | ... |