Gamerule Entities (#15513)

This commit is contained in:
Nemanja
2023-04-24 01:20:51 -04:00
committed by GitHub
parent 8943c2a10e
commit 39cc02b8f9
124 changed files with 3097 additions and 4342 deletions

View File

@@ -1,6 +1,6 @@
using System.Linq;
using Content.Server.GameTicking;
using Content.Server.StationEvents.Components;
using Content.Server.GameTicking.Rules.Components;
using Content.Shared.Dragon;
using Robust.Server.GameObjects;
using Robust.Shared.Map.Components;
@@ -10,8 +10,6 @@ namespace Content.Server.Dragon;
public sealed partial class DragonSystem
{
public override string Prototype => "Dragon";
private int RiftsMet(DragonComponent component)
{
var finished = 0;
@@ -28,9 +26,11 @@ public sealed partial class DragonSystem
return finished;
}
public override void Started()
protected override void Started(EntityUid uid, DragonRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
{
var spawnLocations = EntityManager.EntityQuery<MapGridComponent, TransformComponent>().ToList();
base.Started(uid, component, gameRule, args);
var spawnLocations = EntityQuery<MapGridComponent, TransformComponent>().ToList();
if (spawnLocations.Count == 0)
return;
@@ -39,16 +39,8 @@ public sealed partial class DragonSystem
Spawn("MobDragon", location.Item2.MapPosition);
}
public override void Ended()
{
return;
}
private void OnRiftRoundEnd(RoundEndTextAppendEvent args)
{
if (!RuleAdded)
return;
var dragons = EntityQuery<DragonComponent>(true).ToList();
if (dragons.Count == 0)