Revert "Adds blinding + blindfolds (#8688)" (#9689)

This reverts commit 7a7ab5e8c1.
This commit is contained in:
Moony
2022-07-13 16:50:35 -05:00
committed by GitHub
parent ef6d0344de
commit a655891a8d
21 changed files with 1 additions and 305 deletions

View File

@@ -1,26 +0,0 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Eye.Blinding
{
[RegisterComponent]
[NetworkedComponent]
public sealed class BlindableComponent : Component
{
/// <description>
/// How many sources of blindness are affecting us?
/// </description>
[DataField("sources")]
public int Sources = 0;
/// <description>
/// Used to ensure that this doesn't break with sandbox or admin tools.
/// This is not "enabled/disabled".
/// </description>
public bool LightSetup = false;
/// <description>
/// Gives an extra frame of blindness to reenable light manager during
/// </description>
public bool GraceFrame = false;
}
}

View File

@@ -1,12 +0,0 @@
using Robust.Shared.GameStates;
namespace Content.Shared.Eye.Blinding
{
[RegisterComponent]
[NetworkedComponent]
public sealed class BlindfoldComponent : Component
{
[ViewVariables]
public bool IsActive = false;
}
}

View File

@@ -1,40 +0,0 @@
using Content.Shared.Inventory.Events;
using Content.Shared.Inventory;
using Content.Shared.Item;
namespace Content.Shared.Eye.Blinding
{
public sealed class SharedBlindingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<BlindfoldComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<BlindfoldComponent, GotUnequippedEvent>(OnUnequipped);
}
private void OnEquipped(EntityUid uid, BlindfoldComponent component, GotEquippedEvent args)
{
if (!TryComp<SharedItemComponent>(uid, out var clothing) || clothing.SlotFlags == SlotFlags.PREVENTEQUIP) // we live in a society
return;
// Is the clothing in its actual slot?
if (!clothing.SlotFlags.HasFlag(args.SlotFlags))
return;
component.IsActive = true;
if (!TryComp<BlindableComponent>(args.Equipee, out var blindComp))
return;
blindComp.Sources++;
}
private void OnUnequipped(EntityUid uid, BlindfoldComponent component, GotUnequippedEvent args)
{
if (!component.IsActive)
return;
component.IsActive = false;
if (!TryComp<BlindableComponent>(args.Equipee, out var blindComp))
return;
blindComp.Sources--;
}
}
}