mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	vasectomy patch
This commit is contained in:
		
							parent
							
								
									9ae622bb7f
								
							
						
					
					
						commit
						0e53cdb03d
					
				
					 2 changed files with 18 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -15,6 +15,7 @@ namespace RJW_BGS
 | 
			
		|||
    [HarmonyPatch(typeof(PregnancyHelper))]
 | 
			
		||||
    public class PatchPregnancyHelper
 | 
			
		||||
    {
 | 
			
		||||
        public static HediffDef vasectomydef = DefDatabase<HediffDef>.GetNamed("Vasectomy", true);
 | 
			
		||||
        // Token: 0x0600000F RID: 15
 | 
			
		||||
        [HarmonyPostfix]
 | 
			
		||||
        [HarmonyPatch("impregnate")]
 | 
			
		||||
| 
						 | 
				
			
			@ -31,6 +32,11 @@ namespace RJW_BGS
 | 
			
		|||
 | 
			
		||||
            Pawn giver = props.pawn; // orgasmer
 | 
			
		||||
            Pawn receiver = props.partner;
 | 
			
		||||
            Hediff vasectomy;
 | 
			
		||||
            receiver.health.hediffSet.TryGetHediff(vasectomydef, out vasectomy);
 | 
			
		||||
            
 | 
			
		||||
            
 | 
			
		||||
            
 | 
			
		||||
            List<Hediff> pawnparts = giver.GetGenitalsList();
 | 
			
		||||
            List<Hediff> partnerparts = receiver.GetGenitalsList();
 | 
			
		||||
            var interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
 | 
			
		||||
| 
						 | 
				
			
			@ -69,10 +75,21 @@ namespace RJW_BGS
 | 
			
		|||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(xxx.get_pawnname(giver) + " has no parts to Fertilize with");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (vasectomy != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message("vasectomy check");
 | 
			
		||||
                receiver.health.RemoveHediff(vasectomy);
 | 
			
		||||
            }
 | 
			
		||||
            if (CanImpregnate2(giver, receiver, props.sexType))
 | 
			
		||||
            {
 | 
			
		||||
                
 | 
			
		||||
                PregnancyHelper.DoImpregnate(giver, receiver);
 | 
			
		||||
               
 | 
			
		||||
            }
 | 
			
		||||
            if (vasectomy != null)
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message("vasectomy check");
 | 
			
		||||
                receiver.health.AddHediff(vasectomy);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue