From 90a880a9bea64601db77d5bbb2b184d5371dc082 Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sat, 30 Mar 2024 22:20:48 -0700 Subject: [PATCH] Fix: Prevent single-use hyposprays from getting the toggle draw verb (#26595) Prevent single-use hyposprays from getting the toggle draw verb Co-authored-by: Plykiya --- Content.Shared/Chemistry/Components/HyposprayComponent.cs | 7 +++++++ .../Chemistry/EntitySystems/SharedHypospraySystem.cs | 2 +- .../Entities/Objects/Specific/Medical/hypospray.yml | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Content.Shared/Chemistry/Components/HyposprayComponent.cs b/Content.Shared/Chemistry/Components/HyposprayComponent.cs index 05d202aaaa..05ef84bbaf 100644 --- a/Content.Shared/Chemistry/Components/HyposprayComponent.cs +++ b/Content.Shared/Chemistry/Components/HyposprayComponent.cs @@ -30,4 +30,11 @@ public sealed partial class HyposprayComponent : Component [AutoNetworkedField] [DataField(required: true)] public bool OnlyAffectsMobs = false; + + /// + /// Whether or not the hypospray is able to draw from containers or if it's a single use + /// device that can only inject. + /// + [DataField] + public bool InjectOnly = false; } diff --git a/Content.Shared/Chemistry/EntitySystems/SharedHypospraySystem.cs b/Content.Shared/Chemistry/EntitySystems/SharedHypospraySystem.cs index f91e5621f0..b647d33c98 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedHypospraySystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedHypospraySystem.cs @@ -27,7 +27,7 @@ public abstract class SharedHypospraySystem : EntitySystem // private void AddToggleModeVerb(Entity entity, ref GetVerbsEvent args) { - if (!args.CanAccess || !args.CanInteract || args.Hands == null) + if (!args.CanAccess || !args.CanInteract || args.Hands == null || entity.Comp.InjectOnly) return; var (_, component) = entity; diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml index dbc78a8409..d6f3ee75fa 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml @@ -115,6 +115,7 @@ solutionName: pen transferAmount: 15 onlyAffectsMobs: false + injectOnly: true - type: Appearance - type: SolutionContainerVisuals maxFillLevels: 1 @@ -205,6 +206,7 @@ solutionName: pen transferAmount: 20 onlyAffectsMobs: false + injectOnly: true - type: SolutionContainerManager solutions: pen: @@ -236,6 +238,7 @@ solutionName: pen transferAmount: 20 onlyAffectsMobs: false + injectOnly: true - type: SolutionContainerManager solutions: pen: @@ -267,6 +270,8 @@ solutionName: pen transferAmount: 20 onlyAffectsMobs: false + injectOnly: true + - type: SolutionContainerManager solutions: pen: @@ -299,6 +304,7 @@ solutionName: pen transferAmount: 30 onlyAffectsMobs: false + injectOnly: true - type: SolutionContainerManager solutions: pen: @@ -337,6 +343,7 @@ solutionName: pen transferAmount: 30 onlyAffectsMobs: false + injectOnly: true - type: StaticPrice price: 500 - type: Tag @@ -397,6 +404,7 @@ solutionName: pen transferAmount: 30 onlyAffectsMobs: false + injectOnly: true - type: StaticPrice price: 500 - type: Tag -- 2.51.2