Revolutionaries (#18477)

Co-authored-by: coolmankid12345 <coolmankid12345@users.noreply.github.com>
Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
coolmankid12345
2023-10-04 21:47:33 -04:00
committed by GitHub
parent 2c69dd2df9
commit 9df5ded9ad
51 changed files with 1246 additions and 38 deletions

View File

@@ -1,10 +1,11 @@
using System.Linq;
using System.Linq;
using Content.Shared.Actions;
using Content.Shared.Implants.Components;
using Content.Shared.Interaction;
using Content.Shared.Interaction.Events;
using Content.Shared.Mobs;
using Content.Shared.Tag;
using JetBrains.Annotations;
using Robust.Shared.Containers;
using Robust.Shared.Network;
@@ -52,6 +53,9 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
}
}
}
var ev = new ImplantImplantedEvent(uid, component.ImplantedEntity.Value);
RaiseLocalEvent(uid, ref ev);
}
private void OnRemoveAttempt(EntityUid uid, SubdermalImplantComponent component, ContainerGettingRemovedAttemptEvent args)
@@ -128,7 +132,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
/// </summary>
/// <param name="target">the implanted entity</param>
/// <param name="implant">the implant</param>
/// <param name="component">the implant component</param>
[PublicAPI]
public void ForceRemove(EntityUid target, EntityUid implant)
{
if (!TryComp<ImplantedComponent>(target, out var implanted))
@@ -144,6 +148,7 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
/// Removes and deletes implants by force
/// </summary>
/// <param name="target">The entity to have implants removed</param>
[PublicAPI]
public void WipeImplants(EntityUid target)
{
if (!TryComp<ImplantedComponent>(target, out var implanted))
@@ -180,3 +185,23 @@ public sealed class ImplantRelayEvent<T> where T : notnull
Event = ev;
}
}
/// <summary>
/// Event that is raised whenever someone is implanted with any given implant.
/// Raised on the the implant entity.
/// </summary>
/// <remarks>
/// implant implant implant implant
/// </remarks>
[ByRefEvent]
public readonly struct ImplantImplantedEvent
{
public readonly EntityUid Implant;
public readonly EntityUid? Implanted;
public ImplantImplantedEvent(EntityUid implant, EntityUid? implanted)
{
Implant = implant;
Implanted = implanted;
}
}