should_use_tribal_realm_palace_graphics_trigger = {
	government_has_flag = government_is_tribal
	culture = {
		has_graphical_india_culture_group_trigger = no
		has_graphical_mena_culture_group_trigger = no
		has_graphical_steppe_culture_group_trigger = no
		has_graphical_african_culture_group_trigger = no
	}
}

has_graphical_mena_culture_group_trigger = {
	has_building_gfx = mena_building_gfx
}

has_graphical_india_culture_group_trigger = {
	OR = {
		has_building_gfx = indian_building_gfx
		has_building_gfx = southeast_asian_building_gfx
	}
}

has_graphical_east_asia_culture_group_trigger = {
	OR = {
		has_building_gfx = chinese_building_gfx
		has_building_gfx = japanese_building_gfx	
	}
}

has_graphical_east_asia_or_southeast_asia_group_trigger = {
	OR = {
		has_building_gfx = chinese_building_gfx
		has_building_gfx = japanese_building_gfx
		has_building_gfx = southeast_asian_building_gfx
	}
}

has_graphical_mediterranean_culture_group_trigger = {
	OR = {
		has_building_gfx = mediterranean_building_gfx
		has_building_gfx = byzantine_building_gfx
	}
}

has_graphical_western_culture_group_trigger = {
	has_building_gfx = western_building_gfx
}

has_graphical_norse_culture_group_trigger = {
	has_building_gfx = norse_building_gfx
}

has_graphical_african_culture_group_trigger = {
	has_building_gfx = african_building_gfx
}

has_graphical_steppe_culture_group_trigger = {
	has_building_gfx = steppe_building_gfx
}

has_graphical_iberian_culture_group_trigger = {
	has_building_gfx = iberian_building_gfx
}

has_graphical_iranian_culture_group_trigger = {
	has_building_gfx = iranian_building_gfx
}

has_graphical_chinese_culture_group_trigger = {
	has_building_gfx = chinese_building_gfx
}

has_graphical_japanese_culture_group_trigger = {
	has_building_gfx = japanese_building_gfx
}

graphical_wilderness_desert_trigger = {
	OR = {
		terrain = desert
		terrain = desert_mountains
		terrain = oasis
		AND = {
			terrain = hills
			OR = {
				geographical_region = world_africa
				geographical_region = world_middle_east_arabia
			}
		}
	}
}

graphical_wilderness_forest_pine_trigger = {
	OR = {
		terrain = taiga
		AND = {
			terrain = forest
			OR = {
				geographical_region = world_europe_north
				geographical_region = world_steppe
			}
		}
	}
}

graphical_wilderness_forest_trigger = {
	OR = {
		terrain = forest
		terrain = farmlands
	}
}

graphical_wilderness_mountains_trigger = {
	terrain = mountains
}

graphical_wilderness_steppe_trigger = {
	OR = {
		terrain = steppe
		AND = {
			terrain = hills
			OR = {
				geographical_region = world_steppe
				geographical_region = world_middle_east_persia
				geographical_region = world_middle_east_jerusalem
			}
		}
	}
}

graphical_drylands_trigger = {
	terrain = drylands
}

graphical_wilderness_wetlands_trigger = {
	OR = {
		terrain = wetlands
		terrain = floodplains
	}
}

graphical_wilderness_jungle_trigger = {
	OR = {
		terrain = jungle
		AND = {
			terrain = hills
			geographical_region = graphical_india
			NOT = { geographical_region = world_tibet }
		}
	}
}

graphical_plains_trigger = {
	terrain = plains
}

graphical_wilderness_ocean_trigger = {
	is_sea_province = yes
}

graphical_hills_trigger = {
	terrain = hills
}

### Scripted illustrations

# This doesn't really evaluate anything, it just saves the scope out for later things to use
title_illustration_save_province_temporary = {
	trigger_if = {
		limit = { tier = tier_barony }
		title_province = {
			save_temporary_scope_as = province
		}
	}
	trigger_else_if = {
		limit = {
			tier > tier_county
			NOT = {
				any_in_de_jure_hierarchy = { tier = tier_county }
			}
		}
	}
	trigger_else = {
		title_capital_county.title_province = {
			save_temporary_scope_as = province
		}
	}
	always = yes
}

#has_indian_culture_trigger = {
has_graphical_india_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			geographical_region = graphical_india
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				geographical_region = graphical_india
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				geographical_region = graphical_india
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				geographical_region = graphical_india
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

has_graphical_east_asia_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			OR = {
				geographical_region = graphical_east_asia
				geographical_region = world_steppe_east
			}
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				OR = {
					geographical_region = graphical_east_asia
					geographical_region = world_steppe_east
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				OR = {
					geographical_region = graphical_east_asia
					geographical_region = world_steppe_east
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				OR = {
					geographical_region = graphical_east_asia
					geographical_region = world_steppe_east
				}
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

#has_mediterranean_culture_trigger = {
has_graphical_mediterranean_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			geographical_region = graphical_mediterranean
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				geographical_region = graphical_mediterranean
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				geographical_region = graphical_mediterranean
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				geographical_region = graphical_mediterranean
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

#has_mena_culture_trigger = {
has_graphical_mena_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			OR = {
				geographical_region = graphical_mena
				geographical_region = world_steppe_tarim
				geographical_region = world_steppe_central
				AND = {
					prev = {
						government_has_flag = government_is_clan
					}
					OR = {
						geographical_region = world_steppe_west
						geographical_region = world_siberia
					}
				}
			}
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				OR = {
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					AND = {
						province_owner = {
							government_has_flag = government_is_clan
						}
						OR = {
							geographical_region = world_steppe_west
							geographical_region = world_siberia
						}
					}
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				OR = {
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					AND = {
						province_owner = {
							government_has_flag = government_is_clan
						}
						OR = {
							geographical_region = world_steppe_west
							geographical_region = world_siberia
						}
					}
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				OR = {
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					AND = {
						province_owner = {
							government_has_flag = government_is_clan
						}
						OR = {
							geographical_region = world_steppe_west
							geographical_region = world_siberia
						}
					}
				}
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

has_graphical_scandinavia_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			geographical_region = world_europe_north
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				geographical_region = world_europe_north
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				geographical_region = world_europe_north
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				geographical_region = world_europe_north
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

#has_western_culture_trigger = {
has_graphical_western_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			NOR = {
				geographical_region = graphical_india
				geographical_region = graphical_mediterranean
				geographical_region = graphical_mena
				geographical_region = world_steppe_tarim
				geographical_region = world_steppe_central
				geographical_region = world_steppe_east
				geographical_region = world_asia
			}
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}

		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				NOR = {
					geographical_region = graphical_india
					geographical_region = graphical_mediterranean
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					geographical_region = world_steppe_east
					geographical_region = world_asia
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				NOR = {
					geographical_region = graphical_india
					geographical_region = graphical_mediterranean
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					geographical_region = world_steppe_east
					geographical_region = world_asia
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				NOR = {
					geographical_region = graphical_india
					geographical_region = graphical_mediterranean
					geographical_region = graphical_mena
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
					geographical_region = world_steppe_east
					geographical_region = world_asia
				}
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

#Has graphical region Iberia trigger
has_graphical_iberia_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			geographical_region = world_europe_west_iberia
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				geographical_region = world_europe_west_iberia
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				geographical_region = world_europe_west_iberia
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				geographical_region = world_europe_west_iberia
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

#Has graphical region Iran trigger
has_graphical_iran_region_trigger = {
	trigger_if = {
		limit = {
			exists = capital_province
		}
		capital_province = {
			OR = {
				geographical_region = world_middle_east_persia
				geographical_region = world_steppe_tarim
				geographical_region = world_steppe_central
			}
		}
	}
	trigger_else_if = {
		limit = {
			NOT = { exists = capital_province }
		}
		trigger_if = { 
			limit = { exists = host.capital_province }
			host.capital_province = {
				OR = {
					geographical_region = world_middle_east_persia
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = liege.capital_province
			}
			liege.capital_province = {
				OR = {
					geographical_region = world_middle_east_persia
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
				}
			}
		}
		trigger_else_if = {
			limit = {
				exists = location.province_owner.capital_province
			}
			location.province_owner.capital_province = {
				OR = {
					geographical_region = world_middle_east_persia
					geographical_region = world_steppe_tarim
					geographical_region = world_steppe_central
				}
			}
		}
		trigger_else = { always = yes }
	}
	trigger_else = { always = yes }
}

steppe_building_gfx_use_mena_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		OR = {
			#western steppe should only be mena if you are clan
			NOR = {
				geographical_region = world_steppe_west
				geographical_region = world_europe
				geographical_region = world_asia_minor
				geographical_region = world_india
				geographical_region = world_burma
				geographical_region = world_tibet
				geographical_region = world_asia
				geographical_region = world_steppe_east
			}
			AND = {
				faith.religion = religion:islam_religion
				OR = {
					geographical_region = world_steppe_west
					geographical_region = world_asia_minor
				}
			}
		}
	}	
}
steppe_building_gfx_use_indian_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		OR = {
			#western steppe should only be mena if you are clan
			geographical_region = world_india
			geographical_region = world_burma
			geographical_region = world_tibet
			geographical_region = world_asia_southeast
		}
	}	
}

steppe_building_gfx_use_mediterranean_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		OR = {
			geographical_region = world_europe_south_east
			geographical_region = world_europe_south_italy
			geographical_region = world_europe_west_iberia
			geographical_region = world_asia_minor
		}
	}	
}
steppe_building_gfx_use_iranian_trigger = {
	AND = {
		OR = {
			geographical_region = world_steppe_central
			geographical_region = world_middle_east_persia
		}
		culture ?= { has_building_gfx = steppe_building_gfx }
	}
}
steppe_building_gfx_use_western_trigger = {
	AND = {
		OR = {
			geographical_region = world_europe_north
			geographical_region = world_europe_west
		}
		culture ?= { has_building_gfx = steppe_building_gfx }
	}
}
steppe_building_gfx_use_east_asian_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		OR = {
			geographical_region = world_asia
			geographical_region = world_steppe_east
		}
		NOT = { geographical_region = world_asia_southeast }
	}
}
steppe_building_gfx_use_japanese_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		geographical_region = world_asia_japan
	}
}
steppe_building_gfx_use_southeast_asian_trigger = {
	AND = {
		culture ?= { has_building_gfx = steppe_building_gfx }
		geographical_region = world_asia_southeast
	}
}

high_tier_throne_room_trigger = {
	OR = {
		AND = {
			tgp_is_ceremonial_regent_trigger = no # Not 'actual' ruler
			primary_title ?= { tier >= tier_kingdom }
		}
		tgp_is_ceremonial_liege_trigger = yes
	}
	has_graphical_$REGION$_region_trigger = yes
}

high_tier_throne_room_spouse_trigger = {
	OR = {
		primary_spouse ?= {
			high_tier_throne_room_trigger = { REGION = $REGION$ }
			has_graphical_$REGION$_region_trigger = yes
		}
		AND = {
			betrothed ?= {
				high_tier_throne_room_trigger = { REGION = $REGION$ }
				has_graphical_$REGION$_region_trigger = yes
			}
		}
		AND = {
			liege.diarch ?= this
			liege ?= {
				high_tier_throne_room_trigger = { REGION = $REGION$ }
				has_graphical_$REGION$_region_trigger = yes
			}
		}
	}
}

byzantine_governor_trigger = {
	is_landed = yes
	government_allows = administrative
	liege ?= {
		OR = {
			is_roman_emperor_primary_title_trigger = yes
			AND = {
				culture = {
					OR = {
						has_cultural_pillar = heritage_byzantine
						has_cultural_pillar = heritage_caucasian
					}
				}
				primary_title.tier >= tier_empire
			}
		}
	}
}

byzantine_governor_close_family_trigger = {
	location = prev.location
	is_landed = yes
	government_has_flag = government_is_special_administrative
	exists = top_liege
	top_liege = {
		OR = {
			is_roman_emperor_primary_title_trigger = yes
			AND = {
				culture = {
					OR = {
						has_cultural_pillar = heritage_byzantine
						has_cultural_pillar = heritage_caucasian
					}
				}
				primary_title.tier >= tier_empire
			}
		}
	}
}

east_asian_governor_trigger = {
	is_landed = yes
	government_allows = administrative
	top_liege ?= {
		OR = {
			primary_title = title:h_china
			primary_title.de_jure_liege = title:h_china
			AND = {
				culture_has_east_asian_heritage_pillar_trigger = yes
				primary_title.tier >= tier_empire
			}
		}
	}
}

east_asian_governor_close_family_trigger = {
	location = prev.location
	is_landed = yes
	government_has_flag = government_is_special_administrative
	top_liege ?= {
		OR = {
			primary_title = title:h_china
			primary_title.de_jure_liege = title:h_china
			AND = {
				culture_has_east_asian_heritage_pillar_trigger = yes
				primary_title.tier >= tier_empire
			}
		}
	}
}

has_graphical_chinese_region_trigger = {
	trigger_if = {
		limit = { exists = capital_province }
		capital_province = { geographical_region = world_asia_china }
	}
	trigger_else_if = { 
		limit = { exists = host.capital_province }
		host.capital_province = { geographical_region = world_asia_china }
	}
	trigger_else_if = {
		limit = { exists = liege.capital_province }
		liege.capital_province = { geographical_region = world_asia_china }
	}
	trigger_else_if = {
		limit = { exists = location.province_owner.capital_province }
		location.province_owner.capital_province = { geographical_region = world_asia_china }
	}
	trigger_else = { always = yes }
}

has_graphical_japanese_region_trigger = {
	trigger_if = {
		limit = { exists = capital_province }
		capital_province = { geographical_region = world_asia_japan }
	}
	trigger_else_if = { 
		limit = { exists = host.capital_province }
		host.capital_province = { geographical_region = world_asia_japan }
	}
	trigger_else_if = {
		limit = { exists = liege.capital_province }
		liege.capital_province = { geographical_region = world_asia_japan }
	}
	trigger_else_if = {
		limit = { exists = location.province_owner.capital_province }
		location.province_owner.capital_province = { geographical_region = world_asia_japan }
	}
	trigger_else = { always = yes }
}

has_graphical_korean_region_trigger = {
	trigger_if = {
		limit = { exists = capital_province }
		capital_province = { geographical_region = world_asia_korea }
	}
	trigger_else_if = { 
		limit = { exists = host.capital_province }
		host.capital_province = { geographical_region = world_asia_korea }
	}
	trigger_else_if = {
		limit = { exists = liege.capital_province }
		liege.capital_province = { geographical_region = world_asia_korea }
	}
	trigger_else_if = {
		limit = { exists = location.province_owner.capital_province }
		location.province_owner.capital_province = { geographical_region = world_asia_korea }
	}
	trigger_else = { always = yes }
}
