using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Chemistry.Events; using Content.Shared.Clothing.EntitySystems; namespace Content.Server.Chemistry.EntitySystems; /// /// Server-side system for hypospray that adds borg announcement functionality /// public sealed class ServerHypospraySystem : EntitySystem { [Dependency] private readonly Content.Server._Sunrise.Medical.BorgHypospraySystem _borgHypospray = default!; [Dependency] private readonly SharedSolutionContainerSystem _solutionContainers = default!; public override void Initialize() { base.Initialize(); // Subscribe to injection events after the shared system processes them SubscribeLocalEvent(OnAfterInject); } private void OnAfterInject(Entity entity, ref BeforeInjectTargetEvent args) { // Get the solution that was injected if (_solutionContainers.TryGetSolution(entity.Owner, entity.Comp.SolutionName, out var hypoSpraySoln, out _)) { _borgHypospray.TryAnnounceInjection(entity.Owner, args.EntityUsingInjector, args.TargetGettingInjected, hypoSpraySoln.Value); } } }