From 4194a7d66669c56003d14a312a9c090758858f1f Mon Sep 17 00:00:00 2001 From: OctoRocket <88291550+OctoRocket@users.noreply.github.com> Date: Sat, 22 Apr 2023 22:43:46 -0500 Subject: [PATCH] [Tweak] Medipen prick popup is now centered on player (and some cleanup) (#15665) --- .../EntitySystems/ChemistrySystemHypospray.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs b/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs index 2e0593ecf1..d4076d6a19 100644 --- a/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs +++ b/Content.Server/Chemistry/EntitySystems/ChemistrySystemHypospray.cs @@ -2,7 +2,7 @@ using System.Linq; using System.Diagnostics.CodeAnalysis; using Content.Server.Chemistry.Components; using Content.Server.Chemistry.Components.SolutionManager; -using Content.Server.Weapons.Melee; +// using Content.Server.Weapons.Melee; using Content.Shared.Chemistry.Reagent; using Content.Shared.Database; using Content.Shared.FixedPoint; @@ -12,7 +12,6 @@ using Content.Shared.Interaction.Events; using Content.Shared.Mobs.Components; using Content.Shared.Weapons.Melee.Events; using Content.Shared.Timing; -using Robust.Shared.Player; namespace Content.Server.Chemistry.EntitySystems { @@ -30,7 +29,8 @@ namespace Content.Server.Chemistry.EntitySystems private void OnUseInHand(EntityUid uid, HyposprayComponent component, UseInHandEvent args) { - if (args.Handled) return; + if (args.Handled) + return; TryDoInject(uid, args.User, args.User); args.Handled = true; @@ -68,9 +68,8 @@ namespace Content.Server.Chemistry.EntitySystems if (!EligibleEntity(target, _entMan)) return false; - if (TryComp(uid, out UseDelayComponent? delayComp)) - if (_useDelay.ActiveDelay(uid, delayComp)) - return false; + if (TryComp(uid, out UseDelayComponent? delayComp) && _useDelay.ActiveDelay(uid, delayComp)) + return false; string? msgFormat = null; @@ -100,9 +99,7 @@ namespace Content.Server.Chemistry.EntitySystems if (target != user) { - _popup.PopupCursor(Loc.GetString("hypospray-component-feel-prick-message"), target.Value); - var meleeSys = EntitySystem.Get(); - var angle = Angle.FromWorldVec(_entMan.GetComponent(target.Value).WorldPosition - _entMan.GetComponent(user).WorldPosition); + _popup.PopupEntity(Loc.GetString("hypospray-component-feel-prick-message"), target.Value); // TODO: This should just be using melee attacks... // meleeSys.SendLunge(angle, user); } @@ -131,7 +128,7 @@ namespace Content.Server.Chemistry.EntitySystems _reactiveSystem.DoEntityReaction(target.Value, removedSolution, ReactionMethod.Injection); _solutions.TryAddSolution(target.Value, targetSolution, removedSolution); - //same logtype as syringes... + // same LogType as syringes... _adminLogger.Add(LogType.ForceFeed, $"{_entMan.ToPrettyString(user):user} injected {_entMan.ToPrettyString(target.Value):target} with a solution {SolutionContainerSystem.ToPrettyString(removedSolution):removedSolution} using a {_entMan.ToPrettyString(uid):using}"); return true; -- 2.51.2