For induced ovulators, use a variable instead of EggExist for estrus/dangerday in luteal.

This commit is contained in:
lutepickle 2023-04-23 08:39:49 -07:00
parent 3de006dbbf
commit 2e2e2a120c
2 changed files with 29 additions and 2 deletions

Binary file not shown.

View file

@ -15,6 +15,14 @@ namespace RJW_Menstruation
public class HediffComp_InducedOvulator : HediffComp_Menstruation public class HediffComp_InducedOvulator : HediffComp_Menstruation
{ {
protected bool hadOvulatoryStage = false; // Regardless of whether an egg was actually produced
protected override void InitializeExtraValues()
{
base.InitializeExtraValues();
hadOvulatoryStage |= IsEggExist;
}
public override string GetCurStageDesc public override string GetCurStageDesc
{ {
get get
@ -46,12 +54,31 @@ namespace RJW_Menstruation
return Mathf.CeilToInt((Pawn.relations?.ChildrenCount ?? 0) / Configurations.ImplantationChanceDefault); return Mathf.CeilToInt((Pawn.relations?.ChildrenCount ?? 0) / Configurations.ImplantationChanceDefault);
} }
public override void CompExposeData()
{
base.CompExposeData();
Scribe_Values.Look(ref hadOvulatoryStage, "hadOvulatoryStage", false);
}
protected override void GoOvulatoryStage() protected override void GoOvulatoryStage()
{ {
estrusflag = false; estrusflag = false;
hadOvulatoryStage = false;
GoNextStage(Stage.Luteal); GoNextStage(Stage.Luteal);
} }
protected override void OvulatoryAction()
{
base.OvulatoryAction();
hadOvulatoryStage = true;
}
protected override void LutealAction()
{
base.LutealAction();
if (curStage != Stage.Luteal) hadOvulatoryStage = false;
}
protected override void AfterCumIn(Pawn cummer) protected override void AfterCumIn(Pawn cummer)
{ {
base.AfterCumIn(cummer); base.AfterCumIn(cummer);
@ -70,7 +97,7 @@ namespace RJW_Menstruation
case Stage.Ovulatory: case Stage.Ovulatory:
return true; return true;
case Stage.Luteal: case Stage.Luteal:
return IsEggExist && curStageTicks < EggLifespanTicks; return hadOvulatoryStage && curStageTicks < EggLifespanTicks;
default: default:
return false; return false;
} }
@ -88,7 +115,7 @@ namespace RJW_Menstruation
case Stage.Ovulatory: case Stage.Ovulatory:
return true; return true;
case Stage.Luteal: case Stage.Luteal:
return IsEggExist && curStageTicks < EggLifespanTicks; return hadOvulatoryStage && curStageTicks < EggLifespanTicks;
default: default:
return false; return false;
} }