# Vanilla scripted triggers from 00_scripted_triggers_ai.txt

districts_good_energy = {
	planet = {
		OR = {
			has_modifier = hazardous_weather
			has_modifier = divine_algorithm
			has_modifier = energy_relic
			has_modifier = gas_rich_planet_fo_realz
			has_planet_flag = buildings_good_energy
			# GPM
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					gpm_has_positive_energy_planet_modifier = yes
				"
				toggle = @has_guillis_planet_modifiers
			}
		}
	}
}

districts_good_minerals = {
	planet = {
		OR = {
			has_modifier = extensive_moon_system
			has_modifier = carbon_world
			has_modifier = mineral_rich
			has_modifier = ultra_rich
			has_modifier = asteroid_belt
			has_modifier = minerals_relic
			has_planet_flag = buildings_good_minerals
			# GPM
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					gpm_has_positive_mineral_planet_modifier = yes
				"
				toggle = @has_guillis_planet_modifiers
			}
		}
		# SirBlackAxe's Unofficial Bug Patch
		NOT = { has_modifier = pm_wenkwort_custodian }
	}
}

districts_good_food = {
	planet = {
		OR = {
			has_modifier = lush_planet
			has_planet_flag = buildings_good_food
			# SirBlackAxe's Unofficial Bug Patch
			has_modifier = paradise_planet
			has_modifier = ancient_harvesters
			has_modifier = eat_the_titans
			# GPM
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					gpm_has_positive_food_planet_modifier = yes
				"
				toggle = @has_guillis_planet_modifiers
			}
		}
	}
}

jobs_any_research = {
	planet = {
		any_owned_pop = {
			OR = {
				has_job = head_researcher
				has_job = researcher
				has_job = brain_drone
				has_job = calculator
				has_job = dimensional_portal_researcher
				has_job = dimensional_portal_researcher_gestalt
				has_job = space_time_anomaly_researcher
				has_job = space_time_anomaly_researcher_gestalt
				has_job = necromancer
				has_job = xeno_zoo_keeper
				has_job = head_researcher
				# ACOT
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						has_job = acot_researcher
						has_job = acot_researcher_drone
						has_job = acot_priest
						has_job = acot_voidsphere_labman
						has_job = acot_voidsphere_labdrone
						has_job = acot_free_thinker
					"
					toggle = @has_ancient_caches
				}
				# AOT
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						has_job = ae_researcher
						has_job = ae_researcher_drone
						has_job = phanon_researcher
						has_job = phanon_researcher_drone
						has_job = phanon_priest
						has_job = stellarite_researcher
						has_job = stellarite_researcher_drone
						has_job = stellarite_priest
						has_job = stellarite_bureaucrat
					"
					toggle = @has_acquisition_of_tech
				}
				# GPM
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						has_job = gpm_archaeologist
						has_job = gpm_archaeologist_drone
						has_job = gpm_precursor_archaeologist
						has_job = gpm_precursor_archaeologist_drone
						has_job = gpm_orbital_researcher
						has_job = gpm_orbital_researcher_drone
					"
					toggle = @has_guillis_planet_modifiers
				}
			}
		}
	}
}

has_farming_designation = {
	OR = {
		has_designation = col_farming
		has_designation = col_ring_farming
		has_designation = col_habitat_farming
		has_designation = col_habitat_gestalt_farming
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_food
				has_designation = col_city_farming
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_farming
			"
			toggle = @has_nsc_freebooter_mod
		}
	}
}

# has_fortress_designation

has_factory_designation = {
	OR = {
		has_designation = col_capital_factory
		has_designation = col_factory
		has_designation = col_mac_factory
		has_designation = col_ecu_factory
		has_designation = col_habitat_factory
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_ring_factory
				has_designation = col_dome_factory
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_factory
			"
			toggle = @has_nsc_freebooter_mod
		}
	}
}

has_foundry_designation = {
	OR = {
		has_designation = col_capital_foundry
		has_designation = col_foundry
		has_designation = col_ecu_foundry
		has_designation = col_habitat_foundry
		has_designation = col_mac_foundry
		has_designation = col_hiv_foundry
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_ring_foundry
				has_designation = col_dome_foundry
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_foundry
			"
			toggle = @has_nsc_freebooter_mod
		}
		# TimeMod
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_nanites_capital_machine_manufacturing
			"
			toggle = @timemod
		}
	}
}

has_generator_designation = {
	OR = {
		has_designation = col_generator
		has_designation = col_habitat_energy
		has_designation = col_ring_generator
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_energy
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Libra: Gestalt Age
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_libra_nanotech_generator
			"
			toggle = @libra_mod
		}
	}
}

has_industrial_designation = {
	OR = {
		has_designation = col_industrial
		has_designation = col_habitat_industrial
		has_designation = col_ecu_industrial
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_industrial
				has_designation = col_ring_industry
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# TimeMod
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_time_capital_manufacturing
				has_designation = col_timesingularity_capital_manufacturing
				has_designation = col_endless_time_capital_manufacturing
				has_designation = col_psionic_best_capital_manufacturing
				has_designation = col_psionic_capital_manufacturing
			"
			toggle = @timemod
		}
	}
}

has_mining_designation = {
	OR = {
		has_designation = col_habitat_mining
		has_designation = col_mining
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_mining
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Libra: Gestalt Age
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_libra_nanotech_mining
			"
			toggle = @libra_mod
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_mining
			"
			toggle = @has_nsc_freebooter_mod
		}
	}
}

has_refinery_designation = {
	OR = {
		has_designation = col_refinery
		has_designation = col_habitat_refinery
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_mining
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_refinery
				has_designation = col_city_refinery
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_refinery
			"
			toggle = @has_nsc_freebooter_mod
		}
		# TimeMod
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_gas_colony_capital_rare
				has_designation = col_gas_colony_capital_hive_rare
			"
			toggle = @timemod
		}
	}
}

has_research_designation = {
	OR = {
		has_designation = col_research
		has_designation = col_ring_research
		has_designation = col_habitat_research
		has_designation = col_ecu_research
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_dome_research
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Libra: Gestalt Age
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_libra_nanotech_research
			"
			toggle = @libra_mod
		}
		# Freebooters Origin (reborn)
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_habitat_nsc_freebooter_research
			"
			toggle = @has_nsc_freebooter_mod
		}
		# TimeMod
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_designation = col_time_capital_research
				has_designation = col_timesingularity_capital_research
				has_designation = col_endless_time_capital_research
				has_designation = col_psionic_best_capital_research
				has_designation = col_psionic_capital_research
				has_designation = col_nanites_capital_machine_research
			"
			toggle = @timemod
		}
	}
}

# has_unity_designation
# has_rural_designation
# has_trade_designation
