namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Huge Power is an ability that doubles the Pokémon's Attack stat.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Huge_Power_(Ability)">Bulbapedia - Huge Power</see>
/// </summary>
[Script(ScriptCategory.Ability, "huge_power")]
public class HugePower : Script, IScriptChangeOffensiveStatValue
{
    /// <inheritdoc />
    public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
        ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
    {
        if (stat == Statistic.Attack)
        {
            value = value.MultiplyOrMax(2);
        }
    }
}