diff --git a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs index cb20a1b868..eb6eb5a426 100644 --- a/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs +++ b/Content.Server/Revenant/EntitySystems/RevenantSystem.Abilities.cs @@ -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. } } diff --git a/Content.Shared/Revenant/Components/RevenantComponent.cs b/Content.Shared/Revenant/Components/RevenantComponent.cs index 9e92762b18..b3d47e22f9 100644 --- a/Content.Shared/Revenant/Components/RevenantComponent.cs +++ b/Content.Shared/Revenant/Components/RevenantComponent.cs @@ -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 /// [ViewVariables(VVAccess.ReadWrite), DataField("malfunctionRadius")] public float MalfunctionRadius = 3.5f; + + /// + /// Whitelist for entities that can be emagged by malfunction. + /// Used to prevent ultra gamer things like ghost emagging chem or instantly launching the shuttle. + /// + [DataField] + public EntityWhitelist? MalfunctionWhitelist; + + /// + /// Whitelist for entities that can never be emagged by malfunction. + /// + [DataField] + public EntityWhitelist? MalfunctionBlacklist; #endregion #region Visualizer diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml index 866e15735f..68ebf52dc0 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml @@ -58,6 +58,17 @@ 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