2024-03-22 17:23:33 +09:00
|
|
|
using Content.Shared._White.Cult.Components;
|
|
|
|
|
using Content.Shared.Examine;
|
|
|
|
|
using Content.Shared.Interaction.Events;
|
|
|
|
|
|
|
|
|
|
namespace Content.Shared._White.Cult.Systems;
|
|
|
|
|
|
|
|
|
|
public sealed class ConcealableSystem : EntitySystem
|
|
|
|
|
{
|
|
|
|
|
public override void Initialize()
|
|
|
|
|
{
|
|
|
|
|
base.Initialize();
|
|
|
|
|
|
|
|
|
|
SubscribeLocalEvent<ConcealableComponent, ExamineAttemptEvent>(OnExamine);
|
2024-07-25 13:32:56 +00:00
|
|
|
SubscribeLocalEvent<ConcealableComponent, GettingInteractedWithAttemptEvent>(OnInteract);
|
2024-03-22 17:23:33 +09:00
|
|
|
}
|
|
|
|
|
|
2024-07-25 13:32:56 +00:00
|
|
|
private void OnInteract(Entity<ConcealableComponent> ent, ref GettingInteractedWithAttemptEvent args)
|
2024-03-22 17:23:33 +09:00
|
|
|
{
|
|
|
|
|
if (ent.Comp is {Concealed: true, ExaminableWhileConcealed: false})
|
|
|
|
|
args.Cancel();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void OnExamine(Entity<ConcealableComponent> ent, ref ExamineAttemptEvent args)
|
|
|
|
|
{
|
|
|
|
|
if (ent.Comp is {Concealed: true, ExaminableWhileConcealed: false})
|
|
|
|
|
args.Cancel();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public sealed class ConcealEvent : EntityEventArgs
|
|
|
|
|
{
|
|
|
|
|
public bool Conceal;
|
|
|
|
|
|
|
|
|
|
public ConcealEvent(bool conceal)
|
|
|
|
|
{
|
|
|
|
|
Conceal = conceal;
|
|
|
|
|
}
|
|
|
|
|
}
|