Files
tbd-station-14/Content.Client/Overlays/ShowMindShieldIconsSystem.cs
Zachary Higgs c5045883ac Fake mindshield componentry and Implanter (#34079)
* Fake Mindshield (With some bad sprites)

- Add FakeMindshield System and Component

- Add FakeMindsheildImplantSystem and Component

- modify ShowMindShieldIconsSystem to check for FakeMindshields

- add all supporting yaml for the Implants, action and uplink

- add loc file stuff

- add unfinished sprites

* Cleanup, add to thief toolbox, remove metagame

- Move Implant sameness check to AFTER the implant DoAfter
to prevent instant identification of Deception Implants

- cleanup the systems and components

- add the fake mindshield to the Thief toolbox

* part 1 of fixing the folder problem

* Make the fakemindshield sprite folder lowercase

* CR - Move ImplantCheck into shared, cleanup

- Moved ImplantCheck and eventsubscription into Shared

- Remove Client/Server extensions of FakeMindshieldImplantSystem and
FakeMindShieldSystem and make shared Sealed

- make OnToggleMindshield Private, use the event!

* CR - Cleanup extra lines, fix some Prototype

- cleaned up extra liens in ImplanterSystem and
SharedFakeMindshieldSystem from when i was developing

- Uplink catalog no longer lists the implant in 2 spots,
only implants now, also uses the On state action icon

- added a comment about why it's reraising the action event
rather than directly interacting with the FakeMindshield Component

* Fake Mindshield CR:

- Added a comment about IsEnabled

- moved OnFakeMindShieldToggle to Entity<> from Uid, Comp

- fixed some formatting in uplink_catalog

* CR - Add a bit more comment
2025-01-27 18:37:46 -08:00

39 lines
1.5 KiB
C#

using Content.Shared.Mindshield.Components;
using Content.Shared.Overlays;
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon.Components;
using Robust.Shared.Prototypes;
namespace Content.Client.Overlays;
public sealed class ShowMindShieldIconsSystem : EquipmentHudSystem<ShowMindShieldIconsComponent>
{
[Dependency] private readonly IPrototypeManager _prototype = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<MindShieldComponent, GetStatusIconsEvent>(OnGetStatusIconsEvent);
SubscribeLocalEvent<FakeMindShieldComponent, GetStatusIconsEvent>(OnGetStatusIconsEventFake);
}
// TODO: Probably need to get this OFF of client since this can be read by bad actors rather easily
// ...imagine cheating in a game about silly paper dolls
private void OnGetStatusIconsEventFake(EntityUid uid, FakeMindShieldComponent component, ref GetStatusIconsEvent ev)
{
if(!IsActive)
return;
if (component.IsEnabled && _prototype.TryIndex(component.MindShieldStatusIcon, out var fakeStatusIconPrototype))
ev.StatusIcons.Add(fakeStatusIconPrototype);
}
private void OnGetStatusIconsEvent(EntityUid uid, MindShieldComponent component, ref GetStatusIconsEvent ev)
{
if (!IsActive)
return;
if (_prototype.TryIndex(component.MindShieldStatusIcon, out var iconPrototype))
ev.StatusIcons.Add(iconPrototype);
}
}