f93_buy_more_shrouded_region_access = {
	owned_planets_only = yes				#default: no
	sound = event_administrative_work		#this is a sound
	icon = decision_colony_settlement		#icon found in gfx/interface/icons/decisions/

	resources = {
		category = decisions
		cost = {
			energy = 500
			trade = 20000
			sr_dark_matter = 150
		}
	}

	enactment_time = 360 					#enactment time in days, default is instant

	prerequisites = {
	}

	show_tech_unlock_if = {
		#triggers for whether the decision should show in the tech
	}

	potential = {
		is_capital = yes
		has_global_flag = f93_shroud_gate_active
		NOT = { exists = event_target:f93_ralis_country }
	}

	allow = {
		any_system = {
			has_star_flag = f93_shroud_region_flag
			NOR = {
				any_neighbor_system = { has_hyperlane_to = prev }
				has_natural_wormhole = yes
			}
		}
	}

	on_queued = {
		#effect when queuing decision here
	}

	on_unqueued = {
		#effect when manually unqueuing decision here
	}

	abort_trigger = {
		#triggers for aborting the queued decision here
	}

	abort_effect = {
		#effect when aborting queued decision (via abort_trigger) here
	}

	effect = {
		random_system = {
			limit = {
				has_star_flag = f93_shroud_region_flag
				f93_is_in_a_cluster = no
			}
			f93_place_shroud_gate_node_and_cluster = yes
		}
	}

	ai_weight = {
		weight = 6

		modifier = {
			factor = 0
			has_resource = { type = trade amount > 80000 }
		}
	}
}

f93_lock_the_ralisgate = {
	owned_planets_only = yes
	enactment_time = 10
	icon = decision_exploding_planet
	
	resources = {
		category = decisions
		cost = {
			energy = 1500
			sr_dark_matter = 10
		}
	}
	
	potential = {
		OR = {
			solar_system = { has_star_flag = f93_ralisgate }
			any_system = {
				distance = {
					source = prev
					type = hyperlane
					max_jumps = 5
				}
				has_star_flag = f93_ralisgate
			}
		}
	}

	allow = {
		hidden_trigger = {
			OR = {
				solar_system = { has_star_flag = f93_ralisgate }
				any_system = {
					distance = {
						source = prev
						type = hyperlane
						max_jumps = 5
					}
					has_star_flag = f93_ralisgate
					NOT = { has_star_flag = f93_ralisgate_locked }
				}
			}
		}
		NOT = { solar_system = { has_star_flag = f93_ralisgate_locked } }
	}

	effect = {
		hidden_effect = {
			solar_system = { set_timed_star_flag = { flag = f93_ralisgate_locked days = 1800 } }
			closest_system = {
				limit = { has_star_flag = f93_ralisgate }
				set_timed_star_flag = { flag = f93_ralisgate_locked days = 1800 }
			}
		}
		custom_tooltip = f93_lock_the_ralisgate_effect
	}

	ai_weight = {
		factor = 1
		modifier = {
			owner = { is_at_war = no }
			factor = 0
		}
		modifier = {
			factor = 100
			owner = {
				is_at_war = yes
				any_war = {
					any_war_participant = {
						relative_power = { who = prevprev category = fleet value >= superior }
					}
				}
			}
		}
	}
}
f93_expand_drifter_operations = {
	owned_planets_only = yes
	potential = {
		has_modifier = f93_zro_downpour
		has_planet_flag = f93_expand_drift_unlock
	}
	resources = {
		category = decisions
		cost = {
			influence = 500
			minor_artifacts = 750
			trade = 10000
		}
	}
	
	effect = {
		add_deposit = f93_expanded_drifter_operations
	}
}