using PkmnLib.Static.Moves;

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Fur Coat is an ability that halves the damage taken from physical moves.
/// This ability is exclusive to Furfrou.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Fur_Coat_(Ability)">Bulbapedia - Fur Coat</see>
/// </summary>
[Script(ScriptCategory.Ability, "fur_coat")]
public class FurCoat : Script, IScriptChangeIncomingMoveDamage
{
    /// <inheritdoc />
    public void ChangeIncomingMoveDamage(IExecutingMove move, IPokemon target, byte hit, ref uint damage)
    {
        if (move.UseMove.Category == MoveCategory.Physical)
        {
            damage /= 2;
        }
    }
}