#[repr(transparent)]pub struct item_id(_);
Implementations§
source§impl item_id
impl item_id
This impl provides general metadata about items in the game.
sourcepub const unsafe fn new(id: u32) -> Self
pub const unsafe fn new(id: u32) -> Self
Returns the ID struct for the item with the given ID.
Safety
The caller must make sure the ID is valid (refers to an existing item), otherwise this is UB.
sourcepub fn category(&self) -> ItemCategoryId
pub fn category(&self) -> ItemCategoryId
Returns the category ID of this item.
pub fn can_be_thrown(&self) -> bool
pub fn is_valid(&self) -> bool
pub fn fallback_if_invalid(self) -> Self
pub fn is_money(&self) -> bool
sourcepub fn is_aura_bow(&self) -> bool
pub fn is_aura_bow(&self) -> bool
Checks if the item is one of the aura bows received at the start of the game.
sourcepub fn get_exclusive_item_offset(&self) -> i32
pub fn get_exclusive_item_offset(&self) -> i32
Gets the exclusive item offset, which is the item ID relative to that of the first exclusive item, the Prism Ruff.
sourcepub fn get_dungeon_item_action(&self, _ov29: OverlayLoadLease<29>) -> Type
pub fn get_dungeon_item_action(&self, _ov29: OverlayLoadLease<29>) -> Type
Returns the action ID that corresponds to an item given its ID.
The action is based on the category of the item (see ITEM_CATEGORY_ACTIONS
), unless the
specified ID is 0x16B, in which case ACTION_UNK_35
is returned.
Some items can have unexpected actions, such as thrown items, which have ACTION_NOTHING
.
This is done to prevent duplicate actions from being listed in the menu (since items always
have a “throw” option), since a return value of ACTION_NOTHING
prevents the option from
showing up in the menu.
sourcepub fn get_exclusive_item_offset_checked_for_validity(&self) -> i32
pub fn get_exclusive_item_offset_checked_for_validity(&self) -> i32
Gets the exclusive item offset, which is the item ID relative to that of the first exclusive item, the Prism Ruff.
If the given item ID is not a valid item ID, ItemId::ITEM_PLAIN_SEED
(0x55) is returned.
This is a bug, since 0x55 is the valid exclusive item offset for the Icy Globe.
sourcepub fn get_thrown_item_quantity_minimum(&self) -> u8
pub fn get_thrown_item_quantity_minimum(&self) -> u8
Get the minimum quantity for this (thrown) item ID.
sourcepub fn get_thrown_item_quantity_maximum(&self) -> u8
pub fn get_thrown_item_quantity_maximum(&self) -> u8
Get the maximum quantity for this (thrown) item ID.
sourcepub fn apply_exclusive_item_stat_boosts(
&self,
atk_to_modify: &mut u8,
sp_atk_to_modify: &mut u8,
def_to_modify: &mut u8,
sp_def_to_modify: &mut u8
)
pub fn apply_exclusive_item_stat_boosts( &self, atk_to_modify: &mut u8, sp_atk_to_modify: &mut u8, def_to_modify: &mut u8, sp_def_to_modify: &mut u8 )
Applies stat boosts from an exclusive item.
sourcepub fn get_faint_reason(&self, move_id: MoveId) -> faint_reason
pub fn get_faint_reason(&self, move_id: MoveId) -> 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.