# Icons set here are the ones show in the actual slot. The reason is so that we can support different icons for different sizes.

#############
# UTILITIES #
#############

# Plasteel Armor

utility_component_template = {
	key = "SMALL_ARMOR_5"
	size = small
	icon = "GFX_ship_part_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_S5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T5
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "ARMOR_5"
	upgrades_to = "AVC_SMALL_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_s_t5_cost
		}
		upkeep = {
			energy = @s_t5_upkeep_energy
			alloys = @s_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "MEDIUM_ARMOR_5"
	size = medium
	icon = "GFX_ship_part_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_M5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T5
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "ARMOR_5"
	upgrades_to = "AVC_MEDIUM_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_m_t5_cost
		}
		upkeep = {
			energy = @m_t5_upkeep_energy
			alloys = @m_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "LARGE_ARMOR_5"
	size = large
	icon = "GFX_ship_part_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_L5
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T5
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "ARMOR_5"
	upgrades_to = "AVC_LARGE_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_l_t5_cost
		}
		upkeep = {
			energy = @l_t5_upkeep_energy
			alloys = @l_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "SMALL_DRAGON_ARMOR"
	size = small
	icon = "GFX_ship_part_dragon_armor"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_S6
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_dragon_armor" }
	component_set = "DRAGON_ARMOR"
	upgrades_to = "AVC_SMALL_DRAGON_ARMOR_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_s_t6_cost
		}
		upkeep = {
			energy = @s_t6_upkeep_energy
			alloys = @s_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T6_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "MEDIUM_DRAGON_ARMOR"
	size = medium
	icon = "GFX_ship_part_dragon_armor"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_M6
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_dragon_armor" }
	component_set = "DRAGON_ARMOR"
	upgrades_to = "AVC_MEDIUM_DRAGON_ARMOR_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_m_t6_cost
		}
		upkeep = {
			energy = @m_t6_upkeep_energy
			alloys = @m_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T6_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "LARGE_DRAGON_ARMOR"
	size = large
	icon = "GFX_ship_part_dragon_armor"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_L6
	}
	ship_modifier = {
		ship_armor_hardening_add = @hardening_T6
	}

	potential = {
		OR = {
			from = {
				country_uses_bio_ships = no
			}
			is_arkship_ship = yes
		}
	}

	show_tech_unlock_if = {
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_dragon_armor" }
	component_set = "DRAGON_ARMOR"
	upgrades_to = "AVC_LARGE_DRAGON_ARMOR_2"
	resources = {
		category = ship_components
		cost = {
			alloys = @armor_l_t6_cost
		}
		upkeep = {
			energy = @l_t6_upkeep_energy
			alloys = @l_t6_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T6_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
	}
}

utility_component_template = {
	key = "SMALL_CRYSTAL_ARMOR_2"
	size = small
	icon = "GFX_ship_part_crystal_armor_2"
	icon_frame = 1
	power = 0
	resources = {
		category = ship_components
		cost = {
			rare_crystals = 0.33
		}
	}

	prerequisites = { "tech_crystal_armor_2" }
	component_set = "CRYSTAL_ARMOR_2"
	upgrades_to = "AVC_SMALL_CRYSTAL_ARMOR_3"

	modifier = {
		ship_hull_add = @hull_S4
	}
	ship_modifier = {
		ship_damage_reduction_add = 2
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = rare_crystals }
		}
	}
}

utility_component_template = {
	key = "MEDIUM_CRYSTAL_ARMOR_2"
	size = medium
	icon = "GFX_ship_part_crystal_armor_2"
	icon_frame = 1
	power = 0
	resources = {
		category = ship_components
		cost = {
			rare_crystals = 0.65
		}
	}

	prerequisites = { "tech_crystal_armor_2" }
	component_set = "CRYSTAL_ARMOR_2"
	upgrades_to = "AVC_MEDIUM_CRYSTAL_ARMOR_3"

	modifier = {
		ship_hull_add = @hull_M4
	}
	ship_modifier = {
		ship_damage_reduction_add = 3
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = rare_crystals }
		}
	}
}

utility_component_template = {
	key = "LARGE_CRYSTAL_ARMOR_2"
	size = large
	icon = "GFX_ship_part_crystal_armor_2"
	icon_frame = 1
	power = 0
	resources = {
		category = ship_components
		cost = {
			rare_crystals = 1.30
		}
	}

	prerequisites = { "tech_crystal_armor_2" }
	component_set = "CRYSTAL_ARMOR_2"
	upgrades_to = "AVC_LARGE_CRYSTAL_ARMOR_3"

	modifier = {
		ship_hull_add = @hull_L4
	}
	ship_modifier = {
		ship_damage_reduction_add = 4
	}

	ai_weight = {
		weight = 1
		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = rare_crystals }
		}
	}
}

utility_component_template = {
	key = "SMALL_LM_ARMOR_5"
	size = small
	icon = "GFX_ship_part_lm_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_S5
		ship_armor_regen_add_perc = @inf_regen_perc
		ship_hull_regen_add_perc = @inf_regen_perc
	}
	ship_modifier = {
		weapon_type_energy_weapon_fire_rate_mult = @inf_energy_speed
		ship_armor_hardening_add = @hardening_T5
	}

	potential = { 
		from = { 
			is_galvanic_empire = yes 
			country_uses_bio_ships = no
		} 
	}

	show_tech_unlock_if = {
		is_galvanic_empire = yes 
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "LM_ARMOR_5"
	upgrades_to = "AVC_SMALL_LM_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			sr_living_metal = @s_t5_cost
		}
		upkeep = {
			energy = @s_t5_upkeep_energy
			alloys = @s_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = { resource = sr_living_metal value < @inf_lm_AIincome }
			}
		}
		modifier = {
			factor = 1.5
			owner = {
				resource_stockpile_compare = { resource = sr_living_metal value > @inf_lm_AIstockpile }
			}
		}
	}
}

utility_component_template = {
	key = "MEDIUM_LM_ARMOR_5"
	size = medium
	icon = "GFX_ship_part_lm_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_M5
		ship_armor_regen_add_perc = @inf_regen_perc
		ship_hull_regen_add_perc = @inf_regen_perc
	}
	ship_modifier = {
		weapon_type_energy_weapon_fire_rate_mult = @inf_energy_speed
		ship_armor_hardening_add = @hardening_T5
	}

	potential = { 
		from = { 
			is_galvanic_empire = yes 
			country_uses_bio_ships = no
		} 
	}

	show_tech_unlock_if = {
		is_galvanic_empire = yes 
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "LM_ARMOR_5"
	upgrades_to = "AVC_MEDIUM_LM_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			sr_living_metal = @m_t5_cost
		}
		upkeep = {
			energy = @m_t5_upkeep_energy
			alloys = @m_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = { resource = sr_living_metal value < @inf_lm_AIincome }
			}
		}
		modifier = {
			factor = 1.5
			owner = {
				resource_stockpile_compare = { resource = sr_living_metal value > @inf_lm_AIstockpile }
			}
		}
	}
}

utility_component_template = {
	key = "LARGE_LM_ARMOR_5"
	size = large
	icon = "GFX_ship_part_lm_armor_5"
	icon_frame = 1
	power = 0
	modifier = {
		ship_armor_add = @armor_L5
		ship_armor_regen_add_perc = @inf_regen_perc
		ship_hull_regen_add_perc = @inf_regen_perc
	}
	ship_modifier = {
		weapon_type_energy_weapon_fire_rate_mult = @inf_energy_speed
		ship_armor_hardening_add = @hardening_T5
	}

	potential = { 
		from = { 
			is_galvanic_empire = yes 
			country_uses_bio_ships = no
		} 
	}

	show_tech_unlock_if = {
		is_galvanic_empire = yes 
		country_uses_bio_ships = no
	}

	prerequisites = { "tech_ship_armor_5" }
	component_set = "LM_ARMOR_5"
	upgrades_to = "AVC_LARGE_LM_ARMOR_6"
	resources = {
		category = ship_components
		cost = {
			sr_living_metal = @l_t5_cost
		}
		upkeep = {
			energy = @l_t5_upkeep_energy
			alloys = @l_t5_upkeep_alloys
		}
	}

	ai_weight = {
		weight = @T5_weight
		inline_script = {
			script = ship_components/weights/roles_stealth
			MULT = 2
		}
		modifier = {
			factor = 0.0
			owner = {
				has_monthly_income = { resource = sr_living_metal value < @inf_lm_AIincome }
			}
		}
		modifier = {
			factor = 1.5
			owner = {
				resource_stockpile_compare = { resource = sr_living_metal value > @inf_lm_AIstockpile }
			}
		}
	}
}
