namespace = anomaly

ship_event = {
	id = anomaly.6715
	title = "anomaly.6715.name"
	desc = "anomaly.6715.desc"
	picture = GFX_evt_gray_gooed_planet
	show_sound = event_laboratory_sound
	is_triggered_only = yes
	specimen = ancient_nanites

	option = {
		name = anomaly.6715.a
		event_target:nanite_swarm_planet = {
			remove_modifier = nanite_swarm_modifier
			add_modifier = {
				modifier = tamed_nanite_swarm_modifier
				days = -1
			}
		}
		if = {
			limit = {
				owner_species = {
					OR = {
						has_trait = trait_mechanical
						has_trait = trait_machine_unit
						has_trait = trait_pc_habitat_preference
						has_trait = trait_pc_shattered_ring_habitable_preference
						# Gigastructural Engineering & More
						inline_script = {
							script = merger_of_rules/toggled_code
							code = "
								giga_has_artificial_preference_trait = yes
							"
							toggle = @has_guillis_planet_modifiers
						}
						# Voyage to Eternity
						inline_script = {
							script = merger_of_rules/toggled_code
							code = "
								OR = {
									has_trait = trait_pc_KZ_VOY_hyper_ecumenopolis_preference
									has_trait = trait_pc_KZ_VOY_astral_world_preference
									has_trait = trait_pc_KZ_VOY_astral_world_solaria_preference
									has_trait = trait_pc_KZ_VOY_luna_preference
									has_trait = trait_pc_KZ_VOY_terran_relic_preference
								}
							"
							toggle = @vte_mod
						}
					}
				}
			}
			event_target:nanite_swarm_planet = {
				change_pc = pc_gaia
				every_deposit = {
					limit = { is_blocker = yes }
					clear_blocker = yes
				}
			}
		}
		else = {
			event_target:nanite_swarm_planet = {
				change_pc = root.owner_species
				every_deposit = {
					limit = { is_blocker = yes }
					clear_blocker = yes
				}
			}
		}
	}
}
