Files
tbd-station-14/Content.Shared/Sound/Components/EmitSoundOnCollideComponent.cs
metalgearsloth 04830bf704 Add wallbonk sound to BaseItem (#15689)
Uses a chisel sound.
2023-04-23 13:42:09 -04:00

23 lines
786 B
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Sound.Components;
[RegisterComponent, NetworkedComponent]
public sealed class EmitSoundOnCollideComponent : BaseEmitSoundComponent
{
public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);
/// <summary>
/// Minimum velocity required for the sound to play.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("minVelocity")]
public float MinimumVelocity = 0.25f;
/// <summary>
/// To avoid sound spam add a cooldown to it.
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("nextSound", customTypeSerializer:typeof(TimeOffsetSerializer))]
public TimeSpan NextSound;
}