Cleanup: Use `SoundSpecifier instead of string literals in VomitSystem` (#35426)
* Cleanup * Update * Update
This commit is contained in:
@@ -31,6 +31,12 @@ namespace Content.Server.Medical
|
|||||||
[Dependency] private readonly ForensicsSystem _forensics = default!;
|
[Dependency] private readonly ForensicsSystem _forensics = default!;
|
||||||
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
[Dependency] private readonly BloodstreamSystem _bloodstream = default!;
|
||||||
|
|
||||||
|
[ValidatePrototypeId<SoundCollectionPrototype>]
|
||||||
|
private const string VomitCollection = "Vomit";
|
||||||
|
|
||||||
|
private readonly SoundSpecifier _vomitSound = new SoundCollectionSpecifier(VomitCollection,
|
||||||
|
AudioParams.Default.WithVariation(0.2f).WithVolume(-4f));
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Make an entity vomit, if they have a stomach.
|
/// Make an entity vomit, if they have a stomach.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -94,7 +100,7 @@ namespace Content.Server.Medical
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Force sound to play as spill doesn't work if solution is empty.
|
// 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);
|
_popup.PopupEntity(Loc.GetString("disease-vomit", ("person", Identity.Entity(uid, EntityManager))), uid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,3 +62,8 @@
|
|||||||
id: Honks
|
id: Honks
|
||||||
files:
|
files:
|
||||||
- /Audio/Items/bikehorn.ogg
|
- /Audio/Items/bikehorn.ogg
|
||||||
|
|
||||||
|
- type: soundCollection
|
||||||
|
id: Vomit
|
||||||
|
files:
|
||||||
|
- /Audio/Effects/Fluids/splat.ogg
|
||||||
|
|||||||
Reference in New Issue
Block a user