############################################################
###          Technologies : required components          ###
############################################################

# ── Improved Zero-Point Reactor				: tier 6 reactor for ships and stations
#     └─ Singularity Reactor					: tier 7 reactor for ships and stations
#         └─ Improved Singularity Reactor		: tier 8 reactor for ships and stations
# ── Improved Dark Matter Reactor				: tier 7 reactor for ships and stations [vanilla FE reactor upgrade]
#     └─ Perfected Dark Matter Reactor			: tier 8 reactor for ships and stations [vanilla FE reactor upgrade]
# ── Shroud Well								: tier 8 psionic reactor
#
# ── Automated Dreadnought Computer				: very strong computer for bigger hulls; requires observed Automatic Dreadnought / Leviathans DLC
# ── Nanite Thought Matrix						: nanite-based combat computers
# ── Gigapredator Instincts						: special bioship combat computers
#
# ── Improved Tachyon Sensors					: tier 5 sensors for ships and stations
#     └─ String Theory							: tier 6 sensors for ships and stations
#         ├─ String Fluctuation Analysis		: tier 7 sensors for ships and stations
#         ├─ Psionic Sensors					: tier 7 sensors for ships and stations
#         └─ Eyes Clarivoyancy					: special tier 7 sensor for bioships
#             └─ Superior Eyes Clarivoyancy		: special tier 8 sensor for bioships
#                 └─ God-eye					: special tier 9 sensor for bioships
# ── Precursor Sensor Arrays					: tier 8 sensors
#
# ── Antimatter Thrusters						: tier 5 thrusters for ships
#     └─ Gravity Manipulation Engines			: tier 6 thrusters for ships
#
# ── Improved Jump Drive						: tier 2 jump drive
#     └─ Ultrahyperbolic Jump Drive				: tier 3 jump drive
# ── Precursor Jump Drive						: tier 3 jump drive [FE debris only]
# ── Improved Psi Jump Drive					: tier 2 psi jump drive
#     └─ Shroud Guide							: tier 3 psi jump drive
#
# ── Titan Aura: Mirage System					: unlocks titan aura "Mirage System"
# ── Titan Aura: Nanite Infiltration			: unlocks titan aura "Nanite Infiltration Swarm"
# ── Titan Aura: Space Distortion				: unlocks titan aura "Space Distortion Module"

############################################################
##              Improved Zero-Point Reactor               ##
############################################################

esc_tech_reactor_6 = {
	area = physics
	category = { particles }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	prerequisites = { "esc_tech_grand_research_initiative" "tech_zero_point_power" }
	ai_update_type = all
	gateway = ESC_REACTORS

	technology_swap = {
		name = esc_tech_reactor_6_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_REACTOR_6_TITLE"
			desc = "ESC_TECH_UNLOCK_REACTOR_6_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_reactors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 1.15
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
	}
}

############################################################
##                   Singularity Reactor                  ##
############################################################

esc_tech_reactor_7 = {
	area = physics
	category = { particles }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	prerequisites = { "esc_tech_reactor_6" }
	ai_update_type = all
	gateway = ESC_REACTORS

	technology_swap = {
		name = esc_tech_reactor_7_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_REACTOR_7_TITLE"
			desc = "ESC_TECH_UNLOCK_REACTOR_7_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_reactors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 1.15
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
	}
}

############################################################
##             Improved Singularity Reactor               ##
############################################################

esc_tech_reactor_8 = {
	area = physics
	category = { particles }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	prerequisites = { "esc_tech_reactor_7" }
	ai_update_type = all
	is_rare = yes

	technology_swap = {
		name = esc_tech_reactor_8_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_REACTOR_8_TITLE"
			desc = "ESC_TECH_UNLOCK_REACTOR_8_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_reactors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_reactor_8 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 1.15
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_reactor_8 }
			}
		}
	}
}

############################################################
##             Improved Dark Matter Reactor               ##
############################################################

esc_tech_dark_matter_power_core_2 = {
	area = physics
	category = { particles }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	prerequisites = { "tech_dark_matter_power_core" }
	ai_update_type = all
	is_rare = yes
	gateway = ESC_REACTORS

	technology_swap = {
		name = esc_tech_dark_matter_power_core_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_DM_REACTOR_2_TITLE"
			desc = "ESC_TECH_UNLOCK_DM_REACTOR_2_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_reactors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			has_global_flag = @ACOT_active_flag
		}
		modifier = {
			factor = 1.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_dark_matter_power_core_2 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			has_global_flag = @ACOT_active_flag
		}
		modifier = {
			factor = 1.15
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_dark_matter_power_core_2 }
			}
		}
	}
}

############################################################
##             Perfected Dark Matter Reactor              ##
############################################################

esc_tech_dark_matter_power_core_3 = {
	area = physics
	category = { particles }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	prerequisites = { "esc_tech_dark_matter_power_core_2" }
	ai_update_type = all
	is_rare = yes
	is_reverse_engineerable = no

	technology_swap = {
		name = esc_tech_dark_matter_power_core_3_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_DM_REACTOR_3_TITLE"
			desc = "ESC_TECH_UNLOCK_DM_REACTOR_3_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_reactors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			has_global_flag = @ACOT_active_flag
		}
		modifier = {
			factor = 1.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_dark_matter_power_core_3 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			has_global_flag = @ACOT_active_flag
		}
		modifier = {
			factor = 1.15
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_dark_matter_power_core_3 }
			}
		}
	}
}

############################################################
##                     Shroud Well                        ##
############################################################

esc_tech_reactor_psionic = {
	area = society
	category = { psionics }
	tier = 6
	cost = @ESC_TECH_tier6_cost3
	weight = @ESC_TECH_tier6_weight3
	prerequisites = { "esc_tech_reactor_6" "esc_tech_psionic_weapons" }
	ai_update_type = all
	is_rare = yes
	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_PSI_REACTOR_TITLE"
			desc = "ESC_TECH_UNLOCK_PSI_REACTOR_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_psionic_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
		modifier = {
			factor = 1.5
			OR = {
				has_ethic = ethic_spiritualist
				has_ethic = ethic_fanatic_spiritualist
			}
		}
		modifier = {
			factor = 0.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_reactor_psionic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
		modifier = {
			factor = 1.5
			OR = {
				has_ethic = ethic_spiritualist
				has_ethic = ethic_fanatic_spiritualist
			}
		}
		modifier = {
			factor = 0.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_reactor_psionic }
			}
		}
	}
}

### >>> >>> >>> >>> >>> --- --- ---  <<< <<< <<< <<< <<< ###

############################################################
##            Automatic Dreadnought Protocols             ##
############################################################

esc_tech_dreadnought_computer = {
	area = physics
	category = { computing }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	ai_update_type = all
	prerequisites = { "tech_cruisers" }
	is_rare = yes
	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_DREADNOUGHT_COMPUTER_TITLE"
			desc = "ESC_TECH_UNLOCK_DREADNOUGHT_COMPUTER_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_dreadnought_tech_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0	### event tech
		}
	}
}

############################################################
##                 Nanite Thought Matrix                  ##
############################################################

esc_tech_nanite_thought_matrix = {
	area = physics
	tier = 5
	cost = @tier5cost3
	category = { computing }
	ai_update_type = military
	prerequisites = { "esc_tech_synthetic_lifeform_studies" }
	weight = 0 # tech is given as a research option by an event
	is_rare = yes
	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_COMBAT_COMPUTERS_NANITE_TITLE"
			desc = "ESC_TECH_UNLOCK_COMBAT_COMPUTERS_NANITE_DESC"
		}
	}
}

############################################################
##                Gigapredator Instincts                  ##
############################################################

esc_tech_gigapredator_instincts = {
	area = society
	category = { biology }
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	ai_update_type = all
	prerequisites = { "tech_combat_computers_2" }
	is_rare = yes
	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_GIGAPREDATOR_TITLE"
			desc = "ESC_TECH_UNLOCK_GIGAPREDATOR_DESC"
		}
	}

	potential = {
		country_uses_bio_ships = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_dreadnought_tech_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0	### event tech
		}
	}
}

### >>> >>> >>> >>> >>> --- --- ---  <<< <<< <<< <<< <<< ###

############################################################
##                 Improved Tachyon Sensors               ##
############################################################

esc_tech_sensors_5 = {
	area = physics
	category = { computing }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	prerequisites = { "tech_sensors_4" "esc_tech_grand_research_initiative" }
	ai_update_type = all

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_ADV_TACHYON_SENSOR_TITLE"
			desc = "ESC_TECH_UNLOCK_ADV_TACHYON_SENSOR_DESC"
		}
	}

	modifier = {
		science_ship_survey_speed = 0.10
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
	}
}

############################################################
##                      String Theory                     ##
############################################################

esc_tech_sensors_6 = {
	area = physics
	category = { computing }
	tier = 5
	cost = @tier5cost3
	weight = @tier5weight3
	prerequisites = { "esc_tech_sensors_5" }
	ai_update_type = all
	is_rare = yes

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_STRING_SENSOR_TITLE"
			desc = "ESC_TECH_UNLOCK_STRING_SENSOR_DESC"
		}
	}

	modifier = {
		science_ship_survey_speed = 0.10
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_6 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_6 }
			}
		}
	}
}

############################################################
##                String Fluctuation Analysis             ##
############################################################

esc_tech_sensors_7 = {
	area = physics
	category = { computing }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	prerequisites = { "esc_tech_sensors_6" }
	ai_update_type = all
	is_rare = yes

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_ADV_STRING_SENSOR_TITLE"
			desc = "ESC_TECH_UNLOCK_ADV_STRING_SENSOR_DESC"
		}
	}

	modifier = {
		science_ship_survey_speed = 0.10
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_7 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_7 }
			}
		}
	}
}

############################################################
##                     Psionic Sensors                    ##
############################################################

esc_tech_sensors_psionic = {
	area = society
	category = { psionics }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	prerequisites = { "esc_tech_sensors_6" "esc_tech_psionic_weapons" }
	ai_update_type = all
	is_rare = yes
	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_PSI_SENSOR_TITLE"
			desc = "ESC_TECH_UNLOCK_PSI_SENSOR_DESC"
		}
	}

	modifier = {
		science_ship_survey_speed = 0.10
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_psionic_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 1.5
			OR = {
				has_ethic = ethic_spiritualist
				has_ethic = ethic_fanatic_spiritualist
			}
		}
		modifier = {
			factor = 0.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_psionic }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = 1.5
			OR = {
				has_ethic = ethic_spiritualist
				has_ethic = ethic_fanatic_spiritualist
			}
		}
		modifier = {
			factor = 0.25
			OR = {
				has_ethic = ethic_materialist
				has_ethic = ethic_fanatic_materialist
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_sensors_psionic }
			}
		}
	}
}

############################################################
##                    Eye of Clarivoyancy                 ##
############################################################

esc_tech_clairvoyancy_eyes_1 = {
	area = society
	category = { biology }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	prerequisites = { "esc_tech_sensors_6" }
	ai_update_type = all
	is_rare = yes

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_CLAIVOYANCY_1_TITLE"
			desc = "ESC_TECH_UNLOCK_CLAIVOYANCY_1_DESC"
		}
	}

	potential = {
		country_uses_bio_ships = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_1 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_1 }
			}
		}
	}
}

############################################################
##               Superior Eye of Clarivoyancy             ##
############################################################

esc_tech_clairvoyancy_eyes_2 = {
	area = society
	category = { biology }
	tier = 6
	cost = @ESC_TECH_tier6_cost2
	weight = @ESC_TECH_tier6_weight2
	prerequisites = { "esc_tech_clairvoyancy_eyes_1" }
	ai_update_type = all
	is_rare = yes

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_CLAIVOYANCY_2_TITLE"
			desc = "ESC_TECH_UNLOCK_CLAIVOYANCY_2_DESC"
		}
	}

	potential = {
		country_uses_bio_ships = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_2 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_2 }
			}
		}
	}
}

############################################################
##               Superior Eye of Clarivoyancy             ##
############################################################

esc_tech_clairvoyancy_eyes_3 = {
	area = society
	category = { biology }
	tier = 6
	cost = @ESC_TECH_tier6_cost3
	weight = @ESC_TECH_tier6_weight3
	prerequisites = { "esc_tech_clairvoyancy_eyes_2" }
	ai_update_type = all
	is_rare = yes

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_CLAIVOYANCY_3_TITLE"
			desc = "ESC_TECH_UNLOCK_CLAIVOYANCY_3_DESC"
		}
	}

	potential = {
		country_uses_bio_ships = yes
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_3 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_clairvoyancy_eyes_3 }
			}
		}
	}
}

############################################################
##                 Precursor Sensor Arrays                ##
############################################################

esc_tech_sensors_precursor = {
	area = physics
	category = { computing }
	tier = 6
	cost = @ESC_TECH_tier6_cost3
	weight = 0
	prerequisites = { }
	ai_update_type = all
	is_rare = yes

	technology_swap = {
		name = esc_tech_sensors_precursor_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_PRECURSOR_SENSOR_TITLE"
			desc = "ESC_TECH_UNLOCK_PRECURSOR_SENSOR_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_sensors_forbidden }
	}
}

### >>> >>> >>> >>> >>> --- --- ---  <<< <<< <<< <<< <<< ###

############################################################
##                 Anti-matter Thrusters                  ##
############################################################

esc_tech_thrusters_5 = {
	area = engineering
	category = { propulsion }
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	ai_update_type = all
	prerequisites = { "esc_tech_grand_research_initiative" "tech_thrusters_4" }

	technology_swap = {
		name = esc_tech_thrusters_5_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_THRUSTERS_5_TITLE"
			desc = "ESC_TECH_UNLOCK_THRUSTERS_5_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_thrusters_forbidden }
	}

	weight_modifier = {
		factor = 1.25
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
	}
}

############################################################
##              Gravity Manipulation Engines              ##
############################################################

esc_tech_thrusters_6 = {
	area = engineering
	category = { propulsion }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = all
	prerequisites = { "esc_tech_gravity_manipulation" "esc_tech_thrusters_5" }
	is_rare = yes

	technology_swap = {
		name = esc_tech_thrusters_6_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "ESC_TECH_UNLOCK_THRUSTERS_6_TITLE"
			desc = "ESC_TECH_UNLOCK_THRUSTERS_6_DESC"
		}
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_thrusters_forbidden }
	}

	weight_modifier = {
		factor = 1.25
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_thrusters_6 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_thrusters_6 }
			}
		}
	}
}

### >>> >>> >>> >>> >>> --- --- ---  <<< <<< <<< <<< <<< ###

############################################################
##                  Improved Jump Drive                   ##
############################################################

esc_tech_jump_drive_2 = {
	area = physics
	category = { particles }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = all
	prerequisites = { tech_jump_drive_1 }
	is_rare = yes

	technology_swap = {
		name = esc_tech_jump_drive_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = @ACOT_active_flag } # ACOT has better drives
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_ftl_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_jump_drive_2 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier #FTL techs are good
	}
}

############################################################
##             Ultrahyperbolic Jump Drive                 ##
############################################################

esc_tech_jump_drive_3 = {
	area = physics
	category = { particles }
	tier = 7
	cost = @ESC_TECH_tier7_cost1
	weight = @ESC_TECH_tier7_weight1
	ai_update_type = all
	prerequisites = { esc_tech_jump_drive_2 }
	is_rare = yes
	is_reverse_engineerable = no

	technology_swap = {
		name = esc_tech_jump_drive_3_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = @ACOT_active_flag } # ACOT has better drives
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_ftl_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_jump_drive_3 }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier #FTL techs are good
	}
}

############################################################
##                 Precursor Jump Drive                   ##
############################################################

esc_tech_jump_drive_precursor = {
	area = physics
	category = { particles }
	tier = 7
	cost = @ESC_TECH_tier7_cost1
	weight = 0 # can only be found in FE debris if playing with ESC overwrites
	ai_update_type = all
	is_rare = yes

	technology_swap = {
		name = esc_tech_jump_drive_precursor_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_ftl_forbidden }
	}
}

############################################################
##               Improved Psi Jump Drive                  ##
############################################################

esc_tech_psi_jump_drive_2 = {
	area = society
	category = { psionics }
	tier = 6
	cost = @ESC_TECH_tier6_cost1
	weight = @ESC_TECH_tier6_weight1
	ai_update_type = all
	prerequisites = { tech_psi_jump_drive_1 }
	is_rare = yes
	is_reverse_engineerable = no

	technology_swap = {
		name = esc_tech_psi_jump_drive_2_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = @ACOT_active_flag } # ACOT has better drives
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_ftl_forbidden }
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_psionic_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier #FTL techs are good
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
	}
}

############################################################
##                      Shroud Guide                      ##
############################################################

esc_tech_psi_jump_drive_3 = {
	area = society
	category = { psionics }
	tier = 6 # there aren't enough tier 6 society techs to unlock tier 7 on just psionics
	cost = @ESC_TECH_tier7_cost1
	weight = @ESC_TECH_tier7_weight1
	ai_update_type = all
	prerequisites = { esc_tech_psi_jump_drive_2 }
	is_rare = yes
	is_reverse_engineerable = no

	technology_swap = {
		name = esc_tech_psi_jump_drive_3_bio
		inherit_icon = no
		inherit_effects = yes
		trigger = { country_uses_bio_ships = yes }
		weight = { factor = 1 }
	}

	potential = {
		NOT = { has_global_flag = @ACOT_active_flag } # ACOT has better drives
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_ftl_forbidden }
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_psionic_weapons_forbidden }
	}

	weight_modifier = {
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_maniacal }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_2 }
				has_trait_in_council = { TRAIT = leader_trait_maniacal_3 }
			}
		}
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier #FTL techs are good
		modifier = {
			factor = 0
			ESC_TRIGGER_may_research_psionic_weapons_advanced = no
		}
	}
}

### >>> >>> >>> >>> >>> --- --- ---  <<< <<< <<< <<< <<< ###

############################################################
##                Titan Aura: Mirage System               ##
############################################################

esc_tech_aura_mirage_system = {
	area = physics
	category = { computing }
	cost = @tier5cost1
	weight = @tier5weight1
	tier = 5
	prerequisites = { "tech_titans" }
	is_rare = yes

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_auxiliary_forbidden }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
	 		title = "ESC_TECH_UNLOCK_TITAN_AURA_MIRAGE"
	 		desc = "ESC_TECH_UNLOCK_TITAN_AURA_MIRAGE_DESC"
	 	}
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_mirage_system }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_mirage_system }
			}
		}
	}
}

############################################################
##         Titan Aura: Nanite Infiltration Swarm          ##
############################################################

esc_tech_aura_nanite_swarm = {
	area = society
	category = { materials }
	tier = 5
	cost = @tier5cost2
	weight = @tier5weight2
	prerequisites = { "tech_titans" "esc_tech_synthetic_lifeform_studies" }
	is_rare = yes

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_auxiliary_forbidden }
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_nanite_weapons_forbidden }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
	 		title = "ESC_TECH_UNLOCK_TITAN_AURA_NANITES"
	 		desc = "ESC_TECH_UNLOCK_TITAN_AURA_NANITES_DESC"
	 	}
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_nanite_swarm }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_nanite_swarm }
			}
		}
	}
}

############################################################
##          Titan Aura: Space Distortion Module           ##
############################################################

esc_tech_aura_space_distortion = {
	area = physics
	category = { field_manipulation }
	tier = 5
	cost = @tier5cost2
	weight = @tier5weight2
	prerequisites = { "tech_titans" "esc_tech_gravity_manipulation" }
	is_rare = yes

	potential = {
		NOT = { has_global_flag = ESC_GLOBAL_FLAG_auxiliary_forbidden }
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
	 		title = "ESC_TECH_UNLOCK_TITAN_AURA_SPATIAL"
	 		desc = "ESC_TECH_UNLOCK_TITAN_AURA_SPATIAL_DESC"
	 	}
	}

	weight_modifier = {
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_space_distortion }
			}
		}
	}

	ai_weight = {
		factor = @ESC_AI_tech_weight_multiplier
		modifier = {
			factor = @ESC_TECH_Technology_Ascendancy_weight_modifier
			has_ascension_perk = ap_technological_ascendancy
		}
		modifier = {
			factor = @federation_perk_factor
			has_federation = yes
			federation = {
				has_federation_perk = rare_tech_boost
				any_member = { has_technology = esc_tech_aura_space_distortion }
			}
		}
	}
}
