diff --git a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs index 47dcb3f4534d7d..f8a1fa7c91b6ae 100644 --- a/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs +++ b/Content.Shared/Chemistry/Reaction/ChemicalReactionSystem.cs @@ -4,7 +4,6 @@ using Content.Shared.Database; using Content.Shared.EntityEffects; using Content.Shared.FixedPoint; -using Content.Shared.Implants.Components; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -167,8 +166,27 @@ private List PerformReaction(Entity soln, ReactionPro var energy = reaction.ConserveEnergy ? solution.GetThermalEnergy(_prototypeManager) : 0; + List dnaDataList = new List(); + + //save reactant DNA to DNAlist + if (reaction.PreserveDNA) + { + + foreach (var reagent in solution.Contents) + { + + foreach (var data in reagent.Reagent.EnsureReagentData()) + { + if (data is DnaData) + { + dnaDataList.Add((data)); + } + } + } + } + //Remove reactants - foreach (var reactant in reaction.Reactants) + foreach (KeyValuePair reactant in reaction.Reactants) { if (!reactant.Value.Catalyst) { @@ -182,7 +200,7 @@ private List PerformReaction(Entity soln, ReactionPro foreach (var product in reaction.Products) { products.Add(product.Key); - solution.AddReagent(product.Key, product.Value * unitReactions); + solution.AddReagent(new ReagentId(product.Key, dnaDataList), product.Value * unitReactions); } if (reaction.ConserveEnergy) @@ -192,10 +210,6 @@ private List PerformReaction(Entity soln, ReactionPro solution.Temperature = energy / newCap; } - if(reaction.preserveDNA) - { - - } OnReaction(soln, reaction, null, unitReactions); diff --git a/Content.Shared/Chemistry/Reaction/ReactionPrototype.cs b/Content.Shared/Chemistry/Reaction/ReactionPrototype.cs index bc22abb30cf696..0d19fa56adb1dc 100644 --- a/Content.Shared/Chemistry/Reaction/ReactionPrototype.cs +++ b/Content.Shared/Chemistry/Reaction/ReactionPrototype.cs @@ -66,7 +66,7 @@ public sealed partial class ReactionPrototype : IPrototype, IComparable [DataField("preserveDNA")] - public bool preserveDNA = false; + public bool PreserveDNA = false; /// /// How dangerous is this effect? Stuff like bicaridine should be low, while things like methamphetamine diff --git a/Resources/Prototypes/Recipes/Reactions/drinks.yml b/Resources/Prototypes/Recipes/Reactions/drinks.yml index 67a5b54f81aac0..f20ef7bc73943b 100644 --- a/Resources/Prototypes/Recipes/Reactions/drinks.yml +++ b/Resources/Prototypes/Recipes/Reactions/drinks.yml @@ -294,6 +294,7 @@ - type: reaction id: DemonsBlood + preserveDNA: true requiredMixerCategories: - Stir reactants: @@ -310,6 +311,7 @@ - type: reaction id: DevilsKiss + preserveDNA: true requiredMixerCategories: - Stir reactants: @@ -824,6 +826,7 @@ - type: reaction id: RedMead + preserveDNA: true reactants: Mead: amount: 1 diff --git a/Resources/Prototypes/Recipes/Reactions/fun.yml b/Resources/Prototypes/Recipes/Reactions/fun.yml index 5ae173c0ee5b9b..00a37972e130c4 100644 --- a/Resources/Prototypes/Recipes/Reactions/fun.yml +++ b/Resources/Prototypes/Recipes/Reactions/fun.yml @@ -73,6 +73,7 @@ - type: reaction id: SpaceGlue + preserveDNA: true minTemp: 370 reactants: SpaceLube: diff --git a/Resources/Prototypes/Recipes/Reactions/medicine.yml b/Resources/Prototypes/Recipes/Reactions/medicine.yml index a99015fe90be40..09b4d070dfc6ac 100644 --- a/Resources/Prototypes/Recipes/Reactions/medicine.yml +++ b/Resources/Prototypes/Recipes/Reactions/medicine.yml @@ -208,6 +208,7 @@ - type: reaction id: Ambuzol + preserveDNA: true reactants: Dylovene: amount: 1 diff --git a/Resources/Prototypes/Recipes/Reactions/single_reagent.yml b/Resources/Prototypes/Recipes/Reactions/single_reagent.yml index 46fe35415f0b62..ad4b67d9a53b3a 100644 --- a/Resources/Prototypes/Recipes/Reactions/single_reagent.yml +++ b/Resources/Prototypes/Recipes/Reactions/single_reagent.yml @@ -37,6 +37,7 @@ - type: reaction id: BloodToWine + preserveDNA: true impact: Low requiredMixerCategories: - Holy