mirror of
https://github.com/DeltaV-Station/Delta-v.git
synced 2026-10-02 00:57:26 +00:00
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
using Content.Shared._Harmony.Conspirators.Components;
|
|
using Content.Shared.Antag;
|
|
using Content.Shared.Ghost; // DeltaV
|
|
using Robust.Shared.GameStates;
|
|
using Robust.Shared.Player;
|
|
|
|
namespace Content.Shared._Harmony.Conspirators.EntitySystems;
|
|
|
|
public abstract class SharedConspiratorSystem : EntitySystem // looking at blood bound to see how the icons work
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
|
|
SubscribeLocalEvent<ConspiratorComponent, ComponentGetStateAttemptEvent>(OnConspiratorAttemptGetState);
|
|
}
|
|
|
|
private void OnConspiratorAttemptGetState(
|
|
Entity<ConspiratorComponent> entity,
|
|
ref ComponentGetStateAttemptEvent args)
|
|
{
|
|
args.Cancelled = !CanGetState(args.Player);
|
|
}
|
|
|
|
private bool CanGetState(ICommonSession? player)
|
|
{
|
|
if (player?.AttachedEntity is not { } uid)
|
|
return true;
|
|
|
|
return HasComp<ConspiratorComponent>(uid) || HasComp<ShowAntagIconsComponent>(uid) || HasComp<GhostComponent>(uid); // DeltaV - add GhostComponent
|
|
}
|
|
}
|