mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Fixed Anus Replacement, added sample gene to add extra penis or no penis, added License
This commit is contained in:
parent
b30b108c55
commit
bb679527af
21 changed files with 431 additions and 64 deletions
BIN
.LICENSE.txt.swp
Normal file
BIN
.LICENSE.txt.swp
Normal file
Binary file not shown.
Binary file not shown.
40
Common/Defs/Genes/GeneDefs_ExtraGenitaliaEndogenes.xml
Normal file
40
Common/Defs/Genes/GeneDefs_ExtraGenitaliaEndogenes.xml
Normal file
|
@ -0,0 +1,40 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Defs>
|
||||||
|
<GeneDef Name="GeneExtraGenitaliaBase" Abstract="True">
|
||||||
|
<displayCategory>rjw_genes_genitalia</displayCategory>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
<exclusionTags>
|
||||||
|
<li>GenitalType</li>
|
||||||
|
</exclusionTags>
|
||||||
|
<biostatCpx>0</biostatCpx>
|
||||||
|
<biostatMet>0</biostatMet>
|
||||||
|
-->
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneExtraGenitaliaBase">
|
||||||
|
<defName>rjw_genes_extra_penis</defName>
|
||||||
|
<label>extra penis</label>
|
||||||
|
<description>Males of this species grow an additional penis .</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_ExtraPenis</geneClass>
|
||||||
|
<displayOrderInCategory>15</displayOrderInCategory>
|
||||||
|
<exclusionTags>
|
||||||
|
<li>PenisAmount</li>
|
||||||
|
</exclusionTags>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneExtraGenitaliaBase">
|
||||||
|
<defName>rjw_genes_no_penis</defName>
|
||||||
|
<label>no penis</label>
|
||||||
|
<description>Males of this do not have a penis.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_NoPenis</geneClass>
|
||||||
|
<displayOrderInCategory>16</displayOrderInCategory>
|
||||||
|
<exclusionTags>
|
||||||
|
<li>PenisAmount</li>
|
||||||
|
</exclusionTags>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
</Defs>
|
|
@ -6,8 +6,8 @@
|
||||||
<exclusionTags>
|
<exclusionTags>
|
||||||
<li>GenitalType</li>
|
<li>GenitalType</li>
|
||||||
</exclusionTags>
|
</exclusionTags>
|
||||||
<!--
|
|
||||||
<biostatCpx>0</biostatCpx>
|
<biostatCpx>0</biostatCpx>
|
||||||
|
<!--
|
||||||
<biostatMet>0</biostatMet>
|
<biostatMet>0</biostatMet>
|
||||||
-->
|
-->
|
||||||
</GeneDef>
|
</GeneDef>
|
|
@ -102,6 +102,18 @@
|
||||||
</operations>
|
</operations>
|
||||||
</Operation>
|
</Operation>
|
||||||
|
|
||||||
|
<Operation Class="PatchOperationSequence">
|
||||||
|
<success>Always</success>
|
||||||
|
<operations>
|
||||||
|
<li Class="PatchOperationAdd">
|
||||||
|
<xpath>Defs/XenotypeDef[defName="Genie"]/genes</xpath>
|
||||||
|
<value>
|
||||||
|
<li>rjw_genes_human_genitalia</li>
|
||||||
|
</value>
|
||||||
|
</li>
|
||||||
|
</operations>
|
||||||
|
</Operation>
|
||||||
|
|
||||||
<!-- SPECIAL Penises -->
|
<!-- SPECIAL Penises -->
|
||||||
|
|
||||||
<Operation Class="PatchOperationSequence">
|
<Operation Class="PatchOperationSequence">
|
||||||
|
@ -128,18 +140,6 @@
|
||||||
</operations>
|
</operations>
|
||||||
</Operation>
|
</Operation>
|
||||||
|
|
||||||
<Operation Class="PatchOperationSequence">
|
|
||||||
<success>Always</success>
|
|
||||||
<operations>
|
|
||||||
<li Class="PatchOperationAdd">
|
|
||||||
<xpath>Defs/XenotypeDef[defName="Genie"]/genes</xpath>
|
|
||||||
<value>
|
|
||||||
<li>rjw_genes_slime_genitalia</li>
|
|
||||||
</value>
|
|
||||||
</li>
|
|
||||||
</operations>
|
|
||||||
</Operation>
|
|
||||||
|
|
||||||
<Operation Class="PatchOperationSequence">
|
<Operation Class="PatchOperationSequence">
|
||||||
<success>Always</success>
|
<success>Always</success>
|
||||||
<operations>
|
<operations>
|
||||||
|
|
9
LICENSE.txt
Normal file
9
LICENSE.txt
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Copyright 2022 Vegapnk
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ namespace RJW_Genes
|
||||||
{
|
{
|
||||||
[MayRequireBiotech] public static readonly GeneCategoryDef rjw_genes_genitalia;
|
[MayRequireBiotech] public static readonly GeneCategoryDef rjw_genes_genitalia;
|
||||||
|
|
||||||
|
// Base Genitalia Types
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_human_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_human_genitalia;
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_equine_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_equine_genitalia;
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_demonic_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_demonic_genitalia;
|
||||||
|
@ -16,5 +17,9 @@ namespace RJW_Genes
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_ovipositor_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_ovipositor_genitalia;
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_feline_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_feline_genitalia;
|
||||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_canine_genitalia;
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_canine_genitalia;
|
||||||
|
|
||||||
|
// Extra Genitalia
|
||||||
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_extra_penis;
|
||||||
|
[MayRequireBiotech] public static readonly GeneDef rjw_genes_no_penis;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
87
Source/GeneDefs_GenitaliaTypeEndogenes.xml
Normal file
87
Source/GeneDefs_GenitaliaTypeEndogenes.xml
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Defs>
|
||||||
|
|
||||||
|
<GeneDef Name="GeneGenitalTypeBase" Abstract="True">
|
||||||
|
<displayCategory>rjw_genes_genitalia</displayCategory>
|
||||||
|
<exclusionTags>
|
||||||
|
<li>GenitalType</li>
|
||||||
|
</exclusionTags>
|
||||||
|
<biostatCpx>0</biostatCpx>
|
||||||
|
<!--
|
||||||
|
<biostatMet>0</biostatMet>
|
||||||
|
-->
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_human_genitalia</defName>
|
||||||
|
<label>human genitalia</label>
|
||||||
|
<description>Carriers of this carry genitalia similar to humans.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_HumanGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>1</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_equine_genitalia</defName>
|
||||||
|
<label>equine genitalia</label>
|
||||||
|
<description>Carriers of this gene develop equine genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_EquineGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>2</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_canine_genitalia</defName>
|
||||||
|
<label>canine genitalia</label>
|
||||||
|
<description>Carriers of this gene develop canine genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_CanineGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>3</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_feline_genitalia</defName>
|
||||||
|
<label>feline genitalia</label>
|
||||||
|
<description>Carriers of this gene develop feline genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_FelineGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>4</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_demonic_genitalia</defName>
|
||||||
|
<label>demonic genitalia</label>
|
||||||
|
<description>Carriers of this gene have demonic genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_DemonicGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>5</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_dragon_genitalia</defName>
|
||||||
|
<label>dragon genitalia</label>
|
||||||
|
<description>Carriers of this gene develop dragon genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_DragonGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>6</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_slime_genitalia</defName>
|
||||||
|
<label>slime genitalia</label>
|
||||||
|
<description>Carriers of this gene have slime genitalia.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_SlimeGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>7</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||||
|
<defName>rjw_genes_ovipositor_genitalia</defName>
|
||||||
|
<label>insect genitalia</label>
|
||||||
|
<description>Carriers of this gene have ovipositors similar to insects.</description>
|
||||||
|
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||||
|
<geneClass>RJW_Genes.Gene_OvipositorGenitalia</geneClass>
|
||||||
|
<displayOrderInCategory>8</displayOrderInCategory>
|
||||||
|
</GeneDef>
|
||||||
|
|
||||||
|
</Defs>
|
61
Source/Genes/ExtraGenitalia/Gene_ExtraPenis.cs
Normal file
61
Source/Genes/ExtraGenitalia/Gene_ExtraPenis.cs
Normal file
|
@ -0,0 +1,61 @@
|
||||||
|
using Verse;
|
||||||
|
using rjw;
|
||||||
|
using RimWorld;
|
||||||
|
|
||||||
|
namespace RJW_Genes
|
||||||
|
{
|
||||||
|
public class Gene_ExtraPenis : Gene
|
||||||
|
{
|
||||||
|
|
||||||
|
internal Hediff additional_penis;
|
||||||
|
|
||||||
|
public override void PostMake()
|
||||||
|
{
|
||||||
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
|
|
||||||
|
// Penis are only added for male pawns!
|
||||||
|
if (pawn.gender == Gender.Male && additional_penis == null)
|
||||||
|
{
|
||||||
|
createAndAddPenis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PostAdd()
|
||||||
|
{
|
||||||
|
base.PostAdd();
|
||||||
|
|
||||||
|
// Penis are only added for male pawns!
|
||||||
|
if (pawn.gender == Gender.Male && additional_penis == null)
|
||||||
|
{
|
||||||
|
createAndAddPenis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PostRemove()
|
||||||
|
{
|
||||||
|
base.PostRemove();
|
||||||
|
if(additional_penis != null)
|
||||||
|
pawn.health.RemoveHediff(additional_penis);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void createAndAddPenis()
|
||||||
|
{
|
||||||
|
var correctGene = GenitaliaUtility.GetGenitaliaTypeGeneForPawn(pawn);
|
||||||
|
var penisDef = GenitaliaUtility.GetPenisForGene(correctGene);
|
||||||
|
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||||
|
additional_penis = HediffMaker.MakeHediff(penisDef, pawn);
|
||||||
|
|
||||||
|
var CompHediff = additional_penis.TryGetComp<rjw.CompHediffBodyPart>();
|
||||||
|
if (CompHediff != null)
|
||||||
|
{
|
||||||
|
CompHediff.initComp(pawn);
|
||||||
|
CompHediff.updatesize();
|
||||||
|
}
|
||||||
|
|
||||||
|
pawn.health.AddHediff(additional_penis, partBPR);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
58
Source/Genes/ExtraGenitalia/Gene_NoPenis.cs
Normal file
58
Source/Genes/ExtraGenitalia/Gene_NoPenis.cs
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
using Verse;
|
||||||
|
using rjw;
|
||||||
|
using RimWorld;
|
||||||
|
|
||||||
|
namespace RJW_Genes
|
||||||
|
{
|
||||||
|
public class Gene_NoPenis : Gene
|
||||||
|
{
|
||||||
|
|
||||||
|
internal Hediff removed_penis;
|
||||||
|
|
||||||
|
// TODO: This gene only works if another Gene was set specifying the genitalia.
|
||||||
|
// If it is added later, it still works, but on creation it needs a different
|
||||||
|
public override void PostMake()
|
||||||
|
{
|
||||||
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
|
|
||||||
|
// Penis are only added for male pawns!
|
||||||
|
if (pawn.gender == Gender.Male && removed_penis == null)
|
||||||
|
{
|
||||||
|
RemoveButStorePenis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PostAdd()
|
||||||
|
{
|
||||||
|
base.PostAdd();
|
||||||
|
|
||||||
|
// Penis are only added for male pawns!
|
||||||
|
if (pawn.gender == Gender.Male && removed_penis == null)
|
||||||
|
{
|
||||||
|
RemoveButStorePenis();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void PostRemove()
|
||||||
|
{
|
||||||
|
base.PostRemove();
|
||||||
|
if(removed_penis != null)
|
||||||
|
pawn.health.AddHediff(removed_penis);
|
||||||
|
}
|
||||||
|
|
||||||
|
internal void RemoveButStorePenis()
|
||||||
|
{
|
||||||
|
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||||
|
Hediff penisToRemove = Genital_Helper.get_AllPartsHediffList(pawn).FindLast(x => Genital_Helper.is_penis(x));
|
||||||
|
|
||||||
|
if(penisToRemove != null)
|
||||||
|
{
|
||||||
|
removed_penis = penisToRemove;
|
||||||
|
pawn.health.RemoveHediff(penisToRemove);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.canine_penis,Genital_Helper.canine_vagina,Genital_Helper.generic_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.canine_penis,Genital_Helper.canine_vagina,Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.canine_penis, Genital_Helper.canine_vagina, Genital_Helper.generic_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.canine_penis, Genital_Helper.canine_vagina, Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,14 +9,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.demon_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.demon_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.demon_penis, Genital_Helper.demon_vagina, Genital_Helper.demon_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.demon_penis, Genital_Helper.demon_vagina, Genital_Helper.demon_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.dragon_penis,Genital_Helper.dragon_vagina,Genital_Helper.generic_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.dragon_penis,Genital_Helper.dragon_vagina,Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.dragon_penis, Genital_Helper.dragon_vagina, Genital_Helper.generic_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.dragon_penis, Genital_Helper.dragon_vagina, Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.equine_penis,Genital_Helper.equine_vagina,Genital_Helper.generic_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.equine_penis,Genital_Helper.equine_vagina,Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.equine_penis, Genital_Helper.equine_vagina, Genital_Helper.generic_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.equine_penis, Genital_Helper.equine_vagina, Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.feline_penis,Genital_Helper.feline_vagina,Genital_Helper.generic_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.feline_penis,Genital_Helper.feline_vagina,Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.feline_penis, Genital_Helper.feline_vagina, Genital_Helper.generic_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.feline_penis, Genital_Helper.feline_vagina, Genital_Helper.generic_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.average_penis,Genital_Helper.average_vagina,Genital_Helper.average_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.average_penis,Genital_Helper.average_vagina,Genital_Helper.average_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostAdd();
|
base.PostAdd();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.average_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.average_penis, Genital_Helper.average_vagina, Genital_Helper.average_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.ovipositorM,Genital_Helper.ovipositorF,Genital_Helper.insect_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.ovipositorM,Genital_Helper.ovipositorF,Genital_Helper.insect_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.ovipositorM, Genital_Helper.ovipositorF, Genital_Helper.insect_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.ovipositorM, Genital_Helper.ovipositorF, Genital_Helper.insect_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -8,14 +8,16 @@ namespace RJW_Genes
|
||||||
public override void PostMake()
|
public override void PostMake()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
|
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||||
Sexualizer.sexualize_pawn(pawn);
|
Sexualizer.sexualize_pawn(pawn);
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn,Genital_Helper.slime_penis,Genital_Helper.slime_vagina,Genital_Helper.slime_anus);
|
|
||||||
|
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.slime_penis,Genital_Helper.slime_vagina,Genital_Helper.slime_anus);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void PostAdd()
|
public override void PostAdd()
|
||||||
{
|
{
|
||||||
base.PostMake();
|
base.PostMake();
|
||||||
GenitaliaChanger.changeGenitalia(this.pawn, Genital_Helper.slime_penis, Genital_Helper.slime_vagina, Genital_Helper.slime_anus);
|
GenitaliaChanger.ChangeGenitalia(this.pawn, Genital_Helper.slime_penis, Genital_Helper.slime_vagina, Genital_Helper.slime_anus);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,16 +11,15 @@ namespace RJW_Genes
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method changes the pawns genitalia to the given types of genitalia.
|
/// This method changes the pawns genitalia to the given types of genitalia.
|
||||||
/// All genitals will be changed, e.g. pawns with 2 penises (for whatever reason) or is a futa, all genitals will be changed.
|
/// All genitals will be changed, e.g. pawns with 2 penises (for whatever reason) or is a futa, all genitals will be changed.
|
||||||
/// Anuses are currently not changed, due to a small bug.
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="pawn">the pawn who's genitals will be changed</param>
|
/// <param name="pawn">the pawn who's genitals will be changed</param>
|
||||||
/// <param name="penisReplacement">the new type of penis</param>
|
/// <param name="penisReplacement">the new type of penis</param>
|
||||||
/// <param name="vaginaReplacement">the new type of vagina</param>
|
/// <param name="vaginaReplacement">the new type of vagina</param>
|
||||||
/// <param name="anusReplacement">the new type of anus (currently disabled)</param>
|
/// <param name="anusReplacement">the new type of anus</param>
|
||||||
public static void changeGenitalia(Pawn pawn, HediffDef penisReplacement, HediffDef vaginaReplacement, HediffDef anusReplacement)
|
public static void ChangeGenitalia(Pawn pawn, HediffDef penisReplacement, HediffDef vaginaReplacement, HediffDef anusReplacement)
|
||||||
{
|
{
|
||||||
var oldParts = Genital_Helper.get_AllPartsHediffList(pawn);
|
var oldParts = Genital_Helper.get_AllPartsHediffList(pawn);
|
||||||
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
BodyPartRecord correctBPR;
|
||||||
|
|
||||||
if (!oldParts.NullOrEmpty())
|
if (!oldParts.NullOrEmpty())
|
||||||
{
|
{
|
||||||
|
@ -31,16 +30,21 @@ namespace RJW_Genes
|
||||||
{
|
{
|
||||||
if (IsArtificial(existingGenital))
|
if (IsArtificial(existingGenital))
|
||||||
continue;
|
continue;
|
||||||
|
correctBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||||
|
|
||||||
replacementGenital = null;
|
replacementGenital = null;
|
||||||
CompHediff = null;
|
CompHediff = null;
|
||||||
if (IsPenis(existingGenital))
|
if (Genital_Helper.is_penis(existingGenital))
|
||||||
replacementGenital = HediffMaker.MakeHediff(penisReplacement, pawn, partBPR);
|
replacementGenital = HediffMaker.MakeHediff(penisReplacement, pawn, correctBPR);
|
||||||
|
|
||||||
if (IsVagina(existingGenital))
|
if (Genital_Helper.is_vagina(existingGenital))
|
||||||
replacementGenital = HediffMaker.MakeHediff(vaginaReplacement, pawn, partBPR);
|
replacementGenital = HediffMaker.MakeHediff(vaginaReplacement, pawn, correctBPR);
|
||||||
|
|
||||||
//TODO: Adding Anus in this way had an issue by multiplying Anusses. At the moment Anus are not covered.
|
if (IsAnus(existingGenital))
|
||||||
|
{
|
||||||
|
correctBPR = Genital_Helper.get_anusBPR(pawn);
|
||||||
|
replacementGenital = HediffMaker.MakeHediff(anusReplacement, pawn, correctBPR);
|
||||||
|
}
|
||||||
|
|
||||||
if (replacementGenital != null)
|
if (replacementGenital != null)
|
||||||
{
|
{
|
||||||
|
@ -53,7 +57,7 @@ namespace RJW_Genes
|
||||||
GenderHelper.ChangeSex(pawn, () =>
|
GenderHelper.ChangeSex(pawn, () =>
|
||||||
{
|
{
|
||||||
pawn.health.RemoveHediff(existingGenital);
|
pawn.health.RemoveHediff(existingGenital);
|
||||||
pawn.health.AddHediff(replacementGenital, partBPR);
|
pawn.health.AddHediff(replacementGenital, correctBPR);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,21 +70,6 @@ namespace RJW_Genes
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static bool IsPenis(Hediff candidate)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
candidate.def.defName.ToLower().Contains("penis") ||
|
|
||||||
candidate.def.defName.ToLower().Contains("ovipositorm") ||
|
|
||||||
candidate.def.defName.ToLower().Contains("tentacle");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsVagina(Hediff candidate)
|
|
||||||
{
|
|
||||||
return
|
|
||||||
candidate.def.defName.ToLower().Contains("vagina") ||
|
|
||||||
candidate.def.defName.ToLower().Contains("ovipositorf");
|
|
||||||
}
|
|
||||||
|
|
||||||
private static bool IsAnus(Hediff candidate)
|
private static bool IsAnus(Hediff candidate)
|
||||||
{
|
{
|
||||||
return candidate.def.defName.ToLower().Contains("anus"); }
|
return candidate.def.defName.ToLower().Contains("anus"); }
|
||||||
|
|
93
Source/GenitaliaUtility.cs
Normal file
93
Source/GenitaliaUtility.cs
Normal file
|
@ -0,0 +1,93 @@
|
||||||
|
using RimWorld;
|
||||||
|
using Verse;
|
||||||
|
using rjw;
|
||||||
|
|
||||||
|
namespace RJW_Genes
|
||||||
|
{
|
||||||
|
public class GenitaliaUtility
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Returns the first (non) overwritten gene from the rjw_genes genitalia genes.
|
||||||
|
/// In case the pawn has none, as default the human one is returned.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pawn">the pawn whom to find genitaliagenes for</param>
|
||||||
|
/// <returns>The first GeneDef of the pawn related to GenitaliaTypes</returns>
|
||||||
|
public static GeneDef GetGenitaliaTypeGeneForPawn(Pawn pawn)
|
||||||
|
{
|
||||||
|
|
||||||
|
foreach (var gene in pawn.genes.GenesListForReading)
|
||||||
|
{
|
||||||
|
if (gene.def.defName.Contains("rjw_genes") && gene.def.defName.EndsWith("_genitalia"))
|
||||||
|
if (!gene.Overridden)
|
||||||
|
return gene.def;
|
||||||
|
}
|
||||||
|
|
||||||
|
return GeneDefOf.rjw_genes_human_genitalia;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds a genital created from a given Def to the pawn.
|
||||||
|
/// Does not alter/touch gender.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="pawn">The pawn whom to add the genital to,</param>
|
||||||
|
/// <param name="genitalToAdd">The type of genital to be added</param>
|
||||||
|
public static void AddGenitalToPawn(Pawn pawn,HediffDef genitalToAdd)
|
||||||
|
{
|
||||||
|
if (pawn == null || genitalToAdd == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
var partBPR = Genital_Helper.get_genitalsBPR(pawn);
|
||||||
|
var additionalGenital = HediffMaker.MakeHediff(genitalToAdd, pawn);
|
||||||
|
|
||||||
|
var CompHediff = additionalGenital.TryGetComp<rjw.CompHediffBodyPart>();
|
||||||
|
if (CompHediff != null)
|
||||||
|
{
|
||||||
|
CompHediff.initComp(pawn);
|
||||||
|
CompHediff.updatesize();
|
||||||
|
}
|
||||||
|
|
||||||
|
pawn.health.AddHediff(additionalGenital, partBPR);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static HediffDef GetPenisForGene(GeneDef gene)
|
||||||
|
{
|
||||||
|
switch (gene.defName)
|
||||||
|
{
|
||||||
|
case "rjw_genes_human_genitalia": return Genital_Helper.average_penis;
|
||||||
|
case "rjw_genes_equine_genitalia": return Genital_Helper.equine_penis;
|
||||||
|
case "rjw_genes_canine_genitalia": return Genital_Helper.canine_penis;
|
||||||
|
case "rjw_genes_feline_genitalia": return Genital_Helper.feline_penis;
|
||||||
|
case "rjw_genes_demonic_genitalia": return Genital_Helper.demon_penis;
|
||||||
|
case "rjw_genes_dragon_genitalia": return Genital_Helper.dragon_penis;
|
||||||
|
case "rjw_genes_slime_genitalia": return Genital_Helper.slime_penis;
|
||||||
|
case "rjw_genes_ovipositor_genitalia": return Genital_Helper.ovipositorM;
|
||||||
|
|
||||||
|
default: return Genital_Helper.average_penis;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static bool PawnStillNeedsGenitalia(Pawn pawn)
|
||||||
|
{
|
||||||
|
// There is the issue that the genes fire in a pseudo-random order
|
||||||
|
// Hence it can happen that the pawn still needs genitalia
|
||||||
|
// I wanted to make a simple lookup, but I think the genes are applied for all humans encountered so it could be huge
|
||||||
|
// So the heuristic is to check if the pawn has any of the 3 standard genitalia OR has all genes ticked that says "I don't want genitalia".
|
||||||
|
if (pawn == null) return false;
|
||||||
|
|
||||||
|
bool pawn_has_any_genitalia =
|
||||||
|
Genital_Helper.has_genitals(pawn) || Genital_Helper.has_anus(pawn) || Genital_Helper.has_breasts(pawn);
|
||||||
|
|
||||||
|
bool pawn_is_not_supposed_to_have_genitalia =
|
||||||
|
pawn.genes.GenesListForReading.Any(x => x.def.defName == "rjw_genes_no_penis");
|
||||||
|
|
||||||
|
if (pawn_is_not_supposed_to_have_genitalia)
|
||||||
|
return false;
|
||||||
|
else
|
||||||
|
return !pawn_has_any_genitalia;
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -28,6 +28,7 @@
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="RJW">
|
<Reference Include="RJW">
|
||||||
<HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
|
<HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
|
||||||
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
@ -40,12 +41,16 @@
|
||||||
<Private>False</Private>
|
<Private>False</Private>
|
||||||
</Reference>
|
</Reference>
|
||||||
<None Include="..\About\**" />
|
<None Include="..\About\**" />
|
||||||
<None Include="..\Common\Defs\**" />
|
<None Include="..\Common\Defs\Genes\GeneCategories.xml" />
|
||||||
|
<None Include="..\Common\Defs\Genes\GeneDefs_ExtraGenitaliaEndogenes.xml" />
|
||||||
|
<None Include="..\Common\Defs\Genes\GeneDefs_GenitaliaTypeEndogenes.xml" />
|
||||||
<None Include="..\Common\Languages\**" />
|
<None Include="..\Common\Languages\**" />
|
||||||
<None Include="..\Common\Patches\**" />
|
<None Include="..\Common\Patches\**" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="GeneDefOf.cs" />
|
<Compile Include="GeneDefOf.cs" />
|
||||||
|
<Compile Include="Genes\ExtraGenitalia\Gene_NoPenis.cs" />
|
||||||
|
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraPenis.cs" />
|
||||||
<Compile Include="Genes\Genitalia\Gene_SlimeGenitalia.cs" />
|
<Compile Include="Genes\Genitalia\Gene_SlimeGenitalia.cs" />
|
||||||
<Compile Include="Genes\Genitalia\Gene_DragonGenitalia.cs" />
|
<Compile Include="Genes\Genitalia\Gene_DragonGenitalia.cs" />
|
||||||
<Compile Include="Genes\Genitalia\Gene_FelineGenitalia.cs" />
|
<Compile Include="Genes\Genitalia\Gene_FelineGenitalia.cs" />
|
||||||
|
@ -55,8 +60,12 @@
|
||||||
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
|
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
|
||||||
<Compile Include="Genes\Genitalia\Gene_HumanGenitalia.cs" />
|
<Compile Include="Genes\Genitalia\Gene_HumanGenitalia.cs" />
|
||||||
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
|
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
|
||||||
|
<Compile Include="GenitaliaUtility.cs" />
|
||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="RJW_Genes.cs" />
|
<Compile Include="RJW_Genes.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="GeneDefs_GenitaliaTypeEndogenes.xml" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in a new issue