]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
revenant emag whitelist (#21849)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Mon, 27 Nov 2023 21:39:29 +0000 (21:39 +0000)
committerGitHub <noreply@github.com>
Mon, 27 Nov 2023 21:39:29 +0000 (14:39 -0700)
* add MalfunctionWhitelist

* whitelist a few things

* locutus of borg

* support blacklist

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs
Content.Shared/Revenant/Components/RevenantComponent.cs
Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml

index cb20a1b86834cc76814ebb0f502610c8728169bc..eb6eb5a426f2a881ab9b3dd7fdd61cc6aad77c3a 100644 (file)
@@ -321,6 +321,12 @@ public sealed partial class RevenantSystem
 
         foreach (var ent in _lookup.GetEntitiesInRange(uid, component.MalfunctionRadius))
         {
+            if (component.MalfunctionWhitelist?.IsValid(ent, EntityManager) == false)
+                continue;
+
+            if (component.MalfunctionBlacklist?.IsValid(ent, EntityManager) == true)
+                continue;
+
             _emag.DoEmagEffect(uid, ent); //it does not emag itself. adorable.
         }
     }
index 9e92762b18297f1f18d464642cc168dfea75b23c..b3d47e22f9732b64ca8e7a91f1d14b2126115a4e 100644 (file)
@@ -1,6 +1,7 @@
 using System.Numerics;
 using Content.Shared.FixedPoint;
 using Content.Shared.Store;
+using Content.Shared.Whitelist;
 using Robust.Shared.GameStates;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -182,6 +183,19 @@ public sealed partial class RevenantComponent : Component
     /// </summary>
     [ViewVariables(VVAccess.ReadWrite), DataField("malfunctionRadius")]
     public float MalfunctionRadius = 3.5f;
+
+    /// <summary>
+    /// Whitelist for entities that can be emagged by malfunction.
+    /// Used to prevent ultra gamer things like ghost emagging chem or instantly launching the shuttle.
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? MalfunctionWhitelist;
+
+    /// <summary>
+    /// Whitelist for entities that can never be emagged by malfunction.
+    /// </summary>
+    [DataField]
+    public EntityWhitelist? MalfunctionBlacklist;
     #endregion
 
     #region Visualizer
index 866e15735fe843bb6216ada22463571d7334f5bc..68ebf52dc06548eb823a0bbe6bb31434b073c52b 100644 (file)
     rules: ghost-role-information-revenant-rules
   - type: GhostTakeoverAvailable
   - type: Revenant
+    malfunctionWhitelist:
+      components:
+      # emag lockers open
+      - EntityStorage
+      # emag doors open
+      - Airlock
+      # troll medical to help get kills
+      - StasisBed
+      - EmaggableMedibot
+      # borg become killer
+      - EmagSiliconLaw
   - type: PointLight
     color: MediumPurple
     radius: 2