namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;

/// <summary>
/// Rock Head is an ability that prevents the Pokémon from taking recoil damage from most moves.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Rock_Head_(Ability)">Bulbapedia - Rock Head</see>
/// </summary>
[Script(ScriptCategory.Ability, "rock_head")]
public class RockHead : Script, IScriptCustomTrigger
{
    /// <inheritdoc />
    public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
    {
        if (eventName != CustomTriggers.ModifyRecoil)
            return;
        if (args is CustomTriggers.ModifyRecoilArgs recoilArgs)
        {
            recoilArgs.Prevent = true;
        }
    }
}