# Yeet the Sphere, Win the Game
special_project = {
	key = "COSMOGENESIS_VICTORY"
	event_chain = cosmogenesis_planet_pickup_chain
	days_to_research = 360
	tech_department = physics_technology
	timelimit = -1
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_scanning_beam.dds"

	event_scope = ship_event

	requirements = {
		size_requirement = {
			ship_size = monadic_qerr
			count = 1
		}
	}

	on_success = {
		from = {
			country_event = { id = crisis.7515 days = 1 }
		}
		solar_system = {
			set_star_flag = cosmogenesis_project
		}
	}
}

special_project = {
	key = "COSMOGENESIS_LEAKING_ATMOSPHERE"
	days_to_research = 360
	tech_department = physics_technology
	timelimit = -1
	location = yes
	picture = GFX_evt_gray_gooed_planet
	icon = "gfx/interface/icons/situation_log/situation_log_planet.dds"

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	on_success = {
		from = {
			remove_modifier = leaking_atmosphere
		}
	}
}

special_project = {
	key = "COLD_METAL_PROJECT"
	cost = 1000
	tech_department = society_technology
	timelimit = -1
	picture = GFX_evt_frozen
	icon = "gfx/interface/icons/situation_log/situation_log_ai.dds"

	event_scope = country_event

	requirements = {
	}

	on_success = {
		country_event = { id = cyber.835 }
	}
}

# Investigate The Storm 1
special_project = {
	key = "THE_SYNTH_QUEENS_STORM"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = 10000
	tech_department = physics_technology
	location = no

	event_scope = country_event

	requirements = {}

	on_success = {
		owner = {
			country_event = { id = crisis.9100 }
		}
	}

	abort_trigger = {
		has_country_flag = synth_queen_researched_first_storm_project
		has_global_flag = synth_queen_war_started
	}
}

# Investigate The Storm 2
special_project = {
	key = "THE_SYNTH_QUEENS_STORM_2"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = {
		base = 50000
		modifier = {
			subtract = 25000
			has_tradition = tr_nanotech_adopt
			desc = "UPGRADE_FLAGSHIP_EMPTY"
		}
	}
	tech_department = physics_technology
	location = no

	event_scope = country_event

	on_progress_50 = {
		country_event = { id = crisis.9105 }
	}

	on_success = {
		country_event = { id = crisis.9110 }
	}

	abort_trigger = {
		has_global_flag = synth_queen_war_started
	}
}

# The Queen's Databank
special_project = {
	key = "THE_SYNTH_QUEENS_DATABANK"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 1800
	sound = yes
	location = yes
	timelimit = 900

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	abort_trigger = {
		has_global_flag = synth_queen_war_started
	}

	on_success = {
		owner = {
			country_event = { id = crisis.8085 }
		}
	}

	on_fail = {
		owner = {
			country_event = { id = crisis.8130 }
			set_country_flag = rebellious_child
			set_country_flag = synth_queen_did_not_get_the_box_in_time
		}
	}
}

# The Queen's Databank Countdown to Destruction
special_project = {
	key = "THE_SYNTH_QUEENS_DATABANK_COUNTDOWN"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 1800
	sound = yes
	location = yes
	timelimit = 540

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	abort_trigger = {
		has_global_flag = synth_queen_war_started
	}

	on_success = {
		owner = {
			country_event = { id = crisis.8110 }
		}
	}

	on_fail = {
		owner = {
		 	country_event = { id = crisis.8125 }
		}
	}
}

# History Investigations
special_project = {
	key = "THE_SYNTH_QUEENS_INVESTIGATION"
	event_chain = "the_synth_queen_history_chain"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_radar.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 300
	sound = no
	location = yes
	timelimit = -1

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
	}

	on_success = {
		if = {
			limit = {
				from = {
					has_planet_flag = synth_queen_history_site_1
				}
			}
			ship_event = { id = crisis.20100 }
		}
		else_if = {
			limit = {
				from = {
					has_planet_flag = synth_queen_history_site_2
				}
			}
			ship_event = { id = crisis.20200 }
		}
		else_if = {
			limit = {
				from = {
					has_planet_flag = synth_queen_history_site_3
				}
			}
			ship_event = { id = crisis.20300 }
		}
		else_if = {
			limit = {
				from = {
					has_planet_flag = synth_queen_history_site_4
				}
			}
			ship_event = { id = crisis.20500 }
		}
		else = {
			ship_event = { id = crisis.20600 }
		}
	}

	# AI will start investigating faster on higher difficulties
	AI_wait_days = {
		weight = 90
		modifier = {
			mult = 0
			is_difficulty = 5
		}
		modifier = {
			mult = 1
			is_difficulty = 4
		}
		modifier = {
			mult = 2
			is_difficulty = 3
		}
		modifier = {
			mult = 3
			is_difficulty = 2
		}
		modifier = {
			mult = 4
			is_difficulty = 1
		}
		modifier = {
			mult = 5
			is_difficulty = 0
		}
	}
}

special_project = {
	key = "THE_SYNTH_QUEENS_INVESTIGATION_FAKE"
	event_chain = "the_synth_queen_history_chain"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_radar.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 300
	sound = no
	location = yes
	timelimit = -1

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
	}

	on_success = {
		ship_event = { id = crisis.20600 }
	}

	# AI will start investigating faster on higher difficulties
	AI_wait_days = {
		weight = 90
		modifier = {
			mult = 0
			is_difficulty = 5
		}
		modifier = {
			mult = 1
			is_difficulty = 4
		}
		modifier = {
			mult = 2
			is_difficulty = 3
		}
		modifier = {
			mult = 3
			is_difficulty = 2
		}
		modifier = {
			mult = 4
			is_difficulty = 1
		}
		modifier = {
			mult = 5
			is_difficulty = 0
		}
	}
}

special_project = {
	key = "THE_SYNTH_QUEENS_INVESTIGATION_PARAGON"
	picture = GFX_evt_star_chart
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 300
	sound = no
	location = yes
	timelimit = -1

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
	}

	on_success = {
		ship_event = { id = crisis.20400 }
	}
}

special_project = {
	key = "THE_SYNTH_QUEENS_OUTPOST_AMBUSH"
	event_chain = "the_synth_queen_raids_chain"
	picture = GFX_evt_guardians
	icon = "gfx/interface/icons/situation_log/situation_log_combat.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 1
	sound = yes
	location = yes

	event_scope = ship_event

	requirements = {
		fleet_power >= 50000
	}

	abort_trigger = {
		owner = {
			has_global_flag = synth_queen_war_started
		}
	}

	on_success = {
		ship_event = { id = crisis.8136 }
	}
}

special_project = {
	key = "THE_SYNTH_QUEENS_CONVOY_AMBUSH"
	event_chain = "the_synth_queen_raids_chain"
	picture = GFX_evt_cargoship_caravan
	icon = "gfx/interface/icons/situation_log/situation_log_combat.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 1
	sound = yes
	location = yes

	event_scope = ship_event

	requirements = {
		fleet_power >= 50000
	}

	abort_trigger = {
		owner = {
			has_global_flag = synth_queen_war_started
		}
	}

	on_success = {
		ship_event = { id = crisis.8136 }
	}
}

special_project = {
	key = "THE_SYNTH_QUEENS_RESHAPING_RITUAL"
	picture = GFX_evt_synth_queen
	icon = "gfx/interface/icons/situation_log/situation_log_synth_queen.dds"
	situation_log_category = crises
	cost = 0
	days_to_research = 30
	sound = yes
	location = yes

	event_scope = ship_event

	requirements = {
		shipclass_transport = 1
	}

	on_success = {
		owner = {
			country_event = { id = crisis.24250 }
		}
	}
}
