Files
OldThink/Content.Server/_White/_Engi/BucketHelmet/BucketHelmetSystem.cs
2024-11-24 21:44:35 +03:00

31 lines
959 B
C#

using Content.Shared.Inventory.Events;
using Content.Shared._White._Engi.BucketHelmet;
namespace Content.Server._White._Engi.BucketHelmet;
/// <summary>
/// WD.
/// This handles placemet of PreventStrippingFromEarsComponent when bucket helmet is in use.
/// </summary>
public sealed class BucketHelmetSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<BucketHelmetComponent, GotEquippedEvent>(OnGotEquipped);
SubscribeLocalEvent<BucketHelmetComponent, GotUnequippedEvent>(OnGotUnequipped);
}
public void OnGotUnequipped(EntityUid uid, BucketHelmetComponent component, GotUnequippedEvent args)
{
RemComp<PreventStrippingFromEarsComponent>(args.Equipee);
}
public void OnGotEquipped(EntityUid uid, BucketHelmetComponent component, GotEquippedEvent args)
{
if (args.Slot == "head")
EnsureComp<PreventStrippingFromEarsComponent>(args.Equipee);
}
}