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

25 lines
715 B
C#
Raw Permalink Normal View History

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