using Content.Server.Tesla.EntitySystems;
using Robust.Shared.Audio;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; // DeltaV
using Robust.Shared.Timing; // DeltaV
namespace Content.Server.Tesla.Components;
///
/// A component that tracks an entity's saturation level from absorbing other creatures by touch, and spawns new entities when the saturation limit is reached.
///
[RegisterComponent, Access(typeof(TeslaEnergyBallSystem))]
[AutoGenerateComponentPause] // DeltaV
public sealed partial class TeslaEnergyBallComponent : Component
{
///
/// how much energy will Tesla get by eating various things. Walls, people, anything.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float ConsumeStuffEnergy = 2f;
///
/// The amount of energy this entity contains. Once the limit is reached, the energy will be spent to spawn mini-energy balls
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float Energy;
///
/// The amount of energy an entity must reach in order to zero the energy and create another entity
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float NeedEnergyToSpawn = 100f;
///
/// The amount of energy to which the tesla must reach in order to be destroyed.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public float EnergyToDespawn = -540f; // DeltaV: -100<-540, make the Tesla take as long to fail as the singulo.
///
/// Played when energy reaches the lower limit (and entity destroyed)
///
[DataField]
public SoundSpecifier? SoundCollapse;
///
/// Entities that spawn when the energy limit is reached
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId SpawnProto = "TeslaMiniEnergyBall";
///
/// Entity, spun when tesla gobbles with touch.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public EntProtoId ConsumeEffectProto = "EffectTeslaSparks";
// Begin DeltaV additions
///
/// The amount of energy drained passively per update.
///
[DataField]
public float PassiveEnergyDrainRate = 3f;
///
/// The timespan of next update.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUpdateTime = TimeSpan.Zero;
// End DeltaV
}