Files
Delta-v/Content.Shared/StatusEffectNew/Components/StatusEffectComponent.cs
4186c8caa2 Weather entities (#41427)
* weather status effect entities

* proto port + fixes

* Update weather.yml

* fix visuals

* Update SharedWeatherSystem.cs

* Update SharedWeatherSystem.cs

* Update WeatherSystem.cs

* Thanks Slarti, thats a much better

* Update WeatherSystem.cs

* Update StencilOverlay.Weather.cs

* Update Content.Client/Overlays/StencilOverlay.Weather.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Update Content.Shared/StatusEffectNew/Components/StatusEffectComponent.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Update Content.Client/Overlays/StencilOverlay.Weather.cs

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>

* Revise weather command help descriptions

Updated weather command help texts for clarity.

* Merge branch 'master' into ed-14-11-2025-weather-entities

* Tayrtahn review apply

* fixes and cleanup

---------

Co-authored-by: Pok <113675512+Pok27@users.noreply.github.com>
Co-authored-by: slarticodefast <161409025+slarticodefast@users.noreply.github.com>
2026-06-29 12:44:02 +02:00

60 lines
2.3 KiB
C#

using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.StatusEffectNew.Components;
/// <summary>
/// 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(fieldDeltas: true), AutoGenerateComponentPause]
[Access(typeof(StatusEffectsSystem))]
[EntityCategory("StatusEffects")]
public sealed partial class StatusEffectComponent : Component
{
/// <summary>
/// The entity that this status effect is applied to.
/// </summary>
[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>
/// We actually don't want to network this, that way client can apply an effect it's receiving properly!
[DataField]
public bool Applied;
/// <summary>
/// Whitelist, by which it is determined whether this status effect can be imposed on a particular entity.
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Blacklist, by which it is determined whether this status effect can be imposed on a particular entity.
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
/// <summary>
/// QoL function, returns total duration of this status effect.
/// </summary>
[ViewVariables]
public TimeSpan Duration => EndEffectTime == null ? TimeSpan.MaxValue : EndEffectTime.Value - StartEffectTime;
}