Commit d677158e5720afbce135d4a13bc6a8211359dfda
1 parent
c8210d56
调整打开地块位置
Showing
3 changed files
with
5 additions
and
9 deletions
Show diff stats
src/adv/AdvBlock.lua
src/adv/AdvMap.lua
| ... | ... | @@ -125,7 +125,7 @@ function Map:openBlockRand(num, isPlayer, ignoreBack) |
| 125 | 125 | end |
| 126 | 126 | |
| 127 | 127 | |
| 128 | --- 打开一个地块 | |
| 128 | +-- 打开一个地块 翻开地块的入口方法 !!! | |
| 129 | 129 | function Map:openBlock(roomId, blockId, isPlayer, ignoreBack) |
| 130 | 130 | local room = self.rooms[roomId] |
| 131 | 131 | if not room then return end |
| ... | ... | @@ -136,7 +136,8 @@ function Map:openBlock(roomId, blockId, isPlayer, ignoreBack) |
| 136 | 136 | if status then |
| 137 | 137 | if isPlayer then |
| 138 | 138 | self.adv.battle.player:triggerPassive(Passive.OPEN_BLOCK) |
| 139 | - self.map.adv:scoreChange(AdvScoreType.Block) | |
| 139 | + self.adv:scoreChange(AdvScoreType.Block) | |
| 140 | + self.adv.owner:checkTaskEnter("AdvOpenBlock") | |
| 140 | 141 | end |
| 141 | 142 | |
| 142 | 143 | if not ignoreBack then | ... | ... |
src/adv/AdvRoom.lua
| ... | ... | @@ -21,10 +21,6 @@ function Room:loadBlocks(csvData, info) |
| 21 | 21 | local isFirstOpen = false |
| 22 | 22 | for blockId, _ in pairs(csvData["blocks"]) do |
| 23 | 23 | self.blocks[blockId] = Block.new(self, blockId, info.event[blockId], info.open == 1 or info.open[blockId], info.trap[blockId]) |
| 24 | - if self.map.adv.isRelay then -- 中继层全部开放 | |
| 25 | - self.blocks[blockId].isOpen = true | |
| 26 | - self.blocks[blockId]:randomEvent() | |
| 27 | - end | |
| 28 | 24 | if not self.isPath and self.blocks[blockId]:isBoss() then |
| 29 | 25 | self.isBossRoom = true |
| 30 | 26 | end |
| ... | ... | @@ -40,8 +36,8 @@ function Room:loadBlocks(csvData, info) |
| 40 | 36 | end |
| 41 | 37 | end |
| 42 | 38 | end |
| 43 | - -- boss 房间 开启一下所有的地块 | |
| 44 | - if self.isBossRoom and self.isShow and isFirstOpen then | |
| 39 | + --中继层全部开放 boss 房间 开启所有的地块 | |
| 40 | + if self.map.adv.isRelay or (self.isBossRoom and self.isShow and isFirstOpen) then | |
| 45 | 41 | for _, block in pairs(self.blocks) do |
| 46 | 42 | self:openBlock(block) |
| 47 | 43 | end | ... | ... |