Files
tbd-station-14/Content.Server/StationEvents/Events/RandomSpawnRule.cs
deltanedas a3a1538d32 move gamerule components to shared (#28572)
* move MinMax to shared

* cleanup MinMax

* move other ticking components to shared just because

* remove unused prototype file

* update everything to use shared components

* test

* test 2

* test 3

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
2024-06-04 21:53:24 +10:00

20 lines
677 B
C#

using Content.Server.GameTicking.Rules.Components;
using Content.Server.StationEvents.Components;
using Content.Shared.GameTicking.Components;
namespace Content.Server.StationEvents.Events;
public sealed class RandomSpawnRule : StationEventSystem<RandomSpawnRuleComponent>
{
protected override void Started(EntityUid uid, RandomSpawnRuleComponent comp, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, comp, gameRule, args);
if (TryFindRandomTile(out _, out _, out _, out var coords))
{
Sawmill.Info($"Spawning {comp.Prototype} at {coords}");
Spawn(comp.Prototype, coords);
}
}
}