From 723192ff7e8f2c64981d47169df838fdd192d211 Mon Sep 17 00:00:00 2001 From: neuPanda Date: Sun, 12 Jan 2025 01:11:37 -0500 Subject: [PATCH] Cryo Overhaul added 2 steping chems added a trauma and a tox cryo chem modified existing cryo chems to be more viable yet still balanced improved efficiency of cryo chambers modified body metabolizm --- .../Body/Components/MetabolizerComponent.cs | 7 +-- .../Body/Systems/MetabolizerSystem.cs | 13 +++-- Content.Server/Medical/CryoPodSystem.cs | 6 +- .../Chemistry/Components/Solution.cs | 57 ++++++++++++++++++- .../SharedSolutionContainerSystem.cs | 20 ++++++- .../Medical/Cryogenics/CryoPodComponent.cs | 14 ++++- .../Locale/en-US/reagents/meta/chemicals.ftl | 5 ++ .../Locale/en-US/reagents/meta/medicine.ftl | 10 +++- Resources/Prototypes/Reagents/chemicals.yml | 14 +++++ Resources/Prototypes/Reagents/medicine.yml | 47 ++++++++++++++- .../Recipes/Reactions/chemicals.yml | 26 +++++++++ .../Prototypes/Recipes/Reactions/medicine.yml | 32 ++++++++++- .../Guidebook/Medical/Cryogenics.xml | 12 +++- 13 files changed, 235 insertions(+), 28 deletions(-) diff --git a/Content.Server/Body/Components/MetabolizerComponent.cs b/Content.Server/Body/Components/MetabolizerComponent.cs index 7fe7d23cf34..0b064f0cbd6 100644 --- a/Content.Server/Body/Components/MetabolizerComponent.cs +++ b/Content.Server/Body/Components/MetabolizerComponent.cs @@ -54,14 +54,13 @@ public sealed partial class MetabolizerComponent : Component /// [DataField] public bool RemoveEmpty = false; - /// - /// How many reagents can this metabolizer process at once? + /// How many poisons can this metabolizer process at once? /// Used to nerf 'stacked poisons' where having 5+ different poisons in a syringe, even at low /// quantity, would be muuuuch better than just one poison acting. /// - [DataField("maxReagents")] - public int MaxReagentsProcessable = 3; + [DataField("maxPoisons")] + public int MaxPoisonsProcessable = 3; /// /// A list of metabolism groups that this metabolizer will act on, in order of precedence. diff --git a/Content.Server/Body/Systems/MetabolizerSystem.cs b/Content.Server/Body/Systems/MetabolizerSystem.cs index 8b0f0ac6f8d..70ea2ea5334 100644 --- a/Content.Server/Body/Systems/MetabolizerSystem.cs +++ b/Content.Server/Body/Systems/MetabolizerSystem.cs @@ -146,7 +146,7 @@ private void TryMetabolize(Entity(reagent.Prototype, out var proto)) @@ -163,9 +163,9 @@ private void TryMetabolize(Entity= ent.Comp1.MaxReagentsProcessable) - return; + // Already processed all poisons, skip to the next reagent. + if (poisons >= ent.Comp1.MaxPoisonsProcessable && proto.Metabolisms.ContainsKey("Poison")) + continue; // loop over all our groups and see which ones apply @@ -226,8 +226,9 @@ private void TryMetabolize(Entity - /// Splits a solution without the specified reagent prototypes. + /// splits the solution taking the specified amount of reagents proportionally to their quantity. /// + /// The total amount of solution to remove and return. + /// a new solution of equal proportions to the original solution public Solution SplitSolutionWithOnly(FixedPoint2 toTake, params string[] includedPrototypes) { // First remove the non-included prototypes @@ -671,6 +672,58 @@ public Solution SplitSolution(FixedPoint2 toTake) return newSolution; } + /// + /// splits the solution taking up to the specified amount of each reagent from the solution. + /// If the solution has less of a reagent than the specified amount, it will take all of that reagent. + /// + /// How much of each reagent to take + /// a new solution containing the reagents taken from the original solution + public Solution SplitSolutionReagentsEvenly(FixedPoint2 toTakePer) + { + var splitSolution = new Solution(); + + if (toTakePer <= FixedPoint2.Zero) + return splitSolution; + var reagentsCount = Contents.Count; + var reagentsToRemove = new List(); + for (var i = 0; i < reagentsCount; i++) + { + var currentReagent = Contents[i]; + + if (currentReagent.Quantity <= FixedPoint2.Zero) + { + reagentsToRemove.Add(currentReagent); + continue; + } + + if (currentReagent.Quantity <= toTakePer) + { + splitSolution.AddReagent(currentReagent); + reagentsToRemove.Add(currentReagent); + } + else + { + splitSolution.AddReagent(currentReagent.Reagent, toTakePer); + RemoveReagent(currentReagent.Reagent, toTakePer); + } + } + + foreach (var reagent in reagentsToRemove) + { + RemoveReagent(reagent); + } + if (Volume == FixedPoint2.Zero) + RemoveAllSolution(); + + _heatCapacityDirty = true; + splitSolution._heatCapacityDirty = true; + + ValidateSolution(); + splitSolution.ValidateSolution(); + + return splitSolution; + } + /// /// Variant of that doesn't return a new solution containing the removed reagents. /// diff --git a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs index 5e58a0944a4..854833f0dd6 100644 --- a/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs +++ b/Content.Shared/Chemistry/EntitySystems/SharedSolutionContainerSystem.cs @@ -326,9 +326,7 @@ public void UpdateAppearance(Entity sol /// /// Removes part of the solution in the container. - /// - /// - /// + /// /// The container to remove solution from. /// the volume of solution to remove. /// The solution that was removed. public Solution SplitSolution(Entity soln, FixedPoint2 quantity) @@ -341,6 +339,22 @@ public Solution SplitSolution(Entity soln, FixedPoint2 quanti return splitSol; } + /// + /// Splits a solution removing a specified amount of each reagent, if available. + /// + /// The container to split the solution from. + /// The amount of each reagent to split. + /// + public Solution SplitSolutionReagentsEvenly(Entity soln, FixedPoint2 quantity) + { + var (uid, comp) = soln; + var solution = comp.Solution; + + var splitSol = solution.SplitSolutionReagentsEvenly(quantity); + UpdateChemicals(soln); + return splitSol; + } + public Solution SplitStackSolution(Entity soln, FixedPoint2 quantity, int stackCount) { var (uid, comp) = soln; diff --git a/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs b/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs index a736a63cb22..9e17991af03 100644 --- a/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs +++ b/Content.Shared/Medical/Cryogenics/CryoPodComponent.cs @@ -1,4 +1,4 @@ -using Robust.Shared.Containers; +using Robust.Shared.Containers; using Robust.Shared.GameStates; using Robust.Shared.Serialization; using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom; @@ -34,11 +34,19 @@ public sealed partial class CryoPodComponent : Component public TimeSpan? NextInjectionTime; /// - /// How many units to transfer per tick from the beaker to the mob? + /// How many units of each reagent to transfer per tick from the beaker to the mob? /// [ViewVariables(VVAccess.ReadWrite)] [DataField("beakerTransferAmount")] - public float BeakerTransferAmount = 1f; + public float BeakerTransferAmount = .25f; + + /// + /// How potent (multiplier) the reagents are when transferred from the beaker to the mob. + /// + [ViewVariables(VVAccess.ReadWrite)] + [DataField("PotencyAmount")] + public float PotencyMultiplier = 2f; + /// /// Delay applied when inserting a mob in the pod. diff --git a/Resources/Locale/en-US/reagents/meta/chemicals.ftl b/Resources/Locale/en-US/reagents/meta/chemicals.ftl index 1d70ff65ff1..4807eca95d0 100644 --- a/Resources/Locale/en-US/reagents/meta/chemicals.ftl +++ b/Resources/Locale/en-US/reagents/meta/chemicals.ftl @@ -28,3 +28,8 @@ reagent-desc-sodium-polyacrylate = A super-absorbent polymer with assorted indus reagent-name-cellulose = cellulose fibers reagent-desc-cellulose = A crystaline polydextrose polymer, plants swear by this stuff. +reagent-name-salicylicacid = salicylic acid +reagent-desc-salicylicacid = A powdery substance used for dermatological treatments. + +reagent-name-formaldehyde = formaldehyde +reagent-desc-formaldehyde = A yellowish substance used for peservation of tissue. diff --git a/Resources/Locale/en-US/reagents/meta/medicine.ftl b/Resources/Locale/en-US/reagents/meta/medicine.ftl index 1e34411efbb..63c203a70b6 100644 --- a/Resources/Locale/en-US/reagents/meta/medicine.ftl +++ b/Resources/Locale/en-US/reagents/meta/medicine.ftl @@ -14,10 +14,16 @@ reagent-name-bicaridine = bicaridine reagent-desc-bicaridine = An analgesic which is highly effective at treating brute damage. It's useful for stabilizing people who have been severely beaten, as well as treating less life-threatening injuries. reagent-name-cryoxadone = cryoxadone -reagent-desc-cryoxadone = Required for the proper function of cryogenics. Heals all standard types of damage, but only works in temperatures under 213K. It can treat and rejuvenate plants when applied in small doses. +reagent-desc-cryoxadone = Required for the proper function of cryogenics. Useful in treating asphyxiation and bloodloss, but only works in temperatures under 213K. It can treat and rejuvenate plants when applied in small doses. Works regardless of the patient being alive or dead. reagent-name-doxarubixadone = doxarubixadone -reagent-desc-doxarubixadone = A cryogenics chemical. Heals certain types of cellular damage done by Slimes and improper use of other chemicals. +reagent-desc-doxarubixadone = A cryogenics chemical. Heals certain types of cellular damage done by Slimes and improper use of other chemicals. Works regardless of the patient being alive or dead. + +reagent-name-traumoxadone = traumoxadone +reagent-desc-traumoxadone = A cryogenics chemical. Used to treat severe trauma via regeneration of the damaged tissue. Works regardless of the patient being alive or dead. Product of Mystic Medical + +reagent-name-stelloxadone = stelloxadone +reagent-desc-stelloxadone = A cryogenics chemical. Used to aggressively dissolve toxins from the body. Works regardless of the patient being alive or dead. Product of Mystic Medical reagent-name-dermaline = dermaline reagent-desc-dermaline = An advanced chemical that is more effective at treating burn damage than kelotane. diff --git a/Resources/Prototypes/Reagents/chemicals.yml b/Resources/Prototypes/Reagents/chemicals.yml index b2b4850c8f6..79085fed14b 100644 --- a/Resources/Prototypes/Reagents/chemicals.yml +++ b/Resources/Prototypes/Reagents/chemicals.yml @@ -166,3 +166,17 @@ color: "#E6E6DA" physicalDesc: reagent-physical-desc-crystalline slippery: false + +- type: reagent + id: SalicylicAcid + name: reagent-name-salicylicacid + desc: reagent-desc-salicylicacid + physicalDesc: reagent-physical-desc-powdery + color: "#EEEEEE" + +- type: reagent + id: Formaldehyde + name: reagent-name-formaldehyde + desc: reagent-desc-formaldehyde + physicalDesc: reagent-physical-desc-sickly + color: "#F26724" diff --git a/Resources/Prototypes/Reagents/medicine.yml b/Resources/Prototypes/Reagents/medicine.yml index 3a7eade1d8c..9637fe387a4 100644 --- a/Resources/Prototypes/Reagents/medicine.yml +++ b/Resources/Prototypes/Reagents/medicine.yml @@ -172,7 +172,7 @@ - !type:ReagentThreshold min: 15 - !type:Drunk - + - type: reagent id: Cryoxadone name: reagent-name-cryoxadone @@ -1396,3 +1396,48 @@ - !type:PlantAdjustHealth amount: 0.1 +- type: reagent + id : Traumoxadone + name: reagent-name-traumoxadone + group: Medicine + desc: reagent-desc-traumoxadone + physicalDesc: reagent-physical-desc-soothing + flavor: medicine + color: "#880077" + worksOnTheDead: true + metabolisms: + Medicine: + effects: + - !type:HealthChange + conditions: + - !type:Temperature + max: 213.0 + damage: + types: + Blunt: -2 + Piercing: -2 + Slash: -2 + +- type: reagent + id : Stelloxadone + name: reagent-name-stelloxadone + group: Medicine + desc: reagent-desc-stelloxadone + physicalDesc: reagent-physical-desc-soothing + flavor: medicine + color: "#FFA861" + worksOnTheDead: true + metabolisms: + Medicine: + effects: + - !type:HealthChange + conditions: + - !type:Temperature + max: 213.0 + damage: + types: + Poison: -6 + Radiation: -3 + Cellular: 1 + groups: + Brute: 3 diff --git a/Resources/Prototypes/Recipes/Reactions/chemicals.yml b/Resources/Prototypes/Recipes/Reactions/chemicals.yml index 537a792e859..b4520b76cca 100644 --- a/Resources/Prototypes/Recipes/Reactions/chemicals.yml +++ b/Resources/Prototypes/Recipes/Reactions/chemicals.yml @@ -501,3 +501,29 @@ amount: 1 products: Tazinide: 1 + +- type: reaction + id : SalicylicAcid + reactants: + Phenol: + amount: 1 + Sodium: + amount: 1 + Carbon: + amount: 1 + Oxygen: + amount: 1 + SulfuricAcid: + amount: 1 + products: + SalicylicAcid: 3 + +- type: reaction + id : Formaldehyde + reactants: + Vinegar: + amount: 2 + Silver: + amount: 1 + products: + Formaldehyde: 3 diff --git a/Resources/Prototypes/Recipes/Reactions/medicine.yml b/Resources/Prototypes/Recipes/Reactions/medicine.yml index a99015fe90b..61d9fb036b9 100644 --- a/Resources/Prototypes/Recipes/Reactions/medicine.yml +++ b/Resources/Prototypes/Recipes/Reactions/medicine.yml @@ -71,7 +71,7 @@ reactants: Cryoxadone: amount: 1 - UnstableMutagen: + Phalanximine: amount: 1 products: Doxarubixadone: 2 @@ -561,8 +561,8 @@ id: Opporozidone minTemp: 400 #Maybe if a method of reducing reagent temp exists one day, this could be -50 reactants: - Cognizine: - amount: 1 + Formaldehyde: + amount: 2 Plasma: amount: 2 Doxarubixadone: @@ -662,3 +662,29 @@ amount: 1 products: Haloperidol: 5 + +- type: reaction + id: Traumoxadone + reactants: + Cryoxadone: + amount: 1 + SalicylicAcid: + amount: 1 + Lipozine: + amount: 1 + products: + Traumoxadone: 2 + +- type: reaction + id: Stelloxadone + reactants: + Cryoxadone: + amount: 3 + Stellibinin: + amount: 5 + Arithrazine: + amount: 2 + products: + Stelloxadone: 5 + Water: 3 + Fiber: 2 diff --git a/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml b/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml index f70f43c8a8b..b5fb3693166 100644 --- a/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml +++ b/Resources/ServerInfo/Guidebook/Medical/Cryogenics.xml @@ -37,14 +37,20 @@ Not every network will look like this, but hopefully, it's enough to give you th An important thing to note, winter clothing (and hardsuits) will make cryogenic treatment less, or completely ineffective. Be sure to remove cold preventative clothing before placing people in the pod. ## Using the Pod -Once things have been set up, you're going to require a specific medication, Cryoxadone. Cryoxadone heals all damage types when a patient is chilled, and can either be pre-adminsitered (with a pill), or loaded into the cell directly with a beaker. Do note, patients won't begin to heal until they've chilled to the appropriate temperature, it may be worthwhile to wait a bit before placing a beaker inside. +Once things have been set up, you're going to require cryogenic medications (all listed below). They each provide healing when a patient is chilled, and should be loaded into the pod directly with a beaker. Do note, patients won't begin to heal until they've chilled to the appropriate temperature, it may be worthwhile to wait a bit before placing a beaker inside. ## Additional Information: -The standard pressure for a gas pump is 100.325 kpa. Cryoxadone works at under 170K, but it is standard practice to set the freezer to 100K for faster freezing. +The standard pressure for a gas pump is 100.325 kpa. Cryogenics medicines work at under 213K (150K for Opporozidone), but it is standard practice to set the freezer to 100K for faster freezing. + +Cryo pods separate out each reagent from the beaker in the pod, injecting a small, steady amount of each into the patient. This allows for medicine to be administered twice as efficiently than with injection or oral administration. + + + - + +