Files
tbd-station-14/Content.Server/Singularity/StartSingularityEngineCommand.cs
TemporalOroboros 9a72b05a50 Splits the singularity into its component parts + ECS singularity + Support for singularities in containers. (#12132)
* InitialCommit (Broken)

* Fixes compile errors

* PR comments. More doc comments. Fixes

* Makes a singularity/event horizon without radiation/physics a valid state to be in

* VV 'fake' setters, fixes the visualizer, fixes the singularity trying to eat itself instead of nearby things.

* Removes unused dependency from Content.Client.GravityWellSystem

* Testing containment and fake VV setters for SingularityGeneratorComponent

* Fixes gravity wells (broken due to LookupFlags.None). Adds recursive Event Horizon consumption

* Fix merge skew

* Fixes for the master merge

* Fix engine commit

* Dirty is obsolete

* Switch over dirty

* Fix requested changes

* ambiant -> ambient

* Moves EventHorionComponent to Shared

* Proper container handling

* Fixes master merge. Fixes post insertion assertions for singularities. Extends proper container handling to gravity wells and the distortion shader.

* Better support for admemes throwing singularities.

* Moves update timing from accumulators to target times

* Update doc comments
2022-12-19 20:47:15 -06:00

46 lines
1.8 KiB
C#

using Content.Server.Administration;
using Content.Server.ParticleAccelerator.Components;
using Content.Server.Singularity.Components;
using Content.Server.Singularity.EntitySystems;
using Content.Shared.Administration;
using Content.Shared.Singularity.Components;
using Robust.Shared.Console;
namespace Content.Server.Singularity
{
[AdminCommand(AdminFlags.Admin)]
public sealed class StartSingularityEngineCommand : IConsoleCommand
{
public string Command => "startsingularityengine";
public string Description => "Automatically turns on the particle accelerator and containment field emitters.";
public string Help => $"{Command}";
public void Execute(IConsoleShell shell, string argStr, string[] args)
{
if (args.Length != 0)
{
shell.WriteLine($"Invalid amount of arguments: {args.Length}.\n{Help}");
return;
}
var entityManager = IoCManager.Resolve<IEntityManager>();
var entitySystemManager = IoCManager.Resolve<IEntitySystemManager>();
foreach (var comp in entityManager.EntityQuery<EmitterComponent>())
{
entitySystemManager.GetEntitySystem<EmitterSystem>().SwitchOn(comp);
}
foreach (var comp in entityManager.EntityQuery<RadiationCollectorComponent>())
{
entitySystemManager.GetEntitySystem<RadiationCollectorSystem>().SetCollectorEnabled(comp.Owner, true, null, comp);
}
foreach (var comp in entityManager.EntityQuery<ParticleAcceleratorControlBoxComponent>())
{
comp.RescanParts();
comp.SetStrength(ParticleAcceleratorPowerState.Level0);
comp.SwitchOn();
}
shell.WriteLine("Done!");
}
}
}