#####################
# Ship Components
#####################

utility_component_template = {
	key = SWS_LONG_RANGE_SCANNER_T1
	size = aux
	icon = GFX_ship_part_sws_long_range_scanner_01
	icon_frame = 1
	power = -120

	resources = {
		category = ship_components
		cost = {
			alloys = 40
		}
	}

	ship_modifier = {
		ship_sensor_range_add = 4
	}

	prerequisites = { "tech_sws_long_range_scanner_T1" }
	component_set = SWS_LONG_RANGE_SCANNER_T1
	upgrades_to = SWS_LONG_RANGE_SCANNER_T2

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_LONG_RANGE_SCANNER_T2
	size = aux
	icon = GFX_ship_part_sws_long_range_scanner_02
	icon_frame = 1
	power = -200

	resources = {
		category = ship_components
		cost = {
			alloys = 80
		}
	}

	ship_modifier = {
		ship_sensor_range_add = 8
	}

	prerequisites = { "tech_sws_long_range_scanner_T2" }
	component_set = SWS_LONG_RANGE_SCANNER_T2

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_ASTROMECH_BAY
	size = aux
	icon = GFX_ship_part_sws_astromech_bay
	icon_frame = 1
	power = -10

	resources = {
		category = ship_components
		cost = {
			alloys = 10
		}
	}

	ship_modifier = {
		ship_hull_regen_add_perc = 0.05
		ship_armor_regen_add_perc = 0.05
	}

	prerequisites = { "tech_sws_astromech_bay" }
	component_set = SWS_ASTROMECH_BAY

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_ESCAPE_POD_HUNTERS
	size = aux
	icon = GFX_ship_part_sws_escape_pod_hunters
	icon_frame = 1
	power = -50

	resources = {
		category = ship_components
		cost = {
			alloys = 80
		}
	}

	hostile_aura = {
		name = "sws_escape_pod_hunters_aura"
		radius = 200
		apply_on = ships

		stack_info = {
			id = sws_escape_pod_hunters_aura
			priority = 1
		}

		modifier = {
			ship_fire_rate_mult = -0.10
			ship_accuracy_mult = -0.10
			ship_tracking_mult = -0.10
		}

		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
		}
	}

	prerequisites = { "tech_sws_escape_pod_hunters" }
	component_set = SWS_ESCAPE_POD_HUNTERS

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_MISSILE_JAMMING_FIELD
	size = aux
	icon = GFX_ship_part_sws_missile_jamming_field
	icon_frame = 1
	power = -400

	resources = {
		category = ship_components
		cost = {
			alloys = 800
		}
	}

	hostile_aura = {
		name = "sws_missile_jamming_field_aura"
		radius = 1000
		apply_on = ships

		stack_info = {
			id = sws_missile_jamming_field_aura
			priority = 1
		}

		modifier = {
			weapon_type_explosive_weapon_fire_rate_mult = -1.00
			weapon_type_explosive_weapon_damage_mult = -1.00
		}

		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
		}
	}

	prerequisites = { "tech_sws_missile_jamming_field" }
	component_set = SWS_MISSILE_JAMMING_FIELD

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_GRAVITY_WELL_GENERATOR
	size = aux
	icon = GFX_ship_part_sws_gravity_well_generator
	icon_frame = 1
	power = -400

	resources = {
		category = ship_components
		cost = {
			alloys = 800
		}
	}

	hostile_aura = {
		name = "sws_gravity_well_generator_aura"
		radius = 200
		apply_on = ships

		stack_info = {
			id = sws_gravity_well_generator_aura
			priority = 1
		}

		modifier = {
			ship_emergency_ftl_min_days_add = 3600
			ship_disengage_chance_reduction = 1.00
		}

		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
		}
	}

	prerequisites = { "tech_sws_gravity_well_generator" }
	component_set = SWS_GRAVITY_WELL_GENERATOR

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_TRACTOR_BEAM_T1
	size = aux
	icon = GFX_ship_part_sws_tractor_beam_01
	icon_frame = 1
	power = -160

	resources = {
		category = ship_components
		cost = {
			alloys = 320
		}
	}

	hostile_aura = {
		name = "sws_tractor_beam_aura_01"
		radius = 80
		apply_on = ships

		stack_info = {
			id = sws_tractor_beam_aura_01
			priority = 1
		}

		modifier = {
			ship_speed_mult = -0.40
			ship_evasion_mult = -0.30
		}

		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
		}
	}

	prerequisites = { "tech_sws_tractor_beam_T1" }
	component_set = SWS_TRACTOR_BEAM_T1
	upgrades_to = SWS_TRACTOR_BEAM_T2

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = SWS_TRACTOR_BEAM_T2
	size = aux
	icon = GFX_ship_part_sws_tractor_beam_02
	icon_frame = 1
	power = -240

	resources = {
		category = ship_components
		cost = {
			alloys = 480
		}
	}

	hostile_aura = {
		name = "sws_tractor_beam_aura_02"
		radius = 120
		apply_on = ships

		stack_info = {
			id = sws_tractor_beam_aura_02
			priority = 1
		}

		modifier = {
			ship_speed_mult = -0.80
			ship_evasion_mult = -0.60
		}

		graphics = {
			area_effect = {
				entity = "circle_area_entity"
				dynamic_scale = yes
			}
		}
	}

	prerequisites = { "tech_sws_tractor_beam_T2" }
	component_set = SWS_TRACTOR_BEAM_T2

	ai_weight = {
		weight = 0
	}
}
