Files
wwdpublic/Content.Shared/Bed/Sleep/SleepingComponent.cs
Tayrtahn 4330745996 Move SleepingSystem to Shared & cleanup (#28672)
* Move SleepingSystem to Shared & cleanup

* Remove empty OnShutdown handler

(cherry picked from commit bdafdeb7052aefa6e0f749f2e04c28bf33a78f4b)
2025-01-14 02:02:18 +03:00

49 lines
1.3 KiB
C#

using Content.Shared.FixedPoint;
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
namespace Content.Shared.Bed.Sleep;
/// <summary>
/// Added to entities when they go to sleep.
/// </summary>
[NetworkedComponent, RegisterComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause(Dirty = true)]
public sealed partial class SleepingComponent : Component
{
/// <summary>
/// How much damage of any type it takes to wake this entity.
/// </summary>
[DataField]
public FixedPoint2 WakeThreshold = FixedPoint2.New(2);
/// <summary>
/// Cooldown time between users hand interaction.
/// </summary>
[DataField]
public TimeSpan Cooldown = TimeSpan.FromSeconds(1f);
[DataField]
[AutoNetworkedField, AutoPausedField]
public TimeSpan CooldownEnd;
/// <summary>
/// The moment this entity went to sleep. Initialized on MapInit.
/// </summary>
[DataField]
public TimeSpan SleepingSince;
[DataField]
[AutoNetworkedField]
public EntityUid? WakeAction;
/// <summary>
/// Sound to play when another player attempts to wake this entity.
/// </summary>
[DataField]
public SoundSpecifier WakeAttemptSound = new SoundPathSpecifier("/Audio/Effects/thudswoosh.ogg")
{
Params = AudioParams.Default.WithVariation(0.05f)
};
}