diff --git a/1.4/Assemblies/RJW_Menstruation.dll b/1.4/Assemblies/RJW_Menstruation.dll index 4e04199..24345de 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 a9cf99a..2f43120 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,6 +307,7 @@ namespace RJW_Menstruation } else part.TransformValue(StatRequest.For(Pawn), ref ovulationChance); } + if (Pawn.Has(Quirk.Breeder)) ovulationChance *= 10.0f; try { calculatingOvulationChance = true; @@ -322,18 +323,19 @@ 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; + } } } @@ -1593,7 +1595,6 @@ namespace RJW_Menstruation { estrusflag = false; float eggnum; - int ovulated; try { eggnum = Math.Max(Rand.ByCurve(Pawn.def.race.litterSizeCurve), 1f); @@ -1608,13 +1609,19 @@ namespace RJW_Menstruation eggnum = 1f; } eggnum *= ovulationFactor; - ovulated = (int)eggnum + eggstack; + int toOvulate = (int)eggnum + eggstack; float ovulationChance = OvulationChance; - for (int i = 0; i < ovulated; i++) + int ovulated = 0; + for (int i = 0; i < toOvulate; 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 8fc798d..9b726b2 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 1c41775..0037925 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,6 +1,7 @@ Version 1.0.8.8 - Fix pawns skipping straight to menopause instead of going through climacteric stages. - - Rework ovulation mechanics. A pawn's implantation chance is now dependent on their age. + - 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. - 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.