Species
    name = "SP_SLY"
    description = "SP_SLY_DESC"
    gameplay_description = "SP_SLY_GAMEPLAY_DESC"
    Playable
    CanProduceShips
    CanColonize

    tags = [ "VERY_BAD_SUPPLY" "PEDIA_PC_FUEL" "GASEOUS" "GOOD_INFLUENCE" "GREAT_STOCKPILE" "NO_TERRAFORM" "BAD_RESEARCH" "BAD_WEAPONS" "GOOD_DETECTION" "GREAT_STEALTH" "BAD_OFFENSE_TROOPS" "PEDIA_GASEOUS_SPECIES_CLASS" "INDEPENDENT_HAPPINESS" "PEDIA_INDEPENDENT" ]

    foci = [
        [[HAS_INDUSTRY_FOCUS]]
        [[HAS_RESEARCH_FOCUS]]
        [[HAS_INFLUENCE_FOCUS]]
        [[HAS_GROWTH_FOCUS]]
        [[HAS_ADVANCED_FOCI]]
    ]

    defaultfocus = "FOCUS_INDUSTRY"
    likes = ["FOCUS_INDUSTRY" "SPARK_FOSSILS_SPECIAL" "MIMETIC_ALLOY_SPECIAL" "CRYSTALS_SPECIAL" "KRAKEN_NEST_SPECIAL" "PANOPTICON_SPECIAL" "PHILOSOPHER_SPECIAL" "PLC_ARTISAN_WORKSHOPS" "PLC_CONFEDERATION" "PLC_CONTINUOUS_SCANNING" "PLC_EXPLORATION" "PLC_NATIVE_APPROPRIATION" "PLC_DIVERSITY" ]
    dislikes = [
        "BLD_GAS_GIANT_GEN"   // messes with their way of life
        "BLD_BIOTERROR_PROJECTOR" "BLD_SCANNING_FACILITY" "BLD_MEGALITH" "BLD_SPACE_ELEVATOR" "BLD_HYPER_DAM" "BLD_PLANET_BEACON" "BLD_SPATIAL_DISTORT_GEN" "ELERIUM_SPECIAL" "RESONANT_MOON_SPECIAL" "TEMPORAL_ANOMALY_SPECIAL" "SUPERCONDUCTOR_SPECIAL" "PLC_RACIAL_PURITY" "PLC_TERROR_SUPPRESSION" "PLC_CONFORMANCE" "PLC_CHECKPOINTS"
    ]

    effectsgroups = [
        [[AVERAGE_INDUSTRY]]
        [[BAD_RESEARCH]]
        [[GOOD_INFLUENCE]]
        [[GREAT_STOCKPILE]]

        [[AVERAGE_POPULATION]]
        [[INDEPENDENT_HAPPINESS]]
        [[COMMON_OPINION_EFFECTS(SP_SLY)]]
        [[VERY_BAD_SUPPLY]]
        [[GREAT_DEFENSE_TROOPS]]
        [[BAD_OFFENSE_TROOPS]]
        [[BAD_WEAPONS]]

        [[GOOD_DETECTION]]
        [[GREAT_STEALTH]]

        // not for description
        [[AVERAGE_PLANETARY_SHIELDS]]
        [[AVERAGE_PLANETARY_DEFENSE]]
        [[NARROW_EP]]
        [[STANDARD_SHIP_SHIELDS]]

        // Extra refueling on gas giants
        EffectsGroup
            description = "GASEOUS_DESC"
            scope = Source
            activation = And [
                Ship
                Stationary
                ContainedBy And [
                    Object id = Source.SystemID
                    Contains condition = And [
                        Planet type = GasGiant
                        Not OwnedBy affiliation = EnemyOf empire = RootCandidate.Owner
                    ]
                ]
            ]
            stackinggroup = "SP_SLY_FUEL_STACK"
            // Update ship_hulls.macros if this number changes
            effects = SetFuel value = Value + 0.1

        // Always repair and resupply at own planets
        EffectsGroup
            scope = And [
                Ship
                InSystem id = Source.SystemID
                Stationary
                Species name = ThisSpecies
                Or [
                    OwnedBy empire = Source.Owner
                    And [
                        // either ally providing repair or owner of ship being repaired must adopt policy to share repairs
                        Or [
                            EmpireHasAdoptedPolicy empire = Source.Owner name = "PLC_ALLIED_REPAIR"
                            EmpireHasAdoptedPolicy empire = LocalCandidate.Owner name = "PLC_ALLIED_REPAIR"
                        ]
                        OwnedBy affiliation = AllyOf empire = Source.Owner
                    ]
                ]
                Turn low = LocalCandidate.System.LastTurnBattleHere + 1
                Structure high = LocalCandidate.MaxStructure - 0.001
                // ResupplyableBy empire = Source.Owner -> intentionally not required
            ]
            activation = Planet
            stackinggroup = "FLEET_REPAIR"
            effects = [
                SetStructure value = Value + (Target.MaxStructure/10)
                SetFuel value = Target.MaxFuel
                // TODO: have a resupply effect that will also act on part meters without needing to list them all...
            ]

        EffectsGroup
            scope = Source
            activation = Capital
            effects = UnlockPolicy name = "PLC_CONFEDERATION" empire = Source.Owner
    ]

    [[GASEOUS_STANDARD_EP]]

    graphic = "icons/species/amorphous-05.png"

#include "common/*.macros"

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