Move the stage time advancement into its own function

This commit is contained in:
lutepickle 2023-10-29 18:11:51 -07:00
parent a6afe494d8
commit d0eb2e8383
1 changed files with 11 additions and 6 deletions

View File

@ -1621,6 +1621,11 @@ namespace RJW_Menstruation
Pawn.health.AddHediff(hediff, parent.Part); Pawn.health.AddHediff(hediff, parent.Part);
} }
protected void AdvanceStageTime()
{
curStageTicks += TickInterval * Configurations.CycleAcceleration;
}
protected virtual void FollicularAction() protected virtual void FollicularAction()
{ {
if (!IsBreedingSeason()) if (!IsBreedingSeason())
@ -1635,7 +1640,7 @@ namespace RJW_Menstruation
} }
else else
{ {
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
if (!estrusflag && curStageTicks > currentIntervalTicks - Props.estrusDaysBeforeOvulation * GenDate.TicksPerDay) if (!estrusflag && curStageTicks > currentIntervalTicks - Props.estrusDaysBeforeOvulation * GenDate.TicksPerDay)
{ {
estrusflag = true; estrusflag = true;
@ -1648,7 +1653,7 @@ namespace RJW_Menstruation
{ {
if (curStageTicks < currentIntervalTicks) if (curStageTicks < currentIntervalTicks)
{ {
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
return; return;
} }
estrusflag = false; estrusflag = false;
@ -1708,12 +1713,12 @@ namespace RJW_Menstruation
} }
else else
{ {
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
} }
} }
else else
{ {
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
} }
} }
@ -1735,7 +1740,7 @@ namespace RJW_Menstruation
else else
{ {
if (curStageTicks < currentIntervalTicks / 4) BleedOut(); if (curStageTicks < currentIntervalTicks / 4) BleedOut();
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
} }
} }
@ -1778,7 +1783,7 @@ namespace RJW_Menstruation
} }
else else
{ {
curStageTicks += TickInterval * Configurations.CycleAcceleration; AdvanceStageTime();
} }
} }