tech_psionic_aura = {
	cost = @tier3cost1
	area = society
	tier = 3
	category = { psionics }
	weight = 0 # given by event
	is_rare = yes

	potential = {
		has_shroud_dlc = yes
	}

	feature_flags = {
		unlock_psionic_aura
	}

	modifier = {
		custom_tooltip = psionic_aura_delve_success_tt
	}

	# unlocks psionic auras

	ai_weight = {
		base = 1
		modifier = {
			factor = 10000
			is_psionic = yes
		}
	}
}

tech_aura_intensification = {
	cost = @tier4cost1
	area = society
	tier = 4
	category = { psionics }
	weight = 0 # given by event
	is_rare = yes
	prerequisites = { "tech_psionic_aura" }

	potential = {
		has_shroud_dlc = yes
	}

	feature_flags = {
		allow_psionic_aura_intensity_spread
		allow_psionic_aura_intensity_growth
	}

	modifier = {
		custom_tooltip = aura_intensification_delve_success_tt
	}

	# allows psionic auras to grow in intensity and spread

	ai_weight = {
		base = 1
		modifier = {
			factor = 10000
			is_psionic = yes
		}
	}
}

tech_psionic_suppression = {
	cost = @tier2cost1
	area = society
	tier = 2
	category = { psionics }
	weight = @tier2weight1

	potential = {
		has_shroud_dlc = yes
		has_encountered_psionic_auras = yes
	}

	prereqfor_desc = {
		custom = {
			title = tech_psionic_suppression_feature_tt
		}
	}

	# unlocks shroud seals and psionic suppressors

	weight_modifier = {
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_psionic_suppression
		}
		modifier = {
			factor = 0
			has_origin = origin_mindwardens
		}
	}

	ai_weight = {
		base = 1
		modifier = {
			factor = 1000
			OR = {
				has_origin = origin_mindwardens
				any_system_within_border = {
					any_neighbor_system = {
						has_psionic_aura = yes
						aura_owner = {
							opinion = { who = root value < 0 }
						}
					}
				}
				AND = {
					is_nomadic = yes
					any_owned_nonprimary_starbase = {
						is_waystation_starbase = yes
						solar_system = {
							OR = {
								AND = {
									has_psionic_aura = yes
									aura_owner = {
										opinion = {
											who = root
											value < 0
										}
									}
								}
								any_neighbor_system = {
									has_psionic_aura = yes
									aura_owner = {
										opinion = {
											who = root
											value < 0
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

tech_aura_resonation = {
	cost = @tier3cost1
	area = society
	tier = 3
	category = { psionics }
	weight = 0 # given by event
	is_rare = yes
	prerequisites = { "tech_psionic_aura" }

	potential = {
		has_shroud_dlc = yes
	}

	# unlocks Psionic Projectors

	ai_weight = {
		base = 1
		modifier = {
			factor = 1000 # Not as prio as tech_psionic_aura but still very good
			is_psionic = yes
		}
	}
}

tech_materiality_engine = {
	cost = @tier5cost1
	area = society
	tier = 3
	category = { psionics }
	weight = 0 # given by event
	is_rare = yes

	potential = {
		has_shroud_dlc = yes
	}

	# unlocks Materiality Engines

	ai_weight = {
		base = 1
		modifier = {
			factor = 10 # Overall a good tech to have if you're psionic
			is_psionic = yes
		}
	}
}

#####################
# Shroud Components #
#####################

tech_psionic_bombers = {
	cost = @tier5cost2
	area = society
	tier = 5
	category = { psionics }
	is_rare = yes
	weight = 0 # given by event
	is_reverse_engineerable = no

	potential = {
		has_shroud_dlc = yes
	}

	technology_swap = {
		name = tech_bio_psionic_bombers
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { psionics }
		weight = {
			factor = 1
		}
	}

	# unlocks Psionic Bombers

	ai_weight = {
		factor = 10 # Overall a good tech to have

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_strike_craft
		}
	}
}

tech_psionic_lightning = {
	cost = @tier5cost2
	area = society
	tier = 5
	category = { psionics }
	is_rare = yes
	weight = 0 # given by event
	is_reverse_engineerable = no

	potential = {
		has_shroud_dlc = yes
	}

	technology_swap = {
		name = tech_bio_psionic_lightning
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { psionics }
		weight = {
			factor = 1
		}
	}

	# unlocks Psionic Lighting

	ai_weight = {
		factor = 10 # Overall a good tech to have

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}

tech_psionic_disruptor = {
	cost = @tier5cost2
	area = society
	tier = 5
	category = { psionics }
	is_rare = yes
	weight = 0 # given by event
	is_reverse_engineerable = no

	potential = {
		has_shroud_dlc = yes
	}

	technology_swap = {
		name = tech_bio_psionic_disruptor
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { psionics }
		weight = {
			factor = 1
		}
	}

	# unlocks Psionic Disruptors

	ai_weight = {
		factor = 10 # Overall a good tech to have

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}

tech_zro_launcher = {
	cost = @tier5cost2
	area = society
	tier = 5
	category = { psionics }
	is_rare = yes
	weight = 0 # given by event
	is_reverse_engineerable = no

	potential = {
		has_shroud_dlc = yes
	}

	technology_swap = {
		name = tech_bio_zro_launcher
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { psionics }
		weight = {
			factor = 1
		}
	}

	# unlocks Zro Launchers

	ai_weight = {
		factor = 10 # Overall a good tech to have

		inline_script = {
			script = ai/weapon_preference_weight
			WEAPON_TYPE = weapon_type_energy
		}
	}
}
