Skip to main content

SpeciesData

Struct SpeciesData 

Source
pub struct SpeciesData {
Show 37 fields pub name: String, pub base_species: String, pub forme: Option<String>, pub class: String, pub color: Color, pub primary_type: Type, pub secondary_type: Option<Type>, pub abilities: Vec<String>, pub hidden_ability: Option<String>, pub gender_ratio: u8, pub catch_rate: u8, pub can_hatch: bool, pub egg_groups: HashSet<String>, pub hatch_time: u8, pub height: u32, pub weight: u32, pub base_exp_yield: u16, pub leveling_rate: LevelingRate, pub ev_yield: StatTable, pub base_friendship: u8, pub max_hp: Option<u16>, pub base_stats: StatTable, pub prevo: Option<String>, pub evos: Vec<String>, pub evolution_data: Option<EvolutionData>, pub base_forme: Option<String>, pub formes: HashSet<String>, pub cosmetic_formes: HashSet<String>, pub battle_only_forme: bool, pub required_moves: HashSet<String>, pub required_items: HashSet<String>, pub changes_from: Option<String>, pub gigantamax_move: Option<String>, pub flags: HashSet<SpeciesFlag>, pub events: HashMap<String, EventData>, pub learnset: LearnSet, pub effect: Value,
}
Expand description

Data about a particular species.

Species data is common to all Mons of a given species. Data about a specific Mon (such as its nature, stats, or battle-specific conditions) does not belong here.

Fields§

§name: String

The name of the species plus any forme name.

Should be equal to base_species + forme.

The species name should be unique across all species and formes.

§base_species: String

The base species name, which excludes any forme name.

§forme: Option<String>

The forme name, if it exists.

§class: String

The species class, which displays on the Dex page.

§color: Color

The primary color of the species.

§primary_type: Type

The primary type of the species.

§secondary_type: Option<Type>

The secondary type of the species, if it exists.

§abilities: Vec<String>

Abilities.

§hidden_ability: Option<String>

Hidden ability, if it exists.

§gender_ratio: u8

Gender ratio.

Gender ratio is represented as one byte (a value between 0 and 255). There are three special values:

  • 0 = male only
  • 254 = female only
  • 255 = gender unknown

Otherwise, the gender ratio is compared to a random number between 1 and 252 (inclusive). If the random number is less than gender_ratio, the Mon will be female.

§catch_rate: u8

Catch rate.

Catch rate is represented as one byte (a value between 0 and 255).

§can_hatch: bool

Can the species be hatched from an egg?

§egg_groups: HashSet<String>

Egg groups the species belongs to, which indicates which species can be bred together.

§hatch_time: u8

The number of egg cycles required to hatch an egg of this species.

One egg cycle is equal to 255 steps.

§height: u32

Height in meters (m).

§weight: u32

Weight in kilograms (kg).

§base_exp_yield: u16

Base experience yield when defeating this species.

§leveling_rate: LevelingRate

Leveling rate of this species, which determines how much experience is required for leveling up.

§ev_yield: StatTable

EV (effort value) yield when defeating this species in battle.

§base_friendship: u8

Base friendship.

Base friendship is represented as one byte (a value between 0 and 255).

§max_hp: Option<u16>

Maximum HP override.

This is used for Shedinja, which always has a maximum HP of 1.

§base_stats: StatTable

Base stats.

§prevo: Option<String>

Pre-evolution, if it exists.

§evos: Vec<String>

Evolutions.

§evolution_data: Option<EvolutionData>

Evolution data, which gives information on how the species’ pre-evolution evolves into this species.

§base_forme: Option<String>

The name of the base forme of this species, if it exists.

For example, Giratina’s base forme is “Altered”.

§formes: HashSet<String>

Formes, which have distinct species data.

§cosmetic_formes: HashSet<String>

Cosmetic formes, which have no impact on species data.

§battle_only_forme: bool

Is this forme available only in battles?

§required_moves: HashSet<String>

Moves required for transforming into this forme. At least one move must be known.

§required_items: HashSet<String>

Items required for transforming into this forme. At least one item must be held.

§changes_from: Option<String>

The species and forme name this forme transforms from.

§gigantamax_move: Option<String>

The Gigantamax move, if any.

§flags: HashSet<SpeciesFlag>

Flags.

§events: HashMap<String, EventData>

Event giveaways for this species.

§learnset: LearnSet

Learnset, which contains all legal moves for this species.

The learnset also defines how moves are learned by the species (crate::mons::MoveSource).

§effect: Value

Dynamic battle effects.

Implementations§

Source§

impl SpeciesData

Source

pub fn display_name(&self) -> String

The display name of the species with the forme name.

Source

pub fn types(&self) -> (Type, Option<Type>)

Utility method for returning the species’ two types.

Source

pub fn bst(&self) -> u32

The base state total (BST) of the species.

Source

pub fn male_only(&self) -> bool

Is the species male only?

Source

pub fn female_only(&self) -> bool

Is the species female only?

Source

pub fn unknown_gender(&self) -> bool

Is the species genderless?

Source

pub fn not_fully_evolved(&self) -> bool

Source

pub fn mega(&self) -> bool

Is the species a Mega Evolution?

Source

pub fn gigantamax(&self) -> bool

Is the species a Gigantamax?

Source

pub fn create_cosmetic_forme_data(self, forme: String) -> Self

Creates cosmetic forme data by moving and modifying this instance of SpeciesData.

Trait Implementations§

Source§

impl Clone for SpeciesData

Source§

fn clone(&self) -> SpeciesData

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 SpeciesData

Source§

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

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

impl<'de> Deserialize<'de> for SpeciesData

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 SpeciesData

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>,