Skip to content

Commit 800dd4b

Browse files
Add sound
1 parent 261747c commit 800dd4b

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

Content.Shared/Rootable/RootableComponent.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Content.Shared.Alert;
22
using Content.Shared.FixedPoint;
3+
using Robust.Shared.Audio;
34
using Robust.Shared.GameStates;
45
using Robust.Shared.Prototypes;
56
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
@@ -51,4 +52,9 @@ public sealed partial class RootableComponent : Component
5152
/// </summary>
5253
[DataField]
5354
public float SpeedModifier = 0.8f;
55+
56+
/// <summary>
57+
/// Sound that plays when rooting is toggled.
58+
/// </summary>
59+
public SoundSpecifier RootSound = new SoundPathSpecifier("/Audio/Voice/Diona/diona_salute.ogg");
5460
}

Content.Shared/Rootable/SharedRootableSystem.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
using Content.Shared.Damage.Components;
22
using Content.Shared.Actions;
33
using Content.Shared.Alert;
4+
using Content.Shared.Coordinates;
45
using Content.Shared.Fluids.Components;
56
using Content.Shared.Gravity;
67
using Content.Shared.Mobs;
78
using Content.Shared.Movement.Systems;
89
using Content.Shared.Slippery;
910
using Content.Shared.Toggleable;
11+
using Robust.Shared.Audio.Systems;
1012
using Robust.Shared.Physics.Components;
1113
using Robust.Shared.Physics.Events;
1214
using Robust.Shared.Physics.Systems;
@@ -26,6 +28,7 @@ public abstract class SharedRootableSystem : EntitySystem
2628
[Dependency] private readonly IEntityManager _entityManager = default!;
2729
[Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifier = default!;
2830
[Dependency] private readonly AlertsSystem _alerts = default!;
31+
[Dependency] private readonly SharedAudioSystem _audioSystem = default!;
2932

3033
private EntityQuery<PuddleComponent> _puddleQuery;
3134

@@ -81,6 +84,8 @@ public bool TryToggleRooting(EntityUid uid, RootableComponent? rooted = null)
8184
else
8285
_alerts.ClearAlert(uid, rooted.RootedAlert);
8386

87+
_audioSystem.PlayPredicted(rooted.RootSound, uid.ToCoordinates(), uid);
88+
8489
return true;
8590
}
8691

0 commit comments

Comments
 (0)