]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Crawling Fixes Part 5: Holy Fuck (#39109)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Mon, 21 Jul 2025 09:08:04 +0000 (02:08 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Jul 2025 09:08:04 +0000 (11:08 +0200)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Cuffs/Components/HandcuffComponent.cs
Content.Shared/Cuffs/SharedCuffableSystem.cs
Content.Shared/Stunnable/SharedStunSystem.Knockdown.cs

index 9465d605ed8238c68a57ecd1b404dd907057f2e1..a94e48a35c967e823d202d80eeab510ea5ed3812 100644 (file)
@@ -1,4 +1,3 @@
-using Content.Shared.Damage;
 using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
@@ -33,24 +32,6 @@ public sealed partial class HandcuffComponent : Component
     [DataField, ViewVariables(VVAccess.ReadWrite)]
     public float StunBonus = 2f;
 
-    /// <summary>
-    ///     Modifier for the amount of time it takes an entity to stand up if cuffed.
-    /// </summary>
-    [DataField]
-    public float StandupMod = 5f;
-
-    /// <summary>
-    ///     Modifier to the speed of an entity who is cuffed, does not stack with KnockedMovementMod
-    /// </summary>
-    [DataField]
-    public float MovementMod = 1f;
-
-    /// <summary>
-    ///     Modifier to the knocked down speed of an entity who is cuffed
-    /// </summary>
-    [DataField]
-    public float KnockedMovementMod = 0.4f;
-
     /// <summary>
     ///     Will the cuffs break when removed?
     /// </summary>
index 931028052cfa1ecdc86e5e9fb0735f6889f811be..3b0f6c8a30cfe266fe64e2f14abff06908704c88 100644 (file)
@@ -21,7 +21,6 @@ using Content.Shared.Inventory.VirtualItem;
 using Content.Shared.Item;
 using Content.Shared.Movement.Events;
 using Content.Shared.Movement.Pulling.Events;
-using Content.Shared.Movement.Systems;
 using Content.Shared.Popups;
 using Content.Shared.Pulling.Events;
 using Content.Shared.Rejuvenate;
@@ -46,7 +45,6 @@ namespace Content.Shared.Cuffs
         [Dependency] private readonly ISharedAdminLogManager _adminLog = default!;
         [Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
         [Dependency] private readonly AlertsSystem _alerts = default!;
-        [Dependency] private readonly MovementSpeedModifierSystem _move = default!;
         [Dependency] private readonly SharedAudioSystem _audio = default!;
         [Dependency] private readonly SharedContainerSystem _container = default!;
         [Dependency] private readonly SharedDoAfterSystem _doAfter = default!;
@@ -58,14 +56,10 @@ namespace Content.Shared.Cuffs
         [Dependency] private readonly UseDelaySystem _delay = default!;
         [Dependency] private readonly SharedCombatModeSystem _combatMode = default!;
 
-        private EntityQuery<HandcuffComponent> _cuffQuery;
-
         public override void Initialize()
         {
             base.Initialize();
 
-            _cuffQuery = GetEntityQuery<HandcuffComponent>();
-
             SubscribeLocalEvent<CuffableComponent, HandCountChangedEvent>(OnHandCountChanged);
             SubscribeLocalEvent<UncuffAttemptEvent>(OnUncuffAttempt);
 
@@ -95,9 +89,6 @@ namespace Content.Shared.Cuffs
             SubscribeLocalEvent<HandcuffComponent, MeleeHitEvent>(OnCuffMeleeHit);
             SubscribeLocalEvent<HandcuffComponent, AddCuffDoAfterEvent>(OnAddCuffDoAfter);
             SubscribeLocalEvent<HandcuffComponent, VirtualItemDeletedEvent>(OnCuffVirtualItemDeleted);
-            SubscribeLocalEvent<CuffableComponent, GetStandUpTimeEvent>(OnCuffableStandupArgs);
-            SubscribeLocalEvent<CuffableComponent, KnockedDownRefreshEvent>(OnCuffableKnockdownRefresh);
-            SubscribeLocalEvent<CuffableComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshMovementSpeedModifiers);
         }
 
         private void CheckInteract(Entity<CuffableComponent> ent, ref InteractionAttemptEvent args)
@@ -375,9 +366,6 @@ namespace Content.Shared.Cuffs
                     _adminLog.Add(LogType.Action, LogImpact.High,
                         $"{ToPrettyString(user):player} has cuffed {ToPrettyString(target):player}");
                 }
-
-                if (!MathHelper.CloseTo(component.MovementMod, 1f))
-                    _move.RefreshMovementSpeedModifiers(target);
             }
             else
             {
@@ -432,72 +420,6 @@ namespace Content.Shared.Cuffs
             }
         }
 
-        /// <summary>
-        ///     Takes longer to stand up when cuffed
-        /// </summary>
-        private void OnCuffableStandupArgs(Entity<CuffableComponent> ent, ref GetStandUpTimeEvent time)
-        {
-            if (!HasComp<KnockedDownComponent>(ent) || !IsCuffed(ent))
-                return;
-
-            var cuffs = GetAllCuffs(ent.Comp);
-            var mod = 1f;
-
-            if (cuffs.Count == 0)
-                return;
-
-            foreach (var cuff in cuffs)
-            {
-                if (!_cuffQuery.TryComp(cuff, out var comp))
-                    continue;
-
-                // Get the worst modifier
-                mod = Math.Max(mod, comp.StandupMod);
-            }
-
-            time.DoAfterTime *= mod;
-        }
-
-        private void OnCuffableKnockdownRefresh(Entity<CuffableComponent> ent, ref KnockedDownRefreshEvent args)
-        {
-            var cuffs = GetAllCuffs(ent.Comp);
-            var mod = 1f;
-
-            if (cuffs.Count == 0)
-                return;
-
-            foreach (var cuff in cuffs)
-            {
-                if (!_cuffQuery.TryComp(cuff, out var comp))
-                    continue;
-
-                // Get the worst modifier
-                mod = Math.Min(mod, comp.KnockedMovementMod);
-            }
-
-            args.SpeedModifier *= mod;
-        }
-
-        private void OnRefreshMovementSpeedModifiers(Entity<CuffableComponent> ent, ref RefreshMovementSpeedModifiersEvent args)
-        {
-            var cuffs = GetAllCuffs(ent.Comp);
-            var mod = 1f;
-
-            if (cuffs.Count == 0)
-                return;
-
-            foreach (var cuff in cuffs)
-            {
-                if (!_cuffQuery.TryComp(cuff, out var comp))
-                    continue;
-
-                // Get the worst modifier
-                mod = Math.Min(mod, comp.MovementMod);
-            }
-
-            args.ModifySpeed(mod);
-        }
-
         /// <summary>
         ///     Adds virtual cuff items to the user's hands.
         /// </summary>
@@ -814,9 +736,6 @@ namespace Content.Shared.Cuffs
                 shoved = true;
             }
 
-            if (!MathHelper.CloseTo(cuff.MovementMod, 1f))
-                _move.RefreshMovementSpeedModifiers(target);
-
             if (cuffable.CuffedHandCount == 0)
             {
                 if (user != null)
index d609acff0481d2dac6f9d39efcf79b037cabf9a9..2146c27a21809237c147e4e07eba579dbe8b8604 100644 (file)
@@ -4,7 +4,6 @@ using Content.Shared.Damage;
 using Content.Shared.Damage.Components;
 using Content.Shared.Database;
 using Content.Shared.DoAfter;
-using Content.Shared.Hands;
 using Content.Shared.Hands.EntitySystems;
 using Content.Shared.Input;
 using Content.Shared.Movement.Events;
@@ -58,8 +57,6 @@ public abstract partial class SharedStunSystem
         SubscribeLocalEvent<KnockedDownComponent, RefreshMovementSpeedModifiersEvent>(OnRefreshKnockedSpeed);
         SubscribeLocalEvent<KnockedDownComponent, RefreshFrictionModifiersEvent>(OnRefreshFriction);
         SubscribeLocalEvent<KnockedDownComponent, TileFrictionEvent>(OnKnockedTileFriction);
-        SubscribeLocalEvent<KnockedDownComponent, DidEquipHandEvent>(OnHandEquipped);
-        SubscribeLocalEvent<KnockedDownComponent, DidUnequipHandEvent>(OnHandUnequipped);
 
         // DoAfter event subscriptions
         SubscribeLocalEvent<KnockedDownComponent, TryStandDoAfterEvent>(OnStandDoAfter);
@@ -518,15 +515,5 @@ public abstract partial class SharedStunSystem
         args.ModifyAcceleration(entity.Comp.FrictionModifier);
     }
 
-    private void OnHandEquipped(Entity<KnockedDownComponent> entity, ref DidEquipHandEvent args)
-    {
-        RefreshKnockedMovement(entity);
-    }
-
-    private void OnHandUnequipped(Entity<KnockedDownComponent> entity, ref DidUnequipHandEvent args)
-    {
-        RefreshKnockedMovement(entity);
-    }
-
     #endregion
 }