Skip to content

Commit

Permalink
Revert "Revert "Felinid Thievery" (#1177)"
Browse files Browse the repository at this point in the history
This reverts commit b14097d.
  • Loading branch information
WarMechanic authored May 10, 2024
1 parent ac2f119 commit fd0e5e0
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 2 deletions.
4 changes: 3 additions & 1 deletion Content.Client/Inventory/StrippableBoundUserInterface.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using Robust.Client.GameObjects;
using Robust.Client.UserInterface;
using Robust.Client.UserInterface.Controls;
using Robust.Client.Player;
using Robust.Shared.Input;
using Robust.Shared.Map;
using Robust.Shared.Prototypes;
Expand All @@ -31,6 +32,7 @@ namespace Content.Client.Inventory
public sealed class StrippableBoundUserInterface : BoundUserInterface
{
[Dependency] private readonly IUserInterfaceManager _ui = default!;
[Dependency] private readonly IPlayerManager _playerManager = default!;
private readonly ExamineSystem _examine;
private readonly InventorySystem _inv;
private readonly SharedCuffableSystem _cuffable;
Expand Down Expand Up @@ -198,7 +200,7 @@ private void AddInventoryButton(EntityUid invUid, string slotId, InventoryCompon
var entity = container.ContainedEntity;

// If this is a full pocket, obscure the real entity
if (entity != null && slotDef.StripHidden)
if (entity != null && slotDef.StripHidden && !(EntMan.TryGetComponent<ThievingComponent>(_playerManager.LocalEntity, out var thiefcomponent) && thiefcomponent.IgnoreStripHidden))
entity = _virtualHiddenEntity;

var button = new SlotButton(new SlotData(slotDef, container));
Expand Down
12 changes: 12 additions & 0 deletions Content.Shared/Strip/Components/ThievingComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,16 @@ public sealed partial class ThievingComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stealthy")]
public bool Stealthy;

/// <summary>
/// Should the user be able to see hidden items? (i.e pockets)
/// </summary>
[DataField]
public bool IgnoreStripHidden; //DeltaV

/// <summary>
/// A multiplier coefficient for strip time
/// </summary>
[DataField]
public float StripTimeMultiplier = 1f; //DeltaV
}
1 change: 1 addition & 0 deletions Content.Shared/Strip/ThievingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@ private void OnBeforeStrip(EntityUid uid, ThievingComponent component, BeforeStr
{
args.Stealth |= component.Stealthy;
args.Additive -= component.StripTimeReduction;
args.Multiplier *= component.StripTimeMultiplier;
}
}
3 changes: 2 additions & 1 deletion Resources/Prototypes/Entities/Mobs/Player/admin_ghost.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,9 @@
range: 500
- type: StationLimitedNetwork
- type: Thieving
stripTimeReduction: 9999
stripTimeMultiplier: 0
stealthy: true
ignoreStripHidden: true
- type: Stripping
- type: SolutionScanner
- type: IgnoreUIRange
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@
Unsexed: MaleFelinid
- type: Felinid
- type: NoShoesSilentFootsteps
- type: Thieving
ignoreStripHidden: true
stealthy: false
stripTimeReduction: 0
stripTimeMultiplier: 0.667

- type: entity
save: false
Expand Down

0 comments on commit fd0e5e0

Please sign in to comment.