示例#1
0
    def _clear_wall_walkway(self):
        builds = []
        builds.append(
            BuildingBlock(self.column_se_corner +
                          Vec3(self._get_x(-7), WALL_HEIGHT, -2),
                          block.AIR,
                          self.column_se_corner +
                          Vec3(self._get_x(-4), WALL_HEIGHT + 2, -3),
                          description="clear corner turret wall walkway"))
        builds.append(
            BuildingBlock(self.column_se_corner +
                          Vec3(self._get_x(-5), WALL_HEIGHT, -3),
                          block.AIR,
                          self.column_se_corner +
                          Vec3(self._get_x(-4), WALL_HEIGHT + 2, 0),
                          description="clear corner turret wall walkway"))

        builds.append(
            Torch(self.column_se_corner +
                  Vec3(self._get_x(-6), WALL_HEIGHT + 2, -2),
                  block.TORCH.withData(Torch.NORTH),
                  description="walkway torch"))
        torch_orientation = Torch.EAST
        if self.mirrored:
            torch_orientation = Torch.WEST

        builds.append(
            Torch(self.column_se_corner +
                  Vec3(self._get_x(-5), WALL_HEIGHT + 2, -1),
                  block.TORCH.withData(torch_orientation),
                  description="walkway torch"))
        self._add_section("Turret - clear wall walkway", builds)
示例#2
0
    def _create_turret_access(self):
        builds = []
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(self._get_x(0), 0, 0),
                          block.STONE_BRICK,
                          self.column_se_corner + Vec3(self._get_x(-1), 3, -1),
                          description="turret access point"))
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(self._get_x(-1), 0, -1),
                          block.AIR,
                          self.column_se_corner + Vec3(self._get_x(-2), 2, -3),
                          description="turret acces clearance"))
        hinge_type = Door.HINGE_LEFT
        door_orientation = Door.EAST
        if self.mirrored:
            hinge_type = Door.HINGE_RIGHT
            door_orientation = Door.WEST

        # Place door on east wall of access point, so doorways either side of gate face each other
        # this will probably be usefull if i have to leave assess between animal pens on east wall
        builds.append(
            Door(Door.hinge_type,
                 self.column_se_corner + Vec3(self._get_x(0), 0, -1),
                 block.DOOR_WOOD.withData(door_orientation),
                 description="Turret access door"))

        self._add_section("Straight Turret access", builds)
示例#3
0
    def __init__(self, *args, **kwargs):
        super(LampPost, self).__init__(width=LampPost.WIDTH, *args, **kwargs)

        post = BuildingBlock(Building.SE_CORNER_POS + Vec3(-1, 0, -1),
                             block.FENCE,
                             description="Post")
        self.add_layer(BuildingLayer([post], 0))
        self.add_layer(BuildingLayer([post], 1))
        self.add_layer(BuildingLayer([post], 2))

        torches = [(Building.SE_CORNER_POS + Vec3(-2, 0, -1),
                    block.TORCH.withData(Torch.WEST), "West torch"),
                   (Building.SE_CORNER_POS + Vec3(-1, 0, -2),
                    block.TORCH.withData(Torch.NORTH), "North torch"),
                   (Building.SE_CORNER_POS + Vec3(0, 0, -1),
                    block.TORCH.withData(Torch.EAST), "East torch"),
                   (Building.SE_CORNER_POS + Vec3(-1, 0, 0),
                    block.TORCH.withData(Torch.SOUTH), "South torch")]

        wool_block = block.WOOL.withData(LampPost.BLACK_WOOL)
        lamp_blocks = []
        lamp_blocks.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(-1, 0, -1),
                          wool_block,
                          description="Lamp block"))
        for pos, block_type, desc in torches:
            lamp_blocks.append(Torch(pos, block_type, description=desc))

        self.add_layer(BuildingLayer(lamp_blocks, 3))

        self._set_orientation()
示例#4
0
    def _create_structure(self):
        super(GroundRoomBase, self)._create_structure()

        # create walls
        builds = []
        builds.append(
            BuildingBlock(GroundRoomBase.WALLS_CORNER_POS['South East'],
                          EXTERIOR_WALLS,
                          GroundRoomBase.WALLS_CORNER_POS['South West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="South wall"))
        builds.append(
            BuildingBlock(GroundRoomBase.WALLS_CORNER_POS['South West'],
                          EXTERIOR_WALLS,
                          GroundRoomBase.WALLS_CORNER_POS['North West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="West wall"))
        builds.append(
            BuildingBlock(GroundRoomBase.WALLS_CORNER_POS['North East'],
                          EXTERIOR_WALLS,
                          GroundRoomBase.WALLS_CORNER_POS['North West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="North wall"))
        builds.append(
            BuildingBlock(GroundRoomBase.WALLS_CORNER_POS['South East'],
                          EXTERIOR_WALLS,
                          GroundRoomBase.WALLS_CORNER_POS['North East'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="East wall"))

        self._add_section("Base room walls", builds)
        self._add_windows()
示例#5
0
    def _create_structure(self):
        super(GroundRoomBase, self)._create_structure()
        builds = []
        builds.append(
            BuildingBlock(UpperRoomBase.WALLS_CORNER_POS['South East'],
                          INTERIOR_WALLS,
                          UpperRoomBase.WALLS_CORNER_POS['South West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="South wall"))
        builds.append(
            BuildingBlock(UpperRoomBase.WALLS_CORNER_POS['South West'],
                          INTERIOR_WALLS,
                          UpperRoomBase.WALLS_CORNER_POS['North West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="West wall"))
        builds.append(
            BuildingBlock(UpperRoomBase.WALLS_CORNER_POS['South East'],
                          INTERIOR_WALLS,
                          UpperRoomBase.WALLS_CORNER_POS['North East'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="East wall"))
        # add exterior north wll last so corners are last written as exterior.
        builds.append(
            BuildingBlock(UpperRoomBase.WALLS_CORNER_POS['North East'],
                          EXTERIOR_WALLS,
                          UpperRoomBase.WALLS_CORNER_POS['North West'] +
                          Vec3(0, WALL_HEIGHT, 0),
                          description="North wall"))
        # add doors to south wall

        self._add_section("Upper room walls", builds)
        self._add_windows()
示例#6
0
    def _create_moat(self):
        builds = []
        builds.append(
            BuildingBlock(
                Building.SE_CORNER_POS + Vec3(0, self.base_level, -2),
                block.DIRT,
                Building.SE_CORNER_POS + Vec3(self.x2, self.base_level, -5),
                description="Wall moat base"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(0, self.foundation_depth, -5),
                          block.STONE_BRICK,
                          Building.SE_CORNER_POS + Vec3(self.x2, -1, -5),
                          description="moat outer wall"))

        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(0, self.foundation_depth, -2),
                          block.WATER,
                          Building.SE_CORNER_POS + Vec3(self.x2, -2, -4),
                          description="moat water"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(0, -1, -2),
                          block.AIR,
                          Building.SE_CORNER_POS + Vec3(self.x2, -1, -4),
                          description="clear blocks over water"))
        self._add_section("Wall - moat", builds)
示例#7
0
    def _add_windows(self):
        builds = []
        builds.append(
            BuildingBlock(
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-1, 1, 0),
                block.GLASS_PANE,
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-1, 2, 0),
                description="window"))
        builds.append(
            BuildingBlock(
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-3, 1, 0),
                block.GLASS_PANE,
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-4, 2, 0),
                description="window"))
        builds.append(
            BuildingBlock(
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-6, 1, 0),
                block.GLASS_PANE,
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-6, 2, 0),
                description="window"))
        builds.append(
            Torch(
                GroundRoomBase.WALLS_CORNER_POS['North East'] + Vec3(-2, 2, 1),
                block.TORCH.withData(Torch.SOUTH)))
        builds.append(
            Torch(
                GroundRoomBase.WALLS_CORNER_POS['North West'] + Vec3(2, 2, 1),
                block.TORCH.withData(Torch.SOUTH)))

        self._add_section("Base room windows", builds)
示例#8
0
	def _create_structure(self):
		#   sssggssggssssggssggsss 9
		#   wb   T   ffff   T   bw 8 
		#   wb       ffff       bw 7 side walls lined with book shelves
		#   wb    c  ffff  c    bw 6 c  => chair
		#   wb                  bw 5
		#   wT       fccf       Tw 4  fences posts 3 high around bed, wood slabs on top?
		#   wt        bb        cw 3  t=> table, c=> chair
		#   wtc       bb        cw 2	desk & chairs one side, sofa on the other?
		#   wt   T   f  f   T    w 1
		#   wwwwwwddwwwwwwddwwwwww 0 TODO: move doors
		#           t    t          
		#   1098765432109876543210
		#    2         1          
		super(Bedroom, self)._create_structure()
		self._create_walls_and_doors()
		self._create_windows()
		self._create_torches()

		builds = []

		# bookshelves
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-1,0,1),
									block.BOOKSHELF,
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-1,3,4),
									description="East bookshelves"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North West'] + Vec3(1,0,1),
									block.BOOKSHELF,
									Bedroom.WALLS_CORNER_POS['North West'] + Vec3(1,3,4),
									description="West bookshelves"))
		self._add_section("Bedroom bookshelves", builds)
							
		# TODO: fireplace, bed & chest, desk & chairs & sofa
示例#9
0
    def __init__(self, *args, **kwargs):
        super(Well, self).__init__(width=Well.WIDTH, *args, **kwargs)

        # level -3, base
        base = []
        base.append(
            BuildingBlock(Well.WELL_CORE_POS[0],
                          block.COBBLESTONE,
                          Well.WELL_CORE_POS[1],
                          description="Well base"))
        self.add_layer(BuildingLayer(base, -3))

        # level -2, water
        water = []
        water.extend(base)
        water.append(
            BuildingBlock(Well.WELL_INNER_SPAN[0],
                          block.WATER,
                          Well.WELL_INNER_SPAN[1],
                          description="Well water"))

        self.add_layer(BuildingLayer(water, -2))

        layer_blocks = []
        # level -1, ground
        layer_blocks.append(
            BuildingBlock(Well.WELL_OUTER_SPAN[0],
                          block.GRAVEL,
                          Well.WELL_OUTER_SPAN[1],
                          description="Well ground surround"))
        layer_blocks.extend(water)

        self.add_layer(BuildingLayer(layer_blocks, -1))
        del layer_blocks[:]

        # level 0, walls
        layer_blocks.extend(base)
        layer_blocks.append(
            BuildingBlock(Well.WELL_INNER_SPAN[0],
                          block.AIR,
                          Well.WELL_INNER_SPAN[1],
                          description="Well clear inner"))

        self.add_layer(BuildingLayer(layer_blocks, 0))
        del layer_blocks[:]

        # levels 1 & 2, supports
        supports = []
        for pos in Well.WELL_CORE_POS:
            supports.append(
                BuildingBlock(pos, block.FENCE, description="Well support"))

        self.add_layer(BuildingLayer(supports, 1))
        self.add_layer(BuildingLayer(supports, 2))

        # level 3 roof
        base[0].description = "Well roof"
        self.add_layer(BuildingLayer(base, 3))

        self._set_orientation()
示例#10
0
	def _create_walls_and_doors(self):
		builds = []
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['South East'],
									INTERIOR_WALLS, 
									Bedroom.WALLS_CORNER_POS['South West'] + Vec3(0,WALL_HEIGHT,0),
									description="Bedroom south wall"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['South West'],
									INTERIOR_WALLS, 
									Bedroom.WALLS_CORNER_POS['North West'] + Vec3(0,WALL_HEIGHT,1),
									description="Bedroom west wall"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['South East'],
									INTERIOR_WALLS, 
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(0,WALL_HEIGHT,1),
									description="Bedroom east wall"))

		builds.append(Door(Door.HINGE_RIGHT, 
							Bedroom.WALLS_CORNER_POS['South East'] + Vec3(-6,0,0),
							block.DOOR_WOOD.withData(Door.SOUTH),
							description="Bedroom door"))
		builds.append(Door(Door.HINGE_LEFT, 
							Bedroom.WALLS_CORNER_POS['South East'] + Vec3(-7,0,0),
							block.DOOR_WOOD.withData(Door.SOUTH),
							description="Bedroom door"))
		
		builds.append(Door(Door.HINGE_RIGHT, 
							Bedroom.WALLS_CORNER_POS['South East'] + Vec3(-14,0,0),
							block.DOOR_WOOD.withData(Door.SOUTH),
							description="Bedroom door"))
		builds.append(Door(Door.HINGE_LEFT, 
							Bedroom.WALLS_CORNER_POS['South East'] + Vec3(-15,0,0),
							block.DOOR_WOOD.withData(Door.SOUTH),
							description="Bedroom door"))
		self._add_section("Bedroom shell", builds)
示例#11
0
    def __init__(self, *args, **kwargs):
        super(SmallHouseV2, self).__init__(*args, **kwargs)

        #######################################################################
        # build the roof
        layer_blocks = []
        # create the wall spans as wood for first layer of roof
        for pos1, pos2, desc in SmallHouseV2Base.WALL_SPANS:
            layer_blocks.append(
                BuildingBlock(pos1, block.WOOD, pos2, desc + " roof"))

        self.add_layer(BuildingLayer(layer_blocks, 4))
        del layer_blocks[:]

        # create inner span as wood for second layer of roof
        layer_blocks.append(
            BuildingBlock(SmallHouseV2Base.WALLS_CORNER_POS['South East'] +
                          Vec3(-1, 0, -1),
                          block.WOOD,
                          SmallHouseV2Base.WALLS_CORNER_POS['North West'] +
                          Vec3(1, 0, 1),
                          description="Roof inner"))

        self.add_layer(BuildingLayer(layer_blocks, 5))
        del layer_blocks[:]

        self._set_orientation()
示例#12
0
    def _clear_se_wall(self):
        #TODO: leaving blocks agains twall intact
        builds = []
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(0, WALL_DEPTH, 0),
                          block.WATER,
                          Building.SE_CORNER_POS + Vec3(0, WATER_HEIGHT, -1),
                          description="clear turret moat end- water"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(0, WATER_HEIGHT + 1, 0),
                          block.AIR,
                          Building.SE_CORNER_POS + Vec3(0, -1, -1),
                          description="clear turret moat end- air bove water"))

        builds.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(-1, WALL_DEPTH, -2),
                          block.WATER,
                          Building.SE_CORNER_POS + Vec3(-1, WATER_HEIGHT, -2),
                          description="clear turret moat end- water"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(-1, WATER_HEIGHT + 1, -2),
                          block.AIR,
                          Building.SE_CORNER_POS + Vec3(-1, -1, -2),
                          description="clear turret moat end- air bove water"))

        self._add_section("Wall turret moat - clear SE opening", builds)
示例#13
0
    def _clear_nw_wall(self):
        builds = []
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(-6, WALL_DEPTH, -7),
                          block.WATER,
                          Building.SE_CORNER_POS + Vec3(-7, WATER_HEIGHT, -7),
                          description="clear turret moat end- water"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(-6, WATER_HEIGHT + 1, -7),
                          block.AIR,
                          Building.SE_CORNER_POS + Vec3(-7, -1, -7),
                          description="clear turret moat end- air bove water"))

        builds.append(
            BuildingBlock(Building.SE_CORNER_POS + Vec3(-5, WALL_DEPTH, -6),
                          block.WATER,
                          Building.SE_CORNER_POS + Vec3(-5, WATER_HEIGHT, -6),
                          description="clear turret moat end- water"))
        builds.append(
            BuildingBlock(Building.SE_CORNER_POS +
                          Vec3(-5, WATER_HEIGHT + 1, -6),
                          block.AIR,
                          Building.SE_CORNER_POS + Vec3(-5, -1, -6),
                          description="clear turret moat end- air bove water"))
        self._add_section("Wall turret moat - clear NW opening", builds)
示例#14
0
	def _create_wall_clearances(self):
		builds = []

		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-3),0,-1),
									block.AIR,
									Building.SE_CORNER_POS + Vec3(self._get_x(-3),WALL_HEIGHT,-2),
									description="turret wall clearance"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-1),0,-3),
									block.AIR,
									Building.SE_CORNER_POS + Vec3(self._get_x(-2),WALL_HEIGHT,-3),
									description="turret wall clearance"))
		self._add_section("Wall clearances for turret", builds)
示例#15
0
	def _create_multipart_layer(self, orientation):
		WELL_OUTER = (Vec3(-2,0,-1), Vec3(3,0,-6))
		WELL_CORE = (Vec3(-1,0,-2), Vec3(2,0,-5))
		WELL_INNER = (Vec3(0,0,-3), Vec3(1,0,-4))

		WELL_GROUND = []
		WELL_GROUND.append(BuildingBlock(WELL_OUTER[0], block.GRAVEL, WELL_OUTER[1]))
		WELL_GROUND.append(BuildingBlock(WELL_CORE[0], block.STONE, WELL_CORE[1]))
		WELL_GROUND.append(BuildingBlock(WELL_INNER[0], block.WATER, WELL_INNER[1]))

		sut = BuildingLayer(WELL_GROUND, 0)
		sut = self._rotate_sut(sut, orientation)
		return sut
示例#16
0
	def _create_ground_floor_fittings(self):
		# TODO: add class for main doorway
		# add windows & torches 
		builds = []
		builds.append(SubBuilding(TurretTaper(Building.NORTH), Castle.WALLS_CORNER_POS['North West'] + Vec3(3,0,3)))
		builds.append(SubBuilding(TurretTaper(Building.EAST), Castle.WALLS_CORNER_POS['North East'] + Vec3(-3,0,3)))
		builds.append(SubBuilding(TurretTaper(Building.SOUTH), Castle.WALLS_CORNER_POS['South East'] + Vec3(-3,0,-3)))
		builds.append(SubBuilding(TurretTaper(Building.WEST), Castle.WALLS_CORNER_POS['South West'] + Vec3(3,0,-3)))
		self._add_section("Turret bases", builds)

		# torches over external side doors
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-1,2,-15),
							block.TORCH.withData(Torch.WEST)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-26,2,-15),
							block.TORCH.withData(Torch.EAST)))

		# torches a foyer end of corridors
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-8,2,-15),
							block.TORCH.withData(Torch.SOUTH)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-19,2,-15),
							block.TORCH.withData(Torch.SOUTH)))

		# torches on walls of kitchen & enchanting room
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-8,2,-10),
							block.TORCH.withData(Torch.WEST)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-19,2,-9),
							block.TORCH.withData(Torch.EAST)))

		# torches on walls of Pantry & smithy
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-8,2,-5),
							block.TORCH.withData(Torch.WEST)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-19,2,-5),
							block.TORCH.withData(Torch.EAST)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-8,2,-2),
							block.TORCH.withData(Torch.WEST)))
		builds.append(Torch(Castle.WALLS_CORNER_POS['South East'] + Vec3(-19,2,-2),
							block.TORCH.withData(Torch.EAST)))

		self._add_section("Ground floor torches", builds)

		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['South East'] + Vec3(-9,1,0),
									block.GLASS_PANE, 
									Castle.WALLS_CORNER_POS['South East'] + Vec3(-10,2,0),
									description="window"))
		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['South East'] + Vec3(-17,1,0),
									block.GLASS_PANE, 
									Castle.WALLS_CORNER_POS['South East'] + Vec3(-18,2,0),
									description="window"))


		self._add_section("Ground floor Windows", builds)
示例#17
0
	def __init__(self, multiplier=1, *args, **kwargs):
		super(Street, self).__init__(width=Street.WIDTH, *args, **kwargs)
		self.multiplier = multiplier
				
		z_extent = (-3 * multiplier) + 1
		path = BuildingBlock(Building.SE_CORNER_POS, block.COBBLESTONE, 
								Building.SE_CORNER_POS + Vec3(-2,0,z_extent))
		self.add_layer(BuildingLayer([path], -2))

		path = BuildingBlock(Building.SE_CORNER_POS, block.GRAVEL, 
								Building.SE_CORNER_POS + Vec3(-2,0,z_extent))
		self.add_layer(BuildingLayer([path], -1))
		
		self._set_orientation()
示例#18
0
	def _create_singlepart_layer(self, orientation):
		WELL_CORE = (Vec3(-1,0,-2), Vec3(2,0,-5))
		WELL_BASE = []
		WELL_BASE.append(BuildingBlock(WELL_CORE[0], block.STONE, WELL_CORE[1]))
		sut = BuildingLayer(WELL_BASE, 0)
		sut = self._rotate_sut(sut, orientation)
		return sut
示例#19
0
	def _create_walls(self):
		builds = []
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-4),0,0),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-4),WALL_HEIGHT+2,0),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-5),0,-1),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-5),WALL_HEIGHT+2,-1),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-6),0,-2),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-6),WALL_HEIGHT+2,-4),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-5),0,-5),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-5),WALL_HEIGHT+2,-5),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-4),0,-6),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-2),WALL_HEIGHT+2,-6),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(-1),0,-5),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(-1),WALL_HEIGHT+2,-5),
									description="turret wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(0),0,-4),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(self._get_x(0),WALL_HEIGHT+2,-4),
									description="turret wall"))

		self._add_section("Turret walls", builds)
示例#20
0
 def _create_base(self):
     builds = []
     builds.append(
         BuildingBlock(Building.SE_CORNER_POS + Vec3(0, self.base_level, 0),
                       block.DIRT,
                       Building.SE_CORNER_POS +
                       Vec3(-7, self.base_level, -7),
                       description="turret moat base"))
     self._add_section("Wall turret moat - base", builds)
示例#21
0
    def _clear_wall_walkway(self):
        builds = []
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(-7, WALL_HEIGHT, -2),
                          block.AIR,
                          self.column_se_corner + Vec3(0, WALL_HEIGHT + 2, -3),
                          description="clear turret moat end- air bove water"))

        self._add_section("Straight Turret - clear wall walkway", builds)
示例#22
0
    def _create_turret_access(self):
        builds = []
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(self._get_x(-6), -2, 0),
                          block.STONE_BRICK,
                          self.column_se_corner + Vec3(self._get_x(-7), 3, -1),
                          description="turret access point"))
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(self._get_x(-4), 0, -1),
                          block.AIR,
                          self.column_se_corner + Vec3(self._get_x(-6), 2, -1),
                          description="turret acces clearance"))
        builds.append(
            BuildingBlock(self.column_se_corner + Vec3(self._get_x(-4), 0, -2),
                          block.AIR,
                          self.column_se_corner + Vec3(self._get_x(-4), 2, -2),
                          description="turret acces clearance"))
        hinge_type = Door.HINGE_RIGHT
        door_orientation = Door.WEST
        inside_torch = Torch.EAST
        outside_torch = Torch.WEST
        if self.mirrored:
            hinge_type = Door.HINGE_LEFT
            door_orientation = Door.EAST
            inside_torch = Torch.WEST
            outside_torch = Torch.EAST

        builds.append(
            Door(hinge_type,
                 self.column_se_corner + Vec3(self._get_x(-7), 0, -1),
                 block.DOOR_WOOD.withData(door_orientation),
                 description="Turret access door"))
        builds.append(
            Torch(self.column_se_corner + Vec3(-6, 2, -1),
                  block.TORCH.withData(inside_torch),
                  description="main column torch"))
        builds.append(
            Torch(self.column_se_corner + Vec3(-8, 2, -1),
                  block.TORCH.withData(outside_torch),
                  description="main column torch"))

        self._add_section("Corner Turret access", builds)
示例#23
0
    def _create_overhangs(self):
        '''
		#    bbbb    8 b => overhang
		#   bxxxxb   7  
		#  bx    xb  6  
		# bx      xb 5 
		# bx  xx  xb 4 
		# bx  xx  xb 3 
		# bx      xb 2 
		#  bx    xb  1 
		#   bxxxxb   0 
		#    bbbb      
		#987654321012          
		'''
        heights = [self.height, WALL_HEIGHT - 1]
        builds = []
        for height in heights:
            # create 4x10 rectangle
            builds.append(
                BuildingBlock(self.column_se_corner + Vec3(-2, height, 1),
                              block.STONE_BRICK,
                              self.column_se_corner + Vec3(-5, height, -8),
                              description="turret overhang, n-s extreme"))
            # create 10x4 rectangle
            builds.append(
                BuildingBlock(self.column_se_corner + Vec3(1, height, -2),
                              block.STONE_BRICK,
                              self.column_se_corner + Vec3(-8, height, -5),
                              description="turret overhang, e-w extreme"))
            # create 6x8 rectangle
            builds.append(
                BuildingBlock(self.column_se_corner + Vec3(-1, height, 0),
                              block.STONE_BRICK,
                              self.column_se_corner + Vec3(-6, height, -7),
                              description="turret overhang, n-s center"))
            # create 8x6 rectangle
            builds.append(
                BuildingBlock(self.column_se_corner + Vec3(0, height, -1),
                              block.STONE_BRICK,
                              self.column_se_corner + Vec3(-7, height, -6),
                              description="turret overhang, e-w center"))
        self._add_section("Turret - overhangs", builds)
示例#24
0
	def _create_surrounding_walls(self, description, level):
		builds = []
		# build surrounding walls
		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['South East'] + Vec3(0,level,0),
									EXTERIOR_WALLS,
									Castle.WALLS_CORNER_POS['South West'] + Vec3(0,WALL_HEIGHT + level,0),
									description="South wall"))
		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['South West'] + Vec3(0,level,0),
									EXTERIOR_WALLS,
									Castle.WALLS_CORNER_POS['North West'] + Vec3(0,WALL_HEIGHT + level,0),
									description="West wall"))
		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['South East'] + Vec3(0,level,0),
									EXTERIOR_WALLS,
									Castle.WALLS_CORNER_POS['North East'] + Vec3(0,WALL_HEIGHT + level,0),
									description="East wall"))
		builds.append(BuildingBlock(Castle.WALLS_CORNER_POS['North East'] + Vec3(0,level,0),
									EXTERIOR_WALLS,
									Castle.WALLS_CORNER_POS['North West'] + Vec3(0,WALL_HEIGHT + level,0),
									description="North wall"))
		self._add_section(description, builds)
示例#25
0
	def _create_windows(self):
		builds = []
		# windows:
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-3,1,0),
									block.GLASS_PANE, 
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-4,2,0),
									description="window"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-7,1,0),
									block.GLASS_PANE, 
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-8,2,0),
									description="window"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-13,1,0),
									block.GLASS_PANE, 
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-14,2,0),
									description="window"))
		builds.append(BuildingBlock(Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-17,1,0),
									block.GLASS_PANE, 
									Bedroom.WALLS_CORNER_POS['North East'] + Vec3(-18,2,0),
									description="window"))
		self._add_section("Bedroom windows", builds)
示例#26
0
	def _create_interior_enclosure(self):
		builds = []
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(0),0,0),
									self.access_enclosure,
									Building.SE_CORNER_POS + Vec3(self._get_x(-2),WALL_HEIGHT,0),
									description="turret interior wall"))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(self._get_x(0),0,0),
									self.access_enclosure,
									Building.SE_CORNER_POS + Vec3(self._get_x(0),WALL_HEIGHT,-2),
									description="turret interior wall"))
		hinge_type = Door.HINGE_LEFT
		if self.mirrored:
			hinge_type = Door.HINGE_RIGHT

		builds.append(Door(hinge_type, 
							Building.SE_CORNER_POS + Vec3(self._get_x(-1),0,0),
							block.DOOR_WOOD.withData(Door.SOUTH),
							description="Turret access door"))

		self._add_section("Turret interior enclosure", builds)
示例#27
0
 def _add_walkway(self, type, level):
     blocks = []
     blocks.append(
         BuildingBlock(
             ApartmentBlock.CORNER_POS['South East'] + Vec3(0, level, 0),
             type,
             ApartmentBlock.CORNER_POS['North East'] + Vec3(-1, level, 0),
             description="East walkway"))
     blocks.append(
         BuildingBlock(
             ApartmentBlock.CORNER_POS['South West'] + Vec3(0, level, 0),
             type,
             ApartmentBlock.CORNER_POS['North West'] + Vec3(1, level, 0),
             description="West walkway"))
     blocks.append(
         BuildingBlock(
             ApartmentBlock.CORNER_POS['South East'] + Vec3(0, level, 0),
             type,
             ApartmentBlock.CORNER_POS['South West'] + Vec3(0, level, -1),
             description="South walkway"))
     return blocks
示例#28
0
	def __init__(self, *args, **kwargs):
		super(Farm, self).__init__(width=Farm.WIDTH, *args, **kwargs)

		layer_blocks = []
		layer_blocks.append(BuildingBlock(Farm.BOUNDARY_SPAN[0], 
									block.WOOD, Farm.BOUNDARY_SPAN[1],
									description="Farm boundary"))
		layer_blocks.append(BuildingBlock(Farm.LAND_SPAN[0], 
									block.FARMLAND, Farm.LAND_SPAN[1],
									description="Farm land"))
		layer_blocks.append(BuildingBlock(Farm.WATER_SPAN[0], 
									block.WATER, Farm.WATER_SPAN[1],
									description="Farm irrigation"))

		self.add_layer(BuildingLayer(layer_blocks, 0))
		del layer_blocks[:]

		# all wheat on one side , with random choice of ripeness
		layer_blocks.append(BuildingBlock(Farm.CROPS_LEFT_SPAN[0], 
									Block(WHEAT.id, random.randint(3,7)), 
									Farm.CROPS_LEFT_SPAN[1],
									description="Wheat crops"))
		layer_blocks.append(BuildingBlock(Farm.CROPS_RIGHT_SPAN[0], 
									Block(POTATOES.id, random.randint(3,7)), 
									Farm.CROPS_RIGHT_SPAN[1] + Vec3(1,0,0),
									description="Potatoes"))
		layer_blocks.append(BuildingBlock(Farm.CROPS_RIGHT_SPAN[0] + Vec3(-1,0,0,), 
									Block(CARROTS.id, random.randint(3,7)), 
									Farm.CROPS_RIGHT_SPAN[1],
									description="Carrots"))

		self.add_layer(BuildingLayer(layer_blocks, 1))
		self._set_orientation()
示例#29
0
    def _create_structure(self):
        super(Fireplace, self)._create_structure()
        # create walls
        builds = []
        builds.append(
            BuildingBlock(Fireplace.AREA_SPAN[0],
                          block.STONE_BRICK,
                          Fireplace.AREA_SPAN[1],
                          description="Stone fill"))

        builds.append(
            BuildingBlock(Fireplace.OPEN_FRONT_SPAN[0],
                          block.AIR,
                          Fireplace.OPEN_FRONT_SPAN[1],
                          description="Clear Front"))
        builds.append(
            BuildingBlock(Fireplace.GRATE_SPAN[0],
                          block.AIR,
                          Fireplace.GRATE_SPAN[1],
                          description="Clear grate"))
        builds.append(
            BuildingBlock(Fireplace.GRILL_SPAN[0],
                          Fireplace.GRILL_TYPE,
                          Fireplace.GRILL_SPAN[1],
                          description="Stone fill"))
        builds.append(
            BuildingBlock(Fireplace.LAVAL_SPAN[0],
                          block.LAVA,
                          Fireplace.LAVAL_SPAN[1],
                          description="Stone fill"))

        builds.append(
            Torch(Fireplace.TORCH_POS[0],
                  block.TORCH.withData(Torch.SOUTH),
                  description="torch"))
        builds.append(
            Torch(Fireplace.TORCH_POS[1],
                  block.TORCH.withData(Torch.SOUTH),
                  description="torch"))
        self._add_section("Fireplace", builds)
示例#30
0
	def _create_structure(self):
		super(TurretTaper, self)._create_structure()
		builds = []
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-2,WALL_HEIGHT+2,-4),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(-4,WALL_HEIGHT+2,-5)))

		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-4,WALL_HEIGHT+2,-4),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(-5,WALL_HEIGHT+2,-2)))

		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-1,WALL_HEIGHT+2,-4),
									EXTERIOR_WALLS))
		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-4,WALL_HEIGHT+2,-1),
									EXTERIOR_WALLS))

		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-2,WALL_HEIGHT+1,-4),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(-3,WALL_HEIGHT+1,-4)))

		builds.append(BuildingBlock(Building.SE_CORNER_POS + Vec3(-4,WALL_HEIGHT+1,-3),
									EXTERIOR_WALLS,
									Building.SE_CORNER_POS + Vec3(-4,WALL_HEIGHT+1,-2)))

		self._add_section("Turret base", builds)