From 32ae526b0fa5067077346d97a2dbea91abd037b3 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Tue, 31 May 2022 08:22:35 -0700 Subject: [PATCH] Better handle climacteric for induced ovulators --- .../HediffComps/HediffComp_InducedOvulator.cs | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs index 0c67735..40eae4d 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_InducedOvulator.cs @@ -45,8 +45,8 @@ namespace RJW_Menstruation } if (curStageHrs >= FollicularIntervalHours) { - GoNextStage(Stage.Luteal); estrusflag = false; + GoNextStage(Stage.Luteal); } else { @@ -60,10 +60,38 @@ namespace RJW_Menstruation } } + protected override void ClimactericFollicularAction() + { + if (!Configurations.EnableMenopause) + { + RemoveClimactericEffect(); + StayCurrentStage(); + } + else if (curStageHrs >= (follicularIntervalhours - bleedingIntervalhours) * CycleFactor) + { + estrusflag = false; + GoNextStage(Stage.ClimactericLuteal); + } + else + { + curStageHrs += Configurations.CycleAcceleration; + StayCurrentStage(); + } + } + protected override void AfterCumIn(Pawn cummer) { base.AfterCumIn(cummer); - if (curStage == Stage.Follicular || curStage == Stage.ClimactericFollicular) curStage = Stage.Ovulatory; + switch (curStage) + { + case Stage.Follicular: + curStage = Stage.Ovulatory; + break; + case Stage.ClimactericFollicular: + if(ovarypower >= OvaryPowerThreshold / 3 || Rand.Range(0.0f, 1.0f) > 0.2f) // chance to fail to induce + curStage = Stage.Ovulatory; + break; + } } public override bool IsDangerDay