From 4a460468d09be73bdfe234df356e04403cd523e9 Mon Sep 17 00:00:00 2001 From: Connor Huffine Date: Wed, 10 Dec 2025 13:52:55 -0500 Subject: [PATCH] Improve ClothingSpeedModifier, Fix Paramedic Void Suit (#41820) * Add RequireActivated bool * Fix paramedic voidsuit * Remove explicit check This is actually unnecessarily verbose. * Improve comment * Update Content.Shared/Clothing/ClothingSpeedModifierSystem.cs Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> * Add cref linking * Change reference from system to component * Fix missing closing tag before anyone notices * Add clarity about when this field is used. * Add early return if not affected by toggling --------- Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- .../Clothing/ClothingSpeedModifierComponent.cs | 9 ++++++++- Content.Shared/Clothing/ClothingSpeedModifierSystem.cs | 5 ++++- .../Entities/Clothing/OuterClothing/softsuits.yml | 1 + 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Clothing/ClothingSpeedModifierComponent.cs b/Content.Shared/Clothing/ClothingSpeedModifierComponent.cs index 8dc496ec25..37f0a83eaa 100644 --- a/Content.Shared/Clothing/ClothingSpeedModifierComponent.cs +++ b/Content.Shared/Clothing/ClothingSpeedModifierComponent.cs @@ -5,7 +5,7 @@ namespace Content.Shared.Clothing; /// /// Modifies speed when worn and activated. -/// Supports ItemToggleComponent. +/// Supports . /// [RegisterComponent, NetworkedComponent, Access(typeof(ClothingSpeedModifierSystem))] public sealed partial class ClothingSpeedModifierComponent : Component @@ -16,6 +16,13 @@ public sealed partial class ClothingSpeedModifierComponent : Component [DataField] public float SprintModifier = 1.0f; + /// + /// Defines if the speed modifier requires activation to apply. + /// This will have no effect without an on the entity. + /// + [DataField] + public bool RequireActivated = true; + /// /// An optional required standing state. /// Set to true if you need to be standing, false if you need to not be standing, null if you don't care. diff --git a/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs b/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs index 29f063c7fa..4c264ac375 100644 --- a/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs +++ b/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs @@ -56,7 +56,7 @@ public sealed class ClothingSpeedModifierSystem : EntitySystem private void OnRefreshMoveSpeed(EntityUid uid, ClothingSpeedModifierComponent component, InventoryRelayedEvent args) { - if (!_toggle.IsActivated(uid)) + if (component.RequireActivated && !_toggle.IsActivated(uid)) return; if (component.Standing != null && !_standing.IsMatchingState(args.Owner, component.Standing.Value)) @@ -114,6 +114,9 @@ public sealed class ClothingSpeedModifierSystem : EntitySystem private void OnToggled(Entity ent, ref ItemToggledEvent args) { + if (!ent.Comp.RequireActivated) + return; + // make sentient boots slow or fast too _movementSpeed.RefreshMovementSpeedModifiers(ent); diff --git a/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml b/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml index 7bf6ed1f0a..761c0e715f 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml @@ -126,6 +126,7 @@ - type: ClothingSpeedModifier walkModifier: 0.9 sprintModifier: 0.9 + requireActivated: false - type: HeldSpeedModifier - type: TemperatureProtection heatingCoefficient: 0.1 -- 2.52.0