pub struct ScriptPokemon<ID: Clone>(_, pub BattlePokemon);
Tuple Fields§
§1: BattlePokemon
Implementations§
Source§impl<ID: Clone> ScriptPokemon<ID>
impl<ID: Clone> ScriptPokemon<ID>
pub fn new(pokemon: Indexed<ID, &BattlePokemon>) -> Self
pub fn throw_move<R: Rng + Clone + 'static>( &mut self, random: ScriptRandom<R>, m: ScriptMove, ) -> bool
pub fn get_damage<R: Rng + Clone + 'static>( &mut self, random: ScriptRandom<R>, target: Self, power: INT, category: MoveCategory, move_type: PokemonType, crit_rate: INT, ) -> ScriptDamage
pub fn hp(&mut self) -> INT
Methods from Deref<Target = BattlePokemon>§
pub fn battle_exp_from(&self, type_: &BattleType) -> Experience
pub fn stat(&self, stat: StatType) -> BaseStat
pub fn damage_kind( &self, random: &mut impl Rng, target: &Self, kind: DamageKind, category: MoveCategory, move_type: PokemonType, crit_rate: CriticalRate, ) -> DamageResult<Health>
pub fn move_power_damage_random( &self, random: &mut impl Rng, target: &Self, power: Power, category: MoveCategory, move_type: PokemonType, crit: bool, ) -> DamageResult<Health>
pub fn move_power_damage( &self, target: &Self, power: Power, category: MoveCategory, move_type: PokemonType, crit: bool, range: u8, ) -> DamageResult<Health>
Methods from Deref<Target = OwnedPokemon>§
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Get the name of this pokemon. Returns the nickname or the pokemon’s name.
pub fn should_evolve(&self) -> Option<&u16>
Sourcepub fn exp_from(&self) -> u32
pub fn exp_from(&self) -> u32
Get the Experience from this pokemon at its current Level.
Sourcepub fn moves_at_level(&self) -> impl DoubleEndedIterator
pub fn moves_at_level(&self) -> impl DoubleEndedIterator
Get this pokemon’s moves at its current Level.
Sourcepub fn percent_hp(&self) -> f32
pub fn percent_hp(&self) -> f32
Get the current Health of this pokemon as a percentage.
Sourcepub fn heal_hp(&mut self, amount: Option<u16>)
pub fn heal_hp(&mut self, amount: Option<u16>)
Heal this pokemon with an optional amount of Health.
Sourcepub fn add_exp<'s>(
&'s mut self,
movedex: &Dex<Move>,
experience: u32,
) -> impl DoubleEndedIterator + 's
pub fn add_exp<'s>( &'s mut self, movedex: &Dex<Move>, experience: u32, ) -> impl DoubleEndedIterator + 's
Add Experience to this pokemon, and also handle level ups.
Sourcepub fn on_level_up(
&mut self,
movedex: &Dex<Move>,
previous: u8,
) -> impl DoubleEndedIterator
pub fn on_level_up( &mut self, movedex: &Dex<Move>, previous: u8, ) -> impl DoubleEndedIterator
Handle leveling up.
Trait Implementations§
Source§impl<ID: Clone + Clone> Clone for ScriptPokemon<ID>
impl<ID: Clone + Clone> Clone for ScriptPokemon<ID>
Source§fn clone(&self) -> ScriptPokemon<ID>
fn clone(&self) -> ScriptPokemon<ID>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<ID: Clone> Deref for ScriptPokemon<ID>
impl<ID: Clone> Deref for ScriptPokemon<ID>
Source§impl<ID: Clone> Into<PokemonIdentifier<ID>> for ScriptPokemon<ID>
impl<ID: Clone> Into<PokemonIdentifier<ID>> for ScriptPokemon<ID>
Source§fn into(self) -> PokemonIdentifier<ID>
fn into(self) -> PokemonIdentifier<ID>
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl<ID> Freeze for ScriptPokemon<ID>where
ID: Freeze,
impl<ID> RefUnwindSafe for ScriptPokemon<ID>where
ID: RefUnwindSafe,
impl<ID> Send for ScriptPokemon<ID>where
ID: Send,
impl<ID> Sync for ScriptPokemon<ID>where
ID: Sync,
impl<ID> Unpin for ScriptPokemon<ID>where
ID: Unpin,
impl<ID> UnwindSafe for ScriptPokemon<ID>where
ID: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more