2025-06-28 12:02:24 +02:00

17 lines
490 B
C#

namespace PkmnLib.Plugin.Gen7.Scripts.Pokemon;
[Script(ScriptCategory.Pokemon, "flinch_effect")]
public class FlinchEffect : Script, IScriptPreventMove
{
/// <inheritdoc />
public void PreventMove(IExecutingMove move, ref bool prevent)
{
prevent = true;
var args = new CustomTriggers.OnFlinchArgs(move);
move.RunScriptHook(x => x.CustomTrigger(CustomTriggers.OnFlinch, args));
if (args.Prevent)
return;
RemoveSelf();
}
}