diff --git a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs index 6c135e1a07..2bbcad4bc4 100644 --- a/Content.Shared/Clothing/EntitySystems/MaskSystem.cs +++ b/Content.Shared/Clothing/EntitySystems/MaskSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Actions; +using Content.Shared.Actions; using Content.Shared.Clothing.Components; using Content.Shared.Inventory; using Content.Shared.Inventory.Events; @@ -68,6 +68,6 @@ public sealed class MaskSystem : EntitySystem RaiseLocalEvent(uid, ref maskEv); var wearerEv = new WearerMaskToggledEvent(mask.IsToggled); - RaiseLocalEvent(uid, ref wearerEv); + RaiseLocalEvent(wearer, ref wearerEv); } } diff --git a/Content.Shared/IdentityManagement/Components/IdentityBlockerComponent.cs b/Content.Shared/IdentityManagement/Components/IdentityBlockerComponent.cs index 4dc9e97b01..3857063783 100644 --- a/Content.Shared/IdentityManagement/Components/IdentityBlockerComponent.cs +++ b/Content.Shared/IdentityManagement/Components/IdentityBlockerComponent.cs @@ -1,4 +1,4 @@ -using Content.Shared.Inventory; +using Content.Shared.Inventory; using Robust.Shared.GameStates; namespace Content.Shared.IdentityManagement.Components; @@ -7,6 +7,20 @@ namespace Content.Shared.IdentityManagement.Components; public sealed partial class IdentityBlockerComponent : Component { public bool Enabled = true; + + /// + /// What part of your face does this cover? Eyes, mouth, or full? + /// + [DataField] + public IdentityBlockerCoverage Coverage = IdentityBlockerCoverage.FULL; +} + +public enum IdentityBlockerCoverage +{ + NONE = 0, + MOUTH = 1 << 0, + EYES = 1 << 1, + FULL = MOUTH | EYES } /// @@ -14,6 +28,9 @@ public sealed partial class IdentityBlockerComponent : Component /// public sealed class SeeIdentityAttemptEvent : CancellableEntityEventArgs, IInventoryRelayEvent { - // i.e. masks or helmets. - public SlotFlags TargetSlots => SlotFlags.MASK | SlotFlags.HEAD; + // i.e. masks, helmets, or glasses. + public SlotFlags TargetSlots => SlotFlags.MASK | SlotFlags.HEAD | SlotFlags.EYES; + + // cumulative coverage from each relayed slot + public IdentityBlockerCoverage TotalCoverage = IdentityBlockerCoverage.NONE; } diff --git a/Content.Shared/IdentityManagement/SharedIdentitySystem.cs b/Content.Shared/IdentityManagement/SharedIdentitySystem.cs index 7cb5f41b8a..a02e00f0b1 100644 --- a/Content.Shared/IdentityManagement/SharedIdentitySystem.cs +++ b/Content.Shared/IdentityManagement/SharedIdentitySystem.cs @@ -23,7 +23,11 @@ public abstract class SharedIdentitySystem : EntitySystem private void OnSeeIdentity(EntityUid uid, IdentityBlockerComponent component, SeeIdentityAttemptEvent args) { if (component.Enabled) - args.Cancel(); + { + args.TotalCoverage |= component.Coverage; + if(args.TotalCoverage == IdentityBlockerCoverage.FULL) + args.Cancel(); + } } protected virtual void OnComponentInit(EntityUid uid, IdentityComponent component, ComponentInit args) diff --git a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml index cda7bc2f55..e969118bbe 100644 --- a/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml +++ b/Resources/Prototypes/Entities/Clothing/Eyes/glasses.yml @@ -122,6 +122,7 @@ sprite: Clothing/Eyes/Glasses/outlawglasses.rsi - type: VisionCorrection - type: IdentityBlocker + coverage: EYES - type: entity parent: ClothingEyesBase @@ -140,6 +141,8 @@ tags: - HamsterWearable - WhitelistChameleon + - type: IdentityBlocker + coverage: EYES - type: entity parent: ClothingEyesBase @@ -162,6 +165,8 @@ guides: - Security - type: ShowSecurityIcons + - type: IdentityBlocker + coverage: EYES - type: entity parent: ClothingEyesBase diff --git a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml index e71c615c13..77655e7cdb 100644 --- a/Resources/Prototypes/Entities/Clothing/Masks/masks.yml +++ b/Resources/Prototypes/Entities/Clothing/Masks/masks.yml @@ -262,6 +262,8 @@ - type: IngestionBlocker - type: Item storedRotation: -90 + - type: IdentityBlocker + coverage: MOUTH - type: entity parent: ClothingMaskBase @@ -475,6 +477,7 @@ - type: Clothing sprite: Clothing/Mask/neckgaiter.rsi - type: IdentityBlocker + coverage: MOUTH - type: Tag tags: - WhitelistChameleon