Unhardcoded genital type genes

This commit is contained in:
a flock of birds 2024-05-26 10:52:18 +01:00
parent f45714c44c
commit 197634f920
16 changed files with 130 additions and 269 deletions

Binary file not shown.

View file

@ -3,6 +3,7 @@
<GeneDef Name="GeneGenitalTypeBase" Abstract="True"> <GeneDef Name="GeneGenitalTypeBase" Abstract="True">
<displayCategory>rjw_genes_genitalia_type</displayCategory> <displayCategory>rjw_genes_genitalia_type</displayCategory>
<geneClass>RJW_Genes.Gene_GenitaliaType</geneClass>
<exclusionTags> <exclusionTags>
<li>GenitalType</li> <li>GenitalType</li>
</exclusionTags> </exclusionTags>
@ -21,7 +22,12 @@
<label>equine genitalia</label> <label>equine genitalia</label>
<description>Carriers of this gene develop equine genitalia.</description> <description>Carriers of this gene develop equine genitalia.</description>
<iconPath>Genes/Icons/Genitalia_Equine</iconPath> <iconPath>Genes/Icons/Genitalia_Equine</iconPath>
<geneClass>RJW_Genes.Gene_EquineGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>HorsePenis</penis>
<vagina>HorseVagina</vagina>
</li>
</modExtensions>
<displayOrderInCategory>802</displayOrderInCategory> <displayOrderInCategory>802</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -30,7 +36,12 @@
<label>canine genitalia</label> <label>canine genitalia</label>
<description>Carriers of this gene develop canine genitalia.</description> <description>Carriers of this gene develop canine genitalia.</description>
<iconPath>Genes/Icons/Genitalia_Canine</iconPath> <iconPath>Genes/Icons/Genitalia_Canine</iconPath>
<geneClass>RJW_Genes.Gene_CanineGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>DogPenis</penis>
<vagina>DogVagina</vagina>
</li>
</modExtensions>
<displayOrderInCategory>803</displayOrderInCategory> <displayOrderInCategory>803</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -39,7 +50,12 @@
<label>feline genitalia</label> <label>feline genitalia</label>
<description>Carriers of this gene develop feline genitalia.</description> <description>Carriers of this gene develop feline genitalia.</description>
<iconPath>Genes/Icons/Genitalia_Feline</iconPath> <iconPath>Genes/Icons/Genitalia_Feline</iconPath>
<geneClass>RJW_Genes.Gene_FelineGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>CatPenis</penis>
<vagina>CatVagina</vagina>
</li>
</modExtensions>
<displayOrderInCategory>804</displayOrderInCategory> <displayOrderInCategory>804</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -48,7 +64,13 @@
<label>demonic genitalia</label> <label>demonic genitalia</label>
<description>Carriers of this gene have demonic genitalia.</description> <description>Carriers of this gene have demonic genitalia.</description>
<iconPath>Genes/Icons/Genitalia_Demon</iconPath> <iconPath>Genes/Icons/Genitalia_Demon</iconPath>
<geneClass>RJW_Genes.Gene_DemonicGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>DemonPenis</penis>
<vagina>DemonVagina</vagina>
<anus>DemonAnus</anus>
</li>
</modExtensions>
<displayOrderInCategory>805</displayOrderInCategory> <displayOrderInCategory>805</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -57,7 +79,12 @@
<label>dragon genitalia</label> <label>dragon genitalia</label>
<description>Carriers of this gene develop dragon genitalia.</description> <description>Carriers of this gene develop dragon genitalia.</description>
<iconPath>Genes/Icons/Genitalia_Draconic</iconPath> <iconPath>Genes/Icons/Genitalia_Draconic</iconPath>
<geneClass>RJW_Genes.Gene_DragonGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>DragonPenis</penis>
<vagina>DragonVagina</vagina>
</li>
</modExtensions>
<displayOrderInCategory>806</displayOrderInCategory> <displayOrderInCategory>806</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -66,7 +93,13 @@
<label>slime genitalia</label> <label>slime genitalia</label>
<description>Carriers of this gene have slime genitalia.</description> <description>Carriers of this gene have slime genitalia.</description>
<iconPath>Genes/Icons/Slime_Genitalia</iconPath> <iconPath>Genes/Icons/Slime_Genitalia</iconPath>
<geneClass>RJW_Genes.Gene_SlimeGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>SlimeTentacles</penis>
<vagina>SlimeVagina</vagina>
<anus>SlimeAnus</anus>
</li>
</modExtensions>
<displayOrderInCategory>807</displayOrderInCategory> <displayOrderInCategory>807</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -75,7 +108,13 @@
<label>demonic tentacle genitalia</label> <label>demonic tentacle genitalia</label>
<description>Carriers of this gene have demonic tentacle genitalia.</description> <description>Carriers of this gene have demonic tentacle genitalia.</description>
<iconPath>Genes/Icons/Placeholder</iconPath> <iconPath>Genes/Icons/Placeholder</iconPath>
<geneClass>RJW_Genes.Gene_DemonicGenitaliaTentacle</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>DemonTentaclePenis</penis>
<vagina>DemonVagina</vagina>
<anus>DemonAnus</anus>
</li>
</modExtensions>
<displayOrderInCategory>807</displayOrderInCategory> <displayOrderInCategory>807</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -84,7 +123,13 @@
<label>crocodilian genitalia</label> <label>crocodilian genitalia</label>
<description>Carriers of this gene have crocodilian genitalia.</description> <description>Carriers of this gene have crocodilian genitalia.</description>
<iconPath>Genes/Icons/Placeholder</iconPath> <iconPath>Genes/Icons/Placeholder</iconPath>
<geneClass>RJW_Genes.Gene_CrocodilianGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>CrocodilianPenis</penis>
<vagina>Vagina</vagina>
<anus>Anus</anus>
</li>
</modExtensions>
<displayOrderInCategory>807</displayOrderInCategory> <displayOrderInCategory>807</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -93,7 +138,13 @@
<label>racoon genitalia</label> <label>racoon genitalia</label>
<description>Carriers of this gene have racoon genitalia.</description> <description>Carriers of this gene have racoon genitalia.</description>
<iconPath>Genes/Icons/Placeholder</iconPath> <iconPath>Genes/Icons/Placeholder</iconPath>
<geneClass>RJW_Genes.Gene_RacoonGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>RaccoonPenis</penis>
<vagina>Vagina</vagina>
<anus>Anus</anus>
</li>
</modExtensions>
<displayOrderInCategory>807</displayOrderInCategory> <displayOrderInCategory>807</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -102,7 +153,13 @@
<label>reptilian genitalia</label> <label>reptilian genitalia</label>
<description>Carriers of this gene have reptilian genitalia.</description> <description>Carriers of this gene have reptilian genitalia.</description>
<iconPath>Genes/Icons/Placeholder</iconPath> <iconPath>Genes/Icons/Placeholder</iconPath>
<geneClass>RJW_Genes.Gene_ReptilianGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>HemiPenis</penis>
<vagina>Vagina</vagina>
<anus>Anus</anus>
</li>
</modExtensions>
<displayOrderInCategory>807</displayOrderInCategory> <displayOrderInCategory>807</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -111,7 +168,13 @@
<label>insect genitalia</label> <label>insect genitalia</label>
<description>Carriers of this gene have ovipositors similar to insects.</description> <description>Carriers of this gene have ovipositors similar to insects.</description>
<iconPath>Genes/Icons/Ovipositor_Genitalia</iconPath> <iconPath>Genes/Icons/Ovipositor_Genitalia</iconPath>
<geneClass>RJW_Genes.Gene_OvipositorGenitalia</geneClass> <modExtensions>
<li Class="RJW_Genes.GenitaliaTypeExtension">
<penis>OvipositorM</penis>
<vagina>OvipositorF</vagina>
<anus>InsectAnus</anus>
</li>
</modExtensions>
<displayOrderInCategory>808</displayOrderInCategory> <displayOrderInCategory>808</displayOrderInCategory>
<exclusionTags> <exclusionTags>

View file

@ -0,0 +1,23 @@
using Verse;
using RimWorld;
using rjw;
#pragma warning disable IDE0044, CS0649 // Private fields set when def is loaded
namespace RJW_Genes
{
public class GenitaliaTypeExtension : DefModExtension
{
private HediffDef_PartBase penis;
public HediffDef_PartBase Penis => penis ?? (HediffDef_PartBase) Genital_Helper.generic_penis;
private HediffDef_PartBase vagina;
public HediffDef_PartBase Vagina => vagina ?? (HediffDef_PartBase) Genital_Helper.generic_vagina;
private HediffDef_PartBase anus;
public HediffDef_PartBase Anus => anus ?? (HediffDef_PartBase) Genital_Helper.generic_anus;
private HediffDef_PartBase breasts;
public HediffDef_PartBase Breasts => breasts ?? (HediffDef_PartBase) Genital_Helper.generic_breasts;
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_CanineGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.canine_penis,Genital_Helper.canine_vagina,Genital_Helper.generic_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.canine_penis, Genital_Helper.canine_vagina, Genital_Helper.generic_anus);
}
}
}

View file

@ -1,23 +0,0 @@
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class Gene_CrocodilianGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.crocodilian_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.crocodilian_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
}
}

View file

@ -1,23 +0,0 @@
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class Gene_DemonicGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.demon_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.demon_penis, Genital_Helper.demon_vagina, Genital_Helper.demon_anus);
}
}
}

View file

@ -1,23 +0,0 @@
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class Gene_DemonicGenitaliaTentacle : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.demonT_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.demonT_penis, Genital_Helper.demon_vagina, Genital_Helper.demon_anus);
}
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_DragonGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.dragon_penis,Genital_Helper.dragon_vagina,Genital_Helper.generic_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.dragon_penis, Genital_Helper.dragon_vagina, Genital_Helper.generic_anus);
}
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_EquineGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.equine_penis,Genital_Helper.equine_vagina,Genital_Helper.generic_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.equine_penis, Genital_Helper.equine_vagina, Genital_Helper.generic_anus);
}
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_FelineGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.feline_penis,Genital_Helper.feline_vagina,Genital_Helper.generic_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.feline_penis, Genital_Helper.feline_vagina, Genital_Helper.generic_anus);
}
}
}

View file

@ -0,0 +1,31 @@
using rjw;
namespace RJW_Genes
{
// bleh plural attributive noun in keeping with naming convention
public class Gene_GenitaliaType : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
Apply();
}
public override void PostAdd()
{
base.PostAdd();
Apply();
}
protected virtual void Apply()
{
GenitaliaTypeExtension genitals = def.GetModExtension<GenitaliaTypeExtension>();
if (genitals == null && RJW_Genes_Settings.rjw_genes_detailed_debug)
{
ModLog.Error($"Gene {def} failed to change genitals - Need a modExtension with Class=\"{typeof(GenitaliaTypeExtension).FullName}\".");
return;
}
GenitaliaChanger.ChangeGenitalia(pawn, genitals.Penis, genitals.Vagina, genitals.Anus);
}
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_OvipositorGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.ovipositorM,Genital_Helper.ovipositorF,Genital_Helper.insect_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.ovipositorM, Genital_Helper.ovipositorF, Genital_Helper.insect_anus);
}
}
}

View file

@ -1,23 +0,0 @@
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class Gene_RacoonGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.raccoon_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.raccoon_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
}
}

View file

@ -1,23 +0,0 @@
using Verse;
using RimWorld;
using rjw;
namespace RJW_Genes
{
public class Gene_ReptilianGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.hemipenis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.hemipenis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
}
}
}

View file

@ -1,22 +0,0 @@
using Verse;
using rjw;
namespace RJW_Genes
{
public class Gene_SlimeGenitalia : RJW_Gene
{
public override void PostMake()
{
base.PostMake();
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.slime_penis,Genital_Helper.slime_vagina,Genital_Helper.slime_anus);
}
public override void PostAdd()
{
base.PostAdd();
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.slime_penis, Genital_Helper.slime_vagina, Genital_Helper.slime_anus);
}
}
}

View file

@ -84,17 +84,8 @@
<Compile Include="Genes\GenitaliaSize\Gene_BigMaleGenitalia.cs" /> <Compile Include="Genes\GenitaliaSize\Gene_BigMaleGenitalia.cs" />
<Compile Include="Genes\GenitaliaSize\Patch_ResizingOnAdulthood.cs" /> <Compile Include="Genes\GenitaliaSize\Patch_ResizingOnAdulthood.cs" />
<Compile Include="Genes\GenitaliaSize\SizeAdjuster.cs" /> <Compile Include="Genes\GenitaliaSize\SizeAdjuster.cs" />
<Compile Include="Genes\Genitalia\Gene_ReptilianGenitalia.cs" /> <Compile Include="Genes\Genitalia\Gene_GenitaliaType.cs" />
<Compile Include="Genes\Genitalia\Gene_CrocodilianGenitalia.cs" /> <Compile Include="Genes\Genitalia\Defs\GenitaliaTypeExtension.cs" />
<Compile Include="Genes\Genitalia\Gene_RacoonGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_DemonicGenitaliaTentacle.cs" />
<Compile Include="Genes\Genitalia\Gene_SlimeGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_DragonGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_FelineGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_CanineGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_OvipositorGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_DemonicGenitalia.cs" />
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" /> <Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
<Compile Include="Genes\Patch_AddNotifyOnGeneration.cs" /> <Compile Include="Genes\Patch_AddNotifyOnGeneration.cs" />
<Compile Include="Genes\Special\Defs\AgeTransferExtension.cs" /> <Compile Include="Genes\Special\Defs\AgeTransferExtension.cs" />