upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_consumer_goods
		}
	}
	consumer_goods = @instrument_upkeep_common
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_alloys
		}
	}
	alloys = @instrument_upkeep_rare
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_unity
		}
	}
	unity = @instrument_upkeep_rare
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_gas
		}
	}
	exotic_gases = @instrument_upkeep_very_rare
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_crystal
		}
	}
	rare_crystals = @instrument_upkeep_very_rare
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_motes
		}
	}
	volatile_motes = @instrument_upkeep_very_rare
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_zro
		}
	}
	sr_zro = @instrument_upkeep_legendary
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_dark_matter
		}
	}
	sr_dark_matter = @instrument_upkeep_legendary
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_living_metal
		}
	}
	sr_living_metal = @instrument_upkeep_epic
}

upkeep = {
	trigger = {
		has_trait = trait_psionic
		owner = {
			has_country_flag = instrument_craving_nanites
		}
	}
	nanites = @instrument_upkeep_epic
}

# ACOT
upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_dark_energy
				}
			}
			acot_sr_dark_energy = @instrument_upkeep_rare
		"
		toggle = @has_ancient_caches
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_stellarite
				}
			}
			acot_sr_stellarite = @instrument_upkeep_rare
		"
		toggle = @has_acquisition_of_tech
	}
}

# AOT
upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_runic_power
				}
			}
			aot_sr_runic_power = @instrument_upkeep_rare
		"
		toggle = @has_acquisition_of_tech
	}
}

# Gigas
upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_iodizium
				}
			}
			sr_iodizium = @instrument_upkeep_epic
		"
		toggle = @has_gigastructures
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_amb_megaconstruction
				}
			}
			giga_sr_amb_megaconstruction = @instrument_upkeep_epic
		"
		toggle = @has_gigastructures
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_psionic_sublimate
				}
			}
			sr_psionic_sublimate = @instrument_upkeep_epic
		"
		toggle = @has_gigastructures
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_negative_mass
				}
			}
			ehof_sr_negative_mass = @instrument_upkeep_rare
		"
		toggle = @has_gigastructures
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_sentient_metal
				}
			}
			ehof_sr_sentient_metal = @instrument_upkeep_rare
		"
		toggle = @has_gigastructures
	}
}

# Planetary Diversity
upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_eludium
				}
			}
			sr_eludium = @instrument_upkeep_very_rare
		"
		toggle = @has_planetary_diversity_unique_worlds
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_acean
				}
			}
			sr_acean = @instrument_upkeep_very_rare
		"
		toggle = @has_planetary_diversity_unique_worlds
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_rad_bloom
				}
			}
			sr_rad_bloom = @instrument_upkeep_very_rare
		"
		toggle = @has_planetary_diversity_unique_worlds
	}
}

upkeep = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			trigger = {
				has_trait = trait_psionic
				owner = {
					has_country_flag = instrument_craving_tiyanki_parts
				}
			}
			sr_tiyanki_parts = @instrument_upkeep_very_rare
		"
		toggle = @has_planetary_diversity_unique_worlds
	}
}
