var Constructor = function()
{
    this.getWeatherName = function()
    {
        return qsTr("Hailstorm");
    };

    this.getDescription = function()
    {
        return qsTr("Severe hailstones that inflict direct damage on exposed units, especially aircraft, helicopters and drones. All units lose 10% of Offensive");
    };

    this.getWeatherTerrainSprite = function()
    {
        return "hailstorm";
    };

    this.getWeatherSymbol = function()
    {
        return "weather_symbol_hailstorm";
    };

    this.getOffensiveModifier = function()
    {
        return -10;
    };

    this.onStartOfTurn = function(weather, unit, map)
    {
        var uType = unit.getUnitType();
        if (uType === GameEnums.UnitType_Air || 
            uType === GameEnums.REMOTE_WEAPON || 
            uType === GameEnums.HELICOPTER || 
            uType === GameEnums.DRONE)
        {
            if (!unit.getWeatherImmune())
            {
                if (unit.getOwner() === map.getCurrentPlayer())
                {
                    unit.setHp(unit.getHp() - 1);
                    
                    if (unit.getHp() <= 0)
                    {
                        unit.killUnit();
                    }
                }
            }
        }
    };

    this.activate = function(weather, map)
    {
        var animationCount = GameAnimationFactory.getAnimationCount();
        var queueAnimation = null;
        if (animationCount > 0)
        {
            queueAnimation = GameAnimationFactory.getAnimation(animationCount - 1);
        }
        var animation = GameAnimationFactory.createAnimation(map, 0, 0);
        
        animation.addSprite2("white_pixel", 0, 0, 3200, map.getMapWidth(), map.getMapHeight());
        animation.addTweenColor(0, "#00FFFFFF", "#40DDDDFF", 3000, true);
        
        animation.setSound("hailstorm.wav"); 
        animation.setStartOfAnimationCall("ANIMATION", "preOnAnimationChangedAnimation");
        
        if (queueAnimation !== null)
        {
            queueAnimation.queueAnimation(animation);
        }
    };

    this.getDefaultWeatherChance = function()
    {
        return 0;
    };
}

Constructor.prototype = WEATHER;
var WEATHER_HAILSTORM = new Constructor();