Example #1
0
 def generate(self, options):
     MapGenerator.generate(self, options)
     
     print("Creating stairwells.")
     
     stair_max = 3
     stair_quantity = 0
     
     if options['connections'][Direction.UP] is not False:
         for location in options['connections'][Direction.UP]:
             self.create_stairwell(location, up=True)
             stair_quantity += 1
         
     if options['connections'][Direction.DOWN] is not False:
         for location in options['connections'][Direction.DOWN]:
             self.create_stairwell(location, up=False)
             stair_quantity += 1
     
     maximum = stair_max/2 - stair_quantity
     if maximum > 0:
         for _ in xrange(random.randint(1, maximum)):
             self.create_stairwell(up=False)
             stair_quantity += 1
     
     for _ in xrange(max(0, stair_max - stair_quantity)):
         self.create_stairwell(up=True)
     
     print("Creating "+str(self.room_quantity)+" rooms.")
     self.create_rooms(self.room_quantity)
     
     print("Creating exits.")
     for direction in [Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST]:
         if options['connections'][direction] is not False:
             for _ in xrange(2):
                 self.create_exit(direction)
     
     print("Decoding map.")
     tile_map = self.decode_map()
     print("Decorating rooms.")
     self.decorate_rooms(tile_map)
     
     print("Creating passages.")
     self.create_passages(tile_map, random.randint(3, 7))
     
     self.clean()
     return tile_map
Example #2
0
 def generate(self, options):
     MapGenerator.generate(self, options)
     
     print("Creating Throne Room")
     self.create_throne_room()
     
     print("Creating "+str(self.room_quantity)+" rooms.")
     self.create_rooms(self.room_quantity)
     
     print("Creating dividers.")
     for direction in [Direction.NORTH, Direction.SOUTH, Direction.WEST, Direction.EAST]:
         for _ in xrange(2):
             self.create_divider(direction)
     
     print("Decoding map.")
     tile_map = self.decode_map()
     print("Decorating rooms.")
     self.decorate_rooms(tile_map)
     
     print("Creating passages.")
     self.create_passages(tile_map, random.randint(3, 7))
     
     self.clean()
     return tile_map
Example #3
0
 def generate(self, options):
     MapGenerator.generate(self, options)
     
     return self.decode_map()