Commit 23d9f08609f139faf85a2f9a1aca26282db667db

Authored by zhouhaihai
1 parent 5a13ebef

展示房间

Showing 2 changed files with 9 additions and 4 deletions   Show diff stats
src/adv/AdvMap.lua
... ... @@ -10,7 +10,8 @@ local createMap, getEventLib
10 10  
11 11 function Map:ctor(adv, mapIdx, mapInfo, isEnter, isNewRelay)
12 12 self.adv = adv
13   - if type(mapInfo) == "number" then -- mapInfo 传入 id
  13 + local isNew = type(mapInfo) == "number"
  14 + if isNew then -- mapInfo 传入 id
14 15 mapInfo = createMap(self, mapInfo, isEnter, isNewRelay) -- 生成地图
15 16 end
16 17 if not mapInfo then return end
... ... @@ -19,10 +20,10 @@ function Map:ctor(adv, mapIdx, mapInfo, isEnter, isNewRelay)
19 20 self.mapId = mapInfo.mapId
20 21 self.isShow = mapInfo.isShow -- 是否全部展示 -- 客户端用
21 22 self.rooms = {}
22   - self:loadRooms(mapInfo.rooms, isNewRelay)
  23 + self:loadRooms(mapInfo.rooms, isNew, isNewRelay)
23 24 end
24 25  
25   -function Map:loadRooms(rooms, isNewRelay)
  26 +function Map:loadRooms(rooms, isNew, isNewRelay)
26 27 local mapInfoCsv = csvdb["mapCsv"][self.mapId]
27 28 local mapData = csvdb["map_" .. mapInfoCsv["path"] .. "Csv"]
28 29  
... ... @@ -34,6 +35,10 @@ function Map:loadRooms(rooms, isNewRelay)
34 35 self.rooms[roomId] = Room.new(self, roomId, csvdb["room_" .. roomName .. "Csv"], rooms[roomId], false, isNewRelay, mapInfoCsv.type)
35 36 end
36 37 end
  38 +
  39 + if mapInfoCsv.type == 2 and isNew then
  40 + self:showMap()
  41 + end
37 42 end
38 43  
39 44 function Map:initBattleAfter()
... ...
src/adv/AdvRoom.lua
... ... @@ -38,7 +38,7 @@ function Room:loadBlocks(csvData, info, isNewRelay, mapType)
38 38 end
39 39 end
40 40 --中继层全部开放 boss 房间 开启所有的地块
41   - if (self.map.adv.isRelay and not isNewRelay) or (self.isBossRoom and self.isShow and isFirstOpen) or mapType == 2 or (isFirstOpen and mapType == 1) then
  41 + if (self.map.adv.isRelay and not isNewRelay) or (self.isBossRoom and self.isShow and isFirstOpen) or (isFirstOpen and mapType == 1) then
42 42 table.insert(self.battleAfterCall, function()
43 43 for _, block in pairs(self.blocks) do
44 44 self:openBlock(block)
... ...