##########################################################################
# Decisions
##########################################################################

#Garden: Declare Garden World.
decision_esap_garden_activate = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_esap_garden_activate
	
	resources = {
		category = decisions
		cost = {
			influence = 10
			minerals = 3600
			food = 1800
		}
	}
	
	potential = {
		owner = {
			has_ascension_perk = ap_esap_garden
		}
		NOR = {
			has_modifier = mod_esap_garden
			# has_modifier = mod_esap_industry
			# has_modifier = mod_esap_industry_hive
			# has_modifier = mod_esap_industry_machines
			# is_planet_class = pc_city
			is_planet_class = pc_nuked
		}
		habitable_structure = no
	}
	
	effect = {
		custom_tooltip = decision_esap_garden_activate_tooltip
		hidden_effect = {
			add_modifier = { 
				modifier = "mod_esap_garden" 
				days = -1 
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}
#Garden: Remove Garden World.
decision_esap_garden_deactivate = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_esap_garden_deactivate
	
	resources = {
		category = decisions
		cost = {
			minerals = 360
		}
	}
	
	potential = {
		has_modifier = mod_esap_garden
	}
	
	effect = {
		custom_tooltip = decision_esap_garden_deactivate_tooltip
		hidden_effect = {
			remove_modifier = "mod_esap_garden" 
		}
	}
	
	ai_weight = {
		weight = 0
	}
}

#Mining, search for deposits.
decision_esap_mining = {
	owned_planets_only = yes
	sound = event_super_explosion
	icon = decision_esap_mining 
	
	resources = {
		category = decisions
		cost = {
			minerals = 250
			alloys = 125
		}
	}
	
	potential = {
		owner = {
			has_ascension_perk = ap_esap_mining
		}
		NOR = {
			has_modifier = mod_esap_mining
			check_variable = {
				which = var_esap_mining
				value > 9
			}
			is_planet_class = pc_city
		}
		habitable_structure = no
	}
	
	effect = {
		custom_tooltip = decision_esap_mining_tooltip
		hidden_effect = {
			change_variable = {
				which = var_esap_mining
				value = 1
			}
			add_modifier = { 
				modifier = "mod_esap_mining" 
				years = 5
			}
			add_deposit = d_esap_mining
			random_list = {
				7 = {}
				1 = { add_deposit = d_fuming_bog  }
				1 = { add_deposit = d_crystalline_caverns }
				1 = { add_deposit = d_dust_caverns }
			}

		}
	}
	
	ai_weight = {
		weight = 0
	}
}

#Industry: Declare Forge World.
decision_esap_industry_activate = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_esap_industry_activate
	
	resources = {
		category = decisions
		cost = {
			influence = 10
			minerals = 3600
			alloys = 1800
		}
	}
	
	potential = {
		owner = {
			has_ascension_perk = ap_esap_industry
		}
		NOR = {
			# has_modifier = mod_esap_garden
			has_modifier = mod_esap_industry
			has_modifier = mod_esap_industry_hive
			has_modifier = mod_esap_industry_machines
			# is_planet_class = pc_city
		}
		habitable_structure = no
	}
	
	effect = {
		if = {
			limit = { owner = { is_regular_empire = yes } }
			custom_tooltip = decision_esap_industry_activate_tooltip
			hidden_effect = {
				add_modifier = { 
					modifier = "mod_esap_industry" 
					days = -1 
				}
			}
		}
		if = {
			limit = { owner = { is_hive_empire = yes } }
			custom_tooltip = decision_esap_industry_hive_activate_tooltip
			hidden_effect = {
				add_modifier = { 
					modifier = "mod_esap_industry_hive" 
					days = -1 
				}
			}
		}
		if = {
			limit = { owner = { is_machine_empire = yes } }
			custom_tooltip = decision_esap_industry_machines_activate_tooltip
			hidden_effect = {
				add_modifier = { 
					modifier = "mod_esap_industry_machines" 
					days = -1 
				}
			}
		}
	}
	
	ai_weight = {
		weight = 0
	}
}
#Industry: Remove Forge World.
decision_esap_industry_deactivate = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_esap_industry_deactivate
	
	resources = {
		category = decisions
		cost = {
			minerals = 360
		}
	}
	
	potential = {
		Or = {
			has_modifier = mod_esap_industry
			has_modifier = mod_esap_industry_hive
			has_modifier = mod_esap_industry_machines
		}
	}
	
	effect = {
		if = {
			limit = { has_modifier = mod_esap_industry }
			custom_tooltip = decision_esap_industry_deactivate_tooltip
			hidden_effect = { remove_modifier = "mod_esap_industry" }
		}
		if = {
			limit = { has_modifier = mod_esap_industry_hive }
			custom_tooltip = decision_esap_industry_deactivate_tooltip
			hidden_effect = { remove_modifier = "mod_esap_industry_hive" }
		}
		if = {
			limit = { has_modifier = mod_esap_industry_machines }
			custom_tooltip = decision_esap_industry_deactivate_tooltip
			hidden_effect = { remove_modifier = "mod_esap_industry_machines" }
		}
	}
	
	ai_weight = {
		weight = 0
	}
}
