This commit is contained in:
Swept
2021-11-06 17:32:33 -07:00
committed by GitHub
parent 1bec086a0d
commit b46957e0d8
6 changed files with 17 additions and 1 deletions

View File

@@ -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");
}
}

View File

@@ -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<ActionBlockerSystem>().CanInteract(args.User))
if (args.User.InRangeUnobstructed(args.Target) && Get<ActionBlockerSystem>().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)

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
- type: soundCollection
id: valveSqueak
files:
- /Audio/Effects/squeak1.ogg
- /Audio/Effects/squeak2.ogg
- /Audio/Effects/squeak3.ogg