# ## physics technologies

# ##################
# Science Ship
# ##################

tech_space_exploration = {
	cost = 0
	area = physics
	start_tech = yes
	category = { computing }
	tier = 0

	#allow auto-explore on science ships
	feature_flags = {
		tech_automated_exploration
		unlocks_auto_research
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_SCIENCE_SHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_SCIENCE_SHIP_CONSTRUCTION_DESC"
		}
	}
}

# ##################
# Basic Science Lab
# ##################

tech_basic_science_lab_1 = {
	cost = @tier0cost1
	area = physics
	tier = 0
	category = { computing }
	start_tech = yes

	# # unlock basic science lab lvl 1
	weight_modifier = {
		factor = 1000
	}

	ai_weight = {
		weight = 10000
	}

	starting_potential = {
		is_low_tech_start = no # So Broken Shackles origin players don't start with it
	}
}

tech_basic_science_lab_2 = {
	area = physics
	category = { computing }
	tier = 1
	cost = @tier1cost3
	prerequisites = { "tech_basic_science_lab_1" }
	weight = @tier1weight3

	# unlocks upgraded labs

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_science_lab_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_exotic_gases
				has_technology = tech_exotic_gases
				has_country_flag = has_market_access
			}
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {
		factor = @ai_research_lab_factor

	}
}

tech_basic_science_lab_3 = {
	area = physics
	category = { computing }
	tier = 3
	cost = @tier3cost1
	prerequisites = { "tech_basic_science_lab_2" "tech_colonial_centralization" }
	weight = @tier3weight1

	# unlocks 2nd upgraded labs

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_science_lab_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
			NOT = {
			has_ascension_perk = ap_weather_control }
		}
	}
	technology_swap = {
		name = tech_basic_science_lab_3
		inherit_icon = yes
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = no
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_particle_storm_tt
			}
		}
		weight = {
			factor = 1
		}
	}
	technology_swap = {
		name = tech_wilderness_science_lab_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_particle_storm_tt
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		factor = 2

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {
		factor = @ai_research_lab_factor

	}
}

tech_global_research_initiative = {
	area = physics
	tier = 3
	cost = @tier3cost1
	category = { computing }

	potential = {
		is_wilderness_empire = no
	}

	prerequisites = { "tech_basic_science_lab_2" "tech_colonial_centralization" }

	weight = @tier3weight1

	weight_modifier = {
		factor = 1.5
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_computing }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {

	}
}

tech_curator_lab = {
	area = physics
	category = { computing }
	tier = 2
	cost = @tier2cost1
	is_reverse_engineerable = no
	is_rare = yes
	weight = @tier2weight1

	modifier = {
		science_ship_survey_speed = 0.33
	}

	weight_modifier = {
		modifier = {
			factor = 0.50
			has_modifier = "curator_insight"
		}
		modifier = {
			factor = 3
			has_trait_in_council = { TRAIT = leader_trait_curator }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_curator_lab
		}
		modifier = {
			factor = 0
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_modifier = "curator_insight"
			}
		}
	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_CURATOR_LAB_1_TITLE"
			desc = "TECH_UNLOCK_CURATOR_LAB_1_DESC"
		}
	}
}

tech_archeology_lab = {
	area = physics
	category = { computing }
	tier = 2
	cost = @tier2cost1
	is_reverse_engineerable = no
	is_rare = yes
	weight = @tier2weight1

	modifier = {
		ship_anomaly_generation_chance_mult = 0.10
		ship_anomaly_research_speed_mult = 0.25
	}

	weight_modifier = {
		modifier = {
			factor = 0.50
			has_modifier = "curator_insight"
		}
		modifier = {
			factor = 3
			has_trait_in_council = { TRAIT = leader_trait_curator }
		}
		modifier = {
			factor = 0
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_modifier = "curator_insight"
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_archeology_lab
		}
	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_CURATOR_LAB_2_TITLE"
			desc = "TECH_UNLOCK_CURATOR_LAB_2_DESC"
		}
	}

	potential = {
		has_ancrel = no
	}
}

tech_space_science_1 = {
	cost = @tier1cost1
	area = physics
	tier = 1
	category = { computing }
	prerequisites = { "tech_space_construction" }
	weight = @tier1weight1

	modifier = {
		station_researchers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_science_1
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_science_nomads_tt
			tech_space_science_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_science_2 = {
	cost = @tier1cost3
	area = physics
	tier = 1
	category = { computing }
	prerequisites = { "tech_space_science_1" }
	weight = @tier1weight3

	modifier = {
		station_researchers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_science_2
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_science_nomads_tt
			tech_space_science_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_science_3 = {
	cost = @tier2cost1
	area = physics
	tier = 2
	category = { computing }
	prerequisites = { "tech_space_science_2" }
	weight = @tier2weight1

	modifier = {
		station_researchers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_science_3
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_science_nomads_tt
			tech_space_science_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_science_4 = {
	cost = @tier2cost3
	area = physics
	tier = 2
	category = { computing }
	prerequisites = { "tech_space_science_3" }
	weight = @tier2weight3

	modifier = {
		station_researchers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_science_4
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_science_nomads_tt
			tech_space_science_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_science_5 = {
	cost = @tier3cost1
	area = physics
	tier = 3
	category = { computing }
	prerequisites = { "tech_space_science_4" }
	weight = @tier3weight1

	modifier = {
		station_researchers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_science_5
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_science_nomads_tt
			tech_space_science_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

# ##################
# Physics Lab and Computers/AI
# ##################

tech_physics_1 = {
	area = physics
	category = { field_manipulation }
	tier = 1
	cost = @tier1cost3
	prerequisites = { "tech_basic_science_lab_1" }
	weight = @tier1weight3

	potential = {
		is_wilderness_empire = no
	}

	weight_modifier = {
		modifier = {
			factor = 5
			is_ai = yes
		}
		modifier = {
			factor = 2
			years_passed > 5
		}
		modifier = {
			factor = 2
			years_passed > 10
		}
		modifier = {
			factor = 2
			years_passed > 15
		}
		modifier = {
			factor = 2
			years_passed > 20
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {
		factor = @ai_physics_tech_speed_factor
		factor = @zone_clear_ai_tech_factor
	}
}

tech_physics_2 = {
	area = physics
	category = { field_manipulation }
	tier = 2
	cost = @tier2cost3
	prerequisites = { "tech_physics_1" }
	weight = @tier2weight3

	potential = {
		is_wilderness_empire = no
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
		modifier = {
			factor = 2
			years_passed > 25
		}
		modifier = {
			factor = 2
			years_passed > 30
		}
		modifier = {
			factor = 2
			years_passed > 35
		}
		modifier = {
			factor = 2
			years_passed > 40
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {
		factor = @ai_physics_tech_speed_factor
		factor = @zone_clear_ai_tech_factor
	}
}

tech_physics_3 = {
	area = physics
	category = { field_manipulation }
	tier = 3
	cost = @tier3cost3
	prerequisites = { "tech_physics_2" }
	weight = @tier3weight3

	potential = {
		is_wilderness_empire = no
	}

	weight_modifier = {
		modifier = {
			factor = 2
			years_passed > 25
		}
		modifier = {
			factor = 2
			years_passed > 30
		}
		modifier = {
			factor = 2
			years_passed > 35
		}
		modifier = {
			factor = 2
			years_passed > 40
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {
		factor = @ai_physics_tech_speed_factor
	}
}

#tech_physics_4 = {
#	cost = {
#		factor = @tier4breakthrough
#	}
#	area = physics
#	tier = 5
#	category = { field_manipulation }
#	prerequisites = { "tech_physics_3" }
#	is_breakthrough = yes
#	weight = @tier4weightbreakthrough
#
#	gateway = espionage
#
#	modifier = {
#		custom_tooltip = breakthrough_physics_unlock_tooltip
#	}
#
#	weight_modifier = {
#		modifier = {
#			factor = 2
#			years_passed > 25
#		}
#		modifier = {
#			factor = 2
#			years_passed > 30
#		}
#		modifier = {
#			factor = 2
#			years_passed > 35
#		}
#		modifier = {
#			factor = 2
#			years_passed > 40
#		}
#
#		modifier = {
#			factor = 1.5
#			is_specialist_subject_type = { TYPE = scholarium }
#		}
#	}
#
#	ai_weight = {
#		factor = @ai_physics_tech_speed_factor
#	}
#}

tech_administrative_ai = {
	area = physics
	tier = 1
	cost = @tier1cost1
	category = { computing }
	prerequisites = { "tech_basic_science_lab_1" }
	weight = @tier1weight1

	modifier = {
		all_technology_research_speed = 0.05
		planet_researchers_upkeep_mult = 0.05
	}

	technology_swap = {
		name = tech_administrative_ai_synth_fert
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			has_origin = origin_synthetic_fertility
		}
		modifier = {
			custom_tooltip = tech_administrative_ai_synth_fert_tt
			show_only_custom_tooltip = no
			all_technology_research_speed = 0.05
			planet_researchers_upkeep_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {

	}
}

#AI-Controlled Colony Ships
tech_cryostasis_1 = {
	cost = @tier1cost3
	area = physics
	tier = 1
	category = { computing }
	prerequisites = { "tech_administrative_ai" "tech_colonization_1" }
	weight = @tier1weight3

	potential = {
		is_nomadic = no
	}

	modifier = {
		planet_colony_development_speed_mult = 0.50
	}

	weight_modifier = {

	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_cryostasis_1_wilderness
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_wilderness_empire = yes
		}
		modifier = {
			terraform_speed_mult = 0.50
		}
	}
}

#Self-Aware Colony Ships
tech_cryostasis_2 = {
	cost = @tier2cost3
	area = physics
	tier = 3
	category = { computing }
	prerequisites = { "tech_self_aware_logic" "tech_cryostasis_1" }
	weight = @tier2weight3

	potential = {
		is_nomadic = no
	}

	modifier = {
		planet_colony_development_speed_mult = 0.50
	}

	weight_modifier = {

	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_cryostasis_2_wilderness
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_wilderness_empire = yes
		}
		modifier = {
			terraform_speed_mult = 0.50
		}
	}
}

tech_self_aware_logic = {
	area = physics
	tier = 2
	cost = @tier2cost2
	category = { computing }
	prerequisites = { "tech_administrative_ai" }
	weight = @tier2weight2

	modifier = {
		num_tech_alternatives_add = 1
	}

	technology_swap = {
		name = tech_self_aware_logic_synth_fert
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			has_origin = origin_synthetic_fertility
		}
		modifier = {
			custom_tooltip = tech_self_aware_logic_synth_fert_tt
			show_only_custom_tooltip = no
			num_tech_alternatives_add = 1
		}
	}

	weight_modifier = {
		modifier = {
			factor = 2
			has_origin = origin_synthetic_fertility
		}
	}

	ai_weight = {

	}
}

#Automated Exploration Protocols
tech_automated_exploration = {
	area = physics
	tier = 1
	cost = @tier1cost2
	category = { computing }
	weight = @tier1weight2

	modifier = {
		science_ship_survey_speed = 0.25
	}

	weight_modifier = {

		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}

		modifier = {
			factor = 0
			years_passed < 5
		}

		modifier = {
			factor = 2.0
			is_ai = no
			years_passed > 10
		}

		modifier = {
			factor = 2.0
			is_ai = no
			years_passed > 15
		}

		modifier = {
			factor = 2.0
			is_ai = no
			years_passed > 20
		}

		modifier = {
			factor = 2.0
			num_owned_planets > 5
		}

		modifier = {
			factor = 2.0
			num_owned_planets > 10
		}

		modifier = {
			factor = 2.0
			num_owned_planets > 15
		}

		modifier = {
			factor = 2.0
			num_owned_planets > 20
		}
	}

	ai_weight = {

	}
}

tech_sapient_ai = {
	area = physics
	tier = 4
	cost = @tier4cost1
	category = { computing }
	prerequisites = { "tech_self_aware_logic" }
	weight = @tier4weight1

	modifier = {
		all_technology_research_speed = 0.05
		planet_researchers_upkeep_mult = 0.05
	}

	technology_swap = {
		name = tech_sapient_ai_synth_fert
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			has_origin = origin_synthetic_fertility
		}
		modifier = {
			custom_tooltip = tech_sapient_ai_synth_fert_tt
			show_only_custom_tooltip = no
			all_technology_research_speed = 0.05
			planet_researchers_upkeep_mult = 0.05
		}
	}

	potential = {
		NOT = { has_ethic = ethic_gestalt_consciousness }
	}

	weight_modifier = {
		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
		modifier = {
			factor = 2
			has_origin = origin_synthetic_fertility
		}
	}

	ai_weight = {

	}
}

tech_positronic_implants = {
	area = physics
	tier = 4
	cost = @tier4cost1
	category = { computing }
	prerequisites = { "tech_self_aware_logic" }
	weight = @tier4weight1

	modifier = {
		all_technology_research_speed = 0.05
		planet_researchers_upkeep_mult = 0.05
	}

	potential = {
		has_ethic = ethic_gestalt_consciousness
	}

	weight_modifier = {

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = scholarium }
		}
	}

	ai_weight = {

	}
}

tech_combat_computers_1 = {
	area = physics
	tier = 1
	cost = @tier1cost3
	category = { computing }
	prerequisites = { "tech_administrative_ai" }
	weight = @tier1weight3

	# unlocks aggressive / defensive combat computers

	weight_modifier = {
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_destroyers
				has_technology = tech_weavers
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_cruisers
				has_technology = tech_harbingers
			}
		}
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_battleships
				has_technology = tech_stingers
			}
		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_COMBAT_COMPUTERS_1_TITLE"
			desc = "TECH_UNLOCK_COMBAT_COMPUTERS_1_DESC"
		}
	}

	ai_weight = {

	}
}

tech_combat_computers_2 = {
	area = physics
	tier = 3
	cost = @tier3cost1
	category = { computing }
	prerequisites = { "tech_combat_computers_1" "tech_self_aware_logic" }
	weight = @tier3weight1

	# unlocks additional combat computers

	weight_modifier = {

	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_COMBAT_COMPUTERS_2_TITLE"
			desc = "TECH_UNLOCK_COMBAT_COMPUTERS_2_DESC"
		}
	}

	ai_weight = {

	}
}

tech_combat_computers_3 = {
	area = physics
	tier = 4
	cost = @tier4cost2
	category = { computing }
	is_rare = yes
	is_dangerous = yes
	prerequisites = { "tech_combat_computers_2" "tech_sapient_ai" }
	weight = @tier4weight2

	# unlocks sapient combat computers

	potential = {
		NOT = { has_ethic = ethic_gestalt_consciousness }
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.20
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_computing }
				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 = 0
			has_policy_flag = ai_outlawed
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_combat_computers_3
		}

		#BREAKTHROUGH - check for scientist
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_COMBAT_COMPUTERS_3_TITLE"
			desc = "TECH_UNLOCK_COMBAT_COMPUTERS_3_DESC"
		}
	}

	ai_weight = {

	}
}

tech_combat_computers_autonomous = {
	area = physics
	tier = 4
	cost = @tier4cost2
	category = { computing }
	is_rare = yes
	prerequisites = { "tech_combat_computers_2" }
	weight = @tier4weight2

	# unlocks autonomous combat computers

	potential = {
		has_ethic = ethic_gestalt_consciousness
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.20
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_computing }
				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 }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_combat_computers_autonomous
		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_COMBAT_COMPUTERS_AUTONOMOUS_TITLE"
			desc = "TECH_UNLOCK_COMBAT_COMPUTERS_AUTONOMOUS_DESC"
		}
	}

	ai_weight = {

	}
}

tech_auxiliary_fire_control = {
	area = physics
	tier = 1
	cost = @tier1cost3
	category = { computing }
	prerequisites = { "tech_combat_computers_1" }
	weight = @tier1weight3

	# unlocks aggressive / defensive combat computers

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_synchronized_defences = {
	area = physics
	tier = 4
	cost = @tier4cost2
	category = { computing }
	prerequisites = { "tech_self_aware_logic" }
	is_rare = yes
	weight = @tier4weight2

	potential = {
		is_nomadic = no
	}

	# unlocks starbase building - defense-grid supercomputer

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.50
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_computing }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}
		modifier = {
			factor = 0.75
			has_ethic = ethic_pacifist
		}
		modifier = {
			factor = 0.65
			has_ethic = ethic_fanatic_pacifist
		}
		modifier = {
			factor = 1.10
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.20
			has_ethic = ethic_fanatic_militarist
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_synchronized_defences
		}
	}

	ai_weight = {

	}
}

tech_consumer_good_refinement_1 = {
	cost = @tier2cost1
	area = physics
	tier = 2
	category = { computing }
	prerequisites = { "tech_luxuries_1" "tech_administrative_ai" }
	weight = @tier2weight1

	modifier = {
		planet_artisans_produces_mult = 0.05
	}

	potential = {
		country_uses_consumer_goods = yes
	}

	weight_modifier = {
		factor = 2

	}

	ai_weight = {

	}
}

tech_consumer_good_refinement_2 = {
	cost = @tier4cost1
	area = physics
	tier = 4
	category = { computing }
	prerequisites = { "tech_luxuries_2" "tech_consumer_good_refinement_1" "tech_self_aware_logic" }
	weight = @tier4weight1

	modifier = {
		planet_artisans_produces_mult = 0.05
	}

	potential = {
		country_uses_consumer_goods = yes
	}

	weight_modifier = {
		factor = 2

	}

	ai_weight = {

	}
}

tech_neuro_quantum_links = {
	area = physics
	tier = 3
	cost = @tier3cost1
	category = { computing }
	prerequisites = { "tech_basic_science_lab_2" "tech_integrated_cybernetics" }
	weight = @tier3weight1

	modifier = {
		planet_jobs_specialist_produces_mult = 0.025
	}

	potential = {
		is_wilderness_empire = no
		OR = {
			is_machine_empire = no
			has_civic = civic_machine_assimilator
		}
	}

	weight_modifier = {
		factor = 1.5
		modifier = {
			factor = 0
			NOR = {
				has_ascension_perk = ap_the_flesh_is_weak
				has_ascension_perk = ap_organo_machine_interfacing
				has_ascension_perk = ap_organo_machine_interfacing_assimilator
			}
		}
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_computing }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}
	}

	ai_weight = {

	}
}

### ENCRYPTION / DECRYPTION

tech_encryption_1 = {
	area = physics
	tier = 1
	cost = @tier1cost2
	category = { computing }
	prerequisites = { "tech_colonial_bureaucracy" }
	weight = @tier1weight3

	gateway = espionage

	modifier = {
		intel_encryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

tech_encryption_2 = {
	area = physics
	tier = 2
	cost = @tier2cost2
	category = { computing }
	prerequisites = { "tech_encryption_1" }
	weight = @tier2weight3

	gateway = espionage

	modifier = {
		intel_encryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

tech_encryption_3 = {
	area = physics
	tier = 4
	cost = @tier4cost2
	category = { computing }
	prerequisites = { "tech_encryption_2" }
	weight = @tier3weight3

	modifier = {
		intel_encryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

tech_decryption_1 = {
	area = physics
	tier = 1
	cost = @tier1cost2
	category = { computing }
	prerequisites = { "tech_colonial_bureaucracy" }
	weight = @tier1weight3

	gateway = espionage

	modifier = {
		intel_decryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

tech_decryption_2 = {
	area = physics
	tier = 2
	cost = @tier2cost2
	category = { computing }
	prerequisites = { "tech_decryption_1" }
	weight = @tier2weight3

	gateway = espionage

	modifier = {
		intel_decryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

tech_decryption_3 = {
	area = physics
	tier = 4
	cost = @tier4cost2
	category = { computing }
	prerequisites = { "tech_decryption_2" }
	weight = @tier3weight3

	modifier = {
		intel_decryption_add = 2
	}

	weight_modifier = {

		modifier = {
			factor = 0.1
			NOR = {
				is_ai = yes # AIs don't get the informative event that flags this
				has_country_flag = first_spynetwork
			}
		}
		modifier = {
			factor = 5
			has_tradition = tr_subterfuge_adopt
		}
	}

	ai_weight = {

	}
}

# ##################
# Ship Reactors
# ##################

tech_fission_power = {
	area = physics
	cost = 0
	tier = 0
	start_tech = yes
	category = { particles }

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_FISSION_POWER_TITLE"
			desc = "TECH_UNLOCK_FISSION_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_fission_power
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_FISSION_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_FISSION_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}
}

tech_fusion_power = {
	area = physics
	cost = @tier1cost2
	tier = 1
	category = { particles }
	prerequisites = { "tech_fission_power" }
	weight = @tier1weight2

	gateway = power_generation

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_FUSION_POWER_TITLE"
			desc = "TECH_UNLOCK_FUSION_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_fusion_power
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_FUSION_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_FUSION_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		factor = 2
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_destroyers
				has_technology = tech_stingers
				has_technology = tech_weavers
				has_technology = tech_harbingers
			}
		}
	}

	ai_weight = {

	}
}

tech_cold_fusion_power = {
	area = physics
	cost = @tier2cost2
	tier = 2
	category = { particles }
	prerequisites = { "tech_fusion_power" }
	weight = @tier2weight2

	gateway = power_generation

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_COLD_FUSION_POWER_TITLE"
			desc = "TECH_UNLOCK_COLD_FUSION_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_cold_fusion_power
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_COLD_FUSION_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_COLD_FUSION_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		factor = 2
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_cruisers
				has_technology = tech_harbingers
			}
		}
	}

	ai_weight = {

	}
}

tech_antimatter_power = {
	area = physics
	cost = @tier3cost2
	tier = 3
	category = { particles }
	prerequisites = { "tech_cold_fusion_power" }
	weight = @tier3weight2

	gateway = power_generation

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_ANTIMATTER_POWER_TITLE"
			desc = "TECH_UNLOCK_ANTIMATTER_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_antimatter_power
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_ANTIMATTER_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_ANTIMATTER_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		factor = 2
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_battleships
				has_technology = tech_stingers
			}
		}
	}

	ai_weight = {

	}
}

tech_zero_point_power = {
	area = physics
	cost = @tier4cost2
	tier = 4
	category = { particles }
	prerequisites = { "tech_antimatter_power" }
	weight = @tier4weight2

	gateway = power_generation

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_ZERO_POINT_POWER_TITLE"
			desc = "TECH_UNLOCK_ZERO_POINT_POWER_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_zero_point_power
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_ZERO_POINT_POWER_TITLE"
				desc = "TECH_UNLOCK_BIO_ZERO_POINT_POWER_DESC"
			}
		}
		weight = {
			factor = 1
		}
	}

	weight_modifier = {
		factor = 2
		modifier = {
			factor = 2
			OR = {
				has_technology = tech_battleships
				has_technology = tech_stingers
			}
		}
	}

	ai_weight = {
		modifier = {
			factor = @shattered_ring_ai_tech_factor
			has_origin = origin_shattered_ring
		}
	}
}

tech_reactor_boosters_1 = {
	area = physics
	cost = 0
	tier = 0
	start_tech = yes
	category = { particles }
	prerequisites = { "tech_fission_power" }
}

tech_reactor_boosters_2 = {
	area = physics
	cost = @tier1cost3
	tier = 1
	category = { particles }
	prerequisites = { "tech_fusion_power" "tech_reactor_boosters_1" }
	weight = @tier1weight3

	weight_modifier = {
		factor = 1.5

	}

	ai_weight = {

	}
}

tech_reactor_boosters_3 = {
	area = physics
	cost = @tier3cost3
	tier = 1
	category = { particles }
	prerequisites = { "tech_antimatter_power" "tech_reactor_boosters_2" }
	weight = @tier3weight3

	weight_modifier = {
		factor = 1.5

	}

	ai_weight = {

	}
}


# ##################
# Shields and related techs
# ##################

tech_shields_1 = {
	area = physics
	cost = 0
	tier = 0
	category = { field_manipulation }
	start_tech = yes

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

tech_shields_2 = {
	area = physics
	cost = @tier1cost3
	tier = 1
	category = { field_manipulation }
	prerequisites = { "tech_shields_1" }
	weight = @tier1weight3

	modifier = {
		army_health = 0.05
	}

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
	}

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

	ai_weight = {
		modifier = {
			factor = @shattered_ring_ai_tech_factor
			has_origin = origin_shattered_ring
		}
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shields_3 = {
	area = physics
	cost = @tier2cost3
	tier = 2
	category = { field_manipulation }
	prerequisites = { "tech_shields_2" }
	weight = @tier2weight3

	modifier = {
		army_health = 0.05
	}

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
	}

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

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shields_4 = {
	area = physics
	cost = @tier3cost3
	tier = 3
	category = { field_manipulation }
	prerequisites = { "tech_shields_3" }
	weight = @tier3weight3

	modifier = {
		army_health = 0.05
	}

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
	}

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

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shields_5 = {
	area = physics
	cost = @tier4cost3
	tier = 4
	category = { field_manipulation }
	prerequisites = { "tech_shields_4" }
	weight = @tier4weight3

	modifier = {
		army_health = 0.05
	}

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
	}

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

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shield_rechargers_1 = {
	area = physics
	cost = @tier2cost3
	tier = 2
	category = { field_manipulation }
	prerequisites = { "tech_shields_3" }
	weight = @tier2weight3

	weight_modifier = {

	}

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shield_hardeners_1 = {
	area = physics
	cost = @tier2cost3
	tier = 2
	category = { field_manipulation }
	prerequisites = { "tech_shield_rechargers_1" "tech_exotic_gases" }
	weight = @tier2weight3

	weight_modifier = {

	}

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_shield_hardeners_2 = {
	area = physics
	cost = @tier5cost3
	tier = 5
	category = { field_manipulation }
	prerequisites = { "tech_shield_hardeners_1" "tech_mine_zro" }
	weight = @tier5weight3

	weight_modifier = {

	}

	ai_weight = {
		inline_script = "ai/shield_preference_weight"
	}
}

tech_planetary_shield_generator = {
	area = physics
	cost = @tier3cost1
	tier = 3
	category = { field_manipulation }
	is_rare = yes
	prerequisites = { "tech_shields_3" }
	weight = @tier3weight1

	technology_swap = {
		name = tech_nomads_shield_generator
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_nomadic = yes
		}
	}

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_shield_generator
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.5
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_field_manipulation }
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_planetary_shield_generator
		}
	}

	# unlocks building: planetary shield generator
}

# ##################
# Sensors
# ##################

tech_sensors_2 = {
	area = physics
	cost = @tier2cost1
	tier = 2
	category = { computing }
	weight = @tier2weight1

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_subterfuge_adopt
		}
		modifier = {
			factor = 1.25
			is_nomadic = no
			any_system_within_border = {
				is_inside_nebula = yes
			}
		}
		modifier = {
			factor = 1.25
			is_nomadic = yes
			any_owned_nonprimary_starbase = {
				is_waystation_starbase = yes
				solar_system = {
					is_inside_nebula = yes
				}
			}
		}
	}

	ai_weight = {

	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_SENSOR_2_TITLE"
			desc = "TECH_UNLOCK_SENSOR_2_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_sensors_2
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
			is_nomadic = no
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_SENSOR_2_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_SENSOR_2_DESC"
			}
		}
	}

	technology_swap = {
		name = tech_bioship_sensors_2
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_nomadic = yes
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_SENSOR_2_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_SENSOR_2_DESC"
			}
			custom = {
				title = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_TITLE"
				desc = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_DESC"
			}
		}
	}

	technology_swap = {
		name = tech_sensors_2
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_nomadic = yes
			country_uses_bio_ships = no
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_SENSOR_2_TITLE"
				desc = "TECH_UNLOCK_SENSOR_2_DESC"
			}
			custom = {
				title = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_TITLE"
				desc = "TECH_UNLOCK_DEEP_SCAN_CONTRACT_DESC"
			}
		}
	}
}

tech_sensors_3 = {
	area = physics
	cost = @tier3cost1
	tier = 3
	category = { computing }
	prerequisites = { "tech_sensors_2" }
	weight = @tier3weight1

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_subterfuge_adopt
		}
		modifier = {
			factor = 1.25
			is_nomadic = no
			any_system_within_border = {
				is_inside_nebula = yes
			}
		}
		modifier = {
			factor = 1.25
			is_nomadic = yes
			any_owned_nonprimary_starbase = {
				is_waystation_starbase = yes
				solar_system = {
					is_inside_nebula = yes
				}
			}
		}
	}

	ai_weight = {

	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_SENSOR_3_TITLE"
			desc = "TECH_UNLOCK_SENSOR_3_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_sensors_3
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_SENSOR_3_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_SENSOR_3_DESC"
			}
		}
	}
}

tech_sensors_4 = {
	area = physics
	cost = @tier4cost1
	tier = 4
	category = { computing }
	prerequisites = { "tech_sensors_3" }
	weight = @tier4weight1

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_subterfuge_adopt
		}
		modifier = {
			factor = 1.25
			is_nomadic = no
			any_system_within_border = {
				is_inside_nebula = yes
			}
		}
		modifier = {
			factor = 1.25
			is_nomadic = yes
			any_owned_nonprimary_starbase = {
				is_waystation_starbase = yes
				solar_system = {
					is_inside_nebula = yes
				}
			}
		}
	}

	ai_weight = {

	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_SENSOR_4_TITLE"
			desc = "TECH_UNLOCK_SENSOR_4_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_sensors_4
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_SENSOR_4_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_SENSOR_4_DESC"
			}
		}
	}
}

# ##################
# Power Plants
# ##################

tech_power_plant_1 = {
	cost = 0
	area = physics
	tier = 0
	category = { field_manipulation }
	start_tech = yes

	## unlock power plant lvl 1
}

#Power Plant II
tech_power_plant_2 = {
	cost = @tier1cost1
	area = physics
	tier = 1
	category = { field_manipulation }
	prerequisites = { "tech_power_plant_1" }
	weight = @tier1weight1

	gateway = zone

	modifier = {
		planet_technician_energy_produces_mult = 0.05
	}

	technology_swap = {
		name = tech_power_plant_2
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			planet_technician_energy_produces_mult = 0.05
			starbase_collected_system_energy_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_prosperity_adopt
		}
	}

	ai_weight = {
		factor = @technician_ai_factor
	}
}

#Power Plant III
tech_power_plant_3 = {
	cost = @tier2cost1
	area = physics
	tier = 2
	category = { field_manipulation }
	prerequisites = { "tech_power_plant_2" }
	weight = @tier2weight1

	modifier = {
		planet_technician_energy_produces_mult = 0.05
	}

	technology_swap = {
		name = tech_power_plant_3
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			planet_technician_energy_produces_mult = 0.05
			starbase_collected_system_energy_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_prosperity_adopt
		}
	}

	ai_weight = {
		factor = @technician_ai_factor
	}
}

#Power Plant IV
tech_power_plant_4 = {
	cost = @tier3cost1
	area = physics
	tier = 3
	category = { field_manipulation }
	prerequisites = { "tech_power_plant_3" }
	weight = @tier3weight1

	modifier = {
		planet_technician_energy_produces_mult = 0.05
	}

	technology_swap = {
		name = tech_power_plant_4
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
			NOT = {
				has_ascension_perk = ap_weather_control
			}
		}
		modifier = {
			planet_technician_energy_produces_mult = 0.05
			starbase_collected_system_energy_mult = 0.05
		}
	}

	technology_swap = {
		name = tech_power_plant_4
		inherit_icon = yes
		inherit_effects = yes
		trigger = {
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_electric_storm_tt
			}
		}
		weight = {
			factor = 1
		}
	}

	technology_swap = {
		name = tech_power_plant_4
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_electric_storm_tt
			}
		}
		modifier = {
			planet_technician_energy_produces_mult = 0.05
			starbase_collected_system_energy_mult = 0.05
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_prosperity_adopt
		}
	}

	ai_weight = {
		factor = @technician_ai_factor
	}
}

#Global Energy Management
tech_power_hub_1 = {
	cost = @tier1cost3
	area = physics
	tier = 1
	category = { field_manipulation }
	prerequisites = { "tech_power_plant_2" }
	weight = @tier1weight3

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_power_hub_1
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	weight_modifier = {
		factor = 2
		modifier = {
			factor = 1.25
			has_tradition = tr_prosperity_adopt
		}
		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = prospectorium }
		}
		modifier = {
			factor = 5
			OR = {
				num_districts = { type = district_generator value > 0 }
				num_districts = { type = district_hab_energy value > 0 }
				num_districts = { type = district_photosynthesis_fields value > 0 }
				num_districts = { type = district_geothermal value > 0 }
				has_any_generator_zone = yes
			}
		}
	}

	ai_weight = {
		factor = @energy_grid_ai_factor # Energy grid
		modifier = {
			factor = @shattered_ring_ai_tech_factor
			has_origin = origin_shattered_ring
		}
	}
}

#Planetary Power Grid
tech_power_hub_2 = {
	cost = @tier2cost3
	area = physics
	tier = 2
	category = { field_manipulation }
	prerequisites = { "tech_power_hub_1" "tech_colonial_centralization" }
	weight = @tier2weight3

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_exotic_gases
				has_technology = tech_exotic_gases
				has_country_flag = has_market_access
			}
		}
		modifier = {
			factor = 2
			has_tradition = tr_prosperity_adopt
		}

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = prospectorium }
		}
	}

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_power_hub_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	ai_weight = {
		factor = @energy_grid_ai_factor # Energy grid level 2
	}
}


# ##################
# FTL Drives
# ##################

tech_hyper_drive_1 = {
	cost = @tier0cost3
	area = physics
	tier = 0
	category = { particles }
	start_tech = yes

	is_reverse_engineerable = no

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_HYPERDRIVE_1_TITLE"
			desc = "TECH_UNLOCK_HYPERDRIVE_1_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_hyper_drive_1
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_HYPERDRIVE_1_TITLE"
				desc = "TECH_UNLOCK_BIO_HYPERDRIVE_1_DESC"
			}
		}
		weight = {
			factor = 5
		}
	}

	weight_modifier = {
		factor = 1000
	}

	ai_weight = {
		weight = 10000
	}

	starting_potential = {
		is_eager_explorer_empire = no
	}
}

tech_hyper_drive_2 = {
	cost = @tier2cost2
	area = physics
	tier = 2
	category = { particles }
	is_reverse_engineerable = no
	prerequisites = { "tech_hyper_drive_1" }
	weight = @tier2weight2

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = @ap_grasp_the_void_travel_tech
			has_ascension_perk = ap_grasp_the_void
		}
		modifier = {
			factor = @eager_explorer_effect
			is_eager_explorer_empire = yes
		}
		modifier = {
			factor = 10
			mid_game_years_passed > 0
			has_country_flag = chosen_empire
		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_HYPERDRIVE_2_TITLE"
			desc = "TECH_UNLOCK_HYPERDRIVE_2_DESC"
		}
	}

	technology_swap = {
		name = tech_bio_hyper_drive_2
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_HYPERDRIVE_2_TITLE"
				desc = "TECH_UNLOCK_BIO_HYPERDRIVE_2_DESC"
			}
		}
		weight = {
			factor = 5
		}
	}

	modifier = {
		planet_resettlement_unemployed_mult = 0.25
	}

	ai_weight = {

		modifier = {
			factor = 10
			has_country_flag = chosen_empire
		}
	}
}

tech_hyper_drive_3 = {
	cost = @tier3cost3
	area = physics
	tier = 3
	category = { particles }
	is_reverse_engineerable = no
	prerequisites = { "tech_hyper_drive_2" }
	weight = @tier3weight3

	technology_swap = {
		name = tech_hyper_drive_3
		inherit_icon = yes
		inherit_effects = yes
		trigger = {
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_celestial_storm_tt
			}
		}
		weight = {
			factor = 10
		}
	}

	technology_swap = {
		name = tech_bio_hyper_drive_3
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_HYPERDRIVE_3_TITLE"
				desc = "TECH_UNLOCK_BIO_HYPERDRIVE_3_DESC"
			}
		}
		weight = {
			factor = 5
		}
	}

	technology_swap = {
		name = tech_bio_hyper_drive_3
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_HYPERDRIVE_3_TITLE"
				desc = "TECH_UNLOCK_BIO_HYPERDRIVE_3_DESC"
			}
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_celestial_storm_tt
			}
		}
		weight = {
			factor = 10
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
		modifier = {
			factor = @ap_grasp_the_void_travel_tech
			has_ascension_perk = ap_grasp_the_void
		}
		modifier = {
			factor = @eager_explorer_effect
			is_eager_explorer_empire = yes
		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_HYPERDRIVE_3_TITLE"
			desc = "TECH_UNLOCK_HYPERDRIVE_3_DESC"
		}
	}

	modifier = {
		planet_resettlement_unemployed_mult = 0.25
	}

	ai_weight = {

	}
}

tech_wormhole_stabilization = {
	cost = @tier3cost1
	area = physics
	tier = 3
	category = { particles }
	is_rare = yes
	is_reverse_engineerable = no
	weight = @tier3weight1
	prerequisites = { "tech_hyper_drive_2" }

	feature_flags = { wormhole_stabilization }

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.5
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_particles }
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				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 = 1.25
			has_tradition = tr_discovery_adopt
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_wormhole_stabilization
		}
		modifier = {
			factor = @ap_grasp_the_void_travel_tech
			has_ascension_perk = ap_grasp_the_void
		}
		modifier = {
			factor = @eager_explorer_effect
			is_eager_explorer_empire = yes
		}
		modifier = {
			factor = 0
			NOR = {
				has_seen_any_bypass = wormhole
				any_relation = {
					is_country_type = default
					has_communications = ROOT
					has_technology = tech_wormhole_stabilization
				}
			}
		}
		modifier = {
			factor = 4
			owns_any_bypass = wormhole
		}
		modifier = {
			factor = 10
			mid_game_years_passed > 0
			has_country_flag = chosen_empire
		}
	}

	ai_weight = {
		modifier = {
			factor = 10
			has_country_flag = chosen_empire
		}
		modifier = {
			factor = 10
			mid_game_years_passed > 0
			has_country_flag = chosen_empire
		}
	}
}

tech_jump_drive_1 = {
	cost = @tier5cost1
	area = physics
	tier = 5
	category = { particles }
	is_reverse_engineerable = yes
	is_rare = yes
	is_dangerous = yes
	weight = @tier5weight1
	prerequisites = { "tech_zero_point_power" }

	feature_flags = {
		jump_method
	}

	technology_swap = {
		name = tech_bio_jump_drive_1
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIO_JUMPDRIVE_1_TITLE"
				desc = "TECH_UNLOCK_BIO_JUMPDRIVE_1_DESC"
			}
		}
	}

	weight_modifier = {
		factor = 0.1
		modifier = {
			factor = 0.1
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_particles }
				has_trait_in_council = { TRAIT = leader_trait_curator }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
				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 }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_jump_drive_1
		}
		modifier = {
			factor = @ap_grasp_the_void_travel_tech
			has_ascension_perk = ap_grasp_the_void
		}
		modifier = {
			factor = @eager_explorer_effect
			is_eager_explorer_empire = yes
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_discovery_adopt
		}
	}

	ai_weight = {
	}

	prereqfor_desc = {
		component = {
			title = "TECH_UNLOCK_JUMPDRIVE_1_TITLE"
			desc = "TECH_UNLOCK_JUMPDRIVE_1_DESC"
		}
	}
}

# ##################
# Debuff auras
# ##################

tech_ftl_inhibitor = {
	area = physics
	cost = @tier2cost1
	tier = 2
	category = { particles }
	prerequisites = { "tech_hyper_drive_1" }
	weight = @tier2weight1

	potential = {
		is_nomadic = no
	}

	feature_flags = {
		planetary_ftl_inhibitor
	}

	weight_modifier = {
		factor = 4 #FTL inhibitor is very important
		modifier = {
			factor = 1.25
			has_tradition = tr_unyielding_adopt
		}

	}

	ai_weight = {

	}
}
