Registration fixes and improvements.
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2022-09-16 11:01:37 +02:00
parent b1890681a1
commit 7bcfd92d45
20 changed files with 397 additions and 52 deletions

View File

@@ -282,6 +282,11 @@ impl Pokemon {
pub fn weight(&self) -> f32 {
self.weight.load(Ordering::Relaxed)
}
/// Sets the weight of the Pokemon in kilograms.
pub fn set_weight(&self, weight: f32) {
self.weight.store(weight, Ordering::Relaxed)
}
/// The height of the Pokemon in meters.
pub fn height(&self) -> f32 {
self.height.load(Ordering::Relaxed)
@@ -685,6 +690,11 @@ impl Pokemon {
let move_data = self.library.static_data().moves().get(move_name).unwrap();
learned_moves[move_pos.unwrap()] = Some(Arc::new(LearnedMove::new(move_data, learn_method)));
}
/// Removes the current non-volatile status from the Pokemon.
pub fn clear_status(&self) {
self.status_script.clear()
}
}
/// The data of the Pokemon related to being in a battle.
@@ -780,6 +790,8 @@ pub enum DamageSource {
MoveDamage = 0,
/// The damage is done by something else.
Misc = 1,
/// The damage is done because of struggling.
Struggle = 2,
}
#[cfg(test)]