using Robust.Shared.Audio; using Robust.Shared.GameStates; using Robust.Shared.Serialization; namespace Content.Shared.Bed.Cryostorage; /// /// This is used for a container which, when a player logs out while inside of, /// will delete their body and redistribute their items. /// [RegisterComponent, NetworkedComponent] [AutoGenerateComponentState] public sealed partial class CryostorageComponent : Component { [DataField, ViewVariables(VVAccess.ReadWrite)] public string ContainerId = "storage"; /// /// How long a player can remain inside Cryostorage before automatically being taken care of, given that they have no mind. /// [DataField, ViewVariables(VVAccess.ReadWrite)] [AutoNetworkedField] public TimeSpan NoMindGracePeriod = TimeSpan.FromSeconds(30f); /// /// How long a player can remain inside Cryostorage before automatically being taken care of. /// [DataField, ViewVariables(VVAccess.ReadWrite)] [AutoNetworkedField] public TimeSpan GracePeriod = TimeSpan.FromMinutes(5f); /// /// A list of players who have actively entered cryostorage. /// [DataField] [AutoNetworkedField] public List StoredPlayers = new(); /// /// Sound that is played when a player is removed by a cryostorage. /// [DataField] public SoundSpecifier? RemoveSound = new SoundPathSpecifier("/Audio/Effects/teleport_departure.ogg"); } [Serializable, NetSerializable] public enum CryostorageVisuals : byte { Full } [Serializable, NetSerializable] public record struct CryostorageContainedPlayerData() { /// /// The player's IC name /// public string PlayerName = string.Empty; /// /// The player's entity /// public NetEntity PlayerEnt = NetEntity.Invalid; /// /// A dictionary relating a slot definition name to the name of the item inside of it. /// public Dictionary ItemSlots = new(); /// /// A dictionary relating a hand ID to the hand name and the name of the item being held. /// public Dictionary HeldItems = new(); } [Serializable, NetSerializable] public sealed class CryostorageBuiState : BoundUserInterfaceState { public List PlayerData; public CryostorageBuiState(List playerData) { PlayerData = playerData; } } [Serializable, NetSerializable] public sealed class CryostorageRemoveItemBuiMessage : BoundUserInterfaceMessage { public NetEntity StoredEntity; public string Key; public RemovalType Type; public enum RemovalType : byte { Hand, Inventory } public CryostorageRemoveItemBuiMessage(NetEntity storedEntity, string key, RemovalType type) { StoredEntity = storedEntity; Key = key; Type = type; } } [Serializable, NetSerializable] public enum CryostorageUIKey : byte { Key }