ninja 2 electric boogaloo (#15534)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
21
Content.Server/Implants/AutoImplantSystem.cs
Normal file
21
Content.Server/Implants/AutoImplantSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using Content.Server.Implants.Components;
|
||||
|
||||
namespace Content.Server.Implants;
|
||||
|
||||
public sealed class AutoImplantSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SubdermalImplantSystem _subdermalImplant = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<AutoImplantComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, AutoImplantComponent comp, MapInitEvent args)
|
||||
{
|
||||
_subdermalImplant.AddImplants(uid, comp.Implants);
|
||||
RemComp<AutoImplantComponent>(uid);
|
||||
}
|
||||
}
|
||||
17
Content.Server/Implants/Components/AutoImplantComponent.cs
Normal file
17
Content.Server/Implants/Components/AutoImplantComponent.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.List;
|
||||
|
||||
namespace Content.Server.Implants.Components;
|
||||
|
||||
/// <summary>
|
||||
/// Implants an entity automatically on MapInit.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class AutoImplantComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// List of implants to inject.
|
||||
/// </summary>
|
||||
[DataField("implants", required: true, customTypeSerializer: typeof(PrototypeIdListSerializer<EntityPrototype>))]
|
||||
public List<string> Implants = new();
|
||||
}
|
||||
Reference in New Issue
Block a user