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>
This commit is contained in:
parent
3f5c69a083
commit
3d0655ef8a
|
|
@ -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
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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<NightVisionComponent, FlashAttemptEvent>(OnFlashAttempt);
|
||||
}
|
||||
|
||||
private void OnFlashAttempt(Entity<NightVisionComponent> ent, ref FlashAttemptEvent args)
|
||||
{
|
||||
if (!ent.Comp.IsActive)
|
||||
return;
|
||||
|
||||
args.Uncancel();
|
||||
args.IgnoreProtection = true;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue