Files
tbd-station-14/Content.Server/StationEvents/Components/MeteorSchedulerComponent.cs
TsjipTsjip 71eb4d9178 CVarify meteor behavior (#29030)
* CVarify meteor behavior

* Cache value to reduce CVar calls, hook into OnValueChanged

* _cfg is still null at construction time, fixed by just making it set up on Started instead

* Invoke immediately! Learning more every step of the way.

* Move cached value initialisation to Initialize call

* Add explicit supercall
2024-06-15 10:03:20 -04:00

25 lines
726 B
C#

using Content.Shared.Random;
using Robust.Shared.Prototypes;
namespace Content.Server.StationEvents.Components;
/// <summary>
/// This is used for running meteor swarm events at regular intervals.
/// </summary>
[RegisterComponent, Access(typeof(MeteorSchedulerSystem)), AutoGenerateComponentPause]
public sealed partial class MeteorSchedulerComponent : Component
{
/// <summary>
/// The weights for which swarms will be selected.
/// </summary>
[DataField]
public ProtoId<WeightedRandomEntityPrototype> Config = "DefaultConfig";
/// <summary>
/// The time at which the next swarm occurs.
/// </summary>
[DataField, AutoPausedField]
public TimeSpan NextSwarmTime = TimeSpan.Zero;
}