]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Add reagent specific footstep sounds (#24406)
authorthemias <89101928+themias@users.noreply.github.com>
Tue, 23 Jan 2024 04:18:33 +0000 (23:18 -0500)
committerGitHub <noreply@github.com>
Tue, 23 Jan 2024 04:18:33 +0000 (23:18 -0500)
* Add sticky footsteps

* Update Resources/Audio/Effects/Footsteps/attributions.yml

Co-authored-by: ike709 <ike709@users.noreply.github.com>
---------

Co-authored-by: ike709 <ike709@users.noreply.github.com>
12 files changed:
Content.Shared/Chemistry/Reagent/ReagentPrototype.cs
Content.Shared/Fluids/SharedPuddleSystem.cs
Resources/Audio/Effects/Footsteps/attributions.yml
Resources/Audio/Effects/Footsteps/gib_step.ogg [new file with mode: 0644]
Resources/Audio/Effects/Footsteps/meatslap.ogg [new file with mode: 0644]
Resources/Prototypes/Entities/Effects/puddle.yml
Resources/Prototypes/Reagents/Consumable/Drink/base_drink.yml
Resources/Prototypes/Reagents/Consumable/Drink/drinks.yml
Resources/Prototypes/Reagents/Consumable/Drink/juice.yml
Resources/Prototypes/Reagents/biological.yml
Resources/Prototypes/SoundCollections/footsteps.yml
Resources/Prototypes/Tiles/floors.yml

index 0eea8b2baec1b8766f2ae230ffd52879520e0fe4..f71afa7f479273d4c1a43c05caa14bf2c4e7c361 100644 (file)
@@ -123,9 +123,8 @@ namespace Content.Shared.Chemistry.Reagent
         [DataField]
         public float PricePerUnit;
 
-        // TODO: Pick the highest reagent for sounds and add sticky to cola, juice, etc.
         [DataField]
-        public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater");
+        public SoundSpecifier FootstepSound = new SoundCollectionSpecifier("FootstepWater", AudioParams.Default.WithVolume(6));
 
         public FixedPoint2 ReactionTile(TileRef tile, FixedPoint2 reactVolume)
         {
index 08a7624c4a8a116bab832c7d1a55bad932c52f1e..59a9c6ef26ac81cb968c4db3592415213cbc337c 100644 (file)
@@ -1,10 +1,18 @@
 using Content.Shared.Chemistry.Components;
+using Content.Shared.Chemistry.EntitySystems;
+using Content.Shared.Chemistry.Reagent;
 using Content.Shared.DragDrop;
+using Content.Shared.Fluids.Components;
+using Content.Shared.Movement.Events;
+using Robust.Shared.Prototypes;
 
 namespace Content.Shared.Fluids;
 
 public abstract class SharedPuddleSystem : EntitySystem
 {
+    [Dependency] private readonly IPrototypeManager _prototypeManager = default!;
+    [Dependency] private readonly SharedSolutionContainerSystem _solutionContainerSystem = default!;
+
     /// <summary>
     /// The lowest threshold to be considered for puddle sprite states as well as slipperiness of a puddle.
     /// </summary>
@@ -19,6 +27,7 @@ public abstract class SharedPuddleSystem : EntitySystem
         SubscribeLocalEvent<DumpableSolutionComponent, CanDropTargetEvent>(OnDumpCanDropTarget);
         SubscribeLocalEvent<DrainableSolutionComponent, CanDropTargetEvent>(OnDrainCanDropTarget);
         SubscribeLocalEvent<RefillableSolutionComponent, CanDropDraggedEvent>(OnRefillableCanDropDragged);
+        SubscribeLocalEvent<PuddleComponent, GetFootstepSoundEvent>(OnGetFootstepSound);
     }
 
     private void OnRefillableCanDrag(Entity<RefillableSolutionComponent> entity, ref CanDragEvent args)
@@ -52,4 +61,18 @@ public abstract class SharedPuddleSystem : EntitySystem
         args.CanDrop = true;
         args.Handled = true;
     }
+
+    private void OnGetFootstepSound(Entity<PuddleComponent> entity, ref GetFootstepSoundEvent args)
+    {
+        if (!_solutionContainerSystem.ResolveSolution(entity.Owner, entity.Comp.SolutionName, ref entity.Comp.Solution,
+                out var solution))
+            return;
+
+        var reagentId = solution.GetPrimaryReagentId();
+        if (!string.IsNullOrWhiteSpace(reagentId?.Prototype)
+            && _prototypeManager.TryIndex(reagentId.Value.Prototype, out ReagentPrototype? proto))
+        {
+            args.Sound = proto.FootstepSound;
+        }
+    }
 }
index 756f8c84084d391af6a844ac6d988cf5548f1c93..45872787b7d207b96b923b325020c5cf31a6d73e 100644 (file)
   license: "CC-BY-SA-4.0"
   copyright: "Taken and modified from el1n freesound.org"
   source: "https://freesound.org/people/el1n/sounds/442746/"
+
+- files:
+  - gib_step.ogg
+  - meatslap.ogg
+  license: "CC-BY-SA-3.0"
+  copyright: "Taken from https://github.com/tgstation/tgstation"
+  source: "https://github.com/tgstation/tgstation/blob/34d5ab2e46e3fb4dd9d7475f587d33441df9651c/sound/effects"
+  
\ No newline at end of file
diff --git a/Resources/Audio/Effects/Footsteps/gib_step.ogg b/Resources/Audio/Effects/Footsteps/gib_step.ogg
new file mode 100644 (file)
index 0000000..3225af3
Binary files /dev/null and b/Resources/Audio/Effects/Footsteps/gib_step.ogg differ
diff --git a/Resources/Audio/Effects/Footsteps/meatslap.ogg b/Resources/Audio/Effects/Footsteps/meatslap.ogg
new file mode 100644 (file)
index 0000000..01b4bf5
Binary files /dev/null and b/Resources/Audio/Effects/Footsteps/meatslap.ogg differ
index dd7f4116539252f7bc6c59bd3ca293efdb15f920..2c845e1d0f05ee7bf645ad6dc0aa4f118a315522 100644 (file)
     mode: SnapgridCenter
   components:
   - type: Clickable
-  - type: FootstepModifier
-    footstepSoundCollection:
-      collection: FootstepWater
-      params:
-        volume: 6
   - type: Slippery
     launchForwardsMultiplier: 2.0
   - type: Transform
index 3ffeaaf58e4e2bda5b26d624eae3f139ee31ff3c..9984b4c0cf6712222e043982ceedb76885f2bc00 100644 (file)
     amount: 0.1
   - !type:PlantAdjustHealth
     amount: -0.1
+  footstepSound:
+    collection: FootstepSticky
+    params:
+      volume: 6
 
 - type: reagent
   id: BaseAlcohol
     amount: 0.25
   - !type:PlantAdjustWater
     amount: 0.7
+
+- type: reagent
+  id: BaseJuice
+  parent: BaseDrink
+  abstract: true
+  flavor: sweet
+  footstepSound:
+    collection: FootstepSticky
+    params:
+      volume: 6
\ No newline at end of file
index 5f60d76c142f3dbf7f7b767d9c07c446dd5858a8..558ecc0e1567556102e3679c38982644a30f9284 100644 (file)
   metamorphicSprite:
     sprite: Objects/Consumable/Drinks/grenadineglass.rsi
     state: icon
+  footstepSound:
+    collection: FootstepSticky
+    params:
+      volume: 6
 
 - type: reagent
   id: IcedCoffee
 
 - type: reagent
   id: JuiceBerryPoison
+  parent: BaseJuice
   name: reagent-name-juice-berry-poison
   group: Drinks
   desc: reagent-desc-juice-berry-poison
 
 - type: reagent
   id: Lemonade
+  parent: BaseJuice
   name: reagent-name-lemonade
   group: Drinks
   desc: reagent-desc-lemonade
 
 - type: reagent
   id: NuclearCola
+  parent: BaseSoda
   name: reagent-name-nuclear-cola
   group: Drinks
   desc: reagent-desc-nuclear-cola
index 9b6e235eecd32e46172530168395bf9a04c5c75f..ee1492b45e2d4743a358d5dbe811932b1b017f92 100644 (file)
@@ -1,7 +1,7 @@
 - type: reagent
   id: JuiceApple
   name: reagent-name-juice-apple
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-apple
   physicalDesc: reagent-physical-desc-crisp
   flavor: apple
@@ -11,7 +11,7 @@
 - type: reagent
   id: JuiceBanana
   name: reagent-name-juice-banana
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-banana
   physicalDesc: reagent-physical-desc-crisp
   flavor: banana
@@ -20,7 +20,7 @@
 - type: reagent
   id: JuiceBerry
   name: reagent-name-juice-berry
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-berry
   physicalDesc: reagent-physical-desc-sweet
   flavor: berry
@@ -29,7 +29,7 @@
 - type: reagent
   id: JuiceCarrot
   name: reagent-name-juice-carrot
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-carrot
   physicalDesc: reagent-physical-desc-crisp
   flavor: carrot
@@ -49,7 +49,7 @@
 - type: reagent
   id: JuiceGrape
   name: reagent-name-juice-grape
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-grape
   physicalDesc: reagent-physical-desc-crisp
   flavor: juice
@@ -58,7 +58,7 @@
 - type: reagent
   id: JuiceLemon
   name: reagent-name-juice-lemon
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-lemon
   physicalDesc: reagent-physical-desc-citric
   flavor: sour
@@ -67,7 +67,7 @@
 - type: reagent
   id: JuiceLime
   name: reagent-name-juice-lime
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-lime
   physicalDesc: reagent-physical-desc-citric
   flavor: sour
@@ -84,7 +84,7 @@
 - type: reagent
   id: JuiceOrange
   name: reagent-name-juice-orange
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-orange
   physicalDesc: reagent-physical-desc-citric
   flavor: orange
@@ -93,7 +93,7 @@
 - type: reagent
   id: JuicePineapple
   name: reagent-name-juice-pineapple
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-pineapple
   physicalDesc: reagent-physical-desc-tropical
   flavor: pineapple
 - type: reagent
   id: JuicePotato
   name: reagent-name-juice-potato
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-potato
   physicalDesc: reagent-physical-desc-starchy
   flavor: potatoes
 - type: reagent
   id: JuiceTomato
   name: reagent-name-juice-tomato
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-tomato
   physicalDesc: reagent-physical-desc-saucey
   flavor: tomato
 - type: reagent
   id: JuiceWatermelon
   name: reagent-name-juice-watermelon
-  parent: BaseDrink
+  parent: BaseJuice
   desc: reagent-desc-juice-watermelon
   physicalDesc: reagent-physical-desc-sweet
   flavor: watermelon
index 62d2a427881a7140dede8baf0fa0518a59c7b269..d29d5f7e4dafcd763f7be56874bc092075a5dd5e 100644 (file)
   plantMetabolism:
     - !type:PlantAdjustWater
       amount: 0.5
+  footstepSound:
+    collection: FootstepBlood
+    params:
+      volume: 6
 
 - type: reagent
   parent: Blood
       effects:
       - !type:SatiateHunger
         factor: 1.5
+  footstepSound:
+    collection: FootstepBlood
+    params:
+      volume: 6
 
 - type: reagent
   parent: Blood
   plantMetabolism:
   - !type:PlantAdjustWater
     amount: 0.5
+  footstepSound:
+    collection: FootstepBlood
+    params:
+      volume: 6
 
 - type: reagent
   id: Fat
   color: "#d8d8b0"
   physicalDesc: reagent-physical-desc-exotic-smelling
   slippery: false
+  footstepSound:
+    collection: FootstepBlood
+    params:
+      volume: 6
 
 - type: reagent
   id: Vomit
       - !type:AdjustReagent
         reagent: Nutriment
         amount: 0.1
+  footstepSound:
+    collection: FootstepBlood
+    params:
+      volume: 6
\ No newline at end of file
index 296e6386500263949656fef8ab928efe2ea31557..e48eeb6450afb6b56803c5ab444ff0c39732435d 100644 (file)
   id: FootstepSlip
   files:
   - /Audio/Effects/slip.ogg
+
+- type: soundCollection
+  id: FootstepBlood
+  files:
+  - /Audio/Effects/Footsteps/gib_step.ogg
+  
+- type: soundCollection
+  id: FootstepSticky
+  files:
+  - /Audio/Effects/Footsteps/meatslap.ogg
\ No newline at end of file
index 9d6f197e36263184629a210831d91ef77bfa7aa7..3a80bdddc4eeef8f06d380c7fd1de0287d3ffe63 100644 (file)
   isSubfloor: false
   canCrowbar: true
   footstepSounds:
-    collection: BarestepCarpet
+    collection: FootstepBlood
   itemDrop: FloorTileItemFlesh
   friction: 0.05 #slippy
   heatCapacity: 10000