﻿@illustration_christian = "gfx/interface/illustrations/holding_types/temple_christian.dds"
@illustration_generic_grass = "gfx/interface/illustrations/holding_types/temple_generic_grass.dds"
@illustration_generic_arid = "gfx/interface/illustrations/holding_types/temple_generic_arid.dds"
@illustration_india = "gfx/interface/illustrations/holding_types/temple_india.dds"
@illustration_islamic = "gfx/interface/illustrations/holding_types/temple_islamic.dds"
@illustration_orthodox = "gfx/interface/illustrations/holding_types/temple_orthodox.dds"
@illustration_northern_pagan = "gfx/interface/illustrations/holding_types/temple_northern_pagan.dds"

temple_01 = {
	construction_time = slow_construction_time
	
	
	### GENERIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_generic_01_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_generic_01_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_generic_01_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_generic_01_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_mena" }
	}
	
	asset = {
		type = pdxmesh
		name = "building_western_temple_pagan_01_mesh"
		illustration = @illustration_northern_pagan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/pagan_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "pagan_gfx" }
	}
	
	### DHARMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ORTHODOX ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### CATHOLIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ISLAMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	
	
	
	can_construct_potential = {
		building_requirement_tribal = no
		barony_cannot_construct_holding = no
	}
	
	can_construct = {
		culture = {
			has_innovation = innovation_city_planning
		}
	}
	
	can_construct_showing_failures_only = {
		building_requirement_tribal_holding_in_county = no
	}
	cost_gold = 500
	next_building = temple_02
	
	levy = small_building_levy_tier_2
	garrison = normal_building_garrison_tier_1
	province_modifier = {
		monthly_income = normal_building_tax_tier_2
	}

	flag = temple

	type_icon = "icon_building_monastic_schools.dds"

	on_complete = {
		county.holder = { add_piety = medium_piety_gain }

		#to give follow-up to the vassal.1001 event
		hidden_effect = {
			province_owner = {
				save_scope_as = owner_of_province
				
				scope:owner_of_province = {
					if = { #Religious liege asked me to build a temple
						limit = {
							exists = var:promised_to_build_temple
							has_character_flag = promised_liege_temple
						}
						trigger_event = {
							id = vassal.1010
							days = 3
						}
					}
					if = { #Religious vassal asked me to build a temple
						limit = {
							exists = var:promised_to_build_temple
							has_character_flag = promised_vassal_temple
						}
						trigger_event = {
							id = vassal.1110
							days = 3
						}
					}
				}
			}
		}
	}
	
	ai_value = {
		base = 10 ## Paradox pls. Not 100.
		modifier = {
			factor = 0
			scope:holder = {
				NOT = { has_government = theocracy_government }
			}
		}
	}
}

temple_02 = {
	construction_time = slow_construction_time
	
	### GENERIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_generic_01_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_generic_01_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_generic_01_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_generic_01_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 0 } }
		graphical_regions = { "graphical_mena" }
	}
	
	asset = {
		type = pdxmesh
		name = "building_western_temple_pagan_01_mesh"
		illustration = @illustration_northern_pagan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/pagan_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "pagan_gfx" }
	}
	
	### DHARMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_dharmic_01_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ORTHODOX ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_orthodox_01_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### CATHOLIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_christian_01_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ISLAMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_islamic_01_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 0 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mena" }
	}

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_manorialism
		}
	}
	cost_gold = 500
	next_building = temple_03
	
	levy = small_building_levy_tier_4
	garrison = normal_building_garrison_tier_3
	province_modifier = {
		monthly_income = normal_building_tax_tier_4
		levy_size = 0.25
		garrison_size = 0.25
	}

	flag = temple
	
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = {
			factor = 2
			duchy = {is_capital_barony = yes}
		}
	}
}

temple_03 = {
	construction_time = slow_construction_time
	
	### GENERIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_generic_02_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_generic_02_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_generic_02_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_generic_02_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_mena" }
	}
	
	asset = {
		type = pdxmesh
		name = "building_western_temple_pagan_02_mesh"
		illustration = @illustration_northern_pagan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/pagan_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "pagan_gfx" }
	}
	
	### DHARMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ORTHODOX ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### CATHOLIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ISLAMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	

	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_windmills
		}
	}
	cost_gold = 500
	next_building = temple_04
	
	levy = small_building_levy_tier_6
	garrison = normal_building_garrison_tier_5
	province_modifier = {
		monthly_income = normal_building_tax_tier_6
		levy_size = 0.5
		garrison_size = 0.5
	}

	flag = temple
	
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = {
			factor = 2
			duchy = {is_capital_barony = yes}
		}
	}
}

temple_04 = {
	construction_time = slow_construction_time
	
	### GENERIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_generic_02_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_generic_02_mesh"
		illustration = @illustration_generic_grass
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_generic_02_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_generic_02_mesh"
		illustration = @illustration_generic_arid
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/generic_temple" soundparameter = { "Tier" = 1 } }
		graphical_regions = { "graphical_mena" }
	}
	
	asset = {
		type = pdxmesh
		name = "building_western_temple_pagan_02_mesh"
		illustration = @illustration_northern_pagan
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/pagan_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "pagan_gfx" }
	}
	
	### DHARMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_dharmic_02_mesh"
		illustration = @illustration_india
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/dharmic_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "dharmic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ORTHODOX ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_orthodox_02_mesh"
		illustration = @illustration_orthodox
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/orthodox_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "orthodox_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### CATHOLIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_christian_02_mesh"
		illustration = @illustration_christian
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/church_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "catholic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	### ISLAMIC ###
	asset = {
		type = pdxmesh
		name = "building_western_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
	}
	asset = {
		type = pdxmesh
		name = "building_mediterranean_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mediterranean" }
	}
	asset = {
		type = pdxmesh
		name = "building_indian_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_india" }
	}
	asset = {
		type = pdxmesh
		name = "building_mena_temple_islamic_02_mesh"
		illustration = @illustration_islamic
		soundeffect = { soundeffect = "event:/SFX/Ambience/3DMapEmitters/Holdings/Temples/mosque_temple" soundparameter = { "Tier" = 1 } }
		graphical_faiths = { "islamic_gfx" }
		graphical_regions = { "graphical_mena" }
	}
	
	
	can_construct_potential = {
		building_requirement_tribal = no
	}
	can_construct = {
		culture = {
			has_innovation = innovation_cranes
		}
	}
	cost_gold = 500
	
	levy = small_building_levy_tier_8
	garrison = normal_building_garrison_tier_7
	province_modifier = {
		monthly_income = normal_building_tax_tier_8
		levy_size = 1
		garrison_size = 1
	}

	flag = temple
	
	ai_value = {
		base = 1 ## Build after other buildings - see later
		modifier = { ## But Kings/Emperors please upgrade your cap asap!
			factor = 5
			scope:holder = {
				OR = {
				primary_title.tier = tier_kingdom
				primary_title.tier = tier_empire
				}
			}
			duchy = {is_capital_barony = yes}
		}
		modifier = {
			add = {
				value = 3 ## Castles have 4
				multiply = combined_building_level ## The more buildings we have, the more worth it this becomes.
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} } ## Topmost liege shouldn't construct in vassal holdings unless no better option.
		}
		modifier = {
			factor = 2
			duchy = {is_capital_barony = yes}
		}
	}
}

####
#
# Temple Buildings
#
####

### Monastic School

monastic_schools_01 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		has_building_or_higher = temple_01
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_1_cost
	
	character_modifier = {
		monthly_piety = 0.1
	}
	county_modifier = {
		monthly_county_control_change_add = 0.1
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_1
	}
	
	next_building = monastic_schools_02

	type_icon = "icon_building_monastic_schools.dds"
	
	ai_value = {
		base = 10
		modifier = {
			add = 15
			scope:holder = {
				OR = {
					has_government = theocracy_government
					is_theocratic_lessee = yes
				}
			}
		}
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}
		}
		
	}
}

monastic_schools_02 = {
	construction_time = standard_construction_time

	can_construct_potential = {
		has_building_or_higher = temple_01
		culture = {
			has_innovation = innovation_city_planning
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_2_cost
	
	character_modifier = {
		monthly_piety = 0.2
	}
	county_modifier = {
		monthly_county_control_change_add = 0.2
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_2
	}
	
	next_building = monastic_schools_03
	ai_value = {
		base = 9
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_03 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_02
		culture = {
			has_innovation = innovation_manorialism
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_3_cost
	
	character_modifier = {
		monthly_piety = 0.3
	}
	county_modifier = {
		monthly_county_control_change_add = 0.3
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_3
	}
	
	next_building = monastic_schools_04
	ai_value = {
		base = 8
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_04 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_02
		culture = {
			has_innovation = innovation_manorialism
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_4_cost
	
	character_modifier = {
		monthly_piety = 0.4
	}
	county_modifier = {
		monthly_county_control_change_add = 0.4
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_4
	}
	
	next_building = monastic_schools_05
	ai_value = {
		base = 7
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_05 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_03
		culture = {
			has_innovation = innovation_windmills
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_5_cost
	
	character_modifier = {
		monthly_piety = 0.5
	}
	county_modifier = {
		monthly_county_control_change_add = 0.5
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_5
	}
	
	next_building = monastic_schools_06
	ai_value = {
		base = 6
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_06 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_03
		culture = {
			has_innovation = innovation_windmills
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_6_cost
	
	character_modifier = {
		monthly_piety = 0.6
	}
	county_modifier = {
		monthly_county_control_change_add = 0.6
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_6
	}
	
	next_building = monastic_schools_07
	ai_value = {
		base = 5
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_07 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_04
		culture = {
			has_innovation = innovation_cranes
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}

	cost_gold = normal_building_tier_7_cost
	
	character_modifier = {
		monthly_piety = 0.7
	}
	county_modifier = {
		monthly_county_control_change_add = 0.7
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_7
	}
	
	next_building = monastic_schools_08
	ai_value = {
		base = 4
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}

monastic_schools_08 = {
	construction_time = standard_construction_time

	can_construct = {
		has_building_or_higher = temple_04
		culture = {
			has_innovation = innovation_cranes
		}
	}

	can_construct_showing_failures_only = {
		building_requirement_tribal = no
	}
	
	cost_gold = normal_building_tier_8_cost
	
	character_modifier = {
		monthly_piety = 0.8
	}
	county_modifier = {
		monthly_county_control_change_add = 0.8
	}
	province_modifier = {
		monthly_income = poor_building_tax_tier_8
	}
	
	ai_value = {
		base = 3
		modifier = {
			factor = 2
			scope:holder = { NOT = {exists = liege} }
		}
		modifier = { 
			factor = 2
			duchy = {is_capital_barony = yes}	
		}
		
	}
}
