Hull
    name = "SH_KRILL_2_BODY"
    description = "SH_KRILL_2_BODY_DESC"
    speed = 30
    fuel = 6
    NoDefaultFuelEffect
    stealth = 15
    structure = 40
    slots = [
        Slot type = Internal position = (0.20, 0.15)
        Slot type = External position = (0.80, 0.15)
    ]
    buildCost = 1
    buildTime = 1
    Unproducible
    tags = [ "PEDIA_HULL_MONSTER_KRILL" ]
    location = All
    effectsgroups = [
        EffectsGroup
            scope = And [
                System
                InSystem id = Source.SystemID
                Number low = 2 high = 3 condition = And [
                    Ship
                    InSystem id = Source.SystemID
                    DesignHasHull name = "SH_KRILL_2_BODY"
                ]
            ]
            activation = And [
                Turn low = max(60, LocalCandidate.LastTurnActiveInBattle + 1)
                InSystem
            ]
            stackinggroup = "KRILL_2_ACTION_STACK"
            effects = [
                CreateShip designname = "SM_KRILL_3"
/*
                GenerateSitRepMessage
                    message = "EFFECT_MONSTER_SPAWNING"
                    label = "EFFECT_MONSTER_SPAWNING_LABEL"
                    parameters = [
                        tag = "predefinedshipdesign" data = "SM_KRILL_3"
                        tag = "system" data = Source.SystemID
                    ]
*/
            ]
        EffectsGroup
            scope = And [
                Number low = 2 condition = And [
                    Ship
                    InSystem id = Source.SystemID
                    DesignHasHull name = "SH_KRILL_2_BODY"
                ]
                NumberOf number = 2 condition = And [
                    Ship
                    InSystem id = Source.SystemID
                    DesignHasHull name = "SH_KRILL_2_BODY"
                ]
            ]
            activation = And [
                Turn low = max(60, LocalCandidate.LastTurnActiveInBattle + 1)
                InSystem
            ]
           effects = Destroy

        EffectsGroup
            scope = And [
                Source
                ContainedBy And [
                    System
                    Contains Planet type = Asteroids
                ]
            ]
            activation = And [
                Turn low = max(60, LocalCandidate.LastTurnActiveInBattle + 1)
                Random probability = 0.15
                InSystem
            ]
            stackinggroup = "KRILL_2_ACTION_STACK"
            effects = [
                CreateShip designname = "SM_KRILL_1"
/*
                GenerateSitRepMessage
                    message = "EFFECT_MONSTER_SPAWNING"
                    label = "EFFECT_MONSTER_SPAWNING_LABEL"
                    parameters = [
                        tag = "predefinedshipdesign" data = "SM_KRILL_1"
                        tag = "system" data = Source.SystemID
                    ]
*/
            ]

        [[MONSTER_MOVE_ALWAYS]]
        [[INFINITE_FUEL]]
        [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]]
        [[MODERATE_VISION]]
        [[MONSTER_SHIELD_REGENERATION]]

        EffectsGroup
            scope = And [
                Fleet
                Stationary
                Object id = Source.FleetID
            ]
            activation = Random probability = 0.70
            stackinggroup = "KRILL_2_ACTION_STACK"
            effects = SetDestination destination = And [
                System
                WithinStarlaneJumps jumps = 1 condition = Source
                Not InSystem id = Source.SystemID
            ]
    ]
    icon = ""
    graphic = "icons/monsters/krill-2.png"

#include "monster.macros"

#include "../ship_hulls.macros"
