From 63b147e111e1feeb7b8df883b021ceb1106b96e2 Mon Sep 17 00:00:00 2001 From: Kara Date: Mon, 5 Sep 2022 18:43:04 -0700 Subject: [PATCH] Chem entity nerf (#11037) --- Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs | 2 +- Content.Server/Chemistry/Components/ChemMasterComponent.cs | 3 +++ .../Chemistry/Components/SharedChemMasterComponent.cs | 1 + .../Prototypes/Entities/Objects/Specific/chemistry-bottles.yml | 2 ++ Resources/Prototypes/Entities/Objects/Specific/chemistry.yml | 2 ++ 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs index b1ae05e8f7..880992ca54 100644 --- a/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs +++ b/Content.Client/Chemistry/UI/ChemMasterWindow.xaml.cs @@ -37,7 +37,7 @@ namespace Content.Client.Chemistry.UI private static bool IsSpinValid(int n) { - return n is > 0 and <= 25; + return n is > 0 and <= MaxEntitySpawns; } /// diff --git a/Content.Server/Chemistry/Components/ChemMasterComponent.cs b/Content.Server/Chemistry/Components/ChemMasterComponent.cs index bf6e4910fd..9822395458 100644 --- a/Content.Server/Chemistry/Components/ChemMasterComponent.cs +++ b/Content.Server/Chemistry/Components/ChemMasterComponent.cs @@ -281,6 +281,9 @@ namespace Content.Server.Chemistry.Components var handSys = _sysMan.GetEntitySystem(); var solSys = _sysMan.GetEntitySystem(); + pillAmount = Math.Clamp(pillAmount, 0, MaxEntitySpawns); + bottleAmount = Math.Clamp(bottleAmount, 0, MaxEntitySpawns); + if (action == UiAction.CreateBottles) { var individualVolume = BufferSolution.TotalVolume / FixedPoint2.New(bottleAmount); diff --git a/Content.Shared/Chemistry/Components/SharedChemMasterComponent.cs b/Content.Shared/Chemistry/Components/SharedChemMasterComponent.cs index 728769b32b..2dcf4349dd 100644 --- a/Content.Shared/Chemistry/Components/SharedChemMasterComponent.cs +++ b/Content.Shared/Chemistry/Components/SharedChemMasterComponent.cs @@ -12,6 +12,7 @@ namespace Content.Shared.Chemistry.Components [Virtual] public class SharedChemMasterComponent : Component { + public const int MaxEntitySpawns = 10; public static string BeakerSlotId = "ChemMaster-beaker"; [DataField("beakerSlot")] diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml index 4cb5d83493..724db06630 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry-bottles.yml @@ -42,6 +42,8 @@ solution: drink - type: TrashOnEmpty solution: drink + - type: StaticPrice + price: 0 - type: entity name: bottle diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml index 06b5589000..8bb3e3f52b 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml @@ -268,6 +268,8 @@ - type: DeleteOnTrigger - type: Extractable grindableSolutionName: food + - type: StaticPrice + price: 0 - type: entity name: pill canister