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 249f8e04f3..dbfb6ab63b 100644 --- a/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs +++ b/Content.Shared/Clothing/ClothingSpeedModifierSystem.cs @@ -57,7 +57,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)) @@ -132,6 +132,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 d10051bf50..1f516a830d 100644 --- a/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml +++ b/Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml @@ -200,6 +200,7 @@ - type: ClothingSpeedModifier walkModifier: 0.9 sprintModifier: 0.9 + requireActivated: false - type: HeldSpeedModifier - type: TemperatureProtection heatingCoefficient: 0.1