ninja 2 electric boogaloo (#15534)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-09-10 07:20:27 +01:00
committed by GitHub
parent 25c8a03276
commit 24810d916b
153 changed files with 3892 additions and 78 deletions

View File

@@ -1,5 +1,4 @@
using Content.Shared.Implants;
using Content.Shared.Implants.Components;
using Content.Shared.Roles;
using JetBrains.Annotations;
using Robust.Shared.Prototypes;
@@ -13,7 +12,6 @@ namespace Content.Server.Jobs;
[UsedImplicitly]
public sealed partial class AddImplantSpecial : JobSpecial
{
[DataField("implants", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<EntityPrototype>))]
public HashSet<String> Implants { get; private set; } = new();
@@ -21,19 +19,6 @@ public sealed partial class AddImplantSpecial : JobSpecial
{
var entMan = IoCManager.Resolve<IEntityManager>();
var implantSystem = entMan.System<SharedSubdermalImplantSystem>();
var xformQuery = entMan.GetEntityQuery<TransformComponent>();
if (!xformQuery.TryGetComponent(mob, out var xform))
return;
foreach (var implantId in Implants)
{
var implant = entMan.SpawnEntity(implantId, xform.Coordinates);
if (!entMan.TryGetComponent<SubdermalImplantComponent>(implant, out var implantComp))
return;
implantSystem.ForceImplant(mob, implant, implantComp);
}
implantSystem.AddImplants(mob, Implants);
}
}