// Fill the entire dungeon with wall tiles. These will be removed as necessary by the DungeonSectors generated private void fillDungeonWithWallTiles() { tiles = new ShiblitzTile[dungeonSize.x][]; for (int i = 0; i < dungeonSize.x; i++) { tiles[i] = new ShiblitzTile[dungeonSize.y]; for (int j = 0; j < dungeonSize.y; j++) { tiles[i][j] = new ShiblitzTile(ShiblitzTile.TYPE.WALL); } } }
public void open() { if (opened) { return; } opened = true; neighbor1.getSector().reveal(); neighbor2.getSector().reveal(); Game.getDungeonBoard().board.SetTile((Vector3Int)location, ShiblitzTile.getAppropriateFloorTile(location)); Game.getCamera().panAndZoomTo(neighbor1.getSector(), neighbor2.getSector()); }
public void paint(Tilemap target) { if (revealed) { for (int i = 0; i < size.x; i++) { for (int j = 0; j < size.y; j++) { TileBase type; switch (getTile(new Vector2Int(i, j)).type) { case ShiblitzTile.TYPE.DOOR: type = ShiblitzTile.doorTile; break; case ShiblitzTile.TYPE.FLOOR: type = ShiblitzTile.getAppropriateFloorTile(new Vector2Int(position.x + i, position.y + j)); break; case ShiblitzTile.TYPE.WALL: type = ShiblitzTile.wallTile; break; default: Debug.Log("ShiblitzTile Type " + getTile(new Vector2Int(i, j)).type + " is not handled in paint() function"); type = ShiblitzTile.bonusTile; break; } target.SetTile(new Vector3Int(position.x + i, position.y + j, 0), type); } } } else { for (int i = 0; i < size.x; i++) { for (int j = 0; j < size.y; j++) { target.SetTile(new Vector3Int(position.x + i, position.y + j, 0), ShiblitzTile.wallTile); } } } }
public void reveal() { if (revealed) { return; } foreach (Enemy e in enemies) { e.reveal(); e.aggro(); } revealed = true; for (int i = 0; i < neighbors.Count; i++) { if (neighbors[i].isConnected()) { Game.getDungeonBoard().board.SetTile((Vector3Int)neighbors[i].door.location, ShiblitzTile.doorTile); if (type == TYPE.FILLED) { if (neighbors[i].getSector().type == TYPE.FILLED) { neighbors[i].getSector().reveal(); Game.getDungeonBoard().board.SetTile((Vector3Int)neighbors[i].door.location, ShiblitzTile.getAppropriateFloorTile(neighbors[i].door.location)); } else { Game.getDungeonBoard().board.SetTile((Vector3Int)neighbors[i].door.location, ShiblitzTile.doorTile); } } } } paint(Game.getDungeonBoard().board); }