mirror of
https://gitgud.io/lutepickle/rjw_menstruation.git
synced 2024-08-14 22:46:52 +00:00
Properly count quirks for impregnation fetish
This commit is contained in:
parent
4677db4e93
commit
8013481634
2 changed files with 22 additions and 1 deletions
Binary file not shown.
|
@ -88,7 +88,28 @@ namespace RJW_Menstruation
|
|||
((PregnancyHelper.CanImpregnate(pawn, partner) && (partner.GetMenstruationComp()?.IsDangerDay ?? true))
|
||||
||
|
||||
(PregnancyHelper.CanImpregnate(partner, pawn) && (pawn.GetMenstruationComp()?.IsDangerDay ?? true)));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Quirk), "CountSatisfiedQuirks")]
|
||||
public static class CountSatisfiedQuirks_Patch
|
||||
{
|
||||
public static void Postfix(ref int __result, SexProps props)
|
||||
{
|
||||
// Awkward, but it'll have to do
|
||||
Pawn pawn = props.pawn;
|
||||
if (!pawn.Has(Quirk.ImpregnationFetish) || !props.hasPartner()) return;
|
||||
|
||||
// Check if the existing code would have added the count
|
||||
Pawn partner = props.partner;
|
||||
if (!(PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) || PregnancyHelper.CanImpregnate(partner, pawn, props.sexType))) return;
|
||||
__result = Mathf.Max(0, __result - 1); // __result shouldn't go negative, but it's better to be safe
|
||||
|
||||
if (
|
||||
(PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) && (partner.GetMenstruationComp()?.IsDangerDay ?? true))
|
||||
||
|
||||
(PregnancyHelper.CanImpregnate(partner, pawn, props.sexType) && (pawn.GetMenstruationComp()?.IsDangerDay ?? true)))
|
||||
__result++;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue