using Content.Shared.Inventory; using Content.Shared.Popups; using Content.Shared.Strip.Components; using Robust.Shared.Serialization; namespace Content.Shared.Strip; public sealed class ThievingSystem : EntitySystem { public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnBeforeStrip); SubscribeLocalEvent>((e, c, ev) => OnBeforeStrip(e, c, ev.Args)); } private void OnBeforeStrip(EntityUid uid, ThievingComponent component, BeforeStripEvent args) { args.Stealth = (ThievingStealth) Math.Max((sbyte) args.Stealth, (sbyte) component.Stealth); args.Additive -= component.StripTimeReduction; args.Multiplier *= component.StripTimeMultiplier; } public PopupType? GetPopupTypeFromStealth(ThievingStealth stealth) { switch (stealth) { case ThievingStealth.Hidden: return null; case ThievingStealth.Subtle: return PopupType.Small; default: return PopupType.Large; } } } [Serializable, NetSerializable] public enum ThievingStealth : sbyte { /// /// Target sees a large popup indicating that an item is being stolen by who /// Obvious = 0, /// /// Target sees a small popup indicating that an item is being stolen /// Subtle = 1, /// /// Target does not see any popup regarding the stealing of an item /// Hidden = 2 }