Minor Cleanups and Renamings, prefixed all defs with rjw_genes_

This commit is contained in:
Vegapnk 2023-01-17 08:56:26 +01:00
parent c4a64c345f
commit f2871744fd
11 changed files with 52 additions and 145 deletions

View File

@ -5,7 +5,6 @@
<randomChosen>true</randomChosen>
<exclusionTags>
<li>Wing</li>
<li>Wings</li>
</exclusionTags>
<graphicData>
<drawLoc>Tailbone</drawLoc>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>Aphrodisiac_Pheromone</defName>
<defName>rjw_genes_aphrodisiac_pheromone</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>induced libido</label>
<description>Aphrodisiac pheromone effects.</description>
@ -23,7 +23,7 @@
</HediffDef>
<HediffDef>
<defName>Fertilin_Lost</defName>
<defName>rjw_genes_fertilin_lost</defName>
<hediffClass>RJW_Genes.HediffWithComps_tank</hediffClass>
<label>lost fertilin</label>
<description>Percentage of fertilin lost.</description>
@ -42,7 +42,7 @@
</HediffDef>
<HediffDef>
<defName>Succubus_Drained</defName>
<defName>rjw_genes_succubus_drained</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>Drained</label>
<description>The vitality of this pawn has been drained.</description>

View File

@ -4,8 +4,8 @@
<XenotypeDef>
<defName>rjw_genes_succubus</defName>
<label>Succubus</label>
<description>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. </description>
<descriptionShort>Succubi are beautiful and extremely hungry Xenohumans. They strive on having sex and extracting their victims life-force through this. </descriptionShort>
<description>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.</description>
<descriptionShort>Succubi are beautiful and extremely hungry Xenohumans. They strive on having sex and extracting their victims life-force through this.</descriptionShort>
<iconPath>UI/Icons/Xenotypes/Sanguophage</iconPath>
<soundDefOnImplant>PawnBecameSanguophage</soundDefOnImplant>
<generateWithXenogermReplicatingHediffChance>0.5</generateWithXenogermReplicatingHediffChance>

View File

@ -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
}
}

View File

@ -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<Gene_GenitaliaResizingGene> GetGenitaliaResizingGenes(Pawn pawn)
{
var ResizingGenes = new List<Gene_GenitaliaResizingGene>();
@ -189,5 +82,32 @@ namespace RJW_Genes
return ResizingGenes;
}
/// <summary>
/// Unified small check for a pawn if it has a specified Gene.
/// Handles some errors and returns false as default.
/// </summary>
/// <param name="pawn">The pawn for which to look up a gene.</param>
/// <param name="genedef">The gene to look up.</param>
/// <returns></returns>
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); }
}
}

View File

@ -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);
}

View File

@ -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<Gene_LifeForce>();
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;
}

View File

@ -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<Pawn> 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);

View File

@ -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;
}
}

View File

@ -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<StringListDef>.GetNamed("SubSuccubusTailFilter");
}
}

View File

@ -149,7 +149,7 @@
<Compile Include="Genes\Life_Force\Gene_LifeForce.cs" />
<Compile Include="Genes\RJW_Gene.cs" />
<Compile Include="Genes\Genitalia\GenitaliaUtility.cs" />
<Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones_.cs" />
<Compile Include="Genes\Special\Gene_Aphrodisiac_Pheromones.cs" />
<Compile Include="Genes\Life_Force\Patch_LifeForce.cs" />
<Compile Include="Genes\Special\Patch_OrgasmRush.cs" />
<Compile Include="Genes\Special\Patch_Youth_Fountain.cs" />
@ -157,7 +157,7 @@
<Compile Include="HediffDefOf.cs" />
<Compile Include="Interactions\CustomSexInteraction_Helper.cs" />
<Compile Include="Interactions\GenesPartKindUsageRule.cs" />
<Compile Include="Interactions\SubSuccubusTailCustomRequirementHandler - Copy.cs" />
<Compile Include="Interactions\SubSuccubusTailCustomRequirementHandler.cs" />
<Compile Include="Interactions\DomSuccubusTailCustomRequirementHandler.cs" />
<Compile Include="JobDefOf.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />