Struct eos_rs::api::dungeon_mode::Dungeon
source · pub struct Dungeon<T: AsRef<dungeon> + AsMut<dungeon>>(_);
Expand description
The Rust-safe wrapped master struct that contains the state of the dungeon.
Can be owned or mutably borrowed from a low-level ffi::dungeon
.
To get a reference to the global dungeon struct, use GlobalDungeonData::get
and then
GlobalDungeonData::inner
.
To access the raw struct, use Self::inner
.
Implementations§
source§impl Dungeon<dungeon>
impl Dungeon<dungeon>
Dungeon structs.
To get a reference to the global dungeon struct instead, use GlobalDungeonData::get
and then GlobalDungeonData::inner
.
sourcepub fn new() -> Self
pub fn new() -> Self
Create a new empty dungeon struct. Note that this struct is mostly zeroed and since we don’t know all the field values, it could be (=probably is) invalid.
sourcepub fn from_owned(dungeon: dungeon) -> Self
pub fn from_owned(dungeon: dungeon) -> Self
Create a new wrapper for an owned dungeon state.
source§impl<T: AsRef<dungeon> + AsMut<dungeon>> Dungeon<T>
impl<T: AsRef<dungeon> + AsMut<dungeon>> Dungeon<T>
Manipulate the dungeon.
sourcepub fn group_id(&self) -> DungeonGroupId
pub fn group_id(&self) -> DungeonGroupId
Dungeon group ID.
sourcepub fn set_group_id(&mut self, id: DungeonGroupId)
pub fn set_group_id(&mut self, id: DungeonGroupId)
Set Dungeon group ID.
sourcepub fn rescue_floor(&self) -> u8
pub fn rescue_floor(&self) -> u8
Rescue floor number.
sourcepub fn set_rescue_floor(&mut self, rescue_floor: u8)
pub fn set_rescue_floor(&mut self, rescue_floor: u8)
Set Rescue floor number.
sourcepub fn is_iq_disabled(&self) -> bool
pub fn is_iq_disabled(&self) -> bool
Whether or not IQ is disabled.
sourcepub fn set_iq_disabled(&mut self, value: bool)
pub fn set_iq_disabled(&mut self, value: bool)
Set whether or not IQ is disabled.
sourcepub fn is_recruiting_enabled(&self) -> bool
pub fn is_recruiting_enabled(&self) -> bool
Whether or not recruiting is enabled.
sourcepub fn set_recruiting_enabled(&mut self, value: bool)
pub fn set_recruiting_enabled(&mut self, value: bool)
Set whether or not recruiting is enabled.
sourcepub fn is_story_mission(&self) -> bool
pub fn is_story_mission(&self) -> bool
Whether or not the current mission is a story mission.
If not, allows leader changing and continuing without the partner
sourcepub fn set_story_mission(&mut self, value: bool)
pub fn set_story_mission(&mut self, value: bool)
Set whether or not the current mission is a story mission.
If not, allows leader changing and continuing without the partner
sourcepub fn is_send_home_disabled(&self) -> bool
pub fn is_send_home_disabled(&self) -> bool
Whether or not sending home is disabled.
sourcepub fn set_send_home_disabled(&mut self, value: bool)
pub fn set_send_home_disabled(&mut self, value: bool)
Set whether or not sending home is disabled.
Hidden Land flag.
Disables sending home/leader changing, lose if partner faints. Set for dungeons between DUNGEON_HIDDEN_LAND and DUNGEON_TEMPORAL_PINNACLE.
Set whether or not sending home is disabled.
Disables sending home/leader changing, lose if partner faints. Set for dungeons between DUNGEON_HIDDEN_LAND and DUNGEON_TEMPORAL_PINNACLE.
sourcepub fn get_mission_destination(&self) -> &mission_destination_info
pub fn get_mission_destination(&self) -> &mission_destination_info
Info about the next mission destination floor, if applicable
sourcepub fn get_mission_destination_mut(&mut self) -> &mut mission_destination_info
pub fn get_mission_destination_mut(&mut self) -> &mut mission_destination_info
Info about the next mission destination floor, if applicable
sourcepub fn get_fractional_turn(&self) -> u16
pub fn get_fractional_turn(&self) -> u16
Gets the fractional turn speed.
Controls when a monster at a certain speed stage is able to act.
At normal speed, this will tick up by 4 each turn (can act when x % 4 == 3) At +1 speed, ticks up by 2 each turn (can act when x % 2 == 1) At +2 speed, ticks up by 1 or 2 each turn (can act when x % 4 != 0) At +3 speed, ticks up by 1 each turn (an act every tick)
sourcepub fn set_fractional_turn(&mut self, value: u16)
pub fn set_fractional_turn(&mut self, value: u16)
Sets the fractional turn speed.
Controls when a monster at a certain speed stage is able to act.
At normal speed, this will tick up by 4 each turn (can act when x % 4 == 3) At +1 speed, ticks up by 2 each turn (can act when x % 2 == 1) At +2 speed, ticks up by 1 or 2 each turn (can act when x % 4 != 0) At +3 speed, ticks up by 1 each turn (an act every tick)
sourcepub fn get_enemy_spawn_counter(&self) -> u16
pub fn get_enemy_spawn_counter(&self) -> u16
Enemy spawn counter.
Counts from 0-35, spawns happen at 0.
sourcepub fn set_enemy_spawn_counter(&mut self, value: u16)
pub fn set_enemy_spawn_counter(&mut self, value: u16)
Sets the enemy spawn counter.
Counts from 0-35, spawns happen at 0.
sourcepub fn get_wind_turns(&self) -> i16
pub fn get_wind_turns(&self) -> i16
Countdown to the wind blowing you out of the dungeon.
sourcepub fn set_wind_turns(&mut self, value: i16)
pub fn set_wind_turns(&mut self, value: i16)
Sets the wind countdown.
sourcepub fn get_enemy_density(&self) -> u16
pub fn get_enemy_density(&self) -> u16
Enemy density. 0, prevents the enemy_spawn_counter for increasing
sourcepub fn set_enemy_density(&mut self, value: u16)
pub fn set_enemy_density(&mut self, value: u16)
Sets the enemy density. 0, prevents the enemy_spawn_counter for increasing
sourcepub fn is_thief_alert(&self) -> bool
pub fn is_thief_alert(&self) -> bool
If you’ve stolen from Kecleon (actual dungeon state)
sourcepub fn set_thief_alert(&mut self, value: bool)
pub fn set_thief_alert(&mut self, value: bool)
Sets the thief alert state.
sourcepub fn is_thief_alert_event(&self) -> bool
pub fn is_thief_alert_event(&self) -> bool
If you’ve stolen from Kecleon (triggers music and other events?)
sourcepub fn set_thief_alert_event(&mut self, value: bool)
pub fn set_thief_alert_event(&mut self, value: bool)
Sets the thief alert event state.
sourcepub fn is_monster_house_triggered(&self) -> bool
pub fn is_monster_house_triggered(&self) -> bool
You Entered a Monster House (actual dungeon state)
sourcepub fn set_monster_house_triggered(&mut self, value: bool)
pub fn set_monster_house_triggered(&mut self, value: bool)
Sets the monster house triggered state.
sourcepub fn is_monster_house_triggered_event(&self) -> bool
pub fn is_monster_house_triggered_event(&self) -> bool
You Entered a Monster House (triggers music and other events?)
sourcepub fn set_monster_house_triggered_event(&mut self, value: bool)
pub fn set_monster_house_triggered_event(&mut self, value: bool)
Sets the monster house triggered event state.
sourcepub fn get_dungeon_objective(&self) -> Option<DungeonObjective>
pub fn get_dungeon_objective(&self) -> Option<DungeonObjective>
Objective of the current dungeon. Returns None if the objective is invalid.
sourcepub fn set_dungeon_objective(&mut self, objective: DungeonObjective)
pub fn set_dungeon_objective(&mut self, objective: DungeonObjective)
Set objective of the current dungeon
sourcepub fn get_rescue_attempts_left(&self) -> i8
pub fn get_rescue_attempts_left(&self) -> i8
Gets the number of times the player can still be rescued in this dungeon.
sourcepub fn set_rescue_attempts_left(&mut self, value: i8)
pub fn set_rescue_attempts_left(&mut self, value: i8)
Sets the number of times the player can still be rescued in this dungeon.
sourcepub fn get_dungeon_generation_info(&self) -> &dungeon_generation_info
pub fn get_dungeon_generation_info(&self) -> &dungeon_generation_info
Dungeon generation info.
sourcepub fn get_dungeon_generation_info_mut(
&mut self
) -> &mut dungeon_generation_info
pub fn get_dungeon_generation_info_mut( &mut self ) -> &mut dungeon_generation_info
Dungeon generation info.
sourcepub fn get_weather(&self) -> Option<Weather>
pub fn get_weather(&self) -> Option<Weather>
Get the current weather. Returns None if the weather is invalid.
sourcepub fn set_weather(&mut self, weather: Weather)
pub fn set_weather(&mut self, weather: Weather)
Sets the current weather
sourcepub fn get_natural_weather(&self) -> Option<Weather>
pub fn get_natural_weather(&self) -> Option<Weather>
Get the natural weather of this floor. Returns None if the weather is invalid.
sourcepub fn set_natural_weather(&mut self, weather: Weather)
pub fn set_natural_weather(&mut self, weather: Weather)
sets the natural weather of this floor.
sourcepub fn get_weather_turns(&self) -> &[u16; 8]
pub fn get_weather_turns(&self) -> &[u16; 8]
Turns left for each weather type in enum weather_id (except Weather::Random
). If
multiple of these are nonzero, the one with the highest number of turns left is chosen.
Ties are broken in enum order
sourcepub fn get_weather_turns_mut(&mut self) -> &mut [u16; 8]
pub fn get_weather_turns_mut(&mut self) -> &mut [u16; 8]
Turns left for each weather type in enum weather_id (except Weather::Random
). If
multiple of these are nonzero, the one with the highest number of turns left is chosen.
Ties are broken in enum order
sourcepub fn get_artificial_permaweather_turns(&self) -> &[u16; 8]
pub fn get_artificial_permaweather_turns(&self) -> &[u16; 8]
Turns left for artificial permaweather from weather-setting abilities like Drought, Sand Stream, Drizzle, and Snow Warning; one counter for each weather type in enum weather_id (except WEATHER_RANDOM). Any nonzero value triggers that weather condition (it’s usually set to 1 or 0). If the weather’s source is removed, this value becomes the normal number of turns left for that weather condition. Priority in the event of multiple nonzero counters is the same as with weather_turns.
sourcepub fn set_artificial_permaweather_turns(&mut self) -> &mut [u16; 8]
pub fn set_artificial_permaweather_turns(&mut self) -> &mut [u16; 8]
Turns left for artificial permaweather from weather-setting abilities like Drought, Sand Stream, Drizzle, and Snow Warning; one counter for each weather type in enum weather_id (except WEATHER_RANDOM). Any nonzero value triggers that weather condition (it’s usually set to 1 or 0). If the weather’s source is removed, this value becomes the normal number of turns left for that weather condition. Priority in the event of multiple nonzero counters is the same as with weather_turns.
sourcepub fn get_weather_damage_counter(&self) -> u8
pub fn get_weather_damage_counter(&self) -> u8
For damaging weather conditions like sandstorm. Counts down from 9-0, damage on 9.
sourcepub fn set_weather_damage_counter(&mut self, counter: u8)
pub fn set_weather_damage_counter(&mut self, counter: u8)
Sets the weather damage counter.
sourcepub fn get_mud_sport_turns(&self) -> u8
pub fn get_mud_sport_turns(&self) -> u8
Number of turns left for the Mud Sport condition.
sourcepub fn set_mud_sport_turns(&mut self, counter: u8)
pub fn set_mud_sport_turns(&mut self, counter: u8)
Sets the number of turns left for the Mud Sport condition.
sourcepub fn get_water_sport_turns(&self) -> u8
pub fn get_water_sport_turns(&self) -> u8
Number of turns left for the Water Sport condition.
sourcepub fn set_water_sport_turns(&mut self, counter: u8)
pub fn set_water_sport_turns(&mut self, counter: u8)
Sets the number of turns left for the Water Sport condition.
sourcepub fn is_weather_nullified(&self) -> bool
pub fn is_weather_nullified(&self) -> bool
Whether or not current weather is nullified by Cloud Nine or Air Lock.
sourcepub fn set_weather_nullified(&mut self, nullified: bool)
pub fn set_weather_nullified(&mut self, nullified: bool)
Sets whether or not current weather is nullified by Cloud Nine or Air Lock.
sourcepub fn is_gravity_in_effect(&self) -> bool
pub fn is_gravity_in_effect(&self) -> bool
Whether or not Gravity is in effect.
sourcepub fn set_gravity_in_effect(&mut self, gravity: bool)
pub fn set_gravity_in_effect(&mut self, gravity: bool)
Sets whether or not Gravity is in effect.
sourcepub fn get_current_active_entity(&self) -> Option<&DungeonEntity>
pub fn get_current_active_entity(&self) -> Option<&DungeonEntity>
Entity that is taking its turn at this moment.
sourcepub fn get_current_active_entity_mut(&self) -> Option<&mut DungeonEntity>
pub fn get_current_active_entity_mut(&self) -> Option<&mut DungeonEntity>
Entity that is taking its turn at this moment.
sourcepub fn get_new_leader(&self) -> Option<&DungeonEntity>
pub fn get_new_leader(&self) -> Option<&DungeonEntity>
Monster that will become the leader of the team after changing leaders.
sourcepub fn get_new_leader_mut(&self) -> Option<&mut DungeonEntity>
pub fn get_new_leader_mut(&self) -> Option<&mut DungeonEntity>
Monster that will become the leader of the team after changing leaders.
sourcepub fn get_end_floor_flag(&self) -> bool
pub fn get_end_floor_flag(&self) -> bool
Get whether the floor will be advanced at the end of the turn (unless the leader fainted).
sourcepub fn set_end_floor_flag(&mut self, flag: bool)
pub fn set_end_floor_flag(&mut self, flag: bool)
Set whether the floor will be advanced at the end of the turn (unless the leader fainted).
sourcepub fn get_end_floor_flag_force(&self) -> bool
pub fn get_end_floor_flag_force(&self) -> bool
Get whether the floor will be advanced at the end of the turn (even if the leader fainted).
sourcepub fn set_end_floor_flag_force(&mut self, flag: bool)
pub fn set_end_floor_flag_force(&mut self, flag: bool)
Set whether the floor will be advanced at the end of the turn (even if the leader fainted).
sourcepub fn get_leader_action_flag(&self) -> bool
pub fn get_leader_action_flag(&self) -> bool
False if the leader isn’t doing anything right now. True if it’s currently performing an action (such as walking or attacking)
sourcepub fn get_entities(&self) -> EntityTableRef<'_>
pub fn get_entities(&self) -> EntityTableRef<'_>
Gets the table of all entities.
sourcepub fn get_entities_mut(&mut self) -> EntityTableMut<'_>
pub fn get_entities_mut(&mut self) -> EntityTableMut<'_>
Gets the table of all entities, mutably.
sourcepub fn get_tiles(&self) -> DungeonTileGridRef<'_, 56, 32>
pub fn get_tiles(&self) -> DungeonTileGridRef<'_, 56, 32>
Gets the tile grid.
sourcepub fn get_tiles_mut(&mut self) -> DungeonTileGridMut<'_, 56, 32>
pub fn get_tiles_mut(&mut self) -> DungeonTileGridMut<'_, 56, 32>
Gets the tile grid, mutably.
sourcepub fn get_floor_properties(&self) -> &floor_properties
pub fn get_floor_properties(&self) -> &floor_properties
Dungeon floor properties.
sourcepub fn get_floor_properties_mut(&mut self) -> &mut floor_properties
pub fn get_floor_properties_mut(&mut self) -> &mut floor_properties
Dungeon floor properties.
sourcepub fn get_color_table(&self) -> &[rgb; 256]
pub fn get_color_table(&self) -> &[rgb; 256]
Color table. Used to apply a tint to the colors shown on screen. Changes depending on the current weather.
sourcepub fn get_color_table_mut(&mut self) -> &mut [rgb; 256]
pub fn get_color_table_mut(&mut self) -> &mut [rgb; 256]
Color table, mutably. Used to apply a tint to the colors shown on screen. Changes depending on the current weather.
sourcepub fn get_floor_loop_status(&self) -> Option<FloorLoopStatus>
pub fn get_floor_loop_status(&self) -> Option<FloorLoopStatus>
Whether the current floor should continue or end and why. Returns None for invalid values.
sourcepub fn set_floor_loop_status(&mut self, loop_status: FloorLoopStatus)
pub fn set_floor_loop_status(&mut self, loop_status: FloorLoopStatus)
Whether the current floor should continue or end and why.
sourcepub fn is_skip_faint_animation_flag_set(&self) -> bool
pub fn is_skip_faint_animation_flag_set(&self) -> bool
If true, the message log won’t be shown and the yellow beam animation won’t appear over team members after the leader faints
sourcepub fn set_skip_faint_animation_flag(&mut self, flag: bool)
pub fn set_skip_faint_animation_flag(&mut self, flag: bool)
If true, the message log won’t be shown and the yellow beam animation won’t appear over team members after the leader faints
sourcepub fn is_leader_running(&self) -> bool
pub fn is_leader_running(&self) -> bool
True if the leader is running. Causes the leader’s action for the next turn
to be set to ffi::action::ACTION_WALK
until it hits an obstacle.
sourcepub fn set_leader_running(&mut self, running: bool)
pub fn set_leader_running(&mut self, running: bool)
True if the leader is running. Causes the leader’s action for the next turn
to be set to ffi::action::ACTION_WALK
until it hits an obstacle.
sourcepub fn get_spawn_entries(&self) -> &[monster_spawn_entry; 16]
pub fn get_spawn_entries(&self) -> &[monster_spawn_entry; 16]
List of spawn entries for this floor.
sourcepub fn get_spawn_entries_mut(&mut self) -> &mut [monster_spawn_entry; 16]
pub fn get_spawn_entries_mut(&mut self) -> &mut [monster_spawn_entry; 16]
List of spawn entries for this floor, mutably.
sourcepub fn get_spawn_table_entries_chosen(&self) -> &[u16; 16]
pub fn get_spawn_table_entries_chosen(&self) -> &[u16; 16]
List of the indices in the complete monster spawn table for this floor that were spawned in this floor.
sourcepub fn get_spawn_table_entries_chosen_mut(&mut self) -> &mut [u16; 16]
pub fn get_spawn_table_entries_chosen_mut(&mut self) -> &mut [u16; 16]
List of the indices in the complete monster spawn table for this floor that were spawned in this floor.
sourcepub fn get_highest_enemy_level(&self) -> u16
pub fn get_highest_enemy_level(&self) -> u16
Highest level among all the enemies that spawn on this floor
sourcepub fn set_highest_enemy_level(&mut self, level: u16)
pub fn set_highest_enemy_level(&mut self, level: u16)
Highest level among all the enemies that spawn on this floor