diff --git a/Common/Defs/Genes/GeneDefs_Cosmetic.xml b/Common/Defs/Genes/GeneDefs_Cosmetic.xml index f49b690..54dfe41 100644 --- a/Common/Defs/Genes/GeneDefs_Cosmetic.xml +++ b/Common/Defs/Genes/GeneDefs_Cosmetic.xml @@ -5,7 +5,6 @@ true
  • Wing
  • -
  • Wings
  • Tailbone diff --git a/Common/Defs/HediffDefs/Hediffs_Genes.xml b/Common/Defs/HediffDefs/Hediffs_Genes.xml index b0a9cc9..c25b9b3 100644 --- a/Common/Defs/HediffDefs/Hediffs_Genes.xml +++ b/Common/Defs/HediffDefs/Hediffs_Genes.xml @@ -1,7 +1,7 @@  - Aphrodisiac_Pheromone + rjw_genes_aphrodisiac_pheromone HediffWithComps Aphrodisiac pheromone effects. @@ -23,7 +23,7 @@ - Fertilin_Lost + rjw_genes_fertilin_lost RJW_Genes.HediffWithComps_tank Percentage of fertilin lost. @@ -42,7 +42,7 @@ - Succubus_Drained + rjw_genes_succubus_drained HediffWithComps The vitality of this pawn has been drained. diff --git a/Common/Defs/Xenotypes/Succubus.xml b/Common/Defs/Xenotypes/Succubus.xml index c6b51a1..41f3ff7 100644 --- a/Common/Defs/Xenotypes/Succubus.xml +++ b/Common/Defs/Xenotypes/Succubus.xml @@ -4,8 +4,8 @@ rjw_genes_succubus - Succubi are strongly enhanced xenohumans. Powered by archites, their abilities go far beyond normal genetic enhancements. These overnaturally beautiful creatures strive parasitically on the Fertilin found in semen. - Succubi are beautiful and extremely hungry Xenohumans. They strive on having sex and extracting their victims life-force through this. + Succubi are strongly enhanced xenohumans. Powered by archites, their abilities go far beyond normal genetic enhancements. These overnaturally beautiful creatures strive parasitically on the Fertilin found in semen. + Succubi are beautiful and extremely hungry Xenohumans. They strive on having sex and extracting their victims life-force through this. UI/Icons/Xenotypes/Sanguophage PawnBecameSanguophage 0.5 diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs index e4f0e12..53a9c60 100644 --- a/Source/GeneDefOf.cs +++ b/Source/GeneDefOf.cs @@ -89,6 +89,5 @@ namespace RJW_Genes public static readonly GeneDef rjw_genes_succubus_tail; public static readonly GeneDef rjw_genes_succubus_wings; - // Others & Non-Genes } } diff --git a/Source/Genes/GeneUtility.cs b/Source/Genes/GeneUtility.cs index 3da53e3..0837880 100644 --- a/Source/Genes/GeneUtility.cs +++ b/Source/Genes/GeneUtility.cs @@ -6,16 +6,7 @@ namespace RJW_Genes { public class GeneUtility { - //Instead of seperate functions this should be simpeler - public static bool HasGeneNullCheck(Pawn pawn, GeneDef genedef) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(genedef); - } - + //Split function so I can offsetlifeforce from gene without needing to look for the gene agian (for the constant drain tick) public static Gene_LifeForce GetLifeForceGene(Pawn pawn) { @@ -37,28 +28,10 @@ namespace RJW_Genes { Pawn pawn = drain.Pawn; - //Do things + //TODO: Do things } } - public static bool IsMechbreeder(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_mechbreeder); - } - - public static bool HasLifeForce(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_lifeforce); - } - public static bool HasLowLifeForce(Pawn pawn) { if (HasLifeForce(pawn)) @@ -85,42 +58,6 @@ namespace RJW_Genes return false; } - public static bool IsInsectIncubator(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator); - } - - public static bool IsYouthFountain(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain); - } - - public static bool IsAgeDrainer(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_sex_age_drain); - } - - public static bool IsInsectBreeder(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectbreeder); - } - public static float MaxEggSizeMul(Pawn pawn) { float MaxEggSize = 1; @@ -131,50 +68,6 @@ namespace RJW_Genes return MaxEggSize; } - internal static bool IsElastic(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_elasticity); - } - - public static bool IsCumflationImmune(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_cumflation_immunity); - } - public static bool IsGenerousDonor(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_generous_donor); - } - - public static bool isPussyHealer(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_pussyhealer); - } - - public static bool IsUnbreakable(Pawn pawn) - { - if (pawn.genes == null) - { - return false; - } - return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable); - } - public static List GetGenitaliaResizingGenes(Pawn pawn) { var ResizingGenes = new List(); @@ -189,5 +82,32 @@ namespace RJW_Genes return ResizingGenes; } + + /// + /// Unified small check for a pawn if it has a specified Gene. + /// Handles some errors and returns false as default. + /// + /// The pawn for which to look up a gene. + /// The gene to look up. + /// + public static bool HasGeneNullCheck(Pawn pawn, GeneDef genedef) + { + if (pawn.genes == null) + { + return false; + } + return pawn.genes.HasGene(genedef); + } + public static bool HasLifeForce(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_lifeforce); } + public static bool IsMechbreeder(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_mechbreeder); } + public static bool IsInsectIncubator(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_insectincubator); } + public static bool IsYouthFountain(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_youth_fountain); } + public static bool IsAgeDrainer(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_sex_age_drain); } + public static bool IsInsectBreeder(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_insectbreeder); } + public static bool IsElastic(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_elasticity); } + public static bool IsCumflationImmune(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_cumflation_immunity); } + public static bool IsGenerousDonor(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_generous_donor); } + public static bool IsPussyHealer(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_pussyhealer); } + public static bool IsUnbreakable(Pawn pawn) { return HasGeneNullCheck(pawn, GeneDefOf.rjw_genes_unbreakable); } } } \ No newline at end of file diff --git a/Source/Genes/Life_Force/Abilities/AbilityUtility.cs b/Source/Genes/Life_Force/Abilities/AbilityUtility.cs index 3f18b71..77fba03 100644 --- a/Source/Genes/Life_Force/Abilities/AbilityUtility.cs +++ b/Source/Genes/Life_Force/Abilities/AbilityUtility.cs @@ -23,11 +23,11 @@ namespace RJW_Genes FloatRange tendQualityRange; tendQualityRange.min = 0.4f; tendQualityRange.max = 0.8f; - if (GeneUtility.isPussyHealer(pawn)) + if (GeneUtility.IsPussyHealer(pawn)) { Heal(partner, tendQualityRange); } - if (GeneUtility.isPussyHealer(partner)) + if (GeneUtility.IsPussyHealer(partner)) { Heal(pawn, tendQualityRange); } diff --git a/Source/Genes/Life_Force/Patch_LifeForce.cs b/Source/Genes/Life_Force/Patch_LifeForce.cs index f4eb817..9dbda44 100644 --- a/Source/Genes/Life_Force/Patch_LifeForce.cs +++ b/Source/Genes/Life_Force/Patch_LifeForce.cs @@ -68,9 +68,9 @@ namespace RJW_Genes AbsorbFertilin(props, absorb_factor); } - if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_drainer) && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.Succubus_Drained)) + if (GeneUtility.HasGeneNullCheck(succubus, GeneDefOf.rjw_genes_drainer) && !props.pawn.health.hediffSet.HasHediff(HediffDefOf.rjw_genes_succubus_drained)) { - props.pawn.health.AddHediff(HediffDefOf.Succubus_Drained); + props.pawn.health.AddHediff(HediffDefOf.rjw_genes_succubus_drained); GeneUtility.OffsetLifeForce(GeneUtility.GetLifeForceGene(succubus), 0.25f); } } @@ -79,7 +79,7 @@ namespace RJW_Genes { Pawn_GeneTracker genes = props.partner.genes; Gene_LifeForce gene = genes.GetFirstGeneOfType(); - Hediff fertilin_lost = props.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Fertilin_Lost); + Hediff fertilin_lost = props.pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_fertilin_lost); //Around quarter get ejected everytime pawn cums float multiplier = Rand.Range(0.10f, 0.40f); @@ -87,7 +87,7 @@ namespace RJW_Genes //Create a new ferilin_lost hediff or reduce multiplier if (fertilin_lost == null) { - Hediff new_fertilin_lost = HediffMaker.MakeHediff(HediffDefOf.Fertilin_Lost, props.pawn); + Hediff new_fertilin_lost = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_fertilin_lost, props.pawn); props.pawn.health.AddHediff(new_fertilin_lost); new_fertilin_lost.Severity = multiplier; } diff --git a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones.cs similarity index 87% rename from Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs rename to Source/Genes/Special/Gene_Aphrodisiac_Pheromones.cs index d9f4341..c400c17 100644 --- a/Source/Genes/Special/Gene_Aphrodisiac_Pheromones_.cs +++ b/Source/Genes/Special/Gene_Aphrodisiac_Pheromones.cs @@ -31,7 +31,7 @@ namespace RJW_Genes } } - //Creatus an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped. + //Creates an IEnumerable of all pawns which are closeby and in lineofsight, self and other pawns with aphrodisiac pheromones gene are skipped. private IEnumerable AffectedPawns(IntVec3 pos, Map map) { foreach (Pawn pawn in map.mapPawns.AllPawns) @@ -45,10 +45,10 @@ namespace RJW_Genes yield break; } - //Applies er renews a hediff which increases sexdrive for 6 hours + //Applies or renews a hediff which increases sexdrive for 6 hours private void InduceAphrodisiac(Pawn pawn, float sexfrequency) { - Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.Aphrodisiac_Pheromone); + Hediff hediff = pawn.health.hediffSet.GetFirstHediffOfDef(HediffDefOf.rjw_genes_aphrodisiac_pheromone); if (hediff != null) { @@ -56,12 +56,9 @@ namespace RJW_Genes } else { - Hediff aphrodisiac = HediffMaker.MakeHediff(HediffDefOf.Aphrodisiac_Pheromone, pawn); + Hediff aphrodisiac = HediffMaker.MakeHediff(HediffDefOf.rjw_genes_aphrodisiac_pheromone, pawn); foreach (StatModifier stat in aphrodisiac.CurStage.statFactors) { - //Log.Message(pawn.Name.ToString()); - //Log.Message(stat.stat.defName); - //Log.Message(stat.value.ToString()); if (stat.stat.defName == "SexFrequency") { stat.value = ModifySexfrequency(pawn, sexfrequency); diff --git a/Source/HediffDefOf.cs b/Source/HediffDefOf.cs index c6581f8..f0ba596 100644 --- a/Source/HediffDefOf.cs +++ b/Source/HediffDefOf.cs @@ -11,9 +11,9 @@ namespace RJW_Genes [DefOf] public static class HediffDefOf { - public static readonly HediffDef Aphrodisiac_Pheromone; - public static readonly HediffDef Fertilin_Lost; - public static readonly HediffDef Succubus_Drained; + public static readonly HediffDef rjw_genes_aphrodisiac_pheromone; + public static readonly HediffDef rjw_genes_fertilin_lost; + public static readonly HediffDef rjw_genes_succubus_drained; public static readonly HediffDef rjw_genes_orgasm_rush_hediff; } } diff --git a/Source/Interactions/SubSuccubusTailCustomRequirementHandler - Copy.cs b/Source/Interactions/SubSuccubusTailCustomRequirementHandler.cs similarity index 81% rename from Source/Interactions/SubSuccubusTailCustomRequirementHandler - Copy.cs rename to Source/Interactions/SubSuccubusTailCustomRequirementHandler.cs index 5824aa5..9bd8289 100644 --- a/Source/Interactions/SubSuccubusTailCustomRequirementHandler - Copy.cs +++ b/Source/Interactions/SubSuccubusTailCustomRequirementHandler.cs @@ -1,17 +1,9 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; -using RimWorld; +using Verse; using rjw.Modules.Interactions; using rjw.Modules.Interactions.Internals.Implementation; using rjw.Modules.Interactions.Objects; -using rjw; -using rjw.Modules.Interactions.Enums; -//Modefied code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/ +//Modified code based of RJW-AI code at https://gitgud.io/Ed86/rjw-ia/-/tree/master/ namespace RJW_Genes { [StaticConstructorOnStartup] @@ -25,7 +17,6 @@ namespace RJW_Genes } } - static SubSuccubusTailCustomRequirementHandler() { Register(); @@ -50,3 +41,4 @@ namespace RJW_Genes //public static readonly StringListDef filter = DefDatabase.GetNamed("SubSuccubusTailFilter"); } } + diff --git a/Source/Rjw-Genes.csproj b/Source/Rjw-Genes.csproj index d3bad38..440dfae 100644 --- a/Source/Rjw-Genes.csproj +++ b/Source/Rjw-Genes.csproj @@ -149,7 +149,7 @@ - + @@ -157,7 +157,7 @@ - +