Correct PostFix to Postfix

This commit is contained in:
lutepickle 2023-03-12 17:27:04 -07:00
parent 699b3aa6d2
commit 9aab479fe6
3 changed files with 8 additions and 12 deletions

Binary file not shown.

View File

@ -26,33 +26,28 @@ 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;
}
@ -62,7 +57,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;
@ -74,7 +69,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;
@ -97,7 +92,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;
@ -110,7 +105,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();
@ -120,7 +115,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,6 +1,7 @@
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.