
### TOXIC FIELD WORK
# from = operation owner; fromfrom = operation; event_target:toxic_field_country = target country
special_project = {
	key = "TOXIC_OPERATION_PROJECT"
	cost = {
		base = 100
		scaled_modifier = {
			limit = { }
			scope = this
			add = 0.03
			calc = pop_amount
		}
	}
	timelimit = 60
	tech_department = society_technology
	picture = GFX_evt_toxic

	event_scope = planet_event

	requirements = { }

	on_success = {
		from = { country_event = { id = operation.5026 } }
	}

	on_fail = {
		country_event = { id = operation.5027 }
	}
}

### EXCESS NOISE
# from = operation owner; fromfrom = operation; excess_noise_country = target country
special_project = {
	key = "NOISE_OPERATION_PROJECT"
	cost = {
		base = 100
		scaled_modifier = {
			limit = { }
			scope = this
			add = 0.03
			calc = pop_amount
		}
	}
	timelimit = 60
	tech_department = physics_technology
	picture = GFX_evt_sapient_AI

	event_scope = planet_event

	requirements = { }

	on_success = {
		from = { country_event = { id = operation.5031 } }
	}

	on_fail = {
		country_event = { id = operation.5032 }
	}
}


special_project = {
	key = "UNIVERSAL_TRANSLATOR_PROJECT"
	cost = 3000
	tech_department = society_technology
	picture = GFX_evt_mysterious_signal
	icon = "gfx/interface/icons/situation_log/situation_log_radar.dds"
	location = no

	event_scope = country_event

	on_success = {
		country_event = { id = first_contact.422 }
	}
}

special_project = {
	key = "OCTOPODES_LIGHT_PATTERNS_PROJECT"
	cost = 3000
	tech_department = physics_technology
	picture = GFX_evt_clocks
	icon = "gfx/interface/icons/situation_log/situation_log_scanning_beam.dds"
	location = no

	event_scope = country_event

	on_success = {
		country_event = { id = first_contact.437 }
	}
}

### Become the Crisis

### CRISIS SPECIAL PROJECT 1 - COMPLETION UNLOCKS CRISIS LEVEL 2
# Regular
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_1"
	cost = 3000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_alien_propaganda
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_1_complete
		country_event = { id = crisis.4120 }
	}

	on_fail = {
	}
}

# Machine Intelligence
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_MACH_1"
	cost = 3000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_glitchy_matrix
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_1_complete
		country_event = { id = crisis.4120 }
	}

	on_fail = {
	}
}

# Machine Intelligence - Shroud-Forged
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_SH_1"
	cost = 3000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_glitchy_matrix
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_1_complete
		country_event = { id = crisis.4120 }
	}

	on_fail = {
	}
}

# Hivemind
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_HIVE_1"
	cost = 3000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_glitchy_matrix
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_1_complete
		country_event = { id = crisis.4120 }
	}

	on_fail = {
	}
}

# Psionic
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_PSIONIC_1"
	cost = 3000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_glitchy_matrix
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_1_complete
		country_event = { id = crisis.4120 }
	}

	on_fail = {
	}
}

### CRISIS SPECIAL PROJECT 2 - COMPLETION UNLOCKS CRISIS LEVEL 3
# Regular
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_2"
	cost = 6000
	days_to_research = 0
	tech_department = physics_technology
	picture = GFX_evt_physics_research
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_2_complete
		country_event = { id = crisis.4125 }
	}

	on_fail = {
	}
}

# Machine Intelligence
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_MACH_2"
	cost = 6000
	days_to_research = 0
	tech_department = physics_technology
	picture = GFX_evt_physics_research
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_2_complete
		country_event = { id = crisis.4125 }
	}

	on_fail = {
	}
}

# Machine Intelligence - Shroud-Forged
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_SH_2"
	cost = 6000
	days_to_research = 0
	tech_department = physics_technology
	picture = GFX_evt_physics_research
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_2_complete
		country_event = { id = crisis.4125 }
	}

	on_fail = {
	}
}

# Hivemind
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_HIVE_2"
	cost = 6000
	days_to_research = 0
	tech_department = physics_technology
	picture = GFX_evt_physics_research
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_2_complete
		country_event = { id = crisis.4125 }
	}

	on_fail = {
	}
}

# Psionic
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_PSIONIC_2"
	cost = 6000
	days_to_research = 0
	tech_department = physics_technology
	picture = GFX_evt_physics_research
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_2_complete
		country_event = { id = crisis.4125 }
	}

	on_fail = {
	}
}

### CRISIS SPECIAL PROJECT 3 - COMPLETION UNLOCKS CRISIS LEVEL 4
# Regular
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_3"
	cost = 12000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_psionics
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_3_complete
		country_event = { id = crisis.4130 }
	}

	on_fail = {
	}
}

# Machine Intelligence
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_MACH_3"
	cost = 12000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_ai_planet
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_3_complete
		country_event = { id = crisis.4130 }
	}

	on_fail = {
	}
}

# Machine Intelligence - Shroud-Forged
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_SH_3"
	cost = 12000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_ai_planet
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_3_complete
		country_event = { id = crisis.4130 }
	}

	on_fail = {
	}
}

# Hivemind
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_HIVE_3"
	cost = 12000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_ai_planet
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_3_complete
		country_event = { id = crisis.4130 }
	}

	on_fail = {
	}
}

# Psionic
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_PSIONIC_3"
	cost = 12000
	days_to_research = 0
	tech_department = society_technology
	picture = GFX_evt_ai_planet
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_3_complete
		country_event = { id = crisis.4130 }
	}

	on_fail = {
	}
}

### CRISIS SPECIAL PROJECT 4 - COMPLETION UNLOCKS CRISIS LEVEL 5
# Regular
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_4"
	cost = 20000
	days_to_research = 0
	tech_department = engineering_technology
	picture = GFX_evt_planet_beam
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_4_complete
		country_event = { id = crisis.4135 }
	}

	on_fail = {
	}
}

# Machine Intelligence
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_MACH_4"
	cost = 20000
	days_to_research = 0
	tech_department = engineering_technology
	picture = GFX_evt_planet_beam
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_4_complete
		country_event = { id = crisis.4135 }
	}

	on_fail = {
	}
}

# Machine Intelligence - Shroud-Forged
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_SH_4"
	cost = 20000
	days_to_research = 0
	tech_department = engineering_technology
	picture = GFX_evt_planet_beam
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_4_complete
		country_event = { id = crisis.4135 }
	}

	on_fail = {
	}
}

# Hivemind
special_project = {
	key = "CRISIS_SPECIAL_PROJECT_HIVE_4"
	cost = 20000
	days_to_research = 0
	tech_department = engineering_technology
	picture = GFX_evt_planet_beam
	icon = "gfx/interface/icons/situation_log/situation_log_main_quest.dds"
	event_chain = become_the_crisis_chain
	location = no

	event_scope = country_event

	requirements = {
	}

	on_success = {
		set_country_flag = crisis_special_project_4_complete
		country_event = { id = crisis.4135 }
	}

	on_fail = {
	}
}

# The Lonely Bot
special_project = {
	key = "LONELY_BOT_PROJECT"
	cost = 1500
	timelimit = 1800
	tech_department = engineering_technology
	picture = GFX_evt_alien_ruins
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.dds"

	event_scope = planet_event

	on_success = {
		from = { carrier_event = { id = colony.5010 } }
	}

	on_fail = {
		from = { carrier_event = { id = colony.5006 } }
	}
}

special_project = {
	key = "LONELY_BOT_MISSING_PROJECT"
	cost = 1500
	tech_department = engineering_technology
	picture = GFX_evt_alien_ruins
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.dds"

	event_scope = planet_event # Negates requirement for a science ship

	on_success = {
		from = { carrier_event = { id = colony.5020 } }
	}

	on_fail = {

	}

	abort_trigger = {

	}
}

## Situation - The Kaleidoscope

# Remove the Kaleidoscope (first time)
special_project = {
	key = "KALEIDOSCOPE_INFESTATION_FIRST"
	cost = 200
	tech_department = engineering_technology
	picture = GFX_evt_generator_powerup
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.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 = {
		from = {
			carrier_event = { id = situation.2005 }
		}
	}

	on_success = {
		from = {
			carrier_event = { id = situation.2010 }
		}
	}
}

# Remove the Kaleidoscope - minor infestation
special_project = {
	key = "KALEIDOSCOPE_INFESTATION"
	cost = 500
	tech_department = engineering_technology
	picture = GFX_evt_generator_powerup
	icon = "gfx/interface/icons/situation_log/situation_log_engineering.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_success = {
		from = {
			carrier_event = { id = situation.2011 }
		}
	}

	# Automatically goes away if you send the Kaleidoscope to another empire
	abort_trigger = {
		owner = {
			NOT = {
				any_situation = {
					is_situation_type = situation_kaleidoscope
				}
			}
		}
	}
}
