Initial (#5193)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
BIN
Resources/Audio/Effects/squeak1.ogg
Normal file
BIN
Resources/Audio/Effects/squeak1.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/squeak2.ogg
Normal file
BIN
Resources/Audio/Effects/squeak2.ogg
Normal file
Binary file not shown.
BIN
Resources/Audio/Effects/squeak3.ogg
Normal file
BIN
Resources/Audio/Effects/squeak3.ogg
Normal file
Binary file not shown.
6
Resources/Prototypes/SoundCollections/atmospherics.yml
Normal file
6
Resources/Prototypes/SoundCollections/atmospherics.yml
Normal file
@@ -0,0 +1,6 @@
|
||||
- type: soundCollection
|
||||
id: valveSqueak
|
||||
files:
|
||||
- /Audio/Effects/squeak1.ogg
|
||||
- /Audio/Effects/squeak2.ogg
|
||||
- /Audio/Effects/squeak3.ogg
|
||||
Reference in New Issue
Block a user