aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/health.rs8
-rw-r--r--src/shared/player.rs5
-rw-r--r--src/shared/stats.rs3
3 files changed, 6 insertions, 10 deletions
diff --git a/src/shared/health.rs b/src/shared/health.rs
index f4a288a..b88f19c 100644
--- a/src/shared/health.rs
+++ b/src/shared/health.rs
@@ -2,11 +2,3 @@ use crate::shared::*;
#[derive(Component, Message, Serialize, Deserialize, Clone, Copy, Debug, PartialEq)]
pub struct Health(pub f32);
-
-pub const MAX_HEALTH: f32 = 100.;
-
-impl Default for Health {
- fn default() -> Self {
- Health(MAX_HEALTH)
- }
-}
diff --git a/src/shared/player.rs b/src/shared/player.rs
index 4f571d8..c42f5cb 100644
--- a/src/shared/player.rs
+++ b/src/shared/player.rs
@@ -30,15 +30,16 @@ impl PlayerBundle {
replicate.target::<Cooldown>(NetworkTarget::Single(id));
replicate.target::<EffectiveStats>(NetworkTarget::Single(id));
let champion = Champion::default();
+ let effective_stats = EffectiveStats(BaseStats::from_champion(champion).0);
PlayerBundle {
id: PlayerId(id),
position: PlayerPosition(position),
color: PlayerColor(color),
imperative: Imperative::Idle,
cooldown: Cooldown::default(),
- health: Health::default(),
+ health: Health(effective_stats.0.max_health),
champion,
- effective_stats: EffectiveStats(BaseStats::from_champion(champion).0),
+ effective_stats,
buffs: Buffs::default(),
activation: Activation::default(),
replicate,
diff --git a/src/shared/stats.rs b/src/shared/stats.rs
index 8513a3c..ae449f0 100644
--- a/src/shared/stats.rs
+++ b/src/shared/stats.rs
@@ -4,6 +4,7 @@ use crate::shared::*;
pub struct Stats {
pub attack_range: f32,
pub movement_speed: f32,
+ pub max_health: f32,
}
#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq, Debug)]
@@ -18,10 +19,12 @@ impl BaseStats {
Champion::Meele => BaseStats(Stats {
attack_range: 25.,
movement_speed: 75.,
+ max_health: 150.,
}),
Champion::Ranged => BaseStats(Stats {
attack_range: 60.,
movement_speed: 85.,
+ max_health: 100.,
}),
}
}