#############
# UTILITIES ROLES #
#############

utility_component_template = {
	key = "COMBAT_COMPUTER_DEFAULT"
	size = small
	icon = "GFX_ship_part_computer_default"
	icon_frame = 1
	power = 0
	cost = 0
	ship_behavior = "default"
	
	ai_weight = {
		weight = 1
	}
	
	class_restriction = { shipclass_military }
	
	component_set = "combat_computers"
}

utility_component_template = {
	key = "COMBAT_COMPUTER_AGGRESSIVE_BASIC"
	size = small
	icon = "GFX_ship_part_computer_aggressive_basic"
	icon_frame = 1
	power = -12
	cost = 100
	ship_behavior = "aggressive"
	
	modifier = {
		ship_combat_speed_mult = 0.35
		
	}
	ship_modifier = {
		ship_fire_rate_mult = 0.2
		ship_weapon_damage = 0.2
		ship_accuracy_add = 5
		ship_evasion_add = 5
	}
	
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			has_country_flag = ai_flag_aggressive_personality
		}
	}
	
	class_restriction = { shipclass_military }
	prerequisites = { "tech_combat_computers_1" }
	component_set = "combat_computers"
}

utility_component_template = {
	can_recharge_shield = yes
	key = "COMBAT_COMPUTER_DEFENSIVE_BASIC"
	size = small
	icon = "GFX_ship_part_computer_defensive_basic"
	icon_frame = 1
	power = -12
	cost = 100
	ship_behavior = "defensive"

	modifier = {
		ship_armor_add = 5
	}
	
	ship_modifier = {
		ship_shield_regen_add = 1
		ship_weapon_range_mult = 0.2
		ship_evasion_add = -100
	}
	
	ai_weight = {
		weight = 10
		modifier = {
			factor = 2
			has_country_flag = ai_flag_defensive_personality
		}
	}

	class_restriction = { shipclass_military }
	prerequisites = { "tech_combat_computers_1" }
	component_set = "combat_computers"
}

utility_component_template = {
	key = "COMBAT_COMPUTER_AGGRESSIVE_ADVANCED"
	size = small
	icon = "GFX_ship_part_computer_aggressive_advanced"
	icon_frame = 1
	power = -23
	cost = 200
	ship_behavior = "aggressive"
	
	modifier = {
		ship_combat_speed_mult = 0.5
	}
	ship_modifier = {
		ship_accuracy_add = 8
		ship_weapon_damage = 0.3
		ship_fire_rate_mult = 0.3
		ship_evasion_add = 10
	}
	
	ai_weight = {
		weight = 100
		modifier = {
			factor = 2
			has_country_flag = ai_flag_aggressive_personality
		}
	}
	
	class_restriction = { shipclass_military }
	prerequisites = { "tech_combat_computers_2" }
	component_set = "combat_computers"
}

utility_component_template = {
	can_recharge_shield = yes
	key = "COMBAT_COMPUTER_DEFENSIVE_ADVANCED"
	size = small
	icon = "GFX_ship_part_computer_defensive_advanced"
	icon_frame = 1
	power = -23
	cost = 200
	ship_behavior = "defensive"

	modifier = {
		ship_armor_add = 10
	}
	
	ship_modifier = {
		ship_shield_regen_add = 2.5
		ship_weapon_range_mult = 0.3
		ship_evasion_add = -100	
	}
	
	ai_weight = {
		weight = 100
		modifier = {
			factor = 2
			has_country_flag = ai_flag_defensive_personality
		}
	}

	class_restriction = { shipclass_military }
	prerequisites = { "tech_combat_computers_2" }
	component_set = "combat_computers"
}

utility_component_template = {
	key = "COMBAT_COMPUTER_SENTIENT"
	size = small
	icon = "GFX_ship_part_computer_sentient"
	icon_frame = 1
	power = -35
	cost = 400
	ship_behavior = "default"
	
	modifier = {
		
		ship_combat_speed_mult = 0.65
	}	
	ship_modifier = {
		ship_accuracy_add = 10
		ship_fire_rate_mult = 0.3
		ship_weapon_damage = 0.3
		ship_weapon_range_mult = 0.1
		ship_evasion_add = 10
	}
	
	ai_weight = {
		weight = 500
		modifier = {
			factor = 2
			OR = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
			}
		}
		modifier = {
			factor = 0.1
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
	}
	
	class_restriction = { shipclass_military }
	prerequisites = { "tech_combat_computers_3" }
	component_set = "combat_computers"
}

utility_component_template = {
	can_recharge_shield = yes
	key = "COMBAT_COMPUTER_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_pregoc"
	icon_frame = 1
	power = -35
	cost = 400
	ship_behavior = "default"
	
	modifier = {
		ship_armor_add = 25
		ship_combat_speed_mult = 0.1
	}	
	ship_modifier = {
		ship_shield_regen_add = 5
		ship_fire_rate_mult = 0.15
		ship_weapon_range_mult = 0.5
		ship_evasion_add = -100
	}
	
	ai_weight = {
		weight = 500
		modifier = {
			factor = 2
			OR = {
				has_ethic = "ethic_spiritualist"
				has_ethic = "ethic_fanatic_spiritualist"
			}
		}
		modifier = {
			factor = 0.1
			OR = {
				has_ethic = "ethic_materialist"
				has_ethic = "ethic_fanatic_materialist"
			}
		}
	}
	
	class_restriction = { shipclass_military }
	prerequisites = { "tech_precognition_interface" }
	component_set = "combat_computers"
}