Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

silent footsteps for ninja #33280

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Content.Client/Tips/TippyUIController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private Vector2 UpdatePosition(TippyUI tippy, Vector2 screenSize, FrameEventArgs
? -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
9 changes: 4 additions & 5 deletions Content.Shared/Movement/Systems/SharedMoverController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -439,14 +439,14 @@ private bool TryGetSound(
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);
Expand All @@ -467,10 +467,9 @@ private bool TryGetFootstepSound(
if (FootstepModifierQuery.TryComp(xform.MapUid, out var modifier))
{
sound = modifier.FootstepSoundCollection;
return true;
}

return false;
return sound != null;
}

var position = grid.LocalToTile(xform.Coordinates);
Expand All @@ -493,7 +492,7 @@ private bool TryGetFootstepSound(
if (FootstepModifierQuery.TryComp(maybeFootstep, out var footstep))
{
sound = footstep.FootstepSoundCollection;
return true;
return sound != null;
}
}

Expand Down
3 changes: 3 additions & 0 deletions Resources/Prototypes/Entities/Clothing/Shoes/specific.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldnt the null be on the field above

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

damn
yeah it should be


- type: entity
parent: ClothingShoesBaseButcherable
Expand Down
Loading