Style and Clippy fixes.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2022-10-14 16:53:30 +02:00
parent 9efe1b4e22
commit 691bf7c12e
56 changed files with 354 additions and 249 deletions

View File

@@ -457,7 +457,8 @@ impl Pokemon {
.calculate_flat_stats(self, &self.flat_stats);
self.recalculate_boosted_stats();
}
/// Calculates the boosted stats on the Pokemon. This should be called when a stat boost changes.
/// Calculates the boosted stats on the Pokemon, _without_ recalculating the flat stats.
/// This should be called when a stat boost changes.
pub fn recalculate_boosted_stats(&self) {
self.library
.stat_calculator()
@@ -516,7 +517,7 @@ impl Pokemon {
let ability_script = self
.library
.load_script((&*self).into(), ScriptCategory::Ability, self.active_ability().name())
.load_script(self.into(), ScriptCategory::Ability, self.active_ability().name())
.unwrap();
if let Some(ability_script) = ability_script {
self.ability_script
@@ -614,7 +615,7 @@ impl Pokemon {
}
}
/// Damages the Pokemon by a certain amount of damage, from a specific damage source.
/// Damages the Pokemon by a certain amount of damage, from a damage source.
pub fn damage(&self, mut damage: u32, source: DamageSource) {
if damage > self.current_health() {
damage = self.current_health();
@@ -820,7 +821,7 @@ pub mod test {
fn construct_pokemon() {
let lib = Arc::new(crate::dynamic_data::libraries::dynamic_library::test::build());
let species = lib.static_data().species().get(&"foo".into()).unwrap().clone();
let form = species.get_form(&"default".into()).unwrap().clone();
let form = species.get_form(&"default".into()).unwrap();
let pokemon = Pokemon::new(
lib,