#All numbers for balancing are in ...common\scripted_variables\avc_scripted_variables_component_cost.txt

########################
### Reactor Boosters ###
########################

####
# 4#
####

utility_component_template = {
	key = "AVC_REACTOR_BOOSTER_4"
	size = aux

	icon = "GFX_avc_ship_part_reactor_booster_4"
	icon_frame = 1

	prerequisites = { "tech_avc_reactor_boosters_4" }
	component_set = "AVC_REACTOR_BOOSTER_4"
	upgrades_to = "AVC_REACTOR_BOOSTER_5"
	resources = {
		category = ship_components
		cost = {
			alloys = 20
		}
	}

	ai_weight = {
		weight = 7
	}

	modifier = {
		ship_reactor_power_mult = 0.63
	}
}

####
# 5#
####

utility_component_template = {
	key = "AVC_REACTOR_BOOSTER_5"
	size = aux

	icon = "GFX_avc_ship_part_reactor_booster_5"
	icon_frame = 1

	prerequisites = { "tech_avc_reactor_boosters_5" }
	component_set = "AVC_REACTOR_BOOSTER_5"
	upgrades_to = "AVC_REACTOR_BOOSTER_6"
	resources = {
		category = ship_components
		cost = {
			alloys = 25
		}
	}

	ai_weight = {
		weight = 9
	}

	modifier = {
		ship_reactor_power_mult = 0.80
	}
}

####
# 6#
####

utility_component_template = {
	key = "AVC_REACTOR_BOOSTER_6"
	size = aux

	icon = "GFX_avc_ship_part_reactor_booster_6"
	icon_frame = 1

	prerequisites = { "tech_avc_reactor_boosters_6" }
	component_set = "AVC_REACTOR_BOOSTER_6"
	resources = {
		category = ship_components
		cost = {
			alloys = 30
		}
	}

	ai_weight = {
		weight = 11
	}

	modifier = {
		ship_reactor_power_mult = 1.00
	}
}

################################
### Regenerative Hull Tissue ###
################################

utility_component_template = {
	key = "AVC_REGEN_HULL_TISSUE_2"
	size = aux

	icon = "GFX_avc_ship_part_regen_hull_tissue_2"
	icon_frame = 1
	
	prerequisites = { "tech_avc_regenerative_hull_tissue_2" }
	component_set = "AVC_REGEN_HULL_TISSUE_2"
	resources = {
		category = ship_components
		cost = {
			alloys = 30
		}
	}
	ai_weight = {
		weight = 20
		modifier = {
			factor = 2.0
			is_preferred_weapons = weapon_type_explosive
		}		
	}

	power = -15
	modifier = {
		ship_hull_regen_add_perc = 0.15
		ship_armor_regen_add_perc = 0.15
	}
}

#########################
### Shield Rechargers ###
#########################

utility_component_template = {
	key = "AVC_SHIELD_BOOSTER_2"
	size = aux

	icon = "GFX_avc_ship_part_shield_recharger_2"
	icon_frame = 1

	prerequisites = { "tech_avc_shield_rechargers_2" }
	component_set = "AVC_SHIELD_BOOSTER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = 20
			exotic_gases = 2
		}
	}

	ai_weight = {
		weight = 20
		modifier = {
			factor = 2.0
			is_preferred_weapons = weapon_type_energy
			is_country_type = default
			has_monthly_income = { resource = exotic_gases value > 0 }
		}

		modifier = {
			factor = 0.0
			no_resource_for_component = { RESOURCE = exotic_gases }
		}
	}

	power = -40
	modifier = {
		ship_shield_mult = 0.2
	}
}

####################
### Afterburners ###
####################

####
# 3#
####

utility_component_template = {
	key = "AVC_AFTERBURNER_3"
	size = aux

	icon = "GFX_avc_ship_part_afterburner_3"
	icon_frame = 1

	prerequisites = { "tech_avc_afterburners_3" }
	component_set = "AVC_AFTERBURNER_3"
	
	potential = {
		OR = {
			is_ship_class = shipclass_military
			is_arkship_ship = yes
		}
	}
	
	upgrades_to = "AVC_AFTERBURNER_4"
	resources = {
		category = ship_components
		cost = {
			alloys = 8
		}
	}

	ai_weight = {
		weight = 20
		modifier = {
			factor = 2.0
			is_preferred_weapons = weapon_type_kinetic
		}
		modifier = {
			factor = 0.5
			is_preferred_weapons = weapon_type_explosive
		}
	}

	power = -40
	modifier = {
		ship_speed_mult = 0.3
		ship_evasion_mult = 0.15
	}
}

####
# 4#
####

utility_component_template = {
	key = "AVC_AFTERBURNER_4"
	size = aux

	icon = "GFX_avc_ship_part_afterburner_4"
	icon_frame = 1

	prerequisites = { "tech_avc_afterburners_4" }
	component_set = "AVC_AFTERBURNER_4"
	
	potential = {
		OR = {
			is_ship_class = shipclass_military
			is_arkship_ship = yes
		}
	}
	
	resources = {
		category = ship_components
		cost = {
			alloys = 10
		}
	}

	ai_weight = {
		weight = 25
		modifier = {
			factor = 2.0
			is_preferred_weapons = weapon_type_kinetic
		}
		modifier = {
			factor = 0.5
			is_preferred_weapons = weapon_type_explosive
		}
	}

	power = -80
	modifier = {
		ship_speed_mult = 0.4
		ship_evasion_mult = 0.2
	}
}

##############################
### Auxiliary Fire Control ###
##############################

utility_component_template = {
	key = "AVC_AUX_FIRE_CONTROL_2"
	size = aux

	icon = "GFX_avc_ship_part_aux_fire_control_2"
	icon_frame = 1

	
	prerequisites = { "tech_avc_auxiliary_fire_control_2" }
	component_set = "AVC_AUX_FIRE_CONTROL_2"
	
	resources = {
		category = ship_components
		cost = {
			alloys = 20
		}
	}

	ai_weight = {
		weight = 20
		modifier = {
			factor = 3.0
			is_preferred_weapons = weapon_type_kinetic
		}
	}

	power = -20
	modifier = {
		ship_accuracy_add = 10
	}
}


#################
### Enigmatic ###
#################

utility_component_template = {
	key = "AVC_ENIGMATIC_DECODER_2"
	size = aux

	icon = "GFX_avc_ship_part_enigmatic_decoder_2"
	icon_frame = 1

	prerequisites = { "tech_avc_enigmatic_decoder_2" }
	component_set = "AVC_ENIGMATIC_DECODER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = 40
		}
	}

	ai_weight = {
		weight = 20
		modifier = {
			factor = 2
			OR = {
				is_preferred_weapons = weapon_type_energy
				is_preferred_weapons = weapon_type_kinetic
			}
		}
	}

	power = -40
	ship_modifier = {
		ship_tracking_add = 10
		ship_accuracy_add = 10
	}
}

utility_component_template = {
	key = "AVC_ENIGMATIC_ENCODER_2"
	size = aux

	icon = "GFX_avc_ship_part_enigmatic_encoder_2"
	icon_frame = 1

	prerequisites = { "tech_avc_enigmatic_encoder_2" }
	component_set = "AVC_ENIGMATIC_ENCODER_2"
	resources = {
		category = ship_components
		cost = {
			alloys = 40
		}
	}

	ai_weight = {
		weight = 20
		modifier = {
			factor = 0
			OR = {
				has_ethic = ethic_militarist
				has_ethic = ethic_fanatic_militarist
				has_ethic = ethic_gestalt_consciousness
				has_civic = civic_fanatic_purifiers
			}
		}
	}

	power = -40
	modifier = {
		ship_disengage_opportunities_add = 2
	}
}
