From 60a842fd2b10e28cdf43ca071d400722e2431772 Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Thu, 7 Jul 2022 07:52:43 -0700 Subject: [PATCH] Eggs implant at half luteal or 30 days, whichever comes first. --- .../HediffComps/HediffComp_Menstruation.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 5b64733..b13459e 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -66,6 +66,8 @@ namespace RJW_Menstruation //const int ovarypowerthreshold = 72; public const int tickInterval = GenDate.TicksPerHour; + public const int maxImplantDelayDays = 30; + public const int minImplantAgeHours = 72; public CompProperties_Menstruation Props; public Stage curStage = Stage.Follicular; public int curStageHrs = 0; @@ -1152,7 +1154,10 @@ namespace RJW_Menstruation bool pregnant = false; foreach (Egg egg in eggs) { - if (!egg.fertilized || egg.fertstage < 168) continue; + if (!egg.fertilized || + egg.fertstage < minImplantAgeHours || + egg.position < Math.Min(Props.lutealIntervalDays / 2, maxImplantDelayDays) * 24) + continue; else if (egg.fertilizer is null) { deadeggs.Add(egg);