]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Edible Sound Specifier Override (#40312)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Fri, 12 Sep 2025 21:49:12 +0000 (14:49 -0700)
committerGitHub <noreply@github.com>
Fri, 12 Sep 2025 21:49:12 +0000 (23:49 +0200)
Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Nutrition/Components/EdibleComponent.cs
Content.Shared/Nutrition/EntitySystems/IngestionSystem.cs

index 4fcd9770eb1e3323e11b40c6aaf9c32f9c6d7587..bff56984a1282af5716108895fd5804f2d58d199 100644 (file)
@@ -2,6 +2,7 @@
 using Content.Shared.FixedPoint;
 using Content.Shared.Nutrition.EntitySystems;
 using Content.Shared.Nutrition.Prototypes;
+using Robust.Shared.Audio;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
 
@@ -78,6 +79,13 @@ public sealed partial class EdibleComponent : Component
     [DataField]
     public bool RequireDead = true;
 
+    /// <summary>
+    /// An optional override for the sound made when consuming this item.
+    /// Useful for if an edible type doesn't justify a new prototype, like with plushies.
+    /// </summary>
+    [DataField]
+    public SoundSpecifier? UseSound;
+
     /// <summary>
     /// Verb, icon, and sound data for our edible.
     /// </summary>
index 470747fa3f7d2a8dee50dcf089a77c725079f9c3..284bb866f77a5a30d374ded6999eaa7a295b2cae 100644 (file)
@@ -449,7 +449,7 @@ public sealed partial class IngestionSystem : EntitySystem
 
         var edible = _proto.Index(entity.Comp.Edible);
 
-        _audio.PlayPredicted(edible.UseSound, args.Target, args.User);
+        _audio.PlayPredicted(entity.Comp.UseSound ?? edible.UseSound, args.Target, args.User);
 
         var flavors = _flavorProfile.GetLocalizedFlavorsMessage(entity.Owner, args.Target, args.Split);