diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 24345de..4e04199 100644 Binary files a/1.4/Assemblies/RJW_Menstruation.dll and b/1.4/Assemblies/RJW_Menstruation.dll differ diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index 2f43120..a9cf99a 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -307,7 +307,6 @@ namespace RJW_Menstruation } else part.TransformValue(StatRequest.For(Pawn), ref ovulationChance); } - if (Pawn.Has(Quirk.Breeder)) ovulationChance *= 10.0f; try { calculatingOvulationChance = true; @@ -323,19 +322,18 @@ namespace RJW_Menstruation get { float factor = 1.0f; + if (Pawn.Has(Quirk.Breeder)) factor = 10.0f; + if (ModsConfig.BiotechActive && xxx.is_human(Pawn)) { // Implant factor will be based solely on pawn age, plus any rollover from ovulation chance StatPart_FertilityByGenderAge fertilityStatPart = StatDefOf.Fertility.GetStatPart(); fertilityStatPart?.TransformValue(StatRequest.For(Pawn), ref factor); float ovulationOverflow = OvulationChance; - if (ovulationOverflow > 1.0f) factor *= ovulationOverflow; + if (ovulationOverflow > 1.0f) factor *= ovulationOverflow; return Props.baseImplantationChanceFactor * FertilityModifier * factor; } - else - { - return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier * factor; - } + else return Pawn.health.capacities.GetLevel(xxx.reproduction) * Props.baseImplantationChanceFactor * FertilityModifier * factor; } } @@ -1595,6 +1593,7 @@ namespace RJW_Menstruation { estrusflag = false; float eggnum; + int ovulated; try { eggnum = Math.Max(Rand.ByCurve(Pawn.def.race.litterSizeCurve), 1f); @@ -1609,19 +1608,13 @@ namespace RJW_Menstruation eggnum = 1f; } eggnum *= ovulationFactor; - int toOvulate = (int)eggnum + eggstack; + ovulated = (int)eggnum + eggstack; float ovulationChance = OvulationChance; - int ovulated = 0; - for (int i = 0; i < toOvulate; i++) + for (int i = 0; i < ovulated; i++) if (i < eggstack || Rand.Chance(ovulationChance)) // eggstack comes from drugs and are guaranteed ovulated - { eggs.Add(new Egg((int)(EggLifespanHours / CycleFactor))); - ++ovulated; - } ovarypower -= ovulated; - if (Configurations.Debug && ovulated != toOvulate) - Log.Message($"{Pawn} ovulated {ovulated}/{toOvulate} eggs ({ovulationChance.ToStringPercent()} chance)"); eggstack = 0; if (EggHealth <= 0) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs index 9b726b2..8fc798d 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/UI/Dialog_WombStatus.cs @@ -228,7 +228,7 @@ namespace RJW_Menstruation string fainfo = PregnancyCommon.GetFatherInfo(babiescomp?.babies, babiescomp.Pawn, true) + " "; // Keep all parents known, for now if (feinfo == "Null") feinfo = "1 " + p.Mother.def.label + " " + Translations.Dialog_WombInfo02; - if (fainfo == "Null ") + if (fainfo == "Null") { string father = p.Father?.LabelShort ?? Translations.Dialog_FatherUnknown; fainfo = Translations.Dialog_WombInfo03 + ": " + father + " "; diff --git a/changelogs.txt b/changelogs.txt index 0037925..1c41775 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,7 +1,6 @@ Version 1.0.8.8 - Fix pawns skipping straight to menopause instead of going through climacteric stages. - - Fix father appearing as "Null" in womb dialog for some Biotech pregnancies. - - Rework ovulation mechanics. A pawn's implantation chance is now dependent only on their age. + - Rework ovulation mechanics. A pawn's implantation chance is now dependent on their age. - All other fertility-altering effects instead change the odds of ovulation occuring, rolled per-egg. This chance appears in the womb dialog. - If the chance of ovulation goes above 100%, the implantation chance is increased. - Drugs that increase the number of eggs ovulated are still guaranteed to work.