]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Make mover controller respect footsteps volume sound param (#16018)
authorAJCM-git <60196617+AJCM-git@users.noreply.github.com>
Tue, 2 May 2023 23:33:53 +0000 (19:33 -0400)
committerGitHub <noreply@github.com>
Tue, 2 May 2023 23:33:53 +0000 (09:33 +1000)
Content.Shared/Movement/Systems/SharedMoverController.cs
Resources/Prototypes/Entities/Effects/puddle.yml
Resources/Prototypes/Entities/Mobs/NPCs/slimes.yml
Resources/Prototypes/Entities/Structures/catwalk.yml
Resources/Prototypes/Entities/Tiles/water.yml

index 42e9b6f49a4a43c57d79817853a73dfe008ae069..57ee41b718eea308939f662de4081b7842cd1202 100644 (file)
@@ -17,10 +17,6 @@ using Robust.Shared.Timing;
 using Robust.Shared.Utility;
 using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Mobs.Systems;
-using Content.Shared.Mech.Components;
-using Content.Shared.Parallax.Biomes;
-using Robust.Shared.Map.Components;
-using Robust.Shared.Noise;
 using Robust.Shared.Physics.Components;
 using Robust.Shared.Physics.Systems;
 
@@ -49,8 +45,6 @@ namespace Content.Shared.Movement.Systems
         private const float StepSoundMoveDistanceWalking = 1.5f;
 
         private const float FootstepVariation = 0f;
-        private const float FootstepVolume = 3f;
-        private const float FootstepWalkingAddedVolumeMultiplier = 0f;
 
         protected ISawmill Sawmill = default!;
 
@@ -113,12 +107,12 @@ namespace Content.Shared.Movement.Systems
             EntityQuery<SharedPullableComponent> pullableQuery,
             EntityQuery<MovementSpeedModifierComponent> modifierQuery)
         {
-            bool canMove = mover.CanMove;
+            var canMove = mover.CanMove;
             if (relayTargetQuery.TryGetComponent(uid, out var relayTarget) && relayTarget.Entities.Count > 0)
             {
                 DebugTools.Assert(relayTarget.Entities.Count <= 1, "Multiple relayed movers are not supported at the moment");
 
-                bool found = false;
+                var found = false;
                 foreach (var ent in relayTarget.Entities)
                 {
                     if (_mobState.IsIncapacitated(ent) || !moverQuery.TryGetComponent(ent, out var relayedMover))
@@ -264,10 +258,10 @@ namespace Content.Shared.Movement.Systems
                 if (!weightless && mobMoverQuery.TryGetComponent(uid, out var mobMover) &&
                     TryGetSound(weightless, uid, mover, mobMover, xform, out var sound))
                 {
-                    var soundModifier = mover.Sprinting ? 1.0f : FootstepWalkingAddedVolumeMultiplier;
+                    var soundModifier = mover.Sprinting ? 1.5f : 1f;
 
                     var audioParams = sound.Params
-                        .WithVolume(FootstepVolume * soundModifier)
+                        .WithVolume(sound.Params.Volume * soundModifier)
                         .WithVariation(sound.Params.Variation ?? FootstepVariation);
 
                     // If we're a relay target then predict the sound for all relays.
@@ -348,7 +342,8 @@ namespace Content.Shared.Movement.Systems
 
             foreach (var otherCollider in broadPhaseSystem.GetCollidingEntities(transform.MapID, enlargedAABB))
             {
-                if (otherCollider == collider) continue; // Don't try to push off of yourself!
+                if (otherCollider == collider)
+                    continue; // Don't try to push off of yourself!
 
                 // Only allow pushing off of anchored things that have collision.
                 if (otherCollider.BodyType != BodyType.Static ||
index f48ee736ea9de6c6692515c5785b44d95116274a..2f65069b2aebe3f9f9dee169bc9868c918eb96b7 100644 (file)
@@ -74,6 +74,8 @@
     - type: FootstepModifier
       footstepSoundCollection:
         collection: FootstepWater
+        params:
+          volume: 6
     - type: Slippery
       launchForwardsMultiplier: 2.0
     - type: Transform
index aa4c6374692b17efac78d4ffae9d5a0ec197a43e..b52777be0fd41acd99b256ec7125a9dfddc77c64 100644 (file)
@@ -38,6 +38,8 @@
   - type: FootstepModifier
     footstepSoundCollection:
       path: /Audio/Effects/Footsteps/slime1.ogg
+      params:
+        volume: 3
   - type: Tag
     tags:
     - FootstepSound
index 3fbe08dd644803aa5ab3f3f8eb1386534f380b20..7f5c6a60a8822ce6e216338bfa8d0d3b9c6feb4c 100644 (file)
@@ -22,6 +22,8 @@
   - type: FootstepModifier
     footstepSoundCollection:
       collection: FootstepCatwalk
+      params:
+        volume: 8
   - type: Tag
     tags:
       - Catwalk
index aa5b644b984f533ef1c82dfc1c5e8da922fedbc6..64d35f53b39de254a4eda6dc47d685742ecdc382 100644 (file)
@@ -38,3 +38,5 @@
   - type: FootstepModifier
     footstepSoundCollection:
       collection: FootstepWater
+      params:
+        volume: 8