From 3d0655ef8af424b751f9c9a09bb894e5dfb16024 Mon Sep 17 00:00:00 2001 From: William Lemon Date: Mon, 22 Sep 2025 15:46:44 +1000 Subject: [PATCH] Make Night Vision Goggles cause you to ignore Flash Protection (#4378) * Using NVGs now make you VERY flash vulnerable * Removed redundant After * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Content.Server/Flash/FlashSystem.cs | 2 +- .../_DV/Overlays/NightVisionSystem.cs | 25 +++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 Content.Server/_DV/Overlays/NightVisionSystem.cs diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index 200647aaa9..460f2f14f0 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -236,7 +236,7 @@ namespace Content.Server.Flash public readonly EntityUid Target; public readonly EntityUid? User; public readonly EntityUid? Used; - public readonly bool IgnoreProtection; //DeltaV: allow flashing to ignore flash protection + public bool IgnoreProtection; //DeltaV: allow flashing to ignore flash protection public FlashAttemptEvent(EntityUid target, EntityUid? user, EntityUid? used, bool ignoreProtection) //DeltaV: allow flashing to ignore flash protection { diff --git a/Content.Server/_DV/Overlays/NightVisionSystem.cs b/Content.Server/_DV/Overlays/NightVisionSystem.cs new file mode 100644 index 0000000000..dfc41def34 --- /dev/null +++ b/Content.Server/_DV/Overlays/NightVisionSystem.cs @@ -0,0 +1,25 @@ +using Content.Server.Flash; +using Content.Server.Flash.Components; +using Content.Shared._Goobstation.Overlays; +using Content.Shared.Inventory; + +namespace Content.Server._DV.Overlays; + +public sealed partial class NightVisionSystem : EntitySystem +{ + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnFlashAttempt); + } + + private void OnFlashAttempt(Entity ent, ref FlashAttemptEvent args) + { + if (!ent.Comp.IsActive) + return; + + args.Uncancel(); + args.IgnoreProtection = true; + } +}