Content audio (#20862)

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

View File

@@ -2,6 +2,7 @@ using Content.Server.Nutrition.Components;
using Content.Server.Popups;
using Content.Shared.Interaction;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.Player;
using Robust.Shared.Random;
@@ -15,6 +16,7 @@ namespace Content.Server.Nutrition.EntitySystems
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly FoodSystem _foodSystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly SharedAudioSystem _audio = default!;
[Dependency] private readonly SharedInteractionSystem _interactionSystem = default!;
public override void Initialize()
@@ -66,8 +68,8 @@ namespace Content.Server.Nutrition.EntitySystems
if (_robustRandom.Prob(component.BreakChance))
{
SoundSystem.Play(component.BreakSound.GetSound(), Filter.Pvs(userUid), userUid, AudioParams.Default.WithVolume(-2f));
EntityManager.DeleteEntity(component.Owner);
_audio.PlayPvs(component.BreakSound, userUid, AudioParams.Default.WithVolume(-2f));
EntityManager.DeleteEntity(uid);
}
}
}