@section_cost = 30

ship_section_template = {
	key = "CORVETTE_MID_M1S1" # Used by the Frigate, not the Corvette
	ship_size = frigate
	fits_on_slot = mid
	should_draw_components = yes
	entity = "corvette_M1S1_entity"
	icon = "GFX_ship_part_core_mid"
	ai_tags = { explosive explosive_stealth energy_torpedoes energy_torpedoes_stealth }
	prerequisites = {
		tech_nsc_disabled_sections
	}
	ai_weight = {
		modifier = {
			factor = 10.0
			is_preferred_weapons = weapon_type_explosive
		}
		modifier = {
			factor = 0.1
			NOT = { is_preferred_weapons = weapon_type_explosive }
		}
	}

	component_slot = {
		name = "SMALL_GUN_01"
		template = "small_turret"
		locatorname = "small_gun_01"
	}

	component_slot = {
		name = "TORPEDO_01"
		template = "medium_missile_turret"
		locatorname = "medium_gun_01"
	}

	small_utility_slots = 4
	aux_utility_slots = 1

	resources = {
		category = ship_sections
		cost = {
			alloys = @section_cost
		}
	}
}

ship_section_template = {
	key = "CORVETTE_MID_S3"
	ship_size = corvette
	fits_on_slot = mid
	should_draw_components = yes
	entity = "corvette_S3_entity"
	icon = "GFX_ship_part_core_mid"
	ai_tags = { gunship artillery brawler brawler_stealth }

	component_slot = {
		name = "SMALL_GUN_01"
		template = "small_turret"
		locatorname = "small_gun_01"
	}

	component_slot = {
		name = "SMALL_GUN_02"
		template = "small_turret"
		locatorname = "small_gun_02"
	}

	component_slot = {
		name = "SMALL_GUN_03"
		template = "small_turret"
		locatorname = "small_gun_03"
	}

	small_utility_slots = 3
	aux_utility_slots = 1

	ai_weight = {
		modifier = {
			factor = 10.0
			OR = {
				is_preferred_weapons = weapon_type_kinetic
				is_preferred_weapons = weapon_type_energy
			}
		}
		modifier = {
			factor = 0.1
			NOR = {
				is_preferred_weapons = weapon_type_kinetic
				is_preferred_weapons = weapon_type_energy
			}
		}
	}

	resources = {
		category = ship_sections
		cost = {
			alloys = @section_cost
		}
	}
}

ship_section_template = {
	key = "CORVETTE_MID_S2PD1"
	ship_size = corvette
	fits_on_slot = mid
	should_draw_components = yes
	entity = "corvette_S3_entity"
	icon = "GFX_ship_part_core_mid"
	ai_tags = { screen }

	ai_weight = {
		modifier = {
			factor = 10.0
			is_ai = yes
			is_preferred_weapons = weapon_type_strike_craft
			has_technology = tech_cruisers
		}
		modifier = {
			factor = 0.1
			NOT = { is_preferred_weapons = weapon_type_strike_craft }
		}
	}

	component_slot = {
		name = "SMALL_GUN_01"
		template = "point_defence_turret"
		locatorname = "small_gun_01"
	}

	component_slot = {
		name = "SMALL_GUN_02"
		template = "small_turret"
		locatorname = "small_gun_02"
	}

	component_slot = {
		name = "SMALL_GUN_03"
		template = "small_turret"
		locatorname = "small_gun_03"
	}

	small_utility_slots = 3
	aux_utility_slots = 1

	resources = {
		category = ship_sections
		cost = {
			alloys = @section_cost
		}
	}
}

ship_section_template = {
	key = "CORVETTE_MID_PD3"
	ship_size = corvette
	fits_on_slot = mid
	should_draw_components = yes
	entity = "corvette_S3_entity"
	icon = "GFX_ship_part_core_mid"
	ai_tags = { screen }

	ai_weight = {
		modifier = {
			factor = 10.0
			is_ai = yes
			is_preferred_weapons = weapon_type_strike_craft
			has_technology = tech_cruisers
		}
		modifier = {
			factor = 0.1
			NOT = { is_preferred_weapons = weapon_type_strike_craft }
		}
	}

	component_slot = {
		name = "PD_GUN_01"
		template = "point_defence_turret"
		locatorname = "small_gun_01"
	}

	component_slot = {
		name = "PD_GUN_02"
		template = "point_defence_turret"
		locatorname = "small_gun_02"
	}

	component_slot = {
		name = "PD_GUN_03"
		template = "point_defence_turret"
		locatorname = "small_gun_03"
	}

	small_utility_slots = 3
	aux_utility_slots = 1

	resources = {
		category = ship_sections
		cost = {
			alloys = @section_cost
		}
	}
}

