From 5cb48c922fa7236d07b463f0c38ada2d5805e54b Mon Sep 17 00:00:00 2001 From: Plykiya <58439124+Plykiya@users.noreply.github.com> Date: Sat, 9 Mar 2024 02:19:03 -0800 Subject: [PATCH] Syringes that spawn with content start in inject mode (#25881) * Remove unnecessary datafield names, syringes with stuff in them start in inject mode * No trash tag * Remove ViewVariables since DataField has them implicitly * Revert "No trash tag" This reverts commit 2c42172653d2cc70d58bd5bedf61a880b939bf20. * Get rid of tags entirely for PrefilledSyringes --------- Co-authored-by: Plykiya --- .../Chemistry/Components/InjectorComponent.cs | 13 +++------ .../Objects/Specific/Medical/healing.yml | 28 +++++++++---------- .../Entities/Objects/Specific/chemistry.yml | 7 +++++ 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/Content.Shared/Chemistry/Components/InjectorComponent.cs b/Content.Shared/Chemistry/Components/InjectorComponent.cs index e29047b6de..437c5e327d 100644 --- a/Content.Shared/Chemistry/Components/InjectorComponent.cs +++ b/Content.Shared/Chemistry/Components/InjectorComponent.cs @@ -30,7 +30,7 @@ public sealed partial class InjectorComponent : Component /// Whether or not the injector is able to draw from containers or if it's a single use /// device that can only inject. /// - [DataField("injectOnly")] + [DataField] public bool InjectOnly; /// @@ -39,29 +39,26 @@ public sealed partial class InjectorComponent : Component /// /// for example: droppers would ignore mobs /// - [DataField("ignoreMobs")] + [DataField] public bool IgnoreMobs; /// /// The minimum amount of solution that can be transferred at once from this solution. /// [DataField("minTransferAmount")] - [ViewVariables(VVAccess.ReadWrite)] public FixedPoint2 MinimumTransferAmount = FixedPoint2.New(5); /// /// The maximum amount of solution that can be transferred at once from this solution. /// [DataField("maxTransferAmount")] - [ViewVariables(VVAccess.ReadWrite)] public FixedPoint2 MaximumTransferAmount = FixedPoint2.New(50); /// /// Amount to inject or draw on each usage. If the injector is inject only, it will /// attempt to inject it's entire contents upon use. /// - [ViewVariables(VVAccess.ReadWrite)] - [DataField("transferAmount")] + [DataField] [AutoNetworkedField] public FixedPoint2 TransferAmount = FixedPoint2.New(5); @@ -72,8 +69,7 @@ public sealed partial class InjectorComponent : Component /// The base delay has a minimum of 1 second, but this will still be modified if the target is incapacitated or /// in combat mode. /// - [ViewVariables(VVAccess.ReadWrite)] - [DataField("delay")] + [DataField] public TimeSpan Delay = TimeSpan.FromSeconds(5); /// @@ -81,7 +77,6 @@ public sealed partial class InjectorComponent : Component /// right SolutionCaps to support injection/drawing. For InjectOnly injectors this should /// only ever be set to Inject /// - [ViewVariables(VVAccess.ReadWrite)] [AutoNetworkedField] [DataField] public InjectorToggleMode ToggleState = InjectorToggleMode.Draw; diff --git a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml index 52407aba29..79ce03f700 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Medical/healing.yml @@ -785,7 +785,7 @@ # Syringes - type: entity name: ephedrine syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeEphedrine components: - type: SolutionContainerManager @@ -798,7 +798,7 @@ - type: entity name: inaprovaline syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeInaprovaline components: - type: SolutionContainerManager @@ -811,7 +811,7 @@ - type: entity name: tranexamic acid syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeTranexamicAcid components: - type: SolutionContainerManager @@ -824,7 +824,7 @@ - type: entity name: bicaridine syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeBicaridine components: - type: SolutionContainerManager @@ -837,7 +837,7 @@ - type: entity name: dermaline syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeDermaline components: - type: SolutionContainerManager @@ -850,7 +850,7 @@ - type: entity name: hyronalin syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeHyronalin components: - type: SolutionContainerManager @@ -863,7 +863,7 @@ - type: entity name: ipecac syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeIpecac components: - type: SolutionContainerManager @@ -876,7 +876,7 @@ - type: entity name: ambuzol syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeAmbuzol components: - type: SolutionContainerManager @@ -889,7 +889,7 @@ - type: entity name: sigynate syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeSigynate components: - type: SolutionContainerManager @@ -902,7 +902,7 @@ - type: entity name: ethylredoxrazine syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeEthylredoxrazine components: - type: SolutionContainerManager @@ -915,7 +915,7 @@ - type: entity name: phalanximine syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringePhalanximine components: - type: SolutionContainerManager @@ -928,7 +928,7 @@ - type: entity name: saline syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeSaline components: - type: SolutionContainerManager @@ -942,7 +942,7 @@ #this is where all the syringes are so i didn't know where to put it - type: entity name: romerol syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeRomerol components: - type: SolutionContainerManager @@ -955,7 +955,7 @@ - type: entity name: stimulants syringe - parent: BaseSyringe + parent: PrefilledSyringe id: SyringeStimulants components: - type: SolutionContainerManager diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml index ab65940fab..ae4aaed7d2 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml @@ -364,6 +364,13 @@ - Syringe - Trash +- type: entity + parent: BaseSyringe + id: PrefilledSyringe + components: + - type: Injector + toggleState: Inject + - type: entity id: SyringeBluespace parent: BaseSyringe