
utility_component_template = {
    key = "PLNMG_REACTOR_AEG"
    size = small
    icon = "GFX_ship_part_dark_matter_power_core"
    icon_frame = 1
    power = 1000
    resources = {
        category = ship_components
        cost = { alloys = @destroyer_reactor_cost_3 }
        upkeep = {
            energy = 1
            alloys = 0.1
        }
    }

    custom_tooltip = PLNMG_REACTOR_AEG_DESC_TT
    triggered_ship_modifier = {
        ship_reactor_power_add = 900
        mult = trigger:ship_size_multiplier
    }

    prerequisites = { "tech_planetmega_aeg_utility" }
    component_set = "power_core"

    ai_weight = { weight = 5 }
}

### planet defence ship's utility components ###

utility_component_template = {
    key = "PLNMG_DS_REACTOR_3"
    size = small
    icon = "GFX_ship_part_reactor_3"
    icon_frame = 1
    power = 250
    resources = {
        category = ship_components
        cost = { alloys = @destroyer_reactor_cost_3 }
        upkeep = {
            energy = 0.3
            alloys = 0.03
        }
    }

    # prerequisites = { "tech_cold_fusion_power" }
    # show_tech_unlock_if = { country_uses_bio_ships = no }
    component_set = "power_core"
    potential = { is_ship_size = planetmega_defence_ship }
    upgrades_to = "PLNMG_DS_REACTOR_5"

    ai_weight = { weight = 5 }
}
utility_component_template = {
    key = "PLNMG_DS_REACTOR_5"
    size = small
    icon = "GFX_ship_part_reactor_5"
    icon_frame = 1
    power = 1000
    resources = {
        category = ship_components
        cost = { alloys = @destroyer_reactor_cost_3 }
        upkeep = {
            energy = 1
            alloys = 0.1
        }
    }

    prerequisites = { "tech_zero_point_power" }
    show_tech_unlock_if = { has_technology = tech_planetmega_active_defense }
    component_set = "power_core"
    potential = { is_ship_size = planetmega_defence_ship }
    #upgrades_to = "PLNMG_DS_REACTOR_AEG"

    ai_weight = { weight = 5 }
}

utility_component_template = {
    key = "PLNMG_DS_THRUSTER_4"
    size = small
    icon = "GFX_ship_part_thruster_4"
    icon_frame = 1
    power = -50
    resources = {
        category = ship_components
        cost = { alloys = 25 }
    }
    modifier = {
        ship_base_speed_mult = 0.75
        ship_evasion_add = 5
        ship_evasion_mult = 0.10
    }

    # prerequisites = { "tech_thrusters_4" }
    # show_tech_unlock_if = { country_uses_bio_ships = no }
    component_set = "thruster_components"
    potential = { is_ship_size = planetmega_defence_ship }

    ai_weight = { weight = 5 }
}

utility_component_template = {
    key = "PLNMG_DS_COMPUTER_DEFAULT"
    size = small
    icon = "GFX_ship_part_computer_default"
    icon_frame = 1
    ship_behavior = "default"
    upgrade_path = default_plnmg_ds
    potential = { is_ship_size = planetmega_defence_ship }

    modifier = {
        ship_evasion_mult = 0.1
        #weapon_type_explosive_weapon_damage_mult = 0.05
    }
    ship_modifier = {
        ship_fire_rate_mult = 0.2
        ship_tracking_add = 10
        ship_accuracy_add = 5
        ship_weapon_range_mult = 0.05
        ship_engagement_range_mult = 0.25
    }

    component_set = "combat_computers"
    ai_weight = { weight = 1 }
}

### plnmg_plntmatter_carrier###

utility_component_template = {
    key = "PLNMG_PC_REACTOR_5"
    size = small
    icon = "GFX_ship_part_reactor_5"
    icon_frame = 1
    power = @colossus_power
    resources = {
        category = ship_components
        cost = { alloys = @colossus_reactor_cost_1 }
        upkeep = { energy = 5 }
    }

    # prerequisites = { "tech_zero_point_power" }
    # show_tech_unlock_if = { has_technology = tech_planetmega_active_defense }
    component_set = "power_core"
    potential = { is_ship_size = plnmg_plntmatter_carrier }
    upgrades_to = "PLNMG_PC_REACTOR_6"

    ai_weight = { weight = 5 }
}
utility_component_template = {
    key = "PLNMG_PC_REACTOR_6"
    size = small
    icon = "GFX_ship_part_dark_matter_power_core"
    icon_frame = 1
    power = 30000
    resources = {
        category = ship_components
        cost = { sr_dark_matter = 50 }
        upkeep = { energy = 10 }
    }

    prerequisites = { "tech_dark_matter_power_core" }
    show_tech_unlock_if = { can_build_plnmg_world_shaper = yes }
    component_set = "power_core"
    potential = { is_ship_size = plnmg_plntmatter_carrier }
    #upgrades_to = "PLNMG_DS_REACTOR_AEG"

    ai_weight = {
        weight = 5
        modifier = {
            factor = 0
            no_resource_for_component = { RESOURCE = sr_dark_matter }
        }
        modifier = {
            factor = 0
            is_ai = yes
        }
    }
}

utility_component_template = {
    key = "PLNMG_PC_THRUSTER_4"
    size = small
    icon = "GFX_ship_part_thruster_4"
    icon_frame = 1
    power = -500
    resources = {
        category = ship_components
        cost = { alloys = 250 }
    }
    modifier = { ship_base_speed_mult = 0.75 }

    # prerequisites = { "tech_thrusters_4" }
    # show_tech_unlock_if = { country_uses_bio_ships = no }
    component_set = "thruster_components"
    potential = { is_ship_size = plnmg_plntmatter_carrier }

    ai_weight = { weight = 5 }
}
utility_component_template = {
    key = "PLNMG_PC_THRUSTER_5"
    size = small
    icon = "GFX_ship_part_thruster_5"
    icon_frame = 1
    power = -1000
    resources = {
        category = ship_components
        cost = {
            alloys = 300
            sr_dark_matter = 30
        }
    }
    modifier = { ship_base_speed_mult = 1.25 }

    prerequisites = { "tech_dark_matter_propulsion" }
    show_tech_unlock_if = { can_build_plnmg_world_shaper = yes }
    component_set = "thruster_components"
    potential = { is_ship_size = plnmg_plntmatter_carrier }

    ai_weight = {
        weight = 5
        modifier = {
            factor = 0
            no_resource_for_component = { RESOURCE = sr_dark_matter }
        }
        modifier = {
            factor = 0
            is_ai = yes
        }
    }
}

utility_component_template = {
    key = "PLNMG_PC_COMPUTER_DEFAULT"
    size = small
    icon = "GFX_ship_part_computer_default"
    icon_frame = 1
    power = -10
    ship_behavior = "colossus"
    upgrade_path = colossus_plnmg_pc
    potential = { is_ship_size = plnmg_plntmatter_carrier }

    resources = {
        category = ship_components
        cost = { alloys = 0 }
    }
    component_set = "combat_computers"
    ai_weight = { weight = 0 }
}

### the abandoned

# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_1"
#     icon = GFX_ship_part_reactor_1
#     icon_frame = 1
#     power = 120
#     component_set = power_core
#     size = small
#     is_default_component = yes
#     size_restriction = { planetmega_defence_ship }
#     upgrades_to = PLNMG_DS_REACTOR_2
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_2"
#     icon = GFX_ship_part_reactor_2
#     icon_frame = 1
#     power = 165
#     component_set = power_core
#     size = small
#     prerequisites = { tech_fusion_power }
#     size_restriction = { planetmega_defence_ship }
#     upgrades_to = PLNMG_DS_REACTOR_3
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_3"
#     icon = GFX_ship_part_reactor_3
#     icon_frame = 1
#     power = 210
#     component_set = power_core
#     size = small
#     prerequisites = { tech_cold_fusion_power }
#     size_restriction = { planetmega_defence_ship }
#     upgrades_to = PLNMG_DS_REACTOR_4
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_4"
#     icon = GFX_ship_part_reactor_4
#     icon_frame = 1
#     power = 270
#     component_set = power_core
#     size = small
#     prerequisites = { tech_antimatter_power }
#     size_restriction = { planetmega_defence_ship }
#     upgrades_to = PLNMG_DS_REACTOR_5
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_5"
#     icon = GFX_ship_part_reactor_5
#     icon_frame = 1
#     power = 360
#     component_set = power_core
#     size = small
#     prerequisites = { tech_zero_point_power }
#     upgrades_to = PLNMG_DS_REACTOR_6
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 200 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_REACTOR_6"
#     icon = GFX_ship_part_dark_matter_power_core
#     icon_frame = 1
#     power = 460
#     component_set = power_core
#     size = small
#     prerequisites = { tech_dark_matter_power_core }
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 1000 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_THRUSTER_1"
#     icon = GFX_ship_part_thruster_1
#     icon_frame = 1
#     power = -15
#     size = small
#     component_set = thruster_components
#     is_default_component = yes
#     upgrades_to = PLNMG_DS_THRUSTER_2
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_THRUSTER_2"
#     icon = GFX_ship_part_thruster_2
#     icon_frame = 1
#     power = -22
#     size = small
#     component_set = thruster_components
#     prerequisites = { tech_thrusters_2 }
#
#     modifier = {
#         ship_base_speed_mult = 0.25
#         ship_evasion_add = 5
#     }
#
#     upgrades_to = PLNMG_DS_THRUSTER_3
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_THRUSTER_3"
#     icon = GFX_ship_part_thruster_3
#     icon_frame = 1
#     power = -30
#     size = small
#     component_set = thruster_components
#     prerequisites = { tech_thrusters_3 }
#
#     modifier = {
#         ship_base_speed_mult = 0.5
#         ship_evasion_add = 9
#     }
#
#     upgrades_to = PLNMG_DS_THRUSTER_4
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 100 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_THRUSTER_4"
#     icon = GFX_ship_part_thruster_4
#     icon_frame = 1
#     power = -40
#     size = small
#     component_set = thruster_components
#     prerequisites = { tech_thrusters_4 }
#
#     modifier = {
#         ship_base_speed_mult = 0.75
#         ship_evasion_add = 13
#     }
#
#     upgrades_to = PLNMG_DS_THRUSTER_5
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 200 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_THRUSTER_5"
#     icon = GFX_ship_part_thruster_5
#     icon_frame = 1
#     power = -50
#     size = small
#     component_set = thruster_components
#     prerequisites = { tech_dark_matter_propulsion }
#
#     modifier = {
#         ship_base_speed_mult = 1.25
#         ship_evasion_add = 18
#     }
#
#     size_restriction = { planetmega_defence_ship }
#     ai_weight = { weight = 1000 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_DEFAULT"
#     size = small
#     icon = "GFX_ship_part_computer_default"
#     icon_frame = 1
#     power = -5
#     ship_behavior = "swarm"
#     is_default_component = yes
#
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     upgrades_to = "PLNMG_DS_COMPUTER_SWARM_BASIC"
#     ai_tags = { gunship }
#     ai_tag_weight = 0
#
#     ai_weight = {
#         weight = 1
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_BASIC"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_basic"
#     icon_frame = 1
#     power = -10
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "swarm"
#     prerequisites = { "tech_combat_computers_1" }
#     upgrades_to = "PLNMG_DS_COMPUTER_SWARM_ADVANCED"
#     ai_tags = { gunship brawler brawler_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.05
#     }
#     ship_modifier = {
#         ship_fire_rate_mult = 0.05
#     }
#
#     ai_weight = {
#         weight = 2
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_ADVANCED"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_advanced"
#     icon_frame = 1
#     power = -15
#
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "swarm"
#     prerequisites = { "tech_combat_computers_2" }
#     upgrades_to = "PLNMG_DS_COMPUTER_SWARM_SAPIENT"
#     ai_tags = { gunship brawler brawler_stealth }
#     ai_tag_weight = 0
#
#     modifier = { ship_evasion_mult = 0.10 }
#     ship_modifier = { ship_fire_rate_mult = 0.10 }
#
#     ai_weight = { weight = 3 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_SAPIENT"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "swarm"
#     prerequisites = { "tech_combat_computers_3" }
#     ai_tags = { gunship brawler brawler_stealth }
#     ai_tag_weight = 0
#
#     modifier = { ship_evasion_mult = 0.25 }
#     ship_modifier = { ship_fire_rate_mult = 0.15 }
#
#     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
#                 has_policy_flag = ai_outlawed
#             }
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_AUTONOMOUS"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "swarm"
#     prerequisites = { "tech_combat_computers_autonomous" }
#     ai_tags = { gunship brawler brawler_stealth }
#     ai_tag_weight = 0
#
#     modifier = { ship_evasion_mult = 0.25 }
#     ship_modifier = { ship_fire_rate_mult = 0.15 }
#
#     ai_weight = {
#         weight = 5
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_SWARM_PRECOG"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_precog"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "swarm"
#     prerequisites = { "tech_precognition_interface" }
#     ai_tags = { gunship brawler brawler_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.15
#         ship_speed_mult = 0.20
#     }
#     ship_modifier = {
#         ship_fire_rate_mult = 0.15
#     }
#
#     ai_weight = { weight = 4 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_TORPEDO_BASIC"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_basic"
#     icon_frame = 1
#     power = -10
#
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "torpedo"
#     prerequisites = { "tech_combat_computers_1" "tech_torpedoes_1" }
#     upgrades_to = "PLNMG_DS_COMPUTER_SWARM_ADVANCED"
#     ai_tags = { explosive explosive_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         weapon_type_explosive_weapon_damage_mult = 0.05
#     }
#
#     ai_weight = {
#         weight = 2
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_TORPEDO_ADVANCED"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_advanced"
#     icon_frame = 1
#     power = -15
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "torpedo"
#     prerequisites = { "tech_combat_computers_2" "tech_torpedoes_1" }
#     upgrades_to = "PLNMG_DS_COMPUTER_TORPEDO_SAPIENT"
#     ai_tags = { explosive explosive_stealth }
#     ai_tag_weight = 0
#
#     modifier = { weapon_type_explosive_weapon_damage_mult = 0.10 }
#     ai_weight = { weight = 3 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_TORPEDO_SAPIENT"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "torpedo"
#     prerequisites = { "tech_combat_computers_3" "tech_torpedoes_1" }
#     ai_tags = { explosive explosive_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.10
#         weapon_type_explosive_weapon_damage_mult = 0.15
#     }
#
#     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
#                 has_policy_flag = ai_outlawed
#             }
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_TORPEDO_AUTONOMOUS"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "torpedo"
#     prerequisites = { "tech_combat_computers_autonomous" "tech_torpedoes_1" }
#     ai_tags = { explosive explosive_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.10
#         weapon_type_explosive_weapon_damage_mult = 0.15
#     }
#
#     ai_weight = { weight = 5 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_TORPEDO_PRECOG"
#     size = small
#     icon = "GFX_ship_part_computer_swarm_precog"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "torpedo"
#     prerequisites = { "tech_precognition_interface" "tech_torpedoes_1" }
#     ai_tags = { explosive explosive_stealth }
#     ai_tag_weight = 0
#
#     modifier = {
#         weapon_type_explosive_weapon_damage_mult = 0.15
#         ship_tracking_add = 10
#     }
#
#     ai_weight = { weight = 4 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_PICKET_BASIC"
#     size = small
#     icon = "GFX_ship_part_computer_picket_basic"
#     icon_frame = 1
#     power = -10
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "picket"
#     prerequisites = { "tech_combat_computers_1" }
#     upgrades_to = "PLNMG_DS_COMPUTER_PICKET_ADVANCED"
#     ai_tags = { screen }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.05
#         ship_tracking_add = 10
#     }
#
#     ai_weight = {
#         weight = 2
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_PICKET_ADVANCED"
#     size = small
#     icon = "GFX_ship_part_computer_picket_advanced"
#     icon_frame = 1
#     power = -15
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "picket"
#     prerequisites = { "tech_combat_computers_2" }
#     upgrades_to = "COMBAT_COMPUTER_PICKET_SAPIENT"
#     ai_tags = { screen }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.10
#         ship_tracking_add = 20
#     }
#
#     ai_weight = { weight = 3 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_PICKET_SAPIENT"
#     size = small
#     icon = "GFX_ship_part_computer_picket_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "picket"
#     prerequisites = { "tech_combat_computers_3" }
#     ai_tags = { screen }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.10
#     }
#     ship_modifier = {
#         ship_fire_rate_mult = 0.15
#         ship_tracking_add = 30
#     }
#
#     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
#                 has_policy_flag = ai_outlawed
#             }
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_PICKET_AUTONOMOUS"
#     size = small
#     icon = "GFX_ship_part_computer_picket_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "picket"
#     prerequisites = { "tech_combat_computers_autonomous" }
#     ai_tags = { screen }
#     ai_tag_weight = 0
#
#     modifier = {
#         ship_evasion_mult = 0.10
#     }
#     ship_modifier = {
#         ship_fire_rate_mult = 0.15
#         ship_tracking_add = 30
#     }
#
#     ai_weight = { weight = 5 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_PICKET_PRECOG"
#     size = small
#     icon = "GFX_ship_part_computer_picket_precog"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "picket"
#     prerequisites = { "tech_precognition_interface" }
#     ai_tags = { screen }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.20
#         ship_tracking_add = 40
#     }
#
#     ai_weight = { weight = 4 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_MODERN_ARTILLERY_ADVANCED"
#     size = small
#     icon = "GFX_ship_part_computer_artillery_advanced"
#     icon_frame = 1
#     power = -15
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "artillery"
#     prerequisites = { "tech_combat_computers_2" }
#     upgrades_to = "COMBAT_COMPUTER_ARTILLERY_SAPIENT"
#     ai_tags = { artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.10
#         ship_weapon_range_mult = 0.10
#     }
#
#     ai_weight = { weight = 3 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_MODERN_ARTILLERY_SAPIENT"
#     size = small
#     icon = "GFX_ship_part_computer_artillery_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "artillery"
#     prerequisites = { "tech_combat_computers_3" }
#     ai_tags = { artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
#     ai_tag_weight = 0
#
#     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
#                 has_policy_flag = ai_outlawed
#             }
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_MODERN_ARTILLERY_AUTONOMOUS"
#     size = small
#     icon = "GFX_ship_part_computer_artillery_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "artillery"
#     prerequisites = { "tech_combat_computers_autonomous" }
#     ai_tags = { artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.20
#         ship_weapon_range_mult = 0.20
#     }
#
#     ai_weight = { weight = 5 }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_MODERN_ARTILLERY_PRECOG"
#     size = small
#     icon = "GFX_ship_part_computer_artillery_precog"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "artillery"
#     prerequisites = { "tech_precognition_interface" }
#     ai_tags = { artillery artillery_stealth energy_torpedoes energy_torpedoes_stealth }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_fire_rate_mult = 0.15
#         ship_weapon_range_mult = 0.15
#         ship_tracking_add = 10
#     }
#
#     ai_weight = { weight = 4 }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_CARRIER_ADVANCED"
#     size = small
#     icon = "GFX_ship_part_computer_carrier_advanced"
#     icon_frame = 1
#     power = -15
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "carrier"
#     prerequisites = { "tech_combat_computers_2" }
#     upgrades_to = "COMBAT_COMPUTER_CARRIER_SAPIENT"
#     ai_tags = { carrier }
#     ai_tag_weight = 0
#
#     ship_modifier = { ship_engagement_range_mult = 0.50 }
#
#     ai_weight = {
#         weight = 3
#         modifier = {
#             factor = 5
#             is_preferred_weapons = weapon_type_strike_craft
#         }
#     }
# }
#
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_CARRIER_SAPIENT"
#     size = small
#     icon = "GFX_ship_part_computer_carrier_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "carrier"
#     prerequisites = { "tech_combat_computers_3" }
#     ai_tags = { carrier }
#     ai_tag_weight = 0
#
#     ship_modifier = { ship_engagement_range_mult = 1.0 }
#
#     ai_weight = {
#         weight = 5
#         modifier = {
#             factor = 5
#             is_preferred_weapons = weapon_type_strike_craft
#         }
#         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
#                 has_policy_flag = ai_outlawed
#             }
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_CARRIER_AUTONOMOUS"
#     size = small
#     icon = "GFX_ship_part_computer_carrier_sapient"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "carrier"
#     prerequisites = { "tech_combat_computers_autonomous" }
#     ai_tags = { carrier }
#     ai_tag_weight = 0
#
#     ship_modifier = { ship_engagement_range_mult = 1.0 }
#
#     ai_weight = {
#         weight = 5
#         modifier = {
#             factor = 5
#             is_preferred_weapons = weapon_type_strike_craft
#         }
#     }
# }
# utility_component_template = {
#     key = "PLNMG_DS_COMPUTER_CARRIER_PRECOG"
#     size = small
#     icon = "GFX_ship_part_computer_carrier_precog"
#     icon_frame = 1
#     power = -25
#     class_restriction = { shipclass_military }
#     size_restriction = { planetmega_defence_ship }
#     component_set = "combat_computers"
#     ship_behavior = "carrier"
#     prerequisites = { "tech_precognition_interface" }
#     ai_tags = { carrier }
#     ai_tag_weight = 0
#
#     ship_modifier = {
#         ship_engagement_range_mult = 0.75
#         ship_tracking_add = 10
#     }
#
#     ai_weight = {
#         weight = 4
#         modifier = {
#             factor = 5
#             is_preferred_weapons = weapon_type_strike_craft
#         }
#     }
# }

# kept for compatibility
utility_component_template = {
    key = "PLNMG_DS_REACTOR_AEG"
    size = small
    icon = "GFX_ship_part_dark_matter_power_core"
    icon_frame = 1
    power = 10000
    resources = {
        category = ship_components
        cost = { alloys = @destroyer_reactor_cost_3 }
        upkeep = {
            energy = 1
            alloys = 0.1
        }
    }
    hidden = yes
    prerequisites = { "tech_planetmega_aeg_utility" }
    show_tech_unlock_if = { always = no }
    component_set = "power_core"
    potential = { is_ship_size = planetmega_defence_ship }

    ai_weight = { weight = 5 }
}
