* 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
25 lines
726 B
C#
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;
|
|
|
|
}
|