Deukhoofd 7c270a6d52
All checks were successful
Build / Build (push) Successful in 1m1s
Finish script interface refactor
2025-07-06 10:27:56 +02:00

23 lines
882 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
/// <summary>
/// Infiltrator is an ability that allows the Pokémon's moves to ignore the opposing side's barriers and substitutes.
///
/// <see href="https://bulbapedia.bulbagarden.net/wiki/Infiltrator_(Ability)">Bulbapedia - Infiltrator</see>
/// </summary>
[Script(ScriptCategory.Ability, "infiltrator")]
public class Infiltrator : Script, IScriptCustomTrigger
{
/// <inheritdoc />
public void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
{
if (eventName == CustomTriggers.BypassSubstitute && args is CustomTriggers.BypassSubstituteArgs bypassArgs)
{
bypassArgs.Bypass = true;
}
else if (eventName == CustomTriggers.BypassProtection && args is CustomTriggers.BypassProtectionArgs customArgs)
{
customArgs.Bypass = true;
}
}
}