Files
crystall-punk-14/Content.Server/_CP14/DayCycle/CP14CloudShadowsSystem.cs
Ed 7477b7c869 Cloud shadows (#298)
* not worked

* fix

* Update CP14CloudShadowsComponent.cs

* more params in component
2024-07-03 17:33:38 +03:00

25 lines
715 B
C#

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));
}
}