Compare commits

..

No commits in common. "9aab479fe6715ea16537e6929af727e9b7ef10b2" and "de2da85558b3bddb82a9ebafd8bca4c38f4a7380" have entirely different histories.

4 changed files with 13 additions and 9 deletions

Binary file not shown.

View file

@ -1577,7 +1577,7 @@ namespace RJW_Menstruation
}
else if (curStageHrs >= currentIntervalHours)
{
GoOvulatoryStage();
GoNextStage(Stage.Ovulatory);
}
else
{

View file

@ -26,28 +26,33 @@ namespace RJW_Menstruation
public static void Postfix(Hediff_Pregnant __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor starting, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLabor);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
}
}
[HarmonyPatch(typeof(Hediff_Labor), nameof(Hediff_Labor.PreRemoved))]
public class Labor_PreRemoved_Patch
{
public static void Postfix(Hediff_Labor __instance)
public static void PostFix(Hediff_Labor __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s initial labor ending, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = __instance.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.PregnancyLaborPushing);
if (Configurations.Debug) Log.Message($"New pregnancy Hediff is {comp.Pregnancy}");
}
}
[HarmonyPatch(typeof(Hediff_LaborPushing), nameof(Hediff_LaborPushing.PreRemoved))]
public class LaborPushing_PreRemoved_Patch
{
public static void Postfix(Hediff_LaborPushing __instance)
public static void PostFix(Hediff_LaborPushing __instance)
{
HediffComp_Menstruation comp = __instance.GetMenstruationCompFromPregnancy();
if (Configurations.Debug) Log.Message($"{comp.Pawn}'s labor pushing ending, menstruation comp is {comp}");
if (comp == null) return;
comp.Pregnancy = null;
}
@ -57,7 +62,7 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(Hediff_Pregnant), nameof(Hediff_Pregnant.GestationProgress), MethodType.Getter)]
public class Hediff_Pregnant_GestationProgess_Patch
{
public static void Postfix(Hediff_Pregnant __instance, ref float __result)
public static void PostFix(Hediff_Pregnant __instance, ref float __result)
{
if (__result < 1f) return;
Pawn pawn = __instance.pawn;
@ -69,7 +74,7 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(Recipe_ExtractOvum), nameof(Recipe_ExtractOvum.AvailableReport))]
public class ExtractOvum_AvailableReport_Patch
{
public static void Postfix(Thing thing, ref AcceptanceReport __result)
public static void PostFix(Thing thing, ref AcceptanceReport __result)
{
if (!__result.Accepted) return;
Pawn pawn = (Pawn)thing;
@ -92,7 +97,7 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(Recipe_ExtractOvum), "OnSurgerySuccess")]
public class ExtractOvum_OnSurgerySuccess_Patch
{
public static void Postfix(Pawn pawn)
public static void PostFix(Pawn pawn)
{
List<HediffComp_Menstruation> comps = pawn.GetMenstruationComps().ToList();
if (!comps.Any()) return;
@ -105,7 +110,7 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(Recipe_ImplantEmbryo), nameof(Recipe_ImplantEmbryo.ApplyOnPawn))]
public class ImplantEmbryo_ApplyOnPawn_Patch
{
public static void Postfix(Pawn pawn)
public static void PostFix(Pawn pawn)
{
foreach (HediffComp_Menstruation comp in pawn.GetMenstruationComps())
comp.TakeLoosePregnancy();
@ -115,7 +120,7 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(PregnancyUtility), nameof(PregnancyUtility.ApplyBirthOutcome))]
public class ApplyBirthOutcome_Breast_Patch
{
public static void Postfix(Thing birtherThing)
public static void PostFix(Thing birtherThing)
{
if (birtherThing is Pawn pawn && !pawn.health.Dead)
pawn.GetBreastComp()?.GaveBirth();

View file

@ -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.
- Other bug fixes
- 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.