mirror of
				https://gitgud.io/lutepickle/rjw_menstruation.git
				synced 2024-08-14 22:46:52 +00:00 
			
		
		
		
	Associate the post-birth vagina morph with the one that was pregnant
This commit is contained in:
		
							parent
							
								
									4f72320696
								
							
						
					
					
						commit
						b0b7ffba50
					
				
					 1 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -145,11 +145,14 @@ namespace RJW_Menstruation
 | 
			
		|||
    [HarmonyPatch(typeof(Hediff_BasePregnancy), nameof(Hediff_BasePregnancy.PostBirth))]
 | 
			
		||||
    public static class RJW_Patch_PostBirth
 | 
			
		||||
    {
 | 
			
		||||
        public static void Postfix(Pawn mother, Pawn baby)
 | 
			
		||||
        public static void Postfix(Hediff_BasePregnancy __instance, Pawn mother, Pawn baby)
 | 
			
		||||
        {
 | 
			
		||||
            if (Configurations.EnableBirthVaginaMorph)
 | 
			
		||||
            {
 | 
			
		||||
                Hediff vagina = mother.health.hediffSet.hediffs.FirstOrFallback(x => x.def.defName.ToLower().Contains("vagina"));
 | 
			
		||||
                // The comp still has the pregnancy attached at this point in the process
 | 
			
		||||
                Hediff vagina = __instance.GetMenstruationComp()?.parent;
 | 
			
		||||
                if (vagina == null) vagina = mother.health.hediffSet.hediffs.FirstOrFallback(x => x.def.defName.ToLower().Contains("vagina"));
 | 
			
		||||
                if (vagina == null) return;
 | 
			
		||||
                float morph = Mathf.Max(baby.BodySize - Mathf.Pow(vagina.Severity * mother.BodySize, 2), 0f);
 | 
			
		||||
                vagina.Severity += morph * Configurations.VaginaMorphPower;
 | 
			
		||||
            }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue