# All buildings in UH are defined here.
# These properties must be set for all buildings

# random but unique id
id: 1234

# for names, there are two possiblities:
# just an ordinary name:
# (the "_ " must be present so that the game knows it has to translate the string, just leave it there and you'll be fine)
name: _ MyAwesomeBuilding

# or, for level-sensitive names:
name:
	TIER.SAILORS: _ MyAwesomeBuildingLvl1
	TIER.PIONEERS: _ MyAwesomeBuildingLvl2
	TIER.CITIZENS: _ MyAwesomeBuildingLvl4
# in level SETTLERS, this building will have the name of level PIONEERS (the highest available one is used)

# this defines some of the behavior, either copy the class from buildings similar to yours or talk to a dev about it
baseclass: production.Lumberjack

# then some boring data
radius: 8 # area of influnce of building
cost: 5 # running costs in gold per month
costs_inactive: 0 # running costs when it's turned off
size_x: 2 # building width (should match its graphics)
size_y: 2 # building height (should match its graphics)
inhabitants: 1 # inhabitants of the building. Doesn't do anything, but counts as inhabitants number in the overview.
# brief description to be displayed as tooltip (don't forget the "_ ")
tooltip_text: _ My building does fancy thing and is great in general
settler_level: TIER.PIONEERS # building will be available from this level on.
# There are currently fluctuations with the build menu generation, so please talk to a dev to get your building in the build menu

# Now, we define what the building should look like, i.e. where the images are located.
# In simple cases, it looks like this:
actionsets:
  TIER.SAILORS:
    as_hunter0:
# This makes the game look in the directory "as_hunter0". All buildings from level SAILORS on will use this
# As you might have figured, it can also look like this:
# actionsets:
actionsets:
  TIER.SAILORS:
    as_lumberjack0:
  TIER.PIONEERS:
    as_lumberjack_barrack0:
    as_lumberjack_barrack1: 20
    as_lumberjack_barrack2: 5
  TIER.SETTLERS:
    as_ljsettlers0:
# If there are more entries for a level, one is chosen at random each time a building is built.
# As with the names, the highest available tier is used to find graphics.
# If you want to add a custom weight (default is 10) for the random choice to pick from,
# add the weight after the colon : as with barrack1 and 2 above.
# A weight of 5 will make the set twice as rare as the default (and 20 makes it twice as common).
# With the example above, you're likely to see four barrack1 sets for each barrack2 set that's picked.

# Now, we define the heart of the buildings, its mechanics.
# We do that by defining the components the building consists of.
# Add whichever components of these you need
components:
# This makes buildings have a health, buildings without health are indestructible
- HealthComponent: {maxhealth: 1000}
# With this, you can select buildings
- SelectableComponent:
    type: building # building, unit or ship
    tabs: [ProductionOverviewTab,] # the tabs the owner of the building sees
    enemy_tabs: [EnemyBuildingOverviewTab,] # the tab you see when it belongs to an enemy
# Usually, buildings will have to store stuff internally
- StorageComponent
    inventory:
      SlotsStorage: # the common type, here we define "slots" for resource types
                    # we want to turn wood in to boards here, so we need to be able to store both
                    # therefore, we add slots of size 6 each for those resources:
        slot_sizes: {RES.TREES: 6, RES.BOARDS: 6}

# If your building should collect resources via collectors, we add them here:
- CollectingComponent:
    collectors:
			# We want a normal worker collector, that just walks directly to all providers in the radius of the building
      UNITS.BUILDING_COLLECTOR: 2
			# If you need other collectors, check the list in horizons/constants.py (under UNITS)
			# and comments about their behavior in horizons/world/units/collectors/buildingcollector.py

# The collectors will collect exactly what the producer in the building needs:
- ProducerComponent:
	# we produce in production lines. Think of a line as a machine,
	# where you put stuff in and after a certain amount of time, you get other stuff out of it.
	productionlines: # list of all lines
		123: # currently all lines still need an arbitrary but unique id
			# now we define what comes in and what comes out.
			# this machine will cut raw wood in half (so you have 2 boards afterwards):
			consumes:
			- [RES.TREES, 1]
			produces:
			- [RES.BOARDS, 2]
			- [RES.GOLD, 100] # it also magically produces gold (just to show you how you can add further entries ;)
			time: 30 # time in second that the production line (the machine) takes
		# this would already suffice, you can add other production lines, just start with an unique id as above
