@titan_sensor_range = 90
@titanAuraRange = 160

@projected_defenses_amt = 500
@projected_defenses_regen = 0.08 #per month

#fallen empire titan
utility_component_template = {
	key = "TITAN_CORE_FALLEN"
	size = medium
	icon = "GFX_ship_part_titan_core_01"
	icon_frame = 1
	power = 0
	cost = 0
	military_power = -5000
	can_recharge_shield = yes	
	
	size_restriction = { titan_ship_fallen_empire }

	ship_behavior = "isb_aggressive"

	ship_modifier = {
		SHIP_WEAPON_DAMAGE = 1.5
		SHIP_WEAPON_RANGE_MULT = 0.15

		SHIP_HITPOINTS_ADD = 2500
		SHIP_SHIELD_HP_ADD = 5000

		SHIP_AUTO_REPAIR_ADD = 0.10
		SHIP_SHIELD_REGEN_ADD = 150
		ship_combat_speed_mult = 0.5
	}

	ai_weight = {
		weight = 0
	}
}

utility_component_template = {
	key = "TITAN_NO_WEAPON"
	size = small
	icon = "GFX_ship_part_empty_ftl_drive"
	icon_frame = 1
	power = 0
	cost = 0

	component_set = "titan_weapon_components"
}

utility_component_template = {
	key = "TITAN_PROJECTED_DEFENSES"
	size = medium
	icon = "GFX_ship_part_shield_5"
	icon_frame = 1
	power = -400
	cost = 500
	sensor_range = @titan_sensor_range

	prerequisites = { "tech_titan_weapon_module_02" }

	friendly_aura = {
		name = "aura_projected_defenses"
		radius = @titanAuraRange
		apply_on = ships

		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = titan_support_aura
			priority = 1
		}

		modifier = {
			SHIP_HITPOINTS_ADD = @projected_defenses_amt
			SHIP_AUTO_REPAIR_ADD = @projected_defenses_regen
		}

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

	component_set = "titan_weapon_components"

	ai_weight = {
		weight = 2
	}
}

utility_component_template = {
	key = "TITAN_CENTRALISED_COMMAND"
	size = medium
	icon = "GFX_ship_part_titan_cc"
	icon_frame = 1
	power = -250
	cost = 500
	sensor_range = @titan_sensor_range

	prerequisites = { "tech_titan_weapon_module_03" }

	friendly_aura = {
		name = "aura_centralised_command"
		radius = @titanAuraRange
		apply_on = ships

		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = titan_support_aura
			priority = 1
		}

		modifier = {
			SHIP_WINDUP_MULT = -0.50
			SHIP_FTL_WORMHOLE_SPEED_MULT = 0.50
		}

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

	component_set = "titan_weapon_components"

	ai_weight = {
		weight = 1
	}
}

utility_component_template = {
	key = "TITAN_NETWORKED_TARGET"
	size = medium
	icon = "GFX_ship_part_titan_network"
	icon_frame = 1
	power = -400
	cost = 500
	sensor_range = @titan_sensor_range

	prerequisites = { "tech_titan_weapon_module_04" }

	friendly_aura = {
		name = "aura_networked_target"
		radius = @titanAuraRange
		apply_on = ships

		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = titan_support_aura
			priority = 1
		}

		modifier = {
			ship_fire_rate_mult = 0.25
		}

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

	component_set = "titan_weapon_components"

	ai_weight = {
		weight = 3
	}
}

utility_component_template = {
	key = "TITAN_VIRUS"
	size = medium
	icon = "GFX_ship_part_titan_virus"
	icon_frame = 1
	power = -400
	cost = 500
	sensor_range = @titan_sensor_range

	prerequisites = { "tech_titan_weapon_module_05" }

	hostile_aura = {
		name = "aura_titan_virus"
		radius = @titanAuraRange
		apply_on = ships

		stack_info = {			#A ship can only be affected by one aura of a certain id. If multiple auras have the same ID the one with the highest priority will be applied.
			id = titan_hostile_aura
			priority = 10
		}

		modifier = {
			ship_fire_rate_mult = -0.2
			ship_accuracy_mult = -0.2
		}

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

	component_set = "titan_weapon_components"

	ai_weight = {
		weight = 3
	}
}

utility_component_template = {
	key = "TITAN_INERTIA_DAMPENERS"
	size = medium
	icon = "GFX_ship_part_hyper_drive_3"
	icon_frame = 1
	power = -75
	cost = 100
	sensor_range = @titan_sensor_range

	prerequisites = { "tech_titan_weapon_module_01" }

	ship_modifier = {
		ship_combat_speed_mult = 0.4
	}

	component_set = "titan_weapon_components"

	ai_weight = {
		weight = 0
	}
}

#offensive core
utility_component_template = {
	key = "TITAN_CORE_01"
	size = medium
	icon = "GFX_ship_part_titan_core_01"
	icon_frame = 1
	power = 0
	cost = 100
	
	#size_restriction = { titan }

	ship_behavior = "isb_defensive"
	can_recharge_shield = yes

	ship_modifier = {
		SHIP_WEAPON_DAMAGE = 0.50
		#ship_weapon_range_mult = 0.15
		ship_fire_rate_mult = 0.4

		#SHIP_HITPOINTS_ADD = -3500
		#SHIP_SHIELD_HP_ADD = -3500
		SHIP_AUTO_REPAIR_ADD = 0.05
		#SHIP_SHIELD_REGEN_ADD = 40

		ship_tracking_add = 10
	}

	component_set = "titan_core_components"

	ai_weight = {
		weight = 0
	}
}

#defensive core
utility_component_template = {
	key = "TITAN_CORE_02"
	size = medium
	icon = "GFX_ship_part_titan_core_02"
	icon_frame = 1
	power = 0
	cost = 100
	
	#size_restriction = { titan }

	ship_behavior = "isb_aggressive"
	can_recharge_shield = yes

	ship_modifier = {
		SHIP_WEAPON_DAMAGE = -0.25
		ship_fire_rate_mult = -0.25

		SHIP_HITPOINTS_ADD = 11000
		#ISBDIFF - 0.25
		SHIP_AUTO_REPAIR_ADD = 0.10
		#SHIP_SHIELD_HP_ADD = 500
		#SHIP_SHIELD_REGEN_ADD = 150
		ship_combat_speed_mult = 0.4

		ship_tracking_add = 40
	}

	component_set = "titan_core_components"

	ai_weight = {
		weight = 1.9
	}
}

#balanced core
utility_component_template = {
	key = "TITAN_CORE_03"
	size = medium
	icon = "GFX_ship_part_titan_core_03"
	icon_frame = 1
	power = 0
	cost = 100
	
	#size_restriction = { titan }

	ship_behavior = "isb_defensive"
	can_recharge_shield = yes

	ship_modifier = {
		SHIP_WEAPON_DAMAGE = 0.2
		ship_fire_rate_mult = 0.2

		#ship_weapon_range_mult = 2.00

		SHIP_HITPOINTS_ADD = 5500
		#ISBDIFF - 0.125
		SHIP_AUTO_REPAIR_ADD = 0.075
		#SHIP_SHIELD_HP_ADD = 500
		#SHIP_SHIELD_REGEN_ADD = 90
		
		ship_tracking_add = 10
	}

	component_set = "titan_core_components"

	ai_weight = {
		weight = 2
	}
}

utility_component_template = {
	key = "SUN_CRUSHER_CORE"
	size = small
	icon = "GFX_ship_part_hyper_drive_3"
	icon_frame = 1
	cost = 19000
	sensor_range = 40
	ftl = jumpdrive
	power = -30
	#military_power = 1
	
	#size_restriction = { sun_crusher }

	ship_modifier = {
		ship_speed_mult = 0.1
		ship_combat_speed_mult = 0.1
	}

	component_set = "sun_crusher_components"

	ai_weight = {
		weight = 10
	}
}