Get the right menstruation comp when impregnating. Also remove CanFertilize, it's too much of a pain

This commit is contained in:
lutepickle 2022-07-13 15:40:52 -07:00
parent 28cc9755fd
commit 05029858d5
3 changed files with 12 additions and 40 deletions

Binary file not shown.

View file

@ -85,34 +85,6 @@ namespace RJW_Menstruation
return 1.0f - Mathf.Pow(1.0f - Configurations.FertilizeChance, comp.TotalFertCum * comp.Props.basefertilizationChanceFactor);
}
// A looser CanImpregnate
public static bool CanFertilize(Pawn fucker, Pawn fucked, xxx.rjwSextype sexType = xxx.rjwSextype.Vaginal)
{
if (fucker == null || fucked == null) return false;
if (!fucked.GetMenstruationComps().Any()) return PregnancyHelper.CanImpregnate(fucker, fucked, sexType);
if (sexType != xxx.rjwSextype.Vaginal && sexType != xxx.rjwSextype.DoublePenetration) return false;
if (AndroidsCompatibility.IsAndroid(fucker) && AndroidsCompatibility.IsAndroid(fucked)) return false;
if (fucker.IsUnsexyRobot() || fucked.IsUnsexyRobot()) return false;
if (!fucker.RaceHasPregnancy() || !fucked.RaceHasPregnancy()) return false;
if (!Genital_Helper.has_penis_fertile(fucker, fucker.GetGenitalsList())) return false;
if (xxx.is_human(fucked) && xxx.is_human(fucker) && !RJWPregnancySettings.humanlike_pregnancy_enabled) return false;
if (xxx.is_animal(fucker) != xxx.is_animal(fucked) && !RJWPregnancySettings.bestial_pregnancy_enabled) return false;
if (xxx.is_animal(fucker) && xxx.is_animal(fucked) && !RJWPregnancySettings.animal_pregnancy_enabled) return false;
if (fucker.def.defName != fucked.def.defName && RJWPregnancySettings.interspecies_impregnation_modifier <= 0.0f && !RJWPregnancySettings.complex_interspecies) return false;
return true;
}
public static Texture2D GetPregnancyIcon(this HediffComp_Menstruation comp, Hediff hediff)
{
string icon = "";

View file

@ -34,11 +34,11 @@ namespace RJW_Menstruation
HediffComp_Menstruation comp;
if (pawn.Has(Quirk.ImpregnationFetish) || partner.Has(Quirk.ImpregnationFetish) || partner.IsInEstrus())
comp = pawn.GetFertileMenstruationComp();
else comp = pawn.GetRandomMenstruationComp();
comp = partner.GetFertileMenstruationComp();
else comp = partner.GetRandomMenstruationComp();
if (comp == null) return true;
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && MenstruationUtility.CanFertilize(pawn, partner, sextype))
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{
PregnancyHelper.Doimpregnate(pawn, partner);
return false;
@ -105,8 +105,8 @@ namespace RJW_Menstruation
if (partner.IsAnimal() && !Configurations.EnableAnimalCycle) return true;
HediffComp_Menstruation comp;
if (pawn.Has(Quirk.ImpregnationFetish) || partner.Has(Quirk.ImpregnationFetish) || partner.IsInEstrus())
comp = pawn.GetFertileMenstruationComp();
else comp = pawn.GetRandomMenstruationComp();
comp = partner.GetFertileMenstruationComp();
else comp = partner.GetRandomMenstruationComp();
if (comp == null)
{
ModLog.Message("used original rjw method: Comp missing");
@ -144,9 +144,9 @@ namespace RJW_Menstruation
// This is stricter than can_impregnate, so quickly filter out scenarios that are negative anyways.
if (__result == false || __instance != Quirk.ImpregnationFetish) return;
__result =
(MenstruationUtility.CanFertilize(pawn, partner) && (partner.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true))
(PregnancyHelper.CanImpregnate(pawn, partner) && (partner.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true))
||
(MenstruationUtility.CanFertilize(partner, pawn) && (pawn.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true));
(PregnancyHelper.CanImpregnate(partner, pawn) && (pawn.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true));
}
}
@ -165,9 +165,9 @@ namespace RJW_Menstruation
else __result--;
if (
(MenstruationUtility.CanFertilize(pawn, partner, props.sexType) && (partner.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true))
(PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) && (partner.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true))
||
(MenstruationUtility.CanFertilize(partner, pawn, props.sexType) && (pawn.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true)))
(PregnancyHelper.CanImpregnate(partner, pawn, props.sexType) && (pawn.GetMenstruationComps()?.Any(comp => comp.IsDangerDay) ?? true)))
__result++;
}
}
@ -189,15 +189,15 @@ namespace RJW_Menstruation
}
public static void Postfix(ref float __result, Pawn fucker, Pawn fucked)
{
if (fucker.IsInEstrus(true) && MenstruationUtility.CanFertilize(fucked, fucker))
if (fucker.IsInEstrus(true) && PregnancyHelper.CanImpregnate(fucked, fucker))
{
__result *= (1f + GetNetFertility(fucker, fucked) / 4);
}
else if (fucker.IsInEstrus(false) && MenstruationUtility.CanFertilize(fucked, fucker))
else if (fucker.IsInEstrus(false) && PregnancyHelper.CanImpregnate(fucked, fucker))
{
__result *= (1f + GetNetFertility(fucker, fucked) / 40);
}
else if (xxx.is_animal(fucker) && fucked.IsInEstrus(true) && MenstruationUtility.CanFertilize(fucker, fucked))
else if (xxx.is_animal(fucker) && fucked.IsInEstrus(true) && PregnancyHelper.CanImpregnate(fucker, fucked))
{
__result *= 1.25f;
}