Files
tbd-station-14/Content.Server/StationEvents/Events/KudzuGrowthRule.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

21 lines
767 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 KudzuGrowthRule : StationEventSystem<KudzuGrowthRuleComponent>
{
protected override void Started(EntityUid uid, KudzuGrowthRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
base.Started(uid, component, gameRule, args);
// Pick a place to plant the kudzu.
if (!TryFindRandomTile(out var targetTile, out _, out var targetGrid, out var targetCoords))
return;
Spawn("Kudzu", targetCoords);
Sawmill.Info($"Spawning a Kudzu at {targetTile} on {targetGrid}");
}
}