﻿# UA 1.22 acquisition-route availability. Canonical content matrix remains the ownership registry.

mar_has_available_archaeology_artifact_trigger = {
	OR = {
		AND = { # Rocky Valley Labyrinth
			NOT = {
				any_artifact = {
					has_variable = labyrinth
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west_britannia
				}
			}
		}
		AND = { # Helmet of Vercingetorix
			NOT = {
				any_artifact = {
					has_variable = ver_helmet
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Mask of Agamemnon
			NOT = {
				any_artifact = {
					has_variable = agamemnon
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
					geographical_region = world_europe_south_east
					geographical_region = world_europe_west
				}
			}
		}
		AND = { # Mask of Aurelian
			NOT = {
				any_artifact = {
					has_variable = aurelian_mask
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
					geographical_region = world_europe_south_east
				}
			}
		}
		AND = { # Kakungu Mask
			NOT = {
				any_artifact = {
					has_variable = kakungu_mask
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_africa
				}
			}
		}
		AND = { # Laurels of Marble
			NOT = {
				any_artifact = {
					has_variable = laurels
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
					geographical_region = world_europe_west
				}
			}
		}
		AND = { # Caracalla's Cameo Urn
			NOT = {
				any_artifact = {
					has_variable = caracalla_cameo
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_italy
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Dilmun Seal
			NOT = {
				any_artifact = {
					has_variable = dilmun_seal
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_arabia
					geographical_region = world_middle_east_persia
				}
			}
		}
		AND = { # Sarcophagus of Junius Bassus
			NOT = {
				any_artifact = {
					has_variable = junius_bassus
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_italy
				}
			}
		}
		AND = { # Sasanian Silver Bowl
			NOT = {
				any_artifact = {
					has_variable = sasanian_bowl
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east
					geographical_region = world_mesopotamia
				}
			}
		}
		AND = { # Tara Brooch
			NOT = {
				any_artifact = {
					has_variable = tara_brooch
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
				}
			}
		}
		AND = { # Ancient Magatama Jewel
			NOT = {
				any_artifact = {
					has_variable = ancient_magatama_jewel
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_japan
				}
			}
		}
		AND = { # Silla Gold Crown
			NOT = {
				any_artifact = {
					has_variable = silla_gold_crown
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_korea
					geographical_region = world_asia_north_east
				}
			}
		}
		AND = { # Silla Astronomer's Tablet
			NOT = {
				any_artifact = {
					has_variable = silla_astronomers_tablet
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_korea
					geographical_region = world_asia_north_east
				}
			}
		}
	
		# UA_1_23_WORLD_EXPANSION_I_START
		AND = { # Golden Ewer of Nagyszentmiklós
			NOT = { any_artifact = { has_variable = nagyszentmiklos_golden_ewer } }
			scope:location ?= {
				OR = {
					geographical_region = world_steppe_west
				}
			}
		}
		AND = { # Dong Son Bronze Drum
			NOT = { any_artifact = { has_variable = dong_son_bronze_drum } }
			scope:location ?= {
				OR = {
					geographical_region = world_asia_vietnam
				}
			}
		}
		AND = { # Ife Brass Head
			NOT = { any_artifact = { has_variable = ife_brass_head } }
			scope:location ?= {
				OR = {
					geographical_region = world_africa_west
				}
			}
			current_date > 1300.1.1
		}
		AND = { # Tellem Woven Textile
			NOT = { any_artifact = { has_variable = tellem_woven_textile } }
			scope:location ?= {
				OR = {
					geographical_region = world_africa_west
				}
			}
			current_date > 1000.1.1
		}
		# UA_1_23_WORLD_EXPANSION_I_END
		# UA_1_24_WORLD_EXPANSION_II_START
		AND = { # Pisa Griffin
			NOT = { any_artifact = { has_variable = pisa_griffin } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_west_iberia
					geographical_region = world_africa_north
				}
			}
			current_date > 1050.1.1
		}
		# UA_1_24_WORLD_EXPANSION_II_END
	}
}

mar_has_available_historical_artifact_trigger = {
	OR = {
		AND = { # Book of Kells
			NOT = {
				any_artifact = {
					has_variable = book_of_kells
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe
				}
			}
		}
		AND = { # Annales Laurissenses maiores
			NOT = {
				any_artifact = {
					has_variable = frankish_annals
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
					geographical_region = world_europe_west
				}
			}
		}
		AND = { # King Alfred's Jewel
			NOT = {
				any_artifact = {
					has_variable = alfred_jewel
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west
				}
			}
			current_date > 871.1.1
		}
		AND = { # Book of Durrow
			NOT = {
				any_artifact = {
					has_variable = book_of_durrow
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
				}
			}
		}
		AND = { # Pyxis of al-Mughira
			NOT = {
				any_artifact = {
					has_variable = pyxis
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
					geographical_region = world_africa_north
				}
			}
			current_date > 968.1.1
		}
		AND = { # Aeolipile
			NOT = {
				any_artifact = {
					has_variable = aeolipile
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Phaedrus
			NOT = {
				any_artifact = {
					has_variable = b_blue
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Critias
			NOT = {
				any_artifact = {
					has_variable = b_green
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Protagoras
			NOT = {
				any_artifact = {
					has_variable = b_red
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Symposium
			NOT = {
				any_artifact = {
					has_variable = b_purple
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Phaedo
			NOT = {
				any_artifact = {
					has_variable = b_white
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Plato's Ion
			NOT = {
				any_artifact = {
					has_variable = b_yellow
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
		}
		AND = { # Ostromir Gospel
			NOT = {
				any_artifact = {
					has_variable = ostromir_gospel
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = custom_slavia
					geographical_region = ghw_region_russia
					geographical_region = ghw_region_northern_russia
					geographical_region = world_europe_east
				}
			}
			current_date > 1056.1.1
		}
		AND = { # Codex Suprasliensis
			NOT = {
				any_artifact = {
					has_variable = codex_suprasliensis
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = custom_south_slavia
					geographical_region = custom_carpathia
					geographical_region = ghw_region_balkans
					geographical_region = world_europe_south_east
				}
			}
			current_date > 950.1.1
		}
		AND = { # Engishiki Ceremonial Scroll
			NOT = {
				any_artifact = {
					has_variable = engishiki_ceremonial_scroll
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_japan
				}
			}
			current_date > 927.1.1
		}
		AND = { # Goryeo Celadon Maebyeong
			NOT = {
				any_artifact = {
					has_variable = goryeo_celadon_maebyeong
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_korea
				}
			}
			current_date > 918.1.1
		}
		AND = { # Goryeo Sutra Woodblock
			NOT = {
				any_artifact = {
					has_variable = goryeo_sutra_woodblock
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_korea
				}
			}
			current_date > 1011.1.1
		}
	
		# UA_1_23_WORLD_EXPANSION_I_START
		AND = { # Sanjan Copper Plates
			NOT = { any_artifact = { has_variable = sanjan_copper_plates } }
			scope:location ?= {
				OR = {
					geographical_region = world_india_rajastan
				}
			}
			current_date > 871.1.1
		}
		AND = { # Samanid Epigraphic Bowl
			NOT = { any_artifact = { has_variable = samanid_epigraphic_bowl } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_persia
				}
			}
			current_date > 900.1.1
		}
		AND = { # Isfahan Astrolabe
			NOT = { any_artifact = { has_variable = isfahan_astrolabe_1102 } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_persia
				}
			}
			current_date > 1102.1.1
		}
		AND = { # Book of Zambasta
			NOT = { any_artifact = { has_variable = book_of_zambasta } }
			scope:location ?= {
				OR = {
					geographical_region = world_steppe_tarim
				}
			}
		}
		AND = { # Silver-Inlaid Mongol Paiza
			NOT = { any_artifact = { has_variable = mongol_silver_paiza } }
			scope:location ?= {
				OR = {
					geographical_region = world_steppe
				}
			}
			current_date > 1270.1.1
		}
		AND = { # Kedukan Bukit Inscription
			NOT = { any_artifact = { has_variable = kedukan_bukit_inscription } }
			scope:location ?= {
				OR = {
					geographical_region = world_asia_indonesia
				}
			}
		}
		# UA_1_23_WORLD_EXPANSION_I_END
		# UA_1_24_WORLD_EXPANSION_II_START
		AND = { # Harbaville Triptych
			NOT = { any_artifact = { has_variable = harbaville_triptych } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_east
					geographical_region = world_asia_minor
				}
			}
			current_date > 940.1.1
		}
		AND = { # Byzantine Warrior Casket
			NOT = { any_artifact = { has_variable = byzantine_warrior_casket } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_east
					geographical_region = world_asia_minor
				}
			}
			current_date > 950.1.1
		}
		AND = { # Queen Mlke's Gospel
			NOT = { any_artifact = { has_variable = queen_mlke_gospel } }
			scope:location ?= {
				OR = {
					geographical_region = ghw_region_caucasus
					geographical_region = custom_greater_armenia
				}
			}
			current_date > 862.1.1
		}
		AND = { # Blacas Ewer
			NOT = { any_artifact = { has_variable = blacas_ewer } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_arabia
				}
			}
			current_date > 1232.1.1
		}
		AND = { # al-Wasiti's Maqamat
			NOT = { any_artifact = { has_variable = wasiti_maqamat_manuscript } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_arabia
				}
			}
			current_date > 1237.1.1
		}
		AND = { # Baptistery of Saint Louis
			NOT = { any_artifact = { has_variable = saint_louis_baptistery_basin } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_jerusalem
					geographical_region = ghw_region_egypt
				}
			}
			current_date > 1325.1.1
		}
		AND = { # Casket of Leyre
			NOT = { any_artifact = { has_variable = leyre_casket } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_west_iberia
				}
			}
			current_date > 1004.1.1
		}
		AND = { # Vase of the Gazelles
			NOT = { any_artifact = { has_variable = gazelle_vase } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_west_iberia
				}
			}
			current_date > 1370.1.1
		}
		AND = { # Rasulid Astrolabe
			NOT = { any_artifact = { has_variable = rasulid_astrolabe_1291 } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_arabia
				}
			}
			current_date > 1291.1.1
		}
		AND = { # Sultan of Kilwa's Coin
			NOT = { any_artifact = { has_variable = kilwa_sultan_coin } }
			scope:location ?= {
				OR = {
					geographical_region = world_africa_east
				}
			}
			current_date > 1285.1.1
		}
		# UA_1_24_WORLD_EXPANSION_II_END
	}
}

mar_has_available_relic_artifact_trigger = {
	OR = {
		AND = { # Bimaran Casket
			NOT = {
				any_artifact = {
					has_variable = ashes_of_buddha	
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_tibet
					geographical_region = world_india
					geographical_region = world_burma
				}
			}
		}
		AND = { # Dharmachakra
			NOT = {
				any_artifact = {
					has_variable = dharmachakra
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_tibet
					geographical_region = world_india
					geographical_region = world_burma
				}
			}
		}
		AND = { # Branch of the Crown of Thorns
			NOT = {
				any_artifact = {
					has_variable = thorns
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_east
					geographical_region = world_middle_east
				}
			}
		}
		AND = { # Zbruch Idol
			NOT = {
				any_artifact = {
					has_variable = zbruch_idol
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = custom_slavia
					geographical_region = custom_west_slavia
					geographical_region = world_europe_east
				}
			}
		}
		AND = { # Horn of Svetovid
			NOT = {
				any_artifact = {
					has_variable = horn_of_svetovid
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = custom_west_slavia
					geographical_region = ghw_region_baltic
					geographical_region = dlc_fp1_region_non_scandinavian_southern_baltic
				}
			}
		}
		AND = { # Perun's Axe Amulet
			NOT = {
				any_artifact = {
					has_variable = peruns_axe_amulet
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = custom_slavia
					geographical_region = custom_south_slavia
					geographical_region = ghw_region_baltic
					geographical_region = world_europe_east
				}
			}
		}
		AND = { # Amber Sun Disk
			NOT = {
				any_artifact = {
					has_variable = amber_sun_disk
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = ghw_region_baltic
					geographical_region = dlc_fp1_region_non_scandinavian_southern_baltic
					geographical_region = custom_west_slavia
				}
			}
		}
	
		# UA_1_23_WORLD_EXPANSION_I_START
		AND = { # Chola Nataraja Bronze
			NOT = { any_artifact = { has_variable = chola_nataraja_bronze } }
			scope:location ?= {
				OR = {
					geographical_region = world_india_deccan
				}
			}
			current_date > 1000.1.1
		}
		AND = { # Pala Prajnaparamita Manuscript
			NOT = { any_artifact = { has_variable = pala_prajnaparamita_manuscript } }
			scope:location ?= {
				OR = {
					geographical_region = world_india_bengal
				}
			}
			current_date > 1100.1.1
		}
		AND = { # Arda Viraf Namag Codex
			NOT = { any_artifact = { has_variable = arda_viraf_namag_codex } }
			scope:location ?= {
				OR = {
					geographical_region = world_middle_east_persia
				}
			}
			current_date > 900.1.1
		}
		AND = { # Prajnaparamita of Singhasari
			NOT = { any_artifact = { has_variable = singhasari_prajnaparamita } }
			scope:location ?= {
				OR = {
					geographical_region = world_asia_indonesia
				}
			}
			current_date > 1280.1.1
		}
		AND = { # Garima Gospels
			NOT = { any_artifact = { has_variable = garima_gospels } }
			scope:location ?= {
				OR = {
					geographical_region = world_africa_east
				}
			}
		}
		# UA_1_23_WORLD_EXPANSION_I_END
		# UA_1_24_WORLD_EXPANSION_II_START
		AND = { # Deesis Reliquary Casket
			NOT = { any_artifact = { has_variable = byzantine_deesis_reliquary_casket } }
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south_east
					geographical_region = world_asia_minor
				}
			}
			current_date > 950.1.1
		}
		AND = { # Khakhuli Triptych
			NOT = { any_artifact = { has_variable = khakhuli_triptych } }
			scope:location ?= {
				OR = {
					geographical_region = ghw_region_caucasus
					geographical_region = world_asia_minor
				}
			}
			current_date > 1120.1.1
		}
		AND = { # Skevra Reliquary
			NOT = { any_artifact = { has_variable = skevra_reliquary } }
			scope:location ?= {
				OR = {
					geographical_region = ghw_region_caucasus
					geographical_region = custom_greater_armenia
				}
			}
			current_date > 1293.1.1
		}
		AND = { # Lasta Liturgical Cross
			NOT = { any_artifact = { has_variable = ethiopian_lasta_liturgical_cross } }
			scope:location ?= {
				OR = {
					geographical_region = world_africa_east
				}
			}
			current_date > 1100.1.1
		}
		# UA_1_24_WORLD_EXPANSION_II_END
	}
}

mar_has_available_legendary_artifact_trigger = {
	OR = {
		AND = { # Skofnung
			NOT = {
				any_artifact = {
					has_variable = skofnung
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west_britannia
					geographical_region = world_europe_west_germania
				}
			}
		}
		AND = { # Ragnar Lodbrok's Trousers
			NOT = {
				any_artifact = {
					has_variable = ragnar_trousers
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west_britannia
					geographical_region = world_europe_west_germania
				}
			}
		}
		AND = { # Hachiman War Banner
			NOT = {
				any_artifact = {
					has_variable = hachiman_war_banner
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_asia_japan
				}
			}
		}
	}
}

mar_has_available_occult_artifact_trigger = {
	OR = {
		AND = { # Voynich Manuscript
			NOT = {
				any_artifact = {
					has_variable = voynich
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe_south
				}
			}
			current_date > 1400.1.1
		}
		AND = { # Dice of Fate
			NOT = {
				any_artifact = {
					has_variable = dices_of_fate
				}
			}
			scope:location ?= {
				OR = {
					geographical_region = world_europe
					geographical_region = world_africa
					geographical_region = world_middle_east
					geographical_region = world_india
					geographical_region = world_himalaya
				}
			}
		}
		AND = { # Liber Cognitionis Occultae
			NOT = {
				any_artifact = {
					has_variable = liber_cogni
				}
			}
		}
	}
}

mar_has_available_government_artifact_trigger = {
	AND = {
		has_government = celestial_government
		NOT = { any_artifact = { has_variable = mar_celestial_tablet } }
	}
}

mar_has_available_unique_adventure_artifact_trigger = {
	OR = {
		mar_has_available_archaeology_artifact_trigger = yes
		mar_has_available_historical_artifact_trigger = yes
	}
}

# Character-scope gate for the dedicated completed-legend decision.
mar_has_available_legendary_artifact_for_character_trigger = {
	OR = {
		AND = { # Skofnung
			NOT = { any_artifact = { has_variable = skofnung } }
			location = {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west_britannia
					geographical_region = world_europe_west_germania
				}
			}
		}
		AND = { # Ragnar Lodbrok's Trousers
			NOT = { any_artifact = { has_variable = ragnar_trousers } }
			location = {
				OR = {
					geographical_region = world_europe_north
					geographical_region = world_europe_west_britannia
					geographical_region = world_europe_west_germania
				}
			}
		}
		AND = { # Hachiman War Banner
			NOT = { any_artifact = { has_variable = hachiman_war_banner } }
			location = { geographical_region = world_asia_japan }
		}
	}
}
