RandomStatusActivationComponent.cs 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. // SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
  2. // SPDX-FileCopyrightText: 2025 Piras314 <p1r4s@proton.me>
  3. // SPDX-FileCopyrightText: 2025 gluesniffler <159397573+gluesniffler@users.noreply.github.com>
  4. //
  5. // SPDX-License-Identifier: AGPL-3.0-or-later
  6. using Robust.Shared.GameStates;
  7. using Robust.Shared.Prototypes;
  8. using Content.Shared.StatusEffect;
  9. using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
  10. namespace Content.Shared._Shitmed.BodyEffects.Subsystems;
  11. [RegisterComponent]
  12. [AutoGenerateComponentPause]
  13. public sealed partial class RandomStatusActivationComponent : Component
  14. {
  15. /// <summary>
  16. /// List of status effects to roll while the organ is installed.
  17. /// </summary>
  18. [DataField(required: true)]
  19. public Dictionary<ProtoId<StatusEffectPrototype>, string> StatusEffects = new();
  20. /// <summary>
  21. /// How long the status effect should last for.
  22. /// </summary>
  23. [DataField]
  24. public TimeSpan? Duration;
  25. /// <summary>
  26. /// What is the minimum time between activations?
  27. /// </summary>
  28. [DataField]
  29. public TimeSpan MinActivationTime = TimeSpan.FromSeconds(60);
  30. /// <summary>
  31. /// What is the maximum time between activations?
  32. /// </summary>
  33. [DataField]
  34. public TimeSpan MaxActivationTime = TimeSpan.FromSeconds(300);
  35. /// <summary>
  36. /// The next time the organ will activate.
  37. /// </summary>
  38. [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
  39. public TimeSpan NextUpdate;
  40. }