From: Flesh <62557990+PolterTzi@users.noreply.github.com> Date: Fri, 31 May 2024 17:56:41 +0000 (+0200) Subject: Use existing probability field (#28422) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e145a666c9b05278dab848ef49e3cbebd06a5ca2;p=space-station-14.git Use existing probability field (#28422) Remove the PlantAdjustAttribute "Prob" field and use the existing probability field from ReagentEffects instead. --- diff --git a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs index 80c5ca5cf2..9bd8fdaa68 100644 --- a/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs +++ b/Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs @@ -12,9 +12,6 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism [DataField] public float Amount { get; protected set; } = 1; - [DataField] - public float Prob { get; protected set; } = 1; // = (80); - /// /// Localisation key for the name of the adjusted attribute. Used for guidebook descriptions. /// @@ -45,11 +42,7 @@ namespace Content.Server.Chemistry.ReagentEffects.PlantMetabolism || mustHaveAlivePlant && (plantHolderComponent.Seed == null || plantHolderComponent.Dead)) return false; - if (Prob >= 1f) - return true; - - // Dependencies are never injected for reagents if you intend to do that for this. - return !(Prob <= 0f) && IoCManager.Resolve().Prob(Prob); + return true; } protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys) diff --git a/Resources/Prototypes/Reagents/botany.yml b/Resources/Prototypes/Reagents/botany.yml index cdd19dc308..99e9182103 100644 --- a/Resources/Prototypes/Reagents/botany.yml +++ b/Resources/Prototypes/Reagents/botany.yml @@ -31,7 +31,7 @@ - !type:PlantAdjustHealth amount: -0.5 - !type:PlantAdjustMutationMod - prob: 0.3 + probability: 0.3 amount: 0.4 metabolisms: Medicine: @@ -115,10 +115,10 @@ - !type:PlantAdjustNutrition amount: 0.05 - !type:PlantAdjustWeeds - prob: 0.025 + probability: 0.025 amount: 1 - !type:PlantAdjustPests - prob: 0.025 + probability: 0.025 amount: 1 - !type:RobustHarvest {} metabolisms: @@ -273,12 +273,12 @@ - !type:PlantAdjustNutrition amount: 0.1 - !type:PlantAdjustPests - prob: 0.1 + probability: 0.1 amount: -1 - !type:PlantAdjustHealth amount: 0.1 - !type:PlantAffectGrowth - prob: 0.2 + probability: 0.2 amount: 1 - !type:PlantDiethylamine {} metabolisms: diff --git a/Resources/Prototypes/Reagents/elements.yml b/Resources/Prototypes/Reagents/elements.yml index e47335b1b4..4f05568ad2 100644 --- a/Resources/Prototypes/Reagents/elements.yml +++ b/Resources/Prototypes/Reagents/elements.yml @@ -334,7 +334,7 @@ - !type:PlantAdjustHealth amount: -1.5 - !type:PlantAdjustMutationMod - prob: 0.2 + probability: 0.2 amount: 0.1 metabolisms: Poison: