using Content.Shared.CCVar; using Content.Shared.StatusIcon; using Robust.Shared.GameStates; using Robust.Shared.Prototypes; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; namespace Content.Shared.SSDIndicator; /// /// Shows status icon when an entity is SSD, based on if a player is attached or not. /// [RegisterComponent, NetworkedComponent] [AutoGenerateComponentState, AutoGenerateComponentPause] public sealed partial class SSDIndicatorComponent : Component { /// /// Whether or not the entity is SSD. /// [AutoNetworkedField] [DataField, ViewVariables(VVAccess.ReadOnly)] public bool IsSSD = true; /// /// The icon displayed next to the associated entity when it is SSD. /// [DataField] public ProtoId Icon = "SSDIcon"; /// /// The time at which the entity will fall asleep, if is true. /// [AutoNetworkedField, AutoPausedField] [Access(typeof(SSDIndicatorSystem))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan FallAsleepTime = TimeSpan.Zero; /// /// The next time this component will be updated. /// [AutoNetworkedField, AutoPausedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan NextUpdate = TimeSpan.Zero; /// /// The time between updates checking if the entity should be force slept. /// [DataField] public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1); // DeltaV - SSD Recency Additions START /// /// The time at which the player became SSD. /// This will remain unset on SSD entities that never had minds attached, such as newly spawn ghost roles. /// [AutoNetworkedField, AutoPausedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] public TimeSpan? SsdSince; /// /// The icon displayed next to the associated entity when it is recently SSD (stage 2). /// [DataField] public ProtoId RecentIcon = "RecentSSDIcon"; /// /// The icon displayed next to the associated entity when it is very recently SSD (stage 1). /// [DataField] public ProtoId VeryRecentIcon = "VeryRecentSSDIcon"; // DeltaV END } // DeltaV - SSD Recency START // If you change this enum, remember to update `Resources/Locale/en-US/_DV/ssdIndicator/examine.ftl` public enum SsdStage : byte { /// /// Stage 1: SSD Indicator is red. They might just be recovering from a crash/timeout. /// VeryRecent, /// /// Stage 2: SSD Indicator is yellow. They've been gone for a bit, but they shouldn't be moved to cryo yet. /// Recent, /// /// Stage 3: SSD Indicator is green/default. They've been gone for a long time, they can be moved to cryo. /// Cryoable, } // DeltaV END