#
# When added new technologies to this file update the following scripted effects:
#	give_all_biogenesis_techs_option_effect
#	give_all_biogenesis_techs_effect

###########
# Maulers #
###########

tech_maulers = {
	tier = 1
	cost = @tier0cost1
	start_tech = yes
	area = society
	category = { biology }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_mauler_stage_1_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_mauler_stage_1_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		factor = 1000
	}

	ai_weight = {
		weight = 10000
	}

	starting_potential = {
		is_low_tech_start = no # So low tech starts don't start with it
	}
}

tech_mauler_build_speed = {
	tier = 1
	cost = @tier1cost2
	weight = @tier1weight2
	area = society
	category = { biology }
	prerequisites = { "tech_maulers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		custom_tooltip = tech_mauler_build_speed_effect
		ship_mauler_cost_mult = -0.05
		shipsize_mauler_stage_1_build_speed_mult = 0.25
		shipsize_mauler_stage_2_build_speed_mult = 0.25
		shipsize_mauler_stage_3_build_speed_mult = 0.25
		shipsize_offspring_mauler_stage_1_build_speed_mult = 0.25
		shipsize_offspring_mauler_stage_2_build_speed_mult = 0.25
		shipsize_offspring_mauler_stage_3_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}
}

tech_mauler_growth_1 = {
	tier = 1
	cost = @tier1cost2
	weight = @tier1weight2
	category = { biology }
	area = society
	prerequisites = { "tech_maulers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		command_limit_add = 20
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_mauler_stage_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_mauler_stage_2_CONSTRUCTION_DESC"
		}
	}

	gateway = bio_ships

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_mauler_growth_1
			}
		}
		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_mauler_growth_2 = {
	tier = 1
	cost = @tier1cost3
	weight = @tier1weight3
	area = society
	category = { biology }
	prerequisites = { "tech_mauler_growth_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_mauler_stage_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_mauler_stage_3_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_mauler_growth_2
			}
		}
		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
	}
}


###########
# Weavers #
###########

tech_weavers = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	start_tech = yes
	area = society
	category = { biology }
	prerequisites = { "tech_maulers" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_weaver_stage_1_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_weaver_stage_1_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_weavers
			}
		}
		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
	}

	starting_potential = {
		is_low_tech_start = no # So low tech starts don't start with it
	}
}

tech_weaver_build_speed = {
	tier = 1
	cost = @tier1cost2
	weight = @tier1weight2
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		custom_tooltip = tech_weaver_build_speed_effect
		ship_weaver_cost_mult = -0.05
		shipsize_weaver_stage_1_build_speed_mult = 0.25
		shipsize_weaver_stage_2_build_speed_mult = 0.25
		shipsize_weaver_stage_3_build_speed_mult = 0.25
		shipsize_offspring_weaver_stage_1_build_speed_mult = 0.25
		shipsize_offspring_weaver_stage_2_build_speed_mult = 0.25
		shipsize_offspring_weaver_stage_3_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}
}

tech_weaver_growth_1 = {
	tier = 2
	cost = @tier2cost2
	weight = @tier2weight2
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		command_limit_add = 20
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_weaver_stage_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_weaver_stage_2_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_weaver_growth_1
			}
		}
		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_weaver_growth_2 = {
	tier = 2
	cost = @tier2cost3
	weight = @tier2weight3
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_growth_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_weaver_stage_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_weaver_stage_3_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_weaver_growth_2
			}
		}
		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
	}
}

##############
# Harbingers #
##############

tech_harbingers = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_harbinger_stage_1_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_harbinger_stage_1_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		command_limit_add = 40
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 10 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_harbingers
			}
		}
		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_harbinger_build_speed = {
	tier = 3
	cost = @tier3cost2
	weight = @tier3weight2
	area = society
	category = { biology }
	prerequisites = { "tech_harbingers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		custom_tooltip = tech_harbinger_build_speed_effect
		ship_harbinger_cost_mult = -0.05
		shipsize_harbinger_stage_1_build_speed_mult = 0.25
		shipsize_harbinger_stage_2_build_speed_mult = 0.25
		shipsize_harbinger_stage_3_build_speed_mult = 0.25
		shipsize_offspring_harbinger_stage_1_build_speed_mult = 0.25
		shipsize_offspring_harbinger_stage_2_build_speed_mult = 0.25
		shipsize_offspring_harbinger_stage_3_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}
}

tech_harbinger_growth_1 = {
	tier = 3
	cost = @tier3cost2
	weight = @tier3weight2
	area = society
	category = { biology }
	prerequisites = { "tech_harbingers" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_harbinger_stage_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_harbinger_stage_2_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 20 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_harbinger_growth_1
			}
		}
		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_harbinger_growth_2 = {
	tier = 3
	cost = @tier3cost3
	weight = @tier3weight3
	area = society
	category = { biology }
	prerequisites = { "tech_harbinger_growth_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_harbinger_stage_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_harbinger_stage_3_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 20 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_harbinger_growth_2
			}
		}
		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
	}
}

############
# Stingers #
############

tech_stingers = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_harbingers" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_stinger_stage_1_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_stinger_stage_1_CONSTRUCTION_DESC"
		}
	}

	modifier = {
		command_limit_add = 40
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_stingers
			}
		}
		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_stinger_build_speed = {
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	area = society
	category = { biology }
	prerequisites = { "tech_stingers" }

	potential = {
		country_uses_bio_ships = yes
	}

	modifier = {
		custom_tooltip = tech_stinger_build_speed_effect
		ship_stinger_cost_mult = -0.05
		shipsize_stinger_stage_1_build_speed_mult = 0.25
		shipsize_stinger_stage_2_build_speed_mult = 0.25
		shipsize_stinger_stage_3_build_speed_mult = 0.25
		shipsize_offspring_stinger_stage_1_build_speed_mult = 0.25
		shipsize_offspring_stinger_stage_2_build_speed_mult = 0.25
		shipsize_offspring_stinger_stage_3_build_speed_mult = 0.25
	}

	weight_modifier = {
	}

	ai_weight = {

	}
}

tech_stinger_growth_1 = {
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	area = society
	category = { biology }
	prerequisites = { "tech_stingers" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_stinger_stage_2_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_stinger_stage_2_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_stinger_growth_1
			}
		}
		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_stinger_growth_2 = {
	tier = 4
	cost = @tier4cost3
	weight = @tier4weight3
	area = society
	category = { biology }
	prerequisites = { "tech_stinger_growth_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		ship = {
			title = "TECH_UNLOCK_stinger_stage_3_CONSTRUCTION_TITLE"
			desc = "TECH_UNLOCK_stinger_stage_3_CONSTRUCTION_DESC"
		}
	}

	weight_modifier = {
		modifier = {
			factor = 0.1
			NOT = { years_passed > 50 }
		}
		modifier = {
			factor = 10
			any_neighbor_country = {
				has_technology = tech_stinger_growth_2
			}
		}
		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
	}
}

######################
# Starbase Buildings #
######################

tech_growth_chamber_1 = {
	tier = 4
	cost = @tier4cost2
	weight = @tier4weight2
	area = society
	category = { biology }
	prerequisites = {
		tech_stingers
		OR = {
			tech_mauler_growth_1
			tech_stinger_growth_1
			tech_weaver_growth_1
			tech_harbinger_growth_1
		}
	}

	potential = {
		country_uses_bio_ships = yes
	}

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

	weight_modifier = {
		factor = 3
		modifier = {
			factor = 2
			OR = {
				is_militarist = yes
				is_hive_empire = yes
				is_wilderness_empire = yes
			}
		}
	}

	ai_weight = {
		modifier = {
			factor = 2
			OR = {
				is_militarist = yes
				is_hive_empire = yes
				is_wilderness_empire = yes
			}
		}
	}
}

tech_growth_chamber_2 = {
	tier = 4
	cost = @tier4cost3
	weight = @tier4weight3
	area = society
	category = { biology }
	prerequisites = {
		tech_growth_chamber_1
		OR = {
			tech_mauler_growth_2
			tech_stinger_growth_2
			tech_weaver_growth_2
			tech_harbinger_growth_2
		}
	}

	potential = {
		country_uses_bio_ships = yes
	}

	prereqfor_desc = {
		hide_prereq_for_desc = component
		custom = {
			title = "TECH_UNLOCK_ADVANCED_GROWTH_CHAMBER_TITLE"
			desc = "TECH_UNLOCK_ADVANCED_GROWTH_CHAMBER_DESC"
		}
	}

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

		prereqfor_desc = {
			custom = {
				title = "TECH_UNLOCK_ARKSHIP_GROWTH_CHAMBER_TITLE"
				desc = "TECH_UNLOCK_ARKSHIP_GROWTH_CHAMBER_DESC"
			}
		}
	}

	weight_modifier = {
		factor = 3
		modifier = {
			factor = 2
			OR = {
				is_militarist = yes
				is_hive_empire = yes
				is_wilderness_empire = yes
			}
		}
	}

	ai_weight = {
		modifier = {
			factor = 2
			OR = {
				is_militarist = yes
				is_hive_empire = yes
				is_wilderness_empire = yes
			}
		}
	}
}

###################
# SHIP COMPONENTS #
###################

# Mandibles
tech_mandibles_2 = {
	area = engineering
	cost = @tier3cost2
	weight = @tier3weight2
	tier = 3
	category = { materials }
	prerequisites = { tech_maulers }

	potential = {
		country_uses_bio_ships = 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.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

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

tech_mandibles_3 = {
	area = engineering
	cost = @tier4cost2
	weight = @tier4weight2
	tier = 4
	category = { materials }
	prerequisites = { tech_mandibles_2 }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}
	}

	ai_weight = {
		modifier = {
			factor = 1.25
			has_ethic = ethic_militarist
		}
		modifier = {
			factor = 1.5
			has_ethic = ethic_fanatic_militarist
		}

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

# Weaver Buffing Components

tech_weaver_bio_healing_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_healing_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_healing_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_healing_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_healing_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_healing_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_healing_3" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_healing_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_healing_4" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_healing_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_healing_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_evasion_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	start_tech = yes
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}

	starting_potential = {
		is_low_tech_start = no # So low tech starts don't start with it
	}
}

tech_weaver_bio_evasion_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_evasion_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_evasion_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_evasion_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_evasion_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_evasion_3" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_evasion_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_evasion_4" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_evasion_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_evasion_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_fire_rate_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_fire_rate_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_fire_rate_3" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_fire_rate_4" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}
	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

tech_weaver_bio_fire_rate_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_fire_rate_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = buffer_role
			OPPOSITE_ROLE = debuffer_role
		}
	}
}

# Weaver Debuffing Components

tech_weaver_bio_confuser_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_confuser_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_confuser_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_confuser_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_confuser_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_confuser_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_confuser_3" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_confuser_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_confuser_4" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_confuser_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_confuser_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_evasion_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	area = society
	start_tech = yes
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}

	starting_potential = {
		is_low_tech_start = no # So low tech starts don't start with it
	}
}

tech_weaver_bio_anti_evasion_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_evasion_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_evasion_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_evasion_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_evasion_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_evasion_3" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_evasion_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_evasion_4" }

	potential = {
		country_uses_bio_ships = yes
	}

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

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_evasion_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_anti_evasion_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_1 = {
	tier = 1
	cost = @tier1cost1
	weight = @tier1weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weavers" }

	potential = {
		country_uses_bio_ships = yes
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_2 = {
	tier = 2
	cost = @tier2cost1
	weight = @tier2weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_fire_rate_1" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_3 = {
	tier = 3
	cost = @tier3cost1
	weight = @tier3weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_fire_rate_2" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_4 = {
	tier = 4
	cost = @tier4cost1
	weight = @tier4weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_fire_rate_3" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_5 = {
	tier = 5
	cost = @tier5cost1
	weight = @tier5weight1
	area = society
	category = { biology }
	prerequisites = { "tech_weaver_bio_anti_fire_rate_4" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				has_technology = tech_mine_volatile_motes
				has_technology = tech_volatile_motes
				has_country_flag = has_market_access
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

tech_weaver_bio_anti_fire_rate_6 = {
	area = society
	cost = @fallentechcost
	tier = @fallentechtier
	category = { biology }
	weight = @tier5weight3
	is_rare = yes
	prerequisites = { "tech_weaver_bio_anti_fire_rate_5" }

	potential = {
		country_uses_bio_ships = yes
	}

	weight_modifier = {
		modifier = {
			factor = 0
			NOR = {
				is_country_type = fallen_empire
				is_country_type = awakened_fallen_empire
			}
		}
	}

	ai_weight = {
		factor = @favored_weapon_ai_tech_factor
		modifier = {
			factor = 1.5
			has_valid_ai_personality = yes
			OR = {
				has_ai_personality = honorbound_warriors
				has_ai_personality = hegemonic_imperialists
				has_ai_personality = democratic_crusaders
				has_ai_personality = hive_mind
				has_ai_personality = hive_mind_friend
				has_ai_personality = benevolent_wilderness
				has_ai_personality = rampant_wilderness
			}
		}
		inline_script = {
			script = ai/ship_role_preference_weight
			SHIP_SIZE = weaver_stage_1
			ROLE = debuffer_role
			OPPOSITE_ROLE = buffer_role
		}
	}
}

# Deep Space Citadel

tech_deep_space_citadel = {
	area = society
	cost = @tier3cost3
	tier = 3
	category = { military_theory }
	prerequisites = { "tech_starbase_3" }
	weight = @tier3weight3
	is_rare = yes

	potential = {
		has_biogenesis_dlc = yes
		is_nomadic = no
	}

	modifier = {
		deep_space_citadel_limit_add = 1
	}

	weight_modifier = {
		factor = 0.25
		modifier = {
			factor = 0.5
			is_pacifist = yes
		}
		modifier = {
			factor = 2
			is_militarist = yes
		}
		modifier = {
			factor = 2
			OR = {
				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 = 2
			OR = {
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius }
				has_trait_in_council = { TRAIT = leader_trait_spark_of_genius_2 }
			}
		}
		modifier = {
			factor = 2
			has_galactic_wonders = yes
		}
		modifier = {
			factor = 6
			has_ascension_perk = ap_master_builders
		}
		modifier = {
			factor = 6
			has_ascension_perk = ap_galactic_force_projection
		}
		modifier = {
			factor = 6
			has_ascension_perk = ap_eternal_vigilance
		}
		inline_script = {
			script = technologies/rare_technologies_weight_modifiers
			TECHNOLOGY = tech_deep_space_citadel
		}
	}

	prereqfor_desc = {
		ship = {
			title = "allow_deep_space_citadel"
			desc = "deep_space_citadel_0_MEGASTRUCTURE_DETAILS"
		}
	}

	ai_weight = {
		factor = 1 #AI will have a harder time making use of this

		modifier = {
			factor = 2
			is_ai = no #auto-research
		}
	}
}

# Planetary Germination
tech_wilderness_terraform = {
	tier = 0
	cost = @tier0cost1
	area = society
	start_tech = yes
	category = { new_worlds }
	start_tech = yes

	feature_flags = {
		build_terraform_station
	}

	potential = {
		is_wilderness_empire = yes
	}

	starting_potential = {
		is_wilderness_empire = yes
	}
}
