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:
@@ -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.
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user