From ec17616f8d6041ac5d93a786edec0f5d0f969a46 Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Mon, 18 Mar 2024 04:58:00 +0100 Subject: feat: speed ability --- src/shared/stats.rs | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) (limited to 'src/shared/stats.rs') 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., + }), } } } -- cgit v1.2.3