Deduct an egg from a pawn's ovaries upon extraction

This commit is contained in:
lutepickle 2022-11-10 21:46:42 -08:00
parent 0154f89438
commit a8793765c5
2 changed files with 14 additions and 0 deletions

View file

@ -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<HediffComp_Menstruation> 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--;
}
}
}

View file

@ -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.