Files
Delta-v/Content.Shared/Strip/ThievingSystem.cs
T
Krunklehorn faa39fccf5 StrippableSystem doafter overhaul (#25994)
* Initial commit

* Fixed short circuiting

* Use DebugTools

* Use Entity<TComp> more, and make them nullable

* Bring these two together

(cherry picked from commit 41ca8f3dfc)
2024-03-17 15:08:10 +01:00

24 lines
690 B
C#

using Content.Shared.Inventory;
using Content.Shared.Strip;
using Content.Shared.Strip.Components;
namespace Content.Shared.Strip;
public sealed class ThievingSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<ThievingComponent, BeforeStripEvent>(OnBeforeStrip);
SubscribeLocalEvent<ThievingComponent, InventoryRelayedEvent<BeforeStripEvent>>((e, c, ev) => OnBeforeStrip(e, c, ev.Args));
}
private void OnBeforeStrip(EntityUid uid, ThievingComponent component, BeforeStripEvent args)
{
args.Stealth |= component.Stealthy;
args.Additive -= component.StripTimeReduction;
}
}