diff --git a/Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml b/Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml index a43d67f..f7a3d6b 100644 --- a/Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml +++ b/Common/Defs/ThoughtDefs/Thoughts_LifeForce.xml @@ -10,7 +10,7 @@
  • - My cock was eaten directly of my body, I am devestated. + My cock was eaten directly of my body, I am devestated. This is not what good head feels like. -30
  • diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index 7637d57..f8a84f1 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -87,6 +87,7 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_drainer; public static readonly GeneDef rjw_genes_seduce; public static readonly GeneDef rjw_genes_paralysingkiss; + public static readonly GeneDef rjw_genes_cockeater; // Cosmetic public static readonly GeneDef rjw_genes_succubus_tail; diff --git a/Source/Genes/Life_Force/IngestionOutcomeDoer_LifeForceOffset.cs b/Source/Genes/Life_Force/IngestionOutcomeDoer_LifeForceOffset.cs index 281b4e3..fdfdefd 100644 --- a/Source/Genes/Life_Force/IngestionOutcomeDoer_LifeForceOffset.cs +++ b/Source/Genes/Life_Force/IngestionOutcomeDoer_LifeForceOffset.cs @@ -12,7 +12,7 @@ namespace RJW_Genes protected override void DoIngestionOutcomeSpecial(Pawn pawn, Thing ingested) { - if (GeneUtility.HasLifeForce(pawn) && GeneUtility.HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_cum_eater)) + if (GeneUtility.HasLifeForce(pawn) && GeneUtility.IsCumEater(pawn)) { float num = ingested.stackCount * FERTILIN_PER_UNIT / 100; GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(pawn), num); diff --git a/Source/Genes/Life_Force/Patches/Patch_Vanilla_Inheritance_Fertilin.cs b/Source/Genes/Life_Force/Patches/Patch_Vanilla_Inheritance_Fertilin.cs index 94c427f..6bb3c92 100644 --- a/Source/Genes/Life_Force/Patches/Patch_Vanilla_Inheritance_Fertilin.cs +++ b/Source/Genes/Life_Force/Patches/Patch_Vanilla_Inheritance_Fertilin.cs @@ -11,15 +11,16 @@ namespace RJW_Genes /// This Patch is applied to add a absorption gene for fertilin if it has none, but it does have the fertilin gene /// First tries to get one from the parents else chooses one of them at random /// the genes are determined and "simply added". + /// + /// This fixes the potential problem that Pawns could inherit Fertilin, but no gene to gain Fertilin. /// [HarmonyPatch(typeof(PregnancyUtility), "GetInheritedGeneSet", new Type[] { typeof(Pawn), - typeof(Pawn), - //typeof(bool) + typeof(Pawn) } )] - public static class PatchVanillaPregnancyFertilin + public static class Patch_Vanilla_Inheritance_Fertilin { [HarmonyPostfix] public static void InheritedGenes(Pawn father, Pawn mother, ref GeneSet __result) @@ -27,36 +28,53 @@ namespace RJW_Genes //Also make a setting for this if (__result.GenesListForReading.Contains(GeneDefOf.rjw_genes_lifeforce)) { - List gene_list = __result.GenesListForReading; + List babies_genes = __result.GenesListForReading; - //If no absorption gene get one from the parents, else a random one - if(!(gene_list.Contains(GeneDefOf.rjw_genes_drainer) || gene_list.Contains(GeneDefOf.rjw_genes_cum_eater) - || gene_list.Contains(GeneDefOf.rjw_genes_vaginal_absorber) || gene_list.Contains(GeneDefOf.rjw_genes_anal_absorber))) + //If there is no absorption gene get one from the parents, else a random one + if(!Has_Fertilin_Source_Gene(babies_genes)) { - List absorption_genes_list = new List { GeneDefOf.rjw_genes_drainer, GeneDefOf.rjw_genes_cum_eater - , GeneDefOf.rjw_genes_vaginal_absorber, GeneDefOf.rjw_genes_anal_absorber }; + if (RJW_Genes_Settings.rjw_genes_detailed_debug) + ModLog.Message($"Child of ({father.Name};{mother.Name}) has Genes with LifeForce-Resource but no Source-Gene, adding one of parents random if possible or any random otherwise."); + // Gather Parents Source-Genes List absorption_genes_parents = new List(); - foreach (GeneDef geneDef in absorption_genes_list) + foreach (GeneDef geneDef in FertilinSourceGenes) { if(mother.genes != null && mother.genes.HasGene(geneDef)) - { absorption_genes_parents.Add(geneDef); - } + if (father.genes != null && father.genes.HasGene(geneDef)) - { absorption_genes_parents.Add(geneDef); - } } + // Parents had Genes - Pick a random one of them if (!absorption_genes_parents.NullOrEmpty()) - { __result.AddGene(absorption_genes_parents.RandomElement()); - } + // Create a fully random one for your little Cumfueled missbreed else - { - __result.AddGene(absorption_genes_list.RandomElement()); - } + __result.AddGene(FertilinSourceGenes.RandomElement()); } } } + + private static List FertilinSourceGenes = new List() { + GeneDefOf.rjw_genes_drainer, + GeneDefOf.rjw_genes_cum_eater, + GeneDefOf.rjw_genes_vaginal_absorber, + GeneDefOf.rjw_genes_anal_absorber, + GeneDefOf.rjw_genes_cockeater + }; + + private static bool Has_Fertilin_Source_Gene(List genes) + { + foreach (GeneDef gene in genes) + { + if (FertilinSourceGenes.Contains(gene)) + { + return true; + } + } + return false; + } + + } }