pub type MoveId = move_id;
Expand description
A move ID with associated methods to get metadata.
Use the associated constants or the Self::new
method to get instances of this.
Implementations§
source§impl MoveId
impl MoveId
This impl provides general metadata about moves in the game.
See Move
for additional metadata methods.
sourcepub const unsafe fn new(id: u32) -> Self
pub const unsafe fn new(id: u32) -> Self
Returns the ID struct for the move with the given ID.
Safety
The caller must make sure the ID is valid (refers to an existing move), otherwise this is UB.
sourcepub fn is_recoil_move(&self) -> bool
pub fn is_recoil_move(&self) -> bool
Checks if the move is a recoil move (affected by Reckless).
sourcepub fn is_punch_move(&self) -> bool
pub fn is_punch_move(&self) -> bool
Checks if the move is a punch move (affected by Iron Fist).
sourcepub fn get_category(&self) -> Option<MoveCategory>
pub fn get_category(&self) -> Option<MoveCategory>
Gets a move’s category (physical, special, status). Returns None if the category is invalid.
sourcepub fn get_faint_reason(&self, item_id: ItemId) -> faint_reason
pub fn get_faint_reason(&self, item_id: ItemId) -> faint_reason
Gets the faint reason code (see HandleFaint) for a given move-item combination.
If there’s no item, the reason code is the move ID. If the item is an orb, return FAINT_REASON_ORB_ITEM. Otherwise, return FAINT_REASON_NON_ORB_ITEM.