2024-08-10 08:12:13 +10:00
|
|
|
using Content.Shared._CP14.DayCycle.Components;
|
2024-07-03 17:33:38 +03:00
|
|
|
using Robust.Shared.Random;
|
|
|
|
|
|
|
|
|
|
namespace Content.Server._CP14.DayCycle;
|
|
|
|
|
|
2024-08-10 08:12:13 +10:00
|
|
|
public sealed class CP14CloudShadowsSystem : EntitySystem
|
2024-07-03 17:33:38 +03:00
|
|
|
{
|
|
|
|
|
[Dependency] private readonly IRobustRandom _random = default!;
|
|
|
|
|
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<CP14CloudShadowsComponent, MapInitEvent>(OnMapInit);
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-10 08:12:13 +10:00
|
|
|
private void OnMapInit(Entity<CP14CloudShadowsComponent> entity, ref MapInitEvent args)
|
2024-07-03 17:33:38 +03:00
|
|
|
{
|
2024-08-10 08:12:13 +10:00
|
|
|
entity.Comp.CloudSpeed = _random.NextVector2(-entity.Comp.MaxSpeed, entity.Comp.MaxSpeed);
|
2024-07-03 17:33:38 +03:00
|
|
|
}
|
|
|
|
|
}
|