fish-station/Content.Shared/Electrocution/InsulatedSystem.cs
TryPank 06db7c6be2
Перевод (#1951)
Co-authored-by: tajikartem@yandex.ru <tajik@artem@yandex.ru>
2025-04-27 22:40:10 +03:00

24 lines
No EOL
855 B
C#

// Transfer of closed PR of Wizards 31841
using Content.Shared.Inventory;
using Content.Shared.Weapons.Ranged.Events;
using Content.Shared.Popups;
namespace Content.Shared.Electrocution;
public sealed partial class InsulatedSystem : EntitySystem
{
[Dependency] protected readonly SharedPopupSystem PopupSystem = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<InsulatedComponent, InventoryRelayedEvent<ShotAttemptedEvent>>(OnShoot);
}
private void OnShoot(EntityUid uid, InsulatedComponent comp, ref InventoryRelayedEvent<ShotAttemptedEvent> args)
{
if (comp.PreventOpperatinGuns && !args.Args.Used.Comp.BigTrigger)
{
PopupSystem.PopupClient(Loc.GetString("gun-Insulated-gloves"), args.Args.User);
args.Args.Cancel();
}
}
}