// © SUNRISE, An EULA/CLA with a hosting restriction, full text: https://github.com/space-sunrise/space-station-14/blob/master/CLA.txt using Content.Shared.Mind.Components; using Content.Shared.Mobs.Systems; using Content.Shared.NPC; using Content.Shared.StatusIcon; using Content.Shared.StatusIcon.Components; using Robust.Client.Player; using Robust.Shared.Prototypes; using Content.Shared._Sunrise.Disease; using Content.Shared.Ghost; namespace Content.Client._Sunrise.Disease; public sealed class SickSystem : EntitySystem { [Dependency] private readonly IPrototypeManager _prototype = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly IPlayerManager _playerManager = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnGetStatusIcon); SubscribeNetworkEvent(OnUpdateInfect); } private void OnUpdateInfect(UpdateInfectionsEvent args) { EnsureComp(GetEntity(args.Uid)).Inited = true; } private void OnGetStatusIcon(EntityUid uid, SickComponent component, ref GetStatusIconsEvent args) { if (component.Inited) { if (_playerManager.LocalEntity != null) { if (HasComp(_playerManager.LocalEntity.Value) || HasComp(_playerManager.LocalEntity.Value)) { if (!_mobState.IsDead(uid) && !HasComp(uid) && TryComp(uid, out var mindContainer) && mindContainer.ShowExamineInfo) { args.StatusIcons.Add(_prototype.Index(component.Icon)); } } } } } }