Replace some usage of Rand.Range with Rand.Chance

This commit is contained in:
lutepickle 2023-03-06 16:58:23 -08:00
parent c8d32f883f
commit 98cfa23b88
1 changed files with 3 additions and 3 deletions

View File

@ -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);
}