using Content.Server.DeviceLinking.Components.Overload; using Robust.Server.Audio; using Robust.Shared.Audio; using Content.Shared.DeviceLinking.Events; namespace Content.Server.DeviceLinking.Systems; public sealed partial class DeviceLinkOverloadSystem : EntitySystem { [Dependency] private AudioSystem _audioSystem = default!; public override void Initialize() { SubscribeLocalEvent(OnOverloadSound); SubscribeLocalEvent(OnOverloadSpawn); } private void OnOverloadSound(EntityUid uid, SoundOnOverloadComponent component, ref DeviceLinkOverloadedEvent args) { var audioParams = component.OverloadSound?.Params ?? AudioParams.Default; audioParams = audioParams.AddVolume(component.VolumeModifier); _audioSystem.PlayPvs(component.OverloadSound, uid, audioParams); } private void OnOverloadSpawn(EntityUid uid, SpawnOnOverloadComponent component, ref DeviceLinkOverloadedEvent args) { Spawn(component.Prototype, Transform(uid).Coordinates); } }