From 27fc2fc1ea8be71debc3c80ffc71a3f9baaebff4 Mon Sep 17 00:00:00 2001 From: hodasemi Date: Fri, 30 Aug 2024 08:16:05 +0200 Subject: [PATCH] Multiply level to statistics in ability damage --- rpg_components/src/items/ability_book.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rpg_components/src/items/ability_book.rs b/rpg_components/src/items/ability_book.rs index df3a6a9..d92dcd5 100644 --- a/rpg_components/src/items/ability_book.rs +++ b/rpg_components/src/items/ability_book.rs @@ -29,7 +29,7 @@ pub trait Ability: Send + Sync + Clone + Default { fn mana_cost(&self) -> u32; fn mana_cost_per_level(&self) -> u32; fn damage_type(&self) -> DamageType; - fn base_damage(&self, level: u32) -> u32; + fn base_damage(&self) -> u32; } #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] @@ -246,7 +246,7 @@ impl AbilityBook { pub fn damage(&self, statistics: &Statistics) -> u32 { // calculate damage of base ability - let ability_base_damage = self.ability.base_damage(self.level); + let ability_base_damage = self.ability.base_damage(); // get bonus damage from statistics let stats_damage = match self.ability.damage_type() { @@ -260,7 +260,7 @@ impl AbilityBook { let addon_damage = self.addons.damage() * self.level; // sum up - ability_base_damage + stats_damage + addon_damage + ability_base_damage + (stats_damage * self.level) + addon_damage } pub fn into_persistent(&self) -> String {