Anomaly Cores (#21306)

* add first anomaly core

* meme

* 5 min to 10 min
fix yml

* fix

* Update doc

* no static price
This commit is contained in:
Ed
2023-11-01 02:20:52 +03:00
committed by GitHub
parent 3a4c40c29b
commit 96ff529c82
31 changed files with 596 additions and 1 deletions

View File

@@ -0,0 +1,42 @@
using Content.Server.Anomaly.Effects;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Anomaly.Components;
/// <summary>
/// This component exists for a limited time, and after it expires it modifies the entity, greatly reducing its value and changing its visuals
/// </summary>
[RegisterComponent, Access(typeof(AnomalyCoreSystem))]
public sealed partial class AnomalyCoreComponent : Component
{
/// <summary>
/// Amount of time required for the core to decompose into an inert core
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double TimeToDecay = 600;
/// <summary>
/// The moment of core decay. It is set during entity initialization.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
public TimeSpan DecayMoment;
/// <summary>
/// The starting value of the entity.
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double StartPrice = 10000;
/// <summary>
/// The value of the object sought during decaying
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public double EndPrice = 200;
/// <summary>
/// Has the core decayed?
/// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)]
public bool IsDecayed;
}