mirror of
				https://github.com/vegapnk/RJW-Genes.git
				synced 2024-08-15 00:23:31 +00:00 
			
		
		
		
	fertile anus gene
This commit is contained in:
		
							parent
							
								
									246f227792
								
							
						
					
					
						commit
						f37407f817
					
				
					 8 changed files with 254 additions and 6 deletions
				
			
		
										
											Binary file not shown.
										
									
								
							| 
						 | 
				
			
			@ -40,5 +40,14 @@
 | 
			
		|||
			</li>
 | 
			
		||||
		</modExtensions>
 | 
			
		||||
  </GeneDef>
 | 
			
		||||
  
 | 
			
		||||
  <GeneDef>
 | 
			
		||||
      <defName>rjw_genes_fertile_anus</defName>
 | 
			
		||||
      <label>Fertile Anus</label>
 | 
			
		||||
      <displayCategory>rjw_genes_breeding</displayCategory>
 | 
			
		||||
      <description>Xenotypes with this gene have a functional uterus connected to the anal cavity even for males (you have to disable biotech pregnancy and use the RJW system for this to work)</description>
 | 
			
		||||
      <iconPath>Genes/Icons/Fertile_anus</iconPath>
 | 
			
		||||
      <displayOrderInCategory>54</displayOrderInCategory>    
 | 
			
		||||
  </GeneDef>
 | 
			
		||||
 | 
			
		||||
</Defs>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								Common/Textures/Genes/Icons/Fertile_anus.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Common/Textures/Genes/Icons/Fertile_anus.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 44 KiB  | 
							
								
								
									
										238
									
								
								Source/Animal_Inheritance/Patches/PatchPregnancyHelper.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										238
									
								
								Source/Animal_Inheritance/Patches/PatchPregnancyHelper.cs
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,238 @@
 | 
			
		|||
using System;
 | 
			
		||||
using System.Collections.Generic;
 | 
			
		||||
using System.Linq;
 | 
			
		||||
using System.Text;
 | 
			
		||||
using System.Threading.Tasks;
 | 
			
		||||
using HarmonyLib;
 | 
			
		||||
using RimWorld;
 | 
			
		||||
using Verse;
 | 
			
		||||
using rjw;
 | 
			
		||||
using RJW_Genes;
 | 
			
		||||
using rjw.Modules.Interactions.Enums;
 | 
			
		||||
 | 
			
		||||
namespace RJW_BGS
 | 
			
		||||
{
 | 
			
		||||
    [HarmonyPatch(typeof(PregnancyHelper))]
 | 
			
		||||
    public class PatchPregnancyHelper
 | 
			
		||||
    {
 | 
			
		||||
        // Token: 0x0600000F RID: 15
 | 
			
		||||
        [HarmonyPostfix]
 | 
			
		||||
        [HarmonyPatch("impregnate")]
 | 
			
		||||
        private static void ImpregnatePostfix(ref SexProps props)
 | 
			
		||||
        {
 | 
			
		||||
            if (RJWSettings.DevMode) rjw.ModLog.Message("Rimjobworld::impregnate(" + props.sexType + "):: " + xxx.get_pawnname(props.pawn) + " + " + xxx.get_pawnname(props.partner) + ":");
 | 
			
		||||
 | 
			
		||||
            //"mech" pregnancy
 | 
			
		||||
            if (props.sexType == xxx.rjwSextype.MechImplant)
 | 
			
		||||
            {
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            Pawn giver = props.pawn; // orgasmer
 | 
			
		||||
            Pawn receiver = props.partner;
 | 
			
		||||
            List<Hediff> pawnparts = giver.GetGenitalsList();
 | 
			
		||||
            List<Hediff> partnerparts = receiver.GetGenitalsList();
 | 
			
		||||
            var interaction = rjw.Modules.Interactions.Helpers.InteractionHelper.GetWithExtension(props.dictionaryKey);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            if (!(props.sexType == xxx.rjwSextype.Anal && receiver.genes.HasActiveGene(RJW_Genes.GeneDefOf.rjw_genes_fertile_anus)))
 | 
			
		||||
                return;
 | 
			
		||||
 | 
			
		||||
            //"normal" and "beastial" pregnancy
 | 
			
		||||
            if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(" 'normal' pregnancy checks");
 | 
			
		||||
 | 
			
		||||
            //interaction stuff if for handling futa/see who penetrates who in interaction
 | 
			
		||||
            if (!props.isReceiver &&
 | 
			
		||||
                interaction.DominantHasTag(GenitalTag.CanPenetrate) &&
 | 
			
		||||
                interaction.SubmissiveHasFamily(GenitalFamily.Anus))
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(" impregnate - by initiator");
 | 
			
		||||
            }
 | 
			
		||||
            else if (props.isReceiver && props.isRevese &&
 | 
			
		||||
                interaction.DominantHasFamily(GenitalFamily.Anus) &&
 | 
			
		||||
                interaction.SubmissiveHasTag(GenitalTag.CanPenetrate))
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(" impregnate - by receiver (reverse)");
 | 
			
		||||
            }
 | 
			
		||||
            else
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(" no valid interaction tags/family");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (!rjw.Modules.Interactions.Helpers.PartHelper.FindParts(giver, GenitalTag.CanFertilize).Any())
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode) RJW_Genes.ModLog.Message(xxx.get_pawnname(giver) + " has no parts to Fertilize with");
 | 
			
		||||
                return;
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
            if (CanImpregnate2(giver, receiver, props.sexType))
 | 
			
		||||
            {
 | 
			
		||||
                PregnancyHelper.DoImpregnate(giver, receiver);
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        private static bool CanImpregnate2(Pawn fucker, Pawn fucked, xxx.rjwSextype sexType)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
                if (fucker == null || fucked == null)
 | 
			
		||||
                {
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (RJWSettings.DevMode)
 | 
			
		||||
                {
 | 
			
		||||
                    rjw.ModLog.Message(string.Concat(new string[]
 | 
			
		||||
                    {
 | 
			
		||||
                    "Rimjobworld::CanImpregnate checks (",
 | 
			
		||||
                    sexType.ToString(),
 | 
			
		||||
                    "):: ",
 | 
			
		||||
                    xxx.get_pawnname(fucker),
 | 
			
		||||
                    " + ",
 | 
			
		||||
                    xxx.get_pawnname(fucked),
 | 
			
		||||
                    ":"
 | 
			
		||||
                    }));
 | 
			
		||||
                }
 | 
			
		||||
                if (sexType == xxx.rjwSextype.MechImplant && !RJWPregnancySettings.mechanoid_pregnancy_enabled)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" mechanoid 'pregnancy' disabled");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (sexType != xxx.rjwSextype.Vaginal && sexType != xxx.rjwSextype.DoublePenetration && !(sexType == xxx.rjwSextype.Anal && fucked.genes.HasActiveGene(RJW_Genes.GeneDefOf.rjw_genes_fertile_anus)))
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" sextype cannot result in pregnancy");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (AndroidsCompatibility.IsAndroid(fucker) && AndroidsCompatibility.IsAndroid(fucked))
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(xxx.get_pawnname(fucked) + " androids cant breed/reproduce androids");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if ((fucker.IsUnsexyRobot() || fucked.IsUnsexyRobot()) && sexType != xxx.rjwSextype.MechImplant)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" unsexy robot cant be pregnant");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (!fucker.RaceHasPregnancy())
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(xxx.get_pawnname(fucked) + " filtered race that cant be pregnant");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (!fucked.RaceHasPregnancy())
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(xxx.get_pawnname(fucker) + " filtered race that cant impregnate");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (fucked.IsPregnant(false))
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" already pregnant.");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            List<Hediff_InsectEgg> source = new List<Hediff_InsectEgg>();
 | 
			
		||||
                fucked.health.hediffSet.GetHediffs<Hediff_InsectEgg>(ref source, null);
 | 
			
		||||
                if (source.Count > 1)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(xxx.get_pawnname(fucked) + " cant get pregnant while eggs inside");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            List<Hediff> genitalsList = fucker.GetGenitalsList();
 | 
			
		||||
                List<Hediff> genitalsList2 = fucked.GetGenitalsList();
 | 
			
		||||
            if (!Genital_Helper.has_penis_fertile(fucker, genitalsList)  && !Genital_Helper.has_penis_fertile(fucked, genitalsList2))
 | 
			
		||||
            {
 | 
			
		||||
                if (RJWSettings.DevMode)
 | 
			
		||||
                {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" missing genitals for impregnation"+ Genital_Helper.has_penis_fertile(fucker, genitalsList)+"  "+ Genital_Helper.has_anus(fucked, genitalsList2)+"  "+ Genital_Helper.has_penis_fertile(fucked, genitalsList2)+"   "+ Genital_Helper.has_anus(fucker, genitalsList));
 | 
			
		||||
                }
 | 
			
		||||
                return false;
 | 
			
		||||
            }
 | 
			
		||||
            if (fucker.health.capacities.GetLevel(xxx.reproduction) <= 0f || fucked.health.capacities.GetLevel(xxx.reproduction) <= 0f)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" one (or both) pawn(s) infertile");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (xxx.is_human(fucked) && xxx.is_human(fucker) && (RJWPregnancySettings.humanlike_impregnation_chance == 0 || !RJWPregnancySettings.humanlike_pregnancy_enabled))
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" human pregnancy chance set to 0% or pregnancy disabled.");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (((xxx.is_animal(fucker) && xxx.is_human(fucked)) || (xxx.is_human(fucker) && xxx.is_animal(fucked))) && !RJWPregnancySettings.bestial_pregnancy_enabled)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" bestiality pregnancy chance set to 0% or pregnancy disabled.");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (xxx.is_animal(fucked) && xxx.is_animal(fucker) && (RJWPregnancySettings.animal_impregnation_chance == 0 || !RJWPregnancySettings.animal_pregnancy_enabled))
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" animal-animal pregnancy chance set to 0% or pregnancy disabled.");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (fucker.def.defName != fucked.def.defName && RJWPregnancySettings.interspecies_impregnation_modifier <= 0f && !RJWPregnancySettings.complex_interspecies)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(" interspecies pregnancy disabled.");
 | 
			
		||||
                    }
 | 
			
		||||
                return false;
 | 
			
		||||
 | 
			
		||||
            }
 | 
			
		||||
            if (fucked.RaceProps.gestationPeriodDays <= 0f && fucked.TryGetComp<CompEggLayer>() == null)
 | 
			
		||||
                {
 | 
			
		||||
                    if (RJWSettings.DevMode)
 | 
			
		||||
                    {
 | 
			
		||||
                    RJW_Genes.ModLog.Message(xxx.get_pawnname(fucked) + " mother.RaceProps.gestationPeriodDays is " + fucked.RaceProps.gestationPeriodDays.ToString() + " cant impregnate");
 | 
			
		||||
                    }
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
 | 
			
		||||
                return true;
 | 
			
		||||
            }
 | 
			
		||||
        
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -11,7 +11,7 @@ using rjw;
 | 
			
		|||
namespace RJW_BGS
 | 
			
		||||
{
 | 
			
		||||
    [HarmonyPatch(typeof(ParentRelationUtility))]
 | 
			
		||||
    public class patchGetParents
 | 
			
		||||
    public class PatchGetParents
 | 
			
		||||
    {
 | 
			
		||||
        // Token: 0x0600000F RID: 15
 | 
			
		||||
        [HarmonyPostfix]
 | 
			
		||||
| 
						 | 
				
			
			@ -67,9 +67,9 @@ namespace RJW_Genes
 | 
			
		|||
		// Breeding
 | 
			
		||||
		public static readonly GeneDef rjw_genes_mechbreeder;
 | 
			
		||||
		public static readonly GeneDef rjw_genes_zoophile;
 | 
			
		||||
 | 
			
		||||
		// Cum 
 | 
			
		||||
		public static readonly GeneDef rjw_genes_no_cum;
 | 
			
		||||
        public static readonly GeneDef rjw_genes_fertile_anus;
 | 
			
		||||
        // Cum 
 | 
			
		||||
        public static readonly GeneDef rjw_genes_no_cum;
 | 
			
		||||
		public static readonly GeneDef rjw_genes_much_cum;
 | 
			
		||||
		public static readonly GeneDef rjw_genes_very_much_cum;
 | 
			
		||||
		[MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_likes_cumflation;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -27,7 +27,7 @@ namespace RJW_Genes
 | 
			
		|||
			if (props.pawn.IsAnimal() || props.partner.IsAnimal())
 | 
			
		||||
				return;
 | 
			
		||||
 | 
			
		||||
			if (props.pawn.genes != null && props.pawn.genes.HasGene(GeneDefOf.rjw_genes_orgasm_rush))
 | 
			
		||||
			if (props.pawn.genes != null && props.pawn.genes.HasActiveGene(GeneDefOf.rjw_genes_orgasm_rush))
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
				// Pump up Wake-Ness
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -31,6 +31,7 @@
 | 
			
		|||
  </ItemGroup>
 | 
			
		||||
  <ItemGroup>
 | 
			
		||||
    <Compile Include="Animal_Inheritance\InheritanceUtility.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Patches\PatchPregnancyHelper.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Patches\Patch_RJW_BestialityPregnancyUtility.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Patches\Patch_RJW_HediffInsect_Egg.cs" />
 | 
			
		||||
    <Compile Include="Animal_Inheritance\Patches\Patch_Vanilla_PregnancyUtility.cs" />
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +45,7 @@
 | 
			
		|||
    <Compile Include="Common\Either.cs" />
 | 
			
		||||
    <Compile Include="Common\ModLog.cs" />
 | 
			
		||||
    <Compile Include="Common\Defs\TickIntervalExtension.cs" />
 | 
			
		||||
    <Compile Include="Common\patches\Patch_RJW_BestialityPregnancyUtility.cs" />
 | 
			
		||||
    <Compile Include="Common\patches\PatchGetParents.cs" />
 | 
			
		||||
    <Compile Include="GeneDefOf.cs" />
 | 
			
		||||
    <Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
 | 
			
		||||
    <Compile Include="Genes\Breeding\PatchMechBirth.cs" />
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue