Compare commits

..

No commits in common. "06cc59378c55f31101536720419f12df682675fb" and "e4bd9a1f3c4cbfa3afc48469de6e085364b6a114" have entirely different histories.

3 changed files with 8 additions and 16 deletions

View file

@ -1340,9 +1340,9 @@ namespace RJW_Menstruation
protected Pawn Fertilize() protected Pawn Fertilize()
{ {
if (cums == null) return null; if (cums.NullOrEmpty()) return null;
List<Cum> eligibleCum = cums.FindAll(cum => CumCanFertilize(cum)); List<Cum> eligibleCum = cums.FindAll(cum => CumCanFertilize(cum));
if (eligibleCum.Empty()) return null; if (eligibleCum.Count == 0) return null;
float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume); float totalFertPower = eligibleCum.Sum(cum => cum.FertVolume);

View file

@ -244,7 +244,7 @@ namespace RJW_Menstruation
isInduced && isInduced &&
comp.Pawn.jobs.curDriver is JobDriver_Sex job && comp.Pawn.jobs.curDriver is JobDriver_Sex job &&
job.Sexprops != null && job.Sexprops != null &&
!UsingCondom(comp.Pawn, job.Partner) && !job.Sexprops.usedCondom &&
(job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration)) (job.Sexprops.sexType == xxx.rjwSextype.Vaginal || job.Sexprops.sexType == xxx.rjwSextype.DoublePenetration))
ovulatoryProgress = 0.0f; ovulatoryProgress = 0.0f;
else if (comp.curStage == HediffComp_Menstruation.Stage.Ovulatory) ovulatoryProgress = isInduced ? Mathf.Max(ovaryChanceToShow_01, comp.StageProgessNextUpdate) : comp.StageProgessNextUpdate; else if (comp.curStage == HediffComp_Menstruation.Stage.Ovulatory) ovulatoryProgress = isInduced ? Mathf.Max(ovaryChanceToShow_01, comp.StageProgessNextUpdate) : comp.StageProgessNextUpdate;
@ -466,13 +466,5 @@ namespace RJW_Menstruation
return damage.totalDamageDealt; return damage.totalDamageDealt;
} }
public static bool UsingCondom(Pawn pawn, Pawn partner)
{
return
((pawn?.jobs?.curDriver as JobDriver_Sex)?.Sexprops.usedCondom ?? false)
||
((partner?.jobs?.curDriver as JobDriver_Sex)?.Sexprops.usedCondom ?? false);
}
} }
} }

View file

@ -19,11 +19,13 @@ namespace RJW_Menstruation
public static bool Prefix(SexProps props) public static bool Prefix(SexProps props)
{ {
xxx.rjwSextype sextype = props.sexType; xxx.rjwSextype sextype = props.sexType;
Pawn pawn = props.pawn; // Penis Pawn pawn = props.pawn;
Pawn partner = props.partner; // Womb Pawn partner = props.partner;
if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true; if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return true;
if (!partner.ShouldCycle()) return true; if (!partner.ShouldCycle()) return true;
if (!InteractionCanCausePregnancy(props)) return false; if (!InteractionCanCausePregnancy(props)) return false;
List<Hediff> pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)); List<Hediff> pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
@ -36,8 +38,6 @@ namespace RJW_Menstruation
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{ {
if (MenstruationUtility.UsingCondom(pawn, partner)) return false; // Probably unnecessary
PregnancyHelper.DoImpregnate(pawn, partner); PregnancyHelper.DoImpregnate(pawn, partner);
return false; return false;
} }
@ -344,7 +344,7 @@ namespace RJW_Menstruation
xxx.rjwSextype sextype = __instance.Sexprops.sexType; xxx.rjwSextype sextype = __instance.Sexprops.sexType;
if (!(target is Pawn partner)) return; if (!(target is Pawn partner)) return;
if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return; if (sextype != xxx.rjwSextype.Vaginal && sextype != xxx.rjwSextype.DoublePenetration) return;
if (MenstruationUtility.UsingCondom(pawn, partner)) return; if (__instance.Sexprops.usedCondom) return;
if (AndroidsCompatibility.IsAndroid(pawn)) return; if (AndroidsCompatibility.IsAndroid(pawn)) return;
if (!Impregnate_Patch.InteractionCanCausePregnancy(__instance.Sexprops)) return; if (!Impregnate_Patch.InteractionCanCausePregnancy(__instance.Sexprops)) return;
if (!partner.ShouldCycle()) return; if (!partner.ShouldCycle()) return;