cosmo_crisis_destroyer = {
	graphical_culture = no
	max_speed = @speed_fast
	acceleration = 0.3
	rotation_speed = 0.2
	collision_radius = @destroyer_collision_radius
	formation_priority = @destroyer_formation_priority
	modifier = {
		ship_evasion_add = 50
		ship_hull_regen_add_perc = 0.1
		ship_armor_regen_add_perc = 0.1
		#ship_piracy_suppression_add = 8
	}
	max_hitpoints = @fe_destroyer_hp
	size_multiplier = 10
	map_counter_icon = ship_counter_8
	icon = ship_size_military_2
	fleet_slot_size = 2
	section_slots = { "mid" = { locator = "part1" } }
	num_target_locators = 0
	icon_frame = 3
	base_buildtime = 200
	is_space_station = no
	combat_disengage_chance = 1.5
	can_have_federation_design = no
	components_add_to_cost = yes
	default_behavior = line
	ship_roles = { artillery explosive }
	triggered_ship_roles = {
		{
			name = explosive_stealth
			trigger = { has_cloaking_tech = yes }
		}
		{
			name = artillery_stealth
			trigger = { has_technology = tech_cloaking_2 }
		}
		{
			name = energy_torpedoes
			trigger = { has_energy_torpedo_tech = yes }
		}
		{
			name = energy_torpedoes_stealth
			trigger = {
				has_technology = tech_energy_torpedoes_1
				has_technology = tech_cloaking_2
			}
		}
	}

	potential_country = {
		has_technology = tech_cosmogenesis_escort
		country_uses_bio_ships = no
	}

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	use_shipnames_from = destroyer

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"

	resources = {
		category = ships
		cost = {
			alloys = 500
		}
		upkeep = {
			energy = @destroyer_upkeep_energy
			alloys = @destroyer_upkeep_alloys
		}
	}

	available_to_everyone = yes

	ai_ship_data = {
		fraction = {
			base = 33
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_escort
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_minor
				BATTLELINE = @doctrine_composition_neutral
				BARRAGE = @doctrine_composition_favored
				STRIKE_WING = @doctrine_composition_minor
				AMBUSH = @doctrine_composition_minor
				PHALANX = @doctrine_composition_neutral
			}
			# Nudged toward hulls matching the empire's preferred weapon family.
			inline_script = {
				script = "ai/weapon_preference_composition_weight"
				SHIP_SIZE = cosmo_crisis_destroyer
			}
		}
	}
}

cosmo_crisis_battlecruiser = {
	formation_priority = @battleship_formation_priority
	graphical_culture = no
	max_speed = @speed_slow
	acceleration = 0.2
	rotation_speed = 0.15
	collision_radius = @battleship_collision_radius
	modifier = {
		ship_evasion_add = 10
		ship_hull_regen_add_perc = 0.1
		ship_armor_regen_add_perc = 0.1
		#ship_piracy_suppression_add = 4
	}
	max_hitpoints = @fe_battleship_hp
	size_multiplier = 40
	map_counter_icon = ship_counter_32
	icon = ship_size_military_8
	fleet_slot_size = 4
	section_slots = { "mid" = { locator = "part1" } }
	num_target_locators = 0
	is_space_station = no
	components_add_to_cost = yes

	combat_disengage_chance = 1.0
	default_behavior = carrier
	ship_roles = { artillery explosive carrier }
	triggered_ship_roles = {
		{
			name = energy_torpedoes
			trigger = { has_energy_torpedo_tech = yes }
		}
	}

	resources = {
		category = ships
		cost = {
			alloys = 2000
		}
		upkeep = {
			energy = @battleship_upkeep_energy
			alloys = @battleship_upkeep_alloys
		}
	}

	base_buildtime = 600

	use_shipnames_from = battleship

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	potential_country = {
		has_technology = tech_cosmogenesis_battlecruiser
		country_uses_bio_ships = no
		NOT = { has_country_flag = cosmogenesis_aborted }
	}

	available_to_everyone = yes

	ai_ship_data = {
		fraction = {
			base = 33
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_battlecruiser
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_neutral
				BATTLELINE = @doctrine_composition_neutral
				BARRAGE = @doctrine_composition_favored
				STRIKE_WING = @doctrine_composition_favored
				AMBUSH = @doctrine_composition_neutral
				PHALANX = @doctrine_composition_minor
			}
			# Nudged toward hulls matching the empire's preferred weapon family.
			inline_script = {
				script = "ai/weapon_preference_composition_weight"
				SHIP_SIZE = cosmo_crisis_battlecruiser
			}
		}
	}
}

cosmo_crisis_titan = {
	formation_priority = @titan_formation_priority
	graphical_culture = no
	entity = "cosmo_crisis_titan_entity"
	max_speed = @speed_slow
	acceleration = 0.15
	rotation_speed = 0.1
	collision_radius = @titan_collision_radius
	modifier = {
		ship_evasion_add = 2
		ship_hull_regen_add_perc = 0.1
		ship_armor_regen_add_perc = 0.1
	}
	max_hitpoints = @fe_titan_hp
	size_multiplier = 80
	map_counter_icon = ship_counter_128
	icon = ship_size_military_32
	fleet_slot_size = 8
	section_slots = { "mid" = { locator = "part1" } }
	num_target_locators = 0
	is_space_station = no
	components_add_to_cost = yes

	combat_disengage_chance = 0.5
	default_behavior = artillery
	ship_roles = { artillery }
	resources = {
		category = ships
		cost = {
			alloys = 10000
		}
		upkeep = {
			energy = @titan_upkeep_energy
			alloys = @titan_upkeep_alloys
		}
	}

	base_buildtime = 1800

	use_shipnames_from = titan

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"
	required_component_set = "ship_aura_components"

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	prerequisites = { "tech_cosmogenesis_FE_titan" }

	min_upgrade_cost = {
		alloys = 16
	}

	ai_ship_data = {
		min = 1
		max = 3
		planet_mult = 0.1
	}

	potential_country = {
		NOT = { has_country_flag = cosmogenesis_aborted }
	}

	potential_construction = {
		titan_potential_construction = yes
	}

	possible_construction = {
		titan_possible_construction = yes
	}

	available_to_everyone = yes
}

monadic_qerr = {
	is_space_object = yes
	graphical_culture = no
	max_speed = @speed_very_slow
	acceleration = 0.1
	rotation_speed = 0.07
	collision_radius = @titan_collision_radius
	max_hitpoints = 1000000
	modifier = {
		ship_evasion_add = @colossus_evasion
		ship_armor_add = 500000
	}
	size_multiplier = 320
	map_counter_icon = ship_counter_128
	icon = ship_size_military_32
	fleet_slot_size = 0
	section_slots = { "mid" = { locator = "root" } }
	num_target_locators = 0
	is_space_station = no

	class = shipclass_military_special
	is_designable = no
	#is_civilian = yes
	never_lost = yes

	ai_ship_data = {
		min = 1
		max = 1
	}
}

#Biological Ships

# Fallen Hive Large Mauler
# Stage 3 mauler with two additional weapon and armor slots
cosmo_crisis_mauler = {
	use_ai_design_role_from = mauler_stage_1
	graphical_culture = no
	entity = "biogenesis_01_fallen_empire_mauler_ship_entity"
	ship_category = bio_ship					# Used to filter ships sizes for graphical cultures

	formation_priority = @mauler_formation_priority
	max_speed = @speed_very_fast
	acceleration = 0.25
	rotation_speed = 0.1
	collision_radius = @mauler_stage_3_collision_radius
	max_hitpoints = @mauler_stage_3_hp
	modifier = {
		ship_evasion_add = @mauler_stage_3_evasion
		ship_reactor_power_mult = 0.50
	}
	ship_modifier = {
		mod_ship_naval_cap_usage_mult = 1.0
	}
	size_multiplier = 4
	map_counter_icon = ship_counter_4
	icon = ship_size_mauler_stage_3
	fleet_slot_size = 1
	section_slots = { "mid" = { locator = "root" } }
	num_target_locators = 2
	is_space_station = no
	base_buildtime = @mauler_stage_3_build_time
	enable_default_design = yes
	enable_3dview_in_ship_browser = no
	selectable = { has_biogenesis_dlc = yes }
	use_shipnames_from = corvette
	evaluation_resource = food

	default_behavior = torpedo

	role_background = "GFX_role_selection_mauler"
	ship_roles = { brawler screen }
	triggered_ship_roles = {
		{
			name = brawler_stealth
			trigger = { has_cloaking_tech = yes }
		}
		{
			name = screen_stealth
			trigger = { has_cloaking_tech = yes }
		}
	}

	combat_disengage_chance = @mauler_disengage_chance

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	potential_country = {
		has_technology = tech_cosmogenesis_mauler
		country_uses_bio_ships = yes
	}

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"
	required_component_set = "bio_ship_unique_components"

	is_bio_ship = no					# this indicates that this ship uses bioship mechanic

	resources = {
		category = ships
		cost = {
			alloys = 200
		}
		cost = {
			food = 200
			mult = @halved_alloy_to_food_cost_ratio
		}
		upkeep = {
			alloys = @mauler_stage_3_upkeep_alloys
			food = @mauler_stage_3_upkeep_food
		}
	}

	min_upgrade_cost = {
		alloys = @mauler_stage_3_min_upgrade_cost
	}

	ai_ship_data = {
		fraction = {
			base = 30
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_mauler
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_strong_favored
				BATTLELINE = @doctrine_composition_neutral
				BARRAGE = @doctrine_composition_disfavored
				STRIKE_WING = @doctrine_composition_minor
				AMBUSH = @doctrine_composition_minor
				PHALANX = @doctrine_composition_favored
			}
		}
	}
	available_to_everyone = yes
}

# Fallen Hive Large Weaver
# Stage 3 Weaver with two extra PD slots and two extra Medium slots
cosmo_crisis_weaver = {
	use_ai_design_role_from = weaver_stage_1
	graphical_culture = no
	entity = "biogenesis_01_fallen_empire_weaver_stage_3_ship_entity"
	ship_category = bio_ship					# Used to filter ships sizes for graphical cultures

	formation_priority = @weaver_formation_priority
	max_speed = @speed_fast
	acceleration = 0.3
	rotation_speed = 0.2
	collision_radius = @weaver_stage_3_collision_radius
	max_hitpoints = @weaver_stage_3_hp
	modifier = {
		ship_evasion_add = @weaver_stage_3_evasion
		ship_reactor_power_mult = 0.50
	}
	ship_modifier = {
		mod_ship_naval_cap_usage_mult = 1.0
	}
	size_multiplier = 8
	map_counter_icon = ship_counter_8
	icon = ship_size_weaver_stage_3
	fleet_slot_size = 2
	section_slots = { "mid" = { locator = "root" } }
	num_target_locators = 4
	base_buildtime = @weaver_stage_3_build_time
	enable_default_design = yes
	enable_3dview_in_ship_browser = no
	selectable = { has_biogenesis_dlc = yes }
	use_shipnames_from = destroyer
	evaluation_resource = food

	default_behavior = line

	role_background = "GFX_role_selection_weaver"
	ship_roles = { buffer_role debuffer_role }
	triggered_ship_roles = {
		{
			name = buffer_role_stealth
			trigger = { has_technology = tech_cloaking_2 }
		}
		{
			name = debuffer_role_stealth
			trigger = { has_technology = tech_cloaking_2 }
		}
	}

	combat_disengage_chance = @weaver_disengage_chance

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	potential_country = {
		has_technology = tech_cosmogenesis_weaver
		country_uses_bio_ships = yes
		NOT = { has_country_flag = cosmogenesis_aborted }
	}

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"
	required_component_set = "bio_ship_unique_components"

	is_bio_ship = no					# this indicates that this ship uses bioship mechanic

	resources = {
		category = ships
		cost = {
			alloys = 200
		}
		cost = {
			food = 200
			mult = @halved_alloy_to_food_cost_ratio
		}
		upkeep = {
			alloys = @weaver_stage_3_upkeep_alloys
			food = @weaver_stage_3_upkeep_food
		}
	}

	min_upgrade_cost = {
		alloys = @weaver_stage_3_min_upgrade_cost
	}

	ai_ship_data = {
		fraction = {
			base = 30
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_weaver
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_neutral
				BATTLELINE = @doctrine_composition_minor
				BARRAGE = @doctrine_composition_neutral
				STRIKE_WING = @doctrine_composition_neutral
				AMBUSH = @doctrine_composition_neutral
				PHALANX = @doctrine_composition_minor
			}
		}
	}
	available_to_everyone = yes
}

# Fallen Hive Large Harbinger
# Stage 3 harbinger with two extra hangar slots
cosmo_crisis_harbinger = {
	use_ai_design_role_from = harbinger_stage_1
	graphical_culture = no
	entity = "biogenesis_01_fallen_empire_harbinger_stage_3_ship_entity"
	ship_category = bio_ship					# Used to filter ships sizes for graphical cultures

	formation_priority = @harbinger_formation_priority
	max_speed = @speed_default
	acceleration = 0.25
	rotation_speed = 0.175
	collision_radius = @harbinger_stage_3_collision_radius
	max_hitpoints = @harbinger_stage_3_hp
	modifier = {
		ship_evasion_add = @harbinger_stage_3_evasion
		ship_reactor_power_mult = 0.50
	}
	ship_modifier = {
		mod_ship_naval_cap_usage_mult = 1.0
	}
	size_multiplier = 16
	map_counter_icon = ship_counter_16
	icon = ship_size_harbinger_stage_3
	fleet_slot_size = 3
	section_slots = { "mid" = { locator = "root" } }
	num_target_locators = 4
	base_buildtime = @harbinger_stage_3_build_time
	enable_default_design = yes
	enable_3dview_in_ship_browser = no
	selectable = { has_biogenesis_dlc = yes }
	use_shipnames_from = cruiser
	evaluation_resource = food

	default_behavior = carrier

	role_background = "GFX_role_selection_harbinger"
	ship_roles = { carrier }
	triggered_ship_roles = {
		{
			name = artillery
			trigger = {
				OR = {
					has_technology = tech_swarmer_missiles_1
					has_technology = tech_swarmer_missiles_2
					has_technology = tech_scourge_missile_1
					has_technology = tech_energy_torpedoes_1
					has_technology = tech_energy_torpedoes_2
				}
			}
		}
		{
			name = artillery_stealth
			trigger = {
				has_technology = tech_cloaking_3
				OR = {
					has_technology = tech_swarmer_missiles_1
					has_technology = tech_swarmer_missiles_2
					has_technology = tech_scourge_missile_1
					has_technology = tech_energy_torpedoes_1
					has_technology = tech_energy_torpedoes_2
				}
			}
		}
		{
			name = carrier_stealth
			trigger = { has_technology = tech_cloaking_3 }
		}
	}

	combat_disengage_chance = @harbinger_disengage_chance

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	potential_country = {
		has_technology = tech_cosmogenesis_harbinger
		country_uses_bio_ships = yes
		NOT = { has_country_flag = cosmogenesis_aborted }
	}

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"
	required_component_set = "bio_ship_unique_components"

	is_bio_ship = no					# this indicates that this ship uses bioship mechanic

	resources = {
		category = ships
		cost = {
			alloys = 500
		}
		cost = {
			food = 500
			mult = @halved_alloy_to_food_cost_ratio
		}
		upkeep = {
			alloys = @harbinger_stage_3_upkeep_alloys
			food = @harbinger_stage_3_upkeep_food
		}
	}

	min_upgrade_cost = {
		alloys = @harbinger_stage_3_min_upgrade_cost
	}

	ai_ship_data = {
		fraction = {
			base = 20
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_harbinger
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_disfavored
				BATTLELINE = @doctrine_composition_neutral
				BARRAGE = @doctrine_composition_favored
				STRIKE_WING = @doctrine_composition_strong_favored
				AMBUSH = @doctrine_composition_neutral
				PHALANX = @doctrine_composition_minor
			}
		}
	}
	available_to_everyone = yes
}

# Fallen Hive Large Stinger
# Stage 3 Stinger with two titan slots and three extra armor slots
cosmo_crisis_stinger = {
	use_ai_design_role_from = stinger_stage_1
	graphical_culture = no
	entity = "biogenesis_01_fallen_empire_stinger_stage_3_ship_entity"
	ship_category = bio_ship					# Used to filter ships sizes for graphical cultures

	formation_priority = @stinger_formation_priority
	max_speed = @speed_default
	acceleration = 0.25
	rotation_speed = 0.175
	collision_radius = @stinger_stage_3_collision_radius
	max_hitpoints = @stinger_stage_3_hp
	modifier = {
		ship_evasion_add = @stinger_stage_3_evasion
		ship_reactor_power_mult = 0.50
	}
	ship_modifier = {
		mod_ship_naval_cap_usage_mult = 1.0
	}
	size_multiplier = 32
	map_counter_icon = ship_counter_32
	icon = ship_size_stinger_stage_3
	fleet_slot_size = 4
	section_slots = { "mid" = { locator = "root" } }
	num_target_locators = 4
	base_buildtime = @stinger_stage_3_build_time
	enable_default_design = yes
	enable_3dview_in_ship_browser = no
	selectable = { has_biogenesis_dlc = yes }
	use_shipnames_from = battleship
	evaluation_resource = food

	default_behavior = artillery

	role_background = "GFX_role_selection_stinger"
	ship_roles = { artillery }
	triggered_ship_roles = {
		{
			name = artillery_stealth
			trigger = { has_battleship_cloaking_tech = yes }
		}
	}

	combat_disengage_chance = @stinger_disengage_chance

	class = shipclass_military
	construction_type = starbase_shipyard
	enable_default_design = yes

	potential_country = {
		has_technology = tech_cosmogenesis_stinger
		country_uses_bio_ships = yes
		NOT = { has_country_flag = cosmogenesis_aborted }
	}

	required_component_set = "power_core"
	required_component_set = "ftl_components"
	required_component_set = "thruster_components"
	required_component_set = "sensor_components"
	required_component_set = "combat_computers"
	required_component_set = "bio_ship_unique_components"

	is_bio_ship = no					# this indicates that this ship uses bioship mechanic

	resources = {
		category = ships
		cost = {
			alloys = 2500
		}
		cost = {
			food = 2500
			mult = @halved_alloy_to_food_cost_ratio
		}
		upkeep = {
			alloys = @stinger_stage_3_upkeep_alloys
			food = @stinger_stage_3_upkeep_food
		}
	}

	min_upgrade_cost = {
		alloys = @stinger_stage_3_min_upgrade_cost
	}

	ai_ship_data = {
		fraction = {
			base = 10
			# Once Cosmogenesis unlocks this hull, strongly prefer it over standard and bio ships.
			modifier = {
				factor = @special_ship_composition_preference
				has_technology = tech_cosmogenesis_stinger
			}
			# Composition is shaped by the active fleet doctrine.
			inline_script = {
				script = "ai/doctrine_composition_weight"
				SPEARHEAD = @doctrine_composition_neutral
				BATTLELINE = @doctrine_composition_neutral
				BARRAGE = @doctrine_composition_favored
				STRIKE_WING = @doctrine_composition_neutral
				AMBUSH = @doctrine_composition_minor
				PHALANX = @doctrine_composition_neutral
			}
		}
	}
	available_to_everyone = yes
}
