mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-01 16:47:26 +00:00
* this works suspiciously well but also it's not actually that much * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * conflict stuff * and put the tags back in * halve glimmer created by psionics and alter the knife a bit * finally add the guidebook. hopefully this passes tests when I take it off a draft * fix yaml stuff hopefully * fix merge conflict stuff * and put my stuff back * more merge conflicts aaaaaaaa * dying * put implants back in * c# it up * Apply suggestions from code review Co-authored-by: pathetic meowmeow <uhhadd@gmail.com> Signed-off-by: pathetic meowmeow <uhhadd@gmail.com> * fix some stuff and add mindbreaker to the guidebook * make audio stuff mono * aaaaaaaa --------- Signed-off-by: pathetic meowmeow <uhhadd@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Janet Blackquill <uhhadd@gmail.com>
37 lines
1.3 KiB
C#
37 lines
1.3 KiB
C#
using Content.Shared.Containers.ItemSlots;
|
|
using Content.Shared.Implants.Components;
|
|
using Content.Shared.Interaction;
|
|
|
|
namespace Content.Shared._DV.Implants;
|
|
|
|
public sealed class DVInsertableImplantSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
|
|
[Dependency] private readonly MetaDataSystem _metaData = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<DVInsertableImplantComponent, AfterInteractEvent>(OnAfterInteract);
|
|
}
|
|
|
|
private void OnAfterInteract(Entity<DVInsertableImplantComponent> ent, ref AfterInteractEvent args)
|
|
{
|
|
if (args.Handled || !args.CanReach || !TryComp<ImplanterComponent>(args.Target, out var implanter))
|
|
return;
|
|
|
|
if (_itemSlots.GetItemOrNull(args.Target.Value, ImplanterComponent.ImplanterSlotId) is not null)
|
|
return;
|
|
|
|
implanter.ImplantOnly = true;
|
|
Dirty(args.Target.Value, implanter);
|
|
|
|
_itemSlots.Insert(args.Target.Value, implanter.ImplanterSlot, ent, args.User, true);
|
|
args.Handled = true;
|
|
|
|
_metaData.SetEntityName(args.Target.Value, Loc.GetString(ent.Comp.ImplanterName));
|
|
_metaData.SetEntityDescription(args.Target.Value, Loc.GetString(ent.Comp.ImplanterDescription));
|
|
}
|
|
}
|