]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Use existing probability field (#28422)
authorFlesh <62557990+PolterTzi@users.noreply.github.com>
Fri, 31 May 2024 17:56:41 +0000 (19:56 +0200)
committerGitHub <noreply@github.com>
Fri, 31 May 2024 17:56:41 +0000 (09:56 -0800)
Remove the PlantAdjustAttribute "Prob" field and use the existing probability field from ReagentEffects instead.

Content.Server/Chemistry/ReagentEffects/PlantMetabolism/PlantAdjustAttribute.cs
Resources/Prototypes/Reagents/botany.yml
Resources/Prototypes/Reagents/elements.yml

index 80c5ca5cf2b915324d9e0cad412d2c723e8a034e..9bd8fdaa6847360be5a8997452163f63fd968f7a 100644 (file)
@@ -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);
-
         /// <summary>
         /// Localisation key for the name of the adjusted attribute. Used for guidebook descriptions.
         /// </summary>
@@ -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<IRobustRandom>().Prob(Prob);
+            return true;
         }
 
         protected override string? ReagentEffectGuidebookText(IPrototypeManager prototype, IEntitySystemManager entSys)
index cdd19dc308d4a2696c944ea075a4d6c46a21a774..99e9182103dc19a16833f6b2873c7b25ff4fb5df 100644 (file)
@@ -31,7 +31,7 @@
     - !type:PlantAdjustHealth
       amount: -0.5
     - !type:PlantAdjustMutationMod
-      prob: 0.3
+      probability: 0.3
       amount: 0.4
   metabolisms:
     Medicine:
     - !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:
   - !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:
index e47335b1b4a1f63ca049d8f0bc903e638d97fea9..4f05568ad2b05e8823f8ad56bcf31a36f6122a3a 100644 (file)
   - !type:PlantAdjustHealth
     amount: -1.5
   - !type:PlantAdjustMutationMod
-    prob: 0.2
+    probability: 0.2
     amount: 0.1
   metabolisms:
     Poison: