Let a pawn be randomly initialized into their ovulatory stage

This commit is contained in:
lutepickle 2024-02-04 19:49:20 -08:00
parent 2dda753ab9
commit cb8267bf0f
2 changed files with 14 additions and 0 deletions

View File

@ -109,5 +109,10 @@ namespace RJW_Menstruation
if (curStage == Stage.Luteal && !hadOvulatoryStage) return false;
else return base.ShouldBeInEstrus();
}
protected override float RandomOvulationChance()
{
return 0;
}
}
}

View File

@ -1917,10 +1917,16 @@ namespace RJW_Menstruation
else return Rand.Range(0.6f, 1.0f);
}
protected virtual float RandomOvulationChance()
{
return (float)Props.ovulationIntervalHours / GenDate.HoursPerDay;
}
protected Stage RandomStage()
{
Stage stage = Rand.ElementByWeight(
Stage.Follicular, Props.follicularIntervalDays - Props.bleedingIntervalDays,
Stage.Ovulatory, RandomOvulationChance(),
Stage.Luteal, Props.lutealIntervalDays,
Stage.Bleeding, Props.bleedingIntervalDays);
@ -1929,6 +1935,9 @@ namespace RJW_Menstruation
case Stage.Follicular:
curStageTicks = Rand.Range(0, (Props.follicularIntervalDays - Props.bleedingIntervalDays) * GenDate.TicksPerDay);
break;
case Stage.Ovulatory:
curStageTicks = Rand.Range(0, Props.ovulationIntervalHours * GenDate.TicksPerHour);
break;
case Stage.Luteal:
curStageTicks = Rand.Range(0, Props.lutealIntervalDays * GenDate.TicksPerDay);
break;