Added a Futa Gene

This commit is contained in:
Vegapnk 2022-11-15 17:50:25 +01:00
parent fa07b9365c
commit b8fa98ea8d
6 changed files with 101 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View file

@ -103,5 +103,17 @@
</exclusionTags>
</GeneDef>
<GeneDef ParentName="GeneExtraGenitaliaBase">
<defName>rjw_genes_futa</defName>
<label>futanari</label>
<description>Males of this xenotype grow additional female genitalia, Females grow additional male genitalia.</description>
<iconPath>Genes/Icons/Placeholder</iconPath>
<geneClass>RJW_Genes.Gene_Futa</geneClass>
<displayOrderInCategory>29</displayOrderInCategory>
<exclusionTags>
<li>PenisAmount</li>
<li>VaginaAmount</li>
</exclusionTags>
</GeneDef>
</Defs>

View file

@ -27,5 +27,7 @@ namespace RJW_Genes
[MayRequireBiotech] public static readonly GeneDef rjw_genes_no_breasts;
[MayRequireBiotech] public static readonly GeneDef rjw_genes_extra_anus;
[MayRequireBiotech] public static readonly GeneDef rjw_genes_no_anus;
[MayRequireBiotech] public static readonly GeneDef rjw_genes_futa;
}
}

View file

@ -0,0 +1,85 @@
using Verse;
using rjw;
using RimWorld;
namespace RJW_Genes
{
public class Gene_Futa : Gene
{
internal Hediff additional_genital;
public override void PostMake()
{
base.PostMake();
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
Sexualizer.sexualize_pawn(pawn);
if (pawn.gender == Gender.Female && additional_genital == null)
{
createAndAddPenis();
}
if (pawn.gender == Gender.Male && additional_genital == null)
{
CreateAndAddVagina();
}
}
public override void PostAdd()
{
base.PostAdd();
if (pawn.gender == Gender.Female && additional_genital == null)
{
createAndAddPenis();
}
if (pawn.gender == Gender.Male && additional_genital == null)
{
CreateAndAddVagina();
}
}
public override void PostRemove()
{
base.PostRemove();
if(additional_genital != null)
pawn.health.RemoveHediff(additional_genital);
}
//TODO: Extract createAndAddXXX to extra class
internal void createAndAddPenis()
{
var correctGene = GenitaliaUtility.GetGenitaliaTypeGeneForPawn(pawn);
HediffDef penisDef = GenitaliaUtility.GetPenisForGene(correctGene);
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
additional_genital = HediffMaker.MakeHediff(penisDef, pawn);
var CompHediff = additional_genital.TryGetComp<rjw.CompHediffBodyPart>();
if (CompHediff != null)
{
CompHediff.initComp(pawn);
CompHediff.updatesize();
}
pawn.health.AddHediff(additional_genital, partBPR);
}
internal void CreateAndAddVagina()
{
var correctGene = GenitaliaUtility.GetGenitaliaTypeGeneForPawn(pawn);
HediffDef vaginaDef = GenitaliaUtility.GetVaginaForGene(correctGene);
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
additional_genital = HediffMaker.MakeHediff(vaginaDef, pawn);
var CompHediff = additional_genital.TryGetComp<rjw.CompHediffBodyPart>();
if (CompHediff != null)
{
CompHediff.initComp(pawn);
CompHediff.updatesize();
}
pawn.health.AddHediff(additional_genital, partBPR);
}
}
}

View file

@ -51,6 +51,7 @@
<Compile Include="GeneDefOf.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraBreasts.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraAnus.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_Futa.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraVagina.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_NoBreasts.cs" />
<Compile Include="Genes\ExtraGenitalia\Gene_NoAnus.cs" />