Skip to main content

MoveData

Struct MoveData 

Source
pub struct MoveData {
Show 40 fields pub name: String, pub category: MoveCategory, pub primary_type: Type, pub base_power: u32, pub accuracy: Accuracy, pub pp: u8, pub priority: i8, pub target: MoveTarget, pub flags: HashSet<MoveFlag>, pub damage: Option<u16>, pub no_pp_boosts: bool, pub ohko_type: Option<OhkoType>, pub user_switch: Option<SwitchType>, pub self_destruct: Option<SelfDestructType>, pub recoil: Option<RecoilData>, pub drain_percent: Option<Fraction<u16>>, pub typeless: bool, pub force_stab: bool, pub hit_effect: Option<HitEffect>, pub user_effect: Option<HitEffect>, pub user_effect_chance: Option<Fraction<u16>>, pub secondary_effects: Vec<SecondaryEffectData>, pub override_offensive_mon: Option<MonOverride>, pub override_offensive_stat: Option<Stat>, pub override_defensive_mon: Option<MonOverride>, pub override_defensive_stat: Option<Stat>, pub crit_ratio: Option<u8>, pub ignore_accuracy: bool, pub ignore_defensive: bool, pub ignore_evasion: bool, pub ignore_offensive: bool, pub multiaccuracy: bool, pub multihit: Option<MultihitType>, pub tracks_target: bool, pub will_crit: bool, pub no_random_target: bool, pub z_move: Option<ZMoveData>, pub max_move: Option<MaxMoveData>, pub effect: Value, pub condition: Value,
}
Expand description

Data about a particular move.

Moves are the primary effect that drive battle forward. Every Mon enters a battle with their moveset. Each turn, a Mon uses one move to affect the battle. Moves can damage opposing Mons, affect ally Mons or the user itself, boost or drop stats, apply conditions to Mons or the battlefield itself, and more.

Fields§

§name: String

Name of the move.

§category: MoveCategory

Move category.

§primary_type: Type

Move type.

§base_power: u32

Base power.

§accuracy: Accuracy

Base accuracy.

§pp: u8

Total power points, which is the number of times this move can be used.

§priority: i8

Move priority.

§target: MoveTarget

Move target(s).

§flags: HashSet<MoveFlag>

Move flags.

§damage: Option<u16>

Static damage dealt.

§no_pp_boosts: bool

Disallow PP boosts?

§ohko_type: Option<OhkoType>

Type of OHKO, if any.

If a target has this type, it is immune.

§user_switch: Option<SwitchType>

Type of switch that occurs on the user.

§self_destruct: Option<SelfDestructType>

How the user self destructs.

§recoil: Option<RecoilData>

Recoil damage to apply.

§drain_percent: Option<Fraction<u16>>

The percentage of the target’s HP to drain.

§typeless: bool

Typeless?

§force_stab: bool

Force STAB?

§hit_effect: Option<HitEffect>

Primary effect applied to the target.

Applied when the move hits.

§user_effect: Option<HitEffect>

Primary effect on the user.

Applied when the move hits.

§user_effect_chance: Option<Fraction<u16>>

Chance of the user effect occurring.

§secondary_effects: Vec<SecondaryEffectData>

Secondary effects applied to the target.

§override_offensive_mon: Option<MonOverride>

Mon override for offensive stat calculations.

By default, the move user is used.

§override_offensive_stat: Option<Stat>

Stat override for offensive stat calculations.

By default, Atk is used for physical moves and SpA is used for special moves.

§override_defensive_mon: Option<MonOverride>

Mon override for defensive stat calculations.

By default, the move target is used.

§override_defensive_stat: Option<Stat>

Stat override for defensive stat calculations.

By default, Def is used for physical moves and SpD is used for special moves.

§crit_ratio: Option<u8>

Critical hit ratio.

§ignore_accuracy: bool

Ignore accuracy modifiers?

§ignore_defensive: bool

Ignore defensive modifiers?

§ignore_evasion: bool

Ignore evasion modifiers?

§ignore_offensive: bool

Ignore offensive modifiers?

§multiaccuracy: bool

Accuracy calculations should be run multiple times.

§multihit: Option<MultihitType>

The move hits multiple times.

§tracks_target: bool

Does the move track the target, even if they have moved?

§will_crit: bool

The move will always critical hit.

§no_random_target: bool

Does the move avoid random targets?

§z_move: Option<ZMoveData>

Data about how the move affects Z-Moves.

§max_move: Option<MaxMoveData>

Data about how the move affects Max Moves.

§effect: Value

Dynamic battle effects.

§condition: Value

Dynamic battle effects of the condition created by this move.

Trait Implementations§

Source§

impl Clone for MoveData

Source§

fn clone(&self) -> MoveData

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for MoveData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MoveData

Source§

fn default() -> MoveData

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for MoveData

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for MoveData

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

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<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,