using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
[Script(ScriptCategory.Move, "shell_trap")]
public class ShellTrap : Script, IScriptOnBeforeMove, IScriptFailMove
{
///
public void OnBeforeMove(IExecutingMove move)
{
move.User.Volatile.Add(new ShellTrapHelper());
}
///
public void FailMove(IExecutingMove move, ref bool fail)
{
var shellTrapHelper = move.User.Volatile.Get();
if (shellTrapHelper is not { HasHit: true })
{
fail = true;
}
}
}