mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-25 09:38:09 +03:00
29 lines
939 B
C#
29 lines
939 B
C#
using Content.Shared.Inventory.Events;
|
|
using Content.Shared.Clothing.Components;
|
|
using Content.Shared.Shadowkin;
|
|
|
|
namespace Content.Server.Shadowkin;
|
|
|
|
public sealed class ShadowkinCuffSystem : EntitySystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<ShadowkinCuffComponent, GotEquippedEvent>(OnEquipped);
|
|
SubscribeLocalEvent<ShadowkinCuffComponent, GotUnequippedEvent>(OnUnequipped);
|
|
}
|
|
|
|
private void OnEquipped(EntityUid uid, ShadowkinCuffComponent component, GotEquippedEvent args)
|
|
{
|
|
if (!TryComp<ClothingComponent>(uid, out var clothing)
|
|
|| !clothing.Slots.HasFlag(args.SlotFlags))
|
|
return;
|
|
|
|
EnsureComp<ShadowkinCuffComponent>(args.Equipee);
|
|
}
|
|
|
|
private void OnUnequipped(EntityUid uid, ShadowkinCuffComponent component, GotUnequippedEvent args)
|
|
{
|
|
RemComp<ShadowkinCuffComponent>(args.Equipee);
|
|
}
|
|
} |