Cryogenic Sleep Units (#24096)
* Cryogenic sleep units * pause map support * no more body deletion * Cryogenic Storage Units * boowomp * no more emag, no more dropping present people
This commit is contained in:
110
Content.Shared/Bed/Cryostorage/CryostorageComponent.cs
Normal file
110
Content.Shared/Bed/Cryostorage/CryostorageComponent.cs
Normal file
@@ -0,0 +1,110 @@
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Bed.Cryostorage;
|
||||
|
||||
/// <summary>
|
||||
/// This is used for a container which, when a player logs out while inside of,
|
||||
/// will delete their body and redistribute their items.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
public sealed partial class CryostorageComponent : Component
|
||||
{
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public string ContainerId = "storage";
|
||||
|
||||
/// <summary>
|
||||
/// How long a player can remain inside Cryostorage before automatically being taken care of, given that they have no mind.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan NoMindGracePeriod = TimeSpan.FromSeconds(30f);
|
||||
|
||||
/// <summary>
|
||||
/// How long a player can remain inside Cryostorage before automatically being taken care of.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan GracePeriod = TimeSpan.FromMinutes(5f);
|
||||
|
||||
/// <summary>
|
||||
/// A list of players who have actively entered cryostorage.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public List<EntityUid> StoredPlayers = new();
|
||||
|
||||
/// <summary>
|
||||
/// Sound that is played when a player is removed by a cryostorage.
|
||||
/// </summary>
|
||||
[DataField]
|
||||
public SoundSpecifier? RemoveSound = new SoundPathSpecifier("/Audio/Effects/teleport_departure.ogg");
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CryostorageVisuals : byte
|
||||
{
|
||||
Full
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public record struct CryostorageContainedPlayerData()
|
||||
{
|
||||
/// <summary>
|
||||
/// The player's IC name
|
||||
/// </summary>
|
||||
public string PlayerName = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// The player's entity
|
||||
/// </summary>
|
||||
public NetEntity PlayerEnt = NetEntity.Invalid;
|
||||
|
||||
/// <summary>
|
||||
/// A dictionary relating a slot definition name to the name of the item inside of it.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> ItemSlots = new();
|
||||
|
||||
/// <summary>
|
||||
/// A dictionary relating a hand ID to the hand name and the name of the item being held.
|
||||
/// </summary>
|
||||
public Dictionary<string, string> HeldItems = new();
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class CryostorageBuiState : BoundUserInterfaceState
|
||||
{
|
||||
public List<CryostorageContainedPlayerData> PlayerData;
|
||||
|
||||
public CryostorageBuiState(List<CryostorageContainedPlayerData> playerData)
|
||||
{
|
||||
PlayerData = playerData;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class CryostorageRemoveItemBuiMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public NetEntity Entity;
|
||||
|
||||
public string Key;
|
||||
|
||||
public RemovalType Type;
|
||||
|
||||
public enum RemovalType : byte
|
||||
{
|
||||
Hand,
|
||||
Inventory
|
||||
}
|
||||
|
||||
public CryostorageRemoveItemBuiMessage(NetEntity entity, string key, RemovalType type)
|
||||
{
|
||||
Entity = entity;
|
||||
Key = key;
|
||||
Type = type;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum CryostorageUIKey : byte
|
||||
{
|
||||
Key
|
||||
}
|
||||
Reference in New Issue
Block a user