From fa73217b527d1bf2e6ba6547c2ef2c439626a981 Mon Sep 17 00:00:00 2001 From: Winkarst <74284083+Winkarst-cpu@users.noreply.github.com> Date: Mon, 24 Feb 2025 00:53:04 +0300 Subject: [PATCH] Cleanup: Use ``SoundSpecifier`` instead of string literals in ``VomitSystem`` (#35426) * Cleanup * Update * Update --- Content.Server/Medical/VomitSystem.cs | 8 +++++++- Resources/Prototypes/SoundCollections/disease.yml | 5 +++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Content.Server/Medical/VomitSystem.cs b/Content.Server/Medical/VomitSystem.cs index 5cff161e0e..a6982cea4f 100644 --- a/Content.Server/Medical/VomitSystem.cs +++ b/Content.Server/Medical/VomitSystem.cs @@ -31,6 +31,12 @@ namespace Content.Server.Medical [Dependency] private readonly ForensicsSystem _forensics = default!; [Dependency] private readonly BloodstreamSystem _bloodstream = default!; + [ValidatePrototypeId] + private const string VomitCollection = "Vomit"; + + private readonly SoundSpecifier _vomitSound = new SoundCollectionSpecifier(VomitCollection, + AudioParams.Default.WithVariation(0.2f).WithVolume(-4f)); + /// /// Make an entity vomit, if they have a stomach. /// @@ -94,7 +100,7 @@ namespace Content.Server.Medical } // Force sound to play as spill doesn't work if solution is empty. - _audio.PlayPvs("/Audio/Effects/Fluids/splat.ogg", uid, AudioParams.Default.WithVariation(0.2f).WithVolume(-4f)); + _audio.PlayPvs(_vomitSound, uid); _popup.PopupEntity(Loc.GetString("disease-vomit", ("person", Identity.Entity(uid, EntityManager))), uid); } } diff --git a/Resources/Prototypes/SoundCollections/disease.yml b/Resources/Prototypes/SoundCollections/disease.yml index f748945008..9e052998b3 100644 --- a/Resources/Prototypes/SoundCollections/disease.yml +++ b/Resources/Prototypes/SoundCollections/disease.yml @@ -62,3 +62,8 @@ id: Honks files: - /Audio/Items/bikehorn.ogg + +- type: soundCollection + id: Vomit + files: + - /Audio/Effects/Fluids/splat.ogg -- 2.51.2