2023-04-24 03:42:09 +10:00
|
|
|
using Robust.Shared.GameStates;
|
|
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared.Sound.Components;
|
|
|
|
|
|
2024-02-26 04:36:19 +01:00
|
|
|
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class EmitSoundOnCollideComponent : BaseEmitSoundComponent
|
2023-04-24 03:42:09 +10:00
|
|
|
{
|
|
|
|
|
public static readonly TimeSpan CollideCooldown = TimeSpan.FromSeconds(0.2);
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Minimum velocity required for the sound to play.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("minVelocity")]
|
2023-05-20 02:04:26 +10:00
|
|
|
public float MinimumVelocity = 3f;
|
2023-04-24 03:42:09 +10:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// To avoid sound spam add a cooldown to it.
|
|
|
|
|
/// </summary>
|
2023-05-01 14:49:25 +10:00
|
|
|
[ViewVariables(VVAccess.ReadWrite), DataField("nextSound", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2023-06-26 08:36:35 +12:00
|
|
|
public TimeSpan NextSound;
|
2023-04-24 03:42:09 +10:00
|
|
|
}
|