From a8793765c52ed6369c4a38e3daba5216117a0f1b Mon Sep 17 00:00:00 2001 From: lutepickle <28810-lutepickle@users.noreply.gitgud.io> Date: Thu, 10 Nov 2022 21:46:42 -0800 Subject: [PATCH] Deduct an egg from a pawn's ovaries upon extraction --- .../RJW_Menstruation/Patch/Biotech_Patch.cs | 13 +++++++++++++ changelogs.txt | 1 + 2 files changed, 14 insertions(+) diff --git a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs index f0d80a9..c06272c 100644 --- a/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs +++ b/1.4/source/RJW_Menstruation/RJW_Menstruation/Patch/Biotech_Patch.cs @@ -85,4 +85,17 @@ namespace RJW_Menstruation return; } } + + [HarmonyPatch(typeof(Recipe_ExtractOvum), "OnSurgerySuccess")] + public class ExtractOvum_OnSurgerySuccess_Patch + { + public static void PostFix(Pawn pawn) + { + List comps = pawn.GetMenstruationComps().ToList(); + if (!comps.Any()) return; + HediffComp_Menstruation mostEggs = comps.MaxBy(comp => comp.ovarypower); + if (mostEggs.ovarypower <= 0) return; // Shouldn't happen + mostEggs.ovarypower--; + } + } } \ No newline at end of file diff --git a/changelogs.txt b/changelogs.txt index 32469b1..3d88e2c 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,5 +1,6 @@ Version 1.0.8.2 - Updated race support patches for new and removed vaginas. + - The Biotech extract ovum operation will now remove an egg from a pawn's ovaries. Version 1.0.8.1 - Added the option for humans to start Biotech pregnancies if the DLC is enabled. If set, non-humans will use the old multiple pregnancy instead.