Skip to content

Commit

Permalink
bonk
Browse files Browse the repository at this point in the history
  • Loading branch information
FaDeOkno committed Aug 21, 2024
1 parent d0d8a3b commit 95b616f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Content.Shared/ADT/Crawling/SharedCrawlingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
using Robust.Shared.Player;
using Content.Shared.Movement.Systems;
using Content.Shared.Alert;
using Content.Shared.Climbing.Components;
using Content.Shared.Popups;
using Robust.Shared.Physics.Systems;
using Robust.Shared.Map.Components;
using Content.Shared.Climbing.Systems;
using Content.Shared.Climbing.Events;

namespace Content.Shared.ADT.Crawling;

Expand All @@ -18,6 +24,9 @@ public abstract class SharedCrawlingSystem : EntitySystem
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
[Dependency] private readonly AlertsSystem _alerts = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly EntityLookupSystem _lookup = default!;
[Dependency] private readonly BonkSystem _bonk = default!;

public override void Initialize()
{
base.Initialize();
Expand Down Expand Up @@ -68,6 +77,15 @@ private void OnDoAfter(EntityUid uid, CrawlerComponent component, CrawlStandupDo
{
if (args.Cancelled)
return;

foreach (var item in _lookup.GetEntitiesInRange<ClimbableComponent>(Transform(uid).Coordinates, 0.25f))
{
if (HasComp<ClimbableComponent>(item))
{
_bonk.TryBonk(uid, item, source: uid);
return;
}
}
_standing.Stand(uid);
}
private void OnStandUp(EntityUid uid, CrawlerComponent component, StandAttemptEvent args)
Expand Down

0 comments on commit 95b616f

Please sign in to comment.