using Content.Shared.Containers.ItemSlots;
using Content.Shared.Damage;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
namespace Content.Shared.Implants.Components;
///
/// Implanters are used to implant or extract implants from an entity.
/// Some can be single use (implant only) or some can draw out an implant
///
//TODO: Rework drawing to work with implant cases when surgery is in
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
public sealed partial class ImplanterComponent : Component
{
public const string ImplanterSlotId = "implanter_slot";
public const string ImplantSlotId = "implant";
///
/// Whitelist to check entities against before implanting.
/// Implants get their own whitelist which is checked afterwards.
///
[DataField, AutoNetworkedField]
public EntityWhitelist? Whitelist;
///
/// Blacklist to check entities against before implanting.
///
[DataField, AutoNetworkedField]
public EntityWhitelist? Blacklist;
///
/// Used for implanters that start with specific implants
///
[DataField]
public EntProtoId? Implant;
///
/// The time it takes to implant someone else
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float ImplantTime = 5f;
//TODO: Remove when surgery is a thing
///
/// The time it takes to extract an implant from someone
/// It's excessively long to deter from implant checking any antag
///
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public float DrawTime = 25f;
///
/// Good for single-use injectors
///
[DataField, AutoNetworkedField]
public bool ImplantOnly;
///
/// The current mode of the implanter
/// Mode is changed automatically depending if it implants or draws
///
[DataField, AutoNetworkedField]
public ImplanterToggleMode CurrentMode;
///
/// The name and description of the implant to show on the implanter
///
[DataField]
public (string, string) ImplantData;
///
/// Determines if the same type of implant can be implanted into an entity multiple times.
///
[DataField]
public bool AllowMultipleImplants = false;
///
/// The for this implanter
///
[DataField(required: true)]
public ItemSlot ImplanterSlot = new();
///
/// If true, the implanter may be used to remove all kinds of (deimplantable) implants without selecting any.
///
[DataField]
public bool AllowDeimplantAll = false;
///
/// The subdermal implants that may be removed via this implanter
///
[DataField]
public List DeimplantWhitelist = new();
///
/// The subdermal implants that may be removed via this implanter
///
[DataField]
public DamageSpecifier DeimplantFailureDamage = new();
///
/// Chosen implant to remove, if necessary.
///
[AutoNetworkedField]
public EntProtoId? DeimplantChosen = null;
public bool UiUpdateNeeded;
}
[Serializable, NetSerializable]
public enum ImplanterToggleMode : byte
{
Inject,
Draw
}
[Serializable, NetSerializable]
public enum ImplanterVisuals : byte
{
Full
}
[Serializable, NetSerializable]
public enum ImplanterImplantOnlyVisuals : byte
{
ImplantOnly
}