From 7b6d9242e4217c8229cb546de495cd2670b97f2d Mon Sep 17 00:00:00 2001 From: Alexander Foremny Date: Tue, 19 Mar 2024 14:56:30 +0100 Subject: feat: render buffs in client --- src/shared/ability.rs | 10 +++++----- src/shared/buffs.rs | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'src/shared') diff --git a/src/shared/ability.rs b/src/shared/ability.rs index 2cd44c4..d88b63b 100644 --- a/src/shared/ability.rs +++ b/src/shared/ability.rs @@ -109,8 +109,8 @@ fn focus_activation(focus: Focus) -> ActivatedAbilityActivation { let Ok(mut buffs) = buffses.get_mut(*entity_id) else { return; }; - buffs.haste = Some(Timer::from_seconds(focus.duration, TimerMode::Once)); - buffs.speed = Some(Timer::from_seconds(focus.duration, TimerMode::Once)); + buffs.haste = Some(focus.duration); + buffs.speed = Some(focus.duration); }, ) }); @@ -128,7 +128,7 @@ fn haste_activation(haste: Haste) -> ActivatedAbilityActivation { let Ok(mut buffs) = buffses.get_mut(*entity_id) else { return; }; - buffs.haste = Some(Timer::from_seconds(haste.duration, TimerMode::Once)); + buffs.haste = Some(haste.duration); }, ) }); @@ -152,7 +152,7 @@ fn shield_activation(shield: Shield) -> ActivatedAbilityActivation { return; }; health.shield = health.shield + shield.blocked_damage; - buffs.shield = Some(Timer::from_seconds(shield.duration, TimerMode::Once)); + buffs.shield = Some(shield.duration); }, ) }); @@ -170,7 +170,7 @@ fn speed_activation(speed: Speed) -> ActivatedAbilityActivation { let Ok(mut buffs) = buffses.get_mut(*entity_id) else { return; }; - buffs.speed = Some(Timer::from_seconds(speed.duration, TimerMode::Once)); + buffs.speed = Some(speed.duration); }, ) }); diff --git a/src/shared/buffs.rs b/src/shared/buffs.rs index 6b518a5..868f3a3 100644 --- a/src/shared/buffs.rs +++ b/src/shared/buffs.rs @@ -1,9 +1,9 @@ use crate::shared::*; -#[derive(Clone, Component, Default, Debug)] +#[derive(Clone, Message, Component, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct Buffs { - pub haste: Option, - pub shield: Option, - pub slow: Option, - pub speed: Option, + pub haste: Option, + pub shield: Option, + pub slow: Option, + pub speed: Option, } -- cgit v1.2.3