From 30f0ad2134d7af721a9a41eb17177cf212eabb6e Mon Sep 17 00:00:00 2001 From: Doru991 <75124791+Doru991@users.noreply.github.com> Date: Thu, 10 Aug 2023 04:43:06 +0300 Subject: [PATCH] Botany tweaks vol. 2 (#18888) * Even more consumption * Revert "Even more consumption" This reverts commit 94ae0eca0ba1b4a55913f92519e1354b77e70734. Oops forgot a file * Believe it or not, more nutrient consumption * Buff ez nutrient and l4z * Add left 4 zed to emagged nutrimax just because * Change some thresholds --- Content.Server/Botany/SeedPrototype.cs | 2 +- Content.Server/Botany/Systems/MutationSystem.cs | 6 +++++- .../Botany/Systems/PlantHolderSystem.cs | 8 ++++---- .../VendingMachines/Inventories/nutri.yml | 3 ++- .../Objects/Specific/chemistry-bottles.yml | 17 +++++++++++++++++ Resources/Prototypes/Hydroponics/seeds.yml | 10 +++++----- Resources/Prototypes/Reagents/botany.yml | 4 ++-- 7 files changed, 36 insertions(+), 14 deletions(-) diff --git a/Content.Server/Botany/SeedPrototype.cs b/Content.Server/Botany/SeedPrototype.cs index c14d862ff9..4d27fbf4c5 100644 --- a/Content.Server/Botany/SeedPrototype.cs +++ b/Content.Server/Botany/SeedPrototype.cs @@ -125,7 +125,7 @@ public class SeedData #region Tolerances - [DataField("nutrientConsumption")] public float NutrientConsumption = 0.50f; + [DataField("nutrientConsumption")] public float NutrientConsumption = 0.70f; [DataField("waterConsumption")] public float WaterConsumption = 0.5f; [DataField("idealHeat")] public float IdealHeat = 293f; diff --git a/Content.Server/Botany/Systems/MutationSystem.cs b/Content.Server/Botany/Systems/MutationSystem.cs index 5939019089..7cc5545ddb 100644 --- a/Content.Server/Botany/Systems/MutationSystem.cs +++ b/Content.Server/Botany/Systems/MutationSystem.cs @@ -119,6 +119,7 @@ public sealed class MutationSystem : EntitySystem { // Probability that a bit flip happens for this value. float p = mult*bits/totalbits; + p = Math.Clamp(p, 0, 1); if (!Random(p)) { return; @@ -150,6 +151,7 @@ public sealed class MutationSystem : EntitySystem { // Probability that a bit flip happens for this value. float p = mult*bits/totalbits; + p = Math.Clamp(p, 0, 1); if (!Random(p)) { return; @@ -174,7 +176,8 @@ public sealed class MutationSystem : EntitySystem private void MutateBool(ref bool val, bool polarity, int bits, int totalbits, float mult) { // Probability that a bit flip happens for this value. - float p = mult*bits/totalbits; + float p = mult * bits / totalbits; + p = Math.Clamp(p, 0, 1); if (!Random(p)) { return; @@ -186,6 +189,7 @@ public sealed class MutationSystem : EntitySystem private void MutateHarvestType(ref HarvestType val, int bits, int totalbits, float mult) { float p = mult * bits/totalbits; + p = Math.Clamp(p, 0, 1); if (!Random(p)) return; diff --git a/Content.Server/Botany/Systems/PlantHolderSystem.cs b/Content.Server/Botany/Systems/PlantHolderSystem.cs index 5afe898767..86bee23811 100644 --- a/Content.Server/Botany/Systems/PlantHolderSystem.cs +++ b/Content.Server/Botany/Systems/PlantHolderSystem.cs @@ -344,7 +344,7 @@ namespace Content.Server.Botany.Systems } // Weeds like water and nutrients! They may appear even if there's not a seed planted. - if (component.WaterLevel > 10 && component.NutritionLevel > 2) + if (component.WaterLevel > 10 && component.NutritionLevel > 5) { var chance = 0f; if (component.Seed == null) @@ -435,7 +435,7 @@ namespace Content.Server.Botany.Systems // Make sure the plant is not starving. if (_random.Prob(0.35f)) { - if (component.NutritionLevel > 2) + if (component.NutritionLevel > 5) { component.Health += healthMod; } @@ -904,8 +904,8 @@ namespace Content.Server.Botany.Systems if (!component.DrawWarnings) return; - _appearance.SetData(uid, PlantHolderVisuals.WaterLight, component.WaterLevel <= 10, app); - _appearance.SetData(uid, PlantHolderVisuals.NutritionLight, component.NutritionLevel <= 2, app); + _appearance.SetData(uid, PlantHolderVisuals.WaterLight, component.WaterLevel <= 15, app); + _appearance.SetData(uid, PlantHolderVisuals.NutritionLight, component.NutritionLevel <= 8, app); _appearance.SetData(uid, PlantHolderVisuals.AlertLight, component.WeedLevel >= 5 || component.PestLevel >= 5 || component.Toxins >= 40 || component.ImproperHeat || component.ImproperLight || component.ImproperPressure || component.MissingGas > 0, app); diff --git a/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml b/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml index d8796b089e..3101105737 100644 --- a/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml +++ b/Resources/Prototypes/Catalog/VendingMachines/Inventories/nutri.yml @@ -17,4 +17,5 @@ DiseaseSwab: 20 #TO DO: #plant analyzer - + emaggedInventory: + Left4ZedChemistryBottle: 1 diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml index e19bcfc5a3..2fe701c010 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml @@ -190,6 +190,23 @@ tags: - Bottle +- type: entity + id: Left4ZedChemistryBottle + name: left-4-zed bottle + description: This will increase the effectiveness of mutagen. + parent: BaseChemistryEmptyBottle + components: + - type: SolutionContainerManager + solutions: + drink: + maxVol: 30 + reagents: + - ReagentId: Left4Zed + Quantity: 30 + - type: Tag + tags: + - Bottle + - type: entity id: UnstableMutagenChemistryBottle name: unstable mutagen bottle diff --git a/Resources/Prototypes/Hydroponics/seeds.yml b/Resources/Prototypes/Hydroponics/seeds.yml index 212049bb99..467f49b8e5 100644 --- a/Resources/Prototypes/Hydroponics/seeds.yml +++ b/Resources/Prototypes/Hydroponics/seeds.yml @@ -13,7 +13,7 @@ yield: 3 potency: 5 idealLight: 8 - nutrientConsumption: 0.30 + nutrientConsumption: 0.40 chemicals: Nutriment: Min: 1 @@ -39,7 +39,7 @@ yield: 3 potency: 5 idealLight: 8 - nutrientConsumption: 0.30 + nutrientConsumption: 0.40 chemicals: Nutriment: Min: 1 @@ -298,7 +298,7 @@ yield: 2 potency: 10 waterConsumption: 0.60 - nutrientConsumption: 0.30 + nutrientConsumption: 0.40 idealLight: 8 idealHeat: 298 juicy: true @@ -873,7 +873,7 @@ potency: 5 growthStages: 4 idealLight: 5 - nutrientConsumption: 0.30 + nutrientConsumption: 0.40 waterConsumption: 0.60 chemicals: Nutriment: @@ -901,7 +901,7 @@ yield: 3 potency: 5 idealLight: 7 - nutrientConsumption: 0.30 + nutrientConsumption: 0.40 chemicals: Nutriment: Min: 1 diff --git a/Resources/Prototypes/Reagents/botany.yml b/Resources/Prototypes/Reagents/botany.yml index 0197054ae7..6ab90a1113 100644 --- a/Resources/Prototypes/Reagents/botany.yml +++ b/Resources/Prototypes/Reagents/botany.yml @@ -8,7 +8,7 @@ physicalDesc: reagent-physical-desc-thick plantMetabolism: - !type:PlantAdjustNutrition - amount: 1 + amount: 2 metabolisms: Food: effects: @@ -32,7 +32,7 @@ amount: -0.5 - !type:PlantAdjustMutationMod prob: 0.3 - amount: 0.2 + amount: 0.4 metabolisms: Medicine: effects: