Implant whitelist/blacklisting (#20678)

* add whitelist and blacklist to implant and implanter components

* handle whitelist and blacklist in systems

* move hardcoded whitelist/blacklist to base implanter + add admeme implanter

* give implants sensible whitelists

* cleaner CheckTarget and fix

* remove unused imports

* network lists

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-10-27 03:34:02 +01:00
committed by GitHub
parent b4da282341
commit bb65818bf3
7 changed files with 100 additions and 11 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Containers.ItemSlots;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization;
@@ -15,6 +16,19 @@ public sealed partial class ImplanterComponent : Component
public const string ImplanterSlotId = "implanter_slot";
public const string ImplantSlotId = "implant";
/// <summary>
/// Whitelist to check entities against before implanting.
/// Implants get their own whitelist which is checked afterwards.
/// </summary>
[DataField, AutoNetworkedField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Blacklist to check entities against before implanting.
/// </summary>
[DataField, AutoNetworkedField]
public EntityWhitelist? Blacklist;
/// <summary>
/// Used for implanters that start with specific implants
/// </summary>

View File

@@ -1,4 +1,5 @@
using Content.Shared.Actions;
using Content.Shared.Whitelist;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@@ -34,6 +35,20 @@ public sealed partial class SubdermalImplantComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("permanent"), AutoNetworkedField]
public bool Permanent = false;
/// <summary>
/// Target whitelist for this implant specifically.
/// Only checked if the implanter allows implanting on the target to begin with.
/// </summary>
[DataField]
public EntityWhitelist? Whitelist;
/// <summary>
/// Target blacklist for this implant specifically.
/// Only checked if the implanter allows implanting on the target to begin with.
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
}
/// <summary>