Blindness, Narcolepsy, Pacifism, and uncontrollable sneezing (#11489)

* start work

* blindness actually works now

* doc

* doc you too.

* i desire to sneeze my lungs out

* no punchie

* s

Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com>
This commit is contained in:
Moony
2022-09-29 18:23:12 -05:00
committed by GitHub
parent 36583b89af
commit 0c46f99004
12 changed files with 267 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using Content.Shared.Examine;
using Content.Shared.Eye.Blinding;
using Content.Shared.IdentityManagement;
using Robust.Shared.Network;
namespace Content.Shared.Traits.Assorted;
/// <summary>
/// This handles permanent blindness, both the examine and the actual effect.
/// </summary>
public sealed class PermanentBlindnessSystem : EntitySystem
{
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly SharedBlindingSystem _blinding = default!;
/// <inheritdoc/>
public override void Initialize()
{
SubscribeLocalEvent<PermanentBlindnessComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<PermanentBlindnessComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<PermanentBlindnessComponent, ExaminedEvent>(OnExamined);
}
private void OnExamined(EntityUid uid, PermanentBlindnessComponent component, ExaminedEvent args)
{
if (args.IsInDetailsRange && !_net.IsClient)
{
args.PushMarkup(Loc.GetString("permanent-blindness-trait-examined", ("target", Identity.Entity(uid, EntityManager))));
}
}
private void OnShutdown(EntityUid uid, PermanentBlindnessComponent component, ComponentShutdown args)
{
_blinding.AdjustBlindSources(uid, false);
}
private void OnStartup(EntityUid uid, PermanentBlindnessComponent component, ComponentStartup args)
{
_blinding.AdjustBlindSources(uid, true);
}
}