Type Definition eos_rs::api::dungeons::DungeonId

source ·
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

This impl provides general metadata about dungeons in the game.

source

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.

source

pub const fn id(&self) -> u32

Returns the ID of this dungeon.

source

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.

source

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.

source

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.

source

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.

source

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.

source

pub fn goes_up(&self) -> bool

Returns whether this dungeon is considered as going upward or not

source

pub fn get_max_rescue_attempts(&self) -> i8

Returns the maximum rescue attempts allowed in this dungeon, or -1 if rescues are disabled.

source

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.

source

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.

source

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.

source

pub fn are_treasure_box_drops_enabled(&self) -> bool

Checks if enemy Treasure Box drops are enabled in the dungeon.

Trait Implementations§

source§

impl Copy for DungeonId