Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Felinid Thievery #1102

Merged
merged 17 commits into from
May 9, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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] internal readonly IPlayerManager PlayerManager = default!;
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved
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
15 changes: 11 additions & 4 deletions Content.Shared/Strip/Components/ThievingComponent.cs
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,21 @@ public sealed partial class ThievingComponent : Component
/// <summary>
/// How much the strip time should be shortened by
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stripTimeReduction")]
[ViewVariables(VVAccess.ReadWrite), DataField("stripTimeReduction")]
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved
public TimeSpan StripTimeReduction = TimeSpan.FromSeconds(0.5f);

[ViewVariables(VVAccess.ReadWrite), DataField("stripTimeMultiplier")]
public float StripTimeMultiplier = 1f;
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved

/// <summary>
/// Should it notify the user if they're stripping a pocket?
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("stealthy")]
[ViewVariables(VVAccess.ReadWrite), DataField("stealthy")]
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved
public bool Stealthy;

/// <summary>
/// Should the user be able to see hidden items? (i.e pockets)
/// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("ignoreStripHidden")]
WarMechanic marked this conversation as resolved.
Show resolved Hide resolved
public bool IgnoreStripHidden = false;
}
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;
}
}
Loading