namespace = colony

planet_event = {
	id = colony.50
	title = "colony.50.name"
	desc = {
		trigger = {
			NOT = {
				owner = { is_subterranean_empire = yes }
			}
		}
		text = "colony.50.desc"
	}
	desc = {
		trigger = {
			owner = { is_subterranean_empire = yes }
		}
		text = "colony.50.desc.subterranean"
	}

	picture = GFX_evt_in_the_dark
	show_sound = event_air_raid_siren
	location = ROOT
	trackable = yes

	pre_triggers = {
		is_ai = no
		has_owner = yes
		is_homeworld = no
		original_owner = yes
		has_ground_combat = no
		is_capital = no
		is_occupied_flag = no
	}

	trigger = {
		#owner = { NOT = { has_ethic = ethic_gestalt_consciousness } }
		num_pops > 0
		merg_is_standard_habitable = yes
		is_artificial = no
		NOR = {
			has_global_flag = seismic_disturbance_global
			has_planet_flag = colony_event
		}
		solar_system = { is_capital_system = no }
	}

	is_triggered_only = yes

	immediate = {
		owner = { save_event_target_as = subterranean_planet_owner }
		set_global_flag = seismic_disturbance_global
		set_planet_flag = seismic_disturbance
		set_planet_flag = colony_event
		add_deposit = d_underground_farm_blocked
		add_deposit = d_underground_mine_blocked
		add_deposit = d_underground_generator_blocked
		create_subterranean_nation = { FLAG = subterranean_nation }
	}

	option = {
		name = colony.50.a
		begin_event_chain = {
			event_chain = "subterranean_civilization_chain"
			target = ROOT
		}
		enable_special_project = {
			name = "SEISMIC_DISTURBANCE_1_PROJECT" #Establish Communications
			location = this
			owner = root
		}
		enable_special_project = {
			name = "SEISMIC_DISTURBANCE_2_PROJECT" #Preemptive Strike
			location = this
			owner = root
		}

	}
	option = {
		name = distar.216.a.exter
		exclusive_trigger = { owner = { is_homicidal = yes } }
		begin_event_chain = {
			event_chain = "subterranean_civilization_chain"
			target = ROOT
		}
		enable_special_project = {
			name = "SEISMIC_DISTURBANCE_2_PROJECT" #Preemptive Strike
			location = this
			owner = root
		}
	}
}
