AnomalyCoreComponent.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Robust.Shared.GameStates;
  2. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  3. namespace Content.Shared.Anomaly.Components;
  4. /// <summary>
  5. /// This component exists for a limited time, and after it expires it modifies the entity, greatly reducing its value and changing its visuals
  6. /// </summary>
  7. [RegisterComponent, NetworkedComponent, Access(typeof(SharedAnomalyCoreSystem))]
  8. [AutoGenerateComponentState]
  9. public sealed partial class AnomalyCoreComponent : Component
  10. {
  11. /// <summary>
  12. /// Amount of time required for the core to decompose into an inert core
  13. /// </summary>
  14. [DataField, ViewVariables(VVAccess.ReadWrite)]
  15. public double TimeToDecay = 600;
  16. /// <summary>
  17. /// The moment of core decay. It is set during entity initialization.
  18. /// </summary>
  19. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
  20. [AutoNetworkedField]
  21. public TimeSpan DecayMoment;
  22. /// <summary>
  23. /// The starting value of the entity.
  24. /// </summary>
  25. [DataField, ViewVariables(VVAccess.ReadWrite)]
  26. public double StartPrice = 10000;
  27. /// <summary>
  28. /// The value of the object sought during decaying
  29. /// </summary>
  30. [DataField, ViewVariables(VVAccess.ReadWrite)]
  31. public double EndPrice = 200;
  32. /// <summary>
  33. /// Has the core decayed?
  34. /// </summary>
  35. [DataField, ViewVariables(VVAccess.ReadWrite)]
  36. [AutoNetworkedField]
  37. public bool IsDecayed;
  38. /// <summary>
  39. /// The amount of GORILLA charges the core has.
  40. /// Not used when <see cref="IsDecayed"/> is false.
  41. /// </summary>
  42. [DataField, ViewVariables(VVAccess.ReadWrite)]
  43. [AutoNetworkedField]
  44. public int Charge = 5;
  45. }