diff --git a/Content.Server/Strip/StrippableSystem.cs b/Content.Server/Strip/StrippableSystem.cs index 1229e1c1bb..ccf8e5a6c2 100644 --- a/Content.Server/Strip/StrippableSystem.cs +++ b/Content.Server/Strip/StrippableSystem.cs @@ -245,7 +245,12 @@ namespace Content.Server.Strip return true; } - var doAfterArgs = new DoAfterEventArgs(user, component.HandStripDelay, CancellationToken.None, component.Owner) + var userEv = new BeforeStripEvent(component.HandStripDelay); + RaiseLocalEvent(user, userEv); + var ev = new BeforeGettingStrippedEvent(userEv.Time, userEv.Stealth); + RaiseLocalEvent(component.Owner, ev); + + var doAfterArgs = new DoAfterEventArgs(user, ev.Time, CancellationToken.None, component.Owner) { ExtraCheck = Check, BreakOnStun = true, @@ -292,9 +297,9 @@ namespace Content.Server.Strip return false; } - if (!_inventorySystem.CanUnequip(user, component.Owner, slot, out _)) + if (!_inventorySystem.CanUnequip(user, component.Owner, slot, out var reason)) { - user.PopupMessageCursor(Loc.GetString("strippable-component-cannot-unequip-message", ("owner", component.Owner))); + user.PopupMessageCursor(reason); return false; } @@ -376,7 +381,6 @@ namespace Content.Server.Strip return true; } - var userEv = new BeforeStripEvent(component.HandStripDelay); RaiseLocalEvent(user, userEv); var ev = new BeforeGettingStrippedEvent(userEv.Time, userEv.Stealth); diff --git a/Content.Shared/Inventory/InventorySystem.Equip.cs b/Content.Shared/Inventory/InventorySystem.Equip.cs index aeb0489bf7..2c110520bd 100644 --- a/Content.Shared/Inventory/InventorySystem.Equip.cs +++ b/Content.Shared/Inventory/InventorySystem.Equip.cs @@ -240,8 +240,8 @@ public abstract partial class InventorySystem return true; // Is the actor currently stripping the target? Here we could check if the actor has the stripping UI open, but - // that requires server/client specific code. so lets just check if they **could** open the stripping UI. - // Note that this doesn't check that the item is equipped by the target, as this is done elsewhere. + // that requires server/client specific code. + // Uhhh TODO, fix this. This doesn't even fucking check if the target item is IN the targets inventory. return actor != target && HasComp(target) && HasComp(actor) && diff --git a/Content.Shared/Strip/Components/ThievingComponent.cs b/Content.Shared/Strip/Components/ThievingComponent.cs index 7afcea5a85..2ebf41f41f 100644 --- a/Content.Shared/Strip/Components/ThievingComponent.cs +++ b/Content.Shared/Strip/Components/ThievingComponent.cs @@ -1,7 +1,7 @@ -namespace Content.Shared.Strip.Components; +namespace Content.Shared.Strip.Components; /// -/// Give this to an entity when you want to increase their stripping times +/// Give this to an entity when you want to decrease stripping times /// [RegisterComponent] public sealed class ThievingComponent : Component @@ -10,8 +10,8 @@ public sealed class ThievingComponent : Component /// How much the strip time should be shortened by /// [ViewVariables(VVAccess.ReadWrite)] - [DataField("stealTime")] - public float StealTime = 0.5f; + [DataField("stripTimeReduction")] + public float StripTimeReduction = 0.5f; /// /// Should it notify the user if they're stripping a pocket? diff --git a/Content.Shared/Strip/ThievingSystem.cs b/Content.Shared/Strip/ThievingSystem.cs index 51c5f381f6..0ef4b66571 100644 --- a/Content.Shared/Strip/ThievingSystem.cs +++ b/Content.Shared/Strip/ThievingSystem.cs @@ -17,6 +17,6 @@ public sealed class ThievingSystem : EntitySystem private void OnBeforeStrip(EntityUid uid, ThievingComponent component, BeforeStripEvent args) { args.Stealth |= component.Stealthy; - args.Additive -= component.StealTime; + args.Additive -= component.StripTimeReduction; } } diff --git a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml index 386260db54..1bed24612d 100644 --- a/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml +++ b/Resources/Prototypes/Entities/Clothing/Hands/gloves.yml @@ -202,7 +202,7 @@ fiberMaterial: fibers-nanomachines - type: FingerprintMask - type: Thieving - stealTime: 1 + stripTimeReduction: 1 stealthy: true - type: entity @@ -251,7 +251,7 @@ - type: Clothing sprite: Clothing/Hands/Gloves/Color/black.rsi - type: Thieving - stealTime: 1.5 + stripTimeReduction: 1.5 stealthy: true - type: Fiber fiberMaterial: fibers-synthetic diff --git a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml index 1a2ececc42..9f6da5b936 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml @@ -101,3 +101,7 @@ receiveFrequencyId: SuitSensor - type: WirelessNetworkConnection range: 500 + - type: Thieving + stripTimeReduction: 9999 + stealthy: true + - type: Stripping