diff --git a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs index a4497c0bd6..0846d35477 100644 --- a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs @@ -1,4 +1,4 @@ -using Content.Server.Body.Components; +using Content.Server.Body.Components; using Content.Server.Body.Systems; using Content.Shared.Chemistry; using Content.Shared.Chemistry.Components; @@ -115,7 +115,14 @@ public sealed class InjectorSystem : SharedInjectorSystem private void InjectDoAfter(Entity injector, EntityUid target, EntityUid user) { // Create a pop-up for the user - Popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user); + if (injector.Comp.ToggleState == InjectorToggleMode.Draw) + { + Popup.PopupEntity(Loc.GetString("injector-component-drawing-user"), target, user); + } + else + { + Popup.PopupEntity(Loc.GetString("injector-component-injecting-user"), target, user); + } if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out _, out var solution)) return; @@ -131,8 +138,17 @@ public sealed class InjectorSystem : SharedInjectorSystem { // Create a pop-up for the target var userName = Identity.Entity(user, EntityManager); - Popup.PopupEntity(Loc.GetString("injector-component-injecting-target", - ("user", userName)), user, target); + if (injector.Comp.ToggleState == InjectorToggleMode.Draw) + { + Popup.PopupEntity(Loc.GetString("injector-component-drawing-target", + ("user", userName)), user, target); + } + else + { + Popup.PopupEntity(Loc.GetString("injector-component-injecting-target", + ("user", userName)), user, target); + } + // Check if the target is incapacitated or in combat mode and modify time accordingly. if (MobState.IsIncapacitated(target)) diff --git a/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs b/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs index 7ad2170281..dad8eb4091 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedInjectorSystem.cs @@ -1,4 +1,4 @@ -using Content.Shared.Administration.Logs; +using Content.Shared.Administration.Logs; using Content.Shared.Chemistry.Components; using Content.Shared.CombatMode; using Content.Shared.DoAfter; @@ -94,16 +94,34 @@ public abstract class SharedInjectorSystem : EntitySystem if (injector.Comp.InjectOnly) return; + if (!SolutionContainers.TryGetSolution(injector.Owner, InjectorComponent.SolutionName, out var solEnt, out var solution)) + return; + string msg; + switch (injector.Comp.ToggleState) { case InjectorToggleMode.Inject: - SetMode(injector, InjectorToggleMode.Draw); - msg = "injector-component-drawing-text"; + if (solution.AvailableVolume > 0) // If solution has empty space to fill up, allow toggling to draw + { + SetMode(injector, InjectorToggleMode.Draw); + msg = "injector-component-drawing-text"; + } + else + { + msg = "injector-component-cannot-toggle-draw-message"; + } break; case InjectorToggleMode.Draw: - SetMode(injector, InjectorToggleMode.Inject); - msg = "injector-component-injecting-text"; + if (solution.Volume > 0) // If solution has anything in it, allow toggling to inject + { + SetMode(injector, InjectorToggleMode.Inject); + msg = "injector-component-injecting-text"; + } + else + { + msg = "injector-component-cannot-toggle-inject-message"; + } break; default: throw new ArgumentOutOfRangeException(); diff --git a/Resources/Locale/en-US/chemistry/components/injector-component.ftl b/Resources/Locale/en-US/chemistry/components/injector-component.ftl index 4fafc9cd3b..24f524081e 100644 --- a/Resources/Locale/en-US/chemistry/components/injector-component.ftl +++ b/Resources/Locale/en-US/chemistry/components/injector-component.ftl @@ -18,8 +18,12 @@ injector-component-transfer-success-message = You transfer {$amount}u into {$tar injector-component-draw-success-message = You draw {$amount}u from {$target}. injector-component-target-already-full-message = {$target} is already full! injector-component-target-is-empty-message = {$target} is empty! +injector-component-cannot-toggle-draw-message = Too full to draw! +injector-component-cannot-toggle-inject-message = Nothing to inject! ## mob-inject doafter messages -injector-component-injecting-user = You start inserting the needle. -injector-component-injecting-target = {CAPITALIZE(THE($user))} is trying to stick a needle into you! +injector-component-drawing-user = You start drawing the needle. +injector-component-injecting-user = You start injecting the needle. +injector-component-drawing-target = {CAPITALIZE(THE($user))} is trying to use a needle to draw from you! +injector-component-injecting-target = {CAPITALIZE(THE($user))} is trying to inject a needle into you!