# -*- ck2.buildings -*-

 # Triggers are in Province scope. The From Scope contains the settlement holder (character)
 # start trigger is in title scope.

 #<tag> = {
 #	desc = description used in the tooltip of the building
 #	trigger = used for tech requirement of the building, set to 0 if no requirement so it can be build automatically on new games
 #	gold_cost = cost to build the building
 #	build_time = time to build, in days
 #
 #	ai_creation_factor = weight that the AI uses to determine what building to build
 #	extra_tech_building_start = when starting a new game this building will be pre-built if the province has higher tech than the requirement + this + random 0-1
 #}

 # Castle
castle = {
	# Steppe Barracks, gives less heavy infantry, no pikemen, but some horsies
	ca_steppe_barracks_1 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		gold_cost = 100
		build_time = 365
		heavy_infantry = 25
		light_cavalry = 20
		retinuesize = 20
		ai_creation_factor = 86
		
		convert_to_tribal = tb_steppe_barracks_1

		extra_tech_building_start = 1.0
	}
	ca_steppe_barracks_2 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
				has_building = ca_steppe_barracks_2
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 1
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_steppe_barracks_1
		gold_cost = 120
		build_time = 547
		heavy_infantry = 35
		light_cavalry = 20
		retinuesize = 20
		ai_creation_factor = 85

		extra_tech_building_start = 1.8
	}
	ca_steppe_barracks_3 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
				has_building = ca_steppe_barracks_2
				has_building = ca_steppe_barracks_3
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 2
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_steppe_barracks_2
		gold_cost = 200
		build_time = 730
		heavy_infantry = 40
		light_cavalry = 25
		retinuesize = 20
		ai_creation_factor = 84
		
		convert_to_tribal = tb_steppe_barracks_2

		extra_tech_building_start = 3.0
	}
	ca_steppe_barracks_4 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
				has_building = ca_steppe_barracks_2
				has_building = ca_steppe_barracks_3
				has_building = ca_steppe_barracks_4
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 4
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_barracks_3
		gold_cost = 300
		build_time = 1095
		heavy_infantry = 45
		light_cavalry = 30
		retinuesize = 20
		ai_creation_factor = 83

		extra_tech_building_start = 3.0
	}
	ca_steppe_barracks_5 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
				has_building = ca_steppe_barracks_2
				has_building = ca_steppe_barracks_3
				has_building = ca_steppe_barracks_4
				has_building = ca_steppe_barracks_5
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 6
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_barracks_4
		gold_cost = 400
		build_time = 2190
		heavy_infantry = 55
		light_cavalry = 30
		retinuesize = 20
		ai_creation_factor = 82
		
		convert_to_tribal = tb_steppe_barracks_3

		extra_tech_building_start = 2.0
	}
	ca_steppe_barracks_6 = {
		desc = ca_steppe_barracks_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_barracks_1
				has_building = ca_steppe_barracks_2
				has_building = ca_steppe_barracks_3
				has_building = ca_steppe_barracks_4
				has_building = ca_steppe_barracks_5
				has_building = ca_steppe_barracks_6
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 8
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_barracks_5
		gold_cost = 500
		build_time = 2190
		heavy_infantry = 60
		light_cavalry = 35
		retinuesize = 20
		ai_creation_factor = 81

		extra_tech_building_start = 0.2
	}

	#Steppe Stable, gives light cavalry, horse archers and some heavy cavalry
	ca_steppe_stable_1 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		gold_cost = 100
		build_time = 365
		light_cavalry = 25
		horse_archers = 10
		retinuesize = 20
		ai_creation_factor = 86
		
		convert_to_tribal = tb_steppe_stable_1

		extra_tech_building_start = 0.4
	}
	ca_steppe_stable_2 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
				has_building = ca_steppe_stable_2
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 1
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_steppe_stable_1
		gold_cost = 120
		build_time = 547
		light_cavalry = 25
		horse_archers = 20
		retinuesize = 20
		ai_creation_factor = 85

		extra_tech_building_start = 0.8
	}
	ca_steppe_stable_3 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
				has_building = ca_steppe_stable_2
				has_building = ca_steppe_stable_3
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 3
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_steppe_stable_2
		gold_cost = 200
		build_time = 730
		light_cavalry = 35
		horse_archers = 20
		retinuesize = 20
		ai_creation_factor = 84
		
		convert_to_tribal = tb_steppe_stable_2

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_4 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
				has_building = ca_steppe_stable_2
				has_building = ca_steppe_stable_3
				has_building = ca_steppe_stable_4
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 5
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_stable_3
		gold_cost = 300
		build_time = 1095
		light_cavalry = 35
		horse_archers = 20
		knights = 5
		retinuesize = 20
		ai_creation_factor = 83

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_5 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
				has_building = ca_steppe_stable_2
				has_building = ca_steppe_stable_3
				has_building = ca_steppe_stable_4
				has_building = ca_steppe_stable_5
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 7
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_stable_4
		gold_cost = 400
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 10
		retinuesize = 20
		ai_creation_factor = 82
		
		convert_to_tribal = tb_steppe_stable_3

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_6 = {
		desc = ca_steppe_stable_desc
		potential = {
			has_game_rule = {
				name = dacse_buildings
				value = HIP
			}
			OR = {
				AND = {
					terrain = steppe
					emf_province_is_steppe_culture = yes
				}
				has_building = ca_steppe_stable_1
				has_building = ca_steppe_stable_2
				has_building = ca_steppe_stable_3
				has_building = ca_steppe_stable_4
				has_building = ca_steppe_stable_5
				has_building = ca_steppe_stable_6
			}
		}
		is_active_trigger = {
			emf_province_is_steppe_culture = yes
		}
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 8
			emf_province_is_steppe_culture = yes
			emf_is_building_construction_allowed = yes
		}
		upgrades_from = ca_steppe_stable_5
		gold_cost = 500
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 20
		retinuesize = 20
		ai_creation_factor = 81

		extra_tech_building_start = 0.2
	}
}

