Content audio (#20862)
This commit is contained in:
@@ -9,6 +9,9 @@ using Content.Shared.Temperature;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems
|
||||
|
||||
@@ -9,6 +9,10 @@ using Content.Shared.Light.Components;
|
||||
using Content.Shared.Rounding;
|
||||
using Content.Shared.Toggleable;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
@@ -4,6 +4,7 @@ using Content.Shared.Light.Components;
|
||||
using Content.Shared.Throwing;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems
|
||||
@@ -11,6 +12,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
public sealed class LightBulbSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -68,7 +70,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (!Resolve(uid, ref bulb))
|
||||
return;
|
||||
|
||||
SoundSystem.Play(bulb.BreakSound.GetSound(), Filter.Pvs(uid), uid);
|
||||
_audio.PlayPvs(bulb.BreakSound, uid);
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, LightBulbComponent? bulb = null,
|
||||
|
||||
@@ -6,6 +6,8 @@ using Content.Shared.Light.Components;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Storage;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems;
|
||||
|
||||
@@ -7,6 +7,7 @@ using Content.Shared.Smoking;
|
||||
using Content.Shared.Temperature;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems
|
||||
@@ -15,6 +16,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedAudioSystem _audio = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
@@ -79,8 +81,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
var component = matchstick.Comp;
|
||||
|
||||
// Play Sound
|
||||
SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(matchstick),
|
||||
matchstick, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
_audio.PlayPvs(component.IgniteSound, matchstick, AudioParams.Default.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
|
||||
// Change state
|
||||
SetState(matchstick, component, SmokableState.Lit);
|
||||
|
||||
@@ -23,6 +23,12 @@ using Robust.Shared.Audio;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Timing;
|
||||
using Content.Shared.DoAfter;
|
||||
using Content.Server.Emp;
|
||||
using Content.Server.DeviceLinking.Events;
|
||||
using Content.Server.DeviceLinking.Systems;
|
||||
using Content.Shared.Inventory;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
|
||||
namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
@@ -130,7 +136,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (damage != null)
|
||||
_adminLogger.Add(LogType.Damaged, $"{ToPrettyString(args.User):user} burned their hand on {ToPrettyString(args.Target):target} and received {damage.Total:damage} damage");
|
||||
|
||||
_audio.Play(light.BurnHandSound, Filter.Pvs(uid), uid, true);
|
||||
_audio.PlayEntity(light.BurnHandSound, Filter.Pvs(uid), uid, true);
|
||||
|
||||
args.Handled = true;
|
||||
return;
|
||||
@@ -281,7 +287,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (time > light.LastThunk + ThunkDelay)
|
||||
{
|
||||
light.LastThunk = time;
|
||||
_audio.Play(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
|
||||
_audio.PlayEntity(light.TurnOnSound, Filter.Pvs(uid), uid, true, AudioParams.Default.WithVolume(-10f));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,6 +7,8 @@ using Content.Shared.Light.Components;
|
||||
using Content.Shared.Mind.Components;
|
||||
using Content.Shared.Toggleable;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Audio.Systems;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Random;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
Reference in New Issue
Block a user