Files
crystall-punk-14/Content.Server/_CP14/DayCycle/CP14CloudShadowsSystem.cs

22 lines
613 B
C#
Raw Permalink Normal View History

2024-08-10 08:12:13 +10:00
using Content.Shared._CP14.DayCycle.Components;
using Robust.Shared.Random;
namespace Content.Server._CP14.DayCycle;
2024-08-10 08:12:13 +10:00
public sealed class CP14CloudShadowsSystem : EntitySystem
{
[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-08-10 08:12:13 +10:00
entity.Comp.CloudSpeed = _random.NextVector2(-entity.Comp.MaxSpeed, entity.Comp.MaxSpeed);
}
}