﻿holy_stuff_relics_map = {

	save_scope_as = player_character

	every_ruler = {
		set_local_variable = {
			name = christian_relics_list
			value = 0
		}
		set_local_variable = {
			name = islamic_relics_list
			value = 0
		}
		set_local_variable = {
			name = buddhism_relics_list
			value = 0
		}
		set_local_variable = {
			name = zoroastr_relics_list
			value = 0
		}
		set_local_variable = {
			name = germanic_relics_list
			value = 0
		}
		set_local_variable = {
			name = slavic_relics_list
			value = 0
		}
		set_local_variable = {
			name = finno_ugric_relics_list
			value = 0
		}
		set_local_variable = {
			name = boog_relics_list
			value = 0
		}
		set_local_variable = {
			name = hinduism_relics_list
			value = 0
		}
		set_local_variable = {
			name = jainism_relics_list
			value = 0
		}
		set_local_variable = {
			name = judaism_relics_list
			value = 0
		}
		every_character_artifact = {
				limit = { artifact_is_christian_relic_trigger = yes }
			change_local_variable = {
				name = christian_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_islamic_relic_trigger = yes }
			change_local_variable = {
				name = islamic_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_buddhism_relic_trigger = yes }
			change_local_variable = {
				name = buddhism_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_zoroastr_relic_trigger = yes }
			change_local_variable = {
				name = zoroastr_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_germanic_relic_trigger = yes }
			change_local_variable = {
				name = germanic_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_slavic_relic_trigger = yes }
			change_local_variable = {
				name = slavic_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_finno_ugric_relic_trigger = yes }
			change_local_variable = {
				name = finno_ugric_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_boog_relic_trigger = yes }
			change_local_variable = {
				name = boog_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_hinduism_relic_trigger = yes }
			change_local_variable = {
				name = hinduism_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_jainism_relic_trigger = yes }
			change_local_variable = {
				name = jainism_relics_list
				add = 1
			}
		}
		every_character_artifact = {
				limit = { artifact_is_judaism_relic_trigger = yes }
			change_local_variable = {
				name = judaism_relics_list
				add = 1
			}
		}
		if = {
			limit = {
				local_var:christian_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_christian
				set_color_from_title = title:d_map_christian_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_christian}
							}
							set_color_from_title = title:d_map_christian_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:islamic_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_islamic
				set_color_from_title = title:d_map_islamic_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_islamic}
							}
							set_color_from_title = title:d_map_islamic_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:buddhism_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_buddhism
				set_color_from_title = title:d_map_buddhism_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_buddhism}
							}
							set_color_from_title = title:d_map_buddhism_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:zoroastr_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_zoroastr
				set_color_from_title = title:d_map_zoroastr_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_zoroastr}
							}
							set_color_from_title = title:d_map_zoroastr_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:germanic_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_germanic
				set_color_from_title = title:d_map_germanic_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_germanic}
							}
							set_color_from_title = title:d_map_germanic_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:slavic_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_slavic
				set_color_from_title = title:d_map_slavic_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_slavic}
							}
							set_color_from_title = title:d_map_slavic_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:finno_ugric_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_finno_ugric
				set_color_from_title = title:d_map_finno_ugric_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_finno_ugric}
							}
							set_color_from_title = title:d_map_finno_ugric_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:boog_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_boog
				set_color_from_title = title:d_map_boog_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_boog}
							}
							set_color_from_title = title:d_map_boog_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:hinduism_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_hinduism
				set_color_from_title = title:d_map_hinduism_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_hinduism}
							}
							set_color_from_title = title:d_map_hinduism_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:jainism_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_jainism
				set_color_from_title = title:d_map_jainism_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_jainism}
							}
							set_color_from_title = title:d_map_jainism_relics_realm
						}
					}
				}
			}
		}
		else_if = {
			limit = {
				local_var:judaism_relics_list > 0
			}
			capital_barony = {
				save_scope_as = capital_judaism
				set_color_from_title = title:d_map_judaism_relics_barony
			}
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						if = {
							limit = {
								NOT = { this = scope:capital_judaism}
							}
							set_color_from_title = title:d_map_judaism_relics_realm
						}
					}
				}
			}
		}
		else = {
			every_held_title = {
				limit = {
					tier = tier_county
				}
				every_county_province = { 
					barony = {
						set_color_from_title = title:d_map_empty
					}
				}
			}
		}
		remove_local_variable = christian_relics_list
		remove_local_variable = islamic_relics_list
		remove_local_variable = buddhism_relics_list
		remove_local_variable = zoroastr_relics_list
		remove_local_variable = germanic_relics_list
		remove_local_variable = slavic_relics_list
		remove_local_variable = finno_ugric_relics_list
		remove_local_variable = boog_relics_list
		remove_local_variable = hinduism_relics_list
		remove_local_variable = jainism_relics_list
		remove_local_variable = judaism_relics_list
	}
}