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