From 894af847cd8899ed4b842ccb6b108e0252b040b5 Mon Sep 17 00:00:00 2001 From: Aviu00 <93730715+Aviu00@users.noreply.github.com> Date: Fri, 14 Jun 2024 14:01:02 +0000 Subject: [PATCH] Cherrypicks (#356) * Katana Dash checks based on vision rather than collision (#27793) * Fix dash check * unused * obsolete function --------- Co-authored-by: plykiya * Fix StepTrigger blacklist not working (#26968) * Make cuff default range again (#28576) * Make cuff default range again * uncuff distance * how about ONE --------- Co-authored-by: plykiya --------- Co-authored-by: Plykiya <58439124+Plykiya@users.noreply.github.com> Co-authored-by: plykiya Co-authored-by: no <165581243+pissdemon@users.noreply.github.com> --- Content.Shared/Cuffs/SharedCuffableSystem.cs | 4 ++-- Content.Shared/Ninja/Systems/DashAbilitySystem.cs | 9 ++++----- Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/Content.Shared/Cuffs/SharedCuffableSystem.cs b/Content.Shared/Cuffs/SharedCuffableSystem.cs index 059e6c6c79..1e22ed8068 100644 --- a/Content.Shared/Cuffs/SharedCuffableSystem.cs +++ b/Content.Shared/Cuffs/SharedCuffableSystem.cs @@ -545,7 +545,7 @@ namespace Content.Shared.Cuffs BreakOnWeightlessMove = false, BreakOnDamage = true, NeedHand = true, - DistanceThreshold = 0.3f + DistanceThreshold = 1f // shorter than default but still feels good }; if (!_doAfter.TryStartDoAfter(doAfterEventArgs)) @@ -650,7 +650,7 @@ namespace Content.Shared.Cuffs BreakOnDamage = true, NeedHand = true, RequireCanInteract = false, // Trust in UncuffAttemptEvent - DistanceThreshold = 0.3f + DistanceThreshold = 1f // shorter than default but still feels good }; if (!_doAfter.TryStartDoAfter(doAfterEventArgs)) diff --git a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs index 011b6f9f66..50319ae651 100644 --- a/Content.Shared/Ninja/Systems/DashAbilitySystem.cs +++ b/Content.Shared/Ninja/Systems/DashAbilitySystem.cs @@ -5,8 +5,8 @@ using Content.Shared.Charges.Systems; using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Ninja.Components; -using Content.Shared.Physics; using Content.Shared.Popups; +using Content.Shared.Examine; using Robust.Shared.Audio.Systems; using Robust.Shared.Timing; @@ -21,7 +21,7 @@ public sealed class DashAbilitySystem : EntitySystem [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedChargesSystem _charges = default!; [Dependency] private readonly SharedHandsSystem _hands = default!; - [Dependency] private readonly SharedInteractionSystem _interaction = default!; + [Dependency] private readonly ExamineSystemShared _examine = default!; [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly SharedTransformSystem _transform = default!; [Dependency] private readonly ActionContainerSystem _actionContainer = default!; @@ -81,11 +81,10 @@ public sealed class DashAbilitySystem : EntitySystem _popup.PopupClient(Loc.GetString("dash-ability-no-charges", ("item", uid)), user, user); return; } - - var origin = Transform(user).MapPosition; + var origin = _transform.GetMapCoordinates(user); var target = args.Target.ToMap(EntityManager, _transform); // prevent collision with the user duh - if (!_interaction.InRangeUnobstructed(origin, target, 0f, CollisionGroup.Opaque, uid => uid == user)) + if (!_examine.InRangeUnOccluded(origin, target, SharedInteractionSystem.MaxRaycastRange, null)) { // can only dash if the destination is visible on screen _popup.PopupClient(Loc.GetString("dash-ability-cant-see", ("item", uid)), user, user); diff --git a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs index b4ac2cde75..d81ad754d1 100644 --- a/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs +++ b/Content.Shared/StepTrigger/Systems/StepTriggerSystem.cs @@ -59,7 +59,7 @@ public sealed class StepTriggerSystem : EntitySystem if (component.Blacklist != null && TryComp(transform.GridUid, out var grid)) { - var positon = _map.LocalToTile(uid, grid, transform.Coordinates); + var positon = _map.LocalToTile(transform.GridUid.Value, grid, transform.Coordinates); var anch = _map.GetAnchoredEntitiesEnumerator(uid, grid, positon); while (anch.MoveNext(out var ent))