mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Let a pawn be randomly initialized into their ovulatory stage
This commit is contained in:
parent
2dda753ab9
commit
cb8267bf0f
2 changed files with 14 additions and 0 deletions
|
@ -109,5 +109,10 @@ namespace RJW_Menstruation
|
|||
if (curStage == Stage.Luteal && !hadOvulatoryStage) return false;
|
||||
else return base.ShouldBeInEstrus();
|
||||
}
|
||||
|
||||
protected override float RandomOvulationChance()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue