diff --git a/1.3/Assemblies/RJW_Menstruation.dll b/1.3/Assemblies/RJW_Menstruation.dll index 047bfe6..aa1061c 100644 Binary files a/1.3/Assemblies/RJW_Menstruation.dll and b/1.3/Assemblies/RJW_Menstruation.dll differ diff --git a/1.3/Defs/ThoughtDefs/Thoughts_sex.xml b/1.3/Defs/ThoughtDefs/Thoughts_sex.xml index 710baf9..a328574 100644 --- a/1.3/Defs/ThoughtDefs/Thoughts_sex.xml +++ b/1.3/Defs/ThoughtDefs/Thoughts_sex.xml @@ -132,6 +132,23 @@ + + + HaterCameInsideFEstrus + Thought_MemorySocial + 7.0 + 5 + 0.1 + 1 + +
  • + + What was I thinking, letting him do that? + -2 + -5 +
  • +
    +
    HaterCameInsideM diff --git a/1.3/Languages/English/Keyed/RJW_Menstruation.xml b/1.3/Languages/English/Keyed/RJW_Menstruation.xml index b44322f..b87ce62 100644 --- a/1.3/Languages/English/Keyed/RJW_Menstruation.xml +++ b/1.3/Languages/English/Keyed/RJW_Menstruation.xml @@ -102,6 +102,11 @@ Morph power Set morph power. Enable Gather Cum Gizmo + Estrus overrides RJW hookup settings + If enabled, a pawn in visible estrus will use these settings for potential impregnation hookups instead of the RJW settings. All settings default to their RJW counterparts. + Hookup minimum fuckability in estrus + Hookup minimum attractability in estrus + Hookup minimum opinion in estrus Estimated sperm lifespan Estimated egg lifespan Chance of fertilization within an hour: {0}% The chance of pregnancy of fertilized egg. The white overlay is indicates fertilization chance of sperms in womb. diff --git a/1.3/MilkModule/Assemblies/MilkModule.dll b/1.3/MilkModule/Assemblies/MilkModule.dll index 86e100b..db30769 100644 Binary files a/1.3/MilkModule/Assemblies/MilkModule.dll and b/1.3/MilkModule/Assemblies/MilkModule.dll differ diff --git a/1.3/Patches/PawnModExtentions.xml b/1.3/Patches/PawnModExtensions.xml similarity index 100% rename from 1.3/Patches/PawnModExtentions.xml rename to 1.3/Patches/PawnModExtensions.xml diff --git a/1.3/SexperienceModule/Assemblies/SexperienceModule.dll b/1.3/SexperienceModule/Assemblies/SexperienceModule.dll index 5568b04..07dfb96 100644 Binary files a/1.3/SexperienceModule/Assemblies/SexperienceModule.dll and b/1.3/SexperienceModule/Assemblies/SexperienceModule.dll differ diff --git a/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs b/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs index 545391c..8fbcb96 100644 --- a/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs +++ b/1.3/source/RJW_Menstruation/MilkModule/Milk_Patch.cs @@ -24,7 +24,7 @@ namespace MilkModule [HarmonyPatch(typeof(HumanCompHasGatherableBodyResource), "Gathered")] public static class Milk_Patch { - public static void Postfix(Pawn doer, HumanCompHasGatherableBodyResource __instance) + public static void Postfix(HumanCompHasGatherableBodyResource __instance) { HediffComp_Breast comp = null; if (__instance.parent is Pawn pawn) comp = pawn.GetBreastComp(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs index 5e68c9d..348b666 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Configurations.cs @@ -1,4 +1,5 @@ -using System; +using rjw; +using System; using System.Collections.Generic; using UnityEngine; using Verse; @@ -46,6 +47,10 @@ namespace RJW_Menstruation public static bool Debug = false; public static bool EnableMenopause = true; public static DetailLevel InfoDetail { get => Debug ? DetailLevel.All : infoDetail; } + public static bool EstrusOverridesHookupSettings = false; + public static float EstrusFuckabilityToHookup = RJWHookupSettings.MinimumFuckabilityToHookup; + public static float EstrusAttractivenessToHookup = RJWHookupSettings.MinimumAttractivenessToHookup; + public static float EstrusRelationshipToHookup = RJWHookupSettings.MinimumRelationshipToHookup; public static bool UseMultiplePregnancy = true; public static bool EnableHeteroOvularTwins = true; public static bool EnableEnzygoticTwins = true; @@ -85,6 +90,10 @@ namespace RJW_Menstruation EnableGatherCumGizmo = true; EnableAnimalCycle = false; CycleAcceleration = CycleAccelerationDefault; + EstrusOverridesHookupSettings = false; + EstrusFuckabilityToHookup = RJWHookupSettings.MinimumFuckabilityToHookup; + EstrusAttractivenessToHookup = RJWHookupSettings.MinimumAttractivenessToHookup; + EstrusRelationshipToHookup = RJWHookupSettings.MinimumRelationshipToHookup; EnzygoticTwinsChanceAdjust = EnzygoticTwinsChanceAdjustDefault; EnableEnzygoticTwins = true; EnableHeteroOvularTwins = true; @@ -189,6 +198,10 @@ namespace RJW_Menstruation Scribe_Values.Look(ref Debug, "Debug", Debug, true); Scribe_Values.Look(ref infoDetail, "InfoDetail", infoDetail, true); Scribe_Values.Look(ref EnableMenopause, "EnableMenopause", EnableMenopause, true); + Scribe_Values.Look(ref EstrusOverridesHookupSettings, "EstrusOverridesHookupSettings", EstrusOverridesHookupSettings, true); + Scribe_Values.Look(ref EstrusFuckabilityToHookup, "EstrusFuckabilityToHookup", EstrusFuckabilityToHookup, true); + Scribe_Values.Look(ref EstrusAttractivenessToHookup, "EstrusAttractivenessToHookup", EstrusAttractivenessToHookup, true); + Scribe_Values.Look(ref EstrusRelationshipToHookup, "EstrusRelationshipToHookup", EstrusRelationshipToHookup, true); Scribe_Values.Look(ref UseMultiplePregnancy, "UseMultiplePregnancy", UseMultiplePregnancy, true); Scribe_Values.Look(ref EnableHeteroOvularTwins, "EnableHeteroOvularTwins", EnableHeteroOvularTwins, true); Scribe_Values.Look(ref EnableEnzygoticTwins, "EnableEnzygoticTwins", EnableEnzygoticTwins, true); @@ -260,7 +273,12 @@ namespace RJW_Menstruation public override void DoSettingsWindowContents(Rect inRect) { Rect outRect = new Rect(0f, 30f, inRect.width, inRect.height - 30f); - Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, inRect.height + 596f); + float mainRectHeight = -3f + + (Configurations.EnableWombIcon || Configurations.EnableButtonInHT ? 400f : 0f) + + (Configurations.EstrusOverridesHookupSettings ? 144f : 0f) + + (Configurations.UseMultiplePregnancy ? (Configurations.EnableEnzygoticTwins ? 175f : 75f) : 0f) + + (Configurations.EnableBirthVaginaMorph ? 48f : 0f); + Rect mainRect = new Rect(0f, 0f, inRect.width - 30f, Math.Max(inRect.height + mainRectHeight, 1f)); int Adjust; Listing_Standard listmain = new Listing_Standard { @@ -404,6 +422,17 @@ namespace RJW_Menstruation listmain.LabelDouble(Translations.Option19_Label_1, Translations.Option19_Label_2 + ": " + var1 + "ml, " + var2 + "ml/h", Translations.Option19_Desc); Configurations.BleedingAmount = (int)listmain.Slider(Configurations.BleedingAmount, 0, 200); + listmain.CheckboxLabeled(Translations.Option_EstrusOverride_Label, ref Configurations.EstrusOverridesHookupSettings, Translations.Option_EstrusOverride_Desc); + if (Configurations.EstrusOverridesHookupSettings) + { + listmain.Label(Translations.Option_EstrusFuckability_Label + ": " + (int)(Configurations.EstrusFuckabilityToHookup * 100) + "%"); + Configurations.EstrusFuckabilityToHookup = listmain.Slider(Configurations.EstrusFuckabilityToHookup, 0.1f, 1.0f); + listmain.Label(Translations.Option_EstrusAttractability_Label + ": " + (int)(Configurations.EstrusAttractivenessToHookup * 100) + "%"); + Configurations.EstrusAttractivenessToHookup = listmain.Slider(Configurations.EstrusAttractivenessToHookup, 0.0f, 1.0f); + listmain.Label(Translations.Option_EstrusRelationship_Label + ": " + Configurations.EstrusRelationshipToHookup); + Configurations.EstrusRelationshipToHookup = listmain.Slider((int)Configurations.EstrusRelationshipToHookup, -100f, 100f); + } + listmain.CheckboxLabeled(Translations.Option13_Label, ref Configurations.UseMultiplePregnancy, Translations.Option13_Desc); if (Configurations.UseMultiplePregnancy) { diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/EstrusPartKindUsageRule.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/EstrusPartKindUsageRule.cs new file mode 100644 index 0000000..c38ee45 --- /dev/null +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/EstrusPartKindUsageRule.cs @@ -0,0 +1,40 @@ +using Verse; +using rjw; +using rjw.Modules.Interactions.Contexts; +using rjw.Modules.Interactions.Enums; +using rjw.Modules.Interactions.Rules.PartKindUsageRules; +using rjw.Modules.Shared; +using System.Collections.Generic; + +namespace RJW_Menstruation.Interactions +{ + public class EstrusPartKindUsageRule : IPartPreferenceRule + { + 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 + HediffComp_Menstruation.IsInEstrus(fucked, visible) + && + PregnancyHelper.CanImpregnate(fucker, fucked); + } + + public IEnumerable> ModifiersForDominant(InteractionContext context) + { + if (WillingAndAble(context.Internals.Submissive.Pawn, context.Internals.Dominant.Pawn, true)) + yield return new Weighted(visible_estrus_multiplier, LewdablePartKind.Vagina); + else if (WillingAndAble(context.Internals.Submissive.Pawn, context.Internals.Dominant.Pawn, false)) + yield return new Weighted(concealed_estrus_multiplier, LewdablePartKind.Vagina); + } + + public IEnumerable> ModifiersForSubmissive(InteractionContext context) + { + if (WillingAndAble(context.Internals.Dominant.Pawn, context.Internals.Submissive.Pawn, true)) + yield return new Weighted(visible_estrus_multiplier, LewdablePartKind.Vagina); + else if (WillingAndAble(context.Internals.Dominant.Pawn, context.Internals.Submissive.Pawn, false)) + yield return new Weighted(concealed_estrus_multiplier, LewdablePartKind.Vagina); + } + } +} diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs index f77c403..937dbd6 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/HediffComps/HediffComp_Menstruation.cs @@ -1022,6 +1022,12 @@ namespace RJW_Menstruation } } + public static bool IsInEstrus(Pawn pawn, bool visible = true) + { + if (pawn.Dead) return false; + return pawn.health?.hediffSet?.HasHediff(visible ? VariousDefOf.Hediff_Estrus : VariousDefOf.Hediff_Estrus_Concealed) ?? false; + } + public void SetEstrus(int days) { HediffDef estrusdef; @@ -1465,15 +1471,19 @@ namespace RJW_Menstruation { parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFFetish, cummer); } + else if (parent.pawn.relations.OpinionOf(cummer) <= -5) + { + parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer); + } + else if (IsInEstrus(parent.pawn) && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup) + { + parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer); + } else if (!parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Spouse, cummer) && !parent.pawn.relations.DirectRelationExists(PawnRelationDefOf.Fiance, cummer)) { if (parent.pawn.health.capacities.GetLevel(xxx.reproduction) < 0.50f) parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideFLowFert, cummer); else parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.CameInsideF, cummer); } - else if (parent.pawn.relations.OpinionOf(cummer) <= -5) - { - parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer); - } } else { diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs index 134e7b0..1e0b9ca 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Hediff_MultiplePregnancy.cs @@ -125,9 +125,23 @@ namespace RJW_Menstruation if (mother.Faction != baby.Faction) baby.SetFaction(mother.Faction); } - if (mother.IsPrisonerOfColony) + if (mother.IsSlaveOfColony) { - baby.guest.CapturedBy(Faction.OfPlayer); + if (mother.SlaveFaction != null) + baby.SetFaction(mother.SlaveFaction); + else if (mother.HomeFaction != null) + baby.SetFaction(mother.HomeFaction); + else if (mother.Faction != null) + baby.SetFaction(mother.Faction); + else + baby.SetFaction(Faction.OfPlayer); + baby.guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Slave); + } + else if (mother.IsPrisonerOfColony) + { + if (mother.HomeFaction != null) + baby.SetFaction(mother.HomeFaction); + baby.guest.SetGuestStatus(Faction.OfPlayer, GuestStatus.Prisoner); } foreach (Pawn sibling in siblings) @@ -159,13 +173,15 @@ namespace RJW_Menstruation if (mother.Faction != baby.Faction) baby.SetFaction(mother.Faction); } - - foreach (Pawn sibling in siblings) + if (!RJWSettings.Disable_bestiality_pregnancy_relations) { - baby.relations.AddDirectRelation(PawnRelationDefOf.Sibling, sibling); + foreach (Pawn sibling in siblings) + { + baby.relations.AddDirectRelation(PawnRelationDefOf.Sibling, sibling); + } + siblings.Add(baby); } - siblings.Add(baby); Train(baby, mother); PostBirth(mother, father, baby); @@ -324,7 +340,7 @@ namespace RJW_Menstruation PawnGenerationRequest request = new PawnGenerationRequest( newborn: true, allowDowned: true, - faction: mother.IsPrisoner ? null : mother.Faction, + faction: mother.Faction, canGeneratePawnRelations: false, forceGenerateNewPawn: true, colonistRelationChanceFactor: 0, @@ -425,7 +441,7 @@ namespace RJW_Menstruation UpdateTraits(baby, parentTraits); Rand.PopState(); } - else if (baby.relations != null) + else if (baby.relations != null && !RJWSettings.Disable_bestiality_pregnancy_relations) { baby.relations.AddDirectRelation(VariousDefOf.Relation_birthgiver, mother); mother.relations.AddDirectRelation(VariousDefOf.Relation_spawn, baby); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs index 1ef18f2..fe22153 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/GetGizmos.cs @@ -7,7 +7,7 @@ using Verse; namespace RJW_Menstruation { - [HarmonyPatch(typeof(Pawn), "GetGizmos")] + [HarmonyPatch(typeof(Pawn), nameof(Pawn.GetGizmos))] public class Pawn_GetGizmos { public static void Postfix(ref IEnumerable __result, Pawn __instance) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs index d15e1aa..be30dc8 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Harmony.cs @@ -1,4 +1,9 @@ using HarmonyLib; +using rjw; +using rjw.Modules.Interactions.Internals.Implementation; +using rjw.Modules.Interactions.Rules.PartKindUsageRules; +using rjw.Modules.Shared.Logs; +using System.Collections.Generic; using System.Reflection; using Verse; @@ -11,11 +16,16 @@ namespace RJW_Menstruation { var har = new Harmony("RJW_Menstruation"); har.PatchAll(Assembly.GetExecutingAssembly()); - + + InjectIntoRjwInteractionServices(); + } + private static void InjectIntoRjwInteractionServices() + { + var log = LogManager.GetLogger("StaticConstructorOnStartup"); + + List partKindUsageRules = Unprivater.GetProtectedValue>("_partKindUsageRules", typeof(PartPreferenceDetectorService)); + partKindUsageRules.Add(new Interactions.EstrusPartKindUsageRule()); + log.Message("Added 1 rule to PartPreferenceDetectorService._partKindUsageRules"); } } - - - - } diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs index 375db71..7eb0acc 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/Pawn_Patch.cs @@ -10,10 +10,10 @@ using rjw; namespace RJW_Menstruation { - [HarmonyPatch(typeof(Pawn), "SpawnSetup")] + [HarmonyPatch(typeof(Pawn), nameof(Pawn.SpawnSetup))] public class Pawn_Patch { - public static void Postfix(Map map, bool respawningAfterLoad, Pawn __instance) + public static void Postfix(Pawn __instance) { //Log.Message("Initialize on spawnsetup"); HediffComp_Menstruation comp = __instance.GetMenstruationComp(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs index dafa7a5..3c21e52 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Patch/RJW_Patch.cs @@ -4,11 +4,15 @@ using rjw.Modules.Interactions.Enums; using rjw.Modules.Interactions.Objects; using Verse; using UnityEngine; +using System.Collections.Generic; +using System.Linq; +using System.Reflection; +using System.Reflection.Emit; namespace RJW_Menstruation { - [HarmonyPatch(typeof(PregnancyHelper), "impregnate")] + [HarmonyPatch(typeof(PregnancyHelper), nameof(PregnancyHelper.impregnate))] public static class Impregnate_Patch { public static bool Prefix(SexProps props) @@ -75,7 +79,7 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(PregnancyHelper), "Doimpregnate")] + [HarmonyPatch(typeof(PregnancyHelper), nameof(PregnancyHelper.Doimpregnate))] public static class Doimpregnate_Patch { public static bool Prefix(Pawn pawn, Pawn partner) // partner has vagina @@ -97,10 +101,10 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(Hediff_BasePregnancy), "PostBirth")] + [HarmonyPatch(typeof(Hediff_BasePregnancy), nameof(Hediff_BasePregnancy.PostBirth))] public static class RJW_Patch_PostBirth { - public static void Postfix(Pawn mother, Pawn father, Pawn baby) + public static void Postfix(Pawn mother, Pawn baby) { if (Configurations.EnableBirthVaginaMorph) { @@ -111,7 +115,7 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(Quirk), "IsSatisfiedBy")] + [HarmonyPatch(typeof(Quirk), nameof(Quirk.IsSatisfiedBy))] public static class IsSatisfiedBy_Patch { public static void Postfix(Quirk __instance, ref bool __result, Pawn pawn, Pawn partner) @@ -125,19 +129,19 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(Quirk), "CountSatisfiedQuirks")] + [HarmonyPatch(typeof(Quirk), nameof(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; + if (__result == 0 || !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 + else __result--; if ( (PregnancyHelper.CanImpregnate(pawn, partner, props.sexType) && (partner.GetMenstruationComp()?.IsDangerDay ?? true)) @@ -147,7 +151,109 @@ namespace RJW_Menstruation } } - [HarmonyPatch(typeof(CompHediffBodyPart), "updatesize")] + [HarmonyPatch(typeof(SexAppraiser), "GetBodyFactor")] + public static class GetBodyFactor_Patch + { + private static float GetNetFertility(Pawn fucker, Pawn fucked) + { + float fert = fucked.health.capacities.GetLevel(xxx.reproduction); + if (fucker.def.defName != fucked.def.defName) + { + if (RJWPregnancySettings.complex_interspecies) + fert *= SexUtility.BodySimilarity(fucker, fucked); + else + fert *= RJWPregnancySettings.interspecies_impregnation_modifier; + } + 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); + } + else if(xxx.is_animal(fucker) && HediffComp_Menstruation.IsInEstrus(fucked, true) && PregnancyHelper.CanImpregnate(fucker, fucked)) + { + __result *= 1.25f; + } + } + } + + [HarmonyPatch(typeof(CasualSex_Helper), nameof(CasualSex_Helper.roll_to_skip))] + public static class Roll_To_Skip_Patch + { + private static float FuckabilityThreshold(Pawn pawn, Pawn partner) + { + return (Configurations.EstrusOverridesHookupSettings && HediffComp_Menstruation.IsInEstrus(pawn) && PregnancyHelper.CanImpregnate(partner, pawn)) + ? Configurations.EstrusFuckabilityToHookup : RJWHookupSettings.MinimumFuckabilityToHookup; + } + + private static readonly FieldInfo MinimumFuckabilityToHookup = AccessTools.Field(typeof(RJWHookupSettings), nameof(RJWHookupSettings.MinimumFuckabilityToHookup)); + public static IEnumerable Transpiler(IEnumerable instructions) + { + // We only want the first fuckability check, i.e. the estrus-haver towards a partner + bool found_fuckability = false; + foreach(CodeInstruction instruction in instructions) + { + if(!found_fuckability && instruction.LoadsField(MinimumFuckabilityToHookup)) + { + found_fuckability = true; + yield return new CodeInstruction(OpCodes.Ldarg_0); + yield return new CodeInstruction(OpCodes.Ldarg_1); + yield return CodeInstruction.Call(typeof(Roll_To_Skip_Patch), nameof(FuckabilityThreshold)); + } + else yield return instruction; + } + } + } + + [HarmonyPatch(typeof(CasualSex_Helper), nameof(CasualSex_Helper.FindBestPartner))] + public static class FindBestPartner_Patch + { + private static float AttractivenessThreshold(Pawn pawn, Pawn partner) + { + return (Configurations.EstrusOverridesHookupSettings && HediffComp_Menstruation.IsInEstrus(pawn) && PregnancyHelper.CanImpregnate(partner, pawn)) + ? Configurations.EstrusAttractivenessToHookup : RJWHookupSettings.MinimumAttractivenessToHookup; + } + private static float RelationshipThreshold(Pawn pawn, Pawn partner) + { + return (Configurations.EstrusOverridesHookupSettings && HediffComp_Menstruation.IsInEstrus(pawn) && PregnancyHelper.CanImpregnate(partner, pawn)) + ? Configurations.EstrusRelationshipToHookup : RJWHookupSettings.MinimumRelationshipToHookup; + } + + private static readonly FieldInfo MinimumAttractivenessToHookup = AccessTools.Field(typeof(RJWHookupSettings), nameof(RJWHookupSettings.MinimumAttractivenessToHookup)); + private static readonly FieldInfo MinimumRelationshipToHookup = AccessTools.Field(typeof(RJWHookupSettings), nameof(RJWHookupSettings.MinimumRelationshipToHookup)); + public static IEnumerable Transpiler(IEnumerable instructions) + { + // Like in the last one, we're only interested in the first of each + bool found_first_attractiveness = false; + bool found_first_relationship = false; + foreach(CodeInstruction instruction in instructions) + { + if (!found_first_attractiveness && instruction.LoadsField(MinimumAttractivenessToHookup)) + { + found_first_attractiveness = true; + yield return new CodeInstruction(OpCodes.Ldarg_0); + yield return new CodeInstruction(OpCodes.Ldarg_1); + yield return CodeInstruction.Call(typeof(FindBestPartner_Patch), nameof(AttractivenessThreshold)); + } + else if (!found_first_relationship && instruction.LoadsField(MinimumRelationshipToHookup)) + { + found_first_relationship = true; + yield return new CodeInstruction(OpCodes.Ldarg_0); + yield return new CodeInstruction(OpCodes.Ldarg_1); + yield return CodeInstruction.Call(typeof(FindBestPartner_Patch), nameof(RelationshipThreshold)); + } + else yield return instruction; + } + } + } + + [HarmonyPatch(typeof(CompHediffBodyPart), nameof(CompHediffBodyPart.updatesize))] public static class Updatesize_Patch { public static void Postfix(CompHediffBodyPart __instance) diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj index 7ef6854..213ca88 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/RJW_Menstruation.csproj @@ -61,6 +61,7 @@ + diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs index 284a208..306acf6 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/Translations.cs @@ -108,6 +108,11 @@ namespace RJW_Menstruation public static readonly string Option32_Label = "Option32_Label".Translate(); public static readonly string Option32_Desc = "Option32_Desc".Translate(); public static readonly string Option_EnableGatherCumGizmo_Label = "Option_EnableGatherCumGizmo_Label".Translate(); + public static readonly string Option_EstrusOverride_Label = "Option_EstrusOverride_Label".Translate(); + public static readonly string Option_EstrusOverride_Desc = "Option_EstrusOverride_Desc".Translate(); + public static readonly string Option_EstrusFuckability_Label = "Option_EstrusFuckability_Label".Translate(); + public static readonly string Option_EstrusAttractability_Label = "Option_EstrusAttractability_Label".Translate(); + public static readonly string Option_EstrusRelationship_Label = "Option_EstrusRelationship_Label".Translate(); public static readonly string Button_ResetToDefault = "Button_ResetToDefault".Translate(); diff --git a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs index 2f3ba3f..58de25e 100644 --- a/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs +++ b/1.3/source/RJW_Menstruation/RJW_Menstruation/VariousDefOf.cs @@ -34,6 +34,7 @@ namespace RJW_Menstruation public static readonly ThoughtDef CameInsideFFetishSafe = DefDatabase.GetNamed("CameInsideFFetishSafe"); public static readonly ThoughtDef HaterCameInsideFSafe = DefDatabase.GetNamed("HaterCameInsideFSafe"); public static readonly ThoughtDef HaterCameInsideF = DefDatabase.GetNamed("HaterCameInsideF"); + public static readonly ThoughtDef HaterCameInsideFEstrus = DefDatabase.GetNamed("HaterCameInsideFEstrus"); public static readonly ThoughtDef CameInsideM = DefDatabase.GetNamed("CameInsideM"); public static readonly ThoughtDef HaterCameInsideM = DefDatabase.GetNamed("HaterCameInsideM"); public static readonly ThoughtDef UnwantedPregnancy = DefDatabase.GetNamed("UnwantedPregnancy"); diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/GetGizmos.cs b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/GetGizmos.cs index 418787c..3eb7e98 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/GetGizmos.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/GetGizmos.cs @@ -16,7 +16,7 @@ namespace RJW_Menstruation.Sexperience [HarmonyPatch(typeof(Pawn_GetGizmos), nameof(Pawn_GetGizmos.GetMenstruationGizmos))] public static class GetGizmos_Patch { - public static void Postfix(Pawn pawn, HediffComp_Menstruation comp, ref List __result) + public static void Postfix(HediffComp_Menstruation comp, ref List __result) { if (Configurations.EnableGatherCumGizmo) __result.Add(CreateGizmo_GatherCum(comp)); diff --git a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs index 4377e5f..9a344a4 100644 --- a/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs +++ b/1.3/source/RJW_Menstruation/SexperienceModule/Patch/RJW_Patch.cs @@ -18,7 +18,7 @@ namespace RJW_Menstruation.Sexperience { [HarmonyPrefix] [HarmonyPatch("HasJobOnThing")] - public static bool HasJobOnThing(Pawn pawn, Thing t, bool forced, ref bool __result) + public static bool HasJobOnThing(Pawn pawn, ref bool __result) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f && pawn.Map.listerBuildings.ColonistsHaveBuilding(VariousDefOf.CumBucket)) @@ -31,7 +31,7 @@ namespace RJW_Menstruation.Sexperience [HarmonyPostfix] [HarmonyPatch("JobOnThing")] - public static void JobOnThing(Pawn pawn, Thing t, bool forced, ref Job __result) + public static void JobOnThing(Pawn pawn, ref Job __result) { HediffComp_Menstruation comp = pawn.GetMenstruationComp(); if (comp != null && comp.DoCleanWomb && comp.TotalCumPercent > 0.001f) diff --git a/About/Manifest.xml b/About/Manifest.xml index f2d10c0..a7ef90f 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,7 +1,7 @@ RJW Menstruation - 1.0.6.0 + 1.0.6.1 diff --git a/changelogs.txt b/changelogs.txt index 65558dc..50253ba 100644 --- a/changelogs.txt +++ b/changelogs.txt @@ -1,3 +1,18 @@ +Version 1.0.6.1 + - Requires RJW 4.9.6 or later + - Fix errors when a hybrid refers to an invalid race. + - 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. + - Babies born to slaves will have the right faction. + - Respect RJW's bestiality pregnancy relations setting. + + - 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 option 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.