Struct eos_rs::ffi::move_

source ·
#[repr(C)]
pub struct move_ { pub _bitfield_align_1: [u8; 0], pub _bitfield_1: __BindgenBitfieldUnit<[u8; 1]>, pub field_0x1: undefined, pub _bitfield_align_2: [u8; 0], pub _bitfield_2: __BindgenBitfieldUnit<[u8; 2]>, pub id: move_id_16, pub pp: u8, pub ginseng: u8, }

Fields§

§_bitfield_align_1: [u8; 0]§_bitfield_1: __BindgenBitfieldUnit<[u8; 1]>§field_0x1: undefined§_bitfield_align_2: [u8; 0]§_bitfield_2: __BindgenBitfieldUnit<[u8; 2]>§id: move_id_16§pp: u8§ginseng: u8

Implementations§

source§

impl move_

See MoveId for additional metadata methods.

source

pub unsafe fn init(move_pnt: *mut Self, move_id: MoveId)

Initializes a move info struct.

This sets f_exists and f_enabled_for_ai on the flags, the ID to the given ID, the PP to the max PP for the move ID, and the ginseng boost to 0.

Safety

The pointer must point to a valid Move or uninitialized Move.

source

pub fn id(&self) -> MoveId

Returns the move ID

source

pub fn get_target_and_range(&self, is_ai: bool) -> MoveTargetAndRange

Gets the move target-and-range field. See struct move_target_and_range in the C headers.

source

pub fn get_base_power(&self) -> i32

Gets the base power of the move.

source

pub fn get_max_pp(&self) -> i32

Gets the maximum PP for the move.

Returns max PP for the given move, capped at 99.

source

pub fn get_crit_chance(&self) -> i32

Gets the critical hit chance of the move.

source

pub fn is_move_range_string_19(&self) -> bool

Returns whether a move’s range string is 19 (“User”).

source

pub fn get_type(&self) -> MonsterTypeId

Gets the type of the move.

source

pub fn get_ai_weight(&self) -> u8

Gets the AI weight of a move.

source

pub fn get_accuracy1(&self) -> u8

Gets the accuracy1 value for the move.

source

pub fn get_accuracy2(&self) -> u8

Gets the accuracy2 value for the move.

source

pub fn get_ai_condition_random_chance(&self) -> u8

Gets the ai_condition_random_chance value for the move.

source

pub fn should_play_alternative_animation(&self, user: &DungeonEntity) -> bool

Checks whether a moved used by a monster should play its alternative animation. Includes checks for Curse, Snore, Sleep Talk, Solar Beam and 2-turn moves.

source

pub fn get_animation_id( &self, apparent_weather: Weather, should_play_alternative_animation: bool ) -> u16

Returns the move animation ID that should be played for a move. It contains a check for weather ball. After that, if the parameter should_play_alternative_animation is false, the move ID is returned.

should_play_alternative_animation can be retrieved with Self::should_play_alternative_animation.

If it’s true, there’s a bunch of manual ID checks that result on a certain hardcoded return value.

source§

impl move_

source

pub fn f_exists(&self) -> bool_

source

pub fn set_f_exists(&mut self, val: bool_)

source

pub fn f_enabled_for_ai(&self) -> bool_

source

pub fn set_f_enabled_for_ai(&mut self, val: bool_)

source

pub fn f_set(&self) -> bool_

source

pub fn set_f_set(&mut self, val: bool_)

source

pub fn f_last_used(&self) -> bool_

source

pub fn set_f_last_used(&mut self, val: bool_)

source

pub fn f_disabled(&self) -> bool_

source

pub fn set_f_disabled(&mut self, val: bool_)

source

pub fn flags0_unk6(&self) -> u8

source

pub fn set_flags0_unk6(&mut self, val: u8)

source

pub fn new_bitfield_1( f_exists: bool_, f_subsequent_in_link_chain: bool_, f_enabled_for_ai: bool_, f_set: bool_, f_last_used: bool_, f_disabled: bool_, flags0_unk6: u8 ) -> __BindgenBitfieldUnit<[u8; 1]>

source

pub fn f_sealed(&self) -> bool_

source

pub fn set_f_sealed(&mut self, val: bool_)

source

pub fn flags2_unk1(&self) -> u16

source

pub fn set_flags2_unk1(&mut self, val: u16)

source

pub fn f_consume_pp(&self) -> bool_

source

pub fn set_f_consume_pp(&mut self, val: bool_)

source

pub fn f_consume_2_pp(&self) -> bool_

source

pub fn set_f_consume_2_pp(&mut self, val: bool_)

source

pub fn flags2_unk5(&self) -> u16

source

pub fn set_flags2_unk5(&mut self, val: u16)

source

pub fn f_consume_4_pp(&self) -> bool_

source

pub fn set_f_consume_4_pp(&mut self, val: bool_)

source

pub fn flags2_unk7(&self) -> u16

source

pub fn set_flags2_unk7(&mut self, val: u16)

source

pub fn flags2_unk8(&self) -> u16

source

pub fn set_flags2_unk8(&mut self, val: u16)

source

pub fn f_exclusive_item_pp_boost(&self) -> bool_

source

pub fn set_f_exclusive_item_pp_boost(&mut self, val: bool_)

source

pub fn flags3_unk10(&self) -> u16

source

pub fn set_flags3_unk10(&mut self, val: u16)

source

pub fn new_bitfield_2( f_sealed: bool_, flags2_unk1: u16, f_consume_pp: bool_, f_consume_2_pp: bool_, flags2_unk5: u16, f_consume_4_pp: bool_, flags2_unk7: u16, flags2_unk8: u16, f_exclusive_item_pp_boost: bool_, flags3_unk10: u16 ) -> __BindgenBitfieldUnit<[u8; 2]>

Auto Trait Implementations§

§

impl RefUnwindSafe for move_

§

impl Send for move_

§

impl Sync for move_

§

impl Unpin for move_

§

impl UnwindSafe for move_

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.