using Content.Server.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Emag.Systems; using Content.Shared.Chemistry.Dispenser; using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.Prototypes; namespace Content.Server.Chemistry.EntitySystems { [UsedImplicitly] public sealed class ReagentDispenserSystem : SharedReagentDispenserSystem { [Dependency] private readonly IPrototypeManager _prototypeManager = default!; public override void Initialize() { base.Initialize(); SubscribeLocalEvent((_, comp, _) => comp.UpdateUserInterface()); SubscribeLocalEvent((_, comp, _) => comp.UpdateUserInterface()); SubscribeLocalEvent((_, comp, _) => comp.UpdateUserInterface()); SubscribeLocalEvent((_, comp, _) => comp.UpdateUserInterface()); SubscribeLocalEvent(OnEmagged); } private void OnEmagged(EntityUid uid, ReagentDispenserComponent comp, GotEmaggedEvent args) { if (!comp.AlreadyEmagged) { comp.AddFromPrototype(comp.EmagPackPrototypeId); comp.AlreadyEmagged = true; args.Handled = true; } } } }