mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	Added a new gene that increases penis size on oral sex
This commit is contained in:
		
							parent
							
								
									93a4699fba
								
							
						
					
					
						commit
						d5580ba92a
					
				
					 12 changed files with 136 additions and 6 deletions
				
			
		
							
								
								
									
										28
									
								
								Source/Genes/Special/Defs/HormonalSalivaExtension.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										28
									
								
								Source/Genes/Special/Defs/HormonalSalivaExtension.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,28 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    public class HormonalSalivaExtension : DefModExtension
 | 
			
		||||
    {
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// How much the genitalia will growth per interaction.
 | 
			
		||||
        /// This is applied "flat", so if you have penis 0.5 and growthRate 0.05 it goes to 0.55, 0.60, 0.65 etc. 
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public float sizeIncrement;
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// Upper Limit for the body size - default should be 2-3
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public float maxBodySize;
 | 
			
		||||
        /// <summary>
 | 
			
		||||
        /// How much more cum the pawn will make.
 | 
			
		||||
        /// This is applied as multiplication, so if you have cum 20 and multiplier 1.1 you will have 22,24,27 etc. 
 | 
			
		||||
        /// This leads to exponential growth, so try to keep it kinda low. 
 | 
			
		||||
        /// </summary>
 | 
			
		||||
        public float cumMultiplier;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										76
									
								
								Source/Genes/Special/Patches/Patch_HormonalSaliva.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										76
									
								
								Source/Genes/Special/Patches/Patch_HormonalSaliva.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,76 @@
 | 
			
		|||
using HarmonyLib;
 | 
			
		||||
using rjw;
 | 
			
		||||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using Verse;
 | 
			
		||||
 | 
			
		||||
namespace RJW_Genes
 | 
			
		||||
{
 | 
			
		||||
    [HarmonyPatch(typeof(SexUtility), "Aftersex")]
 | 
			
		||||
    public class Patch_HormonalSaliva
 | 
			
		||||
    {
 | 
			
		||||
        // TODO: Reduce to 0.02 after debug. 
 | 
			
		||||
        const float SIZE_INCREMENT_FALLBACK = 0.02f;
 | 
			
		||||
        const float MAX_BODY_SIZE_FALLBACK = 2.5f;
 | 
			
		||||
        const float CUM_MULTIPLIER_FALLBACK = 1.05f;
 | 
			
		||||
 | 
			
		||||
        public static void Postfix(SexProps props)
 | 
			
		||||
        {
 | 
			
		||||
            if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal())
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Pawn pawn = props.pawn;
 | 
			
		||||
            Pawn partner = props.partner;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_hormonal_saliva) && (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Sixtynine || props.sexType == xxx.rjwSextype.Fellatio))
 | 
			
		||||
            {
 | 
			
		||||
                GrowPenisses(partner);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (GeneUtility.HasGeneNullCheck(partner, GeneDefOf.rjw_genes_hormonal_saliva) && (props.sexType == xxx.rjwSextype.Oral || props.sexType == xxx.rjwSextype.Sixtynine || props.sexType == xxx.rjwSextype.Fellatio))
 | 
			
		||||
            {
 | 
			
		||||
                GrowPenisses(pawn);
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static void GrowPenisses(Pawn pawn)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            HormonalSalivaExtension salivaExt = GeneDefOf.rjw_genes_hormonal_saliva.GetModExtension<HormonalSalivaExtension>();
 | 
			
		||||
 | 
			
		||||
            float size_increment = salivaExt?.sizeIncrement ?? SIZE_INCREMENT_FALLBACK;
 | 
			
		||||
            float maximum_body_size = salivaExt?.maxBodySize ?? MAX_BODY_SIZE_FALLBACK;
 | 
			
		||||
            float cum_multiplier = salivaExt?.cumMultiplier ?? CUM_MULTIPLIER_FALLBACK;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            List<Hediff> AllPenisses = Genital_Helper.get_AllPartsHediffList(pawn).FindAll(x => Genital_Helper.is_penis(x));
 | 
			
		||||
            foreach (Hediff penis in AllPenisses)
 | 
			
		||||
            {
 | 
			
		||||
                CompHediffBodyPart CompHediff = penis.TryGetComp<rjw.CompHediffBodyPart>();
 | 
			
		||||
                if (penis.Severity < 1.00)
 | 
			
		||||
                {
 | 
			
		||||
                    penis.Severity = Math.Min(1.01f, penis.Severity + size_increment);
 | 
			
		||||
                }
 | 
			
		||||
                else
 | 
			
		||||
                {
 | 
			
		||||
                    if (CompHediff != null && CompHediff.SizeOwner <= maximum_body_size)
 | 
			
		||||
                    {
 | 
			
		||||
                        CompHediff.SizeOwner += size_increment;
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                // Increase Fluid
 | 
			
		||||
                if (CompHediff != null)
 | 
			
		||||
                    CompHediff.FluidAmmount *= cum_multiplier;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue