pub type DungeonId = dungeon_id;
Expand description
A dungeon group ID with associated methods to get metadata.
Use the associated constants or the Self::new
method to get instances of this.
Implementations§
source§impl DungeonId
impl DungeonId
This impl provides general metadata about dungeons 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 dungeon with the given ID.
Safety
The caller must make sure the ID is valid (refers to an existing dungeon), otherwise this is UB.
sourcepub fn number_floors(&self) -> i32
pub fn number_floors(&self) -> i32
Returns the number of floors of the given dungeon.
The result is hardcoded for certain dungeons, such as dojo mazes.
sourcepub fn group(&self) -> DungeonGroupId
pub fn group(&self) -> DungeonGroupId
Returns the dungeon group associated to the given dungeon.
For IDs greater or equal to DungeonId::DUNGEON_NORMAL_FLY_MAZE
,
returns DungeonGroupId::DGROUP_MAROWAK_DOJO
.
sourcepub fn number_preceding_floors(&self) -> i32
pub fn number_preceding_floors(&self) -> i32
Given a dungeon ID, returns the total amount of floors summed by all the previous dungeons in its group.
The value is normally pulled from
ffi::dungeon_data_list_entry::n_preceding_floors_group
, except for dungeons with an
ID >= DungeonId::DUNGEON_NORMAL_FLY_MAZE
, for which this function always returns 0.
sourcepub fn number_floors_in_group(&self) -> i32
pub fn number_floors_in_group(&self) -> i32
Returns the total amount of floors among all the dungeons in the dungeon group of the specified dungeon.
sourcepub fn conv_floor_to_group_floor(
&self,
dungeon_floor_number: u8
) -> (DungeonGroupId, u8)
pub fn conv_floor_to_group_floor( &self, dungeon_floor_number: u8 ) -> (DungeonGroupId, u8)
Given this dungeon ID and a floor number, returns a struct with the corresponding dungeon group and floor number in that group.
The function normally uses the data in mappa_s.bin to calculate the result, but there’s some dungeons (such as dojo mazes) that have hardcoded return values.
sourcepub fn goes_up(&self) -> bool
pub fn goes_up(&self) -> bool
Returns whether this dungeon is considered as going upward or not
sourcepub fn get_max_rescue_attempts(&self) -> i8
pub fn get_max_rescue_attempts(&self) -> i8
Returns the maximum rescue attempts allowed in this dungeon, or -1 if rescues are disabled.
sourcepub fn get_leader_change_flag(&self) -> bool
pub fn get_leader_change_flag(&self) -> bool
Returns true if the flag that allows changing leaders is set in the restrictions of this dungeon.
sourcepub fn is_special_joined_at_location(&self) -> bool
pub fn is_special_joined_at_location(&self) -> bool
Returns whether this dungeon has a joined at location between
DungeonId::DUNGEON_JOINED_AT_BIDOOF
and DungeonId::DUNGEON_DUMMY_0xE3
.
sourcepub fn is_special_joined_at_location2(&self) -> bool
pub fn is_special_joined_at_location2(&self) -> bool
Returns whether a certain joined_at field value is equal to DungeonId::DUNGEON_BEACH
or
is between DungeonId::DUNGEON_DUMMY_0xEC
and DungeonId::DUNGEON_DUMMY_0xF0
.
sourcepub fn are_treasure_box_drops_enabled(&self) -> bool
pub fn are_treasure_box_drops_enabled(&self) -> bool
Checks if enemy Treasure Box drops are enabled in the dungeon.