pub struct DungeonMonsterRef<'a>(pub &'a monster, pub &'a DungeonEntity);
Expand description

Reference type for the info struct for DungeonEntity objects that are monsters.

For methods, see the DungeonMonsterRead trait.

Tuple Fields§

§0: &'a monster§1: &'a DungeonEntity

Methods from Deref<Target = monster>§

source

pub fn f_ai_unk(&self) -> bool_

source

pub fn f_ai_skip_turn(&self) -> bool_

source

pub fn flags_unk2(&self) -> u16

source

pub fn f_swapping_places(&self) -> bool_

source

pub fn flags_unk6(&self) -> u16

source

pub fn f_walking(&self) -> bool_

source

pub fn flags_unk10(&self) -> u16

source

pub fn f_swapping_places_petrified_ally(&self) -> bool_

Trait Implementations§

source§

impl<'a> Deref for DungeonMonsterRef<'a>

§

type Target = monster

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<'a> DungeonMonsterRead for DungeonMonsterRef<'a>

source§

fn is_special_story_ally(&self) -> bool

Checks if the monster is a special story ally. This is a hard-coded check that looks at the monster’s “Joined At” field. If the value is in the range [ crate::api::dungeons::DungeonId::DUNGEON_JOINED_AT_BIDOOF, crate::api::dungeons::DungeonId::DUNGEON_DUMMY_0xE3 ], this check will return true.
source§

fn is_experience_locked(&self) -> bool

Checks if the monster does not gain experience. This basically just inverts IsSpecialStoryAlly, with the exception of also checking for the “Joined At” field being crate::api::dungeons::DungeonId::DUNGEON_CLIENT.
source§

fn is_holding_item(&self, item_id: ItemId) -> bool

Checks if the monster is holding a certain item that isn’t disabled by Klutz.
source§

fn has_low_health(&self) -> bool

Checks if the monster is at low health (below 25% rounded down).
source§

fn gastro_acid_status(&self) -> bool

Checks if the monster has the Gastro Acid status.
source§

fn is_ability_active(&self, ability_id: AbilityId) -> bool

source§

fn is_ability_active_any_entity(&self, ability_id: AbilityId) -> bool

source§

fn has_type(&self, type_id: MonsterTypeId) -> bool

Checks if the monster has a given type.
source§

fn is_iq_skill_enabled(&self, iq_skill_id: IqSkillId) -> bool

Checks if the monster has a certain IQ skill enabled.
source§

fn is_defender_ability_active( &self, defender: &DungeonEntity, defender_ability_id: AbilityId, own_ability_is_active: bool ) -> bool

Checks if a defender has an active ability that isn’t disabled by an attacker’s (self) Mold Breaker.
source§

fn is_exclusive_item_effect_active( &self, effect_id: ExclusiveItemEffectId ) -> bool

Checks if a certain exclusive item effect is active for the monster.
source§

fn get_type_matchup( &self, defender: &DungeonEntity, target_type_index: TargetTypeIndex, attack_type: MonsterTypeId ) -> Option<DungeonTypeMatchup>

Gets the type matchup for a given combat interaction. Attacker is self. Note that the actual monster’s types on the attacker and defender are not used; the entities are only used to check conditions. The actual type matchup table lookup is done solely using the attack and target type parameters. Read more
source§

fn calc_damage( &self, defender: &DungeonEntity, attack_type: MonsterTypeId, attack_power: i32, crit_chance: i32, damage_out: &mut damage_data, damage_multiplier: I24F8, move_id: MoveId, param_9: i32 )

Probably the damage calculation function. The result seems to get written to the unknown struct behind the pointer provided by damage_out, param_9 is also unknown. Read more
source§

unsafe fn calc_recoil_damage_fixed( &self, fixed_damage: i32, param_3: undefined4, damage_out: &mut damage_data, move_id: MoveId, attack_type: MonsterTypeId, param_7: i16, message_type: undefined4, param_9: undefined4, param_10: undefined4 )

Appears to calculate recoil damage to the monster. This function wraps Self::calc_damage_fixed using the monster as both the attacker and the defender, after doing some basic checks (like if the monster is already at 0 HP) and applying a boost from the Reckless ability if applicable. Some parameters are unknown. The result seems to get written to the unknown struct behind the pointer provided by damage_out, some other parameters are also unknown. Read more
source§

unsafe fn calc_damage_fixed( &self, defender: &DungeonEntity, fixed_damage: i32, param_4: undefined4, damage_out: &mut damage_data, attack_type: MonsterTypeId, move_category: MoveCategory, param_8: i16, message_type: undefined4, param_10: undefined4, param_11: undefined4 )

Appears to calculate damage from a fixed-damage effect. The result seems to get written to the unknown struct behind the pointer provided by damage_out, some other parameters are also unknown. Read more
source§

unsafe fn calc_damage_fixed_no_category( &self, defender: &DungeonEntity, fixed_damage: i32, param_4: undefined4, damage_out: &mut damage_data, attack_type: MonsterTypeId, param_7: i16, message_type: undefined4, param_9: undefined4, param_10: undefined4 )

A wrapper around Self::calc_damage_fixed with the move category set to MoveCategory::None. Read more
source§

unsafe fn calc_damage_fixed_wrapper( &self, defender: &DungeonEntity, fixed_damage: i32, param_4: undefined4, damage_out: &mut damage_data, attack_type: MonsterTypeId, move_category: MoveCategory, param_8: i16, param_9: undefined4, param_10: undefined4, param_11: undefined4 )

A wrapper (with potential side effects…?) around Self::calc_damage_fixed. Read more
source§

fn calc_damage_projectile( &self, defender: &DungeonEntity, used_move: &Move, move_power: i32, damage_multiplier: I24F8, item_id: ItemId ) -> i32

Appears to calculate damage from a variable-damage projectile. Read more
source§

fn calc_damage_final( &self, defender: &DungeonEntity, used_move: &Move, damage_out: &mut damage_data, faint_reason: faint_reason ) -> i32

Last function called by DungeonEffectsEmitter::deal_damage to determine the final damage dealt by the move. Read more
source§

fn can_target_entity(&self, target: &DungeonEntity) -> bool

Checks if a monster can target another entity when controlled by the AI. Read more
source§

fn can_target_position(&self, target: &position) -> bool

Checks if a monster can target a position. This function just calls is_position_in_sight using the position of the user as the origin.
source§

fn is_aura_bow_active(&self) -> bool

Checks if a monster is holding an aura bow that isn’t disabled by Klutz.
source§

fn get_exclusive_item_offense_boost(&self, move_category: MoveCategory) -> i32

Gets the exclusive item boost for attack/special attack for a monster. Panics if the move category is not physical or special.
source§

fn get_exclusive_item_defense_boost(&self, move_category: MoveCategory) -> i32

Gets the exclusive item boost for defense/special defense for a monster. Panics if the move category is not physical or special.
source§

fn has_conditional_ground_immunity(&self) -> bool

Checks if a monster is currently immune to Ground-type moves for reasons other than typing and ability. Read more
source§

fn get_move_target_and_range( &self, the_move: &Move, is_ai: bool ) -> MoveTargetAndRange

Gets the move target-and-range field when used by a given entity. Read more
source§

fn get_apparent_weather(&self) -> Option<Weather>

Get the weather, as experienced by the monster.
source§

fn has_held_item(&self, item_id: ItemId) -> bool

Checks if the monster has a certain held item.
source§

fn get_move_power(&self, the_move: &Move) -> i32

Gets the power of a move, factoring in Ginseng/Space Globe boosts.
source§

fn get_personality_index(&self) -> i32

Note: unverified, ported from Irdkwia’s notes
source§

fn calc_status_duration(&self, turn_range: &[u16; 2], effects: bool) -> i32

Seems to calculate the duration of a volatile status on a monster. Read more
source§

fn get_number_of_attacks(&self) -> i32

Returns the number of attacks that a monster can do in one turn (1 or 2). Read more
source§

fn is_levitating(&self) -> bool

Checks if a monster is levitating (has the effect of Levitate and Gravity is not active)
source§

fn is_type_affected_by_gravity(&self, type_id: type_id) -> bool

Checks if Gravity is active and that the given type is affected (i.e., Flying type).
source§

fn has_type_affected_by_gravity(&self, type_id: type_id) -> bool

Checks if Gravity is active and that this monster is of an affected type (i.e., Flying type).
source§

fn is_conversion2_active(&self) -> Option<Conversion2Status>

Checks if the monster is under the effect of Conversion 2 (its type was changed). Returns None if the value is invalid.
source§

fn get_move_type_if_used_by_self(&self, the_move: &Move) -> MonsterTypeId

Check the type of a move when used by a certain monster. Accounts for special cases such as Hidden Power, Weather Ball, the regular attack…
source§

fn get_sleep_animation_id(&self) -> u8

Returns the animation id to be applied to a monster that has the sleep, napping, nightmare or bide status.
source§

fn is_blinded(&self, check_held_item: bool) -> bool

Returns true if the monster has the blinded status, or if it is not the leader and is holding Y-Ray Specs.
source§

fn should_monster_run_away(&self) -> bool

Checks if a monster should run away from other monsters.
source§

unsafe fn should_monster_run_away_variation(&self, param: undefined) -> bool

Calls Self::should_monster_run_away and returns its result. It also calls another function if the result was true. Read more
source§

unsafe fn should_monster_run_away_variation_outlaw_check( &self, param: undefined ) -> bool

Calls Self::should_monster_run_away_variation. If the result is true, returns true. Otherwise, returns true only if the monster’s behavior field is equal to ffi::monster_behavior::BEHAVIOR_FLEEING_OUTLAW. Read more
source§

fn should_head_to_stairs(&self) -> bool

Checks if this monster should try to reach the stairs when controlled by the AI.
source§

fn has_status_that_prevents_acting(&self) -> bool

Returns true if the monster has any status problem that prevents it from acting.
source§

fn is_cornered(&self) -> bool

True if ths monster is cornered (it can’t move in any direction)
source§

fn can_attack_in_direction(&self, direction: Direction) -> bool

Returns whether a monster can attack in a given direction. Read more
source§

fn ai_obstruction_in_direction(&self, direction: Direction) -> Option<bool>

Returns whether the AI could not move the monster in the specified direction. Read more
source§

fn can_see_invisible_monsters(&self) -> bool

Returns whether this monster can see other invisible monsters. Read more
source§

fn has_dropeye_status(&self) -> bool

Returns whether a certain monster is under the effect of ffi::status_id::STATUS_DROPEYE.
source§

fn is_target_eligible( &self, move_ai_range: MoveTargetAndRange, target: &DungeonEntity, the_move: &Move, check_all_conditions: bool ) -> bool

Checks if a given target is eligible to be targeted by the AI with a certain move. Read more
source§

fn can_use_move(&self, the_move: &Move, extra_checks: bool) -> bool

Checks if a monster can use the given move. Will always return true for the regular attack. Will return false if the move if the flag Move::f_disabled is true, if the flag Move::f_sealed is true. Read more
source§

unsafe fn can_ai_use_move_unchecked( &self, move_index: i32, extra_checks: bool ) -> bool

Checks if an AI-controlled monster can use a move. Will return false if the any of the flags Move::f_exists, Move::f_subsequent_in_link_chain or Move::f_disabled is true. The function does not check if the flag Move::f_enabled_for_ai is set. Read more
source§

fn can_ai_use_move(&self, move_index: u8, extra_checks: bool) -> bool

Checked version of Self::can_ai_use_move_unchecked, that panics if the move index is > 3.
source§

fn status_checker_check(&self, the_move: &Move) -> bool

Determines if using a given move against its intended targets would be redundant because all of them already have the effect caused by said move. Read more
source§

fn get_monster_apparent_id(&self, current_id: MonsterSpeciesId) -> i32

Note: unverified, ported from Irdkwia’s notes
source§

unsafe fn get_monster_name(&self, output: *mut c_char)

Note: unverified, ported from Irdkwia’s notes Read more
source§

fn is_target_recruited(&self, target: &DungeonEntity) -> bool

Note: unverified, ported from Irdkwia’s notes
source§

fn is_satisfying_scenario_condition_to_spawn(&self) -> bool

Note: unverified, ported from Irdkwia’s notes
source§

fn is_in_spawn_list(&self, spawn_list: &mut undefined) -> bool

Note: unverified, ported from Irdkwia’s notes Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for DungeonMonsterRef<'a>

§

impl<'a> !Send for DungeonMonsterRef<'a>

§

impl<'a> !Sync for DungeonMonsterRef<'a>

§

impl<'a> Unpin for DungeonMonsterRef<'a>

§

impl<'a> UnwindSafe for DungeonMonsterRef<'a>

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.