Skip to content

MoveInput

namespace Griff.Modules.Fighting;
public struct MoveInput

What a fighter presses for a move, in the numpad notation fighting games write moves in: the directions as the keys of a number pad, for a fighter facing right (6 forward, 4 back, 2 down, 8 up, 3 down-forward and so on, 5 none), then the button. 5P is a punch standing, 2K a kick crouching, 236P a quarter circle forward and punch, 623P a dragon punch (forward, down, down-forward), [4]6P back held a moment (a charge) then forward and punch, and j.K a kick in the air. Directions are read the way the fighter faces, so a motion works from either side.

public bool Air { get; }

True for a move done in the air (written with j. in front): it comes out only while jumping.

public string Button { get; }

The button pressed as the motion ends, e.g. “P”: one of the fighter’s Buttons.

public int Charge { get; }

The direction held a moment first for a charge move ([4]6P holds 4), or 0 for none.

public static IReadOnlyList<ValueTuple<string, string>> Common { get; }

The names of the motions fighting games share: “236” is a quarter circle forward.

public bool IsSpecial { get; }

True for a special move: a motion of more than one direction, or a charge. What a move’s “cancels special” can cancel into.

public string Motion { get; }

The directions pressed in turn, as numpad digits (“236”): one for a normal (“5”, “2”), none for any direction.

public static char Arrow(int direction)

The arrow for a numpad direction (6 is →), or “•” for 5.

public string Arrows()

Its directions as arrows for a fighter facing right, e.g. “↓↘→ P”, “[←]→ P” or “↓ K (in the air)”.

public string Describe()

What it’s called, e.g. “quarter circle forward + P”, “dragon punch + P”, “charge back, forward + P”, “down + K”, “P in the air”.

public static string DirectionName(int direction)

A numpad direction’s name for a fighter facing right: 6 is “forward”, 1 “down-back”, 5 “neutral”.

public override bool Equals(object obj)
public bool Equals(MoveInput other)
public override int GetHashCode()
public static string? MotionName(string motion)

The name of a common motion (“236” is “quarter circle forward”), or null.

public static MoveInput Parse(string text)

Reads a move’s input, throwing for one that doesn’t make sense.

public override string ToString()

The input as it’s written, e.g. j.236K or [4]6P.

public static bool TryParse(string? text, out MoveInput input, out string? problem)

Reads a move’s input, e.g. 236P, [4]6K, j.2K or P, forgiving spaces and a + before the button (“236 + P”). False with why for one that doesn’t make sense.

public const int MaxSteps

The most directions a motion has.