2023-01-10 22:46:58 +11:00
|
|
|
using Content.Shared.FixedPoint;
|
2022-07-27 00:46:24 -04:00
|
|
|
using Robust.Shared.GameStates;
|
2023-01-10 22:46:58 +11:00
|
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
2022-07-27 00:46:24 -04:00
|
|
|
|
|
|
|
|
namespace Content.Shared.Bed.Sleep;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Added to entities when they go to sleep.
|
|
|
|
|
/// </summary>
|
2024-02-26 04:36:19 +01:00
|
|
|
[NetworkedComponent, RegisterComponent, AutoGenerateComponentPause(Dirty = true)]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class SleepingComponent : Component
|
2022-07-27 00:46:24 -04:00
|
|
|
{
|
2023-01-10 22:46:58 +11:00
|
|
|
/// <summary>
|
|
|
|
|
/// How much damage of any type it takes to wake this entity.
|
|
|
|
|
/// </summary>
|
2022-07-27 00:46:24 -04:00
|
|
|
[DataField("wakeThreshold")]
|
2023-01-10 22:46:58 +11:00
|
|
|
public FixedPoint2 WakeThreshold = FixedPoint2.New(2);
|
2022-10-15 06:13:24 +02:00
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Cooldown time between users hand interaction.
|
|
|
|
|
/// </summary>
|
|
|
|
|
[DataField("cooldown")]
|
|
|
|
|
[ViewVariables(VVAccess.ReadWrite)]
|
|
|
|
|
public TimeSpan Cooldown = TimeSpan.FromSeconds(1f);
|
|
|
|
|
|
2023-01-10 22:46:58 +11:00
|
|
|
[DataField("cooldownEnd", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
2024-02-26 04:36:19 +01:00
|
|
|
[AutoPausedField]
|
2022-10-15 06:13:24 +02:00
|
|
|
public TimeSpan CoolDownEnd;
|
2023-09-08 18:16:05 -07:00
|
|
|
|
|
|
|
|
[DataField("wakeAction")] public EntityUid? WakeAction;
|
2022-07-27 00:46:24 -04:00
|
|
|
}
|