mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	A pawn in estrus will prefer partners that can impregnate them, and prefer to use their vagina
This commit is contained in:
		
							parent
							
								
									9e374f3350
								
							
						
					
					
						commit
						191e4ab5d9
					
				
					 6 changed files with 76 additions and 5 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
					@ -0,0 +1,33 @@
 | 
				
			||||||
 | 
					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 bool WillingAndAble(Pawn fucker, Pawn fucked)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            return
 | 
				
			||||||
 | 
					                (fucked.health?.hediffSet?.HasHediff(VariousDefOf.Hediff_Estrus) ?? false)
 | 
				
			||||||
 | 
					                &&
 | 
				
			||||||
 | 
					                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);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        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);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -1022,6 +1022,14 @@ namespace RJW_Menstruation
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        public bool IsInEstrus(bool includeConcealed = false)
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            Pawn pawn = parent.pawn;
 | 
				
			||||||
 | 
					            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);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        public void SetEstrus(int days)
 | 
					        public void SetEstrus(int days)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            HediffDef estrusdef;
 | 
					            HediffDef estrusdef;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,4 +1,9 @@
 | 
				
			||||||
using HarmonyLib;
 | 
					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 System.Reflection;
 | 
				
			||||||
using Verse;
 | 
					using Verse;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -12,10 +17,15 @@ namespace RJW_Menstruation
 | 
				
			||||||
            var har = new Harmony("RJW_Menstruation");
 | 
					            var har = new Harmony("RJW_Menstruation");
 | 
				
			||||||
            har.PatchAll(Assembly.GetExecutingAssembly());
 | 
					            har.PatchAll(Assembly.GetExecutingAssembly());
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            InjectIntoRjwInteractionServices();
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					        private static void InjectIntoRjwInteractionServices()
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					            var log = LogManager.GetLogger("StaticConstructorOnStartup");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            List<IPartPreferenceRule> partKindUsageRules = Unprivater.GetProtectedValue<List<IPartPreferenceRule>>("_partKindUsageRules", typeof(PartPreferenceDetectorService));
 | 
				
			||||||
 | 
					            partKindUsageRules.Add(new Interactions.EstrusPartKindUsageRule());
 | 
				
			||||||
 | 
					            log.Message("Added 1 rule to PartPreferenceDetectorService._partKindUsageRules");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -147,6 +147,25 @@ namespace RJW_Menstruation
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    [HarmonyPatch(typeof(SexAppraiser), "GetBodyFactor")]
 | 
				
			||||||
 | 
					    public static class GetBodyFactor_Patch
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        public static void Postfix(ref float __result, 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)
 | 
				
			||||||
 | 
					            {
 | 
				
			||||||
 | 
					                if (RJWPregnancySettings.complex_interspecies)
 | 
				
			||||||
 | 
					                    fert *= SexUtility.BodySimilarity(fucker, fucked);
 | 
				
			||||||
 | 
					                else
 | 
				
			||||||
 | 
					                    fert *= RJWPregnancySettings.interspecies_impregnation_modifier;
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            __result *= (1f + fert / 4);
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    [HarmonyPatch(typeof(CompHediffBodyPart), "updatesize")]
 | 
					    [HarmonyPatch(typeof(CompHediffBodyPart), "updatesize")]
 | 
				
			||||||
    public static class Updatesize_Patch
 | 
					    public static class Updatesize_Patch
 | 
				
			||||||
    {
 | 
					    {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -61,6 +61,7 @@
 | 
				
			||||||
    <Compile Include="Configurations.cs" />
 | 
					    <Compile Include="Configurations.cs" />
 | 
				
			||||||
    <Compile Include="Cum.cs" />
 | 
					    <Compile Include="Cum.cs" />
 | 
				
			||||||
    <Compile Include="DebugActions.cs" />
 | 
					    <Compile Include="DebugActions.cs" />
 | 
				
			||||||
 | 
					    <Compile Include="EstrusPartKindUsageRule.cs" />
 | 
				
			||||||
    <Compile Include="HediffComps\HediffComp_InducedOvulator.cs" />
 | 
					    <Compile Include="HediffComps\HediffComp_InducedOvulator.cs" />
 | 
				
			||||||
    <Compile Include="HediffComps\MenstruationUtility.cs" />
 | 
					    <Compile Include="HediffComps\MenstruationUtility.cs" />
 | 
				
			||||||
    <Compile Include="IngestionOutcomeDoers.cs" />
 | 
					    <Compile Include="IngestionOutcomeDoers.cs" />
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue