KudzuGrowthRule.cs 767 B

1234567891011121314151617181920
  1. using Content.Server.GameTicking.Rules.Components;
  2. using Content.Server.StationEvents.Components;
  3. using Content.Shared.GameTicking.Components;
  4. namespace Content.Server.StationEvents.Events;
  5. public sealed class KudzuGrowthRule : StationEventSystem<KudzuGrowthRuleComponent>
  6. {
  7. protected override void Started(EntityUid uid, KudzuGrowthRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
  8. {
  9. base.Started(uid, component, gameRule, args);
  10. // Pick a place to plant the kudzu.
  11. if (!TryFindRandomTile(out var targetTile, out _, out var targetGrid, out var targetCoords))
  12. return;
  13. Spawn("Kudzu", targetCoords);
  14. Sawmill.Info($"Spawning a Kudzu at {targetTile} on {targetGrid}");
  15. }
  16. }