using Content.Shared.FixedPoint;
using Content.Shared.Tools;
using Robust.Shared.Containers;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Medical.Cryogenics;
///
/// Component for medical cryo pods.
/// Handles transferring reagents from a beaker slot into an inserted mob, as well as exposing them to connected atmos pipes.
///
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class CryoPodComponent : Component
{
///
/// The name of the container the patient is stored in.
///
public const string BodyContainerName = "scanner-body";
///
/// Specifies the name of the atmospherics port to draw gas from.
///
[DataField]
public string PortName = "port";
///
/// Specifies the name of the slot that holds the beaker with medicine.
///
[DataField]
public string SolutionContainerName = "beakerSlot";
///
/// How often are chemicals transferred from the beaker to the body?
/// (injection interval)
///
[DataField]
public TimeSpan BeakerTransferTime = TimeSpan.FromSeconds(1);
///
/// The timestamp for the next injection.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoNetworkedField, AutoPausedField]
public TimeSpan NextInjectionTime = TimeSpan.Zero;
///
/// How many units to transfer per injection from the beaker to the mob?
///
[DataField]
public FixedPoint2 BeakerTransferAmount = 1;
///
/// Delay applied when inserting a mob in the pod (in seconds).
///
[DataField]
public float EntryDelay = 2f;
///
/// Delay applied when trying to pry open a locked pod (in seconds).
///
[DataField]
public float PryDelay = 5f;
///
/// Container for mobs inserted in the pod.
///
[ViewVariables]
public ContainerSlot BodyContainer = default!;
///
/// If true, the eject verb will not work on the pod and the user must use a crowbar to pry the pod open.
///
[DataField, AutoNetworkedField]
public bool Locked;
///
/// Causes the pod to be locked without being fixable by messing with wires.
///
[DataField, AutoNetworkedField]
public bool PermaLocked;
///
/// The tool quality needed to eject a body when the pod is locked.
///
[DataField, AutoNetworkedField]
public ProtoId UnlockToolQuality = "Prying";
}
[Serializable, NetSerializable]
public enum CryoPodVisuals : byte
{
ContainsEntity,
IsOn
}