Hull
    name = "SH_KRILL_3_BODY"
    description = "SH_KRILL_3_BODY_DESC"
    speed = 25
    fuel = 5
    NoDefaultFuelEffect
    stealth = 15
    structure = 250
    slots = [
        Slot type = Internal position = (0.20, 0.15)
        Slot type = External position = (0.80, 0.15)
        Slot type = External position = (0.20, 0.75)
        Slot type = External position = (0.80, 0.75)
    ]
    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_3_BODY"
                ]
            ]
            activation = And [
                Turn low = max(90, LocalCandidate.LastTurnActiveInBattle + 1)
                InSystem
            ]
            stackinggroup = "KRILL_3_ACTION_STACK"
            effects = [
                CreateShip designname = "SM_KRILL_4"
/*
                GenerateSitRepMessage
                    message = "EFFECT_MONSTER_SPAWNING"
                    label = "EFFECT_MONSTER_SPAWNING_LABEL"
                    parameters = [
                        tag = "predefinedshipdesign" data = "SM_KRILL_4"
                        tag = "system" data = Source.SystemID
                    ]
*/
            ]
        EffectsGroup
            scope = And [
                Number low = 2 condition = And [
                    Ship
                    InSystem id = Source.SystemID
                    DesignHasHull name = "SH_KRILL_3_BODY"
                ]
                NumberOf number = 2 condition = And [
                    Ship
                    InSystem id = Source.SystemID
                    DesignHasHull name = "SH_KRILL_3_BODY"
                ]
            ]
            activation = And [
                Turn low = max(90, LocalCandidate.LastTurnActiveInBattle + 1)
                InSystem
            ]
            effects = Destroy

        EffectsGroup
            scope = And [
                Source
                ContainedBy And [
                    System
                    Contains Planet type = Asteroids
                ]
            ]
            activation = And [
                Turn low = max(90, LocalCandidate.LastTurnActiveInBattle + 1)
                Random probability = 0.08
                InSystem
            ]
            stackinggroup = "KRILL_3_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]]
        [[GOOD_VISION]]
        [[MONSTER_SHIELD_REGENERATION]]

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

#include "monster.macros"

#include "../ship_hulls.macros"
