diff options
Diffstat (limited to 'src/client.rs')
-rw-r--r-- | src/client.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/client.rs b/src/client.rs index 22e3960..1768b2e 100644 --- a/src/client.rs +++ b/src/client.rs @@ -445,6 +445,30 @@ fn gizmos_attack_indicator( ); gizmos.arrow_2d(position.0, dash_end, Color::YELLOW); } + Ability::Directional(DirectionalAbility::Pull) => { + let Some(world_position) = cursor_world_position(&windows, &cameras) else { + return; + }; + let Some(direction) = (world_position - position.0).try_normalize() else { + return; + }; + let Some((_, pull_start, pull_end)) = pull_collision( + PlayerId(client_id.0), + position.0, + direction, + 150., + &player_positions, + ) else { + let pull_direction = -150. * direction; + let pull_start = position.0 - pull_direction; + let pull_end = pull_start + + (pull_direction.length() - 2. * PLAYER_RADIUS) + * pull_direction.normalize_or_zero(); + gizmos.arrow_2d(pull_start, pull_end, Color::YELLOW); + return; + }; + gizmos.arrow_2d(pull_start, pull_end, Color::YELLOW); + } Ability::Directional(_) => { let Some(world_position) = cursor_world_position(&windows, &cameras) else { return; |