2020-12-17 07:20:57 +00:00
|
|
|
using Content.Server.Administration;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Server.ParticleAccelerator.Components;
|
|
|
|
|
using Content.Server.Singularity.Components;
|
2020-12-17 07:20:57 +00:00
|
|
|
using Content.Shared.Administration;
|
2021-06-09 22:19:39 +02:00
|
|
|
using Content.Shared.Singularity.Components;
|
2021-02-01 16:49:43 -08:00
|
|
|
using Robust.Shared.Console;
|
2020-12-17 07:20:57 +00:00
|
|
|
using Robust.Shared.GameObjects;
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
namespace Content.Server.Singularity
|
2020-12-17 07:20:57 +00:00
|
|
|
{
|
|
|
|
|
[AdminCommand(AdminFlags.Admin)]
|
2021-02-01 16:49:43 -08:00
|
|
|
public class StartSingularityEngineCommand : IConsoleCommand
|
2020-12-17 07:20:57 +00:00
|
|
|
{
|
|
|
|
|
public string Command => "startsingularityengine";
|
|
|
|
|
public string Description => "Automatically turns on the particle accelerator and containment field emitters.";
|
|
|
|
|
public string Help => $"{Command}";
|
|
|
|
|
|
2021-02-01 16:49:43 -08:00
|
|
|
public void Execute(IConsoleShell shell, string argStr, string[] args)
|
2020-12-17 07:20:57 +00:00
|
|
|
{
|
|
|
|
|
if (args.Length != 0)
|
|
|
|
|
{
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine($"Invalid amount of arguments: {args.Length}.\n{Help}");
|
2020-12-17 07:20:57 +00:00
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var entityManager = IoCManager.Resolve<IEntityManager>();
|
2021-06-27 05:40:03 +02:00
|
|
|
foreach (var comp in entityManager.ComponentManager.EntityQuery<EmitterComponent>())
|
2020-12-17 07:20:57 +00:00
|
|
|
{
|
2021-06-27 05:40:03 +02:00
|
|
|
comp.SwitchOn();
|
2020-12-17 07:20:57 +00:00
|
|
|
}
|
2021-06-27 05:40:03 +02:00
|
|
|
foreach (var comp in entityManager.ComponentManager.EntityQuery<RadiationCollectorComponent>())
|
2021-05-28 10:44:13 +01:00
|
|
|
{
|
2021-06-27 05:40:03 +02:00
|
|
|
comp.Collecting = true;
|
2021-05-28 10:44:13 +01:00
|
|
|
}
|
2021-06-27 05:40:03 +02:00
|
|
|
foreach (var comp in entityManager.ComponentManager.EntityQuery<ParticleAcceleratorControlBoxComponent>())
|
2020-12-17 07:20:57 +00:00
|
|
|
{
|
2021-06-27 05:40:03 +02:00
|
|
|
comp.RescanParts();
|
|
|
|
|
comp.SetStrength(ParticleAcceleratorPowerState.Level0);
|
|
|
|
|
comp.SwitchOn();
|
2020-12-17 07:20:57 +00:00
|
|
|
}
|
2021-02-01 16:49:43 -08:00
|
|
|
shell.WriteLine("Done!");
|
2020-12-17 07:20:57 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|