######################
# Solar panels
#####################
tech_solar_panel_network = {
	area = engineering
	tier = 0
	category = { voidcraft }
	prerequisites = { "tech_starbase_2" }
	start_tech = yes

	potential = {
		is_nomadic = no
	}

	starting_potential = {
		is_nomadic = no
	}
}

# ##################
# Ship Sizes
# ##################
tech_corvettes = {
	cost = @tier0cost1
	area = engineering
	start_tech = yes
	category = { voidcraft }
	tier = 0

	potential = {
		country_uses_bio_ships = no
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_CORVETTE_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_CORVETTE_CONSTRUCTION_DESC"
		}
	}

	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
		country_uses_bio_ships = no
	}
}

tech_destroyers = {
	cost = @tier2cost1
	area = engineering
	tier = 2
	category = { voidcraft }
	prerequisites = { "tech_corvettes" }
	weight = @tier2weight1

	gateway = ship

	potential = {
		country_uses_bio_ships = no
	}

	## unlock destroyer
	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_DESTROYER_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_DESTROYER_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		command_limit_add = 20
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_destroyers
			}
		}
		modifier = {
			factor = 2
			years_passed > 15
		}
		modifier = {
			factor = 3
			years_passed > 20
		}
		modifier = {
			factor = 4
			years_passed > 30
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		factor = @ai_ship_types_factor

	}
}

tech_cruisers = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { voidcraft }
	prerequisites = { "tech_destroyers" }
	weight = @tier3weight1

	gateway = ship

	potential = {
		country_uses_bio_ships = no
	}

	## unlock cruisers
	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_CRUISER_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_CRUISER_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		command_limit_add = 40
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 20 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_cruisers
			}
		}
		modifier = {
			factor = 2
			years_passed > 30
		}
		modifier = {
			factor = 3
			years_passed > 35
		}
		modifier = {
			factor = 4
			years_passed > 40
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		factor = @ai_ship_types_factor

	}
}

tech_battleships = {
	cost = @tier4cost1
	area = engineering
	tier = 4
	category = { voidcraft }
	prerequisites = { "tech_cruisers" }
	weight = @tier4weight1

	potential = {
		country_uses_bio_ships = no
	}

	## unlock battleships
	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_BATTLESHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_BATTLESHIP_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		command_limit_add = 60
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_battleships
			}
		}
		modifier = {
			factor = 2
			years_passed > 60
		}
		modifier = {
			factor = 3
			years_passed > 65
		}
		modifier = {
			factor = 4
			years_passed > 70
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		factor = @ai_ship_types_factor

	}
}

tech_titans = {
	cost = @tier5cost1
	area = engineering
	tier = 5
	category = { voidcraft }
	prerequisites = {
		OR = {
			tech_battleships
			tech_stinger_growth_2
		}
	}
	weight = @tier5weight1

	modifier = {
		command_limit_add = 80
	}

	potential = {
		host_has_dlc = "Apocalypse"
	}

	## unlock titans
	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_TITAN_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_TITAN_CONSTRUCTION_DESC"
		}
		custom = {
			title = "TECH_UNLOCK_ION_CANNON_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_ION_CANNON_CONSTRUCTION_DESC"
		}
	}

	technology_swap = {
		name = tech_nomads_titans
		inherit_icon = yes
		inherit_effects = no

		trigger = {
			is_nomadic = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_ION_CANNON_CONSTRUCTION_TITLE"
				desc = "TECH_UNLOCK_ION_CANNON_CONSTRUCTION_DESC"
			}
			custom = {
				title = "TECH_UNLOCK_ARKSHIP_TITAN_AURAS_CONSTRUCTION_TITLE"
				desc = "TECH_UNLOCK_ARKSHIP_TITAN_AURAS_CONSTRUCTION_DESC"
			}
		}
	}

	technology_swap = {
		name = tech_biogenesis_titans
		inherit_icon = no
		inherit_effects = yes

		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { biology }
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 100 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_titans
			}
		}
		modifier = {
			factor = 2
			years_passed > 130
		}
		modifier = {
			factor = 3
			years_passed > 140
		}
		modifier = {
			factor = 4
			years_passed > 150
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		factor = @ai_ship_types_factor

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

tech_juggernaut = {
	cost = @tier5cost3
	area = engineering
	category = { voidcraft }
	tier = 5
	prerequisites = {
		OR = {
			tech_starbase_5
			tech_arkship_construction
		}
		OR = {
			tech_battleships
			tech_harbinger_growth_2
		}
	}
	weight = @tier5weight3
	is_rare = yes

	potential = {
		host_has_dlc = "Federations"
	}

	technology_swap = {
		name = tech_nomads_juggernaut
		inherit_icon = yes
		inherit_effects = no

		trigger = {
			is_nomadic = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_ARKSHIP_JUGGERNAUT_AURAS_CONSTRUCTION_TITLE"
				desc = "TECH_UNLOCK_ARKSHIP_JUGGERNAUT_AURAS_CONSTRUCTION_DESC"
			}
		}
	}

	technology_swap = {
		name = tech_biogenesis_juggernaut
		inherit_icon = no
		inherit_effects = yes

		trigger = {
			country_uses_bio_ships = yes
		}
		area = society
		category = { biology }
	}

	# unlocks Juggernaut
	weight_modifier = {
		factor = 0.25
		modifier = {
			factor = 1.5
			OR = {
				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_juggernaut
		}
		modifier = {
			factor = 1.25
			has_technology = "tech_titans"
		}

	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		ship = {
			title = "TECH_UNLOCK_JUGGERNAUT_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_JUGGERNAUT_CONSTRUCTION_DESC"
		}
	}

	ai_weight = {
		factor = @ai_ship_types_factor

	}
}

# ##################
# Corvette upgrades
# ##################

tech_corvette_build_speed = {
	cost = @tier1cost2
	area = engineering
	tier = 1
	category = { voidcraft }
	prerequisites = { "tech_corvettes" }
	weight = @tier1weight2

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_corvette_build_speed_effect
		ship_corvette_cost_mult = -0.05
		shipsize_corvette_build_speed_mult = 0.25
		shipsize_offspring_corvette_build_speed_mult = 0.25
		shipsize_frigate_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_small_space_fauna_build_speed
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			small_space_fauna_ship_cost_mult = -0.05
			small_space_fauna_build_speed_mult = 0.25
		}
	}
}

tech_corvette_hull_1 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { voidcraft }
	prerequisites = { "tech_corvettes" }
	weight = @tier1weight3

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_corvette_hull_effect
		shipsize_corvette_hull_mult = 0.1
		shipsize_offspring_corvette_hull_mult = 0.1
		shipsize_frigate_hull_mult = 0.1
	}

	weight_modifier = {
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_small_space_fauna_hull_1
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			small_space_fauna_ship_hull_mult = 0.1
		}
	}
}

tech_corvette_hull_2 = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_corvette_hull_1" }
	weight = @tier2weight3

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_corvette_hull_effect
		shipsize_corvette_hull_mult = 0.1
		shipsize_offspring_corvette_hull_mult = 0.1
		shipsize_frigate_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_corvette_hull_2
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_small_space_fauna_hull_2
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			small_space_fauna_ship_hull_mult = 0.1
		}
	}
}

# ##################
# Destroyer upgrades
# ##################

tech_destroyer_build_speed = {
	cost = @tier2cost2
	area = engineering
	tier = 2
	category = { voidcraft }
	prerequisites = { "tech_destroyers" }
	weight = @tier2weight2

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_destroyer_build_speed_effect
		ship_destroyer_cost_mult = -0.05
		shipsize_destroyer_build_speed_mult = 0.25
		shipsize_offspring_destroyer_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_medium_space_fauna_build_speed
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			medium_space_fauna_ship_cost_mult = -0.05
			medium_space_fauna_build_speed_mult = 0.25
		}
	}
}

tech_destroyer_hull_1 = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { voidcraft }
	prerequisites = { "tech_destroyers" }
	weight = @tier2weight3

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_destroyer_hull_effect
		shipsize_destroyer_hull_mult = 0.1
		shipsize_offspring_destroyer_hull_mult = 0.1
	}

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

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_medium_space_fauna_hull_1
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			medium_space_fauna_ship_hull_mult = 0.1
		}
	}
}

tech_destroyer_hull_2 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_destroyer_hull_1" }
	weight = @tier3weight1

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_destroyer_hull_effect
		shipsize_destroyer_hull_mult = 0.1
		shipsize_offspring_destroyer_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_destroyer_hull_2
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_medium_space_fauna_hull_2
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			medium_space_fauna_ship_hull_mult = 0.1
		}
	}

}

# ##################
# Cruiser upgrades
# ##################

tech_cruiser_build_speed = {
	cost = @tier3cost2
	area = engineering
	tier = 3
	category = { voidcraft }
	prerequisites = { "tech_cruisers" }
	weight = @tier3weight2

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_cruiser_build_speed_effect
		ship_cruiser_cost_mult = -0.05
		shipsize_cruiser_build_speed_mult = 0.25
		shipsize_offspring_cruiser_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_large_space_fauna_build_speed
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			large_space_fauna_ship_cost_mult = -0.05
			large_space_fauna_build_speed_mult = 0.25
		}
	}
}

tech_cruiser_hull_1 = {
	cost = @tier3cost3
	area = engineering
	tier = 3
	category = { voidcraft }
	prerequisites = { "tech_cruisers" }
	weight = @tier3weight3

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_cruiser_hull_effect
		shipsize_cruiser_hull_mult = 0.1
		shipsize_offspring_cruiser_hull_mult = 0.1
	}

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

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_large_space_fauna_hull_1
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			large_space_fauna_ship_hull_mult = 0.1
		}
	}
}

tech_cruiser_hull_2 = {
	cost = @tier4cost1
	area = engineering
	tier = 4
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_cruiser_hull_1" }
	weight = @tier4weight1

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_cruiser_hull_effect
		shipsize_cruiser_hull_mult = 0.1
		shipsize_offspring_cruiser_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_cruiser_hull_2
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_large_space_fauna_hull_2
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			large_space_fauna_ship_hull_mult = 0.1
		}
	}
}

# ##################
# Battleship upgrades
# ##################

tech_battleship_build_speed = {
	cost = @tier4cost2
	area = engineering
	tier = 4
	category = { voidcraft }
	prerequisites = { "tech_battleships" }
	weight = @tier4weight2

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_battleship_build_speed_effect
		ship_battleship_cost_mult = -0.05
		shipsize_battleship_build_speed_mult = 0.25
		shipsize_offspring_battleship_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}

	technology_swap = {
		name = tech_extra_large_space_fauna_build_speed
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			extra_large_space_fauna_ship_cost_mult = -0.05
			extra_large_space_fauna_build_speed_mult = 0.25
		}
	}
}

tech_battleship_hull_1 = {
	cost = @tier4cost3
	area = engineering
	tier = 4
	category = { voidcraft }
	prerequisites = { "tech_battleships" }
	weight = @tier4weight3

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_battleship_hull_effect
		shipsize_battleship_hull_mult = 0.1
		shipsize_offspring_battleship_hull_mult = 0.1
	}

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

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_extra_large_space_fauna_hull_1
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			extra_large_space_fauna_ship_hull_mult = 0.1
		}
	}
}

tech_battleship_hull_2 = {
	cost = @tier5cost1
	area = engineering
	tier = 5
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_battleship_hull_1" }
	weight = @tier5weight1

	potential = {
		country_uses_bio_ships = no
	}

	modifier = {
		custom_tooltip = tech_battleship_hull_effect
		shipsize_battleship_hull_mult = 0.1
		shipsize_offspring_battleship_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_battleship_hull_2
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_extra_large_space_fauna_hull_2
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			extra_large_space_fauna_ship_hull_mult = 0.1
		}
	}
}

# ##################
# Titan upgrades
# ##################

tech_titan_hull_1 = {
	cost = @tier5cost2
	area = engineering
	tier = 5
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_titans" }
	weight = @tier5weight2

	modifier = {
		shipsize_titan_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_titan_hull_1
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_titanic_space_fauna_hull_1
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			titanic_space_fauna_ship_hull_mult = 0.1
		}
	}
}

tech_titan_hull_2 = {
	cost = @tier5cost3
	area = engineering
	tier = 5
	is_rare = yes
	category = { voidcraft }
	prerequisites = { "tech_titan_hull_1" }
	weight = @tier5weight3

	modifier = {
		shipsize_titan_hull_mult = 0.1
	}

	weight_modifier = {
		modifier = {
			factor = 0.25
			NOR = {
				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_expertise_voidcraft }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_titan_hull_2
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_supremacy_adopt
		}
	}

	ai_weight = {
		inline_script = "ai/hull_preference_weight"
	}

	technology_swap = {
		name = tech_titanic_space_fauna_hull_2
		inherit_icon = no
		inherit_effects = no

		trigger = {
			is_beastmasters_empire = yes
		}

		modifier = {
			titanic_space_fauna_ship_hull_mult = 0.1
		}
	}
}

# ##################
# Starbases
# ##################

tech_starbase_1 = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { voidcraft }
	prerequisites = { "tech_space_construction" }
	tier = 0

	potential = {
		is_nomadic = no
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_OUTPOST_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_OUTPOST_CONSTRUCTION_DESC"
		}
	}

	# unlocks Outposts

	starting_potential = {
		is_nomadic = no
	}
}


tech_starbase_2 = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { voidcraft }
	tier = 0
	prerequisites = { "tech_starbase_1" }

	potential = {
		is_nomadic = no
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_STARPORT_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_STARPORT_CONSTRUCTION_DESC"
		}
	}

	# unlocks Starport
	ai_weight = {
		factor = @ai_starbase_types_factor
		modifier = {
			factor = @shattered_ring_ai_tech_factor
			has_origin = origin_shattered_ring
		}
	}

	starting_potential = {
		is_nomadic = no
	}
}

tech_starbase_3 = {
	cost = @tier2cost2
	area = engineering
	category = { voidcraft }
	tier = 2
	prerequisites = { "tech_starbase_2" }
	weight = @tier2weight2

	potential = {
		is_nomadic = no
	}

	# unlocks Starhold
	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 20 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_starbase_3
			}
		}
		modifier = {
			factor = 2
			years_passed > 30
		}
		modifier = {
			factor = 3
			years_passed > 35
		}
		modifier = {
			factor = 4
			years_passed > 40
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_starport
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_unyielding_adopt
		}
		modifier = {
			factor = 10
			has_modifier = agenda_impenetrable_border_finish
		}
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_STARHOLD_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_STARHOLD_CONSTRUCTION_DESC"
		}
	}

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

tech_starbase_4 = {
	cost = @tier3cost2
	area = engineering
	category = { voidcraft }
	tier = 3
	prerequisites = { "tech_starbase_3" }
	weight = @tier3weight2

	potential = {
		is_nomadic = no
	}

	# unlocks Star Fortress
	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_starbase_4
			}
		}
		modifier = {
			factor = 2
			years_passed > 60
		}
		modifier = {
			factor = 3
			years_passed > 65
		}
		modifier = {
			factor = 4
			years_passed > 70
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_starhold
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_unyielding_adopt
		}
		modifier = {
			factor = 5
			has_modifier = agenda_impenetrable_border_finish
		}
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_STAR_FORTRESS_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_STAR_FORTRESS_CONSTRUCTION_DESC"
		}
	}

	ai_weight = {
		factor = @ai_starbase_types_factor

	}
}

tech_starbase_5 = {
	cost = @tier4cost2
	area = engineering
	category = { voidcraft }
	tier = 4
	prerequisites = { "tech_starbase_4" }
	weight = @tier4weight2

	potential = {
		is_nomadic = no
	}

	# unlocks Citadel
	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 70 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_starbase_5
			}
		}
		modifier = {
			factor = 2
			years_passed > 90
		}
		modifier = {
			factor = 3
			years_passed > 95
		}
		modifier = {
			factor = 4
			years_passed > 100
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_starfortress
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_unyielding_adopt
		}
		modifier = {
			factor = 5
			has_modifier = agenda_impenetrable_border_finish
		}
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_CITADEL_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_CITADEL_CONSTRUCTION_DESC"
		}
	}

	ai_weight = {
		factor = @ai_starbase_types_factor

	}
}

tech_habitat_1 = {
	cost = @tier3cost2
	area = engineering
	category = { voidcraft }
	tier = 3
	prerequisites = { "tech_starbase_3" }
	weight = @tier3weight2

	potential = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	# unlocks Habitats
	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_habitat_1
			}
		}
		modifier = {
			factor = 2
			years_passed > 60
		}
		modifier = {
			factor = 3
			years_passed > 65
		}
		modifier = {
			factor = 4
			years_passed > 70
		}
		modifier = {
			factor = 5
			count_starbase_sizes = {
				starbase_size = starbase_starhold
				count >= 3
			}
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_adopt
		}
		modifier = {
			factor = 1.25
			has_tradition = tr_expansion_finish
		}
	}

	prereqfor_desc = {
		ship = {
			title = "allow_habitats"
			desc = "habitat_central_complex_MEGASTRUCTURE_DETAILS"
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			OR = {
				has_origin = origin_toxic_knights
				has_country_flag = payback_habitat
				has_valid_civic = civic_void_hive
			}
		}
	}
}

tech_habitat_2 = {
	cost = @tier4cost2
	area = engineering
	category = { voidcraft }
	tier = 4
	prerequisites = { "tech_habitat_1" "tech_starbase_4" }
	weight = @tier4weight3
	is_rare = yes

	potential = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	modifier = {
		habitat_max_districts_add = 1
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = {
				any_owned_planet = {
					is_planet_class = pc_habitat
				}
			}
		}
		modifier = {
			factor = 10
			is_void_dweller_empire = yes
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_habitat_2
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			OR = {
				has_origin = origin_toxic_knights
				has_country_flag = payback_habitat
				has_valid_civic = civic_void_hive
			}
		}
	}
}

tech_habitat_3 = {
	cost = @tier5cost2
	area = engineering
	category = { voidcraft }
	tier = 4
	prerequisites = { "tech_habitat_2" "tech_starbase_5" }
	weight = @tier4weight3
	is_rare = yes

	potential = {
		is_wilderness_empire = no
		is_nomadic = no
	}

	modifier = {
		habitat_max_districts_add = 1
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOT = {
				any_owned_planet = {
					is_planet_class = pc_habitat
				}
			}
		}
		modifier = {
			factor = 10
			is_void_dweller_empire = yes
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_habitat_3
		}
	}

	ai_weight = {
		modifier = {
			factor = 100
			OR = {
				is_void_dweller_empire = yes
				has_origin = origin_toxic_knights
				has_country_flag = payback_habitat
				has_valid_civic = civic_void_hive
			}
		}
	}
}

# ##################
# Starbases upgrades
# ##################

# Modular Engineering
tech_modular_engineering = {
	cost = @tier2cost3
	area = engineering
	category = { voidcraft }
	tier = 2
	prerequisites = {
		OR = {
			"tech_starbase_3"
			"tech_waystation_2"
		}
	}
	is_rare = yes
	weight = @tier2weight3

	modifier = {
		starbase_buildings_cost_mult = -0.25
		starbase_modules_cost_mult = -0.25
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.5
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_voidcraft }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_modular_engineering
		}
	}

	ai_weight = {

	}
}

#Corps of Engineers
tech_space_defense_station_improvement = {
	cost = @tier3cost3
	area = engineering
	tier = 3
	category = { voidcraft }
	prerequisites = { "tech_starbase_4" "tech_modular_engineering" }
	is_rare = yes
	weight = @tier3weight3

	modifier = {
		starbase_upgrade_cost_mult = -0.15
		starbase_upgrade_speed_mult = 0.25
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.25
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_voidcraft }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}
		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_space_defense_station_improvement
		}
		modifier = {
			factor = 1.25
			is_militarist = yes
		}
	}

	ai_weight = {

	}
}

# ##################
# Strike Craft
# ##################

tech_strike_craft_1 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { voidcraft }
	weight = @tier1weight3

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

	## unlock strike craft 1

	weight_modifier = {
	}

	ai_weight = {

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

tech_strike_craft_2 = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { voidcraft }
	prerequisites = { "tech_strike_craft_1" }
	weight = @tier2weight3

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

	## unlock strike craft 2

	weight_modifier = {
	}

	ai_weight = {

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

tech_strike_craft_3 = {
	cost = @tier3cost3
	area = engineering
	tier = 3
	category = { voidcraft }
	prerequisites = { "tech_strike_craft_2" }
	weight = @tier3weight3

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

	## unlock strike craft 3

	weight_modifier = {
	}

	ai_weight = {

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

tech_strike_craft_skrand = {
	cost = @tier4cost3
	area = engineering
	is_rare = yes
	tier = 4
	category = { voidcraft }
	prerequisites = { }
	weight = 0

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

	## unlock unique strike craft component from Skrand storyline
	potential = {
		has_paragon_dlc = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		base = 100

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

# ##################
# Armies & Attachments
# ##################

tech_assault_armies = {
	cost = @tier1cost1
	area = engineering
	tier = 0
	category = { voidcraft }
	prerequisites = { "tech_planetary_defenses" }
	start_tech = yes
}

# ##################
# Ship Armor Components
# ##################

#Nanocomposite Materials
tech_ship_armor_1 = {
	cost = @tier1cost1
	area = engineering
	tier = 0
	category = { materials }
	start_tech = yes

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

#Ceramo-Metal Materials
tech_ship_armor_2 = {
	area = engineering
	cost = @tier1cost2
	tier = 1
	category = { materials }
	prerequisites = { "tech_ship_armor_1" }
	weight = @tier1weight2

	gateway = infrastructure

	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_ship_armor_2
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

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

#Plasteel Materials
tech_ship_armor_3 = {
	area = engineering
	cost = @tier2cost2
	tier = 2
	category = { materials }
	prerequisites = { "tech_ship_armor_2" }
	weight = @tier2weight2

	gateway = infrastructure

	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_ship_armor_3
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

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

#Durasteel Materials
tech_ship_armor_4 = {
	area = engineering
	cost = @tier3cost2
	tier = 3
	category = { materials }
	prerequisites = { "tech_ship_armor_3" }
	weight = @tier3weight2

	gateway = infrastructure

	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_ship_armor_4
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

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

#Neutronium Materials
tech_ship_armor_5 = {
	area = engineering
	cost = @tier4cost2
	tier = 4
	category = { materials }
	prerequisites = { "tech_ship_armor_4" }
	weight = @tier4weight2

	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_ship_armor_5
		inherit_icon = no
		inherit_effects = yes
		trigger = {
			country_uses_bio_ships = yes
		}
		weight = {
			factor = 1
		}
	}

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

# ##################
# Ship Hull Improvement Components
# ##################

#Crystal-Infused Plating
tech_crystal_armor_1 = {
	area = engineering
	cost = @tier2cost3
	tier = 2
	category = { materials }
	weight = 0
	weight_modifier = {
		modifier = {
			add = 5
			has_country_flag = crystal_armor_1_weight
		}
	}

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

#Crystal-Forged Plating
tech_crystal_armor_2 = {
	area = engineering
	cost = @tier4cost1
	tier = 4
	is_rare = yes
	category = { materials }
	weight = 0

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

tech_armor_hardeners_1 = {
	area = engineering
	cost = @tier2cost3
	tier = 2
	category = { materials }
	prerequisites = { "tech_advanced_metallurgy_1" "tech_rare_crystals" }
	weight = @tier2weight3

	weight_modifier = {

	}

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

tech_armor_hardeners_2 = {
	area = engineering
	cost = @tier5cost3
	tier = 5
	category = { materials }
	prerequisites = { "tech_armor_hardeners_1" "tech_mine_living_metal" }
	weight = @tier5weight3

	weight_modifier = {

	}

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

# ##################
# Thruster Components
# ##################

#Chemical Thrusters
tech_thrusters_1 = {
	area = engineering
	cost = 0
	start_tech = yes
	tier = 0
	category = { propulsion }

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_THRUSTER_1_TITLE"
			desc = "TECH_UNLOCK_THRUSTER_1_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_thrusters_1
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_THRUSTER_1_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_THRUSTER_1_DESC"
			}
		}
	}
}

#Ion Thrusters
tech_thrusters_2 = {
	area = engineering
	cost = @tier2cost1
	tier = 2
	category = { propulsion }
	prerequisites = { "tech_thrusters_1" }
	weight = @tier2weight1

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 2
			OR = {
				has_technology = tech_destroyers
				has_technology = tech_weavers
			}
		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_THRUSTER_2_TITLE"
			desc = "TECH_UNLOCK_THRUSTER_2_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_thrusters_2
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_THRUSTER_2_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_THRUSTER_2_DESC"
			}
		}
	}

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

#Plasma Thrusters
tech_thrusters_3 = {
	area = engineering
	cost = @tier3cost1
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_thrusters_2" }
	weight = @tier3weight1

	weight_modifier = {
		factor = 1.25

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

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_THRUSTER_3_TITLE"
			desc = "TECH_UNLOCK_THRUSTER_3_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_thrusters_3
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_THRUSTER_3_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_THRUSTER_3_DESC"
			}
		}
	}

	ai_weight = {

	}
}

#Impulse Thrusters
tech_thrusters_4 = {
	area = engineering
	cost = @tier4cost1
	tier = 4
	category = { propulsion }
	prerequisites = { "tech_thrusters_3" }
	weight = @tier4weight1

	weight_modifier = {
		factor = 1.25

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

		}
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_THRUSTER_4_TITLE"
			desc = "TECH_UNLOCK_THRUSTER_4_DESC"
		}
	}

	technology_swap = {
		name = tech_bioship_thrusters_4
		inherit_icon = no
		inherit_effects = no
		trigger = {
			country_uses_bio_ships = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_BIOSHIP_THRUSTER_4_TITLE"
				desc = "TECH_UNLOCK_BIOSHIP_THRUSTER_4_DESC"
			}
		}
	}

	ai_weight = {

	}
}

# ##################
# Defense Platforms
# ##################

#Defense Platform
tech_space_defense_station_1 = {
	cost = 0
	tier = 0
	area = engineering
	start_tech = yes
	category = { voidcraft }
	prerequisites = { "tech_starbase_1" }

	potential = {
		is_nomadic = no
	}

	starting_potential = {
		is_nomadic = no
	}
}

tech_defense_platform_hull_1 = {
	cost = @tier2cost2
	area = engineering
	tier = 2
	category = { voidcraft }
	prerequisites = { "tech_starbase_3" }
	is_rare = yes
	weight = @tier2weight2

	weight_modifier = {
		factor = 0.50
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_defense_platform_hull_1
		}
		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = bulwark }
		}
	}

	modifier = {
		shipsize_military_station_small_hull_mult = 0.1
	}
}

# ##################
# Industry and Robotics
# ##################

tech_basic_industry = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { industry }
	tier = 0

	# unlocks basic buildings

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

tech_mechanized_mining = {
	cost = 0
	area = engineering
	start_tech = yes
	category = { industry }
	tier = 0

	potential = {
		is_nomadic = no
	}

	# unlocks mining districts

	starting_potential = {
		is_nomadic = no
	}
}

#Powered Exoskeletons
tech_powered_exoskeletons = {
	cost = @tier1cost1
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_basic_industry" }
	weight = @tier1weight1

	gateway = robotics

	modifier = {
		army_damage_mult = 0.10
		worker_and_simple_drone_cat_bonus_workforce_mult = 0.05
	}

	weight_modifier = {
		factor = 1.5
	}

	technology_swap = {
		name = tech_powered_exoskeletons_wilderness
		inherit_icon = yes
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	ai_weight = {
		modifier = {
			factor = @robots_ai_tech_factor
			is_spiritualist = no
			is_hive_empire = no
		}
	}
}

tech_space_mining_1 = {
	cost = @tier1cost1
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_space_construction" }
	weight = @tier1weight1

	modifier = {
		station_gatherers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_mining_1
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_mining_nomads_tt
			tech_space_mining_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_mining_2 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_space_mining_1" }
	weight = @tier1weight3

	modifier = {
		station_gatherers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_mining_2
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_mining_nomads_tt
			tech_space_mining_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_mining_3 = {
	cost = @tier2cost1
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_space_mining_2" }
	weight = @tier2weight1

	modifier = {
		station_gatherers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_mining_3
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_mining_nomads_tt
			tech_space_mining_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_mining_4 = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_space_mining_3" }
	weight = @tier2weight3

	modifier = {
		station_gatherers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_mining_4
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_mining_nomads_tt
			tech_space_mining_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

tech_space_mining_5 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { industry }
	prerequisites = { "tech_space_mining_4" }
	weight = @tier3weight1

	modifier = {
		station_gatherers_produces_mult = 0.10
	}

	technology_swap = {
		name = tech_space_mining_5
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			custom_tooltip = tech_space_mining_nomads_tt
			tech_space_mining_nomads_mult = 0.10
		}
	}

	weight_modifier = {

	}

	ai_weight = {

	}
}

#Mining Network 1
tech_mining_1 = {
	cost = @tier1cost1
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_basic_industry" }
	weight = @tier1weight1

	gateway = zone

	modifier = {
		planet_miners_minerals_produces_mult = 0.05
	}

	weight_modifier = { }

	technology_swap = {
		name = tech_mining_1_wilderness
		inherit_icon = yes
		inherit_effects = yes
		trigger = {
			is_wilderness_empire = yes
		}
	}

	technology_swap = {
		name = tech_mining_1
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			arkship_harvest_resources_produces_mult = 0.025
		}
	}

	ai_weight = {
		factor = @ai_mining_factor
	}
}

#Mining 2
tech_mining_2 = {
	cost = @tier2cost1
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_mining_1" }
	weight = @tier2weight1

	modifier = {
		planet_miners_minerals_produces_mult = 0.05
	}

	weight_modifier = { }

	technology_swap = {
		name = tech_mining_2
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
		}
		modifier = {
			arkship_harvest_resources_produces_mult = 0.025
		}
	}

	ai_weight = {
		factor = @ai_mining_factor
	}
}

#Mining 3
tech_mining_3 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { industry }
	prerequisites = { "tech_mining_2" }
	weight = @tier3weight1

	modifier = {
		planet_miners_minerals_produces_mult = 0.05
	}

	technology_swap = {
		name = tech_mining_3
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
			NOT = {
				has_ascension_perk = ap_weather_control
			}
		}
		modifier = {
			arkship_harvest_resources_produces_mult = 0.025
		}
	}

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

	technology_swap = {
		name = tech_mining_3
		inherit_icon = yes
		trigger = {
			is_nomadic = yes
			has_ascension_perk = ap_weather_control
		}
		prereqfor_desc = {
			custom = {
				title = tech_generate_magnetic_storm_tt
			}
		}
		modifier = {
			arkship_harvest_resources_produces_mult = 0.025
		}
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @ai_mining_factor
	}
}

#Mineral Purification
tech_mineral_purification_1 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_mining_1" }
	weight = @tier1weight3

	technology_swap = { # Wilderness icon swap
		name = tech_wilderness_mineral_purification_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_mining value > 0 }
				num_districts = { type = district_hab_mining value > 0 }
				num_districts = { type = district_hollow_mountains value > 0 }
				num_districts = { type = district_melting value > 0 }
				has_any_mining_zone = yes
			}
		}
	}

	ai_weight = {
		factor = @ai_mining_building_factor
	}
}

#Advanced Mineral Purification
tech_mineral_purification_2 = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_mineral_purification_1" "tech_colonial_centralization" }
	weight = @tier2weight3

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

	weight_modifier = {
		factor = 2

		modifier = {
			factor = 1.5
			is_specialist_subject_type = { TYPE = prospectorium }
		}
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @ai_mining_building_factor
	}
}

#Alloys 1
tech_alloys_1 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { materials }
	prerequisites = { "tech_basic_industry" }
	weight = @tier1weight3

	# Unlock better alloy buildings

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

	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 = 1.5
			is_specialist_subject_type = { TYPE = prospectorium }
		}
	}

	ai_weight = {
		factor = @ai_alloy_factor_factor

	}
}

#Alloys 2
tech_alloys_2 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { materials }
	prerequisites = { "tech_alloys_1" "tech_colonial_centralization" }
	weight = @tier3weight1

	# Unlock better alloy buildings

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

	weight_modifier = {
		factor = 2

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

	ai_weight = {
		factor = @ai_alloy_factor_factor

	}
}

tech_advanced_metallurgy_1 = {
	cost = @tier2cost1
	area = engineering
	tier = 2
	category = { materials }
	prerequisites = { "tech_alloys_1" "tech_ship_armor_2" }
	weight = @tier2weight1

	modifier = {
		planet_metallurgists_produces_mult = 0.05
	}

	weight_modifier = {
		factor = 2
	}

	ai_weight = { }
}

tech_advanced_metallurgy_2 = {
	cost = @tier4cost1
	area = engineering
	tier = 4
	category = { materials }
	prerequisites = { "tech_advanced_metallurgy_1" "tech_alloys_2" "tech_ship_armor_4" }
	weight = @tier4weight1

	modifier = {
		planet_metallurgists_produces_mult = 0.05
	}

	weight_modifier = {
		factor = 2
	}

	ai_weight = { }
}

#Luxuries 1
tech_luxuries_1 = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { materials }
	prerequisites = { "tech_basic_industry" }
	weight = @tier1weight3

	# Unlocks better consumer goods buildings

	potential = {
		country_uses_consumer_goods = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_rare_crystals
				has_technology = tech_rare_crystals
				has_country_flag = has_market_access
			}
		}

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

	ai_weight = {
		factor = @ai_civilian_factory_factor

	}
}

#Luxuries 2
tech_luxuries_2 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { materials }
	prerequisites = { "tech_luxuries_1" "tech_colonial_centralization" }
	weight = @tier3weight1

	# Unlocks better luxury goods buildings

	potential = {
		country_uses_consumer_goods = yes
	}

	weight_modifier = {
		factor = 2

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

	ai_weight = {
		factor = @ai_civilian_factory_factor

	}
}


tech_engineering_1 = {
	area = engineering
	category = { materials }
	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_engineering_tech_speed_factor
		factor = @zone_clear_ai_tech_factor
	}
}

tech_engineering_2 = {
	area = engineering
	category = { materials }
	tier = 2
	cost = @tier2cost3
	prerequisites = { "tech_engineering_1" }
	weight = @tier2weight3

	potential = {
		is_wilderness_empire = no
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_rare_crystals
				has_technology = tech_rare_crystals
				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_engineering_tech_speed_factor
		factor = @zone_clear_ai_tech_factor
	}
}

tech_engineering_3 = {
	area = engineering
	category = { materials }
	tier = 3
	cost = @tier3cost3
	prerequisites = { "tech_engineering_2" }
	weight = @tier3weight3

	potential = {
		is_wilderness_empire = no
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_rare_crystals
				has_technology = tech_rare_crystals
				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_engineering_tech_speed_factor
	}
}
#
## Anfrictional Construction
#tech_engineering_4 = {
#	cost = {
#		factor = @tier4breakthrough
#	}
#	area = engineering
#	tier = 5
#	category = { materials }
#	prerequisites = { "tech_engineering_3" }
#	is_breakthrough = yes
#	weight = @tier4weightbreakthrough
#
#	modifier = {
#		custom_tooltip = breakthrough_engineering_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_engineering_tech_speed_factor
#	}
#}

#Robotic Workers
tech_robotic_workers = {
	cost = @tier1cost3
	area = engineering
	tier = 1
	category = { industry }
	prerequisites = { "tech_powered_exoskeletons" }
	weight = @tier1weight3

	gateway = robotics

	feature_flags = { robots }

	potential = {
		NOR = {
			has_ethic = "ethic_gestalt_consciousness"
			is_individual_machine = yes
		}
	}

	weight_modifier = {
		factor = 1.5
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0.5
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		modifier = {
			factor = 2
			is_materialist = yes
		}

	}

	ai_weight = {
		factor = @robots_ai_tech_factor
		modifier = {
			factor = 2
			is_materialist = yes
		}
		modifier = {
			factor = 0
			NOR = {
				has_ai_personality_behaviour = robot_exploiter
				has_ai_personality_behaviour = robot_liberator
			}
		}
		modifier = {
			factor = 2
			has_origin = origin_mechanists
		}
		modifier = {
			factor = 1000
			has_origin = origin_synthetic_fertility
		}
	}
}

#Droids
tech_droid_workers = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_robotic_workers" "tech_colonial_centralization" }
	weight = @tier2weight3

	gateway = robotics

	feature_flags = { droids }

	potential = {
		NOR = {
			has_ethic = "ethic_gestalt_consciousness"
			is_individual_machine = yes
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0.5
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		modifier = {
			factor = 2
			is_materialist = yes
		}
		modifier = {
			factor = 2
			has_origin = origin_mechanists
		}
	}

	ai_weight = {
		factor = @robots_ai_tech_factor
		modifier = {
			factor = 2
			is_materialist = yes
		}
		modifier = {
			factor = 0
			NOR = {
				has_ai_personality_behaviour = robot_exploiter
				has_ai_personality_behaviour = robot_liberator
			}
		}
		modifier = {
			factor = 2
			has_origin = origin_mechanists
		}
		modifier = {
			factor = 1000
			has_origin = origin_synthetic_fertility
		}
	}
}

#Synthetics
tech_synthetic_workers = {
	cost = @tier4cost2
	area = engineering
	tier = 4
	category = { industry }
	prerequisites = { "tech_droid_workers" "tech_galactic_administration" "tech_sapient_ai" }
	is_rare = yes
	is_dangerous = yes
	weight = @tier4weight2

	feature_flags = { synths }

	gateway = robotics

	modifier = {
		robotic_pop_bonus_workforce_mult = 0.10
	}

	potential = {
		NOR = {
			has_ethic = "ethic_gestalt_consciousness"
			is_individual_machine = yes
		}
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0.5
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		modifier = {
			factor = 2
			is_materialist = yes
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_synthetic_workers
		}
		modifier = {
			factor = 2
			has_origin = origin_mechanists
		}
		modifier = {
			factor = 0.20
			NOR = {
				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 }
				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_curator }
				has_trait_in_council = { TRAIT = leader_trait_expertise_industry }
			}
		}
		modifier = {
			factor = @ap_pending_tech_boost
			has_ascension_perk = ap_synthetic_evolution
		}
	}

	ai_weight = {
		factor = @robots_ai_tech_factor
		modifier = {
			factor = 2
			is_materialist = yes
		}
		modifier = {
			factor = 0
			NOR = {
				has_ai_personality_behaviour = robot_exploiter
				has_ai_personality_behaviour = robot_liberator
				has_ascension_perk = ap_synthetic_evolution
			}
		}
		modifier = {
			factor = 2
			has_origin = origin_mechanists
		}
		modifier = {
			factor = 1000
			has_origin = origin_synthetic_fertility
		}
		modifier = {
			factor = @ap_pending_tech_boost
			has_ascension_perk = ap_synthetic_evolution
		}
	}
}

#Synthetic Personality Matrix
tech_synthetic_leaders = {
	cost = @tier4cost3
	area = engineering
	tier = 4
	category = { industry }
	prerequisites = { "tech_synthetic_workers" }
	weight = @tier4weight3

	feature_flags = { robot_leaders }

	## unlocks robot-leaders

	potential = {
		NOR = {
			has_ethic = "ethic_gestalt_consciousness"
			is_individual_machine = yes
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0
			has_policy_flag = robots_outlawed
		}
		modifier = {
			factor = 0
			has_policy_flag = ai_outlawed
		}

		modifier = {
			factor = 0.33
			has_origin = origin_necrophage
			has_trait = trait_necrophage
		}
	}

	ai_weight = {
		modifier = {
			factor = 0
			NOT = { has_ai_personality_behaviour = robot_exploiter }
			NOT = { has_ai_personality_behaviour = robot_liberator }
		}
		modifier = {
			factor = 2
			is_materialist = yes
		}
	}
}

# Advanced Robotic Assembly
tech_robot_assembly_complex = {
	icon = "tech_mega_assembly"
	cost = @tier4cost1
	area = engineering
	tier = 4
	category = { industry }
	prerequisites = { "tech_robomodding" "tech_galactic_administration" }
	is_rare = yes
	weight = @tier4weight1

	potential = {
		NOT = { has_ethic = "ethic_gestalt_consciousness" }
	}


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

	ai_weight = {
		factor = @pop_growth_tech_ai_factor

	}
}

#Integrated Cybernetics
tech_integrated_cybernetics = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { industry }
	prerequisites = { "tech_powered_exoskeletons" "tech_colonial_centralization" }
	weight = @tier2weight3

	modifier = {
		pop_environment_tolerance = 0.05
		army_damage_mult = 0.10
		army_health = 0.10
	}

	potential = {
		OR = {
			AND = {
				is_machine_empire = no
				is_individual_machine = no
			}
			has_civic = civic_machine_assimilator
		}
	}

	weight_modifier = {
		factor = 1.5
		modifier = {
			factor = @ap_pending_tech_boost
			OR = {
				has_ascension_perk = ap_the_flesh_is_weak
				has_ascension_perk = ap_organo_machine_interfacing
				has_ascension_perk = ap_organo_machine_interfacing_assimilator
			}
		}
	}

	ai_weight = {
		factor = 2
		modifier = {
			factor = 1000
			has_origin = origin_cybernetic_creed
		}
		modifier = {
			factor = @ap_pending_tech_boost
			OR = {
				has_ascension_perk = ap_the_flesh_is_weak
				has_ascension_perk = ap_organo_machine_interfacing
				has_ascension_perk = ap_organo_machine_interfacing_assimilator
			}
		}
	}
}

# ##################
# Space Mining
# ##################

tech_space_construction = {
	cost = 0
	area = engineering
	tier = 0
	category = { industry }
	start_tech = yes

	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_CONSTRUCTION_SHIP_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_CONSTRUCTION_SHIP_CONSTRUCTION_DESC"
		}
		# used to separate the entries
		custom = {
			title = "TECH_UNLOCK_MINING_STATION_TITLE"
			desc = "TECH_UNLOCK_MINING_STATION_DESC"
		}
		# used to separate the entries
		custom = {
			title = "TECH_UNLOCK_RESEARCH_STATION_TITLE"
			desc = "TECH_UNLOCK_RESEARCH_STATION_DESC"
		}
	}

	technology_swap = {
		name = tech_nomads_space_construction
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_nomadic = yes
		}
		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_LOGISTIC_SHIP_CONSTRUCTION_TITLE"
				desc = "TECH_UNLOCK_LOGISTIC_SHIP_CONSTRUCTION_DESC"
			}
		}
		modifier = {
			nomadic_constructor_limit_add = 2
		}
	}

	ai_weight = {

	}

	## unlock construction ship, mining station, research station
}

# ##################
# Afterburners
# ##################

#Afterburners
tech_afterburners_1 = {
	area = engineering
	cost = @tier1cost2
	tier = 1
	category = { propulsion }
	prerequisites = { "tech_thrusters_1" }
	weight = @tier1weight2

	weight_modifier = {
		factor = 1.25

		modifier = {
			factor = 2
			has_technology = tech_thrusters_2
		}
		modifier = {
			factor = 2
			has_technology = tech_thrusters_3
		}
	}

	ai_weight = {
	}
}

#Advanced Afterburners
tech_afterburners_2 = {
	area = engineering
	cost = @tier3cost2
	tier = 3
	category = { propulsion }
	prerequisites = { "tech_afterburners_1" "tech_thrusters_3" }
	weight = @tier3weight2

	weight_modifier = {
		factor = 1.25
	}

	ai_weight = {
	}
}

# ##################
# Building Speed and Automation
# ##################

tech_assembly_pattern = {
	cost = @tier2cost3
	area = engineering
	tier = 2
	category = { industry }
	weight = @tier2weight3

	modifier = {
		planet_building_build_speed_mult = 0.25
	}

	technology_swap = {
		name = tech_assembly_pattern_tankbound
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_tankbound_empire = yes
		}
		modifier = {
			planet_building_build_speed_mult = 0.25
			bonus_automated_workforce_mult = 0.10
		}
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			is_militarist = yes
		}
	}

	ai_weight = {

	}
}

tech_construction_templates = {
	cost = @tier4cost2
	area = engineering
	tier = 4
	is_rare = yes
	category = { industry }
	prerequisites = { "tech_assembly_pattern" }
	weight = @tier4weight2

	modifier = {
		planet_building_build_speed_mult = 0.50
		show_only_custom_tooltip = no
		custom_tooltip = tech_construction_templates_effect
	}

	technology_swap = {
		name = tech_construction_templates_tankbound
		inherit_icon = yes
		inherit_effects = no
		trigger = {
			is_tankbound_empire = yes
		}
		modifier = {
			planet_building_build_speed_mult = 0.50
			bonus_automated_workforce_mult = 0.10
		}
	}

	weight_modifier = {
		factor = 0.5
		modifier = {
			factor = 0.5
			NOR = {
				has_trait_in_council = { TRAIT = leader_trait_expertise_industry }
				has_trait_in_council = { TRAIT = leader_trait_curator }
			}
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_construction_templates
		}
		modifier = {
			factor = 1.25
			is_militarist = yes
		}
	}

	ai_weight = {

	}
}

# ##################
# Housing
# ##################

tech_housing_1 = {
	cost = @tier2cost2
	area = engineering
	tier = 2
	category = { industry }
	weight = @tier2weight2

	potential = {
		is_wilderness_empire = no
	}

	modifier = {
		description = district_housing_tech_effect
	}

	weight_modifier = {
		factor = 1.5

	}

	ai_weight = {

		modifier = {
			factor = @housing_ai_tech_factor
			pop_amount >= 10000
		}
	}
}

tech_housing_2 = {
	cost = @tier3cost1
	area = engineering
	tier = 3
	category = { industry }
	prerequisites = { "tech_housing_1" }
	weight = @tier3weight1

	potential = {
		is_wilderness_empire = no
	}

	modifier = {
		description = district_housing_2_tech_effect
	}

	weight_modifier = {
		factor = 1.5
		modifier = {
			factor = 0
			has_valid_civic = civic_agrarian_idyll
		}

	}

	ai_weight = {

		modifier = {
			factor = @housing_ai_tech_factor
			pop_amount >= 10000
		}
	}
}

tech_leviathan_techgenesis = {
	cost = @tier5cost1
	area = engineering
	tier = 5
	is_rare = yes
	weight = @tier5weight1
	category = { industry }

	potential = {
		has_machine_age_dlc = yes
	}

	prereqfor_desc = {
		custom = {
			title = "TECH_UNLOCK_LEVIATHAN_MACHINE_TITLE"
			desc = "TECH_UNLOCK_LEVIATHAN_MACHINE_DESC"
		}
	}

	weight_modifier = {
		factor = 0
		# Awarded by event
	}

	ai_weight = {
		modifier = {
			factor = 0.5
			has_ethic = ethic_fanatic_xenophobe
		}
		modifier = {
			factor = 0.75
			has_ethic = ethic_xenophobe
		}
		modifier = {
			factor = 1.25
			has_ethic = ethic_xenophile
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_xenophile
		}
	}
}
