CHANCE_OF_GUARD_1
'''        EffectsGroup
            scope = Source
            activation = And [
                Turn high = 0
                Random probability = 0.70
                (GalaxyMaxAIAggression >= 1)
                (GalaxyMonsterFrequency >= 1)
                Not ContainedBy Contains Or [
                    Design name = "SM_EXP_OUTPOST"
                    Building name = "BLD_EXPERIMENTOR_OUTPOST"
                    And [ Planet HasSpecial name = "HIGH_TECH_NATIVES_SPECIAL" ]
                ]
            ]
            effects = [
                If condition = And [
                        Random probability = 0.5
                        [[MINIMUM_DISTANCE_EMPIRE_CHECK]]
                    ]
                    effects = [
                        If condition = ContainedBy Contains Planet type = Asteroids
                                effects = CreateShip designname = OneOf("SM_SNAIL", "SM_GUARD_0", "SM_GUARD_1")
                        else = [
                            CreateShip designname = OneOf("SM_GUARD_0", "SM_GUARD_1")
                        ]
                    ]
                else = [
                    If condition = And [
                            Random probability = 0.5
                            Not Homeworld
                        ]
                        effects = [
                            SetSpecies name = "SP_ANCIENT_GUARDIANS"
                            SetPopulation value = Target.TargetPopulation
                        ]
                    else = [
                        AddSpecial name = OneOf("CLOUD_COVER_MASTER_SPECIAL", "VOLCANIC_ASH_MASTER_SPECIAL")
                    ]
                ]
            ]
'''

CHANCE_OF_GUARD_2
'''        EffectsGroup
            scope = Source
            activation = And [
                Turn high = 0
                Not ContainedBy Contains Or [
                    Design name = "SM_EXP_OUTPOST"
                    Building name = "BLD_EXPERIMENTOR_OUTPOST"
                    And [ Planet HasSpecial name = "HIGH_TECH_NATIVES_SPECIAL" ]
                ]
            ]
            effects = [
                If condition = And [
                        (GalaxyMaxAIAggression >= 1)
                        (GalaxyMonsterFrequency >= 1)
                        [[MINIMUM_DISTANCE_EMPIRE_CHECK]]
                    ]
                    effects = CreateShip designname = "SM_GUARD_2"
                else = [
                    If condition = And [
                            Random probability = 0.7
                            Not Homeworld
                        ]
                        effects = [
                            SetSpecies name = "SP_ANCIENT_GUARDIANS"
                            SetPopulation value = Target.TargetPopulation
                            AddSpecial name = "MODERATE_TECH_NATIVES_SPECIAL"
                        ]
                    else = [
                        AddSpecial name = "VOLCANIC_ASH_MASTER_SPECIAL"
                    ]
                ]
            ]
'''

CHANCE_OF_GUARD_3
'''        EffectsGroup
            scope = Source
            activation = And [
                Turn high = 0
                Not ContainedBy Contains Or [
                    Design name = "SM_EXP_OUTPOST"
                    Building name = "BLD_EXPERIMENTOR_OUTPOST"
                    And [ Planet HasSpecial name = "HIGH_TECH_NATIVES_SPECIAL" ]
                ]
            ]
            effects = [
                If condition = And [
                        (GalaxyMaxAIAggression >= 1)
                        (GalaxyMonsterFrequency >= 1)
                        [[MINIMUM_DISTANCE_EMPIRE_CHECK]]
                    ]
                    effects = CreateShip designname = "SM_GUARD_3"
                else = [
                    If condition = And [
                            Random probability = 0.7
                            Not Homeworld
                        ]
                        effects = [
                            SetSpecies name = "SP_ANCIENT_GUARDIANS"
                            SetPopulation value = Target.TargetPopulation
                            AddSpecial name = "HIGH_TECH_NATIVES_SPECIAL"
                        ]
                    else = [
                        AddSpecial name = "DIM_RIFT_MASTER_SPECIAL"
                    ]
                ]
            ]
'''

CHANCE_OF_HIDE_1
'''        EffectsGroup
            scope = Source
            activation = And [
                // Note: Kraken nests are created in the initial turn and also turns 1 and 2
                // only check in the first turns of the game. 
                Turn high = 5
                Not HasSpecial name = "CLOUD_COVER_MASTER_SPECIAL"
                // every nest has only one chance to get clouds, no matter which turn it was created:
                (CurrentTurn <= max(1, 1 + SpecialAddedOnTurn name = ThisSpecial object = Source.ID))
                Random probability = 0.15
                (GalaxyMaxAIAggression >= 1)
                Not ContainedBy Contains Or [
                    Design name = "SM_EXP_OUTPOST"
                    Building name = "BLD_EXPERIMENTOR_OUTPOST"
                ]
            ]
            effects = [
                AddSpecial name = "CLOUD_COVER_MASTER_SPECIAL"
            ]
'''

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