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: StringThe 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: StringThe base species name, which excludes any forme name.
forme: Option<String>The forme name, if it exists.
class: StringThe species class, which displays on the Dex page.
color: ColorThe primary color of the species.
primary_type: TypeThe primary type of the species.
secondary_type: Option<Type>The secondary type of the species, if it exists.
abilities: Vec<String>Abilities.
Hidden ability, if it exists.
gender_ratio: u8Gender 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: u8Catch rate.
Catch rate is represented as one byte (a value between 0 and 255).
can_hatch: boolCan 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: u8The number of egg cycles required to hatch an egg of this species.
One egg cycle is equal to 255 steps.
height: u32Height in meters (m).
weight: u32Weight in kilograms (kg).
base_exp_yield: u16Base experience yield when defeating this species.
leveling_rate: LevelingRateLeveling rate of this species, which determines how much experience is required for leveling up.
ev_yield: StatTableEV (effort value) yield when defeating this species in battle.
base_friendship: u8Base 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: StatTableBase 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: boolIs 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: LearnSetLearnset, which contains all legal moves for this species.
The learnset also defines how moves are learned by the species
(crate::mons::MoveSource).
effect: ValueDynamic battle effects.
Implementations§
Source§impl SpeciesData
impl SpeciesData
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
The display name of the species with the forme name.
Sourcepub fn types(&self) -> (Type, Option<Type>)
pub fn types(&self) -> (Type, Option<Type>)
Utility method for returning the species’ two types.
Sourcepub fn female_only(&self) -> bool
pub fn female_only(&self) -> bool
Is the species female only?
Sourcepub fn unknown_gender(&self) -> bool
pub fn unknown_gender(&self) -> bool
Is the species genderless?
pub fn not_fully_evolved(&self) -> bool
Sourcepub fn gigantamax(&self) -> bool
pub fn gigantamax(&self) -> bool
Is the species a Gigantamax?
Sourcepub fn create_cosmetic_forme_data(self, forme: String) -> Self
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
impl Clone for SpeciesData
Source§fn clone(&self) -> SpeciesData
fn clone(&self) -> SpeciesData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more