##########################################################################
# Ancient Relics Decisions
##########################################################################
@minor_artifact_decision_cost = 100
@minor_artifact_decision_duration = 3600

decision_tissue_growth_stimulants = {
	owned_planets_only = yes
	sound = event_laboratory_sound
	icon = decision_resources

	resources = {
		category = decisions
		cost = {
			energy = 200
		}
	}

	potential = {
		owner = {
			is_machine_empire = no
			has_country_flag = city_of_bones_completed
		}
		NOT = { has_designation = col_nanotech_world }
	}

	allow = {
		NOT = { has_modifier = tissue_growth_stimulants }
	}

	effect = {
		add_modifier = { modifier = tissue_growth_stimulants days = 3600 }
	}

	ai_weight = {
		weight = 1
	}
}

decision_explosive_fungifoam_housing = {
	owned_planets_only = yes
	sound = event_laboratory_sound
	icon = decision_resources

	resources = {
		category = decisions
		cost = {
			energy = 500
		}
	}

	potential = {
		owner = {
			is_machine_empire = yes
			has_country_flag = city_of_bones_completed
		}
		NOT = { has_designation = col_nanotech_world }
	}

	allow = {
		NOT = { has_modifier = explosive_fungifoam_housing }
	}

	effect = {
		add_modifier = { modifier = explosive_fungifoam_housing }
	}

	ai_weight = {
		weight = 1
	}
}

# Baol Organism Lifeseed
decision_baol_life_seed = {
	important = yes
	owned_planets_only = yes
	sound = event_laboratory_sound
	icon = decision_resort_colony

	enactment_time = 720

	potential = {
		NOT = {
			is_planet_class = pc_city
			is_planet_class = pc_machine
			is_planet_class = pc_relic
			is_planet_class = pc_hive
			is_planet_class = pc_gaia
		}
		is_artificial = no
		exists = owner
		owner = { has_country_flag = relic_last_baol_activated }
		owner = {
			has_country_flag = not_activated_baol
		}
		NOT = { has_designation = col_nanotech_world }
	}

	allow = { }

	effect = {
		# Convert to Gaia world, spawn Nu-Baol pops
		custom_tooltip = decision_baol_life_seed_effects
		hidden_effect = {
			change_pc = pc_gaia
			if = {
				limit = { NOT = { exists = event_target:nu_baol_species } }
				if = {
					limit = {
						owner = {
							is_hive_empire = yes
						}
					}
					create_hive_nu_baol_effect = yes
				}
				else = {
					create_nu_baol_effect = yes
				}
			}
			create_pop_group = {
				size = 400
				species = event_target:nu_baol_species
				ethos = {
					ethic = "ethic_pacifist"
				}
			}
			carrier_event = { id = ancrel.2025 } #Notification event
			carrier_event = {
				id = shroud.10010 		# Patron Objective Counter: po_terraform_planet
			}
		}
	}

	on_queued = {
		owner = { remove_country_flag = not_activated_baol }
	}

	on_unqueued = {
		owner = { set_country_flag = not_activated_baol }
	}

	ai_weight = {
		weight = 0
	}
}

decision_baol_life_seed_enhance = {
	important = yes
	owned_planets_only = yes
	sound = event_laboratory_sound
	icon = decision_resort_colony

	potential = {
		is_planet_class = pc_gaia
		exists = owner
		owner = { has_country_flag = relic_last_baol_activated }
	}

	allow = { }

	effect = {
		# Convert to Gaia world, spawn Nu-Baol pops
		custom_tooltip = decision_baol_life_seed_enhance_effects
		hidden_effect = {
			owner = { remove_country_flag = relic_last_baol_activated }
			if = {
				limit = { NOT = { exists = event_target:nu_baol_species } }
				if = {
					limit = {
						owner = {
							is_hive_empire = yes
						}
					}
					create_hive_nu_baol_effect = yes
				}
				else = {
					create_nu_baol_effect = yes
				}
			}
			create_pop_group = {
				size = 400
				species = event_target:nu_baol_species
				ethos = {
					ethic = "ethic_pacifist"
				}
			}
			while = {
				count = 10
				weighted_random_owned_pop_group = {
					limit = {
						species = {
							NOR = {
								is_robotic = yes
								has_trait = trait_pc_gaia_preference_terraforming
								has_trait = trait_auto_hab_preference
							}
						}
					}
					modify_species = {
						species = this
						ideal_planet_class = pc_nuked
					}
					modify_species = {
						species = this
						remove_trait = trait_pc_nuked_preference
						add_trait = trait_pc_gaia_preference_terraforming
					}
				}
			}
			carrier_event = { id = ancrel.2026 } #Notification event
		}
	}

	on_queued = {
		owner = { remove_country_flag = not_activated_baol }
	}

	ai_weight = {
		weight = 0
	}
}

decision_baol_life_seed_artificial = {
	important = yes
	owned_planets_only = yes
	sound = event_laboratory_sound
	icon = decision_resort_colony

	enactment_time = 720

	potential = {
		is_artificial = yes
		exists = owner
		owner = { has_country_flag = relic_last_baol_activated }
		owner = {
			has_country_flag = not_activated_baol
		}
	}

	allow = { }

	effect = {
		# spawn Nu-Baol pops, add cool deposit
		custom_tooltip = decision_baol_life_seed_artificial_effects
		hidden_effect = {
			if = {
				limit = {
					NOT = {
						has_deposit = d_baol_growth
					}
				}
				add_deposit = d_baol_growth
			}
			if = {
				limit = { NOT = { exists = event_target:nu_baol_species } }
				if = {
					limit = {
						owner = {
							is_hive_empire = yes
						}
					}
					create_hive_nu_baol_effect = yes
				}
				else = {
					create_nu_baol_effect = yes
				}
			}
			create_pop_group = {
				size = 400
				species = event_target:nu_baol_species
				ethos = {
					ethic = "ethic_pacifist"
				}
			}
			carrier_event = { id = ancrel.2027 } #Notification event
			carrier_event = {
				id = shroud.10010 		# Patron Objective Counter: po_terraform_planet
			}
		}
	}

	on_queued = {
		owner = { remove_country_flag = not_activated_baol }
	}

	on_unqueued = {
		owner = { set_country_flag = not_activated_baol }
	}

	ai_weight = {
		weight = 0
	}
}

decision_museum_exhibits = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_museum

	potential = {
		owner = {
			is_gestalt = no
			OR = {
				is_megacorp = no
				is_worker_coop_empire = yes
			}
		}
		NOT = { has_designation = col_nanotech_world }
	}

	allow = {
		NOT = {
			has_modifier = "planet_museum_exhibits"
		}
		num_assigned_jobs = {
			job = bureaucrat
			value >= 100
		}
	}

	resources = {
		category = decisions
		cost = {
			minor_artifacts = @minor_artifact_decision_cost
		}
	}

	effect = {
		#custom_tooltip = decision_museum_exhibits_effect
		add_modifier = { modifier = "planet_museum_exhibits" days = @minor_artifact_decision_duration }
	}

	ai_weight = {
		weight = 0
	}
}

decision_manager_awards = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_deal

	potential = {
		owner = {
			is_megacorp = yes
			is_worker_coop_empire = no
		}
		NOT = { is_planet_class = pc_nanotech }
	}

	allow = {
		NOT = { has_modifier = "planet_manager_awards" }
	}

	resources = {
		category = decisions
		cost = {
			minor_artifacts = @minor_artifact_decision_cost
		}
	}

	effect = {
		add_modifier = { modifier = "planet_manager_awards" days = @minor_artifact_decision_duration }
	}

	ai_weight = {
		weight = 0
	}
}

decision_sanctuary_exhibits = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_museum

	potential = {
		owner = { has_civic = civic_machine_servitor }
		NOT = { has_designation = col_nanotech_world }
	}

	allow = {
		NOT = { has_modifier = "planet_sanctuary_exhibits" }
	}

	resources = {
		category = decisions
		cost = {
			minor_artifacts = @minor_artifact_decision_cost
		}
	}

	effect = {
		add_modifier = { modifier = "planet_sanctuary_exhibits" days = @minor_artifact_decision_duration }
	}

	ai_weight = {
		weight = 0
	}
}

decision_artifact_relays_hivemind = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_satellite_in_orbit

	potential = {
		owner = {
			is_hive_empire = yes
			is_wilderness_empire = no
		}
	}

	allow = {
		NOT = { has_modifier = "planet_artifact_relays_hivemind" }
	}

	resources = {
		category = decisions
		cost = {
			minor_artifacts = @minor_artifact_decision_cost
		}
	}

	effect = {
		custom_tooltip = decision_artifact_relays_hivemind_effect
		hidden_effect = {
			add_modifier = { modifier = "planet_artifact_relays_hivemind" days = @minor_artifact_decision_duration }
		}
	}

	ai_weight = {
		weight = 0
	}
}

decision_artifact_relays_machine = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_satellite_in_orbit

	potential = {
		owner = {
			is_machine_empire = yes
			NOT = {
				has_civic = civic_machine_servitor
			}
		}
		NOT = { is_planet_class = pc_nanotech }
	}

	allow = {
		NOT = { has_modifier = "planet_artifact_relays_machine" }
	}

	resources = {
		category = decisions
		cost = {
			minor_artifacts = @minor_artifact_decision_cost
		}
	}

	effect = {
		custom_tooltip = decision_artifact_relays_machine_effect
		hidden_effect = {
			add_modifier = { modifier = "planet_artifact_relays_machine" days = @minor_artifact_decision_duration }
		}
	}

	ai_weight = {
		weight = 0
	}
}

decision_machine_oracle = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_crime

	resources = {
		category = decisions
		cost = {
			energy = 200
			unity = 500
		}
	}

	potential = {
		owner = {
			is_machine_empire = yes
			has_country_flag = oracle_completed
		}
		NOT = { has_designation = col_nanotech_world }
	}

	allow = {
		NOT = { has_modifier = oracle_software_integration }
	}

	effect = {
		add_modifier = { modifier = oracle_software_integration days = 3600 }
	}

	ai_weight = {
		weight = 1
	}
}

decision_yuht_cleanseplanet = {
	owned_planets_only = yes
	sound = event_administrative_work
	icon = decision_animal_wildlife

	resources = {
		category = decisions
		cost = {
			energy = 500
		}
	}

	potential = {
		can_have_habitable_deposits = yes
		owner = {
			has_country_flag = artifact_yuht_research_completed
		}
		NOT = { has_modifier = pm_yuht_cleansing }
		NOT = { has_designation = col_nanotech_world }
	}

	effect = {
		add_planet_devastation = 50
		add_modifier = { modifier = pm_yuht_cleansing days = -1 }
		remove_fauna_yuht = yes
	}
}
