From d6f27be5fe8faab2bfa30035fbdadfaf034c0471 Mon Sep 17 00:00:00 2001 From: Pspritechologist <81725545+Pspritechologist@users.noreply.github.com> Date: Mon, 19 Jun 2023 07:36:03 -0400 Subject: [PATCH] Allowed reagents is now a list --- .../Components/BloodstreamFillerComponent.cs | 4 +-- .../Systems/BloodstreamFillerSystem.cs | 4 +-- .../Objects/Specific/Medical/hypospray.yml | 26 +++++++++++++++---- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/Content.Server/SimpleStation14/BloodstreamFiller/Components/BloodstreamFillerComponent.cs b/Content.Server/SimpleStation14/BloodstreamFiller/Components/BloodstreamFillerComponent.cs index 0745594816..d435331d32 100644 --- a/Content.Server/SimpleStation14/BloodstreamFiller/Components/BloodstreamFillerComponent.cs +++ b/Content.Server/SimpleStation14/BloodstreamFiller/Components/BloodstreamFillerComponent.cs @@ -40,8 +40,8 @@ public sealed class BloodstreamFillerComponent : Component /// /// If null, any reagent will be allowed. /// - [DataField("reagent"), ViewVariables(VVAccess.ReadWrite)] - public string? Reagent = null; + [DataField("reagents"), ViewVariables(VVAccess.ReadWrite)] + public List Reagents = new(); /// /// Will this filler only fill Silicons? diff --git a/Content.Server/SimpleStation14/BloodstreamFiller/Systems/BloodstreamFillerSystem.cs b/Content.Server/SimpleStation14/BloodstreamFiller/Systems/BloodstreamFillerSystem.cs index cc9bd18852..5045f65e9c 100644 --- a/Content.Server/SimpleStation14/BloodstreamFiller/Systems/BloodstreamFillerSystem.cs +++ b/Content.Server/SimpleStation14/BloodstreamFiller/Systems/BloodstreamFillerSystem.cs @@ -72,7 +72,7 @@ private void TryFill(EntityUid user, EntityUid target, EntityUid filler, Bloodst if (!_solution.TryGetSolution(filler, fillComp.Solution!, out var fillerSolution)) // No solution return; - if (fillComp.Reagent != null && fillComp.Reagent != bloodComp.BloodReagent) // Wrong reagent as specified by the component + if (fillComp.Reagents.Count > 0 && !fillComp.Reagents.Contains(bloodComp.BloodReagent)) // Wrong reagent as specified by the component { _popup.PopupCursor(Loc.GetString(fillComp.TargetInvalidPopup, ("filler", filler)), user); return; @@ -214,7 +214,7 @@ private void TryRefill(EntityUid user, EntityUid filler, EntityUid target, Blood // Check that the tank's solution matches the filler's listed reagent. // This is seperate from checking the actual solution to prevent any funny business. - if (fillComp.Reagent != null && targetSolution.Contents[0].ReagentId != fillComp.Reagent) + if (fillComp.Reagents.Count > 0 && !fillComp.Reagents.Contains(targetSolution.Contents[0].ReagentId)) { _popup.PopupCursor(Loc.GetString(fillComp.RefillReagentInvalidPopup, ("tank", target)), user); return; diff --git a/Resources/Prototypes/SimpleStation14/Entities/Objects/Specific/Medical/hypospray.yml b/Resources/Prototypes/SimpleStation14/Entities/Objects/Specific/Medical/hypospray.yml index ba40e66a87..2fe77c73a9 100644 --- a/Resources/Prototypes/SimpleStation14/Entities/Objects/Specific/Medical/hypospray.yml +++ b/Resources/Prototypes/SimpleStation14/Entities/Objects/Specific/Medical/hypospray.yml @@ -80,11 +80,21 @@ parent: BloodFillerBase id: BloodFillerBlood name: bloodfiller - description: A pump to inject blood into your body. + description: A pump to inject blood into your body. Also accepts Slime. components: + - type: UseDelay + delay: 6 - type: BloodstreamFiller - reagent: Blood - amount: 100 + amount: 60 + fillTime: 1.3 + reagents: + - Blood + - Slime + - Water + - type: SolutionContainerManager + solutions: + filler: + maxVol: 120 - type: entity parent: BloodFillerBase @@ -93,5 +103,11 @@ description: A pump to inject coolant into an IPC. components: - type: BloodstreamFiller - reagent: Water - amount: 200 + reagents: [ Water ] + amount: 150 + fillTime: 0.85 + siliconOnly: true + - type: SolutionContainerManager + solutions: + filler: + maxVol: 250