mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Use a weighted random when determining the stage of a new pawn
This commit is contained in:
parent
983e112edd
commit
93218a8aa1
1 changed files with 5 additions and 2 deletions
|
@ -1841,7 +1841,10 @@ namespace RJW_Menstruation
|
||||||
|
|
||||||
protected Stage RandomStage()
|
protected Stage RandomStage()
|
||||||
{
|
{
|
||||||
int rand = Rand.Range(0, 2);
|
int rand = Rand.ElementByWeight(
|
||||||
|
0, Props.folicularIntervalDays - Props.bleedingIntervalDays,
|
||||||
|
1, Props.lutealIntervalDays,
|
||||||
|
2, Props.bleedingIntervalDays);
|
||||||
|
|
||||||
switch (rand)
|
switch (rand)
|
||||||
{
|
{
|
||||||
|
@ -1849,7 +1852,7 @@ namespace RJW_Menstruation
|
||||||
curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24);
|
curStageHrs = Rand.Range(0, (Props.folicularIntervalDays - Props.bleedingIntervalDays) * 24);
|
||||||
return Stage.Follicular;
|
return Stage.Follicular;
|
||||||
case 1:
|
case 1:
|
||||||
curStageHrs = Rand.Range(0, Props.eggLifespanDays * 24);
|
curStageHrs = Rand.Range(0, Props.lutealIntervalDays * 24);
|
||||||
return Stage.Luteal;
|
return Stage.Luteal;
|
||||||
case 2:
|
case 2:
|
||||||
curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
|
curStageHrs = Rand.Range(0, Props.bleedingIntervalDays * 24);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue