mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-18 05:59:03 +03:00
* blindness rework - damaged eyes now simulate legal blindness * hEY THATS FOR DEMONSTRATION PURPOSES ONLY AAA * attributions * makes eyeclosecomponent adminbus compatible * useshader(null) (cherry picked from commit aa6645c8e956be6abfffb58b43e67f479c45f962)
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using Content.Shared.Eye.Blinding.Components;
|
|
using Content.Shared.Inventory.Events;
|
|
using Content.Shared.Inventory;
|
|
|
|
namespace Content.Shared.Eye.Blinding.Systems;
|
|
|
|
public sealed class BlindfoldSystem : EntitySystem
|
|
{
|
|
[Dependency] private readonly BlindableSystem _blindableSystem = default!;
|
|
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<BlindfoldComponent, GotEquippedEvent>(OnEquipped);
|
|
SubscribeLocalEvent<BlindfoldComponent, GotUnequippedEvent>(OnUnequipped);
|
|
SubscribeLocalEvent<BlindfoldComponent, InventoryRelayedEvent<CanSeeAttemptEvent>>(OnBlindfoldTrySee);
|
|
}
|
|
|
|
private void OnBlindfoldTrySee(Entity<BlindfoldComponent> blindfold, ref InventoryRelayedEvent<CanSeeAttemptEvent> args)
|
|
{
|
|
args.Args.Cancel();
|
|
}
|
|
|
|
private void OnEquipped(Entity<BlindfoldComponent> blindfold, ref GotEquippedEvent args)
|
|
{
|
|
_blindableSystem.UpdateIsBlind(args.Equipee);
|
|
}
|
|
|
|
private void OnUnequipped(Entity<BlindfoldComponent> blindfold, ref GotUnequippedEvent args)
|
|
{
|
|
_blindableSystem.UpdateIsBlind(args.Equipee);
|
|
}
|
|
}
|