25 lines
814 B
C#
25 lines
814 B
C#
using Content.Shared.Implants;
|
|
using Content.Shared.Roles;
|
|
using JetBrains.Annotations;
|
|
using Robust.Shared.Prototypes;
|
|
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Set;
|
|
|
|
namespace Content.Server.Jobs;
|
|
|
|
/// <summary>
|
|
/// Adds implants on spawn to the entity
|
|
/// </summary>
|
|
[UsedImplicitly]
|
|
public sealed partial class AddImplantSpecial : JobSpecial
|
|
{
|
|
[DataField("implants", customTypeSerializer: typeof(PrototypeIdHashSetSerializer<EntityPrototype>))]
|
|
public HashSet<String> Implants { get; private set; } = new();
|
|
|
|
public override void AfterEquip(EntityUid mob)
|
|
{
|
|
var entMan = IoCManager.Resolve<IEntityManager>();
|
|
var implantSystem = entMan.System<SharedSubdermalImplantSystem>();
|
|
implantSystem.AddImplants(mob, Implants);
|
|
}
|
|
}
|