Part
    name = "SP_EMP"
    description = "SP_EMP_DESC"
    class = Bombard
    capacity = 0.5
    mountableSlotTypes = External
    buildcost = 5 * [[FLEET_UPKEEP_MULTIPLICATOR]]
    buildtime = 3
    tags = [ "CTRL_BOMBARD_ROBOTIC" "PEDIA_PC_BOMBARD" ]
    location = All
    effectsgroups = [
        EffectsGroup    // players can order EMP used on enemies
            scope = And [
                Planet
                Species
                InSystem id = Source.SystemID
                OrderedBombardedBy condition = Source
                Or [
                    OwnedBy affiliation = EnemyOf empire = Source.Owner
                    Unowned
                ]
                VisibleToEmpire empire = Source.Owner
                HasTag name = "ROBOTIC"
            ]
            effects = [
                SetPopulation value = Value - 0.5
                GenerateSitRepMessage
                    message = "EFFECT_BIOWEAPON"
                    label = "EFFECT_BIOWEAPON_LABEL"
                    icon = "icons/sitrep/bio_weapon_1.png"
                    parameters = [
                        tag = "planet" data = Target.ID
                        tag = "rawtext" data = "0.5"
                        tag = "shippart" data = "SP_EMP"
                    ]
                    empire = Target.Owner
            ]

        EffectsGroup    // monsters use EMP on player planets
            scope = NumberOf number = 1 condition = And [
                Planet
                InSystem id = Source.SystemID
                OwnedBy affiliation = AnyEmpire
                Stealth high = Source.Detection
                HasTag name = "ROBOTIC"
            ]
            activation = And [
                            Unowned
                            InSystem
                         ]
            effects = [
                SetPopulation value = Value - 0.5
                GenerateSitRepMessage
                    message = "EFFECT_BIOWEAPON"
                    label = "EFFECT_BIOWEAPON_LABEL"
                    icon = "icons/sitrep/bio_weapon_1.png"
                    parameters = [
                        tag = "planet" data = Target.ID
                        tag = "rawtext" data = "0.5"
                        tag = "shippart" data = "SP_EMP"
                    ]
                    empire = Target.Owner
            ]
    ]
    icon = "icons/ship_parts/EMP.png"

#include "/scripting/common/upkeep.macros"
