IdentityBlockerComponent.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using Content.Shared.Inventory;
  2. using Robust.Shared.GameStates;
  3. namespace Content.Shared.IdentityManagement.Components;
  4. [RegisterComponent, NetworkedComponent]
  5. public sealed partial class IdentityBlockerComponent : Component
  6. {
  7. [DataField]
  8. public bool Enabled = true;
  9. /// <summary>
  10. /// What part of your face does this cover? Eyes, mouth, or full?
  11. /// </summary>
  12. [DataField]
  13. public IdentityBlockerCoverage Coverage = IdentityBlockerCoverage.FULL;
  14. }
  15. public enum IdentityBlockerCoverage
  16. {
  17. NONE = 0,
  18. MOUTH = 1 << 0,
  19. EYES = 1 << 1,
  20. FULL = MOUTH | EYES
  21. }
  22. /// <summary>
  23. /// Raised on an entity and relayed to inventory to determine if its identity should be knowable.
  24. /// </summary>
  25. public sealed class SeeIdentityAttemptEvent : CancellableEntityEventArgs, IInventoryRelayEvent
  26. {
  27. // i.e. masks, helmets, or glasses.
  28. public SlotFlags TargetSlots => SlotFlags.MASK | SlotFlags.HEAD | SlotFlags.EYES;
  29. // cumulative coverage from each relayed slot
  30. public IdentityBlockerCoverage TotalCoverage = IdentityBlockerCoverage.NONE;
  31. }