aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/champion.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-19 05:50:53 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-19 05:50:53 +0100
commite9dce64b009455163f2a262ed481c37300917c4a (patch)
treeca747f68d8e46e1de938ff3d54fe009249836cd4 /src/shared/champion.rs
parent6805c6db39c1a9409b39aaf601f78db92b684c0d (diff)
chore: tweak champions
Diffstat (limited to 'src/shared/champion.rs')
-rw-r--r--src/shared/champion.rs58
1 files changed, 50 insertions, 8 deletions
diff --git a/src/shared/champion.rs b/src/shared/champion.rs
index ccc2fcd..05f13ef 100644
--- a/src/shared/champion.rs
+++ b/src/shared/champion.rs
@@ -1,5 +1,7 @@
use crate::shared::ability::*;
+use crate::shared::stats::*;
use crate::shared::*;
+use bevy::utils::*;
use std::str::FromStr;
#[derive(Component, Message, Clone, Copy, Serialize, Deserialize, PartialEq, Debug)]
@@ -27,19 +29,59 @@ impl FromStr for Champion {
}
impl Champion {
- pub fn to_ability(self, ability_slot: AbilitySlot) -> Ability {
+ pub fn base_stats(self) -> BaseStats {
+ match self {
+ 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.,
+ }),
+ }
+ }
+
+ pub fn ability(self, ability_slot: AbilitySlot) -> Ability {
match self {
Champion::Meele => match ability_slot {
- AbilitySlot::Q => Ability::Directional(DirectionalAbility::Dash),
- AbilitySlot::W => Ability::Directional(DirectionalAbility::Pull),
- AbilitySlot::G => Ability::Activated(ActivatedAbility::Speed),
- _ => Ability::Targeted(TargetedAbility::MeeleAttack),
+ AbilitySlot::Q => {
+ Ability::Directional(DirectionalAbility::Dash(Dash { max_distance: 60. }))
+ }
+ AbilitySlot::W => {
+ Ability::Directional(DirectionalAbility::Pull(Pull { max_distance: 60. }))
+ }
+ AbilitySlot::R => {
+ Ability::Targeted(TargetedAbility::MeeleAttack(MeeleAttack { damage: 45. }))
+ }
+ AbilitySlot::G => {
+ Ability::Activated(ActivatedAbility::Speed(Speed { duration: 2.5 }))
+ }
+ _ => Ability::Targeted(TargetedAbility::MeeleAttack(MeeleAttack { damage: 5. })),
},
Champion::Ranged => match ability_slot {
- AbilitySlot::Q => Ability::Directional(DirectionalAbility::Spear),
- AbilitySlot::G => Ability::Activated(ActivatedAbility::Speed),
- _ => Ability::Targeted(TargetedAbility::RangedAttack),
+ AbilitySlot::Q => Ability::Directional(DirectionalAbility::Spear(Spear {
+ max_distance: 250.,
+ damage: 15.,
+ })),
+ AbilitySlot::G => {
+ Ability::Activated(ActivatedAbility::Speed(Speed { duration: 2.5 }))
+ }
+ _ => Ability::Targeted(TargetedAbility::RangedAttack(RangedAttack { damage: 6. })),
},
}
}
+
+ pub fn base_cooldown(self) -> BaseCooldown {
+ match self {
+ Champion::Meele => {
+ BaseCooldown([0.75, 5., 5., 10., 25., 50., 50.].map(Duration::from_secs_f32))
+ }
+ Champion::Ranged => {
+ BaseCooldown([1.25, 5., 5., 10., 25., 50., 50.].map(Duration::from_secs_f32))
+ }
+ }
+ }
}