using Robust.Shared.GameStates;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Anomaly.Components;
///
/// This component exists for a limited time, and after it expires it modifies the entity, greatly reducing its value and changing its visuals
///
[RegisterComponent, NetworkedComponent, Access(typeof(SharedAnomalyCoreSystem))]
[AutoGenerateComponentState]
public sealed partial class AnomalyCoreComponent : Component
{
///
/// Amount of time required for the core to decompose into an inert core
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double TimeToDecay = 600;
///
/// The moment of core decay. It is set during entity initialization.
///
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public TimeSpan DecayMoment;
///
/// The starting value of the entity.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double StartPrice = 10000;
///
/// The value of the object sought during decaying
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double EndPrice = 200;
///
/// Has the core decayed?
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool IsDecayed;
///
/// The amount of GORILLA charges the core has.
/// Not used when is false.
///
[DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public int Charge = 5;
}