# Vanilla scripted triggers from 01_scripted_triggers_jobs.txt

entertainer_job_check_trigger = {
	custom_tooltip = SPECIALIST_JOB_TRIGGER
	hidden_trigger = {
		exists = owner
		OR = {
			is_enslaved = no
			has_slavery_type = { type = slavery_domestic }
			# Expanded Traits, Civics, Pops, and More
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					AND = {
						has_slavery_type = { type = slavery_indentured }
						owner = { has_valid_civic = civic_indentured_assets }
					}
					AND = {
						has_utopia = no
						is_same_species = owner_main_species
						owner = { merg_is_slaver = yes }
					}
				"
				toggle = @expops_compatch_var
			}
		}
		is_being_purged = no
		is_being_assimilated = no
		NOR = {
			has_trait = trait_presapient_docile_livestock
			# Ethics and Civics Classic
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					has_ecc_slave_gene = yes
				"
				toggle = @has_ecc_cog
			}
			# Ethics and Civics Infinity
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					has_eci_flesh_components = yes
					has_eci_slave_gene = yes
				"
				toggle = @post_revolutionary_re_revolution_years
			}
		}
		# Rule out Traits for servitude & lack of free will
		NOR = {
			has_trait = trait_syncretic_proles
			can_think = no
		}
		OR = {
			NOT = { has_trait = trait_mechanical }
			owner = { has_technology = tech_droid_workers }
		}
		NOT = { has_citizenship_type = { type = citizenship_organic_trophy } }
		if = {
			limit = { divinity_right_to_work_job_check_trigger_exempt = no }
			divinity_right_to_work_job_check_trigger_specialist = yes
		}
		# Girls Frontline
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				NAND = {
					has_trait = GF_trait_doll
					owner = { has_policy_flag = GF_doll_right_low }
				}
			"
			toggle = @gf_compatch_var
		}
	}
}

can_fill_specialist_job_trigger = {
	inline_script = {
		script = merger_of_rules/toggled_code
		code = "
			if = {
				limit = {
					has_global_flag = eci_educated
					exists = owner
					owner = {
						OR = {
							has_valid_civic = civic_moth_chasing_flames
							has_valid_civic = civic_ruthless_competition
						}
					}
				}
				custom_tooltip = {
					text = POP_EDUCATED_LOW
					has_modifier = pop_highly_educated
				}
			}
		"
		toggle = @post_revolutionary_re_revolution_years
	}
	custom_tooltip = SPECIALIST_JOB_TRIGGER
	hidden_trigger = {
		exists = owner
		OR = {
			is_enslaved = no
			has_slavery_type = { type = slavery_indentured }
			# Expanded Traits, Civics, Pops, and More
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					AND = {
						has_utopia = no
						is_same_species = owner_main_species
						owner = { merg_is_slaver = yes }
					}
				"
				toggle = @expops_compatch_var
			}
			# Ethics and Civics Infinity
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					owner = { has_valid_civic = civic_du_contrat_social }
					owner = { has_valid_civic = civic_sparta_spirit }
				"
				toggle = @post_revolutionary_re_revolution_years
			}
		}
		is_being_purged = no
		is_being_assimilated = no
		NOR = {
			has_trait = trait_syncretic_proles
			can_think = no
		}
		NOR = {
			# Ethics and Civics Bug Branch
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					is_bugged_slave_gene = yes
				"
				toggle = @has_bug_branch
			}
			# Ethics and Civics Classic
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					has_ecc_slave_gene = yes
				"
				toggle = @has_ecc_cog
			}
			# Expanded Traits, Civics, Pops, and More
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					is_exp_tree_caretaker = yes
				"
				toggle = @expops_compatch_var
			}
			has_trait = trait_presapient_docile_livestock
			# Ethics and Civics Infinity
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					has_eci_fallen_god = yes
				"
				toggle = @post_revolutionary_re_revolution_years
			}
		}
		OR = {
			NOT = { has_trait = trait_mechanical }
			owner = { has_technology = tech_droid_workers }
			# Ethics and Civics Infinity
			inline_script = {
				script = merger_of_rules/toggled_code
				code = "
					AND = {
						has_eci_thl_doll = no
						owner = {
							has_technology = tech_droid_workers
						}
					}
				"
				toggle = @post_revolutionary_re_revolution_years
			}
		}
		NOT = { has_citizenship_type = { type = citizenship_organic_trophy } }
		if = {
			limit = { divinity_right_to_work_job_check_trigger_exempt = no }
			divinity_right_to_work_job_check_trigger_specialist = yes
		}
		# ECI
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				ethic_sparta_job_check_trigger = no
			"
			toggle = @post_revolutionary_re_revolution_years
		}
	}
}

is_organic_species = {
	custom_tooltip = {
		fail_text = not_organic
		species = {
			OR = {
				is_archetype = BIOLOGICAL
				is_archetype = LITHOID
				# Aquatic Portraits mod
				is_archetype = JAYPEES_AQUATIC
				is_archetype = JAYPEES_BRAIN
				is_archetype = JAYPEES_CRAB
				is_archetype = JAYPEES_DOLPHIN
				is_archetype = JAYPEES_DUMBO
				is_archetype = JAYPEES_ELESQUID
				is_archetype = JAYPEES_FISH
				is_archetype = JAYPEES_HAIRTENTACLE
				is_archetype = JAYPEES_SEAL
				is_archetype = JAYPEES_SQUID
				is_archetype = JAYPEES_TURTLEHORSE
				# AshArms Aquarius history
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = Dolls
					"
					toggle = @asharm_mod
				}
				# Assault Lily
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = LILY
					"
					toggle = @change_planet_size_bullet_num
				}
				# Azur Lane Stellaris DLC
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_KANSEN_species = yes
					"
					toggle = @azl_mod
				}
				# Empire of Eeveelution
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = POKEMON
					"
					toggle = @s7_EOE_cost
				}
				# Voyage to Eternity
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_KZ_VOY_organic_species = yes
					"
					toggle = @vte_mod
				}
				# SW:UnknownWorld Shipgirls Story
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = STARSHIPGIRLS
					"
					toggle = @swuss_mod
				}
				# Warship Girls R And MIST Species
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = WARSHIPGIRL
						is_archetype = SHENHAI
						is_archetype = UNITED_FLEET
					"
					toggle = @wsg_mod
				}
				# KDC Story Pack
				inline_script = {
					script = merger_of_rules/toggled_code
					code = "
						is_archetype = NANITES_CROP
					"
					toggle = @gray_t1_tech_days
				}
			}
		}
	}
}

has_sr_producing_job = {
	OR = {
		has_job = mote_harvester
		has_job = mote_harvesting_drone
		has_job = chemist
		has_job = chemist_drone
		has_job = gas_extractor
		has_job = gas_extraction_drone
		has_job = gas_refiner
		has_job = gas_refiner_drone
		has_job = crystal_miner
		has_job = crystal_mining_drone
		has_job = translucer
		has_job = translucer_drone
		# ACOT
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_job = acot_transmute_drone
			"
			toggle = @has_ancient_caches
		}
		# District Overhaul - FunEFork
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_job = 02_exotic_resource_collector
				has_job = 02_exotic_resource_collection_drone
				has_job = 02_siphon_pilot
				has_job = 02_siphon_pilot_drone
				has_job = 02_crystal_grower
				has_job = 02_crystal_growing_drone
			"
			toggle = @has_do3f_mod
		}
		# Extra Districts
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_any_habitat_district_job = yes
			"
			toggle = @is_ED_enabled
		}
	}
}

has_research_job = {
	OR = {
		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
		has_job = archaeoengineers
		has_job = archaeo_drone
		has_job = archaeo_unit
		has_job = munitions_decommissioner
		has_job = munitions_decommissioning_unit
		has_job = munitions_decommissioning_drone
		has_job = astral_researcher
		has_job = astral_drone
		has_job = astral_unit
		has_job = astrometeorologist
		has_job = astrometeorologist_hive
		has_job = astrometeorologist_machine
		# 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
		}
		# Additional Planetary Projects
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_job = epap_engineering_researcher
				has_job = epap_engineering_drone
				has_job = epap_engineering_calculator
				has_job = epap_physics_researcher
				has_job = epap_physics_drone
				has_job = epap_physics_calculator
				has_job = epap_society_researcher
				has_job = epap_society_drone
				has_job = epap_society_calculator
				has_job = epap_biology_researcher
				has_job = epap_biology_drone
				has_job = epap_biology_calculator
			"
			toggle = @has_epap_mod
		}
		# 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
		}
		# District Overhaul - FunEFork
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_job = 02_teacher
				has_job = 02_engineer
				has_job = 02_park_ranger
				has_job = 02_physicist
				has_job = 02_ecosystem_researcher
				has_job = 02_biolumen_researcher
				has_job = 02_technoorganic_researcher
				has_job = 02_engineering_drone
				has_job = 02_nature_research_drone
				has_job = 02_experimental_drone
				has_job = 02_ecosystem_researcher_drone
				has_job = 02_biolumen_researcher_drone
				has_job = 02_technoorganic_researcher_drone
				has_job = 02_dark_matter_researcher
				has_job = 02_dark_matter_brain_drone
			"
			toggle = @has_do3f_mod
		}
		# Ethics and Civics Infinity
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_job = magician
				has_job = legendary_mage
			"
			toggle = @post_revolutionary_re_revolution_years
		}
		# Extra Districts
		inline_script = {
			script = merger_of_rules/toggled_code
			code = "
				has_ED_research_job = yes
			"
			toggle = @is_ED_enabled
		}
		# 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
		}
	}
}
