1
0

RottingComponent.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Content.Shared.Damage;
  2. using Robust.Shared.GameStates;
  3. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  4. namespace Content.Shared.Atmos.Rotting;
  5. /// <summary>
  6. /// Tracking component for stuff that has started to rot.
  7. /// Only the current stage is networked to the client.
  8. /// </summary>
  9. [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
  10. [Access(typeof(SharedRottingSystem))]
  11. public sealed partial class RottingComponent : Component
  12. {
  13. /// <summary>
  14. /// Whether or not the rotting should deal damage
  15. /// </summary>
  16. [DataField]
  17. public bool DealDamage = true;
  18. /// <summary>
  19. /// When the next check will happen for rot progression + effects like damage and ammonia
  20. /// </summary>
  21. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
  22. [AutoPausedField]
  23. public TimeSpan NextRotUpdate = TimeSpan.Zero;
  24. /// <summary>
  25. /// How long in between each rot update.
  26. /// </summary>
  27. [DataField]
  28. public TimeSpan RotUpdateRate = TimeSpan.FromSeconds(5);
  29. /// <summary>
  30. /// How long has this thing been rotting?
  31. /// </summary>
  32. [DataField]
  33. public TimeSpan TotalRotTime = TimeSpan.Zero;
  34. /// <summary>
  35. /// The damage dealt by rotting.
  36. /// </summary>
  37. [DataField]
  38. public DamageSpecifier Damage = new()
  39. {
  40. DamageDict = new()
  41. {
  42. { "Blunt", 0.06 },
  43. { "Cellular", 0.06 }
  44. }
  45. };
  46. }