Concealed estrus gets a (very small) boost, too

This commit is contained in:
lutepickle 2022-04-27 10:28:40 -07:00
parent 3009a3c6ef
commit 1c24fab708
5 changed files with 40 additions and 13 deletions

Binary file not shown.

View File

@ -10,24 +10,31 @@ namespace RJW_Menstruation.Interactions
{
public class EstrusPartKindUsageRule : IPartPreferenceRule
{
private bool WillingAndAble(Pawn fucker, Pawn fucked)
private const float visible_estrus_multiplier = Multipliers.Doubled;
private const float concealed_estrus_multiplier = 1.1f;
private bool WillingAndAble(Pawn fucker, Pawn fucked, bool visible)
{
return
(fucked.health?.hediffSet?.HasHediff(VariousDefOf.Hediff_Estrus) ?? false)
HediffComp_Menstruation.IsInEstrus(fucked, visible)
&&
PregnancyHelper.CanImpregnate(fucker, fucked);
}
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForDominant(InteractionContext context)
{
if (WillingAndAble(context.Internals.Submissive.Pawn, context.Internals.Dominant.Pawn))
yield return new Weighted<LewdablePartKind>(Multipliers.Frequent, LewdablePartKind.Vagina);
if (WillingAndAble(context.Internals.Submissive.Pawn, context.Internals.Dominant.Pawn, true))
yield return new Weighted<LewdablePartKind>(visible_estrus_multiplier, LewdablePartKind.Vagina);
else if (WillingAndAble(context.Internals.Submissive.Pawn, context.Internals.Dominant.Pawn, false))
yield return new Weighted<LewdablePartKind>(concealed_estrus_multiplier, LewdablePartKind.Vagina);
}
public IEnumerable<Weighted<LewdablePartKind>> ModifiersForSubmissive(InteractionContext context)
{
if (WillingAndAble(context.Internals.Dominant.Pawn, context.Internals.Submissive.Pawn))
yield return new Weighted<LewdablePartKind>(Multipliers.Frequent, LewdablePartKind.Vagina);
if (WillingAndAble(context.Internals.Dominant.Pawn, context.Internals.Submissive.Pawn, true))
yield return new Weighted<LewdablePartKind>(visible_estrus_multiplier, LewdablePartKind.Vagina);
else if (WillingAndAble(context.Internals.Dominant.Pawn, context.Internals.Submissive.Pawn, false))
yield return new Weighted<LewdablePartKind>(concealed_estrus_multiplier, LewdablePartKind.Vagina);
}
}
}

View File

@ -1022,11 +1022,10 @@ namespace RJW_Menstruation
}
}
public static bool IsInEstrus(Pawn pawn, bool includeConcealed = false)
public static bool IsInEstrus(Pawn pawn, bool visible = true)
{
if (pawn.Dead) return false;
if (pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus)) return true;
else return includeConcealed && pawn.health.hediffSet.HasHediff(VariousDefOf.Hediff_Estrus_Concealed);
return pawn.health?.hediffSet?.HasHediff(visible ? VariousDefOf.Hediff_Estrus : VariousDefOf.Hediff_Estrus_Concealed) ?? false;
}
public void SetEstrus(int days)

View File

@ -154,10 +154,8 @@ namespace RJW_Menstruation
[HarmonyPatch(typeof(SexAppraiser), "GetBodyFactor")]
public static class GetBodyFactor_Patch
{
public static void Postfix(ref float __result, Pawn fucker, Pawn fucked)
private static float GetNetFertility(Pawn fucker, Pawn fucked)
{
if (!(fucker.health?.hediffSet?.HasHediff(VariousDefOf.Hediff_Estrus) ?? false) || !PregnancyHelper.CanImpregnate(fucked, fucker))
return;
float fert = fucked.health.capacities.GetLevel(xxx.reproduction);
if (fucker.def.defName != fucked.def.defName)
{
@ -166,7 +164,18 @@ namespace RJW_Menstruation
else
fert *= RJWPregnancySettings.interspecies_impregnation_modifier;
}
__result *= (1f + fert / 4);
return fert;
}
public static void Postfix(ref float __result, Pawn fucker, Pawn fucked)
{
if (HediffComp_Menstruation.IsInEstrus(fucker, true) && PregnancyHelper.CanImpregnate(fucked, fucker))
{
__result *= (1f + GetNetFertility(fucker, fucked) / 4);
}
else if (HediffComp_Menstruation.IsInEstrus(fucker, false) && PregnancyHelper.CanImpregnate(fucked, fucker))
{
__result *= (1f + GetNetFertility(fucker, fucked) / 40);
}
}
}

View File

@ -1,3 +1,15 @@
Version 1.0.6.1
- Fix error when bleeding rate set to 0.
- A pawn in estrus will prefer partners and sex types that would result in pregnancy.
- Optional (default disabled) alternative casual hookup settings for a pawn in visible estrus.
- Contributed by amevarashi:
- Fix womb cleaning job if no buckets on the map.
- Fix futa impregnations.
- Hide some details for hidden pregnancies.
- Keep father unknown if the RJW paternity operation hasn't been performed.
- Add ability to remove the gather cum gizmo.
Version 1.0.6.0
- adopted by lutepickle
- Induced ovulators will now go into estrus on every cycle, not just the one after they've been cum in. Hope you have birth control.