aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/stats.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-18 04:58:00 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-18 07:02:29 +0100
commitec17616f8d6041ac5d93a786edec0f5d0f969a46 (patch)
treec3a1738aa715f33438591904310c1fca3f475349 /src/shared/stats.rs
parent937e1ed8d240c1a5b42f5b8cf1104321b9d79c4a (diff)
feat: speed ability
Diffstat (limited to 'src/shared/stats.rs')
-rw-r--r--src/shared/stats.rs22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/shared/stats.rs b/src/shared/stats.rs
index 278a19f..749453c 100644
--- a/src/shared/stats.rs
+++ b/src/shared/stats.rs
@@ -1,16 +1,28 @@
-use crate::shared::champion::*;
use crate::shared::*;
-#[derive(Component, Message, Clone, Serialize, Deserialize, PartialEq)]
+#[derive(Clone, Copy, Serialize, Deserialize, PartialEq)]
pub struct Stats {
pub attack_range: f32,
+ pub movement_speed: f32,
}
-impl Stats {
+#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq)]
+pub struct BaseStats(pub Stats);
+
+#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq)]
+pub struct EffectiveStats(pub Stats);
+
+impl BaseStats {
pub fn from_champion(champion: Champion) -> Self {
match champion {
- Champion::Meele => Stats { attack_range: 35. },
- Champion::Ranged => Stats { attack_range: 60. },
+ Champion::Meele => BaseStats(Stats {
+ attack_range: 25.,
+ movement_speed: 75.,
+ }),
+ Champion::Ranged => BaseStats(Stats {
+ attack_range: 60.,
+ movement_speed: 85.,
+ }),
}
}
}