﻿# Compatibility helper surface. Some entries have no internal RC3 consumers but are retained
# as a stable scripted-trigger ABI for submods/compatibility patches; internal non-use alone
# is not sufficient evidence to delete a public script symbol.

asp_mod_active = { always = yes }

asp_dig_site_visible_trigger = {
	asp_is_default_empire = yes
	is_ai = no
	exists = from
	exists = from.planet
	exists = from.solar_system
	default_site_visible_trigger = yes
}

asp_is_general_planet = {
	OR = {
		habitable_planet = yes
		asp_is_uninhabitable = yes
	}
}

asp_is_aquatic = {
	is_wet = yes
	is_planet_class = pc_ocean
}

asp_is_continental = {
	is_wet = yes
	is_planet_class = pc_continental
}

asp_is_desertic = {
	is_dry = yes
	is_planet_class = pc_desert
}

asp_is_frozen = {
	OR = {
		is_planet_class = pc_frozen
		is_planet_class = pc_arctic
	}
}

asp_is_tundra = {
	is_planet_class = pc_tundra
}

asp_is_gas_giant = {
	is_planet_class = pc_gas_giant
}

asp_is_scientist_cautious = {
	OR = {
		has_trait = leader_trait_roamer
		has_trait = leader_trait_chosen
		has_trait = leader_trait_curator
		has_trait_tier1or2 = { TRAIT = leader_trait_paranoid }
		has_trait_tier1or2or3 = { TRAIT = leader_trait_slippery }
		has_trait_tier1or2or3 = { TRAIT = leader_trait_observant }
	}
}

asp_is_heavy_metal = {
	OR = {
		is_mechanical_empire = yes
		is_robot_empire = yes
	}
}

asp_is_uninhabitable = {
	OR = {
		uninhabitable_regular_planet = yes
		asp_is_frozen = yes
		asp_is_barren = yes
		asp_is_molten = yes
		asp_is_barren_cold = yes
		asp_is_toxic = yes
	}
}

asp_is_valid_system = {
	solar_system = {
		exists = star
		NOR = {
			has_star_flag = sealed_system
			has_star_flag = empire_cluster
			has_special_star_flag_trigger = yes
			is_fe_cluster = yes
			has_star_flag = drone_home_system
			any_system_planet = {
				OR = {
					exists = archaeological_site
					has_planet_flag = hatchling_egg
					has_planet_flag = suppress_archaeological_sites
				}
			}
		}
	}
}

asp_is_valid_alshigan_system = {
	solar_system = {
		exists = star
		NOR = {
			has_star_flag = sealed_system
			has_star_flag = empire_cluster
			has_special_star_flag_trigger = yes
			is_fe_cluster = yes
			has_star_flag = drone_home_system
			any_system_planet = {
				OR = {
					has_planet_flag = hatchling_egg
					has_planet_flag = suppress_archaeological_sites
				}
			}
		}
	}
}

asp_is_modern_age = {
	OR = {
		has_pre_ftl_age = industrial_age
		has_pre_ftl_age = machine_age
	}
}

asp_is_barren = {
	is_planet_class = pc_barren
}

asp_is_barren_cold = {
	is_planet_class = pc_barren_cold
}

asp_is_arctic = {
	is_planet_class = pc_arctic
}

asp_is_valid_moon = {
	AND = {
		asp_is_barren = yes
		is_moon = yes
		NOT = { has_planet_flag = has_megastructure }
		solar_system = {
			starting_system = no
		}
	}
}

asp_is_valid_colony = {
	AND = {
		is_colony = yes
		is_capital = no
		is_artificial = no
	}
}

asp_is_gaia = {
	is_planet_class = pc_gaia
}

asp_is_molten = {
	is_planet_class = pc_molten
}

asp_is_tropical = {
	is_planet_class = pc_tropical
}

asp_is_alpine = {
	is_planet_class = pc_alpine
}

asp_is_savannah = {
	is_planet_class = pc_savannah
}

asp_is_toxic = {
	is_planet_class = pc_toxic
}

asp_is_moon_of_gas_giant = {
	is_scope_type = planet
	exists = orbit
	OR = {
		orbit = { asp_is_gas_giant = yes }
		has_planet_flag = gas_giant_moon
	}
}

# Legacy public class-trigger aliases retained for submods that integrate ASP custom worlds.
aspmod_pc_nuked_colorful_trigger = {
	is_planet_class = pc_nuked_colorful
}

aspmod_pc_rainworld_trigger = {
	is_planet_class = pc_asp_rainworld
}

aspmod_pc_ocean_red_trigger = {
	is_planet_class = pc_asp_ocean_red
}

# The legacy aggregate accidentally ANDed all three mutually exclusive planet classes.
# The intended compatibility surface is "any ASP custom planet class".
aspmod_all_planet_classes_trigger = {
	OR = {
		aspmod_pc_nuked_colorful_trigger = yes
		aspmod_pc_rainworld_trigger = yes
		aspmod_pc_ocean_red_trigger = yes
	}
}

