namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Guts is an ability that boosts the Attack stat if the Pokémon has a status condition.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Guts_(Ability)">Bulbapedia - Guts</see>
/// </summary>
[Script(ScriptCategory.Ability, "guts")]
public class Guts : Script, IScriptChangeOffensiveStatValue
{
    /// <inheritdoc />
    public void ChangeOffensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint defensiveStat,
        ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
    {
        if (target.StatusScript.IsEmpty)
            return;

        if (stat != Statistic.Attack)
            return;

        value = value.MultiplyOrMax(1.5f);
    }
}