CatStation/Content.Shared/Lightning/SharedLightningSystem.cs
Pieter-Jan Briers 5168b5f3d4
IoC source gen compatibility (#43863)
* IoC source gen compatibility

Can be merged before or after https://github.com/space-wizards/RobustToolbox/pull/6549 doesn't really matter.

* Missed a spot
2026-05-09 03:29:58 +00:00

19 lines
716 B
C#

using Robust.Shared.Random;
namespace Content.Shared.Lightning;
public abstract partial class SharedLightningSystem : EntitySystem
{
[Dependency] private IRobustRandom _random = default!;
/// <summary>
/// Picks a random sprite state for the lightning. It's just data that gets passed to the <see cref="BeamComponent"/>
/// </summary>
/// <returns>Returns a string "lightning_" + the chosen random number.</returns>
public string LightningRandomizer()
{
//When the lightning is made with TryCreateBeam, spawns random sprites for each beam to make it look nicer.
var spriteStateNumber = _random.Next(1, 12);
return ("lightning_" + spriteStateNumber);
}
}