More moves, allow for typeless moves
This commit is contained in:
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Rest.cs
Normal file
24
Plugins/PkmnLib.Plugin.Gen7/Scripts/Moves/Rest.cs
Normal file
@@ -0,0 +1,24 @@
|
||||
using PkmnLib.Plugin.Gen7.Scripts.Status;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "rest")]
|
||||
public class Rest : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnSecondaryEffect(IExecutingMove move, IPokemon target, byte hit)
|
||||
{
|
||||
if (move.User.HasStatus(ScriptUtils.ResolveName<Sleep>()))
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
if (!move.User.Heal(move.User.MaxHealth, false, forceHeal: false))
|
||||
{
|
||||
move.GetHitData(target, hit).Fail();
|
||||
return;
|
||||
}
|
||||
move.User.SetStatus(ScriptUtils.ResolveName<Sleep>());
|
||||
((Sleep)move.User.StatusScript.Script!).Turns = 2;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user