@cost0 = 5
@cost1 = 10
@cost2 = 15
@cost3 = 20

@power0 = -5
@power1 = -10
@power2 = -15
@power3 = -25
#################################################################################################################


# This is LoGH Ships MOD for Vanilla



####################
# 'LINE' COMPUTERS #
####################
utility_component_template = {
	key = "LoGHFlagship_COMPUTER_LINE_BASIC"
	size = small
	icon = "GFX_ship_part_computer_line_basic"
	icon_frame = 1
	power = @power1
	resources = {
		category = ship_components
		cost = {
			alloys = @cost1
		}
	}
	class_restriction = { shipclass_military }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "line"
	prerequisites = { "tech_combat_computers_1" }
	upgrades_to = "LoGHFlagship_COMPUTER_LINE_ADVANCED"

	ship_modifier = {
		ship_fire_rate_mult = 0.05
		ship_accuracy_add = 5
	}

	ai_weight = {
		weight = 2
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_LINE_ADVANCED"
	size = small
	icon = "GFX_ship_part_computer_line_advanced"
	icon_frame = 1
	power = @power2
	resources = {
		category = ship_components
		cost = {
			alloys = @cost2
		}
	}
	class_restriction = { shipclass_military }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "line"
	prerequisites = { "tech_combat_computers_2" }
	upgrades_to = "LoGHFlagship_COMPUTER_LINE_SAPIENT"

	ship_modifier = {
		ship_fire_rate_mult = 0.10
		ship_accuracy_add = 10
	}

	ai_weight = {
		weight = 3
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_LINE_SAPIENT"
	size = small
	icon = "GFX_ship_part_computer_line_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "line"
	prerequisites = { "tech_combat_computers_3" }

	ship_modifier = {
		ship_fire_rate_mult = 0.20
		ship_accuracy_add = 20
	}

	ai_weight = {
		weight = 5
		modifier = {
			factor = 0
			OR = {
				has_global_flag = ghost_signal_5_flag
				has_global_flag = ghost_signal_4_flag
				has_global_flag = ghost_signal_3_flag
				has_global_flag = ghost_signal_2_flag
				has_global_flag = ghost_signal_1_flag
			}
		}
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_LINE_AUTONOMOUS"
	size = small
	icon = "GFX_ship_part_computer_line_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "line"
	prerequisites = { "tech_combat_computers_autonomous" }

	ship_modifier = {
		ship_fire_rate_mult = 0.20
		ship_accuracy_add = 20
	}

	ai_weight = {
		weight = 5
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_LINE_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_line_precog"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "line"
	prerequisites = { "tech_precognition_interface" }

	ship_modifier = {
		ship_fire_rate_mult = 0.15
		ship_accuracy_add = 15
		ship_tracking_add = 10
	}

	ai_weight = {
		weight = 4
	}
}

######################
# 'ARTILLERY' COMPUTERS #
######################
utility_component_template = {
	key = "LoGHFlagship_COMPUTER_ARTILLERY_BASIC"
	size = small
	icon = "GFX_ship_part_computer_artillery_basic"
	icon_frame = 1
	power = @power1
	resources = {
		category = ship_components
		cost = {
			alloys = @cost1
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = { "tech_combat_computers_1" }
	upgrades_to = "LoGHFlagship_COMPUTER_ARTILLERY_ADVANCED"

	ship_modifier = {
		ship_fire_rate_mult = 0.05
		ship_weapon_range_mult = 0.05
	}

	ai_weight = {
		weight = 2
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_ARTILLERY_ADVANCED"
	size = small
	icon = "GFX_ship_part_computer_artillery_advanced"
	icon_frame = 1
	power = @power2
	resources = {
		category = ship_components
		cost = {
			alloys = @cost2
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = { "tech_combat_computers_2" }
	upgrades_to = "LoGHFlagship_COMPUTER_ARTILLERY_SAPIENT"

	ship_modifier = {
		ship_fire_rate_mult = 0.10
		ship_weapon_range_mult = 0.10
	}

	ai_weight = {
		weight = 3
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_ARTILLERY_SAPIENT"
	size = small
	icon = "GFX_ship_part_computer_artillery_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = { "tech_combat_computers_3" }

	ship_modifier = {
		ship_fire_rate_mult = 0.20
		ship_weapon_range_mult = 0.20
	}

	ai_weight = {
		weight = 5
		modifier = {
			factor = 0
			OR = {
				has_global_flag = ghost_signal_5_flag
				has_global_flag = ghost_signal_4_flag
				has_global_flag = ghost_signal_3_flag
				has_global_flag = ghost_signal_2_flag
				has_global_flag = ghost_signal_1_flag
			}
		}
	}
}


utility_component_template = {
	key = "LoGHFlagship_COMPUTER_ARTILLERY_AUTONOMOUS"
	size = small
	icon = "GFX_ship_part_computer_artillery_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = { "tech_combat_computers_autonomous" }

	ship_modifier = {
		ship_fire_rate_mult = 0.20
		ship_weapon_range_mult = 0.20
	}

	ai_weight = {
		weight = 5
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_ARTILLERY_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_artillery_precog"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "artillery"
	prerequisites = { "tech_precognition_interface" }

	ship_modifier = {
		ship_fire_rate_mult = 0.15
		ship_weapon_range_mult = 0.15
		ship_tracking_add = 10
	}

	ai_weight = {
		weight = 4
	}
}

######################
# 'CARRIER' COMPUTERS #
######################
utility_component_template = {
	key = "LoGHFlagship_COMPUTER_CARRIER_BASIC"
	size = small
	icon = "GFX_ship_part_computer_carrier_basic"
	icon_frame = 1
	power = @power1
	resources = {
		category = ship_components
		cost = {
			alloys = @cost1
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "carrier"
	prerequisites = { "tech_combat_computers_1" }
	upgrades_to = "LoGHFlagship_COMPUTER_CARRIER_ADVANCED"

	ship_modifier = {
		ship_engagement_range_mult = 0.25
	}

	ai_weight = {
		weight = 2
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_CARRIER_ADVANCED"
	size = small
	icon = "GFX_ship_part_computer_carrier_advanced"
	icon_frame = 1
	power = @power2
	resources = {
		category = ship_components
		cost = {
			alloys = @cost2
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "carrier"
	prerequisites = { "tech_combat_computers_2" }
	upgrades_to = "LoGHFlagship_COMPUTER_CARRIER_SAPIENT"

	ship_modifier = {
		ship_engagement_range_mult = 0.50
	}

	ai_weight = {
		weight = 3
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_CARRIER_SAPIENT"
	size = small
	icon = "GFX_ship_part_computer_carrier_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "carrier"
	prerequisites = { "tech_combat_computers_3" }

	ship_modifier = {
		ship_engagement_range_mult = 1.0
	}

	ai_weight = {
		weight = 5
		modifier = {
			factor = 0
			OR = {
				has_global_flag = ghost_signal_5_flag
				has_global_flag = ghost_signal_4_flag
				has_global_flag = ghost_signal_3_flag
				has_global_flag = ghost_signal_2_flag
				has_global_flag = ghost_signal_1_flag
			}
		}
	}
}


utility_component_template = {
	key = "LoGHFlagship_COMPUTER_CARRIER_AUTONOMOUS"
	size = small
	icon = "GFX_ship_part_computer_carrier_sapient"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "carrier"
	prerequisites = { "tech_combat_computers_autonomous" }

	ship_modifier = {
		ship_engagement_range_mult = 1.0
	}

	ai_weight = {
		weight = 5
	}
}

utility_component_template = {
	key = "LoGHFlagship_COMPUTER_CARRIER_PRECOG"
	size = small
	icon = "GFX_ship_part_computer_carrier_precog"
	icon_frame = 1
	power = @power3
	resources = {
		category = ship_components
		cost = {
			alloys = @cost3
		}
	}
	class_restriction = { shipclass_military shipclass_starbase }
	size_restriction = { LoGHFlagship }
	component_set = "combat_computers"
	ship_behavior = "carrier"
	prerequisites = { "tech_precognition_interface" }

	ship_modifier = {
		ship_engagement_range_mult = 0.75
		ship_tracking_add = 10
	}

	ai_weight = {
		weight = 4
	}
}

