diff --git a/Content.Server/Atmos/Piping/Binary/Components/GasValveComponent.cs b/Content.Server/Atmos/Piping/Binary/Components/GasValveComponent.cs index 61fccc8877..9076207be2 100644 --- a/Content.Server/Atmos/Piping/Binary/Components/GasValveComponent.cs +++ b/Content.Server/Atmos/Piping/Binary/Components/GasValveComponent.cs @@ -1,4 +1,5 @@ using Content.Shared.Interaction; +using Content.Shared.Sound; using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -17,5 +18,8 @@ namespace Content.Server.Atmos.Piping.Binary.Components [DataField("pipe")] [ViewVariables(VVAccess.ReadWrite)] public string PipeName { get; } = "pipe"; + + [DataField("valveSound")] + public SoundSpecifier _valveSound { get; } = new SoundCollectionSpecifier("valveSqueak"); } } diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs index 84745a6a6f..ea64ed6940 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasValveSystem.cs @@ -3,13 +3,16 @@ using Content.Server.NodeContainer; using Content.Server.NodeContainer.Nodes; using Content.Shared.ActionBlocker; using Content.Shared.Atmos.Piping; +using Content.Shared.Audio; using Content.Shared.Examine; using Content.Shared.Interaction; using Content.Shared.Interaction.Helpers; using JetBrains.Annotations; using Robust.Server.GameObjects; +using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.Localization; +using Robust.Shared.Player; namespace Content.Server.Atmos.Piping.Binary.EntitySystems { @@ -45,8 +48,11 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args) { - if(args.User.InRangeUnobstructed(args.Target) && Get().CanInteract(args.User)) + if (args.User.InRangeUnobstructed(args.Target) && Get().CanInteract(args.User)) + { Toggle(uid, component); + SoundSystem.Play(Filter.Pvs(component.Owner), component._valveSound.GetSound(), component.Owner, AudioHelpers.WithVariation(0.25f)); + } } public void Set(EntityUid uid, GasValveComponent component, bool value) diff --git a/Resources/Audio/Effects/squeak1.ogg b/Resources/Audio/Effects/squeak1.ogg new file mode 100644 index 0000000000..288b31c73a Binary files /dev/null and b/Resources/Audio/Effects/squeak1.ogg differ diff --git a/Resources/Audio/Effects/squeak2.ogg b/Resources/Audio/Effects/squeak2.ogg new file mode 100644 index 0000000000..93ce49f744 Binary files /dev/null and b/Resources/Audio/Effects/squeak2.ogg differ diff --git a/Resources/Audio/Effects/squeak3.ogg b/Resources/Audio/Effects/squeak3.ogg new file mode 100644 index 0000000000..48aad7f4ef Binary files /dev/null and b/Resources/Audio/Effects/squeak3.ogg differ diff --git a/Resources/Prototypes/SoundCollections/atmospherics.yml b/Resources/Prototypes/SoundCollections/atmospherics.yml new file mode 100644 index 0000000000..20f359690e --- /dev/null +++ b/Resources/Prototypes/SoundCollections/atmospherics.yml @@ -0,0 +1,6 @@ +- type: soundCollection + id: valveSqueak + files: + - /Audio/Effects/squeak1.ogg + - /Audio/Effects/squeak2.ogg + - /Audio/Effects/squeak3.ogg