revenant emag whitelist (#21849)

* add MalfunctionWhitelist

* whitelist a few things

* locutus of borg

* support blacklist

---------

Co-authored-by: deltanedas <@deltanedas:kde.org>
This commit is contained in:
deltanedas
2023-11-27 21:39:29 +00:00
committed by GitHub
parent f09b5f3f62
commit ab645fb77b
3 changed files with 31 additions and 0 deletions

View 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.
}
}

View 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

View File

@@ -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