Add multipart machines system (#35969)

This commit is contained in:
BarryNorfolk
2025-06-02 16:02:41 +02:00
committed by GitHub
parent 9a38d66df2
commit b2d0f7ed28
32 changed files with 987 additions and 331 deletions

View File

@@ -1,9 +1,11 @@
using Content.Server.Administration;
using Content.Server.Machines.EntitySystems;
using Content.Server.ParticleAccelerator.Components;
using Content.Server.ParticleAccelerator.EntitySystems;
using Content.Server.Singularity.Components;
using Content.Server.Singularity.EntitySystems;
using Content.Shared.Administration;
using Content.Shared.Machines.Components;
using Content.Shared.Singularity.Components;
using Robust.Shared.Console;
@@ -45,12 +47,15 @@ namespace Content.Server.Singularity
}
// Setup PA
var multipartMachineManager = entitySystemManager.GetEntitySystem<MultipartMachineSystem>();
var paSystem = entitySystemManager.GetEntitySystem<ParticleAcceleratorSystem>();
var paQuery = entityManager.EntityQueryEnumerator<ParticleAcceleratorControlBoxComponent>();
while (paQuery.MoveNext(out var paId, out var paControl))
{
paSystem.RescanParts(paId, controller: paControl);
if (!paControl.Assembled)
if (!entityManager.TryGetComponent<MultipartMachineComponent>(paId, out var machine))
continue;
if (!multipartMachineManager.Rescan((paId, machine)))
continue;
paSystem.SetStrength(paId, ParticleAcceleratorPowerState.Level0, comp: paControl);