 # 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 = {
	# Wall quality, gives fortlevel
	ca_wall_q_1 = {
		desc = ca_wall_q_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 80
		
		extra_tech_building_start = 1.2
	}
	ca_wall_q_2 = {
		desc = ca_wall_q_2_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 1
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_q_1
		prerequisites = { ca_wall_1 }
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 79

		extra_tech_building_start = 1.0
	}
	ca_wall_q_3 = {
		desc = ca_wall_q_3_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 3
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_q_2
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 78
		
		extra_tech_building_start = 0.8
	}
	ca_wall_q_4 = {
		desc = ca_wall_q_4_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 5
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_q_3
		gold_cost = 100
		build_time = 365
		fort_level = 1.0
		ai_creation_factor = 77
		
		extra_tech_building_start = 1.0
	}
	ca_wall_q_5 = {
		desc = ca_wall_q_5_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 7
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_q_4
		gold_cost = 100
		build_time = 365
		fort_level = 1.0
		ai_creation_factor = 76

		extra_tech_building_start = 1.2
	}
	
	#Walls, gives fortlevel, levysize and income
	ca_wall_1 = {
		desc = ca_wall_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		fort_level = 0.75
		tax_income = 0.10
		ai_creation_factor = 90
		
		extra_tech_building_start = 1.2
	}
	ca_wall_2 = {
		desc = ca_wall_2_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_1
		gold_cost = 100
		build_time = 547 #1.5y
		fort_level = 0.75
		tax_income = 0.10
		ai_creation_factor = 89
		
		extra_tech_building_start = 0.6
	}
	ca_wall_3 = {
		desc = ca_wall_3_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_2
		gold_cost = 200
		build_time = 730 #2y
		fort_level = 1.5
		tax_income = 0.25
		ai_creation_factor = 88

		extra_tech_building_start = 0.8
	}
	ca_wall_4 = {
		desc = ca_wall_4_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_3
		gold_cost = 200
		build_time = 1095 #3y
		fort_level = 1.5
		tax_income = 0.25
		ai_creation_factor = 87

		extra_tech_building_start = 1.0
	}
	ca_wall_5 = {
		desc = ca_wall_5_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_wall_4
		gold_cost = 300
		build_time = 1460 #4y
		fort_level = 2.0
		tax_income = 0.5
		ai_creation_factor = 86

		extra_tech_building_start = 1.2
	}
	ca_con_wall_6 = { # Theodosian Walls
		potential = {
			FROMFROM = { title = b_constantinople }
		}
		desc = ca_con_wall_6_desc
		upgrades_from = ca_wall_5
		gold_cost = 150
		build_time = 1460 #4y
		fort_level = 4.0
		ai_creation_factor = 86

		extra_tech_building_start = 0.0
	}

	#Keeps, gives levy and garrison size
	ca_keep_1 = {
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 150
		build_time = 547 #1.5y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 102
		
		extra_tech_building_start = 1.2
	}
	ca_keep_2 = {
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_keep_1
		gold_cost = 200
		build_time = 730 #2y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 101

		extra_tech_building_start = 2.4
	}
	ca_keep_3 = {
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_keep_2
		gold_cost = 300
		build_time = 1095 #3y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 100
		
		extra_tech_building_start = 1.6
	}
	ca_keep_4 = {	
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_keep_3
		gold_cost = 400
		build_time = 1460 #4y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 99

		extra_tech_building_start = 1.0
	}
	ca_keep_5 = {
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_keep_4
		gold_cost = 500
		build_time = 2190 #6y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 98

		extra_tech_building_start = 1.2
	}
	ca_keep_6 = {
		desc = ca_keep_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION = 8
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_keep_5
		gold_cost = 500
		build_time = 2190 #6y
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 97
		
		extra_tech_building_start = 1.4
	}
	
	# Militia barracks, gives light infantry and archers.
	ca_militia_barracks_1 = {
		desc = ca_militia_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		light_infantry = 80
		archers = 10
		ai_creation_factor = 100
		
		extra_tech_building_start = 1.2
	}
	ca_militia_barracks_2 = {
		desc = ca_militia_barracks_2_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 1
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_militia_barracks_1
		gold_cost = 120
		build_time = 547
		light_infantry = 50
		archers = 50
		ai_creation_factor = 99

		extra_tech_building_start = 2.4
	}
	ca_militia_barracks_3 = {
		desc = ca_militia_barracks_3_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 5
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_militia_barracks_2
		gold_cost = 200
		build_time = 1095
		light_infantry = 20
		archers = 90
		ai_creation_factor = 98

		extra_tech_building_start = 1.1
	}
	ca_militia_barracks_4 = {
		desc = ca_militia_barracks_3_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 7
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_militia_barracks_3
		gold_cost = 300
		build_time = 1095
		light_infantry = 30
		archers = 120
		ai_creation_factor = 98

		extra_tech_building_start = 1.3
	}

	#Training grounds, gives morale and reinforce rate
	ca_training_grounds_1 = {
		desc = ca_training_grounds_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		gold_cost = 200
		build_time = 730
		land_morale = 0.1
		levy_reinforce_rate = 0.1
		retinuesize = 20
		ai_creation_factor = 89

		extra_tech_building_start = 1.4
	}
	ca_training_grounds_2 = {
		desc = ca_training_grounds_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 3
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_training_grounds_1
		gold_cost = 250
		build_time = 1095
		land_morale = 0.15
		levy_reinforce_rate = 0.15
		retinuesize = 20
		ai_creation_factor = 88
		
		extra_tech_building_start = 0.9
	}
	ca_training_grounds_3 = {
		desc = ca_training_grounds_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_training_grounds_2
		gold_cost = 300
		build_time = 2190
		land_morale = 0.2
		levy_reinforce_rate = 0.2
		retinuesize = 20
		ai_creation_factor = 88
		
		extra_tech_building_start = 0.8
	}
	
	# Barracks, gives heavy infantry and pikemen
	ca_barracks_1 = {
		desc = ca_barracks_1_desc
		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 = 30
		pikemen = 15
		ai_creation_factor = 105
		
		extra_tech_building_start = 1.2
	}
	ca_barracks_2 = {
		desc = ca_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_barracks_1
		gold_cost = 120
		build_time = 547
		heavy_infantry = 40
		pikemen = 15
		ai_creation_factor = 104
		
		extra_tech_building_start = 2.2
	}
	ca_barracks_3 = {
		desc = ca_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 1
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_barracks_2
		gold_cost = 200
		build_time = 730
		heavy_infantry = 45
		pikemen = 20
		ai_creation_factor = 103

		extra_tech_building_start = 3.6
	}
	ca_barracks_4 = {
		desc = ca_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 3
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_barracks_3
		gold_cost = 300
		build_time = 1095
		heavy_infantry = 50
		pikemen = 25
		ai_creation_factor = 102

		extra_tech_building_start = 3.8
	}
	ca_barracks_5 = {
		desc = ca_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 5
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_barracks_4
		gold_cost = 400
		build_time = 2190
		heavy_infantry = 60
		pikemen = 25
		ai_creation_factor = 101

		extra_tech_building_start = 3.0
	}
	ca_barracks_6 = {
		desc = ca_barracks_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 7
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_barracks_5
		gold_cost = 500
		build_time = 2190
		heavy_infantry = 65
		pikemen = 30
		ai_creation_factor = 100

		extra_tech_building_start = 1.4
	}
	
	#Stable, gives light cavalry and some heavy cavalry
	ca_stable_1 = {
		desc = ca_stable_1_desc
		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 = 35
		ai_creation_factor = 89
		
		extra_tech_building_start = 0.6
	}
	ca_stable_2 = {
		desc = ca_stable_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_stable_1
		gold_cost = 120
		build_time = 547
		light_cavalry = 45
		ai_creation_factor = 88

		extra_tech_building_start = 1.2
	}
	ca_stable_3 = {
		desc = ca_stable_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_stable_2
		gold_cost = 200
		build_time = 730
		light_cavalry = 55
		ai_creation_factor = 87

		extra_tech_building_start = 0.8
	}
	ca_stable_4 = {
		desc = ca_stable_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_stable_3
		gold_cost = 300
		build_time = 1095
		light_cavalry = 55
		knights = 5
		ai_creation_factor = 86

		extra_tech_building_start = 1.0
	}
	ca_stable_5 = {
		desc = ca_stable_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_stable_4
		gold_cost = 400
		build_time = 2190
		light_cavalry = 55
		knights = 10
		ai_creation_factor = 85

		extra_tech_building_start = 1.2
	}
	ca_stable_6 = {
		desc = ca_stable_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 8
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_stable_5
		gold_cost = 500
		build_time = 2190
		light_cavalry = 55
		knights = 20
		ai_creation_factor = 85

		extra_tech_building_start = 1.4
	}
	
	#Castle town, gives income
	ca_town_1 = {
		desc = ca_town_1_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		tax_income = 2
		ai_creation_factor = 100
		
		extra_tech_building_start = 0.7
	}
	ca_town_2 = {
		desc = ca_town_2_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 0
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_1 }
		upgrades_from = ca_town_1
		gold_cost = 120
		build_time = 547
		tax_income = 2
		ai_creation_factor = 99

		extra_tech_building_start = 1.4
	}
	ca_town_3 = {
		desc = ca_town_3_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		prerequisites = { ca_wall_2 }
		upgrades_from = ca_town_2
		gold_cost = 200
		build_time = 730
		tax_income = 2
		ai_creation_factor = 98

		extra_tech_building_start = 0.8
	}
	ca_town_4 = {
		desc = ca_town_4_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_town_3
		gold_cost = 300
		build_time = 1095
		tax_income = 2
		ai_creation_factor = 97

		extra_tech_building_start = 1.0
	}
	ca_town_5 = {
		desc = ca_town_4_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 6
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_town_4
		gold_cost = 400
		build_time = 2190
		tax_income = 2
		ai_creation_factor = 96

		extra_tech_building_start = 1.2
	}
	ca_town_6 = {
		desc = ca_town_5_desc
		trigger = {
			TECH_CASTLE_CONSTRUCTION = 8
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_town_5
		gold_cost = 500
		build_time = 2190
		tax_income = 2
		ai_creation_factor = 96

		extra_tech_building_start = 1.4
	}
	
	ca_shipyard_1 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL = 1
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		gold_cost = 100
		build_time = 365
		galleys = 4
		ai_creation_factor = 95
		
		extra_tech_building_start = 0.5
	}
	ca_shipyard_2 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL = 2
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_shipyard_1
		gold_cost = 100
		build_time = 730
		galleys = 5
		ai_creation_factor = 94
		
		extra_tech_building_start = 0.7
	}
	ca_shipyard_3 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL = 3
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_shipyard_2
		gold_cost = 100
		build_time = 1095
		galleys = 6
		ai_creation_factor = 93
		
		extra_tech_building_start = 0.9
	}
	ca_shipyard_4 = {
		desc = shipyard_desc
		port = yes
		trigger = {
			TECH_NAVAL = 4
			hidden_tooltip = {
				FROM = {
					OR = {
						ai = no
						NOT = { has_character_modifier = ai_austerity }
					}
				}
			}
		}
		upgrades_from = ca_shipyard_3
		gold_cost = 100
		build_time = 1460
		galleys = 7
		ai_creation_factor = 92
		
		extra_tech_building_start = 1.1
	}
}
