Species
    name = "SP_LEMBALALAM"
    description = "SP_LEMBALALAM_DESC"
    gameplay_description = "SP_LEMBALALAM_GAMEPLAY_DESC"
    Native

    tags = [ "ORGANIC" "NO_INDUSTRY" "GOOD_RESEARCH" "AVERAGE_SUPPLY" "GOOD_STEALTH" "PEDIA_ORGANIC_SPECIES_CLASS" ]

    foci = [
        /*[[HAS_INDUSTRY_FOCUS]]*/
        [[HAS_RESEARCH_FOCUS]]
        /*[[HAS_GROWTH_FOCUS]]*/
        [[HAS_ADVANCED_FOCI]]
    ]

    preferredfocus = "FOCUS_RESEARCH"

    effectsgroups = [
        [[NO_INDUSTRY]]
        [[GOOD_RESEARCH]]
        [[AVERAGE_STOCKPILE]]

        [[AVERAGE_HAPPINESS]]
        [[AVERAGE_SUPPLY]]
        [[AVERAGE_DEFENSE_TROOPS]]

        [[GOOD_STEALTH]]

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

        // Start the game with Volcanic Ash stealth special
        EffectsGroup
            scope = Source
            activation = Turn high = 0
            //stackinggroup = "GAME_START_MOD_STACK"
            effects = [
                AddSpecial name = "VOLCANIC_ASH_SLAVE_SPECIAL"
                AddSpecial name = "VOLCANIC_ASH_MASTER_SPECIAL"
            ]

        // Always start the game as High Tech natives
        EffectsGroup
            scope = And [
                Source
                Not HasSpecial name = "HIGH_TECH_NATIVES_SPECIAL" 
            ]
            activation = Turn high = 0
            //stackinggroup = "GAME_START_MOD_STACK"
            effects = AddSpecial name = "HIGH_TECH_NATIVES_SPECIAL"

        // Max Population is fixed at 5
        EffectsGroup
            description = "FIXED_LOW_POPULATION_DESC"
            scope = Source
            activation = And [
                Planet
                Not Planet environment = [ uninhabitable ]
            ]
            priority = [[TARGET_POPULATION_OVERRIDE_PRIORITY]]
            effects =
                SetTargetPopulation value = 5 accountinglabel = "IMMORTAL_LABEL"


        // set population to max
        EffectsGroup
            scope = And [
                Source
                Planet
            ]
            activation = Turn high = 1
            priority = [[EARLY_POPULATION_OVERRIDE_PRIORITY]]
            effects = SetPopulation value = Target.TargetPopulation

        // Give techs to empire
        EffectsGroup
            scope = Source
            activation = Not OwnerHasTech name = "SPY_STEALTH_1"
            stackinggroup = "LEMBALALAM_TECH_UNLOCK"
            effects = [
                GiveEmpireTech name = "SPY_STEALTH_1" empire = Target.Owner                
                GenerateSitRepMessage
                    message = "EFFECT_NATIVES_TECH"
                    label = "EFFECT_NATIVES_TECH_LABEL"
                    icon = "icons/species/other-01.png"
                    parameters = [
                        tag = "planet" data = Source.ID
                        tag = "species" data = "SP_LEMBALALAM"
                        tag = "tech" data = "SPY_STEALTH_1"
                    ]
                    empire = Source.Owner
           ]

        EffectsGroup
            scope = Source
            activation = And [
                Not OwnerHasTech name = "SPY_STEALTH_2"
                OwnerHasTech name = "SPY_STEALTH_1"
            ]
            stackinggroup = "LEMBALALAM_TECH_UNLOCK"
            effects = [
                GiveEmpireTech name = "SPY_STEALTH_2" empire = Target.Owner                
                GenerateSitRepMessage
                    message = "EFFECT_NATIVES_TECH"
                    label = "EFFECT_NATIVES_TECH_LABEL"
                    icon = "icons/species/other-01.png"
                    parameters = [
                        tag = "planet" data = Source.ID
                        tag = "species" data = "SP_LEMBALALAM"
                        tag = "tech" data = "SPY_STEALTH_2"
                    ]
                    empire = Source.Owner
           ]

        EffectsGroup
            scope = Source
            activation = Not OwnerHasTech name = "GRO_LIFECYCLE_MAN"
            stackinggroup = "LEMBALALAM_TECH_UNLOCK"
            effects = [
                GiveEmpireTech name = "GRO_LIFECYCLE_MAN" empire = Target.Owner                
                GenerateSitRepMessage
                    message = "EFFECT_NATIVES_TECH"
                    label = "EFFECT_NATIVES_TECH_LABEL"
                    icon = "icons/species/other-01.png"
                    parameters = [
                        tag = "planet" data = Source.ID
                        tag = "species" data = "SP_LEMBALALAM"
                        tag = "tech" data = "GRO_LIFECYCLE_MAN"
                    ]
                    empire = Source.Owner
           ]
    ]

    [[DESERT_STANDARD_EP]]

    graphic = "icons/species/other-01.png"

#include "common/*.macros"

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