## First Contact Special Projects ##

# Broken Shackles Origin #

special_project = {
	key = "BROKEN_SHACKLES_PROJECT_01"
	cost = 2000
	tech_department = physics_technology
	timelimit = -1
	picture = GFX_evt_decryption
	icon = "gfx/interface/icons/situation_log/situation_log_tick.dds"

	event_scope = country_event

	on_success = {
		country_event = { id = origin.5040 }
	}
}

special_project = {
	key = "COST_OF_FREEDOM_PROJECT"
	cost = 12000
	tech_department = society_technology
	timelimit = -1
	picture = GFX_evt_board_meeting
	icon = "gfx/interface/icons/situation_log/situation_log_tick.dds"

	event_scope = country_event
	on_success = {
		country_event = { id = origin.5205 }
	}
}

# Payback Origin

special_project = {
	key = "PAYBACK_KESSLER_EFFECT"
	cost = 600 # Around two and a half years with expected research output.
	tech_department = engineering_technology
	picture = GFX_evt_payback
	icon = "gfx/interface/icons/situation_log/situation_log_ship.dds"
	location = yes
	event_scope = ship_event

	triggered_requirement = {
		text = CONSTRUCTOR_PROJECT_REQUIREMENTS
		count = 1
		trigger = {
			OR = {
				is_ship_class = shipclass_constructor
				is_arkship_fleet = yes
			}
		}
	}

	on_progress_50 = {
		ship_event = { id = origin.4930 }
	}

	on_success = {
		ship_event = { id = origin.4931 }
	}
}

special_project = {
	key = "RESTORE_WARSHIP_PROJECT"
	event_chain = "payback_restore_warship_chain"
	cost = 2000
	tech_department = engineering_technology
	icon = "gfx/interface/icons/situation_log/situation_log_combat.dds"
	picture = GFX_evt_payback

	same_option_group_as = { RESTORE_HABITAT_PROJECT }

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	on_success = {
		ship_event = { id = origin.4934 }
		owner = { end_event_chain = "payback_restore_warship_chain" }
	}
}

special_project = {
	key = "RESTORE_HABITAT_PROJECT"
	event_chain = "payback_restore_warship_chain"
	cost = 2000
	tech_department = engineering_technology
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.dds"
	picture = GFX_evt_payback

	same_option_group_as = { RESTORE_WARSHIP_PROJECT }

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	on_success = {
		ship_event = { id = origin.4935 }
		owner = { end_event_chain = "payback_restore_warship_chain" }
	}
}

special_project = {
	key = "UPGRADE_FLAGSHIP"
	cost = {
		base = 2000
		modifier = {
			factor = 2
			has_technology = tech_starbase_4
			desc = "UPGRADE_FLAGSHIP_EMPTY"
		}
		modifier = {
			factor = 2
			has_technology = tech_starbase_5
			desc = "UPGRADE_FLAGSHIP_EMPTY"
		}
	}
	tech_department = engineering_technology
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.dds"
	picture = GFX_evt_payback

	event_scope = ship_event

	triggered_requirement = {
		text = CONSTRUCTOR_PROJECT_REQUIREMENTS
		count = 1
		trigger = {
			OR = {
				is_ship_class = shipclass_constructor
				is_arkship_fleet = yes
			}
		}
	}

	on_success = {
		ship_event = { id = origin.4937 }
	}
}

## Fear of the Dark ##

special_project = {
	key = "FOTD_CONFIRM_FINDINGS"
	#cost = 0
	days_to_research = 720
	tech_department = physics_technology
	picture = GFX_evt_egg_cracked
	icon = "gfx/interface/icons/situation_log/situation_log_scanning_beam.dds"

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	on_success = {
		owner = { country_event = { id = origin.6150 } }
	}
}

special_project = {
	key = "FOTD_DEFLECTING_FIELDS"
	#cost = 0
	days_to_research = 400
	event_chain = fotd_chain
	picture = GFX_evt_shielded_planet
	icon = "gfx/interface/icons/situation_log/situation_log_projectile.dds"

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
	}

	on_success = {
		owner = { country_event = { id = origin.6186 } }
	}
	abort_trigger = {
		owner = {
			NOT = {
				any_situation = {
					is_situation_type = situation_last_gift
				}
			}
		}
	}
}

special_project = {
	key = "FOTD_REVERSED_THRUSTERS"
	#cost = 0
	days_to_research = 350
	event_chain = fotd_chain
	picture = GFX_evt_machine_space_battle
	icon = "gfx/interface/icons/situation_log/situation_log_projectile.dds"

	event_scope = ship_event

	requirements = {
		fleet_power >= 2000
	}

	on_success = {
		controller = { country_event = { id = origin.6187 } }
	}
	abort_trigger = {
		owner = {
			NOT = {
				any_situation = {
					is_situation_type = situation_last_gift
				}
			}
		}
	}
}

special_project = {
	key = "FOTD_COUNTER_SHOT"
	#cost = 0
	days_to_research = 390
	event_chain = fotd_chain
	picture = GFX_evt_asteroid_field
	icon = "gfx/interface/icons/situation_log/situation_log_projectile.dds"

	event_scope = ship_event

	triggered_requirement = {
		text = CONSTRUCTOR_PROJECT_REQUIREMENTS
		count = 1
		trigger = {
			OR = {
				is_ship_class = shipclass_constructor
				is_arkship_fleet = yes
			}
		}
	}

	on_success = {
		owner = { country_event = { id = origin.6188 } }
	}
	abort_trigger = {
		owner = {
			NOT = {
				any_situation = {
					is_situation_type = situation_last_gift
				}
			}
		}
	}
}

special_project = {
	key = "FOTD_CONTROLLED_SHATTERING"
	#cost = 0
	days_to_research = 430
	event_chain = fotd_chain
	picture = GFX_evt_archaeologists_escaping
	icon = "gfx/interface/icons/situation_log/situation_log_projectile.dds"

	event_scope = planet_event

	on_success = {
		owner = { country_event = { id = origin.6189 } }
	}
	abort_trigger = {
		owner = {
			NOT = {
				any_situation = {
					is_situation_type = situation_last_gift
				}
			}
		}
	}
}

# Jaunting Traveler event chain
special_project = {
	key = "THE_JAUNT_PROJECT"
	days_to_research = 1080 # 3 years
	tech_department = society_technology
	picture = GFX_evt_shroudwalker_teachers
	icon = "gfx/interface/icons/situation_log/situation_log_ai.dds"
	location = yes

	event_scope = ship_event

	requirements = {
		shipclass_science_ship = 1
		leader = scientist
		has_trait = leader_trait_psionic
	}

	on_progress_25 = {
		owner = {
			country_event = { id = fircon.1240 }
		}
	}

	on_progress_75 = {
		owner = {
			country_event = { id = fircon.1241 }
		}
	}

	on_success = {
		owner = {
			random_list = {
				10 = { country_event = { id = fircon.1243 } } # Failure
				90 = { country_event = { id = fircon.1242 } } # Success
			}
		}
	}
}

# I'm a (non) believer - sending troops to the skeptics
special_project = {
	key = SHIELD_PRIMITIVE_PLANET_PROJECT
	cost = 50000
	tech_department = physics_technology
	picture = GFX_evt_underground_civilization
	icon = "gfx/interface/icons/situation_log/situation_log_planet.dds"
	location = yes

	event_scope = country_event

	abort_trigger = {
		from = {
			OR = {
				NOT = {
					exists = owner
					owner = { is_primitive = no }
				}
			}
		}
	}

	on_success = {
		from = { change_pc = pc_shielded }
		country_event = { id = arcsite.3020 }
	}
}

# I'm a (non) believer - sending troops to the skeptics
special_project = {
	key = "NON_BELIEVERS_PROJECT"
	cost = 0
	days_to_research = 80
	tech_department = society_technology
	picture = GFX_evt_underground_civilization
	icon = "gfx/interface/icons/situation_log/situation_log_ship.dds"
	location = yes
	timelimit = 1080

	event_scope = ship_event

	requirements = {
		shipclass_transport = 1
	}

	on_success = {
		while = {
			count = 3
			event_target:non_believers_planet = {
				create_army = {
					name = "NAME_subterranean_task_force"
					owner = event_target:non_believers_country
					species = event_target:non_believers_species
					type = subterranean_defense_army
				}
			}
		}

		owner = {
			set_country_flag = helped_non_believers
			random_list = {
				20 = { country_event = { id = fircon.6030 } } # Subterranean invasion!
				30 = { country_event = { id = fircon.6032 } } # Eruption!
				50 = { country_event = { id = fircon.6033 } } # Absolutely nothing happens
			}
		}
	}

	on_fail = {
		owner = {
			random_list = {
				20 = { country_event = { id = fircon.6030 } } # Subterranean invasion!
				30 = { country_event = { id = fircon.6032 } } # Eruption!
				50 = { country_event = { id = fircon.6033 } } # Absolutely nothing happens
			}
		}
	}

	abort_trigger = {
		event_target:non_believers_planet = {
			OR = {
				NOT = { exists = event_target:non_believers_country }
				AND = {
					exists = owner
					owner = {
						NOT = {
							is_same_value = event_target:non_believers_country
						}
					}
				}
			}
		}
	}
}
