]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Jet Injector Tweaks and Cleanup. (#42158)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Thu, 1 Jan 2026 05:29:36 +0000 (21:29 -0800)
committerGitHub <noreply@github.com>
Thu, 1 Jan 2026 05:29:36 +0000 (05:29 +0000)
* delete metabolismmovespeedmodifiersystem

* Revert "delete metabolismmovespeedmodifiersystem"

This reverts commit 19572fa0858bfb9385f4717fc77c8956bdbc56c0.

* misc cleanup

* math shows I should do this

* prevent popups

* fix handling as well

* this too

* actually these can create popups so just always handle em...

* remove comment

* final fixes

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Chemistry/EntitySystems/InjectorSystem.cs
Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs
Resources/Audio/Items/Medical/attributions.yml
Resources/Audio/Items/Medical/jet_injector.ogg [new file with mode: 0644]
Resources/Audio/Items/attributions.yml
Resources/Audio/Items/jet_injector.ogg [deleted file]
Resources/Locale/en-US/chemistry/components/injector-component.ftl
Resources/Prototypes/Chemistry/injector_modes.yml
Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml

index 4fa44f2fa4a58ddefc9030c6e7f48f63bb3cf018..7abd29a8c4d8d2f63818989332a38e060c8fee9c 100644 (file)
@@ -65,6 +65,7 @@ public sealed partial class InjectorSystem : EntitySystem
             ToggleMode(injector, args.User);
 
         args.Handled = true;
+        args.ApplyDelay = false;
     }
 
     private void OnInjectorAfterInteract(Entity<InjectorComponent> injector, ref AfterInteractEvent args)
@@ -82,12 +83,12 @@ public sealed partial class InjectorSystem : EntitySystem
                 return;
             }
 
-            args.Handled = TryMobsDoAfter(injector, args.User, target);
+            args.Handled |= TryMobsDoAfter(injector, args.User, target);
             return;
         }
 
         // Draw from or inject into jugs, bottles, etc.
-        args.Handled ContainerDoAfter(injector, args.User, target);
+        args.Handled |= TryContainerDoAfter(injector, args.User, target);
     }
 
     private void OnInjectDoAfter(Entity<InjectorComponent> injector, ref InjectorDoAfterEvent args)
@@ -95,7 +96,7 @@ public sealed partial class InjectorSystem : EntitySystem
         if (args.Cancelled || args.Handled || args.Args.Target == null)
             return;
 
-        args.Handled = TryUseInjector(injector, args.Args.User, args.Args.Target.Value);
+        args.Handled |= TryUseInjector(injector, args.Args.User, args.Args.Target.Value);
     }
 
     private void OnAttack(Entity<InjectorComponent> injector, ref MeleeHitEvent args)
@@ -197,7 +198,7 @@ public sealed partial class InjectorSystem : EntitySystem
             || !GetMobsDoAfterTime(injector, user, target, out var doAfterTime, out var amount)) // Get the DoAfter time.
             return false;
 
-        _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, doAfterTime, new InjectorDoAfterEvent(), injector.Owner, target: target, used: injector.Owner)
+        if (!_doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, doAfterTime, new InjectorDoAfterEvent(), injector.Owner, target: target, used: injector.Owner)
         {
             BreakOnMove = true,
             BreakOnWeightlessMove = false,
@@ -205,7 +206,8 @@ public sealed partial class InjectorSystem : EntitySystem
             NeedHand = injector.Comp.NeedHand,
             BreakOnHandChange = injector.Comp.BreakOnHandChange,
             MovementThreshold = injector.Comp.MovementThreshold,
-        });
+        }))
+            return false;
 
         // If the DoAfter was instant, don't send popups and logs indicating an attempt.
         if (doAfterTime == TimeSpan.Zero)
@@ -309,12 +311,12 @@ public sealed partial class InjectorSystem : EntitySystem
     #endregion Mob Interaction
 
     #region Container Interaction
-    private bool ContainerDoAfter(Entity<InjectorComponent> injector, EntityUid user, EntityUid target)
+    private bool TryContainerDoAfter(Entity<InjectorComponent> injector, EntityUid user, EntityUid target)
     {
         if (!GetContainerDoAfterTime(injector, user, target, out var doAfterTime))
             return false;
 
-        _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, doAfterTime, new InjectorDoAfterEvent(), injector.Owner, target: target, used: injector.Owner)
+        return _doAfter.TryStartDoAfter(new DoAfterArgs(EntityManager, user, doAfterTime, new InjectorDoAfterEvent(), injector.Owner, target: target, used: injector.Owner)
         {
             BreakOnMove = true,
             BreakOnWeightlessMove = false,
@@ -323,8 +325,6 @@ public sealed partial class InjectorSystem : EntitySystem
             BreakOnHandChange = injector.Comp.BreakOnHandChange,
             MovementThreshold = injector.Comp.MovementThreshold,
         });
-
-        return true;
     }
 
     /// <summary>
index 9dcd965492024fe6c1ad73acb059923ee7fc5239..c8bd36f6b01f36b02ee0bf2c4c39af02ddd99191 100644 (file)
@@ -80,7 +80,7 @@ public abstract partial class SharedPuddleSystem
                 // Injectors should not be hardcoded here.
                 if (TryComp<InjectorComponent>(entity, out var injectorComp)
                     && _prototypeManager.Resolve(injectorComp.ActiveModeProtoId, out var activeMode)
-                    && !activeMode.Behavior.HasFlag(InjectorBehavior.Draw))
+                    && !activeMode.Behavior.HasAnyFlag(InjectorBehavior.Draw | InjectorBehavior.Dynamic))
                 {
                     foreach (var mode in injectorComp.AllowedModes)
                     {
index a6b352ef221d7ee3d54481d87ab5ff466c6d0bf7..09c4dcd0f59ed461d4275c69ee6238e472bd6eee 100644 (file)
@@ -1,4 +1,9 @@
 - files: ["healthscanner.ogg"]
   license: "CC-BY-4.0"
   copyright: "Taken from FM Synthesis on freesound.org"
-  source: "https://freesound.org/people/FreqMan/sounds/32683/"
\ No newline at end of file
+  source: "https://freesound.org/people/FreqMan/sounds/32683/"
+
+- files: ["jet_injector.ogg"]
+  license: "CC-BY-3.0"
+  copyright: "Orginal audio by EminYILDIRIM -- https://freesound.org/s/548009/ -- License: Attribution 4.0, 2imitk -- https://freesound.org/s/279044/ -- License: Attribution 3.0 and brunoboselli -- https://freesound.org/s/457294/ -- License: Creative Commons 0 --  https://freesound.org/s/460586/ -- License: Attribution NonCommercial 4.0, modified by Princess-Cheeseballs (GitHub)"
+  source: "https://github.com/space-wizards/space-station-14/pull/40076"
diff --git a/Resources/Audio/Items/Medical/jet_injector.ogg b/Resources/Audio/Items/Medical/jet_injector.ogg
new file mode 100644 (file)
index 0000000..306e113
Binary files /dev/null and b/Resources/Audio/Items/Medical/jet_injector.ogg differ
index bed043b3ca65ee2ab78d1a48fa128f4fff41a96c..5a5927c8784c4c185f30a7aa0047effa71cad770 100644 (file)
   license: "CC0-1.0"
   copyright: "Created by romulofs, converted to OGG, and edited by TiniestShark (Github)"
   source: "https://freesound.org/s/127541/"
-
-- files: ["jet_injector.ogg"]
-  license: "CC-BY-3.0"
-  copyright: "Orginal audio by EminYILDIRIM -- https://freesound.org/s/548009/ -- License: Attribution 4.0, 2imitk -- https://freesound.org/s/279044/ -- License: Attribution 3.0 and brunoboselli -- https://freesound.org/s/457294/ -- License: Creative Commons 0, modified by Princess-Cheeseballs (GitHub)"
-  source: "https://github.com/space-wizards/space-station-14/pull/40076"
diff --git a/Resources/Audio/Items/jet_injector.ogg b/Resources/Audio/Items/jet_injector.ogg
deleted file mode 100644 (file)
index 8ccb40d..0000000
Binary files a/Resources/Audio/Items/jet_injector.ogg and /dev/null differ
index 762816a9d2b6afe6235f2d9547a70898d761e825..a418edd1dd5b8f13c7f27e49f82c055096411eb4 100644 (file)
@@ -8,9 +8,9 @@ injector-toggle-verb-text = Toggle Injector Mode
 
 ## Entity
 
-injector-component-inject-mode-name = Inject
-injector-component-draw-mode-name = Draw
-injector-component-dynamic-mode-name = Dynamic
+injector-component-inject-mode-name = inject
+injector-component-draw-mode-name = draw
+injector-component-dynamic-mode-name = dynamic
 injector-component-mode-changed-text = Now {$mode}
 injector-component-transfer-success-message = You transfer {$amount}u into {THE($target)}.
 injector-component-transfer-success-message-self = You transfer {$amount}u into yourself.
index 53a5ee4f7375ac47583c7faf40d5f3a1a4b527b8..1e2b38aa41b0371b776bc6471fdcbce33be437e8 100644 (file)
   abstract: true
   parent: BaseHyposprayMode
   id: BaseJetInjectorMode
-  injectSound: /Audio/Items/jet_injector.ogg
+  injectSound: /Audio/Items/Medical/jet_injector.ogg
   popupUserAttempt: injector-component-spray-injecting-user
   popupTargetAttempt: injector-component-spray-injecting-target
 
index eb602ec9854254c65699d624eb928ca5688f4a9e..8bf35659e51e82f80898c826919018b646203a43 100644 (file)
     allowedModes:
     - HyposprayDynamicMode
     - HyposprayInjectMode
+  - type: Spillable
+    solution: hypospray
+  - type: ExaminableSolution
+    solution: hypospray
+    exactVolume: true
   - type: Appearance
 
 - type: entity
@@ -34,9 +39,6 @@
         maxVol: 30
   - type: RefillableSolution
     solution: hypospray
-  - type: ExaminableSolution
-    solution: hypospray
-    exactVolume: true
   - type: UseDelay
     delay: 0.5
   - type: StaticPrice
         maxVol: 10
   - type: RefillableSolution
     solution: hypospray
-  - type: ExaminableSolution
-    solution: hypospray
   - type: SolutionContainerVisuals
     maxFillLevels: 2
     fillBaseName: borghypo_fill
   - type: Item
     sprite: Objects/Specific/Medical/jetinjector.rsi
   - type: UseDelay
-    delay: 2.0
+    delay: 1.5
   - type: SolutionContainerManager
     solutions:
       hypospray:
         maxVol: 15
   - type: ExaminableSolution
     solution: pen
-    exactVolume: true
   - type: Injector
     solutionName: pen
     currentTransferAmount: null