More abilities, refactor custom triggers to be typed.
All checks were successful
Build / Build (push) Successful in 48s
All checks were successful
Build / Build (push) Successful in 48s
This commit is contained in:
@@ -9,12 +9,15 @@ namespace PkmnLib.Plugin.Gen7.Scripts.Abilities;
|
||||
public class Infiltrator : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void CustomTrigger(StringKey eventName, IDictionary<StringKey, object?>? parameters)
|
||||
public override void CustomTrigger(StringKey eventName, ICustomTriggerArgs args)
|
||||
{
|
||||
if ((eventName != CustomTriggers.BypassProtection && eventName != CustomTriggers.BypassSubstitute) ||
|
||||
parameters is null)
|
||||
return;
|
||||
|
||||
parameters["bypass"] = true;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user