situation_stellar_extraction = {
	picture = GFX_evt_dyson_sphere
	category = positive
	desc = situation_stellar_manip_extraction_desc
	complete_icon = GFX_situation_outcome_unknown
	complete_icon_frame = GFX_situation_outcome_frame_green
	on_start = {
		situation_event = {
			id = stellar_manip.8000
		}
	}
	on_progress_complete = {
		target = {
			planet_event = {
				id = stellar_manip.2000
			}
		}
		destroy_situation = this
	}
	on_fail = {
		# custom_tooltip = situation_planetary_revolt_fail_tooltip
		# hidden_effect = {
		# 	target = {
		# 		planet_event = { id = unrest.4300 }
		# 		set_timed_planet_flag = {
		# 			flag = recent_revolt_attempt
		# 			days = 5400
		# 		}
		# 	}
		# 	owner = {
		# 		every_owned_planet = {
		# 			limit = { has_modifier = instability_join_revolt }
		# 			set_timed_planet_flag = {
		# 				flag = recent_revolt_attempt
		# 				days = 5400
		# 			}
		# 		}
		# 	}
		# 	cleanup_separatism_situation = yes
		# 	destroy_situation = this
		# }
	}
	on_abort = {
		stellarm_set_extraction_abort_variables = yes
		stellarm_clean_up_extraction_megas = yes
	}
	abort_trigger = {
		NAND = {
			exists = owner
			exists = target
			target = {
				stmp_is_valid_star = yes
				exists = space_owner
				space_owner = {
					is_same_empire = prevprev.owner
				}
			}
		}
	}
	start_value = 50
	stages = {
		stellarm_manip_stage = {
			icon = GFX_situation_stage_1
			icon_background = GFX_situation_stage_frame_green
			end = 100
		}
	}
	approach = {
		name = approach_stellarm_removal
		icon = GFX_situation_approach_this_is_fine
		icon_background = GFX_situation_approach_bg_red
		on_select = {
			custom_tooltip = situation_removal_extraction_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
		}
		ai_weight = {
			base = 0
			modifier = {
				owner = {
					has_deficit = energy
				}
				add = 75
			}
		}
	}
	approach = {
		name = approach_stellarm_standard
		icon = GFX_situation_approach_this_is_fine
		icon_background = GFX_situation_approach_bg_yellow
		default = yes
		on_select = {
			custom_tooltip = situation_standard_extraction_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
		}
		ai_weight = {
			base = 8
			# modifier = {
			# 	owner = {
			# 		has_deficit = energy
			# 	}
			# 	factor = 0.25
			# }
		}
	}
	approach = {
		name = approach_stellarm_faster_extraction
		icon = GFX_situation_approach_energy_credits
		icon_background = GFX_situation_approach_bg_red
		resources = {
			category = stellarm_situation_econ
			upkeep = {
				energy = 25
			}
		}
		potential = {
			always = no
		}
		ai_weight = {
			base = 2
			modifier = {
				owner = {
					has_deficit = energy
				}
				factor = 0
			}
		}
	}
	approach = {
		name = approach_stellarm_more_efficient_extraction
		icon = GFX_situation_approach_balance_sheet
		icon_background = GFX_situation_approach_bg_green
		potential = {
			always = no
		}
		resources = {
			category = stellarm_situation_econ
			upkeep = {
				energy = 250
			}
		}
		ai_weight = {
			base = 10
			modifier = {
				owner = {
					has_deficit = energy
				}
				factor = 0
			}
		}
	}
	on_monthly = {
		events = {
			stellar_manip.9000
			stellar_manip.9010
		}
	}
	#Note: if you alter this, you should consider whether to alter potential_revolt_situation_monthly_progress_estimation too
	monthly_progress = {
		base = 0
		modifier = {
			add = 2.05
			desc = STRING_APPROACH_STELLARM_STANDARD
			current_situation_approach = approach_stellarm_standard
		}
		modifier = {
			add = 6
			desc = STRING_APPROACH_STELLARM_FASTER
			current_situation_approach = approach_stellarm_faster_extraction
		}
		modifier = {
			add = 0.8
			desc = STRING_APPROACH_STELLARM_SLOWER
			current_situation_approach = approach_stellarm_more_efficient_extraction
		}
		modifier = {
			divide = 2
			desc = STRING_STELLARM_IS_O_STAR
			target = {
				giga_is_o_star_for_megas = yes
			}
		}
	}
}

situation_stellar_infusion = {
	picture = GFX_evt_dyson_sphere
	category = positive
	desc = situation_stellar_manip_infusion_desc
	complete_icon = GFX_situation_outcome_unknown
	complete_icon_frame = GFX_situation_outcome_frame_green
	on_start = {
		situation_event = {
			id = stellar_manip.8001
		}
	}
	on_progress_complete = {
		target = {
			planet_event = {
				id = stellar_manip.1999
			}
		}
		destroy_situation = this
	}
	on_fail = {
		# custom_tooltip = situation_planetary_revolt_fail_tooltip
		# hidden_effect = {
		# 	target = {
		# 		planet_event = { id = unrest.4300 }
		# 		set_timed_planet_flag = {
		# 			flag = recent_revolt_attempt
		# 			days = 5400
		# 		}
		# 	}
		# 	owner = {
		# 		every_owned_planet = {
		# 			limit = { has_modifier = instability_join_revolt }
		# 			set_timed_planet_flag = {
		# 				flag = recent_revolt_attempt
		# 				days = 5400
		# 			}
		# 		}
		# 	}
		# 	cleanup_separatism_situation = yes
		# 	destroy_situation = this
		# }
	}
	on_abort = {
		stellarm_set_injection_abort_variables = yes
		stellarm_clean_up_infusion_megas = yes

	}
	abort_trigger = {
		NAND = {
			exists = owner
			exists = target
			target = {
				stmp_is_valid_star = yes
				exists = space_owner
				space_owner = {
					is_same_empire = prevprev.owner
				}
			}
		}
	}
	start_value = 50
	stages = {
		stellarm_manip_stage = {
			icon = GFX_situation_stage_1
			icon_background = GFX_situation_stage_frame_green
			end = 100
		}
	}
	approach = {
		name = approach_stellarm_removal
		icon = GFX_situation_approach_this_is_fine
		icon_background = GFX_situation_approach_bg_red
		on_select = {
			custom_tooltip = situation_removal_infusion_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
		}
		ai_weight = {
			base = 0
			modifier = {
				owner = {
					has_deficit = energy
				}
				add = 75
			}
			modifier = {
				owner = {
					has_deficit = sr_stellar_plasma
				}
				add = 75
			}
		}
	}
	approach = {
		name = approach_stellarm_standard_infusion
		icon = GFX_situation_approach_this_is_fine
		icon_background = GFX_situation_approach_bg_yellow
		default = yes
		on_select = {
			custom_tooltip = situation_standard_infusion_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
		}
		ai_weight = {
			base = 8
			# modifier = {
			# 	owner = {
			# 		has_deficit = energy
			# 	}
			# 	factor = 0.25
			# }
		}
	}
	approach = {
		name = approach_stellarm_faster_infusion
		icon = GFX_situation_approach_energy_credits
		icon_background = GFX_situation_approach_bg_red
		potential = {
			always = no
		}
		on_select = {
			custom_tooltip = situation_faster_infusion_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
			upkeep = {
				energy = 125
			}
		}
		ai_weight = {
			base = 2
			modifier = {
				owner = {
					has_deficit = energy
				}
				factor = 0
			}
		}
	}
	approach = {
		name = approach_stellarm_more_efficient_infusion
		icon = GFX_situation_approach_balance_sheet
		icon_background = GFX_situation_approach_bg_green
		potential = {
			always = no
		}
		on_select = {
			custom_tooltip = situation_efficient_infusion_approach_tooltip
		}
		resources = {
			category = stellarm_situation_econ
			upkeep = {
				energy = 10
			}
		}
		ai_weight = {
			base = 10
			modifier = {
				owner = {
					has_deficit = energy
				}
				factor = 0
			}
		}
	}
	on_monthly = {
		events = {
			stellar_manip.9001
			stellar_manip.9010
		}
	}
	#Note: if you alter this, you should consider whether to alter potential_revolt_situation_monthly_progress_estimation too
	monthly_progress = {
		base = 0
		modifier = {
			add = 2.05
			desc = STRING_APPROACH_STELLARM_STANDARD_INFUSION
			current_situation_approach = approach_stellarm_standard_infusion
		}
		modifier = {
			add = 6
			desc = STRING_APPROACH_STELLARM_FASTER_INFUSION
			current_situation_approach = approach_stellarm_faster_infusion
		}
		modifier = {
			add = 0.8
			desc = STRING_APPROACH_STELLARM_SLOWER_INFUSION
			current_situation_approach = approach_stellarm_more_efficient_infusion
		}
		modifier = {
			divide = 2
			desc = STRING_STELLARM_IS_B_STAR
			target = {
				is_planet_class = pc_b_star
			}
		}
		modifier = {
			factor = owner.value:giga_stellarm_plasma_deficit_value
			desc = STRING_HAS_PLASMA_DEFICIT
			owner = {
				has_deficit = sr_stellar_plasma
			}
		}
	}
}
