
planetmega_wilderness_construction = {
	situation_log_category = planetmegas
	complete_icon_frame = GFX_situation_outcome_frame_green
	complete_icon = GFX_situation_outcome_positive
	fail_icon_frame = GFX_situation_outcome_frame_red
	fail_icon = GFX_situation_outcome_meh
	inline_script = situations/plnmg_sit_pics

	triggered_target_modifier = {
		potential = {
			target = {
				or = {
					not = { exists = owner }
					is_planetmega_byd_space_need = no
				}
			}
		}
		planet_max_districts_add = -2
	}

	total_progress = {
		base = 2400
	}
	stages = {
		stage_1 = {
			icon = GFX_planet_mega_stage_1
			icon_background = GFX_situation_stage_frame_green
			custom_tooltip = stage_planet_mega_1_tooltip
			#end = 800 #33.33%
			section_weight = 1
		}
		stage_2 = {
			icon = GFX_planet_mega_stage_2
			icon_background = GFX_situation_stage_frame_green
			custom_tooltip = stage_planet_mega_2_tooltip
			on_first_enter = {
				#
			}
			#end = 1600 #66.66%
			section_weight = 1
		}
		stage_3 = {
			icon = GFX_planet_mega_stage_3
			icon_background = GFX_situation_stage_frame_green
			custom_tooltip = stage_planet_mega_3_tooltip
			on_first_enter = {
				#
			}
			#end = 2400 #20年
			section_weight = 1
		}
	}

	category = positive

	on_progress_complete = {
		custom_tooltip = planet_megastructure_construction_tooltip
		hidden_effect = { situation_event = { id = planetmega.51 } }
	}
	on_start = { 
		situation_event = { id = planetmega.31 }
		owner = { save_event_target_as = situation_starter_country }
	}
	on_fail = {
		custom_tooltip = planet_megastructure_construction_fail_tooltip
		hidden_effect = { situation_event = { id = situation.1180 } }
	}
	on_abort = {
		destroy_situation = this
	}

	on_monthly = {
		events = {
			planetmega.52 #biomass spender
		}
	}

	approach = { #steady
		name = planetmega_approach_default
		icon = GFX_situation_tower_crane
		icon_background = GFX_situation_approach_bg_yellow
		default = yes
		on_select = {
			custom_tooltip = planet_megastructure_default_effect
			hidden_effect = {
				if = {
					limit = { is_variable_set = special_plnmg_const_approach_index }
					clear_variable = special_plnmg_const_approach_index
				}
			}
		}
		ai_weight = { base = 100 }
		resources = {
			category = situations
			upkeep = {
				energy = 20
				alloys = 13
				food = 20
				mult = value:sv_plnmg_sit_upkp_mult
			}
		}
	}

	approach = { #pause
		name = planetmega_approach_pause
		on_select = {
			custom_tooltip = planet_megastructure_pause_effect
			hidden_effect = { set_variable = { which = special_plnmg_const_approach_index value = 1 } }
		}
		icon = GFX_situation_tower_crane
		icon_background = GFX_situation_approach_bg_red
		ai_weight = { base = 0 }
		resources = {
			category = situations
			upkeep = { energy = 1 }
		}
	}

	# approach = {#reverse
	# 	name = planetmega_approach_reverse
	# 	on_select = { custom_tooltip = planet_megastructure_reverse_effect }
	# 	icon = GFX_situation_tower_crane
	# 	icon_background = GFX_situation_approach_bg_red
	# 	ai_weight = { base = 0 }
	# 	resources = {
	# 		category = situations
	# 		upkeep = {
	# 			energy = 3
	# 			mult = value:sv_plnmg_sit_upkp_mult
	# 		}
	# 	}
	# }

	approach = {
		name = planetmega_approach_setting
		icon = GFX_situation_approach_engineering
		icon_background = GFX_situation_approach_bg_yellow
		ai_weight = { base = 0 }
		on_select = {
			hidden_effect = {
				if = {
					limit = {
						is_variable_set = special_plnmg_const_approach_index
						check_variable = { which = special_plnmg_const_approach_index value = 1 }
					}
					set_situation_approach = planetmega_approach_pause
				}
				# else_if = {
				# 	limit = {
				# 		is_variable_set = special_plnmg_const_approach_index
				# 		check_variable = { which = special_plnmg_const_approach_index value = 2 }
				# 	}
				# 	set_situation_approach = planetmega_approach_reverse
				# }
				else = { set_situation_approach = planetmega_approach_default }
			}
			situation_event = { id = planetmega.250 }
		}
	}

	monthly_progress = {
		base = @progressBase_buildPlanetMega
		inline_script = situations/plnmg_sit_progress
	}

	abort_trigger = {
		OR = {
			NOT = { exists = target.owner }
			target.owner = { NOT = { is_same_value = root.owner } }
		}
	}
}

