Part
    name = "SP_GRV"
    description = "SP_GRV_DESC"
    class = Bombard
    capacity = 1.0
    mountableSlotTypes = External
    buildcost = 5 * [[FLEET_UPKEEP_MULTIPLICATOR]] * [[SHIP_PART_COST_MULTIPLIER]]
    buildtime = 3
    tags = [ "CTRL_BOMBARD_LITHIC" "PEDIA_PC_BOMBARD" ]
    location = All
    effectsgroups = [
        EffectsGroup    // players can order graviton pulse 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
                /// @content_tag{LITHIC} When bombarding in-system enemy with this part, reduces population on visible populated Planet with tag
                HasTag name = "LITHIC"
            ]
            priority = [[EARLY_POPULATION_PRIORITY]]
            effects = [
                SetPopulation value = Value - 1
                GenerateSitRepMessage
                    message = "EFFECT_BIOWEAPON"
                    label = "EFFECT_BIOWEAPON_LABEL"
                    icon = "icons/sitrep/bio_weapon_2.png"
                    parameters = [
                        tag = "planet" data = Target.ID
                        tag = "rawtext" data = "1"
                        tag = "shippart" data = "SP_GRV"
                    ]
                    empire = Target.Owner
            ]

        EffectsGroup    // monsters use graviton pulse on player planets
            scope = NumberOf number = 1 condition = And [
                Planet
                InSystem id = Source.SystemID
                OwnedBy affiliation = AnyEmpire
                Stealth high = Source.Detection
                /// @content_tag{LITHIC} Each part owned by Unowned in system will reduce population on one visible populated empire Planet with tag
                HasTag name = "LITHIC"
            ]
            activation = And [
                Unowned
                InSystem
            ]
            priority = [[EARLY_POPULATION_PRIORITY]]
            effects = [
                SetPopulation value = Value - 1
                GenerateSitRepMessage
                    message = "EFFECT_BIOWEAPON"
                    label = "EFFECT_BIOWEAPON_LABEL"
                    icon = "icons/sitrep/bio_weapon_2.png"
                    parameters = [
                        tag = "planet" data = Target.ID
                        tag = "rawtext" data = "1"
                        tag = "shippart" data = "SP_GRV"
                    ]
                    empire = Target.Owner
            ]
    ]
    icon = "icons/ship_parts/gravitic_pulse.png"

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