Implanters and Subdermal Implants (#11840)
Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
25
Content.Server/Implants/ImplantedSystem.cs
Normal file
25
Content.Server/Implants/ImplantedSystem.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using Content.Shared.Implants.Components;
|
||||
using Robust.Shared.Containers;
|
||||
|
||||
namespace Content.Server.Implants;
|
||||
|
||||
public sealed partial class ImplanterSystem
|
||||
{
|
||||
public void InitializeImplanted()
|
||||
{
|
||||
SubscribeLocalEvent<ImplantedComponent, ComponentInit>(OnImplantedInit);
|
||||
SubscribeLocalEvent<ImplantedComponent, ComponentShutdown>(OnShutdown);
|
||||
}
|
||||
|
||||
private void OnImplantedInit(EntityUid uid, ImplantedComponent component, ComponentInit args)
|
||||
{
|
||||
component.ImplantContainer = _container.EnsureContainer<Container>(uid, ImplanterComponent.ImplantSlotId);
|
||||
component.ImplantContainer.OccludesLight = false;
|
||||
}
|
||||
|
||||
private void OnShutdown(EntityUid uid, ImplantedComponent component, ComponentShutdown args)
|
||||
{
|
||||
//If the entity is deleted, get rid of the implants
|
||||
_container.CleanContainer(component.ImplantContainer);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user