ash storms just the facts

This commit is contained in:
deltanedas
2024-12-18 01:27:23 +00:00
committed by tommy
parent cef7597e8d
commit 800fd928b8
12 changed files with 331 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
using Content.Shared.Destructible.Thresholds;
using Content.Shared.Weather;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.DeltaV.Weather;
/// <summary>
/// Makes weather randomly happen every so often.
/// </summary>
[RegisterComponent, Access(typeof(WeatherSchedulerSystem))]
[AutoGenerateComponentPause]
public sealed partial class WeatherSchedulerComponent : Component
{
/// <summary>
/// Weather stages to schedule.
/// </summary>
[DataField(required: true)]
public List<WeatherStage> Stages = new();
/// <summary>
/// The index of <see cref="Stages"/> to use next, wraps back to the start.
/// </summary>
[DataField]
public int Stage;
/// <summary>
/// When to go to the next step of the schedule.
/// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoPausedField]
public TimeSpan NextUpdate;
}
/// <summary>
/// A stage in a weather schedule.
/// </summary>
[Serializable, DataDefinition]
public partial struct WeatherStage
{
/// <summary>
/// A range of how long the stage can last for, in seconds.
/// </summary>
[DataField(required: true)]
public MinMax Duration = new(0, 0);
/// <summary>
/// The weather prototype to add, or null for clear weather.
/// </summary>
[DataField]
public ProtoId<WeatherPrototype>? Weather;
/// <summary>
/// Alert message to send in chat for players on the map when it starts.
/// </summary>
[DataField]
public LocId? Message;
}