namespace = crisis

# Planet Colonized
planet_event = {
	id = crisis.203
	hide_window = yes

	is_triggered_only = yes

	trigger = {
		owner = { is_country_type = "swarm" }
	}

	immediate = {
		every_owned_pop_group = { kill_all_pop = yes }
		if = {
			limit = {
				is_artificial = no
			}
			change_pc = pc_infested
			reset_planet = yes
			planet_event = { id = crisis.215 }
		}
		else_if = {
			# Habitable Ring Worlds can't be infested...
			# they are destroyed instead
			limit = {
				is_ringworld = yes
			}
			change_pc = pc_ringworld_habitable_damaged
			reset_planet = yes
		}
		
		####Adds Orbital Arcology to list of prethoryn infestation targets####
		else_if = {
			limit = {
				is_planet_class = pc_oeo_planetary_ringworld
			}
			change_pc = pc_oeo_planetary_ringworld_damaged
			reset_planet = yes
		}
		#####End of Edits####
		
		else_if = {
			limit = { is_planet_class = pc_habitat }
			spawn_habitat_cracker_effect = yes
		}
	}
}
