return airlock blacklist for emag (#3078)

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas 2025-03-01 11:32:42 +00:00 committed by GitHub
parent 5e17d015c6
commit c243649067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 18 additions and 0 deletions

View File

@ -1,5 +1,6 @@
using Content.Shared.Emag.Systems;
using Content.Shared.Tag;
using Content.Shared.Whitelist; // DeltaV
using Robust.Shared.Audio;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
@ -20,6 +21,12 @@ public sealed partial class EmagComponent : Component
[AutoNetworkedField]
public ProtoId<TagPrototype> EmagImmuneTag = "EmagImmune";
/// <summary>
/// DeltaV: Blacklist for entities that cannot be emagged with this.
/// </summary>
[DataField]
public EntityWhitelist? Blacklist;
/// <summary>
/// What type of emag effect this device will do
/// </summary>

View File

@ -7,6 +7,7 @@ using Content.Shared.IdentityManagement;
using Content.Shared.Interaction;
using Content.Shared.Popups;
using Content.Shared.Tag;
using Content.Shared.Whitelist; // DeltaV
using Robust.Shared.Audio.Systems;
using Robust.Shared.Serialization;
@ -20,6 +21,7 @@ namespace Content.Shared.Emag.Systems;
/// 5. Optionally, set Repeatable on the event to true if you don't want the emagged component to be added
public sealed class EmagSystem : EntitySystem
{
[Dependency] private readonly EntityWhitelistSystem _whitelist = default!; // DeltaV
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
[Dependency] private readonly SharedChargesSystem _charges = default!;
[Dependency] private readonly SharedPopupSystem _popup = default!;
@ -61,6 +63,11 @@ public sealed class EmagSystem : EntitySystem
if (_tag.HasTag(target, ent.Comp.EmagImmuneTag))
return false;
// Begin DeltaV Additions
if (_whitelist.IsBlacklistPass(ent.Comp.Blacklist, target))
return false;
// End DeltaV Additions
TryComp<LimitedChargesComponent>(ent, out var charges);
if (_charges.IsEmpty(ent, charges))
{

View File

@ -6,6 +6,9 @@
description: The all-in-one hacking solution. Friend of any syndicate. The iconic EMAG.
components:
- type: Emag
blacklist: # DeltaV - prevent emag removing access from doors
components:
- Airlock
- type: Sprite
sprite: Objects/Tools/emag.rsi
state: icon

View File

@ -6,6 +6,7 @@
components:
- type: Emag
emagType: Access # LockSystem has its type changed so this only affects airlocks
blacklist: null # allow airlocks
- type: Sprite
sprite: _DV/Objects/Tools/doorjack.rsi
- type: Item