From: mubururu_ <139181059+muburu@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:24:09 +0000 (-0600) Subject: silent footsteps for ninja (#33280) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=4ddd7d3c5f514e667f5caf4c28b5710542cfe75c;p=space-station-14.git silent footsteps for ninja (#33280) * waow * nice suggestion * nullable sound * fix stuff --------- Co-authored-by: Ed <96445749+TheShuEd@users.noreply.github.com> Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com> --- diff --git a/Content.Client/Tips/TippyUIController.cs b/Content.Client/Tips/TippyUIController.cs index 7737a3d698..77c10193a5 100644 --- a/Content.Client/Tips/TippyUIController.cs +++ b/Content.Client/Tips/TippyUIController.cs @@ -104,7 +104,7 @@ public sealed class TippyUIController : UIController ? -WaddleRotation : WaddleRotation; - if (EntityManager.TryGetComponent(_entity, out FootstepModifierComponent? step)) + if (EntityManager.TryGetComponent(_entity, out FootstepModifierComponent? step) && step.FootstepSoundCollection != null) { var audioParams = step.FootstepSoundCollection.Params .AddVolume(-7f) diff --git a/Content.Shared/Movement/Components/FootstepModifierComponent.cs b/Content.Shared/Movement/Components/FootstepModifierComponent.cs index bd7b5377bd..e658f6d948 100644 --- a/Content.Shared/Movement/Components/FootstepModifierComponent.cs +++ b/Content.Shared/Movement/Components/FootstepModifierComponent.cs @@ -9,6 +9,6 @@ namespace Content.Shared.Movement.Components; [RegisterComponent, NetworkedComponent, AutoGenerateComponentState] public sealed partial class FootstepModifierComponent : Component { - [DataField(required: true), AutoNetworkedField] - public SoundSpecifier FootstepSoundCollection = default!; + [DataField, AutoNetworkedField] + public SoundSpecifier? FootstepSoundCollection; } diff --git a/Content.Shared/Movement/Systems/SharedMoverController.cs b/Content.Shared/Movement/Systems/SharedMoverController.cs index 472d56b1d6..5de74d7294 100644 --- a/Content.Shared/Movement/Systems/SharedMoverController.cs +++ b/Content.Shared/Movement/Systems/SharedMoverController.cs @@ -439,14 +439,14 @@ public abstract partial class SharedMoverController : VirtualController if (FootstepModifierQuery.TryComp(uid, out var moverModifier)) { sound = moverModifier.FootstepSoundCollection; - return true; + return sound != null; } if (_inventory.TryGetSlotEntity(uid, "shoes", out var shoes) && FootstepModifierQuery.TryComp(shoes, out var modifier)) { sound = modifier.FootstepSoundCollection; - return true; + return sound != null; } return TryGetFootstepSound(uid, xform, shoes != null, out sound, tileDef: tileDef); @@ -467,10 +467,9 @@ public abstract partial class SharedMoverController : VirtualController if (FootstepModifierQuery.TryComp(xform.MapUid, out var modifier)) { sound = modifier.FootstepSoundCollection; - return true; } - return false; + return sound != null; } var position = grid.LocalToTile(xform.Coordinates); @@ -493,7 +492,7 @@ public abstract partial class SharedMoverController : VirtualController if (FootstepModifierQuery.TryComp(maybeFootstep, out var footstep)) { sound = footstep.FootstepSoundCollection; - return true; + return sound != null; } } diff --git a/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml b/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml index 87a0c06c4a..46fb16b1f2 100644 --- a/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml +++ b/Resources/Prototypes/Entities/Clothing/Shoes/specific.yml @@ -136,6 +136,9 @@ # ninja are masters of sneaking around relatively quickly, won't break cloak walkModifier: 1.1 sprintModifier: 1.3 + - type: FootstepModifier + footstepSoundCollection: + collection: null - type: entity parent: ClothingShoesBaseButcherable