More move scripts
This commit is contained in:
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ShellTrap.cs
Normal file
23
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/ShellTrap.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Pokemon;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "shell_trap")]
|
||||
public class ShellTrap : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeMove(IExecutingMove move)
|
||||
{
|
||||
move.User.Volatile.Add(new ShellTrapHelper());
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override void FailMove(IExecutingMove move, ref bool fail)
|
||||
{
|
||||
var shellTrapHelper = move.User.Volatile.Get<ShellTrapHelper>();
|
||||
if (shellTrapHelper is not { HasHit: true })
|
||||
{
|
||||
fail = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user