using Robust.Shared.GameStates;
using Content.Shared.Silicon.Systems;
using Robust.Shared.Serialization.TypeSerializers.Implementations;
using Robust.Shared.Prototypes;
using Content.Shared.Alert;
using Content.Shared.CCVar;
namespace Content.Shared.Silicon.Components;
///
/// Component for defining a mob as a robot.
///
[RegisterComponent, NetworkedComponent]
public sealed partial class SiliconComponent : Component
{
[ViewVariables(VVAccess.ReadOnly)]
public short ChargeState = 10;
[ViewVariables(VVAccess.ReadOnly)]
public float OverheatAccumulator = 0.0f;
///
/// The last time the Silicon was drained.
/// Used for NPC Silicons to avoid over updating.
///
///
/// Time between drains can be specified in
///
///
public TimeSpan LastDrainTime = TimeSpan.Zero;
///
/// The Silicon's battery slot, if it has one.
///
///
/// Is the Silicon currently dead?
///
public bool Dead;
// BatterySystem took issue with how this was used, so I'm coming back to it at a later date, when more foundational Silicon stuff is implemented.
// ///
// /// The entity to get the battery from.
// ///
// public EntityUid BatteryOverride? = EntityUid.Invalid;
///
/// The type of silicon this is.
///
///
/// Any new types of Silicons should be added to the enum.
/// Setting this to Npc will delay charge state updates by LastDrainTime and skip battery heat calculations
///
[DataField(customTypeSerializer: typeof(EnumSerializer))]
public Enum EntityType = SiliconType.Npc;
///
/// Is this silicon battery powered?
///
///
/// If true, should go along with a battery component. One will not be added automatically.
///
[DataField]
public bool BatteryPowered;
///
/// How much power is drained by this Silicon every second by default.
///
[DataField]
public float DrainPerSecond = 50f;
///
/// The percentages at which the silicon will enter each state.
///
///
/// The Silicon will always be Full at 100%.
/// Setting a value to null will disable that state.
/// Setting Critical to 0 will cause the Silicon to never enter the dead state.
///
[DataField]
public float? ChargeThresholdMid = 0.5f;
///
[DataField]
public float? ChargeThresholdLow = 0.25f;
///
[DataField]
public float? ChargeThresholdCritical = 0.1f;
[DataField]
public ProtoId BatteryAlert = "BorgBattery";
[DataField]
public ProtoId NoBatteryAlert = "BorgBatteryNone";
///
/// The amount the Silicon will be slowed at each charge state.
///
[DataField(required: true)]
public Dictionary SpeedModifierThresholds = default!;
[DataField]
public float FireStackMultiplier = 1f;
///
/// Whether or not a Silicon will cancel all sleep events.
/// Maybe you want an android that can sleep as well as drink APCs? I'm not going to judge.
///
[DataField]
public bool DoSiliconsDreamOfElectricSheep;
}