[][src]Function smash::app::lua_bind::ControlModule::get_command_flag_cat

pub unsafe extern "C" fn get_command_flag_cat(
    arg1: *mut BattleObjectModuleAccessor,
    arg2: c_int
) -> i32

returns the current "command flag" based on the player's current controller inputs. Command flags come in 4 different categories.

The first category is for general inputs that are done very often (aerials, attacks, walking, dashing, jumping, etc). The second category is for less common inputs. Stuff like taunts, rolls, throws (and strangely, shielding). The third category is for things like item tossing. The fourth category is reserved exclusively for command inputs for ryu/ken/terry.

When the function is called, it will poll inputs from only the specified category.

Arguments

Example

// set a boolean to true if the player inputs a forward aerial.
// because "cat"s can be represented as bitmasks, a useful way to compare them is with bitwise operations, as seen below
let mut random_bool = false;
let cat1 = ControlModule::get_command_flag_cat(module_accessor, 0);
if (cat1 & *FIGHTER_PAD_CMD_CAT1_FLAG_ATTACK_AIR_F) != 0 {
    random_bool = true;
}