From 98cfa23b88c472d073496d028215972ee30008e0 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Mon, 6 Mar 2023 16:58:23 -0800 Subject: [PATCH] Replace some usage of Rand.Range with Rand.Chance --- .../RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 5ec30b2..dcb47c6 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1331,7 +1331,7 @@ namespace RJW_Menstruation float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume); - if (Rand.Range(0.0f, 1.0f) > 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor)) + if (Rand.Chance(Mathf.Pow(1.0f - Configurations.FertilizeChance, totalFertPower * Props.basefertilizationChanceFactor))) return null; Pawn.records.AddTo(VariousDefOf.AmountofFertilizedEggs, 1); @@ -1372,7 +1372,7 @@ namespace RJW_Menstruation deadeggs.Add(egg); continue; } - else if (Rand.Range(0.0f, 1.0f) <= Configurations.ImplantationChance * ImplantChance * InterspeciesImplantFactor(egg.fertilizer)) + else if (Rand.Chance(Configurations.ImplantationChance * ImplantChance * InterspeciesImplantFactor(egg.fertilizer))) { if (Configurations.Debug) Log.Message($"Implanting fertilized egg of {Pawn} into {parent}, father {egg.fertilizer}"); if (pregnancy != null) @@ -1634,7 +1634,7 @@ namespace RJW_Menstruation if (curStageHrs >= currentIntervalHours) { eggs.Clear(); - if (EggHealth < 1f / 4f || (EggHealth < 1f / 3f && Rand.Range(0.0f, 1.0f) < 0.3f)) //skips bleeding + if (EggHealth < 1f / 4f || (EggHealth < 1f / 3f && Rand.Chance(0.3f))) //skips bleeding { GoNextStage(Stage.Follicular); }