aboutsummaryrefslogtreecommitdiffstats
path: root/src/shared/ability.rs
diff options
context:
space:
mode:
authorLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-19 14:13:16 +0100
committerLibravatar Alexander Foremny <aforemny@posteo.de>2024-03-19 15:12:22 +0100
commit2d21d709901c96b05d7f0169dd9d1207436c658c (patch)
tree8f1a094c46e96e13a0a5395ba69c0eb402555133 /src/shared/ability.rs
parent2e39423d11a6cd1e25b54c30d9afd22e8eff9dfe (diff)
feat: area of effect
Diffstat (limited to 'src/shared/ability.rs')
-rw-r--r--src/shared/ability.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/shared/ability.rs b/src/shared/ability.rs
index 80c74b2..2cd44c4 100644
--- a/src/shared/ability.rs
+++ b/src/shared/ability.rs
@@ -1,4 +1,5 @@
use crate::server::entity_map::*;
+use crate::shared::area_of_effect::*;
use crate::shared::buffs::*;
use crate::shared::player::*;
use crate::shared::projectile::*;
@@ -220,7 +221,8 @@ fn dash_activation(dash: Dash) -> DirectionalAbilityActivation {
mut set: ParamSet<(
Query<&mut PlayerPosition>,
Query<(&PlayerId, &PlayerPosition)>,
- )>| {
+ )>,
+ mut commands: Commands| {
let Some(source_entity) = ({
let mut source_entity = None;
for (entity, player_id) in players.iter() {
@@ -261,6 +263,14 @@ fn dash_activation(dash: Dash) -> DirectionalAbilityActivation {
if let Ok(mut position) = positions.get_mut(source_entity) {
position.0 = dash_end;
}
+
+ commands.spawn(AreaOfEffectBundle::new(AreaOfEffect {
+ position: dash_end,
+ radius: 1.5 * PLAYER_RADIUS,
+ duration: None,
+ source_player,
+ area_of_effect_type: AreaOfEffectType::Slow,
+ }));
},
)
});