namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Poison Point is an ability that may poison attackers making contact with the Pokémon.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Poison_Point_(Ability)">Bulbapedia - Poison Point</see>
/// </summary>
[Script(ScriptCategory.Ability, "poison_point")]
public class PoisonPoint : Script, IScriptOnIncomingHit
{
    /// <inheritdoc />
    public void OnIncomingHit(IExecutingMove move, IPokemon target, byte hit)
    {
        if (move.GetHitData(target, hit).IsContact)
            move.User.SetStatus(ScriptUtils.ResolveName<Status.Poisoned>(), move.User);
    }
}