Content audio (#20862)

This commit is contained in:
metalgearsloth
2023-10-29 14:58:23 +11:00
committed by GitHub
parent cd280eef6b
commit 9b1b3e03ed
326 changed files with 890 additions and 436 deletions

View File

@@ -8,6 +8,8 @@ using Content.Shared.DoAfter;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using static Content.Shared.Access.Components.AccessOverriderComponent;

View File

@@ -26,6 +26,7 @@ using Content.Shared.Throwing;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Network;
@@ -39,7 +40,6 @@ namespace Content.Server.Administration.Systems
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly IConfigurationManager _config = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
[Dependency] private readonly AudioSystem _audio = default!;
[Dependency] private readonly HandsSystem _hands = default!;
[Dependency] private readonly SharedJobSystem _jobs = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
@@ -49,6 +49,7 @@ namespace Content.Server.Administration.Systems
[Dependency] private readonly PlayTimeTrackingManager _playTime = default!;
[Dependency] private readonly SharedRoleSystem _role = default!;
[Dependency] private readonly GameTicker _gameTicker = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StationRecordsSystem _stationRecords = default!;
[Dependency] private readonly TransformSystem _transform = default!;
@@ -340,7 +341,7 @@ namespace Content.Server.Administration.Systems
_popup.PopupCoordinates(Loc.GetString("admin-erase-popup", ("user", name)), coordinates, PopupType.LargeCaution);
var filter = Filter.Pvs(coordinates, 1, EntityManager, _playerManager);
var audioParams = new AudioParams().WithVolume(3);
_audio.Play("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
_audio.PlayStatic("/Audio/Effects/pop_high.ogg", filter, coordinates, true, audioParams);
}
foreach (var item in _inventory.GetHandOrInventoryEntities(entity.Value))

View File

@@ -3,6 +3,7 @@ using Content.Server.Chat.Systems;
using Content.Server.Station.Systems;
using Content.Shared.CCVar;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Prototypes;
@@ -10,10 +11,11 @@ namespace Content.Server.AlertLevel;
public sealed class AlertLevelSystem : EntitySystem
{
[Dependency] private readonly IConfigurationManager _cfg = default!;
[Dependency] private readonly IPrototypeManager _prototypeManager = default!;
[Dependency] private readonly ChatSystem _chatSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly IConfigurationManager _cfg = default!;
// Until stations are a prototype, this is how it's going to have to be.
public const string DefaultAlertLevelSet = "stationAlerts";
@@ -174,7 +176,7 @@ public sealed class AlertLevelSystem : EntitySystem
if (detail.Sound != null)
{
var filter = _stationSystem.GetInOwningStation(station);
SoundSystem.Play(detail.Sound.GetSound(), filter, detail.Sound.Params);
_audio.PlayGlobal(detail.Sound.GetSound(), filter, true, detail.Sound.Params);
}
else
{

View File

@@ -15,6 +15,7 @@ using Content.Shared.Popups;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Timing;

View File

@@ -6,6 +6,8 @@ using Content.Server.Tools;
using Content.Shared.Database;
using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
namespace Content.Server.Ame.EntitySystems;

View File

@@ -5,6 +5,7 @@ using Content.Shared.Actions.Events;
using Content.Shared.Nutrition.Components;
using Content.Shared.Nutrition.EntitySystems;
using Content.Shared.Storage;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Random;

View File

@@ -81,7 +81,7 @@ public sealed partial class AnomalySystem
var generating = EnsureComp<GeneratingAnomalyGeneratorComponent>(uid);
generating.EndTime = Timing.CurTime + component.GenerationLength;
generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true));
generating.AudioStream = Audio.PlayPvs(component.GeneratingSound, uid, AudioParams.Default.WithLoop(true))?.Entity;
component.CooldownEndTime = Timing.CurTime + component.CooldownLength;
UpdateGeneratorUi(uid, component);
}
@@ -174,7 +174,8 @@ public sealed partial class AnomalySystem
{
if (Timing.CurTime < active.EndTime)
continue;
active.AudioStream?.Stop();
active.AudioStream = _audio.Stop(active.AudioStream);
OnGeneratingFinished(ent, gen);
}
}

View File

@@ -9,6 +9,8 @@ using Content.Shared.Anomaly;
using Content.Shared.Anomaly.Components;
using Content.Shared.DoAfter;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Physics.Events;
using Robust.Shared.Prototypes;
@@ -31,6 +33,7 @@ public sealed partial class AnomalySystem : SharedAnomalySystem
[Dependency] private readonly SharedPointLightSystem _pointLight = default!;
[Dependency] private readonly StationSystem _station = default!;
[Dependency] private readonly RadioSystem _radio = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UserInterfaceSystem _ui = default!;
public const float MinParticleVariation = 0.8f;

View File

@@ -13,5 +13,5 @@ public sealed partial class GeneratingAnomalyGeneratorComponent : Component
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan EndTime = TimeSpan.Zero;
public IPlayingAudioStream? AudioStream;
public EntityUid? AudioStream;
}

View File

@@ -4,6 +4,8 @@ using Content.Server.Anomaly.Components;
using Content.Shared.Anomaly.Components;
using Content.Shared.Mobs.Components;
using Content.Shared.Teleportation.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Anomaly.Effects;

View File

@@ -6,6 +6,7 @@ using Content.Shared.Chemistry.EntitySystems;
using Robust.Shared.Prototypes;
using Content.Shared.Sprite;
using Robust.Server.GameObjects;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Anomaly.Effects;
@@ -75,7 +76,7 @@ public sealed class ReagentProducerAnomalySystem : EntitySystem
if (anomaly.Severity >= 0.97) reagentProducingAmount *= component.SupercriticalReagentProducingModifier;
newSol.AddReagent(component.ProducingReagent, reagentProducingAmount);
_solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled.
_solutionContainer.TryAddSolution(uid, producerSol, newSol); //TO DO - the container is not fully filled.
component.AccumulatedFrametime = 0;

View File

@@ -21,6 +21,7 @@ using Content.Shared.Mobs.Components;
using Content.Server.Station.Systems;
using Content.Server.Shuttles.Systems;
using Content.Shared.Mobs;
using Robust.Server.Audio;
using Robust.Server.Containers;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

View File

@@ -3,6 +3,7 @@ using Content.Server.UserInterface;
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Arcade.SpaceVillain;

View File

@@ -1,6 +1,7 @@
using static Content.Shared.Arcade.SharedSpaceVillainArcadeComponent;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Arcade.SpaceVillain;

View File

@@ -30,8 +30,8 @@ namespace Content.Server.Atmos.Components
// Cancel toggles sounds if we re-toggle again.
public IPlayingAudioStream? ConnectStream;
public IPlayingAudioStream? DisconnectStream;
public EntityUid? ConnectStream;
public EntityUid? DisconnectStream;
[DataField("air"), ViewVariables(VVAccess.ReadWrite)]
public GasMixture Air { get; set; } = new();

View File

@@ -101,8 +101,7 @@ namespace Content.Server.Atmos.EntitySystems
if(_spaceWindSoundCooldown == 0 && !string.IsNullOrEmpty(SpaceWindSound))
{
var coordinates = tile.GridIndices.ToEntityCoordinates(tile.GridIndex, _mapManager);
SoundSystem.Play(SpaceWindSound, Filter.Pvs(coordinates),
coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
_audio.PlayPvs(SpaceWindSound, coordinates, AudioParams.Default.WithVariation(0.125f).WithVolume(MathHelper.Clamp(tile.PressureDifference / 10, 10, 100)));
}
}

View File

@@ -85,8 +85,7 @@ namespace Content.Server.Atmos.EntitySystems
// A few details on the audio parameters for fire.
// The greater the fire state, the lesser the pitch variation.
// The greater the fire state, the greater the volume.
SoundSystem.Play(HotspotSound, Filter.Pvs(coordinates),
coordinates, AudioHelpers.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
_audio.PlayPvs(HotspotSound, coordinates, AudioParams.Default.WithVariation(0.15f/tile.Hotspot.State).WithVolume(-5f + 5f * tile.Hotspot.State));
}
if (_hotspotSoundCooldown > HotspotSoundCooldownCycles)

View File

@@ -7,6 +7,8 @@ using Content.Shared.Atmos.EntitySystems;
using Content.Shared.Maps;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Physics.Systems;
@@ -28,6 +30,7 @@ public sealed partial class AtmosphereSystem : SharedAtmosphereSystem
[Dependency] private readonly SharedContainerSystem _containers = default!;
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
[Dependency] private readonly GasTileOverlaySystem _gasTileOverlaySystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly TransformSystem _transformSystem = default!;
[Dependency] private readonly TileSystem _tile = default!;

View File

@@ -13,6 +13,7 @@ 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.Physics.Systems;
using Robust.Shared.Player;
@@ -239,10 +240,8 @@ namespace Content.Server.Atmos.EntitySystems
if (!component.IsConnected)
return;
component.ConnectStream?.Stop();
if (component.ConnectSound != null)
component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, owner);
component.ConnectStream = _audioSys.Stop(component.ConnectStream);
component.ConnectStream = _audioSys.PlayPvs(component.ConnectSound, component.Owner)?.Entity;
UpdateUserInterface(ent);
}
@@ -259,10 +258,8 @@ namespace Content.Server.Atmos.EntitySystems
_actions.SetToggled(component.ToggleActionEntity, false);
_internals.DisconnectTank(internals);
component.DisconnectStream?.Stop();
if (component.DisconnectSound != null)
component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, owner);
component.DisconnectStream = _audioSys.Stop(component.DisconnectStream);
component.DisconnectStream = _audioSys.PlayPvs(component.DisconnectSound, component.Owner)?.Entity;
UpdateUserInterface(ent);
}
@@ -322,7 +319,7 @@ namespace Content.Server.Atmos.EntitySystems
if(environment != null)
_atmosphereSystem.Merge(environment, component.Air);
_audioSys.Play(component.RuptureSound, Filter.Pvs(owner), Transform(owner).Coordinates, true, AudioParams.Default.WithVariation(0.125f));
_audioSys.PlayPvs(component.RuptureSound, Transform(component.Owner).Coordinates, AudioParams.Default.WithVariation(0.125f));
QueueDel(owner);
return;

View File

@@ -7,6 +7,7 @@ using Content.Server.DeviceNetwork.Systems;
using Content.Server.Power.Components;
using Content.Shared.Atmos.Monitor;
using Content.Shared.Tag;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Utility;

View File

@@ -8,6 +8,7 @@ using Content.Shared.Examine;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
namespace Content.Server.Atmos.Piping.Binary.EntitySystems
@@ -17,6 +18,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{
[Dependency] private readonly SharedAmbientSoundSystem _ambientSoundSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly NodeContainerSystem _nodeContainer = default!;
public override void Initialize()
@@ -35,10 +37,11 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
return;
if (Loc.TryGetString("gas-valve-system-examined", out var str,
("statusColor", valve.Open ? "green" : "orange"),
("open", valve.Open)
))
("statusColor", valve.Open ? "green" : "orange"),
("open", valve.Open)))
{
args.PushMarkup(str);
}
}
private void OnStartup(EntityUid uid, GasValveComponent component, ComponentStartup args)
@@ -50,7 +53,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
private void OnActivate(EntityUid uid, GasValveComponent component, ActivateInWorldEvent args)
{
Toggle(uid, component);
SoundSystem.Play(component.ValveSound.GetSound(), Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.25f));
_audio.PlayPvs(component.ValveSound, uid, AudioParams.Default.WithVariation(0.25f));
}
public void Set(EntityUid uid, GasValveComponent component, bool value)

View File

@@ -16,6 +16,8 @@ using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Lock;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;

View File

@@ -1,8 +1,41 @@
using Content.Server.GameTicking.Events;
using Content.Shared.Audio;
using Robust.Server.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
namespace Content.Server.Audio;
public sealed class ContentAudioSystem : SharedContentAudioSystem
{
[Dependency] private readonly AudioSystem _serverAudio = default!;
[Dependency] private readonly IPrototypeManager _protoManager = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStart);
_protoManager.PrototypesReloaded += OnProtoReload;
}
private void OnProtoReload(PrototypesReloadedEventArgs obj)
{
if (!obj.ByType.ContainsKey(typeof(AudioPresetPrototype)))
return;
_serverAudio.ReloadPresets();
}
public override void Shutdown()
{
base.Shutdown();
_protoManager.PrototypesReloaded -= OnProtoReload;
}
private void OnRoundStart(RoundStartingEvent ev)
{
// On cleanup all entities get purged so need to ensure audio presets are still loaded
// yeah it's whacky af.
_serverAudio.ReloadPresets();
}
}

View File

@@ -3,6 +3,8 @@ using Content.Server.Beam.Components;
using Content.Shared.Beam;
using Content.Shared.Beam.Components;
using Content.Shared.Physics;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision.Shapes;

View File

@@ -13,6 +13,8 @@ using Content.Shared.Slippery;
using Content.Shared.StatusEffect;
using Content.Shared.Stunnable;
using Content.Shared.Verbs;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

View File

@@ -15,6 +15,7 @@ using Content.Shared.Popups;
using Content.Shared.Timing;
using Content.Shared.Verbs;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
@@ -29,6 +30,7 @@ namespace Content.Server.Bible
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedActionsSystem _actionsSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly UseDelaySystem _delay = default!;
public override void Initialize()
@@ -80,8 +82,8 @@ namespace Content.Server.Bible
summonableComp.Summon = null;
}
summonableComp.AlreadySummoned = false;
_popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", uid)), uid, PopupType.Medium);
SoundSystem.Play("/Audio/Effects/radpulse9.ogg", Filter.Pvs(uid), uid, AudioParams.Default.WithVolume(-4f));
_popupSystem.PopupEntity(Loc.GetString("bible-summon-respawn-ready", ("book", summonableComp.Owner)), summonableComp.Owner, PopupType.Medium);
_audio.PlayPvs("/Audio/Effects/radpulse9.ogg", summonableComp.Owner, AudioParams.Default.WithVolume(-4f));
// Clean up the accumulator and respawn tracking component
summonableComp.Accumulator = 0;
_remQueue.Enqueue(uid);
@@ -107,7 +109,7 @@ namespace Content.Server.Bible
{
_popupSystem.PopupEntity(Loc.GetString("bible-sizzle"), args.User, args.User);
SoundSystem.Play(component.SizzleSoundPath.GetSound(), Filter.Pvs(args.User), args.User);
_audio.PlayPvs(component.SizzleSoundPath, args.User);
_damageableSystem.TryChangeDamage(args.User, component.DamageOnUntrainedUse, true, origin: uid);
_delay.BeginDelay(uid, delay);
@@ -125,7 +127,7 @@ namespace Content.Server.Bible
var selfFailMessage = Loc.GetString(component.LocPrefix + "-heal-fail-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
_popupSystem.PopupEntity(selfFailMessage, args.User, args.User, PopupType.MediumCaution);
SoundSystem.Play("/Audio/Effects/hit_kick.ogg", Filter.Pvs(args.Target.Value), args.User);
_audio.PlayPvs("/Audio/Effects/hit_kick.ogg", args.User);
_damageableSystem.TryChangeDamage(args.Target.Value, component.DamageOnFail, true, origin: uid);
_delay.BeginDelay(uid, delay);
return;
@@ -149,7 +151,7 @@ namespace Content.Server.Bible
var selfMessage = Loc.GetString(component.LocPrefix + "-heal-success-self", ("target", Identity.Entity(args.Target.Value, EntityManager)),("bible", uid));
_popupSystem.PopupEntity(selfMessage, args.User, args.User, PopupType.Large);
SoundSystem.Play(component.HealSoundPath.GetSound(), Filter.Pvs(args.Target.Value), args.User);
_audio.PlayPvs(component.HealSoundPath, args.User);
_delay.BeginDelay(uid, delay);
}
}

View File

@@ -20,6 +20,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Content.Shared.Speech.EntitySystems;
using Robust.Server.Audio;
namespace Content.Server.Body.Systems;

View File

@@ -15,6 +15,7 @@ using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using System.Numerics;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Body.Systems;
@@ -129,7 +130,7 @@ public sealed class BodySystem : SharedBodySystem
var filter = Filter.Pvs(bodyId, entityManager: EntityManager);
var audio = AudioParams.Default.WithVariation(0.025f);
_audio.Play(body.GibSound, filter, coordinates, true, audio);
_audio.PlayStatic(body.GibSound, filter, coordinates, true, audio);
foreach (var entity in gibs)
{

View File

@@ -19,6 +19,7 @@ using Content.Shared.Random;
using Content.Shared.Tag;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

View File

@@ -10,6 +10,8 @@ using Content.Shared.Stealth;
using Content.Shared.Stealth.Components;
using Content.Shared.Storage.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Timing;

View File

@@ -13,6 +13,8 @@ using Content.Shared.Containers.ItemSlots;
using Content.Shared.Mobs.Components;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;

View File

@@ -4,6 +4,7 @@ using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Shared.Popups;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;

View File

@@ -22,6 +22,7 @@ using Content.Shared.Radio;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Network;
@@ -307,7 +308,7 @@ public sealed partial class ChatSystem : SharedChatSystem
_chatManager.ChatMessageToAll(ChatChannel.Radio, message, wrappedMessage, default, false, true, colorOverride);
if (playSound)
{
SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), AudioParams.Default.WithVolume(-2f));
_audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, Filter.Broadcast(), true, AudioParams.Default.WithVolume(-2f));
}
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Global station announcement from {sender}: {message}");
}
@@ -345,7 +346,7 @@ public sealed partial class ChatSystem : SharedChatSystem
if (playDefaultSound)
{
SoundSystem.Play(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, AudioParams.Default.WithVolume(-2f));
_audio.PlayGlobal(announcementSound?.GetSound() ?? DefaultAnnouncementSound, filter, true, AudioParams.Default.WithVolume(-2f));
}
_adminLogger.Add(LogType.Chat, LogImpact.Low, $"Station Announcement on {station} from {sender}: {message}");

View File

@@ -14,6 +14,7 @@ using Content.Shared.Database;
using Content.Shared.FixedPoint;
using Content.Shared.Storage;
using JetBrains.Annotations;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;

View File

@@ -7,6 +7,8 @@ using Content.Shared.Chemistry;
using Content.Shared.Chemistry.EntitySystems;
using Content.Shared.DoAfter;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Chemistry.EntitySystems;

View File

@@ -10,6 +10,7 @@ using Content.Shared.Database;
using Content.Shared.Emag.Components;
using Content.Shared.Emag.Systems;
using JetBrains.Annotations;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;

View File

@@ -8,6 +8,7 @@ using Content.Shared.FixedPoint;
using Content.Shared.Maps;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -72,7 +73,8 @@ namespace Content.Server.Chemistry.ReactionEffects
var smoke = args.EntityManager.System<SmokeSystem>();
smoke.StartSmoke(ent, splitSolution, _duration, spreadAmount);
args.EntityManager.System<SharedAudioSystem>().PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
var audio = args.EntityManager.System<SharedAudioSystem>();
audio.PlayPvs(_sound, args.SolutionEntity, AudioHelpers.WithVariation(0.125f));
}
}
}

View File

@@ -29,6 +29,8 @@ using Content.Shared.Roles.Jobs;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Containers;
using Robust.Shared.Physics.Components;

View File

@@ -14,6 +14,8 @@ using Content.Server.Emoting.Systems;
using Content.Server.Speech.EntitySystems;
using Content.Shared.Cluwne;
using Content.Shared.Interaction.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Cluwne;

View File

@@ -1,6 +1,7 @@
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Construction.Completions

View File

@@ -25,5 +25,5 @@ public sealed partial class PartExchangerComponent : Component
[DataField("exchangeSound")]
public SoundSpecifier ExchangeSound = new SoundPathSpecifier("/Audio/Items/rped.ogg");
public IPlayingAudioStream? AudioStream;
public EntityUid? AudioStream;
}

View File

@@ -10,6 +10,8 @@ using Content.Shared.Storage;
using Robust.Shared.Containers;
using Robust.Shared.Utility;
using Content.Shared.Wires;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Collections;
namespace Content.Server.Construction;
@@ -34,7 +36,7 @@ public sealed class PartExchangerSystem : EntitySystem
{
if (args.Cancelled)
{
component.AudioStream?.Stop();
component.AudioStream = _audio.Stop(component.AudioStream);
return;
}
@@ -168,7 +170,7 @@ public sealed class PartExchangerSystem : EntitySystem
return;
}
component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid);
component.AudioStream = _audio.PlayPvs(component.ExchangeSound, uid).Value.Entity;
_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, args.User, component.ExchangeDuration, new ExchangerDoAfterEvent(), uid, target: args.Target, used: uid)
{

View File

@@ -11,6 +11,7 @@ using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

View File

@@ -3,6 +3,7 @@ using Content.Server.Stunnable;
using Content.Shared.Damage;
using Content.Shared.Effects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Physics.Events;
using Robust.Shared.Player;
using Robust.Shared.Random;

View File

@@ -12,6 +12,8 @@ using Content.Shared.Popups;
using Content.Shared.Verbs;
using Content.Shared.Wires;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Defusable.Systems;

View File

@@ -15,6 +15,7 @@ using Content.Shared.Database;
using Content.Shared.Destructible;
using Content.Shared.FixedPoint;
using JetBrains.Annotations;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;

View File

@@ -1,5 +1,6 @@
using Content.Shared.Audio;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
namespace Content.Server.Destructible.Thresholds.Behaviors

View File

@@ -1,6 +1,7 @@
using Content.Server.DeviceLinking.Components;
using Content.Server.DeviceLinking.Components.Overload;
using Content.Server.DeviceLinking.Events;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;

View File

@@ -5,7 +5,9 @@ using Content.Shared.Examine;
using Content.Shared.Interaction;
using Content.Shared.Tools;
using Content.Shared.Popups;
using SharedToolSystem = Content.Shared.Tools.Systems.SharedToolSystem;
using Content.Shared.Tools.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using SignalReceivedEvent = Content.Server.DeviceLinking.Events.SignalReceivedEvent;
namespace Content.Server.DeviceLinking.Systems;

View File

@@ -2,6 +2,7 @@ using Content.Server.DeviceLinking.Components;
using Content.Server.DeviceNetwork;
using Content.Shared.Interaction;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.DeviceLinking.Systems;

View File

@@ -4,6 +4,8 @@ using Content.Shared.Access.Systems;
using Content.Shared.MachineLinking;
using Content.Shared.TextScreen;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
namespace Content.Server.DeviceLinking.Systems;

View File

@@ -15,6 +15,7 @@ using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Verbs;
using JetBrains.Annotations;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;

View File

@@ -1,6 +1,8 @@
using Content.Shared.Dice;
using Content.Shared.Popups;
using JetBrains.Annotations;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Dice;

View File

@@ -13,6 +13,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Movement.Events;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Map;
using Robust.Shared.Physics;

View File

@@ -11,6 +11,8 @@ using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager;
using System.Numerics;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Dragon;

View File

@@ -10,6 +10,8 @@ using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Movement.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameStates;
using Robust.Shared.Map;
using Robust.Shared.Player;
@@ -203,7 +205,7 @@ public sealed partial class DragonSystem : EntitySystem
private void Roar(EntityUid uid, DragonComponent comp)
{
if (comp.SoundRoar != null)
_audio.Play(comp.SoundRoar, Filter.Pvs(uid, 4f, EntityManager), uid, true);
_audio.PlayPvs(comp.SoundRoar, uid);
}
/// <summary>

View File

@@ -26,6 +26,7 @@ using Content.Shared.Stunnable;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Physics.Events;
using Robust.Shared.Player;

View File

@@ -50,11 +50,11 @@ public sealed partial class ExplosionSystem : EntitySystem
comp.Intensity = iterationIntensity;
comp.SpaceMatrix = spaceMatrix;
comp.SpaceTileSize = spaceData?.TileSize ?? DefaultTileSize;
Dirty(comp);
Dirty(explosionEntity, comp);
// Light, sound & visuals may extend well beyond normal PVS range. In principle, this should probably still be
// restricted to something like the same map, but whatever.
_pvsSys.AddGlobalOverride(explosionEntity);
_pvsSys.AddGlobalOverride(GetNetEntity(explosionEntity));
var appearance = AddComp<AppearanceComponent>(explosionEntity);
_appearance.SetData(explosionEntity, ExplosionAppearanceData.Progress, 1, appearance);

View File

@@ -20,6 +20,7 @@ using Content.Shared.Throwing;
using Robust.Server.GameStates;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
@@ -48,6 +49,7 @@ public sealed partial class ExplosionSystem : EntitySystem
[Dependency] private readonly IChatManager _chat = default!;
[Dependency] private readonly ThrowingSystem _throwingSystem = default!;
[Dependency] private readonly PvsOverrideSystem _pvsSys = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedTransformSystem _transformSystem = default!;
private EntityQuery<TransformComponent> _transformQuery;
@@ -334,7 +336,7 @@ public sealed partial class ExplosionSystem : EntitySystem
// play sound.
var audioRange = iterationIntensity.Count * 5;
var filter = Filter.Pvs(epicenter).AddInRange(epicenter, audioRange);
SoundSystem.Play(type.Sound.GetSound(), filter, mapEntityCoords, _audioParams);
_audio.PlayStatic(type.Sound.GetSound(), filter, mapEntityCoords, true, _audioParams);
return new Explosion(this,
type,

View File

@@ -24,6 +24,7 @@ using Robust.Shared.Physics.Systems;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Components;
using Content.Shared.Weapons.Ranged.Events;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Explosion.EntitySystems
{

View File

@@ -9,6 +9,7 @@ using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Verbs;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
namespace Content.Server.Extinguisher;
@@ -18,6 +19,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
[Dependency] private readonly SolutionContainerSystem _solutionContainerSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
@@ -86,7 +88,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
var drained = _solutionContainerSystem.Drain(target, targetSolution, transfer);
_solutionContainerSystem.TryAddSolution(uid, container, drained);
SoundSystem.Play(component.RefillSound.GetSound(), Filter.Pvs(uid), uid);
_audio.PlayPvs(component.RefillSound, uid);
_popupSystem.PopupEntity(Loc.GetString("fire-extinguisher-component-after-interact-refilled-message", ("owner", uid)),
uid, args.Target.Value);
}
@@ -135,8 +137,7 @@ public sealed class FireExtinguisherSystem : EntitySystem
return;
extinguisher.Safety = !extinguisher.Safety;
SoundSystem.Play(extinguisher.SafetySound.GetSound(), Filter.Pvs(uid),
uid, AudioHelpers.WithVariation(0.125f).WithVolume(-4f));
_audio.PlayPvs(extinguisher.SafetySound, uid, AudioParams.Default.WithVariation(0.125f).WithVolume(-4f));
UpdateAppearance(uid, extinguisher);
}
}

View File

@@ -19,6 +19,7 @@ using Content.Shared.Interaction;
using Content.Shared.Paper;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;

View File

@@ -15,6 +15,7 @@ using Content.Shared.Physics;
using Content.Shared.Tag;
using Content.Shared.Traits.Assorted;
using Content.Shared.Weapons.Melee.Events;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
@@ -172,7 +173,7 @@ namespace Content.Server.Flash
}
if (sound != null)
{
SoundSystem.Play(sound.GetSound(), Filter.Pvs(transform), source);
_audio.PlayPvs(sound, source);
}
}

View File

@@ -8,6 +8,7 @@ using Content.Shared.Fluids.Components;
using Content.Shared.Interaction;
using Content.Shared.Timing;
using Content.Shared.Weapons.Melee;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Prototypes;
using Robust.Shared.Utility;

View File

@@ -13,6 +13,9 @@ using Content.Shared.Fluids.Components;
using Content.Shared.Interaction;
using Content.Shared.Tag;
using Content.Shared.Verbs;
using Content.Shared.Fluids.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Collections;
using Robust.Shared.Random;
using Robust.Shared.Utility;

View File

@@ -30,6 +30,11 @@ using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Timing;
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Systems;
using Content.Shared.Maps;
using Content.Shared.Effects;
using Robust.Server.Audio;
namespace Content.Server.Fluids.EntitySystems;
@@ -446,8 +451,7 @@ public sealed partial class PuddleSystem : SharedPuddleSystem
return true;
}
SoundSystem.Play(puddleComponent.SpillSound.GetSound(),
Filter.Pvs(puddleUid), puddleUid);
_audio.PlayPvs(puddleComponent.SpillSound, puddleUid);
return true;
}

View File

@@ -12,6 +12,8 @@ using Content.Shared.FixedPoint;
using Content.Shared.Interaction;
using Content.Shared.Vapor;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Physics.Components;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

View File

@@ -8,6 +8,7 @@ using Content.Shared.Forensics;
using Content.Shared.Hands.EntitySystems;
using Content.Shared.Interaction;
using Content.Shared.Verbs;
using Robust.Shared.Audio.Systems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;

View File

@@ -34,7 +34,7 @@ namespace Content.Server.GameTicking
if (args.NewStatus != SessionStatus.Disconnected)
{
mind.Session = session;
_pvsOverride.AddSessionOverride(mindId.Value, session);
_pvsOverride.AddSessionOverride(GetNetEntity(mindId.Value), session);
}
DebugTools.Assert(mind.Session == session);
@@ -122,7 +122,7 @@ namespace Content.Server.GameTicking
_chatManager.SendAdminAnnouncement(Loc.GetString("player-leave-message", ("name", args.Session.Name)));
if (mind != null)
{
_pvsOverride.ClearOverride(mindId!.Value);
_pvsOverride.ClearOverride(GetNetEntity(mindId!.Value));
mind.Session = null;
}

View File

@@ -360,7 +360,7 @@ namespace Content.Server.GameTicking
playerIcName = icName;
if (TryGetEntity(mind.OriginalOwnedEntity, out var entity))
_pvsOverride.AddGlobalOverride(entity.Value, recursive: true);
_pvsOverride.AddGlobalOverride(GetNetEntity(entity.Value), recursive: true);
var roles = _roles.MindGetAllRoles(mindId);
@@ -609,7 +609,7 @@ namespace Content.Server.GameTicking
_chatSystem.DispatchGlobalAnnouncement(Loc.GetString(proto.Message), playSound: true);
if (proto.Sound != null)
SoundSystem.Play(proto.Sound.GetSound(), Filter.Broadcast());
_audio.PlayGlobal(proto.Sound, Filter.Broadcast(), true);
}
private async void SendRoundStartedDiscordMessage()

View File

@@ -19,6 +19,8 @@ using Content.Shared.Roles;
using Robust.Server;
using Robust.Server.GameObjects;
using Robust.Server.GameStates;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Console;
using Robust.Shared.Map;
@@ -61,6 +63,7 @@ namespace Content.Server.GameTicking
[Dependency] private readonly PlayTimeTrackingSystem _playTimeTrackings = default!;
[Dependency] private readonly PvsOverrideSystem _pvsOverride = default!;
[Dependency] private readonly ServerUpdateManager _serverUpdates = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly StationJobsSystem _stationJobs = default!;
[Dependency] private readonly StationSpawningSystem _stationSpawning = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

View File

@@ -44,6 +44,7 @@ using Robust.Server.GameObjects;
using Robust.Server.Maps;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

View File

@@ -15,6 +15,9 @@ using Content.Shared.Preferences;
using Content.Shared.Roles;
using Robust.Server.GameObjects;
using Robust.Server.Maps;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Enums;
using Robust.Shared.Map;

View File

@@ -17,6 +17,9 @@ using Content.Shared.PDA;
using Content.Shared.Preferences;
using Content.Shared.Roles;
using Content.Shared.Roles.Jobs;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;

View File

@@ -22,6 +22,8 @@ using Content.Shared.Roles;
using Content.Shared.Zombies;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Configuration;
using Robust.Shared.Player;
using Robust.Shared.Random;

View File

@@ -7,6 +7,7 @@ using Content.Shared.Teleportation.Systems;
using Content.Shared.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameObjects;
using Robust.Shared.Timing;

View File

@@ -5,6 +5,7 @@ using Content.Shared.Interaction;
using Content.Shared.Tag;
using Content.Shared.Weapons.Melee.Events;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;

View File

@@ -9,6 +9,8 @@ using Content.Shared.Database;
using Content.Shared.Hands;
using Robust.Shared.Timing;
using Content.Shared.Interaction.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
namespace Content.Server.Glue;

View File

@@ -13,6 +13,8 @@ using Content.Shared.Interaction.Events;
using Content.Shared.Mobs;
using Content.Shared.Popups;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Utility;
@@ -194,14 +196,14 @@ namespace Content.Server.Guardian
if (TryComp<GuardianComponent>(guardian, out var guardianComp))
{
guardianComp.Host = args.Args.Target.Value;
_audio.Play("/Audio/Effects/guardian_inject.ogg", Filter.Pvs(args.Args.Target.Value), args.Args.Target.Value, true);
_audio.PlayPvs("/Audio/Effects/guardian_inject.ogg", args.Args.Target.Value);
_popupSystem.PopupEntity(Loc.GetString("guardian-created"), args.Args.Target.Value, args.Args.Target.Value);
// Exhaust the activator
component.Used = true;
}
else
{
Logger.ErrorS("guardian", $"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}");
Log.Error($"Tried to spawn a guardian that doesn't have {nameof(GuardianComponent)}");
EntityManager.QueueDeleteEntity(guardian);
}
@@ -219,12 +221,12 @@ namespace Content.Server.Guardian
if (args.NewMobState == MobState.Critical)
{
_popupSystem.PopupEntity(Loc.GetString("guardian-host-critical-warn"), component.HostedGuardian.Value, component.HostedGuardian.Value);
_audio.Play("/Audio/Effects/guardian_warn.ogg", Filter.Pvs(component.HostedGuardian.Value), component.HostedGuardian.Value, true);
_audio.PlayPvs("/Audio/Effects/guardian_warn.ogg", component.HostedGuardian.Value);
}
else if (args.NewMobState == MobState.Dead)
{
//TODO: Replace WithVariation with datafield
_audio.Play("/Audio/Voice/Human/malescream_guardian.ogg", Filter.Pvs(uid), uid, true, AudioHelpers.WithVariation(0.20f));
_audio.PlayPvs("/Audio/Voice/Human/malescream_guardian.ogg", uid, AudioParams.Default.WithVariation(0.20f));
EntityManager.RemoveComponent<GuardianHostComponent>(uid);
}
}

View File

@@ -4,6 +4,7 @@ using Content.Shared.Database;
using Content.Shared.Examine;
using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Robust.Server.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Components;

View File

@@ -1,6 +1,7 @@
using Content.Server.Explosion.EntitySystems;
using Content.Shared.Timing;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Timing;
namespace Content.Server.IgnitionSource;

View File

@@ -3,6 +3,8 @@ using Content.Server.Popups;
using Content.Shared.Body.Components;
using Content.Shared.Examine;
using Content.Shared.Popups;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;

View File

@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
using Content.Shared.Mobs.Components;
using Content.Shared.Mobs.Systems;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -18,6 +19,7 @@ public sealed class InteractionPopupSystem : EntitySystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly MobStateSystem _mobStateSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
public override void Initialize()
{
@@ -41,15 +43,17 @@ public sealed class InteractionPopupSystem : EntitySystem
if (curTime < component.LastInteractTime + component.InteractDelay)
return;
if (TryComp<MobStateComponent>(uid, out var state) // if it has a MobStateComponent,
&& !_mobStateSystem.IsAlive(uid, state)) // AND if that state is not Alive (e.g. dead/incapacitated/critical)
if (TryComp<MobStateComponent>(uid, out var state)
&& !_mobStateSystem.IsAlive(uid, state))
{
return;
}
// TODO: Should be an attempt event
// TODO: Need to handle pausing with an accumulator.
string msg = ""; // Stores the text to be shown in the popup message
string? sfx = null; // Stores the filepath of the sound to be played
SoundSpecifier? sfx = null; // Stores the filepath of the sound to be played
if (_random.Prob(component.SuccessChance))
{
@@ -57,7 +61,7 @@ public sealed class InteractionPopupSystem : EntitySystem
msg = Loc.GetString(component.InteractSuccessString, ("target", Identity.Entity(uid, EntityManager))); // Success message (localized).
if (component.InteractSuccessSound != null)
sfx = component.InteractSuccessSound.GetSound();
sfx = component.InteractSuccessSound;
if (component.InteractSuccessSpawn != null)
Spawn(component.InteractSuccessSpawn, Transform(uid).MapPosition);
@@ -68,7 +72,7 @@ public sealed class InteractionPopupSystem : EntitySystem
msg = Loc.GetString(component.InteractFailureString, ("target", Identity.Entity(uid, EntityManager))); // Failure message (localized).
if (component.InteractFailureSound != null)
sfx = component.InteractFailureSound.GetSound();
sfx = component.InteractFailureSound;
if (component.InteractFailureSpawn != null)
Spawn(component.InteractFailureSpawn, Transform(uid).MapPosition);
@@ -76,7 +80,7 @@ public sealed class InteractionPopupSystem : EntitySystem
if (component.MessagePerceivedByOthers != null)
{
string msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
var msgOthers = Loc.GetString(component.MessagePerceivedByOthers,
("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager)));
_popupSystem.PopupEntity(msg, uid, args.User);
_popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true);
@@ -87,9 +91,9 @@ public sealed class InteractionPopupSystem : EntitySystem
if (sfx is not null) //not all cases will have sound.
{
if (component.SoundPerceivedByOthers)
SoundSystem.Play(sfx, Filter.Pvs(args.Target), args.Target); //play for everyone in range
_audio.PlayPvs(sfx, args.Target); //play for everyone in range
else
SoundSystem.Play(sfx, Filter.Entities(args.User, args.Target), args.Target); //play only for the initiating entity and its target.
_audio.PlayEntity(sfx, Filter.Entities(args.User, args.Target), args.Target, true); //play only for the initiating entity and its target.
}
component.LastInteractTime = curTime;

View File

@@ -4,6 +4,8 @@ using Content.Shared.Interaction.Events;
using Content.Shared.Item;
using Content.Shared.Toggleable;
using Content.Shared.Tools.Components;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
namespace Content.Server.Weapons.Melee.ItemToggle;
@@ -53,7 +55,7 @@ public sealed class ItemToggleSystem : EntitySystem
if (TryComp<DisarmMalusComponent>(uid, out var malus))
malus.Malus -= comp.ActivatedDisarmMalus;
_audio.Play(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
_audio.PlayEntity(comp.DeActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.DeActivateSound.Params);
comp.Activated = false;
}
@@ -66,7 +68,7 @@ public sealed class ItemToggleSystem : EntitySystem
if (TryComp<DisarmMalusComponent>(uid, out var malus))
malus.Malus += comp.ActivatedDisarmMalus;
_audio.Play(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
_audio.PlayEntity(comp.ActivateSound, Filter.Pvs(uid, entityManager: EntityManager), uid, true, comp.ActivateSound.Params);
comp.Activated = true;
}

View File

@@ -29,7 +29,8 @@ namespace Content.Server.Kitchen.Components
[DataField("ItemBreakSound")]
public SoundSpecifier ItemBreakSound = new SoundPathSpecifier("/Audio/Effects/clang.ogg");
public IPlayingAudioStream? PlayingStream { get; set; }
public EntityUid? PlayingStream;
[DataField("loopingSound")]
public SoundSpecifier LoopingSound = new SoundPathSpecifier("/Audio/Machines/microwave_loop.ogg");
#endregion

View File

@@ -48,7 +48,7 @@ namespace Content.Server.Kitchen.Components
[DataField("juiceSound"), ViewVariables(VVAccess.ReadWrite)]
public SoundSpecifier JuiceSound { get; set; } = new SoundPathSpecifier("/Audio/Machines/juicer.ogg");
public IPlayingAudioStream? AudioStream;
public EntityUid? AudioStream;
}
[Access(typeof(ReagentGrinderSystem)), RegisterComponent]

View File

@@ -16,6 +16,8 @@ using Content.Shared.Nutrition.Components;
using Content.Shared.Popups;
using Content.Shared.Storage;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
using static Content.Shared.Kitchen.Components.KitchenSpikeComponent;
@@ -154,7 +156,7 @@ namespace Content.Server.Kitchen.EntitySystems
QueueDel(gib);
}
_audio.Play(component.SpikeSound, Filter.Pvs(uid), uid, true);
_audio.PlayEntity(component.SpikeSound, Filter.Pvs(uid), uid, true);
}
private bool TryGetPiece(EntityUid uid, EntityUid user, EntityUid used,

View File

@@ -24,6 +24,7 @@ using Content.Shared.Tag;
using Robust.Server.Containers;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
@@ -73,7 +74,7 @@ namespace Content.Server.Kitchen.EntitySystems
SetAppearance(uid, MicrowaveVisualState.Cooking, microwaveComponent);
microwaveComponent.PlayingStream =
_audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5));
_audio.PlayPvs(microwaveComponent.LoopingSound, uid, AudioParams.Default.WithLoop(true).WithMaxDistance(5)).Value.Entity;
}
private void OnCookStop(EntityUid uid, ActiveMicrowaveComponent component, ComponentShutdown args)
@@ -82,7 +83,7 @@ namespace Content.Server.Kitchen.EntitySystems
return;
SetAppearance(uid, MicrowaveVisualState.Idle, microwaveComponent);
microwaveComponent.PlayingStream?.Stop();
microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
}
/// <summary>

View File

@@ -16,6 +16,7 @@ using Content.Shared.Stacks;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Timing;
@@ -64,7 +65,7 @@ namespace Content.Server.Kitchen.EntitySystems
if (active.EndTime > _timing.CurTime)
continue;
reagentGrinder.AudioStream?.Stop();
reagentGrinder.AudioStream = _audioSystem.Stop(reagentGrinder.AudioStream);
RemCompDeferred<ActiveReagentGrinderComponent>(uid);
var inputContainer = _containerSystem.EnsureContainer<Container>(uid, SharedReagentGrinder.InputContainerId);
@@ -284,7 +285,7 @@ namespace Content.Server.Kitchen.EntitySystems
active.Program = program;
reagentGrinder.AudioStream = _audioSystem.PlayPvs(sound, uid,
AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)); //slightly higher pitched
AudioParams.Default.WithPitchScale(1 / reagentGrinder.WorkTimeMultiplier)).Value.Entity; //slightly higher pitched
_userInterfaceSystem.TrySendUiMessage(uid, ReagentGrinderUiKey.Key,
new ReagentGrinderWorkStartedMessage(program));
}

View File

@@ -16,6 +16,8 @@ using Content.Shared.Research.Components;
using Content.Shared.Research.Prototypes;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Prototypes;
using Robust.Shared.Timing;

View File

@@ -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

View File

@@ -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;

View File

@@ -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,

View File

@@ -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;

View File

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

View File

@@ -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

View File

@@ -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;

View File

@@ -7,6 +7,8 @@ using Content.Shared.Interaction;
using Content.Shared.Item;
using Content.Shared.Lube;
using Content.Shared.Popups;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Random;
namespace Content.Server.Lube;

View File

@@ -19,6 +19,7 @@ using Content.Shared.Physics;
using Content.Shared.Storage;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Map;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager;

View File

@@ -17,6 +17,19 @@ using Content.Shared.MassMedia.Components;
using Content.Shared.MassMedia.Systems;
using Content.Shared.PDA;
using Robust.Server.GameObjects;
using System.Linq;
using Content.Server.Administration.Logs;
using Content.Server.CartridgeLoader.Cartridges;
using Content.Shared.CartridgeLoader;
using Content.Shared.CartridgeLoader.Cartridges;
using Content.Server.CartridgeLoader;
using Content.Server.GameTicking;
using Robust.Shared.Timing;
using Content.Server.Popups;
using Content.Server.StationRecords.Systems;
using Content.Shared.Database;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Containers;
using Robust.Shared.Player;
using Robust.Shared.Timing;

Some files were not shown because too many files have changed in this diff Show More