Много чего
This commit is contained in:
14
Content.Server/_White/AddImplant/AddImplantComponent.cs
Normal file
14
Content.Server/_White/AddImplant/AddImplantComponent.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
||||
|
||||
namespace Content.Server._White.AddImplant;
|
||||
|
||||
/// <summary>
|
||||
/// WD.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
public sealed partial class AddImplantComponent : Component
|
||||
{
|
||||
[DataField("implants", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<EntityPrototype>))]
|
||||
public HashSet<String> Implants { get; private set; } = new();
|
||||
}
|
||||
21
Content.Server/_White/AddImplant/AddImplantSystem.cs
Normal file
21
Content.Server/_White/AddImplant/AddImplantSystem.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
using Content.Shared.Examine;
|
||||
using Content.Shared.Implants;
|
||||
|
||||
namespace Content.Server._White.AddImplant;
|
||||
|
||||
public sealed class AddImplantSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly SharedSubdermalImplantSystem _implantSystem = default!;
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<AddImplantComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
public void OnMapInit(Entity<AddImplantComponent> ent, ref MapInitEvent args)
|
||||
{
|
||||
_implantSystem.AddImplants(ent.Owner, ent.Comp.Implants);
|
||||
RemComp<AddImplantComponent>(ent.Owner);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user