aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/champion.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-22 15:42:19 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-22 15:42:19 +0100
commit2d8740b1e29fc356fbe88cea21059ec83d8c0cf0 (patch)
tree63dce5c6502861d52a1d982b705c65a2d2e4c60d /src/shared/champion.rs
parent91419fb01ef5dcdc06d9f6774d16d3ccca1e4b57 (diff)
feat: minions
Diffstat (limited to 'src/shared/champion.rs')
-rw-r--r--src/shared/champion.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/shared/champion.rs b/src/shared/champion.rs
index 1667672..711e520 100644
--- a/src/shared/champion.rs
+++ b/src/shared/champion.rs
@@ -10,6 +10,7 @@ pub enum Champion {
Meele,
Ranged,
Tower,
+ Minion,
}
impl Default for Champion {
@@ -26,6 +27,7 @@ impl FromStr for Champion {
"ranged" => Ok(Champion::Ranged),
"meele" => Ok(Champion::Meele),
"tower" => Ok(Champion::Tower),
+ "minion" => Ok(Champion::Minion),
_ => Err(format!("unknown champion: {}", s)),
}
}
@@ -52,6 +54,12 @@ impl Champion {
max_health: 500.,
movement_speed: 0.,
}),
+ Champion::Minion => BaseStats(Stats {
+ attack_range: 30.,
+ attack_speed: 1.,
+ max_health: 50.,
+ movement_speed: 60.,
+ }),
}
}
@@ -102,6 +110,9 @@ impl Champion {
Ability::Targeted(TargetedAbility::RangedAttack(RangedAttack { damage: 100. }))
}
},
+ Champion::Minion => match ability_slot {
+ _ => Ability::Targeted(TargetedAbility::RangedAttack(RangedAttack { damage: 2. })),
+ },
}
}
@@ -116,6 +127,9 @@ impl Champion {
Champion::Tower => {
BaseCooldown([10., 10., 10., 10., 10., 10., 10.].map(Duration::from_secs_f32))
}
+ Champion::Minion => {
+ BaseCooldown([1., 1., 1., 1., 1., 1., 1.].map(Duration::from_secs_f32))
+ }
}
}
}