############################
#
# Observation Post Events
#
# Written by Henrik Eklund
#
############################

namespace = observation

@tier1materialreward = 6
@tier1materialmin = 100
@tier1materialmax = 500
@tier2materialreward = 12
@tier2materialmin = 150
@tier2materialmax = 1000
@tier3materialreward = 18
@tier3materialmin = 250
@tier3materialmax = 1500
@tier4materialreward = 24
@tier4materialmin = 350
@tier4materialmax = 2000

@tier1influencereward = 6
@tier1influencemin = 40
@tier1influencemax = 100
@tier2influencereward = 12
@tier2influencemin = 80
@tier2influencemax = 175
@tier3influencereward = 18
@tier3influencemin = 125
@tier3influencemax = 250
@tier4influencereward = 24
@tier4influencemin = 150
@tier4influencemax = 300

@tier1researchreward = 6
@tier1researchmin = 60
@tier1researchmax = 150
@tier2researchreward = 12
@tier2researchmin = 90
@tier2researchmax = 250
@tier3researchreward = 18
@tier3researchmin = 120
@tier3researchmax = 350
@tier4researchreward = 24
@tier4researchmin = 150
@tier4researchmax = 500


### PASSIVE OBSERVATION ###

### Incoming Asteroid

# Incoming Asteroid (HIDDEN)
planet_event = {
	id = observation.1
	hide_window = yes
	
	trigger = {
		NOT = { has_global_flag = asteroid_sighted_prim_global }
		has_observation_outpost = yes
		observation_outpost = { has_mission = passive_observation }
		observation_outpost_owner = { is_ai = no }
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	immediate = {
		set_global_flag = asteroid_sighted_prim_global
		set_planet_flag = asteroid_sighted_prim_planet
		observation_outpost_owner = {
			country_event = { id = observation.2 }
			set_country_flag = asteroid_sighted_prim_country
		}
	}
}

# Incoming Asteroid
country_event = {
	id = observation.2
	title = "observation.2.name"
	desc = "observation.2.desc"
	picture = GFX_evt_asteroid_approaching_planet
	show_sound = event_red_alert
	location = FROM

	is_triggered_only = yes
	
	immediate = {
		create_country = {
			name = "Incoming Asteroid"
			type = faction
		}
		last_created_country = {
			create_fleet = { name = "Asteroid" }
			set_country_flag = incoming_asteroid_prim
			last_created_fleet = {
				set_owner = PREV
				set_fleet_flag = primitive_asteroid
				create_ship = {
					name = "Asteroid"
					design = "Asteroid"
				}
				set_location = {
					target = FROM
					distance = 75
					angle = random 
				}
				queue_actions = {
					move_to = FROM
					effect = {
						id = "observation.2.effect.1"
						ROOT = {
							random_list = {
								75 = { country_event = { id = observation.3 } }
								25 = { country_event = { id = observation.4 } }
							}
						}
						destroy_fleet = this
					}
				}
			}
		}
	}
	
	option = {
		name = "observation.2.a"
	}
}

# Asteroid Impacts!
country_event = {
	id = observation.3
	title = "observation.3.name"
	desc = "observation.3.desc"
	picture = GFX_evt_nuclear_explosion
	show_sound = event_super_explosion
	location = FROMFROM
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = {
			destroy_colony = yes
			change_pc = pc_barren
			remove_planet_flag = asteroid_sighted_prim_planet
		}
		remove_country_flag = asteroid_sighted_prim_country
		remove_global_flag = asteroid_sighted_prim_global
	}
	
	option = {
		name = "observation.3.a"
		FROMFROM = {
			observation_outpost = {
				dismantle = yes
			}
		}
	}
}

# Observation Outpost collides with Asteroid
country_event = {
	id = observation.4
	title = "observation.4.name"
	desc = "observation.4.desc"
	picture = GFX_evt_asteroid_approaching_planet
	show_sound = event_ship_explosion
	location = FROMFROM
	
	is_triggered_only = yes
	
	immediate = {
		remove_country_flag = asteroid_sighted_prim_country
		remove_global_flag = asteroid_sighted_prim_global
		FROMFROM = {
			remove_planet_flag = asteroid_sighted_prim_planet
		}
	}
	
	option = {
		name = "observation.4.a"
		FROMFROM = {
			observation_outpost = {
				dismantle = yes
			}
		}
	}
}

# Asteroid Destroyed (HIDDEN)
country_event = {
	id = observation.5
	hide_window = yes
	
	is_triggered_only = yes
	
	trigger = {
		exists = from
		FROM = { has_country_flag = incoming_asteroid_prim }
	}
	
	immediate = {
		random_country = {
			limit = { has_country_flag = asteroid_sighted_prim_country }
			country_event = { id = observation.6 }
		}
	}
}

# Asteroid Destroyed
country_event = {
	id = observation.6
	title = "observation.6.name"
	desc = "observation.6.desc"
	picture = GFX_evt_atmospheric_entry
	show_sound = event_ship_explosion
	location = ROOT
	
	is_triggered_only = yes
	
	immediate = {
		random_planet = {
			limit = { has_planet_flag = asteroid_sighted_prim_planet }
			save_event_target_as = asteroid_prim_planet
		}
		remove_global_flag = asteroid_sighted_prim_global
		remove_country_flag = asteroid_sighted_prim_country
		event_target:asteroid_prim_planet = {
			remove_planet_flag = asteroid_sighted_prim_planet
		}
	}
	
	option = {
		name = "observation.6.a"
		# Influence gain? Xenophile pop happiness bonus?
	}
}

### Rogue Scientist

# Missing Scientist (HIDDEN)
planet_event = {
	id = observation.10
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = passive_observation }
		observation_outpost_owner = {
			AND = { 
				NOT = { has_country_flag = rogue_scientist_chain }
				is_ai = no
			}
		}
		owner = {
			is_country_type = primitive
			OR = {
				has_country_flag = bronze_age
				has_country_flag = iron_age
				has_country_flag = late_medieval_age
				has_country_flag = renaissance_age
				has_country_flag = steam_age
			}
		}
		NOT = { has_planet_flag = missing_scientist_planet }
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	immediate = {
		observation_outpost_owner = {
			limit = { 
				is_ai = no
				NOT = { has_country_flag = rogue_scientist_chain }
			}
			country_event = { id = observation.11 }
		}
		set_planet_flag = missing_scientist_planet
	}
}

# Missing Scientist
country_event = {
	id = observation.11
	title = "observation.11.name"
	desc = "observation.11.desc"
	picture = GFX_evt_landing_ship
	show_sound = event_ship_thrusters
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.11.a"
		hidden_effect = {
			random_list = {
				25 = { country_event = { id = observation.12 days = 10 random = 5 } }
				75 = { 
					set_country_flag = captured_scientist_origin_1
					set_country_flag = rogue_scientist_chain
				}
			}
		}
	}
}

# Missing Scientist found Dead
country_event = {
	id = observation.12
	title = "observation.12.name"
	desc = "observation.12.desc"
	picture = GFX_evt_alien_nature
	show_sound = event_alien_nature
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.12.a"
		add_modifier = {
			modifier = missing_scientist
			days = 360
		}
	}
}

# Reports of a Cult (HIDDEN)
planet_event = {
	id = observation.14
	hide_window = yes
	
	trigger = {
		has_planet_flag = missing_scientist_planet
		owner = { is_country_type = primitive }
		has_observation_outpost = yes
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = missing_scientist_planet
		observation_outpost_owner = {
			country_event = { id = observation.15 }
		}
	}
}

# Reports of a Cult
country_event = {
	id = observation.15
	title = "observation.15.name"
	desc = "observation.15.desc"
	picture = GFX_evt_medieval_alien_civilization
	show_sound = event_primitive_civilization
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = CURIOUS
		hidden_effect = {
			FROM = { 
				set_planet_flag = cult_reported
				owner = {
					if = {
						limit = { has_country_flag = bronze_age }
						remove_country_flag = bronze_age
					}
					if = {
						limit = { has_country_flag = iron_age }
						remove_country_flag = iron_age
					}
					if = {
						limit = { has_country_flag = late_medieval_age }
						remove_country_flag = late_medieval_age
					}
					if = {
						limit = { has_country_flag = renaissance_age }
						remove_country_flag = renaissance_age
					}
					if = {
						limit = { has_country_flag = steam_age }
						remove_country_flag = steam_age
					}
					set_country_flag = industrial_age
					set_primitive_age = industrial_age
				}
			}
		}
	}
}

# Scientist Makes Himself Known (HIDDEN)
planet_event = {
	id = observation.16
	hide_window = yes
	
	trigger = {
		has_planet_flag = cult_reported
		owner = { is_country_type = primitive }
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = cult_reported
		set_planet_flag = scientist_revealed
		observation_outpost_owner = {
			limit = { has_country_flag = captured_scientist_origin_1 }
			country_event = { id = observation.17 }
		}
	}
}

# Scientist Makes Himself Known
country_event = {
	id = observation.17
	title = TRANSMISSION
	desc = "observation.17.desc"
	
	diplomatic = yes
	is_triggered_only = yes
	
	picture_event_data = {
		#portrait = GFX_portrait_human_female_01
		#planet_background = pc_arctic
		#background = GFX_evt_city_ruins
		#city_species = MAM
		#city_level = 1
	}
	
	option = {
		name = observation.17.a
		response_text = observation.17.a.response
		is_dialog_only = yes
	}
	option = {
		name = observation.17.b
		response_text = observation.17.b.response
		is_dialog_only = yes
	}
	option = {
		name = observation.17.c
		response_text = observation.17.c.response
	}
}

# Rogue Scientist Consolidates Power (HIDDEN)
planet_event = {
	id = observation.18
	hide_window = yes
	
	trigger = {
		has_planet_flag = scientist_revealed
		owner = { is_country_type = primitive }
		has_observation_outpost = yes
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = scientist_revealed
		observation_outpost_owner = {
			limit = { has_country_flag = captured_scientist_origin_1 }
			country_event = { id = observation.19 }
		}
	}
}

# Rogue Scientist Consolidates Power
country_event = {
	id = observation.19
	title = "observation.19.name"
	desc = "observation.19.desc"
	picture = GFX_evt_colony_settlement
	show_sound = event_planetary_riot
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		hidden_effect = {
			FROM = {
				owner = {
					remove_country_flag = industrial_age
					set_country_flag = machine_age
					set_primitive_age = machine_age
				}
			}
		}
	}
	
	option = { # Support Operation
		name = "observation.19.a"
		from = {
			enable_special_project = {
				name = "EXTRACT_ROGUE_SCIENTIST"
				location = this
				owner = root
			}
		}
	}
	option = { # Deny Operation
		name = "observation.19.b"
	}
}

# Successful Extraction
ship_event = {
	id = observation.20
	title = "observation.20.name"
	desc = "observation.20.desc"
	picture = GFX_evt_colony_settlement # CHANGE TO BURNING SETTLEMENT
	show_sound = event_ground_battle
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.20.a"
		hidden_effect = {
			FROMFROM = {
				random_list = {
					33 = { set_planet_flag = extraction_civil_war }
					33 = { set_planet_flag = extraction_regression }
					33 = { set_planet_flag = extraction_continued_development }
				}
			}
		}
	}
}

# Planet Descends into Civil War (HIDDEN)
planet_event = {
	id = observation.21
	hide_window = yes
	
	trigger = {
		has_planet_flag = extraction_civil_war
		owner = { is_country_type = primitive }
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = extraction_civil_war
		observation_outpost_owner = {
			limit = { has_country_flag = captured_scientist_origin_1 }
			country_event = { id = observation.22 }
		}
	}
}

# Planet Descends into Civil War
country_event = {
	id = observation.22
	title = "observation.22.name"
	desc = "observation.22.desc"
	picture = GFX_evt_city_ruins
	show_sound = event_ground_battle
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.22.a"
	}
}

# Planet Regresses (HIDDEN)
planet_event = {
	id = observation.23
	hide_window = yes
	
	trigger = {
		has_planet_flag = extraction_regression
		owner = { is_country_type = primitive }
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = extraction_regression
		observation_outpost_owner = {
			limit = { has_country_flag = captured_scientist_origin_1 }
			country_event = { id = observation.24 }
		}
	}
}

# Planet Regresses
country_event = {
	id = observation.24
	title = "observation.24.name"
	desc = "observation.24.desc"
	picture = GFX_evt_medieval_alien_civilization
	show_sound = event_primitive_civilization
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				remove_country_flag = machine_age
				random_list = {
					50 = { 
						set_country_flag = steam_age 
						set_primitive_age = steam_age
					}
					50 = { 
						set_country_flag = renaissance_age 
						set_primitive_age = renaissance_age
					}
				}
			}
		}
	}
	
	option = {
		name = "observation.24.a"
	}
}

# Observation Outpost Destroyed (Scientist Extracted) (HIDDEN)
planet_event = {
	id = observation.25
	hide_window = yes
	
	trigger = {
		has_planet_flag = extraction_continued_development
		owner = { is_country_type = primitive }
		has_observation_outpost = yes
		observation_outpost_owner = {
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 240
	}
	
	immediate = {
		remove_planet_flag = extraction_continued_development
		owner = { set_country_flag = extraction_teched_up }
		observation_outpost_owner = {
			limit = { has_country_flag = captured_scientist_origin_1 }
			country_event = { id = observation.26 }
		}
	}
}

# Observation Outpost Destroyed (Scientist Extracted) 
country_event = {
	id = observation.26
	title = "observation.26.name"
	desc = "observation.26.desc"
	picture = GFX_evt_exploding_ship
	show_sound = event_ship_explosion
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				country_event = { id = primitive.16 }
			}
		}
	}
	
	option = {
		name = "observation.26.a"
		hidden_effect = {
			remove_country_flag = captured_scientist_origin_1
			set_country_flag = extracted_holy_savior
		}
	}
}

# Aliens demand Holy Savior (HIDDEN)
country_event = {
	id = observation.27
	hide_window = yes
	
	trigger = {
		has_country_flag = extraction_teched_up
		is_primitive = no
	}
	
	mean_time_to_happen = {
		months = 24
	}
	
	immediate = {
		remove_country_flag = extraction_teched_up
		random_country = {
			limit = { has_country_flag = extracted_holy_savior }
			country_event = { id = observation.28 }
			remove_country_flag = extracted_holy_savior
		}
	}
}

# Aliens demand Holy Savior
country_event = {
	id = observation.28
	title = TRANSMISSION
	desc = "observation.28.desc"
	
	diplomatic = yes
	is_triggered_only = yes
	
	option = {
		name = observation.28.a
		response_text = observation.28.a.response
		is_dialog_only = yes
	}
	option = {
		name = observation.28.b
		response_text = observation.28.b.response
	}
	option = {
		name = observation.28.c
		response_text = observation.28.c.response
		hidden_effect = {
			country_event = { id = observation.29 days = 20 random = 10 }
		}
	}
}

# Holy Savior Returned
country_event = {
	id = observation.29
	title = TRANSMISSION
	desc = "observation.29.desc"
	
	diplomatic = yes
	is_triggered_only = yes
	
	option = {
		name = observation.29.a
	}
}

# Observation Outpost Destroyed (Scientist Not Extracted) 
country_event = {
	id = observation.30
	title = "observation.26.name"
	desc = "observation.30.desc"
	picture = GFX_evt_exploding_ship
	show_sound = event_ship_explosion
	location = FROMFROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				country_event = { id = primitive.16 }
			}
		}
	}
	
	option = {
		name = "DISCONCERTING"
	}
}

### Shuttle Intercepted Chain

# Shuttle Intercepted (HIDDEN)
planet_event = {
	id = observation.35
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = passive_observation }
		owner = {
			OR = {
				has_country_flag = machine_age
				has_country_flag = atomic_age 
				has_country_flag = early_space_age
			}
		}
		observation_outpost_owner = {
			is_ai = no
			NOT = { has_country_flag = primitive_shuttle_crash_1 }
		}
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	immediate = {
		observation_outpost_owner = {
			limit = { 
				is_ai = no
				NOT = { has_country_flag = primitive_shuttle_crash_1 }
			}
			country_event = { id = observation.36 }
		}
	}
}

# Shuttle Intercepted
country_event = {
	id = observation.36
	title = "observation.36.name"
	desc = "observation.36.desc"
	picture = GFX_evt_exploding_ship
	show_sound = event_ship_explosion
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.36.a"
		from = {
			enable_special_project = {
				name = "PRIMITIVE_SHUTTLE_CRASH"
				location = this
				owner = root
			}
		}
		hidden_effect = {
			set_country_flag = primitive_shuttle_crash_1
		}
	}
}

# Survivors Rescued
ship_event = {
	id = observation.37
	title = "observation.37.name"
	desc = "observation.37.desc"
	picture = GFX_evt_landing_ship
	show_sound = event_ship_thrusters
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = EXCELLENT
		owner = {
			add_monthly_resource_mult = {
				resource = society_research
				value = @tier2researchreward
				min = @tier2researchmin
				max = @tier2researchmax
			}
		}
	}
}

# Survivors Captured
country_event = {
	id = observation.38
	title = "observation.38.name"
	desc = "observation.38.desc"
	picture = GFX_evt_society_research
	show_sound = event_radio_chatter
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.38.a"
		hidden_effect = {
			FROMFROM = {
				set_planet_flag = scientist_captured_1
			}
			set_country_flag = captured_scientist_origin_1
		}
	}
}

# Shuttle Crash Triggers Nuclear War (HIDDEN)
planet_event = {
	id = observation.39
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		has_planet_flag = scientist_captured_1
		owner = {
			OR = {
				has_country_flag = atomic_age
				has_country_flag = early_space_age
			}
		}		
		observation_outpost_owner = {
			is_ai = no
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		remove_planet_flag = scientist_captured_1
		observation_outpost_owner = {
			limit = { 
				is_ai = no
				has_country_flag = captured_scientist_origin_1
			}
			remove_country_flag = captured_scientist_origin_1
			random_list = {
				33 = { country_event = { id = observation.40 } }
				33 = { country_event = { id = observation.41 } }
				33 = { country_event = { id = observation.42 } }
			}
		}
	}
}

# Nuclear War - Planet Regresses
country_event = {
	id = observation.40
	title = "observation.40.name"
	desc = "observation.40.desc"
	picture = GFX_evt_nuclear_explosion
	show_sound = event_super_explosion
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			change_pc = pc_nuked
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_bomb_crater" }
			random_tile = { set_blocker = "tb_city_ruins" }
			random_tile = { set_blocker = "tb_city_ruins" }
			set_planet_flag = primitives_nuked_themselves
			owner = {
				if = {
					limit = { has_country_flag = atomic_age }
					remove_country_flag = atomic_age
					random_list = {
						33 = { 
							set_country_flag = bronze_age 
							set_primitive_age = bronze_age
						}
						33 = { 
							set_country_flag = iron_age 
							set_primitive_age = iron_age
						}
						33 = { 
							set_country_flag = late_medieval_age
							set_primitive_age = late_medieval_age
						}
					}
				}
				if = {
					limit = { has_country_flag = early_space_age }
					remove_country_flag = early_space_age
					random_list = {
						33 = { 
							set_country_flag = bronze_age 
							set_primitive_age = bronze_age
						}
						33 = { 
							set_country_flag = iron_age
							set_primitive_age = iron_age
						}
						33 = { 
							set_country_flag = late_medieval_age
							set_primitive_age = late_medieval_age
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "observation.40.a"
	}
}

# Nuclear War - Planet Depopulated
country_event = {
	id = observation.41
	title = "primitive.131.name"
	desc = "observation.41.desc"
	picture = GFX_evt_nuclear_explosion
	show_sound = event_super_explosion
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			destroy_colony = yes
			set_planet_flag = primitives_nuked_themselves
			change_pc = pc_nuked
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_bomb_crater" }
			random_tile = { set_blocker = "tb_bomb_crater" }
			random_tile = { set_blocker = "tb_city_ruins" }
			random_tile = { set_blocker = "tb_city_ruins" }
		}
	}
	
	option = {
		name = "observation.41.a"
		FROM = {
			observation_outpost = {
				dismantle = yes
			}
		}
	}
}

# Nuclear War - Planet Uninhabitable
country_event = {
	id = observation.42
	title = "primitive.131.name"
	desc = "observation.42.desc"
	picture = GFX_evt_nuclear_explosion
	show_sound = event_super_explosion
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			destroy_colony = yes
			change_pc = pc_toxic
			add_modifier = {
				modifier = "nuclear_devastation"
				days = -1
			}
		}
	}
	
	option = {
		name = "observation.42.a"
		FROM = {
			observation_outpost = {
				dismantle = yes
			}
		}
	}
}

# Instruments of War (HIDDEN)
planet_event = {
	id = observation.43
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		has_planet_flag = scientist_captured_1
		observation_outpost_owner = {
			is_ai = no
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		remove_planet_flag = scientist_captured_1
		observation_outpost_owner = {
			limit = { 
				is_ai = no
				has_country_flag = captured_scientist_origin_1
			}
			remove_country_flag = captured_scientist_origin_1
			country_event = { id = observation.44 }
		}
	}
}

# New Weapons
country_event = {
	id = observation.44
	title = "observation.44.name"
	desc = "observation.44.desc"
	picture = GFX_evt_satellite_in_orbit ### Should use ground combat event picture
	show_sound = event_ground_battle
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.44.a"
		FROM = {
			owner = {
				custom_tooltip = acquired_tech_tooltip
				set_country_flag = acquired_tech
			}
		}
	}
}

# Hostage Deal (HIDDEN)
planet_event = {
	id = observation.45
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		has_planet_flag = scientist_captured_1
		observation_outpost_owner = {
			is_ai = no
			has_country_flag = captured_scientist_origin_1
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		remove_planet_flag = scientist_captured_1
		observation_outpost_owner = {
			limit = { 
				is_ai = no
				has_country_flag = captured_scientist_origin_1
			}
			remove_country_flag = captured_scientist_origin_1
			country_event = { id = observation.46 }
		}
	}
}

# Hostage Deal
country_event = {
	id = observation.46
	title = "observation.46.name"
	desc = "observation.46.desc"
	picture = GFX_evt_satellite_in_orbit
	show_sound = event_radio_chatter
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.46.a"
		trigger = {
			influence > 199.99
		}
		add_influence = -150
		FROM = {
			owner = {
				custom_tooltip = acquired_tech_tooltip
				hidden_effect = { set_country_flag = acquired_tech }
			}
		}
	}
	option = {
		name = "observation.46.a"
		trigger = {
			NOT = { influence > 199.99 }
		}
		add_influence = -75
		FROM = {
			owner = {
				custom_tooltip = acquired_tech_tooltip
				hidden_effect = { set_country_flag = acquired_tech }
			}
		}
	}
	option = {
		name = "observation.46.b"
		hidden_effect = {
			country_event = { id = observation.47 days = 20 random = 10 }
		}
	}
}

# Hostages Executed
country_event = {
	id = observation.47
	title = "observation.47.name"
	desc = "observation.47.desc"
	picture = GFX_evt_throne_room
	show_sound = event_planetary_riot
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.47.a"
		#add_influence = -100
	}
}

### Smuggler Outpost

# Smuggler Outpost (HIDDEN)
planet_event = {
	id = observation.50
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = passive_observation }
		observation_outpost_owner = { is_ai = no }
		NOT = { has_planet_flag = smuggler_outpost }
		# PRIMITIVES SHOULD NOT BE TOO ADVANCED
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	immediate = {
		set_planet_flag = smuggler_outpost
		observation_outpost_owner = {
			country_event = { id = observation.51 }
		}
	}
}

# Smuggler Outpost
country_event = {
	id = observation.51
	title = "observation.51.name"
	desc = "observation.51.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.51.a"
		from = {
			enable_special_project = {
				name = "SMUGGLER_RAID_PROJECT"
				location = this
				owner = root
			}
		}
	}
}

# Raid on Smugglers
ship_event = {
	id = observation.52
	title = "observation.52.name"
	desc = "observation.52.desc"
	picture = GFX_evt_colony_settlement ## Change to ground battle picture?
	show_sound = event_ground_battle
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.52.a"
		owner = {
			add_monthly_resource_mult = {
				resource = energy
				value = @tier2materialreward
				min = @tier2materialmin
				max = @tier2materialmax
			}
			add_monthly_resource_mult = {
				resource = minerals
				value = @tier2materialreward
				min = @tier2materialmin
				max = @tier2materialmax
			}
		}
	}
}

# Smuggler Weapons Trade
country_event = {
	id = observation.53
	title = "observation.53.name"
	desc = "observation.53.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_planetary_riot ## Change to burning settlement or ground battle?
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.53.a"
		# Can be expanded
	}
}

### AGGRESSIVE OBSERVATION ###

### Scientist Abduction (HIDDEN)
planet_event = {
	id = observation.1000
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = scientist_abduction
						}
					}
				}
			}
			OR = {
				has_country_flag = industrial_age
				has_country_flag = machine_age
				has_country_flag = atomic_age 
				has_country_flag = early_space_age
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1001 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = scientist_abduction
			}
		}
	}
}

# Scientist Abduction
country_event = {
	id = observation.1001
	title = "observation.1001.name"
	desc = "observation.1001.desc"
	picture = GFX_evt_physics_research
	show_sound = event_administrative_work
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1001.a"
		from = {
			enable_special_project = {
				name = "ABDUCT_SCIENTIST_PROJECT"
				location = this
				owner = root
			}
		}
	}
	option = {
		name = "observation.1001.b"
	}
}

# Abduction Successful
ship_event = {
	id = observation.1002
	title = "observation.1002.name"
	desc = "observation.1002.desc"
	picture = GFX_evt_society_research
	show_sound = event_ship_thrusters
	location = FROMFROM

	is_triggered_only = yes
	
	immediate = {
		FROMFROM = {
			owner = {
				owner_species = { save_event_target_as = primitive_species }
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		owner = {
			create_leader = {
				type = scientist
				species = event_target:primitive_species
				name = "Sobak"
				skill = 4000
				traits = {
					trait = leader_trait_spark_of_genius
				}
			}
		}
	}
}

# Abduction Failed
ship_event = {
	id = observation.1003
	title = "observation.1003.name"
	desc = "observation.1003.desc"
	picture = GFX_evt_colony_settlement
	show_sound = event_ship_thrusters
	location = FROMFROMFROM

	is_triggered_only = yes
	
	option = {
		name = "UNFORTUNATE"
	}
}

### Brain Implants (HIDDEN)
planet_event = {
	id = observation.1010
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = brain_implants
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1011 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = brain_implants
			}
		}
	}
}

# Brain Implants
country_event = {
	id = observation.1011
	title = "observation.1011.name"
	desc = "observation.1011.desc"
	picture = GFX_evt_cybernetics
	show_sound = event_laboratory_sound
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1011.a"
		from = {
			enable_special_project = {
				name = "IMPLANT_MALFUNCTIONS_PROJECT"
				location = this
				owner = root
			}
		}
	}
}

# Implants Removed
ship_event = {
	id = observation.1012
	title = "observation.1012.name"
	desc = "observation.1012.desc"
	picture = GFX_evt_society_research
	show_sound = event_laboratory_sound
	location = FROMFROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1012.a"
		owner = {
			add_monthly_resource_mult = {
				resource = society_research
				value = @tier2researchreward
				min = @tier2researchmin
				max = @tier2researchmax
			}
		}
	}
}

# Implants Not Removed in Time
country_event = {
	id = observation.1013
	title = "observation.1013.name"
	desc = "observation.1013.desc"
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = FROMFROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1013.a"
	}
}

### Defense Force (HIDDEN)
planet_event = {
	id = observation.1020
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force
						}
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force_gone
						}
					}
				}
			}
			OR = {
				has_country_flag = industrial_age
				has_country_flag = machine_age
				has_country_flag = atomic_age 
				has_country_flag = early_space_age
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1021 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force
			}
		}
	}
}

# Defense Force
country_event = {
	id = observation.1021
	title = "observation.1021.name"
	desc = "observation.1021.desc"
	picture = GFX_evt_galactic_senate
	show_sound = event_radio_chatter_02
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "DISCONCERTING"
	}
}

# Interceptions (HIDDEN)
planet_event = {
	id = observation.1022
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force
					}
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force_intercepts
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1023 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force_intercepts
			}
		}
	}
}

# Interceptions
country_event = {
	id = observation.1023
	title = "observation.1023.name"
	desc = "observation.1023.desc"
	picture = GFX_evt_colony_settlement
	show_sound = event_air_raid_siren
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1023.a"
	}
}

# Observation Post Lost (HIDDEN)
planet_event = {
	id = observation.1024
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force
					}
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force_intercepts
					}
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force_obs_post_los
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1025 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force_obs_post_los
			}
		}
		observation_outpost = {
			dismantle = yes
		}
	}
}

# Observation Post Lost
country_event = {
	id = observation.1025
	title = "observation.1025.name"
	desc = "observation.1025.desc"
	picture = GFX_evt_exploding_ship
	show_sound = event_ship_explosion
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1025.a"
	}
}

# Strike (HIDDEN)
planet_event = {
	id = observation.1026
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force
					}
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force_intercepts
					}
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force_obs_strike
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1027 }
			set_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force_obs_strike
			}
		}
	}
}

# Strike
country_event = {
	id = observation.1027
	title = "observation.1027.name"
	desc = "observation.1027.desc"
	picture = GFX_evt_hangar_bay
	show_sound = event_radio_chatter
	location = FROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1027.a"
		from = {
			enable_special_project = {
				name = "DEFENSE_FORCE_STRIKE_PROJECT"
				location = this
				owner = root
			}
		}
	}
	option = {
		name = "observation.1027.b"
	}
}

# Strike Successful
ship_event = {
	id = observation.1028
	title = "observation.1028.name"
	desc = "observation.1028.desc"
	picture = GFX_evt_burning_settlement
	show_sound = event_ground_battle
	location = FROMFROM

	is_triggered_only = yes
	
	immediate = {
		FROMFROM = {
			owner = { save_event_target_as = prim_civ }
		}
		owner = {
			set_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force_gone
			}
			remove_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force
			}
			remove_relation_flag = {
				who = event_target:prim_civ
				flag = defense_force_intercepts
			}
		}
	}
	
	option = {
		name = "observation.1028.a"
	}
}

# Strike Failed
ship_event = {
	id = observation.1029
	title = "observation.1029.name"
	desc = "observation.1029.desc"
	picture = GFX_evt_ground_combat
	show_sound = event_ground_battle
	location = FROMFROM

	is_triggered_only = yes
	
	option = {
		name = "observation.1029.a"
	}
}

# Disbanded (HIDDEN)
planet_event = {
	id = observation.1030
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			ROOT = {
				observation_outpost_owner = { 
					is_ai = no
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force
					}
					has_relation_flag = {
						who = PREVPREV
						flag = defense_force_intercepts
					}
					NOT = {
						has_relation_flag = {
							who = PREVPREV
							flag = defense_force_obs_strike
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		owner = { save_event_target_as = prim_civ }
		observation_outpost_owner = {
			country_event = { id = observation.1031 }
			#remove_relation_flag = {
			#	who = from
			#	flag = ransomeer_relation
			#}
		}
	}
}

# Disbanded
country_event = {
	id = observation.1031
	title = "observation.1031.name"
	desc = "observation.1031.desc"
	picture = GFX_evt_galactic_senate
	show_sound = event_conversation
	location = FROM

	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = { save_event_target_as = prim_civ }
		}
		set_relation_flag = {
			who = event_target:prim_civ
			flag = defense_force_gone
		}
		remove_relation_flag = {
			who = event_target:prim_civ
			flag = defense_force
		}
		remove_relation_flag = {
			who = event_target:prim_civ
			flag = defense_force_intercepts
		}
	}
	
	option = {
		name = "observation.1031.a"
	}
}

# Loses Xenophile (HIDDEN)
planet_event = {
	id = observation.1032
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = { 
			OR = {
				has_ethic = "ethic_xenophile"
				has_ethic = "ethic_fanatic_xenophile"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.1033 }
		}
	}
}

# Loses Xenophile
country_event = {
	id = observation.1033
	title = "observation.1033.name"
	desc = "observation.1033.desc"
	picture = GFX_evt_society_research
	show_sound = event_conversation
	location = FROM

	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_xenophile" }
					country_remove_ethic = "ethic_xenophile"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_xenophile" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_xenophile" }
					country_remove_ethic = "ethic_fanatic_xenophile"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_xenophile" }
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
	}
}

# Gains Xenophobe (HIDDEN)
planet_event = {
	id = observation.1034
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			NOT = {
				has_ethic = "ethic_xenophile"
				has_ethic = "ethic_fanatic_xenophile"
				has_ethic = "ethic_xenophobe"
				has_ethic = "ethic_fanatic_xenophobe"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.1035 }
		}
	}
}

# Gains Xenophobe
country_event = {
	id = observation.1035
	title = "observation.1033.name"
	desc = "observation.1035.desc"
	picture = GFX_evt_society_research
	show_sound = event_conversation
	location = FROM

	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				random_list = {
					50 = { 
						country_add_ethic = "ethic_xenophobe"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_xenophobe" }
						}
					}
					50 = {
						country_add_ethic = "ethic_fanatic_xenophobe"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_xenophobe" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
	}
}

# Gains Spiritualist (HIDDEN)
planet_event = {
	id = observation.1036
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = specimen_collection }
		owner = {
			NOT = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.1037 }
		}
	}
}

# Gains Spiritualist
country_event = {
	id = observation.1037
	title = "observation.1033.name"
	desc = "observation.1037.desc"
	picture = GFX_evt_society_research
	show_sound = event_conversation
	location = FROM

	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				random_list = {
					50 = { 
						country_add_ethic = "ethic_spiritualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_spiritualist" }
						}
					}
					50 = {
						country_add_ethic = "ethic_fanatic_spiritualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_spiritualist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
	}
}

### TECHNOLOGICAL ENLIGHTENMENT ###

# Enlightenment Completed
country_event = {
	id = observation.2000
	title = "observation.2000.name"
	desc = "observation.2000.desc"
	picture = GFX_evt_metropolis
	show_sound = event_laboratory_sound
	location = FROMFROM
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = {
			observation_outpost = {
				dismantle = yes
			}
			owner = {
				switch = {
					trigger = has_country_flag
					bronze_age = { remove_country_flag = bronze_age }
					iron_age = { remove_country_flag = iron_age }
					late_medieval_age = { remove_country_flag = late_medieval_age }
					renaissance_age = { remove_country_flag = renaissance_age }
					steam_age = { remove_country_flag = steam_age }
					industrial_age = { remove_country_flag = industrial_age }
					machine_age = { remove_country_flag = machine_age }
					atomic_age = { remove_country_flag = atomic_age }
				}
				set_country_flag = early_space_age
				country_event = { id = primitive.16 }
				set_subject_of = {
					who = root
					subject_type = vassal
				}
			}
		}
	}
	
	option = {
		name = "observation.2000.a"
	}
}

# Xenophobe Primitives (HIDDEN)
planet_event = {
	id = observation.2010
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = {
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_xenophobe"
				has_ethic = "ethic_fanatic_xenophobe"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = xenophobe_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.7
			owner = { has_ethic = "ethic_fanatic_xenophobe" }
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2011 }
		}
	}
}

# Xenophobe Primitives
country_event = {
	id = observation.2011
	title = "observation.2011.name"
	desc = "observation.2011.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = xenophobe_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Xenophile Primitives (HIDDEN)
planet_event = {
	id = observation.2012
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_xenophile"
				has_ethic = "ethic_fanatic_xenophile"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = xenophile_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.7
			owner = { has_ethic = "ethic_fanatic_xenophile" }
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2013 }
		}
	}
}

# Xenophile Primitives
country_event = {
	id = observation.2013
	title = "observation.2013.name"
	desc = "observation.2013.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = 0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = xenophile_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = 0.2 }
			}
		}
	}
}

# Quick Learning Primitives (HIDDEN)
planet_event = {
	id = observation.2014
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = { has_trait = trait_quick_learners }
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = quick_learners_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2015 }
		}
	}
}

# Quick Learning Primitives
country_event = {
	id = observation.2015
	title = "observation.2013.name"
	desc = "observation.2015.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = 0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = quick_learners_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = 0.2 }
			}
		}
	}
}

# Slow Learning Primitives (HIDDEN)
planet_event = {
	id = observation.2016
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = { has_trait = trait_slow_learners }
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = slow_learners_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2017 }
		}
	}
}

# Slow Learning Primitives
country_event = {
	id = observation.2017
	title = "observation.2011.name"
	desc = "observation.2017.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = slow_learners_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Repugnant Primitives (HIDDEN)
planet_event = {
	id = observation.2018
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = { has_trait = trait_repugnant }
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = repugnant_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2019 }
		}
	}
}

# Repugnant Primitives
country_event = {
	id = observation.2019
	title = "observation.2011.name"
	desc = "observation.2019.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = repugnant_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Natural Scientist Primitives (HIDDEN)
planet_event = {
	id = observation.2020
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = { 
			OR = {
				has_trait = trait_natural_engineers
				has_trait = trait_natural_physicists
				has_trait = trait_natural_sociologists
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = natural_scientist_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2021 }
		}
	}
}

# Natural Scientist Primitives
country_event = {
	id = observation.2021
	title = "observation.2013.name"
	desc = "observation.2021.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = 0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = natural_scientist_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = 0.2 }
			}
		}
	}
}

# Intelligent Primitives (HIDDEN)
planet_event = {
	id = observation.2022
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = { 
			OR = { has_trait = trait_intelligent }
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = intelligent_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2023 }
		}
	}
}

# Intelligent Primitives
country_event = {
	id = observation.2023
	title = "observation.2013.name"
	desc = "observation.2023.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = 0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = intelligent_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = 0.2 }
			}
		}
	}
}

# Loses Xenophobe (HIDDEN)
planet_event = {
	id = observation.2030
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			OR = {
				has_ethic = "ethic_xenophobe"
				has_ethic = "ethic_fanatic_xenophobe"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 1.3
			owner = { has_ethic = "ethic_fanatic_xenophobe" }
		}
		modifier = {
			factor = 0.7
			observation_outpost_owner = {
				OR = {
					has_ethic = "ethic_xenophile"
					has_ethic = "ethic_fanatic_xenophile"
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2031 }
		}
	}
}

# Loses Xenophobe
country_event = {
	id = observation.2031
	title = "observation.2031.name"
	desc = "observation.2031.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_xenophobe" }
					country_remove_ethic = "ethic_xenophobe"
					FROM = {
						every_owned_pop = {
							limit = { has_ethic = "ethic_xenophobe" }
							pop_remove_ethic = "ethic_xenophobe"
						}
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_xenophobe" }
					country_remove_ethic = "ethic_fanatic_xenophobe"
					FROM = {
						every_owned_pop = {
							limit = { has_ethic = "ethic_fanatic_xenophobe" }
							pop_remove_ethic = "ethic_fanatic_xenophobe"
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "EXCELLENT"
		tooltip = {
			FROM = {
				owner = {
					country_remove_ethic = "ethic_xenophobe"
					country_remove_ethic = "ethic_fanatic_xenophobe"
				}	
			}
		}
	}
}

# Gains Xenophile (HIDDEN)
planet_event = {
	id = observation.2032
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_xenophobe"
					has_ethic = "ethic_fanatic_xenophobe"
					has_ethic = "ethic_xenophile"
					has_ethic = "ethic_fanatic_xenophile"
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 1.4
			observation_outpost_owner = { has_ethic = "ethic_fanatic_xenophobe" }
		}
		modifier = {
			factor = 1.2
			observation_outpost_owner = { has_ethic = "ethic_xenophobe" }
		}
		modifier = {
			factor = 0.7
			observation_outpost_owner = {
				OR = {
					has_ethic = "ethic_xenophile"
					has_ethic = "ethic_fanatic_xenophile"
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2033 }
		}
	}
}

# Gains Xenophile
country_event = {
	id = observation.2033
	title = "observation.2031.name"
	desc = "observation.2033.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				random_list = {
					75 = { 
						country_add_ethic = "ethic_xenophile"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_xenophile" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_xenophile"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_xenophile" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_xenophile" }
						country_add_ethic = "ethic_xenophile"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_xenophile" }
						country_add_ethic = "ethic_fanatic_xenophile"
					}
				}
			}
		}
	}
}

# Gains Pacifist (HIDDEN)
planet_event = {
	id = observation.2034
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_pacifist"
					has_ethic = "ethic_fanatic_pacifist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_pacifist"
				has_ethic = "ethic_fanatic_pacifist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_militarist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_militarist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_pacifist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_militarist"
							has_ethic = "ethic_militarist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2035 }
		}
	}
}

# Gains Pacifist
country_event = {
	id = observation.2035
	title = "observation.2031.name"
	desc = "observation.2035.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_militarist" }
					country_remove_ethic = "ethic_militarist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_militarist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_militarist" }
					country_remove_ethic = "ethic_fanatic_militarist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_militarist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_pacifist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_pacifist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_pacifist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_pacifist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_pacifist" }
						country_add_ethic = "ethic_pacifist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_pacifist" }
						country_add_ethic = "ethic_fanatic_pacifist"
					}
				}
			}
		}
	}
}

# Gains Militarist (HIDDEN)
planet_event = {
	id = observation.2036
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_militarist"
					has_ethic = "ethic_fanatic_militarist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_militarist"
				has_ethic = "ethic_fanatic_militarist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_pacifist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_pacifist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_militarist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_pacifist"
							has_ethic = "ethic_pacifist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2037 }
		}
	}
}

# Gains Militarist
country_event = {
	id = observation.2037
	title = "observation.2031.name"
	desc = "observation.2037.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_pacifist" }
					country_remove_ethic = "ethic_pacifist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_pacifist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_pacifist" }
					country_remove_ethic = "ethic_fanatic_pacifist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_pacifist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_militarist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_militarist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_militarist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_militarist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_militarist" }
						country_add_ethic = "ethic_militarist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_militarist" }
						country_add_ethic = "ethic_fanatic_militarist"
					}
				}
			}
		}
	}
}

# Gains Collectivist (HIDDEN)
planet_event = {
	id = observation.2038
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_collectivist"
					has_ethic = "ethic_fanatic_collectivist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_collectivist"
				has_ethic = "ethic_fanatic_collectivist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_individualist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_individualist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_collectivist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_individualist"
							has_ethic = "ethic_individualist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2039 }
		}
	}
}

# Gains Collectivist
country_event = {
	id = observation.2039
	title = "observation.2031.name"
	desc = "observation.2039.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_individualist" }
					country_remove_ethic = "ethic_individualist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_individualist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_individualist" }
					country_remove_ethic = "ethic_fanatic_individualist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_individualist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_collectivist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_collectivist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_collectivist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_collectivist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_collectivist" }
						country_add_ethic = "ethic_collectivist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_collectivist" }
						country_add_ethic = "ethic_fanatic_collectivist"
					}
				}
			}
		}
	}
}

# Gains Individualist (HIDDEN)
planet_event = {
	id = observation.2040
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_individualist"
					has_ethic = "ethic_fanatic_individualist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_individualist"
				has_ethic = "ethic_fanatic_individualist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_collectivist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_collectivist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_individualist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_collectivist"
							has_ethic = "ethic_collectivist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2041 }
		}
	}
}

# Gains Individualist
country_event = {
	id = observation.2041
	title = "observation.2031.name"
	desc = "observation.2041.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_collectivist" }
					country_remove_ethic = "ethic_collectivist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_collectivist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_collectivist" }
					country_remove_ethic = "ethic_fanatic_collectivist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_collectivist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_individualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_individualist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_individualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_individualist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_individualist" }
						country_add_ethic = "ethic_individualist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_individualist" }
						country_add_ethic = "ethic_fanatic_individualist"
					}
				}
			}
		}
	}
}

# Gains Materialist (HIDDEN)
planet_event = {
	id = observation.2042
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_materialist"
					has_ethic = "ethic_fanatic_materialist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_spiritualist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_spiritualist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_materialist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_spiritualist"
							has_ethic = "ethic_spiritualist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2043 }
		}
	}
}

# Gains Materialist
country_event = {
	id = observation.2043
	title = "observation.2031.name"
	desc = "observation.2043.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_spiritualist" }
					country_remove_ethic = "ethic_spiritualist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_spiritualist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_spiritualist" }
					country_remove_ethic = "ethic_fanatic_spiritualist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_spiritualist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_materialist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_materialist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_materialist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_materialist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_materialist" }
						country_add_ethic = "ethic_materialist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_materialist" }
						country_add_ethic = "ethic_fanatic_materialist"
					}
				}
			}
		}
	}
}

# Gains Spiritualist (HIDDEN)
planet_event = {
	id = observation.2044
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.5
		}
		owner = { 
			NOT = {
				OR = {
					has_ethic = "ethic_spiritualist"
					has_ethic = "ethic_fanatic_spiritualist"
				}
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 2
			owner = { has_ethic = "ethic_fanatic_materialist" }
		}
		modifier = {
			factor = 1.6
			owner = { has_ethic = "ethic_materialist" }
		}
		modifier = {
			factor = 0.7
			AND = {
				observation_outpost_owner = { has_ethic = "ethic_fanatic_spiritualist" }
				owner = {
					NOT = {
						OR = { 
							has_ethic = "ethic_fanatic_materialist"
							has_ethic = "ethic_materialist"
						}
					}
				}
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2045 }
		}
	}
}

# Gains Spiritualist
country_event = {
	id = observation.2045
	title = "observation.2031.name"
	desc = "observation.2045.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			owner = {
				if = {
					limit = { has_ethic = "ethic_materialist" }
					country_remove_ethic = "ethic_materialist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_materialist" }
					}
				}
				if = {
					limit = { has_ethic = "ethic_fanatic_materialist" }
					country_remove_ethic = "ethic_fanatic_materialist"
					FROM = {
						every_owned_pop = { pop_remove_ethic = "ethic_fanatic_materialist" }
					}
				}
				random_list = {
					75 = { 
						country_add_ethic = "ethic_spiritualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_spiritualist" }
						}
					}
					25 = {
						country_add_ethic = "ethic_fanatic_spiritualist"
						FROM = {
							every_owned_pop = { pop_add_ethic = "ethic_fanatic_spiritualist" }
						}
					}
				}
			}
		}
	}
	
	option = {
		name = "INTERESTING"
		tooltip = {
			FROM = {
				owner = {
					if = {
						limit = { has_ethic = "ethic_spiritualist" }
						country_add_ethic = "ethic_spiritualist"
					}
					if = {
						limit = { has_ethic = "ethic_fanatic_spiritualist" }
						country_add_ethic = "ethic_fanatic_spiritualist"
					}
				}
			}
		}
	}
}

# Pacifists enlightening Militarists (HIDDEN)
planet_event = {
	id = observation.2050
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_militarist"
				has_ethic = "ethic_fanatic_militarist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_pacifist"
				has_ethic = "ethic_fanatic_pacifist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = pac_vs_mil_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_militarist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_militarist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_pacifist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2051 }
		}
	}
}

# Pacifists enlightening Militarists
country_event = {
	id = observation.2051
	title = "observation.2011.name"
	desc = "observation.2051.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = pac_vs_mil_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Militarists enlightening Pacifists (HIDDEN)
planet_event = {
	id = observation.2052
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_pacifist"
				has_ethic = "ethic_fanatic_pacifist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_militarist"
				has_ethic = "ethic_fanatic_militarist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = mil_vs_pac_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_pacifist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_pacifist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_militarist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2053 }
		}
	}
}

# Pacifists enlightening Militarists
country_event = {
	id = observation.2053
	title = "observation.2011.name"
	desc = "observation.2053.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = mil_vs_pac_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Materialists enlightening Spiritualists (HIDDEN)
planet_event = {
	id = observation.2054
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = mat_vs_spi_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_spiritualist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_spiritualist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_materialist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2055 }
		}
	}
}

# Materialists enlightening Spiritualists
country_event = {
	id = observation.2055
	title = "observation.2011.name"
	desc = "observation.2055.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = mat_vs_spi_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Spiritualist enlightening Materialist (HIDDEN)
planet_event = {
	id = observation.2056
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = spi_vs_mat_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_materialist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_materialist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_spiritualist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2057 }
		}
	}
}

# Spiritualist enlightening Materialist
country_event = {
	id = observation.2057
	title = "observation.2011.name"
	desc = "observation.2057.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = spi_vs_mat_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Individualist enlightening Collectivist (HIDDEN)
planet_event = {
	id = observation.2058
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_collectivist"
				has_ethic = "ethic_fanatic_collectivist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_individualist"
				has_ethic = "ethic_fanatic_individualist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = ind_vs_col_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_collectivist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_collectivist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_individualist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2059 }
		}
	}
}

# Individualist enlightening Collectivist
country_event = {
	id = observation.2059
	title = "observation.2011.name"
	desc = "observation.2059.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = ind_vs_col_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Collectivist enlightening Individualist (HIDDEN)
planet_event = {
	id = observation.2060
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			OR = {
				has_mission = technological_enlightenment_1
				has_mission = technological_enlightenment_2
				has_mission = technological_enlightenment_3
				has_mission = technological_enlightenment_4
				has_mission = technological_enlightenment_5
				has_mission = technological_enlightenment_6
				has_mission = technological_enlightenment_7
				has_mission = technological_enlightenment_8
				has_mission = technological_enlightenment_9
			}
			mission_progress > 0.2
		}
		owner = {
			OR = {
				has_ethic = "ethic_individualist"
				has_ethic = "ethic_fanatic_individualist"
			}
		}
		observation_outpost_owner = {
			OR = {
				has_ethic = "ethic_collectivist"
				has_ethic = "ethic_fanatic_collectivist"
			}
		}
		NOT = {
			observation_outpost_owner = {
				ROOT = {
					owner = {
						has_relation_flag = {
							who = PREVPREV
							flag = col_vs_ind_enlightenment
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 720 # NEEDS TWEAK
		
		modifier = {
			factor = 0.8
			owner = { has_ethic = "ethic_fanatic_individualist" }
		}
		modifier = {
			factor = 0.6
			AND = {
				owner = { has_ethic = "ethic_fanatic_individualist" }
				observation_outpost_owner = { has_ethic = "ethic_fanatic_collectivist" }
			}
		}
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.2061 }
		}
	}
}

# Collectivist enlightening Individualist
country_event = {
	id = observation.2061
	title = "observation.2011.name"
	desc = "observation.2061.desc"
	picture = GFX_evt_physics_research
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
			owner = {
				set_relation_flag = {
					who = ROOT
					flag = col_vs_ind_enlightenment
				}
			}
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

### COVERT INFILTRATION

### Progress Events

# Phase I (HIDDEN)
planet_event = {
	id = observation.3000
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			has_mission = covert_infiltration
			mission_progress > 0.25
		}
		NOT = {
			owner = {
				ROOT = {
					observation_outpost_owner = { 
						has_relation_flag = {
							who = PREVPREV
							flag = infiltration_phase_1
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		owner = { save_event_target_as = primitive_civ }
		observation_outpost_owner = {
			set_relation_flag = {
				who = event_target:primitive_civ
				flag = infiltration_phase_1
			}
			random_list = {
				50 = { 
					country_event = { id = observation.3001 }
				}
				50 = {
					country_event = { id = observation.3002 }
				}
			}
		}
	}
}

# Phase I (GOOD PROGRESS)
country_event = {
	id = observation.3001
	title = "observation.3001.name"
	desc = "observation.3001.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
	}
	
	option = {
		name = "EXCELLENT"
	}
}

# Phase I (POOR PROGRESS)
country_event = {
	id = observation.3002
	title = "observation.3001.name"
	desc = "observation.3002.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Phase II (HIDDEN)
planet_event = {
	id = observation.3003
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			has_mission = covert_infiltration
			mission_progress > 0.5
		}
		NOT = {
			owner = {
				ROOT = {
					observation_outpost_owner = { 
						has_relation_flag = {
							who = PREVPREV
							flag = infiltration_phase_2
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		owner = { save_event_target_as = primitive_civ }
		observation_outpost_owner = {
			set_relation_flag = {
				who = event_target:primitive_civ
				flag = infiltration_phase_2
			}
			random_list = {
				50 = { 
					country_event = { id = observation.3004 }
				}
				50 = {
					country_event = { id = observation.3005 }
				}
			}
		}
	}
}

# Phase II (GOOD PROGRESS)
country_event = {
	id = observation.3004
	title = "observation.3004.name"
	desc = "observation.3004.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
	}
	
	option = {
		name = "EXCELLENT"
	}
}

# Phase II (POOR PROGRESS)
country_event = {
	id = observation.3005
	title = "observation.3004.name"
	desc = "observation.3005.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Phase III (HIDDEN)
planet_event = {
	id = observation.3006
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			has_mission = covert_infiltration
			mission_progress > 0.75
		}
		NOT = {
			owner = {
				ROOT = {
					observation_outpost_owner = { 
						has_relation_flag = {
							who = PREVPREV
							flag = infiltration_phase_3
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		days = 1
	}
	
	immediate = {
		owner = { save_event_target_as = primitive_civ }
		observation_outpost_owner = {
			set_relation_flag = {
				who = event_target:primitive_civ
				flag = infiltration_phase_3
			}
			random_list = {
				50 = { 
					country_event = { id = observation.3007 }
				}
				50 = {
					country_event = { id = observation.3008 }
				}
			}
		}
	}
}

# Phase III (GOOD PROGRESS)
country_event = {
	id = observation.3007
	title = "observation.3007.name"
	desc = "observation.3007.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
	}
	
	option = {
		name = "EXCELLENT"
	}
}

# Phase III (POOR PROGRESS)
country_event = {
	id = observation.3008
	title = "observation.3007.name"
	desc = "observation.3008.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "UNFORTUNATE"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Phase IV - Mission Complete
country_event = {
	id = observation.3009
	title = "observation.3009.name"
	desc = "observation.3009.desc"
	picture = GFX_evt_metropolis
	show_sound = event_cityscape ### Celebration sound?
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROMFROM = {
			owner = { save_event_target_as = primitive_civ }
			random_pop = { save_event_target_as = prim_species }
			observation_outpost = { dismantle = yes }
			set_owner = ROOT
			every_planet_army = {
				remove_army = yes
			}
			create_army = {
				name = random
				owner = ROOT
				species = owner_main_species
				type = "defense_army"
			}
			random_tile = {
				limit = { has_blocker = no has_building = no }
				set_building = "building_power_plant_1"
				random_neighboring_tile = {
					limit = { has_blocker = no has_building = no }
					set_building = "building_power_plant_1"
				}
			}
			random_tile = {
				limit = { has_blocker = no has_building = no }
				set_building = "building_capital_1"
				random_neighboring_tile = {
					limit = { has_blocker = no has_building = no }
					set_building = "building_hydroponics_farm_1"
				}
			}
			event_target:primitive_civ = { destroy_country = yes }
		}
	}
	
	option = {
		name = "observation.3009.a"
	}
}

### Rogue Agent

# Rogue Agent (HIDDEN)
planet_event = {
	id = observation.3100
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			has_mission = covert_infiltration
			mission_progress > 0.2
		}
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_agent }
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	immediate = {
		observation_outpost_owner = {
			set_country_flag = observation_rogue_agent
			country_event = { id = observation.3101 }
		}
	}
}

# Rogue Agent
country_event = {
	id = observation.3101
	title = "observation.3101.name"
	desc = "observation.3101.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "observation.3101.a"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Incoming Transmission (HIDDEN)
planet_event = {
	id = observation.3102
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = covert_infiltration }
		observation_outpost_owner = { has_country_flag = observation_rogue_agent }
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_transmission }
		}
	}
	
	mean_time_to_happen = {
		months = 30
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.3103 }
			set_country_flag = observation_rogue_transmission
		}
	}
}

# Incoming Transmission
country_event = {
	id = observation.3103
	title = "observation.3103.name"
	desc = "observation.3103.desc"
	picture = GFX_evt_satellite_in_orbit
	show_sound = event_radio_chatter
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "ONSCREEN"
		country_event = { id = observation.3104 }
	}
}

# Transmission
country_event = {
	id = observation.3104
	title = "TRANSMISSION"
	desc = "observation.3104.desc"
	
	diplomatic = yes
	
	picture_event_data = {
		room = no_video_feed_room
	}
	
	is_triggered_only = yes
	
	option = {
		name = "observation.3104.a"
		response_text = "observation.3104.a.response"
		is_dialog_only = yes
	}
	option = {
		name = "observation.3104.b"
		response_text = "observation.3104.b.response"
		is_dialog_only = yes
	}
	option = {
		name = "observation.3104.c"
		response_text = "observation.3104.c.response"
		hidden_effect = {
			set_country_flag = observation_rogue_active
		}
	}
}

# Operatives Hunted (HIDDEN)
planet_event = {
	id = observation.3105
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = covert_infiltration }
		observation_outpost_owner = { has_country_flag = observation_rogue_active }
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_active_1 }
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.3106 }
			set_country_flag = observation_rogue_active_1
		}
	}
}

# Operatives Hunted
country_event = {
	id = observation.3106
	title = "observation.3106.name"
	desc = "observation.3106.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_radio_chatter
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "observation.3106.a"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Media Witchhunt (HIDDEN)
planet_event = {
	id = observation.3107
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = covert_infiltration }
		observation_outpost_owner = { has_country_flag = observation_rogue_active }
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_active_2 }
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.3108 }
			set_country_flag = observation_rogue_active_2
		}
	}
}

# Media Witchhunt
country_event = {
	id = observation.3108
	title = "observation.3108.name"
	desc = "observation.3108.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_radio_chatter
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "observation.3108.a"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Mass Arrests (HIDDEN)
planet_event = {
	id = observation.3109
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = covert_infiltration }
		observation_outpost_owner = { has_country_flag = observation_rogue_active }
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_active_3 }
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.3110 }
			set_country_flag = observation_rogue_active_3
		}
	}
}

# Mass Arrests
country_event = {
	id = observation.3110
	title = "observation.3110.name"
	desc = "observation.3110.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_radio_chatter
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "observation.3110.a"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
	}
}

# Agent Sighted (HIDDEN)
planet_event = {
	id = observation.3111
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { has_mission = covert_infiltration }
		observation_outpost_owner = { has_country_flag = observation_rogue_active }
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_rogue_sighted }
		}
	}
	
	mean_time_to_happen = {
		months = 60
	}
	
	immediate = {
		observation_outpost_owner = {
			country_event = { id = observation.3112 }
			set_country_flag = observation_rogue_sighted
		}
	}
}

# Agent Sighted
country_event = {
	id = observation.3112
	title = "observation.3112.name"
	desc = "observation.3112.desc"
	picture = colony_settlement
	show_sound = event_conversation
	location = FROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.3112.a"
		from = {
			enable_special_project = {
				name = "ROGUE_BOMBARDMENT_PROJECT"
				location = this
				owner = root
			}
		}
	}
	option = {
		name = "observation.3112.b"
	}
}

# Agent Lost
country_event = {
	id = observation.3113
	title = "observation.3113.name"
	desc = "observation.3113.desc"
	picture = GFX_evt_smugglers_in_bar
	show_sound = event_radio_chatter
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.3113.a"
	}
}

# Agent Eliminated
ship_event = {
	id = observation.3114
	title = "observation.3114.name"
	desc = "observation.3114.desc"
	picture = GFX_evt_burning_settlement
	show_sound = event_space_battle
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "observation.3114.a"
		owner = { remove_country_flag = observation_rogue_active }
	}
}

### War Triggered

# Prelude to War (HIDDEN)
planet_event = {
	id = observation.3130
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		observation_outpost = { 
			has_mission = covert_infiltration
			mission_progress > 0.3
		}
		owner = {
			OR = {
				has_country_flag = atomic_age
				has_country_flag = early_space_age
			}
		}
		NOT = {
			owner = {
				ROOT = {
					observation_outpost_owner = { 
						has_relation_flag = {
							who = PREVPREV
							flag = infiltration_war
						}
					}
				}
			}
		}
	}
	
	mean_time_to_happen = {
		months = 120
	}
	
	immediate = {
		owner = { save_event_target_as = primitive_civ }
		observation_outpost_owner = {
			set_relation_flag = {
				who = event_target:primitive_civ
				flag = infiltration_war
			}
			country_event = { id = observation.3131 }
		}
	}
}

# Prelude to War
country_event = {
	id = observation.3131
	title = "observation.3131.name"
	desc = "observation.3131.desc"
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = FROM
	
	is_triggered_only = yes
	
	immediate = {
		FROM = {
			observation_outpost = { add_mission_progress = -0.2 }
		}
	}
	
	option = {
		name = "observation.3101.a"
		tooltip = {
			FROM = {
				observation_outpost = { add_mission_progress = -0.2 }
			}
		}
		from = {
			enable_special_project = {
				name = "AVERT_PRIMITIVE_WAR_PROJECT"
				location = this
				owner = root
			}
		}
	}
}

# War Erupts
country_event = {
	id = observation.3132
	title = "observation.3132.name"
	desc = "observation.3132.desc"
	picture = GFX_evt_nuclear_explosion
	show_sound = event_air_raid_siren
	location = FROMFROM
	
	is_triggered_only = yes
	
	immediate = {
		FROMFROM = {
			destroy_colony = yes
			set_planet_flag = primitives_nuked_themselves
			change_pc = pc_nuked
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_radioactive_wasteland" }
			random_tile = { set_blocker = "tb_bomb_crater" }
			random_tile = { set_blocker = "tb_bomb_crater" }
			random_tile = { set_blocker = "tb_city_ruins" }
			random_tile = { set_blocker = "tb_city_ruins" }
		}
	}
	
	option = {
		name = "observation.3132.a"
		FROMFROM = {
			observation_outpost = {
				dismantle = yes
			}
		}
	}
}

# War Averted
ship_event = {
	id = observation.3133
	title = "observation.3133.name"
	desc = "observation.3133.desc"
	picture = GFX_evt_galactic_senate
	show_sound = event_conversation
	location = FROMFROM
	
	is_triggered_only = yes
	
	option = {
		name = "EXCELLENT"
		fromfrom = {
			observation_outpost = { add_mission_progress = 0.2 }
		}
	}
}

### Aliens did it!
#Hidden trigger event
planet_event = {
	id = observation.3134
	hide_window = yes
	
	trigger = {
		has_observation_outpost = yes
		OR = {
			observation_outpost = { has_mission = passive_observation }
			observation_outpost = { has_mission = specimen_collection }	
		}	
		NOT = {
			observation_outpost_owner = { has_country_flag = observation_pyramid }
		}
		owner = {
			is_country_type = primitive
			OR = {
				has_country_flag = bronze_age
				has_country_flag = iron_age
				has_country_flag = late_medieval_age
				has_country_flag = renaissance_age
			}
		}
		NOT = {
			any_tile = {
				has_building = "building_great_pyramid"
			}
		}
		any_tile = {
			has_grown_pop = yes
		}
	}
	
	mean_time_to_happen = {
		months = 5000
	}
	
	immediate = {
		random_tile = {
			limit = { has_grown_pop = yes }
			set_building = "building_great_pyramid"
		}	
		observation_outpost_owner = {
			set_country_flag = observation_pyramid
			country_event = { id = observation.3135 }
		}
		set_planet_flag = pyramid_observer_planet
		observation_outpost = {
			save_event_target_as = PyramidPlanetsObservationOutpost
		}
	}
}
#First event
country_event = {
	id = observation.3135
	title = "observation.3135.name"
	desc = {
		trigger = {
			hidden:event_target:ObservationOutpost = {
				switch = {
					trigger = has_mission
					passive_observation = { text = observation.3135.desc.passive }
					specimen_collection = { text = observation.3135.desc.aggressive }
					covert_infiltration = { text = observation.3135.desc.covert }
					default = { text = observation.3135.desc.enlighten }
				}
			}
		}
	}
	picture = GFX_evt_alien_cavemen
	show_sound = event_primitive_civilization
	location = FROM
	
	is_triggered_only = yes

	trigger = {
		from = {
			has_orbital_station = yes
			observation_outpost_owner = {
				is_same_value = root
			}
		}
	}

	immediate = {
		from = {
			observation_outpost = {
				save_event_target_as = ObservationOutpost
			}
		}
	}

	option = {
		name = "observation.3135.a"
		custom_tooltip = observation.3135.a.tooltip
		trigger = {
			NOT = {
				event_target:ObservationOutpost = {
					has_mission = specimen_collection
					has_mission = technological_enlightenment_1
					has_mission = technological_enlightenment_2
					has_mission = technological_enlightenment_3
					has_mission = technological_enlightenment_4
					has_mission = technological_enlightenment_5
					has_mission = technological_enlightenment_6
					has_mission = technological_enlightenment_7
					has_mission = technological_enlightenment_8
					has_mission = technological_enlightenment_9
				}
			}
		}
		from = {
			observation_outpost = {
				dismantle = yes
			}
		}
		hidden_effect = {
			from = {
				owner = {
					if = {
						limit = {
							has_country_flag = iron_age
						}
						remove_country_flag = iron_age
						set_country_flag = bronze_age
						set_primitive_age = bronze_age
					}
					if = {
						limit = {
							has_country_flag = late_medieval_age
						}
						remove_country_flag = late_medieval_age
						set_country_flag = iron_age
						set_primitive_age = iron_age
					}
					if = {
						limit = {
							has_country_flag = renaissance_age
						}
						remove_country_flag = renaissance_age
						set_country_flag = late_medieval_age
						set_primitive_age = late_medieval_age
					}
					if = {
						limit = {
							has_country_flag = steam_age
						}
						remove_country_flag = steam_age
						set_country_flag = renaissance_age
						set_primitive_age = renaissance_age
					}
				}
			}
		}
	}
	option = {
		name = "observation.3135.b"
		custom_tooltip = observation.3135.b.tooltip
		trigger = {
			NOT = {
				has_policy_flag = interference_passive
				event_target:ObservationOutpost = {
					has_mission = covert_infiltration
				}
			}
		}
		hidden_effect = {
			random_list = {
				50 = { country_event = { id = observation.3136 days = 60 } }
				50 = {  }
			}
			from = {
				owner = {
					if = {
						limit = {
							has_country_flag = renaissance_age
						}
						remove_country_flag = renaissance_age
						set_country_flag = steam_age
						set_primitive_age = steam_age
					}
					if = {
						limit = {
							has_country_flag = late_medieval_age
						}
						remove_country_flag = late_medieval_age
						set_country_flag = renaissance_age
						set_primitive_age = renaissance_age
					}
					if = {
						limit = {
							has_country_flag = iron_age
						}
						remove_country_flag = iron_age
						set_country_flag = late_medieval_age
						set_primitive_age = late_medieval_age
					}
					if = {
						limit = {
							has_country_flag = bronze_age
						}
						remove_country_flag = bronze_age
						set_country_flag = iron_age
						set_primitive_age = iron_age
					}
				}
			}
		}
	}
	option = {
		name = "observation.3135.c"
		custom_tooltip = observation.3135.c.tooltip
		trigger = {
			OR = {
				has_policy_flag = first_contact_attack_allowed
				NOT = {
					has_policy_flag = interference_passive
				}
			}
			NOT = {
				has_ethic = ethic_fanatic_pacifist
				has_ethic = ethic_pacifist
			}
		}
		hidden_effect = {
			from = {
				random_tile = {
					limit = {
						has_building = building_great_pyramid
					}
					set_ruined = yes
				}
				random_pop = {
					kill_pop = yes
				}
			}
		}
	}
	option = {
		name = "observation.3135.d"
		custom_tooltip = observation.3135.d.tooltip
		trigger = {
			OR = {
				has_policy_flag = interference_passive
				NOT = {
					has_policy_flag = first_contact_attack_allowed
				}
			}
			OR = {
				has_ethic = ethic_fanatic_pacifist
				has_ethic = ethic_pacifist
			}
		}
		hidden_effect = {
			random_list = {
				60 = { country_event = { id = observation.3136 days = 90 } }
				40 = { country_event = { id = observation.3137 days = 90 } }
			}
		}
	}
}
#Bad results
country_event = {
	id = observation.3136
	title = "observation.3135.name"
	desc = observation.3136.desc
	picture = GFX_evt_burning_settlement
	show_sound = event_planetary_riot
	location = FROMFROM
	
	is_triggered_only = yes

	trigger = {
		fromfrom = {
			has_orbital_station = yes
			observation_outpost_owner = {
				is_same_value = root
			}
		}
	}

	option = {
		name = "CURSES"
		custom_tooltip = observation.3136.a.tooltip
		trigger = {
			fromfrom = {
				count_pops = {
					count > 3
				}
			}
		}
		add_influence = -50
		hidden_effect = {
			fromfrom = {
				add_modifier = {
					modifier = pyramid_wars
					days = 720
				}
				random_tile = {
					limit = {
						has_building = no
						has_blocker = no
					}
					set_building = "building_great_pyramid"
				}
				random_pop = {
					kill_pop = yes
				}
				random_pop = {
					kill_pop = yes
				}
			}
		}
	}
	option = {
		name = "CURSES"
		custom_tooltip = observation.3136.b.tooltip
		trigger = {
			fromfrom = {
				OR = {
					count_pops = {
						count = 3
					}
					count_pops = {
						count = 2
					}
				}
			}
		}
		add_influence = -50
		hidden_effect = {
			fromfrom = {
				add_modifier = {
					modifier = pyramid_wars
					days = 720
				}
				random_tile = {
					limit = {
						has_building = no
					}
					set_building = building_great_pyramid
				}
				random_pop = {
					kill_pop = yes
				}
			}
		}
	}
	option = {
		name = "CURSES"
		custom_tooltip = observation.3136.c.tooltip
		trigger = {
			fromfrom = {
				count_pops = {
					count = 1
				}
			}
		}
		add_influence = -50
		hidden_effect = {
			fromfrom = {
				add_modifier = {
					modifier = pyramid_wars
					days = 720
				}
				random_tile = {
					limit = {
						has_building = no
					}
					set_building = building_great_pyramid
				}
			}
		}
	}
}
#Good results
country_event = {
	id = observation.3137
	title = "observation.3135.name"
	desc = observation.3137.desc
	picture = GFX_evt_medieval_alien_civilization
	show_sound = event_administrative_work
	location = FROMFROM
	
	is_triggered_only = yes

	trigger = {
		fromfrom = {
			has_orbital_station = yes
			observation_outpost_owner = {
				is_same_value = root
			}
		}
	}

	option = {
		name = "observation.3137.a"
		add_monthly_resource_mult = {
			resource = influence
			value = @tier2influencereward
			min = @tier2influencemin
			max = @tier2influencemax
		}
		if = {
			limit = {
				fromfrom = {
					observation_outpost = {
						OR = {
							has_mission = technological_enlightenment_1
							has_mission = technological_enlightenment_2
							has_mission = technological_enlightenment_3
							has_mission = technological_enlightenment_4
							has_mission = technological_enlightenment_5
							has_mission = technological_enlightenment_6
							has_mission = technological_enlightenment_7
							has_mission = technological_enlightenment_8
							has_mission = technological_enlightenment_9
							has_mission = covert_infiltration
						}
					}
				}
			}
			fromfrom = { observation_outpost = { add_mission_progress = 0.3 } }
			else = {
				add_monthly_resource_mult = {
					resource = society_research
					value = @tier2researchreward
					min = @tier2researchmin
					max = @tier2researchmax
				}
			}
		}
	}
}