mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Make IsInEstrus into a Pawn extension
This commit is contained in:
		
							parent
							
								
									9d83860d55
								
							
						
					
					
						commit
						5e818ab879
					
				
					 5 changed files with 15 additions and 15 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -16,7 +16,7 @@ namespace RJW_Menstruation.Interactions
 | 
			
		|||
        private bool WillingAndAble(Pawn fucker, Pawn fucked, bool visible)
 | 
			
		||||
        {
 | 
			
		||||
            return
 | 
			
		||||
                HediffComp_Menstruation.IsInEstrus(fucked, visible)
 | 
			
		||||
                fucked.IsInEstrus(visible)
 | 
			
		||||
                &&
 | 
			
		||||
                PregnancyHelper.CanImpregnate(fucker, fucked);
 | 
			
		||||
        }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1062,11 +1062,7 @@ 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)
 | 
			
		||||
        {
 | 
			
		||||
| 
						 | 
				
			
			@ -1652,7 +1648,7 @@ namespace RJW_Menstruation
 | 
			
		|||
                        parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.HaterCameInsideFEstrus, cummer);
 | 
			
		||||
                        parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideF, cummer);
 | 
			
		||||
                    }
 | 
			
		||||
                    else if (IsInEstrus(parent.pawn) && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
 | 
			
		||||
                    else if (parent.pawn.IsInEstrus() && parent.pawn.relations.OpinionOf(cummer) < RJWHookupSettings.MinimumRelationshipToHookup)
 | 
			
		||||
                    {
 | 
			
		||||
                        parent.pawn.needs.mood.thoughts.memories.RemoveMemoriesOfDefWhereOtherPawnIs(VariousDefOf.CameInsideF, cummer);
 | 
			
		||||
                        parent.pawn.needs.mood.thoughts.memories.TryGainMemory(VariousDefOf.HaterCameInsideFEstrus, cummer);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -279,7 +279,11 @@ namespace RJW_Menstruation
 | 
			
		|||
            }
 | 
			
		||||
            else return (hediff.p_end_tick - hediff.p_start_tick) / GenDate.TicksPerHour;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        public static bool IsInEstrus(this Pawn pawn, bool visible = true)
 | 
			
		||||
        {
 | 
			
		||||
            if (pawn.Dead) return false;
 | 
			
		||||
            return pawn.health?.hediffSet?.HasHediff(visible ? VariousDefOf.Hediff_Estrus : VariousDefOf.Hediff_Estrus_Concealed) ?? false;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -168,15 +168,15 @@ namespace RJW_Menstruation
 | 
			
		|||
        }
 | 
			
		||||
        public static void Postfix(ref float __result, Pawn fucker, Pawn fucked)
 | 
			
		||||
        {
 | 
			
		||||
            if (HediffComp_Menstruation.IsInEstrus(fucker, true) && PregnancyHelper.CanImpregnate(fucked, fucker))
 | 
			
		||||
            if (fucker.IsInEstrus(true) && PregnancyHelper.CanImpregnate(fucked, fucker))
 | 
			
		||||
            {
 | 
			
		||||
                __result *= (1f + GetNetFertility(fucker, fucked) / 4);
 | 
			
		||||
            }
 | 
			
		||||
            else if (HediffComp_Menstruation.IsInEstrus(fucker, false) && PregnancyHelper.CanImpregnate(fucked, fucker))
 | 
			
		||||
            else if (fucker.IsInEstrus(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))
 | 
			
		||||
            else if(xxx.is_animal(fucker) && fucked.IsInEstrus(true) && PregnancyHelper.CanImpregnate(fucker, fucked))
 | 
			
		||||
            {
 | 
			
		||||
                __result *= 1.25f;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			@ -188,7 +188,7 @@ namespace RJW_Menstruation
 | 
			
		|||
    {
 | 
			
		||||
        private static float FuckabilityThreshold(Pawn pawn, Pawn partner)
 | 
			
		||||
        {
 | 
			
		||||
            return (Configurations.EstrusOverridesHookupSettings && HediffComp_Menstruation.IsInEstrus(pawn) && PregnancyHelper.CanImpregnate(partner, pawn))
 | 
			
		||||
            return (Configurations.EstrusOverridesHookupSettings && pawn.IsInEstrus() && PregnancyHelper.CanImpregnate(partner, pawn))
 | 
			
		||||
                ? Configurations.EstrusFuckabilityToHookup : RJWHookupSettings.MinimumFuckabilityToHookup;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -217,12 +217,12 @@ namespace RJW_Menstruation
 | 
			
		|||
    {
 | 
			
		||||
        private static float AttractivenessThreshold(Pawn pawn, Pawn partner)
 | 
			
		||||
        {
 | 
			
		||||
            return (Configurations.EstrusOverridesHookupSettings && HediffComp_Menstruation.IsInEstrus(pawn) && PregnancyHelper.CanImpregnate(partner, pawn))
 | 
			
		||||
            return (Configurations.EstrusOverridesHookupSettings && pawn.IsInEstrus() && 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))
 | 
			
		||||
            return (Configurations.EstrusOverridesHookupSettings && pawn.IsInEstrus() && PregnancyHelper.CanImpregnate(partner, pawn))
 | 
			
		||||
                ? Configurations.EstrusRelationshipToHookup : RJWHookupSettings.MinimumRelationshipToHookup;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue