-using Content.Server.Body.Components;
+using Content.Server.Body.Components;
using Content.Server.Body.Systems;
using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Components;
private void InjectDoAfter(Entity<InjectorComponent> 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;
{
// 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))
-using Content.Shared.Administration.Logs;
+using Content.Shared.Administration.Logs;
using Content.Shared.Chemistry.Components;
using Content.Shared.CombatMode;
using Content.Shared.DoAfter;
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();
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!