namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Unburden is an ability that doubles the Pokémon's Speed if it loses its held item.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Unburden_(Ability)">Bulbapedia - Unburden</see>
/// </summary>
[Script(ScriptCategory.Ability, "unburden")]
public class Unburden : Script, IScriptChangeSpeed
{
    /// <inheritdoc />
    public void ChangeSpeed(ITurnChoice choice, ref uint speed)
    {
        if (choice.User.HasItemBeenRemovedForBattle)
        {
            speed = speed.MultiplyOrMax(2);
        }
    }
}