From 95b616f8ca038a93a7f9dd34d5878e1bb1e5079b Mon Sep 17 00:00:00 2001 From: FaDeOkno Date: Wed, 21 Aug 2024 21:53:14 +0400 Subject: [PATCH] bonk --- .../ADT/Crawling/SharedCrawlingSystem.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Content.Shared/ADT/Crawling/SharedCrawlingSystem.cs b/Content.Shared/ADT/Crawling/SharedCrawlingSystem.cs index c43eadfddda..daabf082645 100644 --- a/Content.Shared/ADT/Crawling/SharedCrawlingSystem.cs +++ b/Content.Shared/ADT/Crawling/SharedCrawlingSystem.cs @@ -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; @@ -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(); @@ -68,6 +77,15 @@ private void OnDoAfter(EntityUid uid, CrawlerComponent component, CrawlStandupDo { if (args.Cancelled) return; + + foreach (var item in _lookup.GetEntitiesInRange(Transform(uid).Coordinates, 0.25f)) + { + if (HasComp(item)) + { + _bonk.TryBonk(uid, item, source: uid); + return; + } + } _standing.Stand(uid); } private void OnStandUp(EntityUid uid, CrawlerComponent component, StandAttemptEvent args)