Hull
    name = "SH_KRAKEN_2_BODY"
    description = "SH_KRAKEN_2_BODY_DESC"
    speed = 45
    fuel = 4
    NoDefaultFuelEffect
    stealth = 5
    structure = 100
    slots = [
        Slot type = External position = (0.15, 0.60)
        Slot type = External position = (0.35, 0.80)
        Slot type = External position = (0.70, 0.20)
        Slot type = Internal position = (0.55, 0.45)
    ]
    buildcost = 1
    buildtime = 1
    Unproducible
    tags = [ "PEDIA_HULL_MONSTER_KRAKEN" ]
    location = All
    effectsgroups = [
        [[GAS_GIANT_STEALTH_BONUS]]
        [[MONSTER_MOVE_ALWAYS]]
        [[INFINITE_FUEL]]
        [[ADD_HULL_FUEL_TO_MAX_FUEL_METER]]
        [[MONSTER_SHIELD_REGENERATION]]

        EffectsGroup
            scope = Source
            activation = And [
                InSystem
                ContainedBy And [
                    Object id = Source.SystemID
                    Contains Planet type = GasGiant
                ]
                Turn low = max(60, LocalCandidate.LastTurnActiveInBattle + 1)
                //triple the chance of maturing when in a system with Krill
                Random probability = (LocalCandidate.Age*0.01 - 0.1) * 3^(Statistic If condition = And [
                    Source
                    InSystem
                    ContainedBy And [
                        Object id = Source.SystemID
                        Contains And [
                            InSystem id = Source.SystemID
                            Ship
                            Or [
                                Design name = "SM_KRILL_1"
                                Design name = "SM_KRILL_2" 
                                Design name = "SM_KRILL_3"  
                                Design name = "SM_KRILL_4"
                            ]
                        ]
                    ]
                ])
            ]
            effects = [
                CreateShip designname = "SM_KRAKEN_3" empire = Source.Owner name = Source.Name
                Destroy
                GenerateSitRepMessage   // generate sitrep message for owner. does nothing when unowned.
                    message = "EFFECT_TAME_MONSTER_MATURED"
                    label = "EFFECT_TAME_MONSTER_MATURED_LABEL"
                    icon = "icons/monsters/kraken-3.png"
                    parameters = [
                        tag = "system" data = Source.SystemID
                        tag = "predefinedshipdesign" data = "SM_KRAKEN_3"
                    ]
                    empire = Source.Owner
            ]
        
         EffectsGroup
            scope = Source
            effects = [
                SetMaxCapacity partname = "SR_TENTACLE" value = Value + (min(Source.Age*0.15, 4) * [[SHIP_WEAPON_DAMAGE_FACTOR]])
                SetCapacity partname = "SR_TENTACLE" value = Value + (min(Source.Age*0.15, 4) * [[SHIP_WEAPON_DAMAGE_FACTOR]])
            ]
        
        [[GOOD_VISION]]
    ]
    icon = ""
    graphic = "icons/monsters/kraken-2.png"

#include "monster.macros"

#include "../ship_hulls.macros"
#include "/scripting/macros/misc.macros"
