FieldType
    name = "FLD_METEOR_BLIZZARD"
    description = "FLD_METEOR_BLIZZARD_DESC"
    stealth = 0.01
    tags = [ "EXOTIC" ]
    effectsgroups = [
        EffectsGroup    // move around
            scope = Source
            effects = [
                SetSpeed value = 5
                MoveTowards speed = Source.Speed/2.8 x = UniverseCentreX y = UniverseCentreY
                MoveInOrbit speed = Source.Speed/1.4 x = UniverseCentreX y = UniverseCentreY
            ]

        EffectsGroup    // grow size when young
            scope = Source
            activation = And [
                (Source.Age <= max((UniverseWidth ^ 1.1) / 50, 20))
                Size high = 50
            ]
            effects = SetSize value = Value + min(max(Value * RandomNumber(0.05, 0.1), 1.0), 3.0)

        EffectsGroup    // shrink size when old
            scope = Source
            activation = (Source.Age >= max((UniverseWidth ^ 1.1) / 50, 20))
            effects = SetSize value = Value - min(max(Value * RandomNumber(0.05, 0.1), 1.0), 3.0)

        EffectsGroup    // grant research
            scope = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
                Not Monster
            ]
            stackinggroup = "METEOR_BLIZZARD_SHIP_EFFECTS"
            effects = SetTargetResearch value = Value + 2 / (1 + Statistic Count condition = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
                Not Monster
            ])^0.5

        EffectsGroup    // shrink when ships are in...
            scope = Source
            activation = Number low = 1 condition = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
                Not Monster
            ]
            effects = SetSize value = Value - Statistic Count condition = And [
                Ship
                WithinDistance distance = Source.Size * 0.9 condition = Source
                Not Monster
            ]

        EffectsGroup    // after reaching a certain age, dissipate when small
            scope = Source
            activation = And [
                (Source.Age >= 10)
                Size high = 10
            ]
            effects = Destroy

    ]
    graphic = "fields/meteor_blizzard.png"
