
### common weapons ###

weapon_component_template = {
    key = "PLNMG_CORE_WARP_BEAM"
    size = titanic
    type = instant
    icon = GFX_ship_part_perdition_beam
    icon_frame = 1
    prio_projectile = yes

    firing_arc = 35
    power = -2000
    windup = { min = 100 max = 150 }
    total_fire_time = 250
    accuracy = 0.95
    tracking = 1
    damage = { min = 50000 max = 250000 }
    range = 250
    min_range = 100
    shield_damage = 2
    armor_damage = 1
    hull_damage = 2

    custom_tooltip = plnmg_pump_additional_desc
    on_hit = {
        custom_tooltip_with_params = {
            description = plnmg_core_warp_beam_aoe_tt
            description_parameters = { MIN_DAMAGE = 500 MAX_DAMAGE = 50000 RANGE = 50 }
        }
        hidden_effect = {
            save_event_target_as = target_ship
            from = { save_event_target_as = shooter_ship }
            from.controller = { plnmg_aeg_weapon_fire_with_check = yes }
        }
        inline_script = {
            script = ship_components/plnmg_weapon_aoe_distance_stratified
            damage = 50000 slot = t_slot type = weapon_type_energy role = weapon_role_artillery
            first_range = 10 second_range = 25 third_range = 50
        }
    }

    tags = { weapon_type_energy weapon_role_artillery t_slot }
    prerequisites = { tech_planetmega_aeg_weapon }
    potential = { from = { is_ai = no } }
    projectile_gfx = "perdition_beam"
    component_set = "PLNMG_CORE_WARP_BEAM"
    resources = {
        category = ship_components
        cost = {
            alloys = @titanic_t7_cost
            rare_crystals = @titanic_t7_rare
        }
        upkeep = {
            energy = @titanic_t7_upkeep_energy
            alloys = @titanic_t7_upkeep_alloys
        }
    }

    target_weights = {
        titan = 5
        battleship = 3
    }
    should_ai_use = no
    ai_weight = { weight = 0 }
}
weapon_component_template = {
    key = "PLNMG_CORE_WARP_BEAM_MINIATURIZED"
    size = extra_large
    type = instant
    icon = GFX_ship_part_perdition_beam
    icon_frame = 1
    prio_projectile = yes

    #firing_arc = 50
    power = -1000
    windup = { min = 20 max = 50 }
    total_fire_time = 150
    accuracy = 0.9
    tracking = 1
    damage = { min = 10000 max = 100000 }
    range = 150
    min_range = 65
    shield_damage = 1.5
    armor_damage = 1
    hull_damage = 1.5

    collateral_damage = { min = 100 max = 10000 }
    collateral_range = 25

    custom_tooltip = plnmg_pump_additional_desc
    on_hit = {
        hidden_effect = {
            save_event_target_as = target_ship
            from = { save_event_target_as = shooter_ship }
            from.controller = { plnmg_aeg_weapon_fire_with_check = yes }
        }
    }

    tags = { weapon_type_energy weapon_role_artillery x_slot }
    prerequisites = { tech_planetmega_aeg_weapon }
    potential = { from = { is_ai = no } }
    projectile_gfx = "perdition_beam"
    component_set = "PLNMG_CORE_WARP_BEAM"
    resources = {
        category = ship_components
        cost = {
            alloys = @xl_t7_cost
            rare_crystals = @xl_t7_rare
        }
        upkeep = {
            energy = @xl_t7_upkeep_energy
            alloys = @xl_t7_upkeep_alloys
        }
    }

    target_weights = {
        titan = 3
        battleship = 5
    }
    should_ai_use = no
    ai_weight = { weight = 0 }
}

# strike_craft_component_template = {
#     key = "PLNMG_T34_CARRIER_1"
#     size = large
#     entity = "crisis_cruiser_hull_entity"
#
#     weapon_type = instant
#     ship_behavior = "bombers_behavior"
#     projectile_gfx = "arc_emitter"
#
#     power = -300
#     resources = {
#         category = ship_components
#         cost = {
#             alloys = 100
#             minerals = 1000
#         }
#         upkeep = {
#             energy = 5
#             minerals = 5
#         }
#     }
#
#     potential = { has_global_flag = plnmg_t34_docked_test }
#     #prerequisites = { tech_planetmega_dummy }
#     show_tech_unlock_if = { country_uses_bio_ships = no }
#
#     count = 3
#     regeneration_per_day = 0.01
#     launch_time = 7
#
#     damage = { min = 3 max = 1700 }
#     cooldown = 70
#     range = 150
#     engagement_range = 250
#     accuracy = 1
#     tracking = 0
#
#     health = 2500
#     armor = 3500
#     shield = 3000
#     evasion = 0.15
#
#     speed = 140
#     rotation_speed = 0.2
#     acceleration = 0.25
#
#     shield_penetration = 1
#     armor_penetration = 1
#
#     icon = "GFX_ship_part_arc_emitter_1"
#     icon_frame = 1
#     component_set = "PLNMG_T34_CARRIER_1"
#
#     tags = {
#         weapon_type_energy
#         weapon_type_strike_craft
#         weapon_role_artillery
#         x_slot
#     }
#     should_ai_use = no
#
#     upgrades_to = PLNMG_T34_CARRIER_2
# }
# strike_craft_component_template = {
#     key = "PLNMG_T34_CARRIER_2"
#     size = large
#     #entity = "crisis_cruiser_hull_entity"
#     entity = "battleship_hull_entity"
#
#     weapon_type = instant
#     ship_behavior = "bombers_behavior"
#     projectile_gfx = "focused_arc_emitter"
#
#     power = -300
#     resources = {
#         category = ship_components
#         cost = {
#             alloys = 1000
#             minerals = 5000
#         }
#         upkeep = {
#             energy = 10
#             minerals = 10
#             alloys = 5
#         }
#     }
#
#     potential = { has_global_flag = plnmg_t34_docked_test }
#     #prerequisites = { tech_planetmega_dummy }
#     show_tech_unlock_if = { country_uses_bio_ships = no }
#
#     count = 5
#     regeneration_per_day = 0.01
#     launch_time = 13
#
#     damage = { min = 3 max = 1700 }
#     cooldown = 70
#     range = 150
#     engagement_range = 250
#     accuracy = 1
#     tracking = 0
#
#     health = 4000
#     armor = 6500
#     shield = 5000
#     evasion = 0.1
#
#     speed = 100
#     rotation_speed = 0.2
#     acceleration = 0.25
#
#     shield_penetration = 1
#     armor_penetration = 1
#
#     icon = "GFX_ship_part_arc_emitter_1"
#     icon_frame = 1
#     component_set = "PLNMG_T34_CARRIER_2"
#
#     tags = {
#         weapon_type_energy
#         weapon_type_strike_craft
#         weapon_role_artillery
#         x_slot
#     }
#     should_ai_use = no
# }

### multifunctional planet killers ###

weapon_component_template = {
    key = "PLANET_KILLER_PLNT_MULTIFUNC"
    size = planet_killer
    type = planet_killer
    prerequisites = { "tech_planetmega_colossus" }
    icon = GFX_ship_part_neutron_sweep
    icon_frame = 1
    component_set = "PLANET_KILLER_PLNT_MULTIFUNC"
    power = -8000
    windup = { min = 1 max = 1 }
    total_fire_time = 1
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = { alloys = 0 }
    }
    potential = { from = { is_ai = no } }
    should_ai_use = no
    ai_weight = { weight = 0 }
}

weapon_component_template = {
    key = "PLANET_KILLER_SYS_MULTIFUNC"
    size = planet_killer
    type = planet_killer
    can_destroy_stars = yes
    prerequisites = { "tech_plnmg_optimized_colossus" }
    icon = GFX_ship_part_neutron_sweep
    icon_frame = 1
    component_set = "PLANET_KILLER_SYS_MULTIFUNC"
    power = -8500
    windup = { min = 1 max = 1 }
    total_fire_time = 1
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = { alloys = 0 }
    }
    potential = { from = { is_ai = no } }
    should_ai_use = no
    ai_weight = { weight = 0 }
}

### mind absorbers ###

weapon_component_template = {
    key = "PLANET_KILLER_PLNMG_BRAIN_MERGER"
    size = planet_killer
    type = planet_killer
    prerequisites = { "tech_plnmg_interthought_aeg" }
    potential = {
        from = {
            is_ai = no
            is_hive_empire = yes
        }
    }

    icon = GFX_ship_part_nanobot_diffuser
    icon_frame = 1

    component_set = "PLANET_KILLER_PLNMG_BRAIN_MERGER"

    power = -7500
    windup = { min = 1 max = 1 }
    total_fire_time = 1
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = {
            alloys = 0
        }
    }

    should_ai_use = no
    ai_weight = {
        factor = 0
    }

    planet_destruction_gfx = "assimilation_nanobots_gfx"
}

weapon_component_template = {
    key = "PLANET_KILLER_PLNMG_BRAIN_VANILLA"
    size = planet_killer
    type = planet_killer
    prerequisites = { "tech_plnmg_integrated_interthought" }
    potential = {
        from = {
            is_ai = no
            is_hive_empire = yes
        }
    }

    icon = GFX_ship_part_nanobot_diffuser
    icon_frame = 1

    component_set = "PLANET_KILLER_PLNMG_BRAIN_VANILLA"

    power = -7500
    windup = { min = 90 max = 90 }
    total_fire_time = 30
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = {
            alloys = 0
        }
    }

    should_ai_use = no
    ai_weight = {
        factor = 0
    }

    planet_destruction_gfx = "assimilation_nanobots_gfx"
}

weapon_component_template = {
    key = "PLANET_KILLER_PLNMG_MIND_INTEGRATOR"
    size = planet_killer
    type = planet_killer
    prerequisites = { "tech_plnmg_interthought_aeg" }
    potential = {
        from = {
            is_ai = no
            is_hive_empire = no
        }
    }

    icon = GFX_ship_part_nanobot_diffuser
    icon_frame = 1

    component_set = "PLANET_KILLER_PLNMG_MIND_INTEGRATOR"

    power = -7500
    windup = { min = 1 max = 1 }
    total_fire_time = 1
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = {
            alloys = 0
        }
    }

    should_ai_use = no
    ai_weight = {
        factor = 0
    }

    planet_destruction_gfx = "assimilation_nanobots_gfx"
}

weapon_component_template = {
    key = "PLANET_KILLER_PLNMG_MIND_VANILLA"
    size = planet_killer
    type = planet_killer
    prerequisites = { "tech_plnmg_integrated_interthought" }
    potential = {
        from = {
            is_ai = no
            is_hive_empire = no
        }
    }

    icon = GFX_ship_part_nanobot_diffuser
    icon_frame = 1

    component_set = "PLANET_KILLER_PLNMG_MIND_VANILLA"

    power = -7500
    windup = { min = 90 max = 90 }
    total_fire_time = 30
    accuracy = 1
    damage = { min = 0 max = 0 }
    range = 0
    resources = {
        category = ship_components
        cost = {
            alloys = 0
        }
    }

    should_ai_use = no
    ai_weight = {
        factor = 0
    }

    planet_destruction_gfx = "assimilation_nanobots_gfx"
}

###test###
# weapon_component_template = {
#     key = "TEST_PLNMG_CWB_SMALL"
#     size = small
#     type = instant
#     icon = GFX_ship_part_perdition_beam
#     icon_frame = 1
#     prio_projectile = yes
#
#     #firing_arc = 35
#     power = -20
#     windup = { min = 10 max = 15 }
#     total_fire_time = 25
#     accuracy = 0.95
#     tracking = 1
#     damage = { min = 250 max = 1000 }
#     range = 50
#     #min_range = 100
#     shield_damage = 1
#     armor_damage = 1
#     hull_damage = 2
#
#     custom_tooltip = plnmg_pump_additional_desc
#     on_hit = {
#         custom_tooltip_with_params = {
#             description = plnmg_core_warp_beam_aoe_tt
#             description_parameters = { MIN_DAMAGE = 1 MAX_DAMAGE = 100 RANGE = 10 }
#         }
#         hidden_effect = {
#             save_event_target_as = target_ship
#             from = { save_event_target_as = shooter_ship }
#             from.controller = { plnmg_aeg_weapon_fire_with_check = yes }
#             plnmg_weapon_aoe_effect_distance = {
#                 damage = 100 range = 10 slot = s_slot type = weapon_type_energy random = yes
#             }
#         }
#     }
#
#     tags = { weapon_type_energy s_slot }
#     potential = { has_global_flag = plnmg_cwb_test }
#     projectile_gfx = "perdition_beam"
#     component_set = "PLNMG_CORE_WARP_BEAM"
#     resources = {
#         category = ship_components
#         cost = {
#             alloys = 1
#         }
#     }
#
#     target_weights = {
#         titan = 5
#         battleship = 3
#     }
#     should_ai_use = no
#     ai_weight = { weight = 0 }
# }
