From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Thu, 1 Jan 2026 05:29:36 +0000 (-0800) Subject: Jet Injector Tweaks and Cleanup. (#42158) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=24005e3e936ac7e1256f7a6ad2a5b22ca6c0e64d;p=space-station-14.git Jet Injector Tweaks and Cleanup. (#42158) * 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> --- diff --git a/Content.Shared/Chemistry/EntitySystems/InjectorSystem.cs b/Content.Shared/Chemistry/EntitySystems/InjectorSystem.cs index 4fa44f2fa4..7abd29a8c4 100644 --- a/Content.Shared/Chemistry/EntitySystems/InjectorSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/InjectorSystem.cs @@ -65,6 +65,7 @@ public sealed partial class InjectorSystem : EntitySystem ToggleMode(injector, args.User); args.Handled = true; + args.ApplyDelay = false; } private void OnInjectorAfterInteract(Entity 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 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 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 injector, EntityUid user, EntityUid target) + private bool TryContainerDoAfter(Entity 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; } /// diff --git a/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs b/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs index 9dcd965492..c8bd36f6b0 100644 --- a/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs +++ b/Content.Shared/Fluids/SharedPuddleSystem.Spillable.cs @@ -80,7 +80,7 @@ public abstract partial class SharedPuddleSystem // Injectors should not be hardcoded here. if (TryComp(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) { diff --git a/Resources/Audio/Items/Medical/attributions.yml b/Resources/Audio/Items/Medical/attributions.yml index a6b352ef22..09c4dcd0f5 100644 --- a/Resources/Audio/Items/Medical/attributions.yml +++ b/Resources/Audio/Items/Medical/attributions.yml @@ -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 index 0000000000..306e11396b Binary files /dev/null and b/Resources/Audio/Items/Medical/jet_injector.ogg differ diff --git a/Resources/Audio/Items/attributions.yml b/Resources/Audio/Items/attributions.yml index bed043b3ca..5a5927c878 100644 --- a/Resources/Audio/Items/attributions.yml +++ b/Resources/Audio/Items/attributions.yml @@ -174,8 +174,3 @@ 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 index 8ccb40d8ce..0000000000 Binary files a/Resources/Audio/Items/jet_injector.ogg and /dev/null differ diff --git a/Resources/Locale/en-US/chemistry/components/injector-component.ftl b/Resources/Locale/en-US/chemistry/components/injector-component.ftl index 762816a9d2..a418edd1dd 100644 --- a/Resources/Locale/en-US/chemistry/components/injector-component.ftl +++ b/Resources/Locale/en-US/chemistry/components/injector-component.ftl @@ -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. diff --git a/Resources/Prototypes/Chemistry/injector_modes.yml b/Resources/Prototypes/Chemistry/injector_modes.yml index 53a5ee4f73..1e2b38aa41 100644 --- a/Resources/Prototypes/Chemistry/injector_modes.yml +++ b/Resources/Prototypes/Chemistry/injector_modes.yml @@ -127,7 +127,7 @@ 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 diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml index eb602ec985..8bf35659e5 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml @@ -10,6 +10,11 @@ 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 @@ -98,8 +100,6 @@ maxVol: 10 - type: RefillableSolution solution: hypospray - - type: ExaminableSolution - solution: hypospray - type: SolutionContainerVisuals maxFillLevels: 2 fillBaseName: borghypo_fill @@ -124,7 +124,7 @@ - type: Item sprite: Objects/Specific/Medical/jetinjector.rsi - type: UseDelay - delay: 2.0 + delay: 1.5 - type: SolutionContainerManager solutions: hypospray: @@ -214,7 +214,6 @@ maxVol: 15 - type: ExaminableSolution solution: pen - exactVolume: true - type: Injector solutionName: pen currentTransferAmount: null