1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
use crate::shared::*;
#[derive(Clone, Copy, Serialize, Deserialize, PartialEq, Debug)]
pub struct Stats {
pub attack_range: f32,
pub movement_speed: f32,
pub max_health: f32,
}
#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq, Debug)]
pub struct BaseStats(pub Stats);
#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq, Debug)]
pub struct EffectiveStats(pub Stats);
impl BaseStats {
pub fn from_champion(champion: Champion) -> Self {
match champion {
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.,
}),
}
}
}
|