This commit is contained in:
62 files changed
+1180
-81
No files matched your search
@@ -0,0 +1,18 @@
|
||||
using PkmnLib.Static.Moves;
|
||||
|
||||
namespace PkmnLib.Plugin.Gen7.Scripts.Moves;
|
||||
|
||||
[Script(ScriptCategory.Move, "sucker_punch")]
|
||||
public class SuckerPunch : Script
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public override void OnBeforeHit(IExecutingMove move, IPokemon target, byte hitIndex)
|
||||
{
|
||||
var targetChoice = move.Battle.ChoiceQueue?.Where(x => x.User == target).FirstOrDefault();
|
||||
if (targetChoice is not IMoveChoice moveChoice ||
|
||||
moveChoice.ChosenMove.MoveData.Category == MoveCategory.Status)
|
||||
{
|
||||
move.GetHitData(target, hitIndex).Fail();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user