@cost1 = 40
@cost2 = 50
@cost3 = 100
@section_cost = 30


####################################################################################################################################################################
### BOW ############################################################################################################################################################
####################################################################################################################################################################

ship_section_template = {
	key = "DESTROYER_BOW_M2S2"
	ship_size = destroyer
	fits_on_slot = bow
	entity = "destroyer_bow_M1S2_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { gunship brawler }

	component_slot = {
		name = "MEDIUM_GUN_01"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}	
	component_slot = {
		name = "MEDIUM_GUN_02"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}	
	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"
	}

	small_utility_slots = 6
	medium_utility_slots = 1

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

ship_section_template = {
	key = "DESTROYER_BOW_G1S3"
	ship_size = destroyer
	fits_on_slot = bow
	entity = "destroyer_bow_M1S2_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { gunship brawler }

	component_slot = {
		name = "MEDIUM_GUN_01"
		template = "medium_missile_turret"
		locatorname = "medium_gun_01"
	}	
	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_01"
	}	
	component_slot = {
		name = "SMALL_GUN_03"
		template = "small_turret"
		locatorname = "small_gun_02"
	}

	small_utility_slots = 6
	medium_utility_slots = 1

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

ship_section_template = {
	key = "DESTROYER_BOW_S5"
	ship_size = destroyer
	fits_on_slot = bow
	entity = "destroyer_bow_S3_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { screen }

	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_01"
	}	
	component_slot = {
		name = "SMALL_GUN_03"
		template = "small_turret"
		locatorname = "small_gun_02"
	}
	component_slot = {
		name = "SMALL_GUN_04"
		template = "small_turret"
		locatorname = "small_gun_02"
	}	
	component_slot = {
		name = "SMALL_GUN_05"
		template = "small_turret"
		locatorname = "small_gun_03"
	}
	
	small_utility_slots = 5
	medium_utility_slots = 2
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost1 }
	}
}

ship_section_template = {
	key = "DESTROYER_BOW_S3P2"
	ship_size = destroyer
	fits_on_slot = bow
	entity = "destroyer_bow_S3_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { screen }

	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_01"
	}	
	component_slot = {
		name = "SMALL_GUN_03"
		template = "small_turret"
		locatorname = "small_gun_02"
	}
	component_slot = {
		name = "SMALL_GUN_04"
		template = "point_defence_turret"
		locatorname = "small_gun_02"
	}
	component_slot = {
		name = "SMALL_GUN_05"
		template = "point_defence_turret"
		locatorname = "small_gun_03"
	}
	
	small_utility_slots = 5
	medium_utility_slots = 1

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

ship_section_template = {
	key = "DESTROYER_BOW_L1"
	ship_size = destroyer
	fits_on_slot = bow
	should_draw_components = yes
	entity = "destroyer_bow_L1_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { artillery artillery_stealth }

	component_slot = {
		name = "LARGE_GUN_01"
		template = "large_turret"
		locatorname = "large_gun_01"
	}
	
	small_utility_slots = 4
	medium_utility_slots = 1
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost3 }
	}
}

ship_section_template = {
	key = "DESTROYER_BOW_LC"
	ship_size = destroyer
	fits_on_slot = bow
	entity = "destroyer_bow_S3_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { screen }

	prerequisites = { "tech_escortcarrier_1" }

	component_slot = {
		name = "STRIKE_CRAFT_01"
		template = "large_strike_craft"
		locatorname = "small_gun_02"
	}
	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 = "invisible_point_defence_turret"
		locatorname = "small_gun_01"
	}

	small_utility_slots = 3

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


####################################################################################################################################################################
### STERN ##########################################################################################################################################################
####################################################################################################################################################################

ship_section_template = {
	key = "DESTROYER_STERN_S5"
	ship_size = destroyer
	fits_on_slot = stern
	entity = "destroyer_stern_S2_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { gunship brawler }

	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_01"
	}	
	component_slot = {
		name = "SMALL_GUN_04"
		template = "small_turret"
		locatorname = "small_gun_02"
	}
	component_slot = {
		name = "SMALL_GUN_05"
		template = "small_turret"
		locatorname = "small_gun_01"
	}	
	
	aux_utility_slots = 1
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost1 }
	}
}

ship_section_template = {
	key = "DESTROYER_STERN_M2"
	ship_size = destroyer
	fits_on_slot = stern
	entity = "destroyer_stern_M1_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { artillery artillery_stealth }

	component_slot = {
		name = "MEDIUM_GUN_01"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}
	component_slot = {
		name = "MEDIUM_GUN_02"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}
	
	aux_utility_slots = 1
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost2 }
	}
}

ship_section_template = {
	key = "DESTROYER_STERN_S3P2"
	ship_size = destroyer
	fits_on_slot = stern
	entity = "destroyer_stern_S2_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { gunship brawler }

	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_01"
	}	
	component_slot = {
		name = "SMALL_GUN_04"
		template = "point_defence_turret"
		locatorname = "small_gun_02"
	}
	component_slot = {
		name = "SMALL_GUN_05"
		template = "point_defence_turret"
		locatorname = "small_gun_01"
	}	
	
	aux_utility_slots = 1
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost1 }
	}
}

ship_section_template = {
	key = "DESTROYER_STERN_LC"
	ship_size = destroyer
	fits_on_slot = stern
	entity = "destroyer_stern_S2_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { gunship brawler }
	
	prerequisites = { "tech_escortcarrier_1" }

	component_slot = {
		name = "STRIKE_CRAFT_01"
		template = "large_strike_craft"
		locatorname = "small_gun_01"
	}
	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"
	}	
	
	aux_utility_slots = 1
	
	resources = {
		category = ship_sections
		cost = { alloys = @cost3 }
	}
}



####################################################################################################################################################################
### VANILLA SECTIONS ###############################################################################################################################################
####################################################################################################################################################################


ship_section_template = {
	key = "DESTROYER_BOW_M1S2"
	ship_size = destroyer
	fits_on_slot = bow
	should_draw_components = yes
	entity = "destroyer_bow_M1S2_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { gunship brawler }

	ai_weight = {
		modifier = {
			factor = 10.0
			NOR = {
				has_ai_personality = peaceful_traders
				has_ai_personality = slaving_despots
				has_ai_personality = migrating_flock
				has_ai_personality = evangelising_zealots
				has_ai_personality = hive_mind
			}
		}
	}
	
	prerequisites = { "tech_nsc_disabled_sections" }

	component_slot = {
		name = "MEDIUM_GUN_01"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}

	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"
	}

	small_utility_slots = 6

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

ship_section_template = {
	key = "DESTROYER_BOW_S3"
	ship_size = destroyer
	fits_on_slot = bow
	should_draw_components = yes
	entity = "destroyer_bow_S3_entity"
	icon = "GFX_ship_part_core_bow"
	ai_tags = { screen }

	ai_weight = {
		modifier = {
			factor = 10.0
			is_preferred_weapons = weapon_type_explosive
		}
		modifier = {
			factor = 0.1
			has_technology = tech_battleships
		}
		modifier = {
			factor = 0.1
			NOT = { is_preferred_weapons = weapon_type_explosive }
		}
	}
	
	prerequisites = { "tech_nsc_disabled_sections" }

	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 = 6

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

#STERN

ship_section_template = {
	key = "DESTROYER_STERN_PD2"
	ship_size = destroyer
	fits_on_slot = stern
	should_draw_components = yes
	entity = "destroyer_stern_S2_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { screen }

	ai_weight = {
		modifier = {
			factor = 10.0
			NOR = {
				has_ai_personality = peaceful_traders
				has_ai_personality = slaving_despots
				has_ai_personality = migrating_flock
				has_ai_personality = evangelising_zealots
				has_ai_personality = hive_mind
			}
		}
	}
	
	prerequisites = { "tech_nsc_disabled_sections" }


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

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

	aux_utility_slots = 1

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

ship_section_template = {
	key = "DESTROYER_STERN_S2"
	ship_size = destroyer
	fits_on_slot = stern
	should_draw_components = yes
	entity = "destroyer_stern_S2_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { gunship brawler }

	ai_weight = {
		factor = 100
	}
	
	prerequisites = { "tech_nsc_disabled_sections" }

	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"
	}

	aux_utility_slots = 2

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

ship_section_template = {
	key = "DESTROYER_STERN_M1"
	ship_size = destroyer
	fits_on_slot = stern
	should_draw_components = yes
	entity = "destroyer_stern_M1_entity"
	icon = "GFX_ship_part_core_stern"
	ai_tags = { artillery artillery_stealth }

	component_slot = {
		name = "MEDIUM_GUN_01"
		template = "medium_turret"
		locatorname = "medium_gun_01"
	}

	prerequisites = { "tech_nsc_disabled_sections" }

	aux_utility_slots = 1

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