return airlock blacklist for emag (#3078)
Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
parent
5e17d015c6
commit
c243649067
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue