aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/server.rs8
-rw-r--r--src/shared/projectile.rs1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/server.rs b/src/server.rs
index 1fe20a4..d9f2653 100644
--- a/src/server.rs
+++ b/src/server.rs
@@ -269,13 +269,19 @@ fn imperative_attack_attack(
};
if cooldown.a_cooldown.is_zero() {
cooldown.a_cooldown = Duration::from_secs_f32(1.5);
+ let instant = *champion == Champion::Meele;
commands.spawn(ProjectileBundle {
projectile: Projectile {
target_player,
source_player: *id,
damage: 4.,
+ instant,
},
- position: ProjectilePosition(position.0),
+ position: ProjectilePosition(if instant {
+ target_position.0
+ } else {
+ position.0
+ }),
replicate: Replicate::default(),
});
}
diff --git a/src/shared/projectile.rs b/src/shared/projectile.rs
index 2e9c6c3..16a064a 100644
--- a/src/shared/projectile.rs
+++ b/src/shared/projectile.rs
@@ -12,6 +12,7 @@ pub struct Projectile {
pub target_player: PlayerId,
pub source_player: PlayerId,
pub damage: f32,
+ pub instant: bool,
}
#[derive(Component, Message, Serialize, Deserialize, Clone, Debug, PartialEq)]