# Temple
temple = {
	# Wall quality, gives fort level
	tp_wall_q_1 = {
		desc = tp_wall_q_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 82

		extra_tech_building_start = 0.4
	}
	tp_wall_q_2 = {
		desc = tp_wall_q_2_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 1
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_2 }
		upgrades_from = tp_wall_q_1
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 81

		extra_tech_building_start = 0.8
	}
	tp_wall_q_3 = {
		desc = ca_wall_q_3_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 3
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_q_2
		gold_cost = 50
		build_time = 182
		fort_level = 0.5
		ai_creation_factor = 80

		extra_tech_building_start = 0.2
	}
	tp_wall_q_4 = {
		desc = ca_wall_q_4_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 5
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_q_3
		gold_cost = 100
		build_time = 365
		fort_level = 1
		ai_creation_factor = 79

		extra_tech_building_start = 0.2
	}
	tp_wall_q_5 = {
		desc = ca_wall_q_5_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 7
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_q_4
		gold_cost = 100
		build_time = 365
		fort_level = 1
		ai_creation_factor = 78

		extra_tech_building_start = 0.2
	}

	# Walls, gives fort level, levy size and income
	tp_wall_1 = {
		desc = ca_wall_1_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		gold_cost = 50
		build_time = 365
		fort_level = 0.5
		levy_size = 0.025
		tax_income = 0.2
		ai_creation_factor = 95

		extra_tech_building_start = 0.5
	}
	tp_wall_2 = {
		desc = ca_wall_2_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 2
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_1
		gold_cost = 50
		build_time = 547
		fort_level = 0.5
		levy_size = 0.025
		tax_income = 0.2
		ai_creation_factor = 94

		extra_tech_building_start = 1.0
	}
	tp_wall_3 = {
		desc = tp_wall_3_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 4
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_2
		gold_cost = 100
		build_time = 730
		fort_level = 1.0
		levy_size = 0.05
		tax_income = 0.2
		ai_creation_factor = 93

		extra_tech_building_start = 1.5
	}
	tp_wall_4 = {
		desc = tp_wall_4_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 6
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_3
		gold_cost = 100
		build_time = 1095
		fort_level = 1.0
		levy_size = 0.05
		tax_income = 0.2
		ai_creation_factor = 92

		extra_tech_building_start = 0.2
	}
	tp_wall_5 = {
		desc = tp_wall_5_desc
		trigger = {
			TECH_FORTIFICATIONS_CONSTRUCTION >= 8
			temple_building_allow = yes
		}
		upgrades_from = tp_wall_4
		gold_cost = 150
		build_time = 1460
		fort_level = 1.5
		levy_size = 0.075
		tax_income = 0.5
		ai_creation_factor = 91

		extra_tech_building_start = 0.2
	}

	# Monastery, gives piety
	tp_monastery_1 = {
		desc = tp_monastery_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		gold_cost = 150
		build_time = 547
		levy_size = 0.05
		garrison_size = 0.05
		ai_creation_factor = 96
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_monastery_2 = {
		desc = tp_monastery_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		upgrades_from = tp_monastery_1
		gold_cost = 200
		build_time = 730
		levy_size = 0.075
		garrison_size = 0.1
		ai_creation_factor = 95
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_monastery_3 = {
		desc = tp_monastery_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 2
			temple_building_allow = yes
		}
		upgrades_from = tp_monastery_2
		gold_cost = 300
		build_time = 1095
		levy_size = 0.1
		garrison_size = 0.15
		ai_creation_factor = 94
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_monastery_4 = {
		desc = tp_monastery_2_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 4
			temple_building_allow = yes
		}
		upgrades_from = tp_monastery_3
		gold_cost = 400
		build_time = 1460
		levy_size = 0.125
		garrison_size = 0.2
		ai_creation_factor = 93
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_monastery_5 = {
		desc = tp_monastery_2_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			temple_building_allow = yes
		}
		upgrades_from = tp_monastery_4
		gold_cost = 500
		build_time = 2190
		levy_size = 0.15
		garrison_size = 0.25
		ai_creation_factor = 92
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_monastery_6 = {
		desc = tp_monastery_2_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 8
			temple_building_allow = yes
		}
		upgrades_from = tp_monastery_5
		gold_cost = 500
		build_time = 2190
		levy_size = 0.15
		garrison_size = 0.25
		ai_creation_factor = 91
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}

	# Barracks, gives light infantry and archers
	tp_barracks_1 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		light_infantry = 60
		archers = 30
		ai_creation_factor = 94

		extra_tech_building_start = 0.5
	}
	tp_barracks_2 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		upgrades_from = tp_barracks_1
		gold_cost = 120
		build_time = 547
		light_infantry = 65
		archers = 45
		ai_creation_factor = 93

		extra_tech_building_start = 1.0
	}
	tp_barracks_3 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 1
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_2 }
		upgrades_from = tp_barracks_2
		gold_cost = 200
		build_time = 730
		light_infantry = 70
		archers = 60
		ai_creation_factor = 92

		extra_tech_building_start = 0.5
	}
	tp_barracks_4 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			temple_building_allow = yes
		}
		upgrades_from = tp_barracks_3
		gold_cost = 300
		build_time = 1095
		light_infantry = 75
		archers = 75
		ai_creation_factor = 91

		extra_tech_building_start = 0.2
	}
	tp_barracks_5 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 5
			temple_building_allow = yes
		}
		upgrades_from = tp_barracks_4
		gold_cost = 400
		build_time = 2190
		light_infantry = 85
		archers = 85
		ai_creation_factor = 90

		extra_tech_building_start = 0.2
	}
	tp_barracks_6 = {
		desc = tp_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 7
			temple_building_allow = yes
		}
		upgrades_from = tp_barracks_5
		gold_cost = 500
		build_time = 2190
		light_infantry = 95
		archers = 95
		ai_creation_factor = 89

		extra_tech_building_start = 0.2
	}

	# Elite Barracks, gives heavy infantry
	tp_elite_barracks_1 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		heavy_infantry = 45
		ai_creation_factor = 95

		extra_tech_building_start = 0.5
	}
	tp_elite_barracks_2 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		upgrades_from = tp_elite_barracks_1
		gold_cost = 120
		build_time = 730
		heavy_infantry = 55
		ai_creation_factor = 94

		extra_tech_building_start = 1.0
	}
	tp_elite_barracks_3 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 2
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_2 }
		upgrades_from = tp_elite_barracks_2
		gold_cost = 200
		build_time = 730
		heavy_infantry = 65
		ai_creation_factor = 93

		extra_tech_building_start = 0.2
	}
	tp_elite_barracks_4 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 4
			temple_building_allow = yes
		}
		upgrades_from = tp_elite_barracks_3
		gold_cost = 300
		build_time = 1095
		heavy_infantry = 75
		ai_creation_factor = 92

		extra_tech_building_start = 0.2
	}
	tp_elite_barracks_5 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			temple_building_allow = yes
		}
		upgrades_from = tp_elite_barracks_4
		gold_cost = 400
		build_time = 2190
		heavy_infantry = 85
		ai_creation_factor = 91

		extra_tech_building_start = 0.2
	}
	tp_elite_barracks_6 = {
		desc = tp_elite_barracks_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 8
			temple_building_allow = yes
		}
		upgrades_from = tp_elite_barracks_5
		gold_cost = 500
		build_time = 2190
		heavy_infantry = 95
		ai_creation_factor = 90

		extra_tech_building_start = 0.2
	}

	# Temple Town, gives income
	tp_town_1 = {
		desc = tp_town_1_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		gold_cost = 100
		build_time = 365
		tax_income = 2
		ai_creation_factor = 98

		extra_tech_building_start = 0.3
	}
	tp_town_2 = {
		desc = tp_town_2_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 0
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		upgrades_from = tp_town_1
		gold_cost = 120
		build_time = 547
		tax_income = 2
		ai_creation_factor = 96

		extra_tech_building_start = 0.6
	}
	tp_town_3 = {
		desc = tp_town_3_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 1
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_2 }
		upgrades_from = tp_town_2
		gold_cost = 200
		build_time = 730
		tax_income = 2
		ai_creation_factor = 95

		extra_tech_building_start = 0.2
	}
	tp_town_4 = {
		desc = tp_town_4_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 3
			temple_building_allow = yes
		}
		upgrades_from = tp_town_3
		gold_cost = 300
		build_time = 1095
		tax_income = 2
		ai_creation_factor = 94

		extra_tech_building_start = 0.2
	}
	tp_town_5 = {
		desc = tp_town_4_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 5
			temple_building_allow = yes
		}
		upgrades_from = tp_town_4
		gold_cost = 400
		build_time = 2190
		tax_income = 2
		ai_creation_factor = 93

		extra_tech_building_start = 0.2
	}
	tp_town_6 = {
		desc = tp_town_5_desc
		trigger = {
			TECH_CITY_CONSTRUCTION >= 7
			temple_building_allow = yes
		}
		upgrades_from = tp_town_5
		gold_cost = 500
		build_time = 2190
		tax_income = 2
		ai_creation_factor = 92

		extra_tech_building_start = 0.2
	}

	# School, gives tech growth and culture techpoints
	tp_school_1 = {
		desc = tp_school_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 3
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_1 }
		gold_cost = 120
		build_time = 547

		tech_growth_modifier = 0.1
		culture_techpoints = 0.04

		ai_creation_factor = 93
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}
	tp_school_2 = {
		desc = tp_school_1_desc
		trigger = {
			TECH_TEMPLE_CONSTRUCTION >= 6
			temple_building_allow = yes
		}
		prerequisites = { tp_wall_2 }
		upgrades_from = tp_school_1
		gold_cost = 120
		build_time = 547

		tech_growth_modifier = 0.2
		culture_techpoints = 0.04

		ai_creation_factor = 92
		add_number_to_name = no
		liege_piety = 0.05

		extra_tech_building_start = 0.2
	}

	# Dedicated temples
	tp_shrine_zeus = {
		desc = tp_shrine_zeus_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_zeus }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		liege_prestige = 0.15
	}
	tp_shrine_poseidon = {
		desc = tp_shrine_poseidon_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_poseidon }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		local_build_time_modifier = -0.1
		local_build_cost_modifier = -0.1
	}
	tp_shrine_hades = {
		desc = tp_shrine_hades_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hades }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		tax_income = 3
	}
	tp_shrine_hermes = {
		desc = tp_shrine_hermes_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hermes }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		tradevalue = 15
	}
	tp_shrine_demeter = {
		desc = tp_shrine_demeter_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_demeter }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		economy_techpoints = 0.05
	}
	tp_shrine_athena = {
		desc = tp_shrine_athena_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_athena }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		military_techpoints = 0.05
	}
	tp_shrine_apollo = {
		desc = tp_shrine_apollo_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_apollo }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		culture_techpoints = 0.05
	}
	tp_shrine_arthemis = {
		desc = tp_shrine_arthemis_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_arthemis }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		liege_piety = 0.1
	}
	tp_shrine_ares = {
		desc = tp_shrine_ares_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_ares }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		levy_reinforce_rate = 0.05
	}
	tp_shrine_aphrodite = {
		desc = tp_shrine_aphrodite_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_aphrodite }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		local_revolt_risk = -0.1
	}
	tp_shrine_ephaestus = {
		desc = tp_shrine_ephaestus_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_ephaestus }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		fort_level = 0.4
		tech_growth_modifier = 0.15
	}
	tp_shrine_hestia = {
		desc = tp_shrine_hestia_desc
		potential = {
			FROMFROM = { has_title_flag = flag_dedicated_to_hestia }
			FROM = {
				religion_openly_hellenic_or_reformed_trigger = yes
			}
		}
		trigger = { temple_building_allow = yes }
		gold_cost = 500
		build_time = 50

		ai_creation_factor = 92
		add_number_to_name = no
		land_morale = 0.05
	}
	tp_saint_shrine = {
		desc = tp_saint_shrine
		potential = {
			OR = {
				has_province_modifier = tomb_of_a_saint
				has_province_modifier = pillaged_tomb_of_a_saint
				FROMFROM = { has_building = tp_saint_shrine }
			}
		}
		trigger = { temple_building_allow = yes }
		is_active_trigger = {
			custom_tooltip = {
				text = tp_saint_shrine_TT
				has_province_modifier = tomb_of_a_saint
			}
			custom_tooltip = {
				text = tp_saint_shrine_TT_2
				FROM = { religion_group = christian }
			}
		}
		gold_cost = 150
		build_time = 210

		ai_creation_factor = 92
		add_number_to_name = no
		liege_piety = 0.3
		local_revolt_risk = -0.05
		tax_income = 2
	}
}
