From ec4326748b89aadcba3ef4b3ebccad76ac9c10b9 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Sun, 13 Mar 2022 11:06:41 +1300 Subject: [PATCH] Botany fix (#7071) --- .../Botany/Systems/BotanySystem.Plant.cs | 5 +++-- .../PlantMetabolism/PlantDiethylamine.cs | 14 +++----------- .../PlantMetabolism/RobustHarvest.cs | 16 +++------------- 3 files changed, 9 insertions(+), 26 deletions(-) diff --git a/Content.Server/Botany/Systems/BotanySystem.Plant.cs b/Content.Server/Botany/Systems/BotanySystem.Plant.cs index dcf14ed354..67f9aa66cf 100644 --- a/Content.Server/Botany/Systems/BotanySystem.Plant.cs +++ b/Content.Server/Botany/Systems/BotanySystem.Plant.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using Content.Server.Botany.Components; using Content.Server.Chemistry.EntitySystems; using Content.Server.Popups; @@ -44,7 +44,8 @@ namespace Content.Server.Botany.Systems foreach (var seed in _prototypeManager.EnumeratePrototypes()) { - AddSeedToDatabase(seed); + seed.Uid = GetNextSeedUid(); + Seeds[seed.Uid] = seed; } } diff --git a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantDiethylamine.cs b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantDiethylamine.cs index d7e2746118..e447f8fc3b 100644 --- a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantDiethylamine.cs +++ b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantDiethylamine.cs @@ -1,13 +1,7 @@ -using Content.Server.Botany.Components; -using Content.Shared.Botany; -using Content.Shared.Chemistry.Components; +using Content.Server.Botany.Components; using Content.Shared.Chemistry.Reagent; using JetBrains.Annotations; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Maths; using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism { @@ -24,15 +18,13 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism var random = IoCManager.Resolve(); - var chance = MathHelper.Lerp(15f, 125f, plantHolderComp.Seed.Lifespan) * 2f; - if (random.Prob(chance)) + if (random.Prob(0.1f)) { plantHolderComp.CheckForDivergence(true); plantHolderComp.Seed.Lifespan++; } - chance = MathHelper.Lerp(15f, 125f, plantHolderComp.Seed.Endurance) * 2f; - if (random.Prob(chance)) + if (random.Prob(0.1f)) { plantHolderComp.CheckForDivergence(true); plantHolderComp.Seed.Endurance++; diff --git a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/RobustHarvest.cs b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/RobustHarvest.cs index d6960936d5..e5e4993bce 100644 --- a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/RobustHarvest.cs +++ b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/RobustHarvest.cs @@ -1,13 +1,7 @@ -using Content.Server.Botany.Components; -using Content.Shared.Botany; -using Content.Shared.Chemistry.Components; +using Content.Server.Botany.Components; using Content.Shared.Chemistry.Reagent; using JetBrains.Annotations; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; -using Robust.Shared.Maths; using Robust.Shared.Random; -using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism { @@ -24,17 +18,13 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism var random = IoCManager.Resolve(); - var chance = MathHelper.Lerp(15f, 150f, plantHolderComp.Seed.Potency) * 3.5f; - - if (random.Prob(chance)) + if (plantHolderComp.Seed.Potency < 100 && random.Prob(0.1f)) { plantHolderComp.CheckForDivergence(true); plantHolderComp.Seed.Potency++; } - chance = MathHelper.Lerp(6f, 2f, plantHolderComp.Seed.Yield) * 0.15f; - - if (random.Prob(chance)) + if (plantHolderComp.Seed.Yield > 1 && random.Prob(0.1f)) { plantHolderComp.CheckForDivergence(true); plantHolderComp.Seed.Yield--;