Files
crystall-punk-14/Content.Server/_CP14/DayCycle/CP14CloudShadowsSystem.cs
2024-08-10 01:12:13 +03:00

22 lines
613 B
C#

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