SoundSystem Improvements (#3697)

* Refactor all audio to use the new SoundSystem.

* Update submodule

Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
Acruid
2021-03-21 09:12:03 -07:00
committed by GitHub
parent d4030edff6
commit 9459400002
104 changed files with 401 additions and 279 deletions

View File

@@ -2,7 +2,6 @@
using Content.Client.Interfaces;
using Content.Shared.Audio;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Content.Shared;
using Robust.Shared.Audio;
using Robust.Shared.Configuration;
@@ -13,6 +12,7 @@ using Robust.Shared.Random;
using Robust.Client;
using Robust.Client.State;
using Content.Client.State;
using Robust.Shared.Player;
namespace Content.Client.GameObjects.EntitySystems
{
@@ -26,8 +26,6 @@ namespace Content.Client.GameObjects.EntitySystems
[Dependency] private readonly IBaseClient _client = default!;
[Dependency] private readonly IClientGameTicker _clientGameTicker = default!;
private AudioSystem _audioSystem = default!;
private SoundCollectionPrototype _ambientCollection = default!;
private AudioParams _ambientParams = new(-10f, 1, "Master", 0, 0, AudioMixTarget.Stereo, true, 0f);
@@ -40,8 +38,6 @@ namespace Content.Client.GameObjects.EntitySystems
{
base.Initialize();
_audioSystem = Get<AudioSystem>();
_ambientCollection = _prototypeManager.Index<SoundCollectionPrototype>("AmbienceBase");
_configManager.OnValueChanged(CCVars.AmbienceBasicEnabled, AmbienceCVarChanged);
@@ -130,7 +126,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
EndAmbience();
var file = _robustRandom.Pick(_ambientCollection.PickFiles);
_ambientStream = _audioSystem.Play(file, _ambientParams);
_ambientStream = SoundSystem.Play(Filter.Local(), file, _ambientParams);
}
private void EndAmbience()
@@ -174,7 +170,7 @@ namespace Content.Client.GameObjects.EntitySystems
{
return;
}
_lobbyStream = _audioSystem.Play(file, _lobbyParams);
_lobbyStream = SoundSystem.Play(Filter.Local(), file, _lobbyParams);
}
private void EndLobbyMusic()

View File

@@ -13,10 +13,12 @@ using Content.Shared.Interfaces;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -65,7 +67,7 @@ namespace Content.Server.Actions
if (random.Prob(_failProb))
{
audio.PlayFromEntity("/Audio/Weapons/punchmiss.ogg", args.Performer,
SoundSystem.Play(Filter.Pvs(args.Performer), "/Audio/Weapons/punchmiss.ogg", args.Performer,
AudioHelpers.WithVariation(0.025f));
args.Performer.PopupMessageOtherClients(Loc.GetString("{0} fails to disarm {1}!", args.Performer.Name, args.Target.Name));
args.Performer.PopupMessageCursor(Loc.GetString("You fail to disarm {0}!", args.Target.Name));
@@ -86,7 +88,7 @@ namespace Content.Server.Actions
return;
}
audio.PlayFromEntity("/Audio/Effects/thudswoosh.ogg", args.Performer,
SoundSystem.Play(Filter.Pvs(args.Performer), "/Audio/Effects/thudswoosh.ogg", args.Performer,
AudioHelpers.WithVariation(0.025f));
}
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using Content.Server.GameObjects.Components.Mobs;
@@ -9,10 +9,9 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Preferences;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -47,7 +46,7 @@ namespace Content.Server.Actions
if (_random.Prob(.01f) && !string.IsNullOrWhiteSpace(_wilhelm))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_wilhelm, args.Performer, AudioParams.Default.WithVolume(Volume));
SoundSystem.Play(Filter.Pvs(args.Performer), _wilhelm, args.Performer, AudioParams.Default.WithVolume(Volume));
}
else
{
@@ -55,12 +54,12 @@ namespace Content.Server.Actions
{
case Sex.Male:
if (_male == null) break;
EntitySystem.Get<AudioSystem>().PlayFromEntity(_random.Pick(_male), args.Performer,
SoundSystem.Play(Filter.Pvs(args.Performer), _random.Pick(_male), args.Performer,
AudioHelpers.WithVariation(Variation).WithVolume(Volume));
break;
case Sex.Female:
if (_female == null) break;
EntitySystem.Get<AudioSystem>().PlayFromEntity(_random.Pick(_female), args.Performer,
SoundSystem.Play(Filter.Pvs(args.Performer), _random.Pick(_female), args.Performer,
AudioHelpers.WithVariation(Variation).WithVolume(Volume));
break;
default:

View File

@@ -13,12 +13,14 @@ using Content.Shared.Audio;
using Content.Shared.Maps;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.ViewVariables;
@@ -189,8 +191,11 @@ namespace Content.Server.Atmos
if(PressureDifference > 15)
{
if(_soundCooldown == 0)
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Effects/space_wind.ogg",
GridIndices.ToEntityCoordinates(GridIndex, _mapManager), AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(PressureDifference / 10, 10, 100)));
{
var coordinates = GridIndices.ToEntityCoordinates(GridIndex, _mapManager);
SoundSystem.Play(Filter.Pvs(coordinates), "/Audio/Effects/space_wind.ogg",
coordinates, AudioHelpers.WithVariation(0.125f).WithVolume(MathHelper.Clamp(PressureDifference / 10, 10, 100)));
}
}
foreach (var entity in _gridTileLookupSystem.GetEntitiesIntersecting(GridIndex, GridIndices))

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.Utility;
@@ -6,10 +6,12 @@ using Content.Shared.Audio;
using Content.Shared.Interfaces.Chemistry;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Chemistry.ReactionEffects
@@ -136,7 +138,7 @@ namespace Content.Server.Chemistry.ReactionEffects
if (!string.IsNullOrEmpty(_sound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_sound, solutionEntity, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(solutionEntity), _sound, solutionEntity, AudioHelpers.WithVariation(0.125f));
}
}

View File

@@ -1,10 +1,11 @@
#nullable enable
#nullable enable
using System.Threading.Tasks;
using Content.Shared.Audio;
using Content.Shared.Construction;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Construction.Completions
@@ -22,7 +23,7 @@ namespace Content.Server.Construction.Completions
if (string.IsNullOrEmpty(sound)) return;
EntitySystem.Get<AudioSystem>().PlayFromEntity(sound, entity, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(entity), sound, entity, AudioHelpers.WithVariation(0.125f));
}
private string GetSound()

View File

@@ -11,11 +11,13 @@ using Content.Shared.Physics;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -311,7 +313,7 @@ namespace Content.Server.Explosions
var boundingBox = new Box2(epicenterMapPos - new Vector2(maxRange, maxRange),
epicenterMapPos + new Vector2(maxRange, maxRange));
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Effects/explosion.ogg", epicenter);
SoundSystem.Play(Filter.Broadcast(), "/Audio/Effects/explosion.ogg", epicenter);
DamageEntitiesInRange(epicenter, boundingBox, devastationRange, heavyImpactRange, maxRange, mapId);
var mapGridsNear = mapManager.FindGridsIntersecting(mapId, boundingBox);

View File

@@ -12,11 +12,13 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
@@ -228,15 +230,14 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (isOwner)
{
if (cuff.StartBreakoutSound != null)
audio.PlayFromEntity(cuff.StartBreakoutSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartBreakoutSound, Owner);
}
else
{
if (cuff.StartUncuffSound != null)
audio.PlayFromEntity(cuff.StartUncuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.StartUncuffSound, Owner);
}
var uncuffTime = isOwner ? cuff.BreakoutTime : cuff.UncuffTime;
var doAfterEventArgs = new DoAfterEventArgs(user, uncuffTime)
{
@@ -256,7 +257,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (result != DoAfterStatus.Cancelled)
{
if (cuff.EndUncuffSound != null)
audio.PlayFromEntity(cuff.EndUncuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), cuff.EndUncuffSound, Owner);
Container.ForceRemove(cuffsToRemove);
cuffsToRemove.Transform.AttachToGridOrMap();

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.GUI;
@@ -10,9 +10,11 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -183,7 +185,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
eventArgs.User.PopupMessage(eventArgs.Target, Loc.GetString("{0:theName} starts cuffing you!", eventArgs.User));
if (StartCuffSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(StartCuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), StartCuffSound, Owner);
TryUpdateCuff(eventArgs.User, eventArgs.Target, cuffed);
return true;
@@ -221,7 +223,7 @@ namespace Content.Server.GameObjects.Components.ActionBlocking
if (cuffs.TryAddNewCuffs(user, Owner))
{
if (EndCuffSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(EndCuffSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), EndCuffSound, Owner);
user.PopupMessage(Loc.GetString("You successfully cuff {0:theName}.", target));
target.PopupMessage(Loc.GetString("You have been cuffed by {0:theName}!", user));

View File

@@ -13,6 +13,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -127,7 +128,7 @@ namespace Content.Server.GameObjects.Components.Arcade
_game?.ExecutePlayerAction(msg.PlayerAction);
break;
case PlayerAction.NewGame:
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/newgame.ogg", Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/Arcade/newgame.ogg", Owner, AudioParams.Default.WithVolume(-4f));
_game = new SpaceVillainGame(this);
UserInterface?.SendMessage(_game.GenerateMetaDataMessage());
break;
@@ -293,7 +294,7 @@ namespace Content.Server.GameObjects.Components.Arcade
case PlayerAction.Attack:
var attackAmount = _random.Next(2, 6);
_latestPlayerActionMessage = Loc.GetString("You attack {0} for {1}!", _enemyName, attackAmount);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/player_attack.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/player_attack.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
if(!_owner._enemyInvincibilityFlag) _enemyHp -= attackAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0;
break;
@@ -301,7 +302,7 @@ namespace Content.Server.GameObjects.Components.Arcade
var pointAmount = _random.Next(1, 3);
var healAmount = _random.Next(6, 8);
_latestPlayerActionMessage = Loc.GetString("You use {0} magic to heal for {1} damage!", pointAmount, healAmount);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/player_heal.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/player_heal.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
if(!_owner._playerInvincibilityFlag) _playerMp -= pointAmount;
_playerHp += healAmount;
_turtleTracker++;
@@ -309,7 +310,7 @@ namespace Content.Server.GameObjects.Components.Arcade
case PlayerAction.Recharge:
var chargeAmount = _random.Next(4, 7);
_latestPlayerActionMessage = Loc.GetString("You regain {0} points", chargeAmount);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/player_charge.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/player_charge.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
_playerMp += chargeAmount;
_turtleTracker -= _turtleTracker > 0 ? 1 : 0;
break;
@@ -341,7 +342,7 @@ namespace Content.Server.GameObjects.Components.Arcade
{
_running = false;
UpdateUi(Loc.GetString("You won!"), Loc.GetString("{0} dies.", _enemyName), true);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/win.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/win.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
_owner.ProcessWin();
return false;
}
@@ -352,14 +353,14 @@ namespace Content.Server.GameObjects.Components.Arcade
{
_running = false;
UpdateUi(Loc.GetString("You lost!"), Loc.GetString("{0} cheers.", _enemyName), true);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/gameover.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/gameover.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false;
}
if (_enemyHp <= 0 || _enemyMp <= 0)
{
_running = false;
UpdateUi(Loc.GetString("You lost!"), Loc.GetString("{0} dies, but takes you with him.", _enemyName), true);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/Arcade/gameover.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
SoundSystem.Play(Filter.Pvs(_owner.Owner), "/Audio/Effects/Arcade/gameover.ogg", _owner.Owner, AudioParams.Default.WithVolume(-4f));
return false;
}

View File

@@ -18,9 +18,11 @@ using Content.Shared.Interfaces.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -278,7 +280,7 @@ namespace Content.Server.GameObjects.Components.Atmos
var tileAtmos = Owner.Transform.Coordinates.GetTileAtmosphere();
tileAtmos?.AssumeAir(Air);
EntitySystem.Get<AudioSystem>().PlayAtCoords("Audio/Effects/spray.ogg", Owner.Transform.Coordinates,
SoundSystem.Play(Filter.Pvs(Owner), "Audio/Effects/spray.ogg", Owner.Transform.Coordinates,
AudioHelpers.WithVariation(0.125f));
Owner.Delete();

View File

@@ -10,11 +10,13 @@ using Content.Shared.GameObjects.Components.Movement;
using Content.Shared.Utility;
using Robust.Server.Console;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Console;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Log;
using Robust.Shared.Player;
using Robust.Shared.Players;
namespace Content.Server.GameObjects.Components.Body
@@ -98,8 +100,7 @@ namespace Content.Server.GameObjects.Components.Body
{
base.Gib(gibParts);
EntitySystem.Get<AudioSystem>()
.PlayAtCoords(AudioHelpers.GetRandomFileFromSoundCollection("gib"), Owner.Transform.Coordinates,
SoundSystem.Play(Filter.Pvs(Owner), AudioHelpers.GetRandomFileFromSoundCollection("gib"), Owner.Transform.Coordinates,
AudioHelpers.WithVariation(0.025f));
if (Owner.TryGetComponent(out ContainerManagerComponent? container))

View File

@@ -20,10 +20,12 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -722,8 +724,7 @@ namespace Content.Server.GameObjects.Components.Botany
if (!string.IsNullOrEmpty(spray.SpraySound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(spray.SpraySound, usingItem,
AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(usingItem), spray.SpraySound, usingItem, AudioHelpers.WithVariation(0.125f));
}
}

View File

@@ -15,11 +15,13 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
@@ -241,7 +243,7 @@ namespace Content.Server.GameObjects.Components.Buckle
return false;
}
EntitySystem.Get<AudioSystem>().PlayFromEntity(strap.BuckleSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), strap.BuckleSound, Owner);
if (!strap.TryAdd(this))
{
@@ -348,7 +350,7 @@ namespace Content.Server.GameObjects.Components.Buckle
UpdateBuckleStatus();
oldBuckledTo.Remove(this);
EntitySystem.Get<AudioSystem>().PlayFromEntity(oldBuckledTo.UnbuckleSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), oldBuckledTo.UnbuckleSound, Owner);
SendMessage(new UnbuckleMessage(Owner, oldBuckledTo.Owner));

View File

@@ -5,6 +5,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using System.Collections.Generic;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Cargo
{
@@ -71,7 +72,7 @@ namespace Content.Server.GameObjects.Components.Cargo
{
if (!Deleted && !Owner.Deleted && _currentState == CargoTelepadState.Teleporting && _teleportQueue.Count > 0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/phasein.ogg", Owner, AudioParams.Default.WithVolume(-8f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/phasein.ogg", Owner, AudioParams.Default.WithVolume(-8f));
Owner.EntityManager.SpawnEntity(_teleportQueue[0].Product, Owner.Transform.Coordinates);
_teleportQueue.RemoveAt(0);
if (Owner.TryGetComponent<SpriteComponent>(out var spriteComponent))

View File

@@ -20,6 +20,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -416,7 +417,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
private void ClickSound()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
[Verb]

View File

@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Mobs.State;
using Content.Server.GameObjects.EntitySystems;
@@ -8,9 +8,11 @@ using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -88,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
meleeSys.SendLunge(angle, user);
}
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Items/hypospray.ogg", user);
SoundSystem.Play(Filter.Pvs(user), "/Audio/Items/hypospray.ogg", user);
var targetSolution = target.GetComponent<SolutionContainerComponent>();

View File

@@ -1,4 +1,4 @@
using System.Linq;
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Body.Behavior;
using Content.Server.GameObjects.Components.Culinary;
@@ -13,6 +13,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -104,8 +105,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
if (UseSound != null)
{
_entitySystem.GetEntitySystem<AudioSystem>()
.PlayFromEntity(UseSound, trueTarget, AudioParams.Default.WithVolume(-1f));
SoundSystem.Play(Filter.Pvs(trueTarget), UseSound, trueTarget, AudioParams.Default.WithVolume(-1f));
}
trueTarget.PopupMessage(user, Loc.GetString("You swallow the pill."));

View File

@@ -22,6 +22,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -356,8 +357,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
private void ClickSound()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
[Verb]

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System.Linq;
using System.Threading.Tasks;
using Content.Server.Utility;
@@ -8,10 +8,12 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -133,7 +135,7 @@ namespace Content.Server.GameObjects.Components
if (!string.IsNullOrEmpty(_useSound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_useSound, Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), _useSound, Owner, AudioHelpers.WithVariation(0.125f));
}
// Decrease "Ammo"

View File

@@ -11,6 +11,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -67,7 +68,7 @@ namespace Content.Server.GameObjects.Components.Culinary
}
}
EntitySystem.Get<AudioSystem>().PlayAtCoords(_sound, Owner.Transform.Coordinates,
SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner.Transform.Coordinates,
AudioParams.Default.WithVolume(-2));
Count--;

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Nutrition;
@@ -8,6 +8,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -74,8 +75,7 @@ namespace Content.Server.GameObjects.Components.Culinary
{
if (_breakSound != null && IoCManager.Resolve<IRobustRandom>().Prob(_breakChance))
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(_breakSound, user, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(user), _breakSound, user, AudioParams.Default.WithVolume(-2f));
Owner.Delete();
}
}

View File

@@ -4,10 +4,12 @@ using Content.Shared.Audio;
using Content.Shared.Damage;
using Content.Shared.GameObjects.Components.Damage;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
@@ -51,7 +53,7 @@ namespace Content.Server.GameObjects.Components.Damage
if (speed < MinimumSpeed) return;
if (!string.IsNullOrEmpty(SoundHit))
EntitySystem.Get<AudioSystem>().PlayFromEntity(SoundHit, otherBody.Entity, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
SoundSystem.Play(Filter.Pvs(otherBody.Entity), SoundHit, otherBody.Entity, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
if ((_gameTiming.CurTime - _lastHit).TotalSeconds < DamageCooldown)
return;

View File

@@ -1,7 +1,9 @@
using System;
using System;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behaviors
@@ -23,8 +25,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
}
var pos = owner.Transform.Coordinates;
system.AudioSystem.PlayAtCoords(Sound, pos, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(pos), Sound, pos, AudioHelpers.WithVariation(0.125f));
}
}
}

View File

@@ -1,7 +1,9 @@
using System;
using System;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.Audio;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behaviors
@@ -26,7 +28,7 @@ namespace Content.Server.GameObjects.Components.Destructible.Thresholds.Behavior
var sound = AudioHelpers.GetRandomFileFromSoundCollection(SoundCollection);
var pos = owner.Transform.Coordinates;
system.AudioSystem.PlayAtCoords(sound, pos, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(pos), sound, pos, AudioHelpers.WithVariation(0.125f));
}
}
}

View File

@@ -28,6 +28,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -445,7 +446,7 @@ namespace Content.Server.GameObjects.Components.Disposal
break;
case UiButton.Power:
TogglePower();
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
break;
default:

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using System.Collections.Generic;
using System.Text;
@@ -17,6 +17,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.Disposal.SharedDisposalRouterComponent;
@@ -146,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Disposal
private void ClickSound()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
/// <summary>

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Server.Interfaces.GameObjects.Components.Items;
using Content.Server.Utility;
using Content.Shared.GameObjects.Verbs;
@@ -14,6 +14,7 @@ using Robust.Shared.ViewVariables;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Player;
using static Content.Shared.GameObjects.Components.Disposal.SharedDisposalTaggerComponent;
namespace Content.Server.GameObjects.Components.Disposal
@@ -111,7 +112,7 @@ namespace Content.Server.GameObjects.Components.Disposal
private void ClickSound()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
/// <summary>

View File

@@ -7,11 +7,13 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Robust.Server.Console;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
@@ -257,7 +259,7 @@ namespace Content.Server.GameObjects.Components.Disposal
}
_lastClang = _gameTiming.CurTime;
EntitySystem.Get<AudioSystem>().PlayAtCoords(_clangSound, Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), _clangSound, Owner.Transform.Coordinates);
break;
case AnchoredChangedMessage:

View File

@@ -29,6 +29,7 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
@@ -400,7 +401,7 @@ namespace Content.Server.GameObjects.Components.Disposal
break;
case UiButton.Power:
TogglePower();
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
break;
default:
throw new ArgumentOutOfRangeException();

View File

@@ -8,9 +8,11 @@ using Content.Shared.GameObjects.Components.Doors;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
using static Content.Shared.GameObjects.Components.SharedWiresComponent;
using static Content.Shared.GameObjects.Components.SharedWiresComponent.WiresAction;
@@ -453,8 +455,7 @@ namespace Content.Server.GameObjects.Components.Doors
BoltsDown = newBolts;
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(newBolts ? "/Audio/Machines/boltsdown.ogg" : "/Audio/Machines/boltsup.ogg", Owner);
SoundSystem.Play(Filter.Broadcast(), newBolts ? "/Audio/Machines/boltsdown.ogg" : "/Audio/Machines/boltsup.ogg", Owner);
}
}
}

View File

@@ -28,6 +28,7 @@ using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Physics.Broadphase;
using Robust.Shared.Physics.Collision;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
using Timer = Robust.Shared.Timing.Timer;
@@ -257,7 +258,7 @@ namespace Content.Server.GameObjects.Components.Doors
if (user.TryGetComponent(out HandsComponent? hands) && hands.Count == 0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/bang.ogg", Owner,
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/bang.ogg", Owner,
AudioParams.Default.WithVolume(-2));
}
}

View File

@@ -1,10 +1,12 @@
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.Components.Weapon;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Explosion
@@ -37,7 +39,7 @@ namespace Content.Server.GameObjects.Components.Explosion
if (_sound != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_sound, Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner.Transform.Coordinates);
}
if (_deleteOnFlash && !Owner.Deleted)

View File

@@ -8,9 +8,11 @@ using Content.Shared.GameObjects.Components;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -112,8 +114,8 @@ namespace Content.Server.GameObjects.Components
private void ClickLatchSound()
{
EntitySystem.Get<AudioSystem>() // Don't have original click, this sounds close
.PlayFromEntity(DoorSound, Owner, AudioHelpers.WithVariation(0.15f));
// Don't have original click, this sounds close
SoundSystem.Play(Filter.Pvs(Owner), DoorSound, Owner, AudioHelpers.WithVariation(0.15f));
}
}
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System.Collections.Generic;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Chemistry;
@@ -8,8 +8,10 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Fluids
@@ -114,7 +116,7 @@ namespace Content.Server.GameObjects.Components.Fluids
if (_sound != null)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_sound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner);
}
return true;

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Server.GameObjects.Components.Chemistry;
using Content.Shared.Chemistry;
using Content.Shared.Interfaces;
@@ -10,6 +10,8 @@ using Robust.Shared.Serialization;
using System.Threading.Tasks;
using Content.Server.GameObjects.EntitySystems.DoAfter;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -165,7 +167,7 @@ namespace Content.Server.GameObjects.Components.Fluids
if (!string.IsNullOrWhiteSpace(_pickupSound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_pickupSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _pickupSound, Owner);
}
return true;

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
@@ -11,12 +11,14 @@ using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
@@ -188,7 +190,7 @@ namespace Content.Server.GameObjects.Components.Fluids
return true;
}
EntitySystem.Get<AudioSystem>().PlayAtCoords(_spillSound, Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), _spillSound, Owner.Transform.Coordinates);
return true;
}

View File

@@ -10,11 +10,13 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -162,7 +164,7 @@ namespace Content.Server.GameObjects.Components.Fluids
//Play sound
if (!string.IsNullOrEmpty(_spraySound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_spraySound, Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), _spraySound, Owner, AudioHelpers.WithVariation(0.125f));
}
_lastUseTime = curTime;

View File

@@ -17,6 +17,7 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces;
using Content.Shared.Physics.Pull;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -28,6 +29,7 @@ using Robust.Shared.Network;
using Robust.Shared.Physics;
using Robust.Shared.Players;
using Robust.Shared.ViewVariables;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.GUI
{
@@ -760,7 +762,7 @@ namespace Content.Server.GameObjects.Components.GUI
if (source != null)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/thudswoosh.ogg", source,
SoundSystem.Play(Filter.Pvs(source), "/Audio/Effects/thudswoosh.ogg", source,
AudioHelpers.WithVariation(0.025f));
if (target != null)

View File

@@ -9,6 +9,7 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Interactable
@@ -107,7 +108,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (LitSound != string.Empty)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(LitSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), LitSound, Owner);
}
if (IconStateLit != string.Empty)
@@ -127,7 +128,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (DieSound != string.Empty)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(DieSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), DieSound, Owner);
}
if (LoopedSound != string.Empty && Owner.TryGetComponent<LoopingLoopingSoundComponent>(out var loopSound))

View File

@@ -14,9 +14,11 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -119,7 +121,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (makeNoise)
{
if (TurnOffSound != null) EntitySystem.Get<AudioSystem>().PlayFromEntity(TurnOffSound, Owner);
if (TurnOffSound != null) SoundSystem.Play(Filter.Pvs(Owner), TurnOffSound, Owner);
}
return true;
@@ -134,7 +136,7 @@ namespace Content.Server.GameObjects.Components.Interactable
if (Cell == null)
{
if (TurnOnFailSound != null) EntitySystem.Get<AudioSystem>().PlayFromEntity(TurnOnFailSound, Owner);
if (TurnOnFailSound != null) SoundSystem.Play(Filter.Pvs(Owner), TurnOnFailSound, Owner);
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
UpdateLightAction();
return false;
@@ -145,7 +147,7 @@ namespace Content.Server.GameObjects.Components.Interactable
// Simple enough.
if (Wattage > Cell.CurrentCharge)
{
if (TurnOnFailSound != null) EntitySystem.Get<AudioSystem>().PlayFromEntity(TurnOnFailSound, Owner);
if (TurnOnFailSound != null) SoundSystem.Play(Filter.Pvs(Owner), TurnOnFailSound, Owner);
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
UpdateLightAction();
return false;
@@ -156,7 +158,7 @@ namespace Content.Server.GameObjects.Components.Interactable
SetState(true);
Owner.EntityManager.EventBus.QueueEvent(EventSource.Local, new ActivateHandheldLightMessage(this));
if (TurnOnSound != null) EntitySystem.Get<AudioSystem>().PlayFromEntity(TurnOnSound, Owner);
if (TurnOnSound != null) SoundSystem.Play(Filter.Pvs(Owner), TurnOnSound, Owner);
return true;
}

View File

@@ -1,10 +1,12 @@
#nullable enable
#nullable enable
using System.Threading.Tasks;
using Content.Shared.Audio;
using Content.Shared.GameObjects.Components;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -68,7 +70,7 @@ namespace Content.Server.GameObjects.Components.Interactable
// Play Sound
if (!string.IsNullOrEmpty(_igniteSound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_igniteSound, Owner,
SoundSystem.Play(Filter.Pvs(Owner), _igniteSound, Owner,
AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
}

View File

@@ -3,7 +3,9 @@ using Content.Shared.GameObjects;
using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -44,7 +46,6 @@ namespace Content.Server.GameObjects.Components.Interactable
[DataField("tools")] private List<ToolEntry> _tools = new();
private int _currentTool = 0;
private AudioSystem _audioSystem = default!;
private ToolComponent? _tool;
private SpriteComponent? _sprite;
@@ -53,9 +54,6 @@ namespace Content.Server.GameObjects.Components.Interactable
base.Initialize();
Owner.TryGetComponent(out _tool);
Owner.TryGetComponent(out _sprite);
_audioSystem = EntitySystem.Get<AudioSystem>();
SetTool();
}
@@ -65,7 +63,7 @@ namespace Content.Server.GameObjects.Components.Interactable
SetTool();
var current = _tools[_currentTool];
if(!string.IsNullOrEmpty(current.ChangeSound))
_audioSystem.PlayFromEntity(current.ChangeSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), current.ChangeSound, Owner);
}
private void SetTool()

View File

@@ -5,7 +5,9 @@ using Content.Shared.Audio;
using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -102,8 +104,7 @@ namespace Content.Server.GameObjects.Components.Interactable
}
var file = AudioHelpers.GetRandomFileFromSoundCollection(name);
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
}
public void PlayUseSound(float volume=-5f)
@@ -112,8 +113,7 @@ namespace Content.Server.GameObjects.Components.Interactable
{
if (!string.IsNullOrEmpty(UseSound))
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(UseSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
SoundSystem.Play(Filter.Pvs(Owner), UseSound, Owner, AudioHelpers.WithVariation(0.15f).WithVolume(volume));
}
}
else

View File

@@ -17,9 +17,11 @@ using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
@@ -321,7 +323,7 @@ namespace Content.Server.GameObjects.Components.Interactable
var drained = targetSolution.Drain(trans);
_solutionComponent.TryAddSolution(drained);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/refill.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/refill.ogg", Owner);
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("Welder refueled"));
}
}

View File

@@ -1,4 +1,4 @@
using Content.Shared.Audio;
using Content.Shared.Audio;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
@@ -6,6 +6,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -60,7 +61,7 @@ namespace Content.Server.GameObjects.Components.Items
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
var file = _random.Pick(soundCollection.PickFiles);
EntitySystem.Get<AudioSystem>().PlayFromEntity(file, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default);
}
}

View File

@@ -1,12 +1,14 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Shared.Chemistry;
using Content.Shared.GameObjects.Components.Chemistry;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
#nullable enable
@@ -38,7 +40,7 @@ namespace Content.Server.GameObjects.Components.Items
var drained = targetSolution.Drain(trans);
container.TryAddSolution(drained);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/refill.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/refill.ogg", Owner);
eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("{0:TheName} is now refilled", Owner));
}

View File

@@ -10,6 +10,8 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Audio;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Items
@@ -45,7 +47,7 @@ namespace Content.Server.GameObjects.Components.Items
private void PlaceAt(IMapGrid mapGrid, EntityCoordinates location, ushort tileId, float offset = 0)
{
mapGrid.SetTile(location.Offset(new Vector2(offset, offset)), new Tile(tileId));
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Items/genhit.ogg", location, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(location), "/Audio/Items/genhit.ogg", location, AudioHelpers.WithVariation(0.125f));
}
async Task<bool> IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs)

View File

@@ -8,11 +8,13 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Maps;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -23,7 +25,6 @@ namespace Content.Server.GameObjects.Components.Items.RCD
public class RCDComponent : Component, IAfterInteract, IUse, IExamine
{
[Dependency] private readonly ITileDefinitionManager _tileDefinitionManager = default!;
[Dependency] private readonly IEntitySystemManager _entitySystemManager = default!;
[Dependency] private readonly IMapManager _mapManager = default!;
[Dependency] private readonly IServerEntityManager _serverEntityManager = default!;
@@ -67,7 +68,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
public void SwapMode(UseEntityEventArgs eventArgs)
{
_entitySystemManager.GetEntitySystem<AudioSystem>().PlayFromEntity("/Audio/Items/genhit.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Items/genhit.ogg", Owner);
int mode = (int) _mode; //Firstly, cast our RCDmode mode to an int (enums are backed by ints anyway by default)
mode = (++mode) % _modes.Length; //Then, do a rollover on the value so it doesnt hit an invalid state
_mode = (RcdMode) mode; //Finally, cast the newly acquired int mode to an RCDmode so we can use it.
@@ -148,7 +149,7 @@ namespace Content.Server.GameObjects.Components.Items.RCD
return true; //I don't know why this would happen, but sure I guess. Get out of here invalid state!
}
_entitySystemManager.GetEntitySystem<AudioSystem>().PlayFromEntity("/Audio/Items/deconstruct.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Items/deconstruct.ogg", Owner);
_ammo--;
return true;
}

View File

@@ -1,9 +1,11 @@
using System.Linq;
using System.Linq;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Items.Storage
@@ -45,8 +47,8 @@ namespace Content.Server.GameObjects.Components.Items.Storage
locker.Insert(entity);
}
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/teleport_departure.ogg", Owner, AudioHelpers.WithVariation(0.125f));
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/teleport_arrival.ogg", lockerEnt, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/teleport_departure.ogg", Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(lockerEnt), "/Audio/Effects/teleport_arrival.ogg", lockerEnt, AudioHelpers.WithVariation(0.125f));
}
}
}

View File

@@ -14,6 +14,7 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -21,6 +22,7 @@ using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -223,7 +225,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
}
ModifyComponents();
EntitySystem.Get<AudioSystem>().PlayFromEntity(_closeSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _closeSound, Owner);
_lastInternalOpenAttempt = default;
}
@@ -232,7 +234,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
Open = true;
EmptyContents();
ModifyComponents();
EntitySystem.Get<AudioSystem>().PlayFromEntity(_openSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _openSound, Owner);
}
private void ModifyComponents()

View File

@@ -8,6 +8,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -98,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
if (!CheckAccess(user)) return;
Locked = false;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/door_lock_off.ogg", Owner, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/door_lock_off.ogg", Owner, AudioParams.Default.WithVolume(-5));
}
private void DoLock(IEntity user)
@@ -106,7 +107,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
if (!CheckAccess(user)) return;
Locked = true;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/door_lock_on.ogg", Owner, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/door_lock_on.ogg", Owner, AudioParams.Default.WithVolume(-5));
}
private bool CheckAccess(IEntity user)

View File

@@ -22,6 +22,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -620,8 +621,7 @@ namespace Content.Server.GameObjects.Components.Items.Storage
}
var file = AudioHelpers.GetRandomFileFromSoundCollection(name);
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(file, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default);
}
}
}

View File

@@ -1,9 +1,10 @@
using Content.Shared.Audio;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -35,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Items
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
var file = _random.Pick(soundCollection.PickFiles);
EntitySystem.Get<AudioSystem>().PlayFromEntity(file, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default);
}
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using Content.Server.GameObjects.EntitySystems.DoAfter;
@@ -10,8 +10,10 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Kitchen;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Kitchen
{
@@ -148,7 +150,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
victim.Delete();
if (SpikeSound != null)
EntitySystem.Get<AudioSystem>().PlayFromEntity(SpikeSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), SpikeSound, Owner);
}
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)

View File

@@ -26,6 +26,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -297,7 +298,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
}
SetAppearance(MicrowaveVisualState.Cooking);
_audioSystem.PlayFromEntity(_startCookingSound, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), _startCookingSound, Owner, AudioParams.Default);
Owner.SpawnTimer((int)(_currentCookTimerTime * _cookTimeMultiplier), (Action)(() =>
{
if (_lostPower)
@@ -324,7 +325,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
Owner.EntityManager.SpawnEntity(_badRecipeName, Owner.Transform.Coordinates);
}
}
_audioSystem.PlayFromEntity(_cookingCompleteSound, Owner, AudioParams.Default.WithVolume(-1f));
SoundSystem.Play(Filter.Pvs(Owner), _cookingCompleteSound, Owner, AudioParams.Default.WithVolume(-1f));
SetAppearance(MicrowaveVisualState.Idle);
_busy = false;
@@ -457,7 +458,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
private void ClickSound()
{
_audioSystem.PlayFromEntity("/Audio/Machines/machine_switch.ogg",Owner,AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg",Owner,AudioParams.Default.WithVolume(-2f));
}
SuicideKind ISuicideAct.Suicide(IEntity victim, IChatManager chat)

View File

@@ -19,6 +19,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -164,7 +165,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
private void ClickSound()
{
_audioSystem.PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
private void SetAppearance()
@@ -328,7 +329,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
switch (program)
{
case GrinderProgram.Grind:
_audioSystem.PlayFromEntity("/Audio/Machines/blender.ogg", Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/blender.ogg", Owner, AudioParams.Default);
//Get each item inside the chamber and get the reagents it contains. Transfer those reagents to the beaker, given we have one in.
Owner.SpawnTimer(_workTime, (Action) (() =>
{
@@ -349,7 +350,7 @@ namespace Content.Server.GameObjects.Components.Kitchen
break;
case GrinderProgram.Juice:
_audioSystem.PlayFromEntity("/Audio/Machines/juicer.ogg", Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/juicer.ogg", Owner, AudioParams.Default);
Owner.SpawnTimer(_workTime, (Action) (() =>
{
foreach (var item in _chamber.ContainedEntities.ToList())

View File

@@ -1,4 +1,4 @@
using System.Threading.Tasks;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Weapon.Melee;
using Content.Shared.Damage;
using Content.Shared.GameObjects.Components.Damage;
@@ -7,6 +7,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.Components.Mining
@@ -37,7 +38,7 @@ namespace Content.Server.GameObjects.Components.Mining
if (!item.TryGetComponent(out PickaxeComponent? pickaxeComponent)) return true;
if (!string.IsNullOrWhiteSpace(pickaxeComponent.MiningSound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(pickaxeComponent.MiningSound, Owner, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), pickaxeComponent.MiningSound, Owner, AudioParams.Default);
}
return true;
}

View File

@@ -7,9 +7,12 @@ using Content.Shared.GameObjects.Components.Mobs;
using Content.Shared.GameObjects.Components.Mobs.State;
using Content.Shared.Interfaces;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Random;
using Robust.Shared.Timing;
@@ -56,8 +59,7 @@ namespace Content.Server.GameObjects.Components.Mobs
protected override void OnInteractHand()
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity("/Audio/Effects/thudswoosh.ogg", Owner, AudioHelpers.WithVariation(0.05f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/thudswoosh.ogg", Owner, AudioHelpers.WithVariation(0.05f));
}
bool IDisarmedAct.Disarmed(DisarmedActEventArgs eventArgs)
@@ -72,9 +74,8 @@ namespace Content.Server.GameObjects.Components.Mobs
if (source != null)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/thudswoosh.ogg", source,
SoundSystem.Play(Filter.Pvs(source), "/Audio/Effects/thudswoosh.ogg", source,
AudioHelpers.WithVariation(0.025f));
if (target != null)
{
source.PopupMessageOtherClients(Loc.GetString("{0} pushes {1}!", source.Name, target.Name));

View File

@@ -19,6 +19,8 @@ using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using Robust.Shared.Audio;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Morgue
{
@@ -113,7 +115,7 @@ namespace Content.Server.GameObjects.Components.Morgue
TryOpenStorage(Owner);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/ding.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/ding.ogg", Owner);
}, _cremateCancelToken.Token);
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Server.GameObjects.Components.Items.Storage;
using Content.Server.GameObjects.EntitySystems;
using Content.Shared.GameObjects.Components.Body;
@@ -9,10 +9,12 @@ using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -140,7 +142,7 @@ namespace Content.Server.GameObjects.Components.Morgue
CheckContents();
if(DoSoulBeep && Appearance !=null && Appearance.TryGetData(MorgueVisuals.HasSoul, out bool hasSoul) && hasSoul)
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/Guns/EmptyAlarm/smg_empty_alarm.ogg", Owner);
}
void IExamine.Examine(FormattedMessage message, bool inDetailsRange)

View File

@@ -1,9 +1,10 @@
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Chemistry;
using Content.Server.GameObjects.Components.Fluids;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Nutrition
{
@@ -14,8 +15,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
public void PlaySound()
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(AudioHelpers.GetRandomFileFromSoundCollection("desecration"), Owner,
SoundSystem.Play(Filter.Pvs(Owner), AudioHelpers.GetRandomFileFromSoundCollection("desecration"), Owner,
AudioHelpers.WithVariation(0.125f));
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System.Linq;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Body.Behavior;
@@ -18,6 +18,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -125,7 +126,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollection);
var file = _random.Pick(soundCollection.PickFiles);
EntitySystem.Get<AudioSystem>().PlayFromEntity(file, args.User, AudioParams.Default);
SoundSystem.Play(Filter.Pvs(args.User), file, args.User, AudioParams.Default);
Opened = true;
return false;
}
@@ -217,7 +218,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (!string.IsNullOrEmpty(_useSound))
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_useSound, target, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(target), _useSound, target, AudioParams.Default.WithVolume(-2f));
}
target.PopupMessage(Loc.GetString("Slurp"));
@@ -249,7 +250,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
var solution = interactions.Drain(interactions.DrainAvailable);
solution.SpillAt(Owner, "PuddleSmear");
EntitySystem.Get<AudioSystem>().PlayFromEntity(_burstSound, Owner,
SoundSystem.Play(Filter.Pvs(Owner), _burstSound, Owner,
AudioParams.Default.WithVolume(-4));
}
}

View File

@@ -18,6 +18,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -163,8 +164,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
if (UseSound != null)
{
_entitySystem.GetEntitySystem<AudioSystem>()
.PlayFromEntity(UseSound, trueTarget, AudioParams.Default.WithVolume(-1f));
SoundSystem.Play(Filter.Pvs(trueTarget), UseSound, trueTarget, AudioParams.Default.WithVolume(-1f));
}
trueTarget.PopupMessage(user, Loc.GetString("Nom"));

View File

@@ -19,10 +19,12 @@ using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -300,7 +302,7 @@ namespace Content.Server.GameObjects.Components.PDA
{
_idSlot.Insert(card.Owner);
ContainedID = card;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Weapons/Guns/MagIn/batrifle_magin.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/Guns/MagIn/batrifle_magin.ogg", Owner);
}
/// <summary>
@@ -329,7 +331,7 @@ namespace Content.Server.GameObjects.Components.PDA
_lightOn = !_lightOn;
light.Enabled = _lightOn;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Items/flashlight_toggle.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Items/flashlight_toggle.ogg", Owner);
UpdatePDAUserInterface();
}
@@ -348,7 +350,7 @@ namespace Content.Server.GameObjects.Components.PDA
hands.PutInHandOrDrop(cardItemComponent);
ContainedID = null;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/id_swipe.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/id_swipe.ogg", Owner);
UpdatePDAUserInterface();
}

View File

@@ -1,12 +1,14 @@
#nullable enable
#nullable enable
using System.Linq;
using Content.Server.Explosions;
using Content.Shared.GameObjects.Components.Pointing;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -120,7 +122,7 @@ namespace Content.Server.GameObjects.Components.Pointing
}
Owner.SpawnExplosion(0, 2, 1, 1);
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/explosion.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/explosion.ogg", Owner);
Owner.Delete();
}

View File

@@ -4,10 +4,12 @@ using System.Collections.Generic;
using Content.Shared.GameObjects.Components.Portal;
using Content.Shared.GameObjects.Components.Tag;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision;
using Robust.Shared.Player;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -139,13 +141,12 @@ namespace Content.Server.GameObjects.Components.Portal
}
var position = _connectingTeleporter.Transform.Coordinates;
var soundPlayer = EntitySystem.Get<AudioSystem>();
// Departure
// Do we need to rate-limit sounds to stop ear BLAST?
soundPlayer.PlayAtCoords(_departureSound, entity.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(entity), _departureSound, entity.Transform.Coordinates);
entity.Transform.Coordinates = position;
soundPlayer.PlayAtCoords(_arrivalSound, entity.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(entity), _arrivalSound, entity.Transform.Coordinates);
TryChangeState(PortalState.RecentlyTeleported);
// To stop spam teleporting. Could potentially look at adding a timer to flush this from the portal

View File

@@ -1,15 +1,17 @@
#nullable enable
#nullable enable
using System;
using System.Linq;
using System.Threading.Tasks;
using Content.Shared.GameObjects.Components.Portal;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Player;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -124,8 +126,7 @@ namespace Content.Server.GameObjects.Components.Portal
Owner.SpawnTimer(TimeSpan.FromSeconds(_chargeTime + _cooldown), () => SetState(ItemTeleporterState.Off));
if (_cooldownSound != null)
{
var soundPlayer = EntitySystem.Get<AudioSystem>();
soundPlayer.PlayFromEntity(_cooldownSound, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _cooldownSound, Owner);
}
}
@@ -209,7 +210,6 @@ namespace Content.Server.GameObjects.Components.Portal
{
// Messy maybe?
var targetGrid = user.Transform.Coordinates.WithPosition(vector);
var soundPlayer = EntitySystem.Get<AudioSystem>();
// If portals use those, otherwise just move em over
if (_portalAliveTime > 0.0f)
@@ -229,12 +229,12 @@ namespace Content.Server.GameObjects.Components.Portal
else
{
// Departure
soundPlayer.PlayAtCoords(_departureSound, user.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(user), _departureSound, user.Transform.Coordinates);
// Arrival
user.Transform.AttachToGridOrMap();
user.Transform.WorldPosition = vector;
soundPlayer.PlayAtCoords(_arrivalSound, user.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(user), _arrivalSound, user.Transform.Coordinates);
}
}
}

View File

@@ -4,8 +4,10 @@ using Content.Shared.Audio;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components
@@ -44,8 +46,7 @@ namespace Content.Server.GameObjects.Components
private void Rustle()
{
EntitySystem.Get<AudioSystem>()
.PlayFromEntity("/Audio/Effects/plant_rustle.ogg", Owner, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/plant_rustle.ogg", Owner, AudioHelpers.WithVariation(0.25f));
}
}
}

View File

@@ -18,6 +18,7 @@ using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Power.AME
@@ -319,14 +320,12 @@ namespace Content.Server.GameObjects.Components.Power.AME
private void ClickSound()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
private void InjectSound(bool overloading)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Effects/bang.ogg", Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/bang.ogg", Owner, AudioParams.Default.WithVolume(overloading ? 10f : 0f));
}
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs args)

View File

@@ -7,10 +7,12 @@ using Content.Shared.GameObjects.Components.Interactable;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Power.AME
{
@@ -48,7 +50,7 @@ namespace Content.Server.GameObjects.Components.Power.AME
var ent = _serverEntityManager.SpawnEntity("AMEShielding", mapGrid.GridTileToLocal(snapPos));
ent.Transform.LocalRotation = Owner.Transform.LocalRotation;
EntitySystem.Get<AudioSystem>().PlayFromEntity(_unwrap, Owner);
SoundSystem.Play(Filter.Pvs(Owner), _unwrap, Owner);
Owner.Delete();

View File

@@ -12,6 +12,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -89,7 +90,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents
{
MainBreakerEnabled = !MainBreakerEnabled;
_uiDirty = true;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/machine_switch.ogg", Owner, AudioParams.Default.WithVolume(-2f));
}
else
{

View File

@@ -4,9 +4,11 @@ using Content.Shared.Audio;
using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -131,7 +133,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>("GlassBreak");
var file = _random.Pick(soundCollection.PickFiles);
EntitySystem.Get<AudioSystem>().PlayFromEntity(file, Owner);
SoundSystem.Play(Filter.Pvs(Owner), file, Owner);
}
}
}

View File

@@ -19,6 +19,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -115,8 +116,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
{
Owner.PopupMessage(eventArgs.User, Loc.GetString("You burn your hand!"));
damageableComponent.ChangeDamage(DamageType.Heat, 20, false, Owner);
var audioSystem = EntitySystem.Get<AudioSystem>();
audioSystem.PlayFromEntity("/Audio/Effects/lightburn.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/lightburn.ogg", Owner);
}
void Eject()
@@ -201,7 +201,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece
if (time > _lastThunk + _thunkDelay)
{
_lastThunk = time;
EntitySystem.Get<AudioSystem>().PlayFromEntity("/Audio/Machines/light_tube_on.ogg", Owner, AudioParams.Default.WithVolume(-10f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Machines/light_tube_on.ogg", Owner, AudioParams.Default.WithVolume(-10f));
}
}
else

View File

@@ -7,9 +7,11 @@ using Content.Shared.GameObjects.EntitySystems;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.GameObjects.Verbs;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -146,7 +148,7 @@ namespace Content.Server.GameObjects.Components.Power
if (playSound && CellRemoveSound != null)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(CellRemoveSound, Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), CellRemoveSound, Owner, AudioHelpers.WithVariation(0.125f));
}
SendMessage(new PowerCellChangedMessage(true));
return cell;
@@ -168,7 +170,7 @@ namespace Content.Server.GameObjects.Components.Power
//Dirty();
if (playSound && CellInsertSound != null)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(CellInsertSound, Owner, AudioHelpers.WithVariation(0.125f));
SoundSystem.Play(Filter.Pvs(Owner), CellInsertSound, Owner, AudioHelpers.WithVariation(0.125f));
}
SendMessage(new PowerCellChangedMessage(false));
return true;

View File

@@ -2,11 +2,13 @@ using System;
using Content.Shared.Damage;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Player;
using Robust.Shared.Timing;
namespace Content.Server.GameObjects.Components.Projectiles
@@ -82,7 +84,8 @@ namespace Content.Server.GameObjects.Components.Projectiles
{
// TODO: No wall component so ?
var offset = angle.ToVec().Normalized / 2;
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundHitWall, user.Transform.Coordinates.Offset(offset));
var coordinates = user.Transform.Coordinates.Offset(offset);
SoundSystem.Play(Filter.Pvs(coordinates), _soundHitWall, coordinates);
}
Owner.SpawnTimer((int) _deathTime.TotalMilliseconds, () =>

View File

@@ -4,9 +4,11 @@ using Content.Shared.Damage;
using Content.Shared.GameObjects.Components.Damage;
using Content.Shared.GameObjects.Components.Projectiles;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Collision;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -63,13 +65,15 @@ namespace Content.Server.GameObjects.Components.Projectiles
return;
}
var coordinates = otherBody.Entity.Transform.Coordinates;
var playerFilter = Filter.Pvs(coordinates);
if (otherBody.Entity.TryGetComponent(out IDamageableComponent? damage) && _soundHitSpecies != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundHitSpecies, otherBody.Entity.Transform.Coordinates);
SoundSystem.Play(playerFilter, _soundHitSpecies, coordinates);
}
else if (_soundHit != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundHit, otherBody.Entity.Transform.Coordinates);
SoundSystem.Play(playerFilter, _soundHit, coordinates);
}
if (damage != null)

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using Content.Server.GameObjects.Components.Power.ApcNetComponents;
using Content.Server.Utility;
using Content.Shared.Audio;
@@ -10,6 +10,7 @@ using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.ViewVariables;
@@ -124,8 +125,7 @@ namespace Content.Server.GameObjects.Components.Research
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(SoundCollectionName);
var file = _random.Pick(soundCollection.PickFiles);
var audioSystem = EntitySystem.Get<AudioSystem>();
audioSystem.PlayFromEntity(file,Owner,AudioParams.Default);
SoundSystem.Play(Filter.Pvs(Owner), file,Owner,AudioParams.Default);
}
}
}

View File

@@ -12,10 +12,12 @@ using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Log;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -257,7 +259,7 @@ namespace Content.Server.GameObjects.Components.Singularity
// TODO: Move to projectile's code.
Timer.Spawn(3000, () => projectile.Delete());
EntitySystem.Get<AudioSystem>().PlayFromEntity(_fireSound, Owner,
SoundSystem.Play(Filter.Pvs(Owner), _fireSound, Owner,
AudioHelpers.WithVariation(Variation).WithVolume(Volume).WithMaxDistance(Distance));
}

View File

@@ -17,6 +17,7 @@ using Robust.Shared.Physics.Dynamics.Shapes;
using Robust.Shared.Random;
using Robust.Server.GameObjects;
using Content.Shared.GameObjects.Components.Singularity;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Timing;
@@ -98,7 +99,6 @@ namespace Content.Server.GameObjects.Components.Singularity
private PhysicsComponent? _collidableComponent;
private SpriteComponent? _spriteComponent;
private RadiationPulseComponent? _radiationPulseComponent;
private AudioSystem _audioSystem = null!;
private IPlayingAudioStream? _playingSound;
public override ComponentState GetComponentState(ICommonSession player)
@@ -110,13 +110,12 @@ namespace Content.Server.GameObjects.Components.Singularity
{
base.Initialize();
_audioSystem = EntitySystem.Get<AudioSystem>();
var audioParams = AudioParams.Default;
audioParams.Loop = true;
audioParams.MaxDistance = 20f;
audioParams.Volume = 5;
_audioSystem.PlayFromEntity("/Audio/Effects/singularity_form.ogg", Owner);
Timer.Spawn(5200,() => _playingSound = _audioSystem.PlayFromEntity("/Audio/Effects/singularity.ogg", Owner, audioParams));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/singularity_form.ogg", Owner);
Timer.Spawn(5200,() => _playingSound = SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/singularity.ogg", Owner, audioParams));
if (!Owner.TryGetComponent(out _spriteComponent))
Logger.Error("SingularityComponent was spawned without SpriteComponent");
@@ -163,7 +162,7 @@ namespace Content.Server.GameObjects.Components.Singularity
public override void OnRemove()
{
_playingSound?.Stop();
_audioSystem.PlayAtCoords("/Audio/Effects/singularity_collapse.ogg", Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/singularity_collapse.ogg", Owner.Transform.Coordinates);
base.OnRemove();
}
}

View File

@@ -1,8 +1,8 @@
using Content.Shared.Audio;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.GameObjects.Components.Sound
@@ -28,9 +28,9 @@ namespace Content.Server.GameObjects.Components.Sound
{
if (_pitchVariation > 0.0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
}
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioParams.Default.WithVolume(-2f));
}
}

View File

@@ -1,8 +1,8 @@
using Content.Shared.Audio;
using Content.Shared.Audio;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -28,15 +28,15 @@ namespace Content.Server.GameObjects.Components.Sound
{
if (_pitchVariation > 0.0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithVariation(_pitchVariation).WithVolume(-2f));
return true;
}
if (_semitoneVariation > 0)
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioHelpers.WithSemitoneVariation(_semitoneVariation).WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioHelpers.WithSemitoneVariation(_semitoneVariation).WithVolume(-2f));
return true;
}
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundName, Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundName, Owner, AudioParams.Default.WithVolume(-2f));
return true;
}
return false;

View File

@@ -1,8 +1,9 @@
using Content.Shared.Audio;
using Content.Shared.Audio;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -30,7 +31,7 @@ namespace Content.Server.GameObjects.Components.Sound
{
var soundCollection = _prototypeManager.Index<SoundCollectionPrototype>(_soundCollectionName);
var file = _footstepRandom.Pick(soundCollection.PickFiles);
EntitySystem.Get<AudioSystem>().PlayFromEntity(file, Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), file, Owner, AudioParams.Default.WithVolume(-2f));
}
}
}

View File

@@ -1,8 +1,10 @@
using System;
using Content.Shared.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Random;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -92,7 +94,7 @@ namespace Content.Server.GameObjects.Components.StationEvents
}
if(!string.IsNullOrEmpty(Sound))
EntitySystem.Get<AudioSystem>().PlayAtCoords(Sound, Owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(Owner), Sound, Owner.Transform.Coordinates);
Dirty();
}

View File

@@ -14,6 +14,7 @@ using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -187,7 +188,7 @@ namespace Content.Server.GameObjects.Components.VendingMachines
Owner.EntityManager.SpawnEntity(id, Owner.Transform.Coordinates);
});
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundVend, Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundVend, Owner, AudioParams.Default.WithVolume(-2f));
}
private void TryEject(string id, IEntity? sender)
@@ -206,7 +207,7 @@ namespace Content.Server.GameObjects.Components.VendingMachines
private void Deny()
{
EntitySystem.Get<AudioSystem>().PlayFromEntity(_soundDeny, Owner, AudioParams.Default.WithVolume(-2f));
SoundSystem.Play(Filter.Pvs(Owner), _soundDeny, Owner, AudioParams.Default.WithVolume(-2f));
// Play the Deny animation
TrySetVisualState(VendingMachineVisualState.Deny);

View File

@@ -21,6 +21,8 @@ using Robust.Shared.Random;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
using System.Threading.Tasks;
using Robust.Shared.Audio;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.Components.Watercloset
{
@@ -124,8 +126,7 @@ namespace Content.Server.GameObjects.Components.Watercloset
public void ToggleToiletSeat()
{
IsSeatUp = !IsSeatUp;
EntitySystem.Get<AudioSystem>()
.PlayFromEntity("/Audio/Effects/toilet_seat_down.ogg", Owner, AudioHelpers.WithVariation(0.05f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/toilet_seat_down.ogg", Owner, AudioHelpers.WithVariation(0.05f));
UpdateSprite();
}

View File

@@ -3,8 +3,10 @@ using Content.Shared.GameObjects.Components.Weapons;
using Content.Shared.Physics;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Timing;
@@ -42,7 +44,7 @@ namespace Content.Server.GameObjects.Components.Weapon
if (!string.IsNullOrEmpty(sound))
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(sound, source.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(source), sound, source.Transform.Coordinates);
}
}
}

View File

@@ -8,6 +8,7 @@ using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
using Robust.Shared.ViewVariables;
@@ -98,7 +99,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
});
}
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Weapons/flash.ogg", Owner.Transform.Coordinates,
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/flash.ogg", Owner.Transform.Coordinates,
AudioParams.Default);
return true;

View File

@@ -8,11 +8,13 @@ using Content.Shared.GameObjects.Components.Items;
using Content.Shared.Interfaces.GameObjects.Components;
using Content.Shared.Physics;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Physics.Broadphase;
using Robust.Shared.Player;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
using Robust.Shared.ViewVariables;
@@ -86,14 +88,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
// This should really be improved. GetEntitiesInArc uses pos instead of bounding boxes.
var entities = ArcRayCast(eventArgs.User.Transform.WorldPosition, angle, eventArgs.User);
var audioSystem = EntitySystem.Get<AudioSystem>();
if (entities.Count != 0)
{
audioSystem.PlayFromEntity(_hitSound, entities.First());
SoundSystem.Play(Filter.Pvs(Owner), _hitSound, entities.First());
}
else
{
audioSystem.PlayFromEntity(_missSound, eventArgs.User);
SoundSystem.Play(Filter.Pvs(Owner), _missSound, eventArgs.User);
}
var hitEntities = new List<IEntity>();
@@ -141,14 +142,13 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
var diff = eventArgs.ClickLocation.ToMapPos(Owner.EntityManager) - location.ToMapPos(Owner.EntityManager);
var angle = Angle.FromWorldVec(diff);
var audioSystem = EntitySystem.Get<AudioSystem>();
if (target != null)
{
audioSystem.PlayFromEntity(_hitSound, target);
SoundSystem.Play(Filter.Pvs(Owner), _hitSound, target);
}
else
{
audioSystem.PlayFromEntity(_missSound, eventArgs.User);
SoundSystem.Play(Filter.Pvs(Owner), _missSound, eventArgs.User);
return false;
}

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System.Collections.Generic;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Items.Storage;
@@ -10,9 +10,11 @@ using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -86,27 +88,31 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (!Cell.TryUseCharge(EnergyPerUse))
return true;
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Weapons/egloves.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/egloves.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
foreach (var entity in entities)
{
if (!entity.TryGetComponent(out StunnableComponent? stunnable)) continue;
if(!stunnable.SlowedDown)
{
if(_robustRandom.Prob(_paralyzeChanceNoSlowdown))
stunnable.Paralyze(_paralyzeTime);
else
stunnable.Slowdown(_slowdownTime);
}
else
{
if(_robustRandom.Prob(_paralyzeChanceWithSlowdown))
stunnable.Paralyze(_paralyzeTime);
else
stunnable.Slowdown(_slowdownTime);
}
}
if (!(Cell.CurrentCharge < EnergyPerUse)) return true;
EntitySystem.Get<AudioSystem>().PlayAtCoords(AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
TurnOff();
return true;
@@ -137,7 +143,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
var sprite = Owner.GetComponent<SpriteComponent>();
var item = Owner.GetComponent<ItemComponent>();
EntitySystem.Get<AudioSystem>().PlayAtCoords(AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "off";
sprite.LayerSetState(0, "stunbaton_off");
@@ -154,9 +160,10 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
var sprite = Owner.GetComponent<SpriteComponent>();
var item = Owner.GetComponent<ItemComponent>();
var playerFilter = Filter.Pvs(Owner);
if (Cell == null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, "/Audio/Machines/button.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
Owner.PopupMessage(user, Loc.GetString("Cell missing..."));
return;
@@ -164,12 +171,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (Cell.CurrentCharge < EnergyPerUse)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Machines/button.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, "/Audio/Machines/button.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
Owner.PopupMessage(user, Loc.GetString("Dead cell..."));
return;
}
EntitySystem.Get<AudioSystem>().PlayAtCoords(AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(playerFilter, AudioHelpers.GetRandomFileFromSoundCollection("sparks"), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
item.EquippedPrefix = "on";
sprite.LayerSetState(0, "stunbaton_on");
@@ -204,7 +211,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Melee
if (!Activated || Cell == null || !Cell.TryUseCharge(EnergyPerUse) || !eventArgs.Target.TryGetComponent(out StunnableComponent? stunnable))
return;
EntitySystem.Get<AudioSystem>().PlayAtCoords("/Audio/Weapons/egloves.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/egloves.ogg", Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.25f));
stunnable.Paralyze(_paralyzeTime);
}

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition;
using Content.Shared.GameObjects;
@@ -14,6 +14,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
@@ -69,14 +70,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
return;
}
var soundSystem = EntitySystem.Get<AudioSystem>();
if (value)
{
TryEjectChamber();
if (_soundBoltOpen != null)
{
soundSystem.PlayAtCoords(_soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
else
@@ -84,7 +83,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
TryFeedChamber();
if (_soundBoltClosed != null)
{
soundSystem.PlayAtCoords(_soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
@@ -226,7 +225,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (!string.IsNullOrEmpty(_soundCycle))
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundCycle, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundCycle, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
@@ -258,7 +257,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
_chamberContainer.Insert(ammo);
if (_soundInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
Dirty();
UpdateAppearance();
@@ -271,7 +270,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
_spawnedAmmo.Push(ammo);
if (_soundInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
Dirty();
UpdateAppearance();

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition;
using Content.Shared.GameObjects;
@@ -11,6 +11,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -189,7 +190,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (!string.IsNullOrEmpty(_soundCycle))
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundCycle, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundCycle, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
@@ -218,7 +219,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
UpdateAppearance();
if (_soundInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
return true;
}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Threading.Tasks;
using Content.Server.GameObjects.Components.Weapon.Ranged.Ammunition;
using Content.Shared.GameObjects;
@@ -14,6 +14,7 @@ using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -164,7 +165,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
_ammoContainer.Insert(entity);
if (_soundInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
Dirty();
@@ -194,7 +195,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
_currentSlot = random;
if (!string.IsNullOrEmpty(_soundSpin))
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundSpin, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundSpin, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
Dirty();
}
@@ -248,7 +249,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_soundEject != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-1));
SoundSystem.Play(Filter.Pvs(Owner), _soundEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-1));
}
}

View File

@@ -17,6 +17,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
@@ -221,7 +222,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
if (_soundPowerCellInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundPowerCellInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
_powerCellContainer.Insert(entity);
@@ -274,7 +275,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
if (_soundPowerCellEject != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundPowerCellEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundPowerCellEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
return true;
}

View File

@@ -18,6 +18,7 @@ using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Map;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Utility;
@@ -92,14 +93,12 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
return;
}
var soundSystem = EntitySystem.Get<AudioSystem>();
if (value)
{
TryEjectChamber();
if (_soundBoltOpen != null)
{
soundSystem.PlayAtCoords(_soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
else
@@ -107,7 +106,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
TryFeedChamber();
if (_soundBoltClosed != null)
{
soundSystem.PlayAtCoords(_soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
@@ -225,13 +224,11 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
TryFeedChamber();
var soundSystem = EntitySystem.Get<AudioSystem>();
if (_chamberContainer.ContainedEntity == null && !BoltOpen)
{
if (_soundBoltOpen != null)
{
soundSystem.PlayAtCoords(_soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltOpen, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5));
}
if (Owner.TryGetContainer(out var container))
@@ -246,7 +243,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_soundRack != null)
{
soundSystem.PlayAtCoords(_soundRack, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundRack, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
}
@@ -274,7 +271,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_soundBoltClosed != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5));
SoundSystem.Play(Filter.Pvs(Owner), _soundBoltClosed, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-5));
}
Owner.PopupMessage(eventArgs.User, Loc.GetString("Bolt closed"));
BoltOpen = false;
@@ -328,8 +325,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_soundAutoEject != null)
{
var soundSystem = EntitySystem.Get<AudioSystem>();
soundSystem.PlayAtCoords(_soundAutoEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundAutoEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
_magazineContainer.Remove(magazine);
@@ -356,7 +352,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
_magazineContainer.Remove(mag);
if (_soundMagEject != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundMagEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundMagEject, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
if (user.TryGetComponent(out HandsComponent? handsComponent))
@@ -395,7 +391,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels
{
if (_soundMagInsert != null)
{
EntitySystem.Get<AudioSystem>().PlayAtCoords(_soundMagInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
SoundSystem.Play(Filter.Pvs(Owner), _soundMagInsert, Owner.Transform.Coordinates, AudioParams.Default.WithVolume(-2));
}
Owner.PopupMessage(eventArgs.User, Loc.GetString("Magazine inserted"));
_magazineContainer.Insert(eventArgs.Using);

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Content.Server.GameObjects.Components.GUI;
using Content.Server.GameObjects.Components.Mobs;
using Content.Server.GameObjects.Components.Weapon.Ranged.Barrels;
@@ -8,7 +8,6 @@ using Content.Shared.GameObjects.Components.Weapons.Ranged;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.Interfaces;
using Content.Shared.Interfaces.GameObjects.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -17,6 +16,7 @@ using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Network;
using Robust.Shared.Player;
using Robust.Shared.Players;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.Timing;
@@ -151,12 +151,11 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged
if (ClumsyCheck && ClumsyComponent.TryRollClumsy(user, ClumsyExplodeChance))
{
var soundSystem = EntitySystem.Get<AudioSystem>();
soundSystem.PlayAtCoords("/Audio/Items/bikehorn.ogg",
Owner.Transform.Coordinates, AudioParams.Default, 5);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Items/bikehorn.ogg",
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
soundSystem.PlayAtCoords("/Audio/Weapons/Guns/Gunshots/bang.ogg",
Owner.Transform.Coordinates, AudioParams.Default, 5);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Weapons/Guns/Gunshots/bang.ogg",
Owner.Transform.Coordinates, AudioParams.Default.WithMaxDistance(5));
if (user.TryGetComponent(out IDamageableComponent? health))
{

View File

@@ -1,4 +1,4 @@
#nullable enable
#nullable enable
using System;
using Content.Server.Utility;
using Content.Shared.Audio;
@@ -10,9 +10,11 @@ using Content.Server.GameObjects.Components.Destructible;
using Content.Server.GameObjects.Components.Destructible.Thresholds.Triggers;
using Content.Shared.Utility;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Timing;
@@ -129,8 +131,8 @@ namespace Content.Server.GameObjects.Components
return false;
}
EntitySystem.Get<AudioSystem>()
.PlayAtCoords("/Audio/Effects/glass_knock.ogg", eventArgs.Target.Transform.Coordinates, AudioHelpers.WithVariation(0.05f));
SoundSystem.Play(Filter.Pvs(eventArgs.Target), "/Audio/Effects/glass_knock.ogg",
eventArgs.Target.Transform.Coordinates, AudioHelpers.WithVariation(0.05f));
eventArgs.Target.PopupMessageEveryone(Loc.GetString("comp-window-knock"));
_lastKnockTime = _gameTiming.CurTime;

View File

@@ -17,9 +17,11 @@ using Content.Shared.Utility;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Localization;
using Robust.Shared.Player;
using Robust.Shared.Prototypes;
using Robust.Shared.Random;
using Robust.Shared.Serialization;
@@ -448,7 +450,7 @@ namespace Content.Server.GameObjects.Components
return;
}
_audioSystem.PlayFromEntity("/Audio/Effects/multitool_pulse.ogg", Owner);
SoundSystem.Play(Filter.Pvs(Owner), "/Audio/Effects/multitool_pulse.ogg", Owner);
break;
}
@@ -498,8 +500,7 @@ namespace Content.Server.GameObjects.Components
else if (await tool.UseTool(eventArgs.User, Owner, 0.5f, ToolQuality.Screwing))
{
IsPanelOpen = !IsPanelOpen;
EntitySystem.Get<AudioSystem>()
.PlayFromEntity(IsPanelOpen ? "/Audio/Machines/screwdriveropen.ogg" : "/Audio/Machines/screwdriverclose.ogg",
SoundSystem.Play(Filter.Pvs(Owner), IsPanelOpen ? "/Audio/Machines/screwdriveropen.ogg" : "/Audio/Machines/screwdriverclose.ogg",
Owner);
return true;
}

View File

@@ -1,8 +1,9 @@
#nullable enable
using Content.Shared.Chemistry;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.Player;
namespace Content.Server.GameObjects.EntitySystems.NewFolder
{
@@ -13,7 +14,7 @@ namespace Content.Server.GameObjects.EntitySystems.NewFolder
base.OnReaction(reaction, owner, unitReactions);
if (reaction.Sound != null)
Get<AudioSystem>().PlayAtCoords(reaction.Sound, owner.Transform.Coordinates);
SoundSystem.Play(Filter.Pvs(owner), reaction.Sound, owner.Transform.Coordinates);
}
}
}

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using System.Linq;
using Content.Server.GameObjects.Components.Gravity;
using Content.Server.GameObjects.Components.Mobs;
@@ -7,10 +7,12 @@ using Content.Shared.GameObjects.EntitySystemMessages.Gravity;
using JetBrains.Annotations;
using Robust.Server.GameObjects;
using Robust.Server.Player;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Maths;
using Robust.Shared.Player;
using Robust.Shared.Random;
namespace Content.Server.GameObjects.EntitySystems
@@ -101,7 +103,7 @@ namespace Content.Server.GameObjects.EntitySystems
{
if (player.AttachedEntity == null
|| player.AttachedEntity.Transform.GridID != gridId) continue;
Get<AudioSystem>().PlayFromEntity("/Audio/Effects/alert.ogg", player.AttachedEntity);
SoundSystem.Play(Filter.Pvs(player.AttachedEntity), "/Audio/Effects/alert.ogg", player.AttachedEntity);
}
}

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