namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Unaware is an ability that ignores the opposing Pokémon's stat changes when attacking or defending.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Unaware_(Ability)">Bulbapedia - Unaware</see>
/// </summary>
[Script(ScriptCategory.Ability, "unaware")]
public class Unaware : Script, IScriptChangeIncomingMoveOffensiveStatValue, IScriptChangeDefensiveStatValue
{
    /// <inheritdoc />
    public void ChangeIncomingMoveOffensiveStatValue(IExecutingMove executingMove, IPokemon target, byte hitNumber,
        uint defensiveStat, StatisticSet<uint> targetStats, Statistic offensive, ref uint offensiveStat)
    {
        offensiveStat = executingMove.User.FlatStats.GetStatistic(offensive);
    }

    /// <inheritdoc />
    public void ChangeDefensiveStatValue(IExecutingMove move, IPokemon target, byte hit, uint offensiveStat,
        ImmutableStatisticSet<uint> targetStats, Statistic stat, ref uint value)
    {
        value = target.FlatStats.GetStatistic(stat);
    }
}