Add a sleep delay to Nocturine (NewStatusEffect version) (#40231)

* Initial commit

* Minor fix

* Why is this uncommented here? Hmmm

* No wait this can't be here, oops

* Do better time

* Also guidebook

* Review changes

* Add rejuvination, fix mispredicts
This commit is contained in:
SlamBamActionman
2025-09-26 22:05:34 +02:00
committed by GitHub
parent dc3f5e3564
commit c7117f38ac
7 changed files with 179 additions and 33 deletions

View File

@@ -9,7 +9,7 @@ namespace Content.Shared.StatusEffectNew.Components;
/// Marker component for all status effects - every status effect entity should have it.
/// Provides a link between the effect and the affected entity, and some data common to all status effects.
/// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(fieldDeltas: true), AutoGenerateComponentPause]
[Access(typeof(StatusEffectsSystem))]
[EntityCategory("StatusEffects")]
public sealed partial class StatusEffectComponent : Component
@@ -20,12 +20,24 @@ public sealed partial class StatusEffectComponent : Component
[DataField, AutoNetworkedField]
public EntityUid? AppliedTo;
/// <summary>
/// When this effect will start. Set to Timespan.Zero to start the effect immediately.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField]
public TimeSpan StartEffectTime;
/// <summary>
/// When this effect will end. If Null, the effect lasts indefinitely.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField, AutoNetworkedField]
public TimeSpan? EndEffectTime;
/// <summary>
/// If true, this status effect has been applied. Used to ensure that <see cref="StatusEffectAppliedEvent"/> only fires once.
/// </summary>
[DataField, AutoNetworkedField]
public bool Applied;
/// <summary>
/// Whitelist, by which it is determined whether this status effect can be imposed on a particular entity.
/// </summary>