 # 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 = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
				}
			}
		}
		replaces = ca_barracks_1
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		heavy_infantry = 25
		light_cavalry = 20
		ai_creation_factor = 105
		
		extra_tech_building_start = 1.0
	}
	ca_steppe_barracks_2 = {
		desc = ca_steppe_barracks_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_barracks_2
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_steppe_barracks_1
		gold_cost = 120
		build_time = 547
		heavy_infantry = 35
		light_cavalry = 20
		ai_creation_factor = 104
		
		extra_tech_building_start = 1.8
	}
	ca_steppe_barracks_3 = {
		desc = ca_steppe_barracks_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
				}
			}
		}
		replaces = ca_barracks_3
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_steppe_barracks_2
		gold_cost = 200
		build_time = 730
		heavy_infantry = 40
		light_cavalry = 25
		ai_creation_factor = 103

		extra_tech_building_start = 3.0
	}
	ca_steppe_barracks_4 = {
		desc = ca_steppe_barracks_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
					
				}
			}
		}
		replaces = ca_barracks_4
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 1
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_barracks_3
		gold_cost = 300
		build_time = 1095
		heavy_infantry = 45
		light_cavalry = 30
		ai_creation_factor = 102

		extra_tech_building_start = 3.0
	}
	ca_steppe_barracks_5 = {
		desc = ca_steppe_barracks_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_barracks_5
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 3
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_barracks_4
		gold_cost = 400
		build_time = 2190
		heavy_infantry = 55
		light_cavalry = 30
		ai_creation_factor = 101

		extra_tech_building_start = 2.0
	}
	ca_steppe_barracks_6 = {
		desc = ca_steppe_barracks_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_barracks_6
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 5
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_barracks_5
		gold_cost = 500
		build_time = 2190
		heavy_infantry = 60
		light_cavalry = 35
		ai_creation_factor = 100

		extra_tech_building_start = 0.2
	}
	
	#Steppe Stable, gives light cavalry & horse archers
	ca_steppe_stable_1 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_1
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		light_cavalry = 25
		horse_archers = 10
		ai_creation_factor = 89
		
		extra_tech_building_start = 0.4
	}
	ca_steppe_stable_2 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_2
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_steppe_stable_1
		gold_cost = 120
		build_time = 547
		light_cavalry = 25
		horse_archers = 20
		ai_creation_factor = 88

		extra_tech_building_start = 0.8
	}
	ca_steppe_stable_3 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_3
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_steppe_stable_2
		gold_cost = 200
		build_time = 730
		light_cavalry = 35
		horse_archers = 20
		ai_creation_factor = 87

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_4 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_4
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_stable_3
		gold_cost = 300
		build_time = 1095
		light_cavalry = 35
		horse_archers = 20
		knights = 5
		ai_creation_factor = 86

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_5 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_5
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_stable_4
		gold_cost = 400
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 10
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}
	ca_steppe_stable_6 = {
		desc = ca_steppe_stable_desc
		potential = {
			terrain = steppe
			FROM = {
				OR = {
					culture_group = altaic
					culture_group = magyar
					culture = alan
					culture_group = iranian
				}
			}
		}
		replaces = ca_stable_6
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 8
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_steppe_stable_5
		gold_cost = 500
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 20
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}

	#Desert Stable, gives light cavalry & horse archers
	ca_desert_stable_1 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_1
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		gold_cost = 100
		build_time = 365
		light_cavalry = 25
		horse_archers = 10
		ai_creation_factor = 89
		
		extra_tech_building_start = 0.4
	}
	ca_desert_stable_2 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_2
		trigger = { TECH_CASTLE_CONSTRUCTION = 0 }
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_desert_stable_1
		gold_cost = 120
		build_time = 547
		light_cavalry = 25
		horse_archers = 20
		ai_creation_factor = 88

		extra_tech_building_start = 0.8
	}
	ca_desert_stable_3 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_3
		trigger = { TECH_CASTLE_CONSTRUCTION = 2 }
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_desert_stable_2
		gold_cost = 200
		build_time = 730
		light_cavalry = 35
		horse_archers = 20
		ai_creation_factor = 87

		extra_tech_building_start = 0.2
	}
	ca_desert_stable_4 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_4
		trigger = { TECH_CASTLE_CONSTRUCTION = 4 }
		upgrades_from = ca_desert_stable_3
		gold_cost = 300
		build_time = 1095
		light_cavalry = 35
		horse_archers = 20
		knights = 5
		ai_creation_factor = 86

		extra_tech_building_start = 0.2
	}
	ca_desert_stable_5 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_5
		trigger = { TECH_CASTLE_CONSTRUCTION = 6 }
		upgrades_from = ca_desert_stable_4
		gold_cost = 400
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 10
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}
	ca_desert_stable_6 = {
		desc = ca_desert_stable_desc
		potential = {
			terrain = desert
			FROM = {
				OR = {
					culture_group = east_african
					culture_group = west_african
					culture_group = arabic
					culture_group = iranian
					culture_group = maghrebi
					culture_group = amazigh
				}
			}
		}
		replaces = ca_stable_6
		trigger = { TECH_CASTLE_CONSTRUCTION = 8 }
		upgrades_from = ca_desert_stable_5
		gold_cost = 500
		build_time = 2190
		light_cavalry = 35
		horse_archers = 20
		knights = 20
		ai_creation_factor = 85

		extra_tech_building_start = 0.2
	}
}
