From aa886ca494e933155c896838a456e2d4d60fbf2f Mon Sep 17 00:00:00 2001 From: osjarw <62134478+osjarw@users.noreply.github.com> Date: Wed, 24 Jul 2024 22:26:52 +0300 Subject: [PATCH] Make `NeedHand` modifiable for injectorSystem (#29870) * Get needhand from yml * MovementThreshold modifiable + inheritdoc --- .../Chemistry/EntitySystems/InjectorSystem.cs | 6 +++--- .../Chemistry/Components/InjectorComponent.cs | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs index 54c3fd576fe542..d94faa8123291b 100644 --- a/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/InjectorSystem.cs @@ -203,9 +203,9 @@ private void InjectDoAfter(Entity injector, EntityUid target, BreakOnMove = true, BreakOnWeightlessMove = false, BreakOnDamage = true, - NeedHand = true, - BreakOnHandChange = true, - MovementThreshold = 0.1f, + NeedHand = injector.Comp.NeedHand, + BreakOnHandChange = injector.Comp.BreakOnHandChange, + MovementThreshold = injector.Comp.MovementThreshold, }); } diff --git a/Content.Shared/Chemistry/Components/InjectorComponent.cs b/Content.Shared/Chemistry/Components/InjectorComponent.cs index aec68340639031..1f2716356c50fa 100644 --- a/Content.Shared/Chemistry/Components/InjectorComponent.cs +++ b/Content.Shared/Chemistry/Components/InjectorComponent.cs @@ -87,6 +87,22 @@ public sealed partial class InjectorComponent : Component [AutoNetworkedField] [DataField] public InjectorToggleMode ToggleState = InjectorToggleMode.Draw; + + #region Arguments for injection doafter + + /// + [DataField] + public bool NeedHand = true; + + /// + [DataField] + public bool BreakOnHandChange = true; + + /// + [DataField] + public float MovementThreshold = 0.1f; + + #endregion } ///