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:
keronshb
2022-11-20 01:49:37 -05:00
committed by GitHub
parent a5dff7eee7
commit 671324bef8
48 changed files with 1633 additions and 79 deletions

View File

@@ -29,6 +29,7 @@ using Content.Shared.Destructible;
using static Content.Shared.Storage.SharedStorageComponent;
using Content.Shared.ActionBlocker;
using Content.Shared.CombatMode;
using Content.Shared.Implants.Components;
using Content.Shared.Movement.Events;
namespace Content.Server.Storage.EntitySystems
@@ -62,6 +63,7 @@ namespace Content.Server.Storage.EntitySystems
SubscribeLocalEvent<ServerStorageComponent, GetVerbsEvent<UtilityVerb>>(AddTransferVerbs);
SubscribeLocalEvent<ServerStorageComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<ServerStorageComponent, ActivateInWorldEvent>(OnActivate);
SubscribeLocalEvent<ServerStorageComponent, OpenStorageImplantEvent>(OnImplantActivate);
SubscribeLocalEvent<ServerStorageComponent, AfterInteractEvent>(AfterInteract);
SubscribeLocalEvent<ServerStorageComponent, DestructionEventArgs>(OnDestroy);
SubscribeLocalEvent<ServerStorageComponent, StorageInteractWithItemEvent>(OnInteractWithItem);
@@ -277,6 +279,17 @@ namespace Content.Server.Storage.EntitySystems
OpenStorageUI(uid, args.User, storageComp);
}
/// <summary>
/// Specifically for storage implants.
/// </summary>
private void OnImplantActivate(EntityUid uid, ServerStorageComponent storageComp, OpenStorageImplantEvent args)
{
if (args.Handled || !TryComp<TransformComponent>(uid, out var xform))
return;
OpenStorageUI(uid, xform.ParentUid, storageComp);
}
/// <summary>
/// Allows a user to pick up entities by clicking them, or pick up all entities in a certain radius
/// around a click.