mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Compare commits
2 commits
bf4303177e
...
21fc56fe2b
Author | SHA1 | Date | |
---|---|---|---|
|
21fc56fe2b | ||
|
95fc9b89a0 |
52 changed files with 582 additions and 189 deletions
|
@ -13,13 +13,13 @@
|
|||
<displayName>RimJobWorld</displayName>
|
||||
<downloadUrl>https://www.loverslab.com/files/file/7257-rimjobworld/</downloadUrl>
|
||||
</li>
|
||||
<!--
|
||||
<li>
|
||||
<packageId>brrainz.harmony</packageId>
|
||||
<displayName>Harmony</displayName>
|
||||
<steamWorkshopUrl>steam://url/CommunityFilePage/2009463077</steamWorkshopUrl>
|
||||
<downloadUrl>https://github.com/pardeike/HarmonyRimWorld/releases/latest</downloadUrl>
|
||||
</li>
|
||||
<!--
|
||||
<li>
|
||||
<packageId>UnlimitedHugs.HugsLib</packageId>
|
||||
<displayName>HugsLib</displayName>
|
||||
|
@ -30,8 +30,8 @@
|
|||
</modDependencies>
|
||||
<loadAfter>
|
||||
<li>rim.job.world</li>
|
||||
<!--
|
||||
<li>brrainz.harmony</li>
|
||||
<!--
|
||||
<li>UnlimitedHugs.HugsLib</li>
|
||||
-->
|
||||
</loadAfter>
|
||||
|
|
BIN
Common/Assemblies/0Harmony.dll
Normal file
BIN
Common/Assemblies/0Harmony.dll
Normal file
Binary file not shown.
Binary file not shown.
32
Common/Defs/GeneDefs_Breeding.xml
Normal file
32
Common/Defs/GeneDefs_Breeding.xml
Normal file
|
@ -0,0 +1,32 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<!-- rjw_genes_mechbreeder,rjw_genes_insectincubator and rjw_genes_insectbreeder were kindly supplied by `Shabalox` https://github.com/Shabalox/RJW_Genes_Addons/ -->
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_mechbreeder</defName>
|
||||
<label>Mechbreeder</label>
|
||||
<description>Pawns with this gene are able to birth mechanoids unharmed.</description>
|
||||
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
|
||||
<displayOrderInCategory>51</displayOrderInCategory>
|
||||
<displayCategory>rjw_genes_breeding</displayCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_insectincubator</defName>
|
||||
<label>InsectIncubator</label>
|
||||
<description>Pawns with this gene are able to hold more insect eggs.</description>
|
||||
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
|
||||
<displayOrderInCategory>52</displayOrderInCategory>
|
||||
<displayCategory>rjw_genes_breeding</displayCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_insectbreeder</defName>
|
||||
<label>InsectBreeder</label>
|
||||
<description>Pawns with this gene are able to fertilize eggs with any fertile penis.</description>
|
||||
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
|
||||
<displayOrderInCategory>53</displayOrderInCategory>
|
||||
<displayCategory>rjw_genes_breeding</displayCategory>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
|
@ -1,10 +1,27 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
|
||||
<!-- Note: It is very important that rjw_genes_gender has a higher priority than the other genes
|
||||
That way they run in the correct order.
|
||||
If the Gender Change happens after e.g. genitalia change, it will produce errors.
|
||||
-->
|
||||
|
||||
<GeneCategoryDef>
|
||||
<defName>rjw_genes_gender</defName>
|
||||
<label>Gender</label>
|
||||
<displayPriorityInXenotype>20</displayPriorityInXenotype>
|
||||
</GeneCategoryDef>
|
||||
|
||||
<GeneCategoryDef>
|
||||
<defName>rjw_genes_genitalia</defName>
|
||||
<label>Genitalia</label>
|
||||
<displayPriorityInXenotype>541</displayPriorityInXenotype>
|
||||
<displayPriorityInXenotype>16</displayPriorityInXenotype>
|
||||
</GeneCategoryDef>
|
||||
|
||||
<GeneCategoryDef>
|
||||
<defName>rjw_genes_breeding</defName>
|
||||
<label>Breeding</label>
|
||||
<displayPriorityInXenotype>15</displayPriorityInXenotype>
|
||||
</GeneCategoryDef>
|
||||
|
||||
</Defs>
|
|
@ -11,7 +11,7 @@
|
|||
<description>Males of this species grow an additional penis .</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_ExtraPenis</geneClass>
|
||||
<displayOrderInCategory>20</displayOrderInCategory>
|
||||
<displayOrderInCategory>701</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -23,7 +23,7 @@
|
|||
<description>Males of this do not have a penis.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NoPenis</geneClass>
|
||||
<displayOrderInCategory>21</displayOrderInCategory>
|
||||
<displayOrderInCategory>702</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<description>Females of this species grow an additional vagina .</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_ExtraVagina</geneClass>
|
||||
<displayOrderInCategory>22</displayOrderInCategory>
|
||||
<displayOrderInCategory>703</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>VaginaAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -48,7 +48,7 @@
|
|||
<description>Females of this do not have a vagina.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NoVagina</geneClass>
|
||||
<displayOrderInCategory>23</displayOrderInCategory>
|
||||
<displayOrderInCategory>704</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>VaginaAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<description>Females of this species grow an additional pair of breasts .</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_ExtraBreasts</geneClass>
|
||||
<displayOrderInCategory>24</displayOrderInCategory>
|
||||
<displayOrderInCategory>705</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>BreastAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -73,7 +73,7 @@
|
|||
<description>Females of this do not have a pair of breasts.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NoBreasts</geneClass>
|
||||
<displayOrderInCategory>25</displayOrderInCategory>
|
||||
<displayOrderInCategory>706</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>BreastAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -85,7 +85,7 @@
|
|||
<description>This specias has an extra anus.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_ExtraAnus</geneClass>
|
||||
<displayOrderInCategory>26</displayOrderInCategory>
|
||||
<displayOrderInCategory>707</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>AnusAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<description>This specias has no anus.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NoAnus</geneClass>
|
||||
<displayOrderInCategory>27</displayOrderInCategory>
|
||||
<displayOrderInCategory>708</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>AnusAmount</li>
|
||||
</exclusionTags>
|
||||
|
@ -109,7 +109,7 @@
|
|||
<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>
|
||||
<displayOrderInCategory>709</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisAmount</li>
|
||||
<li>VaginaAmount</li>
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
<description>Penises of this Xenotype are bigger.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_BigMaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>51</displayOrderInCategory>
|
||||
<displayOrderInCategory>751</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -24,7 +24,7 @@
|
|||
<description>Penises of this Xenotype can be any size.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NormalMaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>52</displayOrderInCategory>
|
||||
<displayOrderInCategory>752</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -36,7 +36,7 @@
|
|||
<description>Penises of this Xenotype are smaller.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_SmallMaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>53</displayOrderInCategory>
|
||||
<displayOrderInCategory>753</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>PenisSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -49,7 +49,7 @@
|
|||
<description>Vaginas of this Xenotype are quite spacy.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_LooseFemaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>54</displayOrderInCategory>
|
||||
<displayOrderInCategory>754</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>VaginaSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -61,7 +61,7 @@
|
|||
<description>Vaginas of this Xenotype can be any size.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NormalFemaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>55</displayOrderInCategory>
|
||||
<displayOrderInCategory>755</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>VaginaSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -73,7 +73,7 @@
|
|||
<description>Vaginas of this Xenotype are pretty tight.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_TightFemaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>56</displayOrderInCategory>
|
||||
<displayOrderInCategory>756</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>VaginaSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -86,7 +86,7 @@
|
|||
<description>Females of this Xenotype have big honkers.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_BigBreasts</geneClass>
|
||||
<displayOrderInCategory>57</displayOrderInCategory>
|
||||
<displayOrderInCategory>757</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>BreastSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -98,7 +98,7 @@
|
|||
<description>Females of this Xenotype have breasts of any size.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NormalBreasts</geneClass>
|
||||
<displayOrderInCategory>58</displayOrderInCategory>
|
||||
<displayOrderInCategory>758</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>BreastSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -110,7 +110,7 @@
|
|||
<description>Females of this Xenotype have smaller breasts.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_SmallBreasts</geneClass>
|
||||
<displayOrderInCategory>59</displayOrderInCategory>
|
||||
<displayOrderInCategory>759</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>BreastSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -123,7 +123,7 @@
|
|||
<description>The Anus of this Xenotype is roomy.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_LooseAnus</geneClass>
|
||||
<displayOrderInCategory>60</displayOrderInCategory>
|
||||
<displayOrderInCategory>760</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>AnusSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -135,7 +135,7 @@
|
|||
<description>Anus of this Xenotype can be any size.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_NormalAnus</geneClass>
|
||||
<displayOrderInCategory>61</displayOrderInCategory>
|
||||
<displayOrderInCategory>761</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>AnusSize</li>
|
||||
</exclusionTags>
|
||||
|
@ -147,7 +147,7 @@
|
|||
<description>The anus of this Xenotype is small.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_TightAnus</geneClass>
|
||||
<displayOrderInCategory>62</displayOrderInCategory>
|
||||
<displayOrderInCategory>762</displayOrderInCategory>
|
||||
<exclusionTags>
|
||||
<li>AnusSize</li>
|
||||
</exclusionTags>
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
<description>Carriers of this carry genitalia similar to humans.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_HumanGenitalia</geneClass>
|
||||
<displayOrderInCategory>1</displayOrderInCategory>
|
||||
<displayOrderInCategory>801</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -27,7 +27,7 @@
|
|||
<description>Carriers of this gene develop equine genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_EquineGenitalia</geneClass>
|
||||
<displayOrderInCategory>2</displayOrderInCategory>
|
||||
<displayOrderInCategory>802</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -36,7 +36,7 @@
|
|||
<description>Carriers of this gene develop canine genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_CanineGenitalia</geneClass>
|
||||
<displayOrderInCategory>3</displayOrderInCategory>
|
||||
<displayOrderInCategory>803</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -45,7 +45,7 @@
|
|||
<description>Carriers of this gene develop feline genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_FelineGenitalia</geneClass>
|
||||
<displayOrderInCategory>4</displayOrderInCategory>
|
||||
<displayOrderInCategory>804</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -54,7 +54,7 @@
|
|||
<description>Carriers of this gene have demonic genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_DemonicGenitalia</geneClass>
|
||||
<displayOrderInCategory>5</displayOrderInCategory>
|
||||
<displayOrderInCategory>805</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -63,7 +63,7 @@
|
|||
<description>Carriers of this gene develop dragon genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_DragonGenitalia</geneClass>
|
||||
<displayOrderInCategory>6</displayOrderInCategory>
|
||||
<displayOrderInCategory>806</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -72,7 +72,7 @@
|
|||
<description>Carriers of this gene have slime genitalia.</description>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_SlimeGenitalia</geneClass>
|
||||
<displayOrderInCategory>7</displayOrderInCategory>
|
||||
<displayOrderInCategory>807</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef ParentName="GeneGenitalTypeBase">
|
||||
|
@ -81,7 +81,7 @@
|
|||
<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>
|
||||
<displayOrderInCategory>808</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
25
Common/Defs/Genes/GeneDefs_SpecifiedGender.xml
Normal file
25
Common/Defs/Genes/GeneDefs_SpecifiedGender.xml
Normal file
|
@ -0,0 +1,25 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<Defs>
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_female_only</defName>
|
||||
<label>Female</label>
|
||||
<displayCategory>rjw_genes_gender</displayCategory>
|
||||
<description>This Xenotype only has females.</description>
|
||||
<biostatCpx>0</biostatCpx>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_FemaleOnly</geneClass>
|
||||
<displayOrderInCategory>1</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
<GeneDef>
|
||||
<defName>rjw_genes_male_only</defName>
|
||||
<displayCategory>rjw_genes_gender</displayCategory>
|
||||
<label>Male</label>
|
||||
<description>This Xenotype only has males.</description>
|
||||
<biostatCpx>0</biostatCpx>
|
||||
<iconPath>Genes/Icons/Placeholder</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_MaleOnly</geneClass>
|
||||
<displayOrderInCategory>2</displayOrderInCategory>
|
||||
</GeneDef>
|
||||
|
||||
</Defs>
|
|
@ -7,6 +7,7 @@ namespace RJW_Genes
|
|||
public static class GeneDefOf
|
||||
{
|
||||
[MayRequireBiotech] public static readonly GeneCategoryDef rjw_genes_genitalia;
|
||||
[MayRequireBiotech] public static readonly GeneCategoryDef rjw_genes_gender;
|
||||
|
||||
// Base Genitalia Types
|
||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_human_genitalia;
|
||||
|
@ -43,5 +44,13 @@ namespace RJW_Genes
|
|||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_normal_anus;
|
||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_tight_anus;
|
||||
|
||||
// Gender
|
||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_female_only;
|
||||
[MayRequireBiotech] public static readonly GeneDef rjw_genes_male_only;
|
||||
|
||||
// Breeding
|
||||
public static readonly GeneDef rjw_genes_mechbreeder;
|
||||
public static readonly GeneDef rjw_genes_insectincubator;
|
||||
public static readonly GeneDef rjw_genes_insectbreeder;
|
||||
}
|
||||
}
|
||||
|
|
9
Source/Genes/Breeding/Gene_MechBreeder.cs
Normal file
9
Source/Genes/Breeding/Gene_MechBreeder.cs
Normal file
|
@ -0,0 +1,9 @@
|
|||
using Verse;
|
||||
|
||||
namespace Genes.Breeding
|
||||
{
|
||||
internal class Gene_MechBreeder : Gene
|
||||
{
|
||||
// This one does not do anything, the patch is some where else checking for the pawn to have this Gene!
|
||||
}
|
||||
}
|
64
Source/Genes/Breeding/PatchMechBirth.cs
Normal file
64
Source/Genes/Breeding/PatchMechBirth.cs
Normal file
|
@ -0,0 +1,64 @@
|
|||
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection;
|
||||
using System.Reflection.Emit;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Class patches the RJW-Mechbirth to not deal damage when the pawn has the MechBreeder Gene.
|
||||
/// This harmony patch was kindly provided by 'shabalox' https://github.com/Shabalox/RJW_Genes_Addons/
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(Hediff_MechanoidPregnancy), "GiveBirth")]
|
||||
public static class PatchMechBirth
|
||||
{
|
||||
[HarmonyTranspiler]
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator il)
|
||||
{
|
||||
bool found_call = false;
|
||||
bool found_skip = false;
|
||||
Label skip_label = il.DefineLabel();
|
||||
MethodInfo ismechbreeder = AccessTools.Method(typeof(GeneUtility), "IsMechbreeder");
|
||||
foreach (CodeInstruction codeInstruction in instructions)
|
||||
{
|
||||
//Check if the first opcode after endfinally ldloc_0 is and in that case add the label to skip the code
|
||||
if (found_skip && codeInstruction.opcode == OpCodes.Ldloc_0)
|
||||
{
|
||||
codeInstruction.labels.Add(skip_label);
|
||||
}
|
||||
found_skip = false;
|
||||
if (codeInstruction.opcode == OpCodes.Endfinally)
|
||||
{
|
||||
found_skip = true;
|
||||
}
|
||||
|
||||
yield return codeInstruction;
|
||||
|
||||
if (codeInstruction.opcode == OpCodes.Call)
|
||||
{
|
||||
if (codeInstruction.operand.ToString() == "Boolean TryMakeFilth(Verse.IntVec3, Verse.Map, Verse.ThingDef, System.String, Int32, RimWorld.FilthSourceFlags)")
|
||||
{
|
||||
found_call = true;
|
||||
}
|
||||
}
|
||||
//Triggers after the pop opcode (after generating filth in c#).
|
||||
else if (found_call)
|
||||
{
|
||||
//Load pawn, call function to check if a mechbreeder, and skip past the part which does damage
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
||||
yield return new CodeInstruction(OpCodes.Call, ismechbreeder);
|
||||
yield return new CodeInstruction(OpCodes.Brtrue_S, skip_label);
|
||||
found_call = false;
|
||||
}
|
||||
}
|
||||
yield break;
|
||||
}
|
||||
}
|
||||
}
|
22
Source/Genes/Breeding/PatchPawnExtensions.cs
Normal file
22
Source/Genes/Breeding/PatchPawnExtensions.cs
Normal file
|
@ -0,0 +1,22 @@
|
|||
using HarmonyLib;
|
||||
using rjw;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// Kindly provided by 'shabalox' https://github.com/Shabalox/RJW_Genes_Addons/
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(PawnExtensions), "RaceImplantEggs")]
|
||||
public static class PatchPawnExtensions
|
||||
{
|
||||
[HarmonyPostfix]
|
||||
public static void Postfix(Pawn pawn, ref bool __result)
|
||||
{
|
||||
if (!__result)
|
||||
{
|
||||
__result = GeneUtility.isInsectBreeder(pawn);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
54
Source/Genes/Breeding/PatchPregnancyHelper.cs
Normal file
54
Source/Genes/Breeding/PatchPregnancyHelper.cs
Normal file
|
@ -0,0 +1,54 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Reflection.Emit;
|
||||
using System.Reflection;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using Verse;
|
||||
using RimWorld;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Class patches the RJW-DoEgg to allow up to MaxEggSizeMul times the original amount of eggs.
|
||||
/// This harmony patch was kindly provided by 'shabalox' https://github.com/Shabalox/RJW_Genes_Addons/
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(PregnancyHelper), "DoEgg")]
|
||||
static class PatchPregnancyHelper
|
||||
{
|
||||
[HarmonyTranspiler]
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions, ILGenerator il)
|
||||
{
|
||||
//MethodInfo isinsectincubator = AccessTools.Method(typeof(GeneUtility), "IsInsectIncubator");
|
||||
MethodInfo maxeggsizemul = AccessTools.Method(typeof(GeneUtility), "MaxEggSizeMul");
|
||||
FieldInfo partner = AccessTools.Field(typeof(SexProps), "partner");
|
||||
|
||||
Label skiplabel = il.DefineLabel();
|
||||
bool finished = false;
|
||||
foreach (CodeInstruction codeInstruction in instructions)
|
||||
{
|
||||
if (!finished)
|
||||
{
|
||||
if (codeInstruction.opcode == OpCodes.Ldc_R4 && codeInstruction.operand.ToString() == "0")
|
||||
{
|
||||
yield return new CodeInstruction(OpCodes.Ldarg_0, null);
|
||||
yield return new CodeInstruction(OpCodes.Ldfld, partner);
|
||||
//yield return new CodeInstruction(OpCodes.Call, isinsectincubator);
|
||||
yield return new CodeInstruction(OpCodes.Callvirt, maxeggsizemul);
|
||||
//yield return new CodeInstruction(OpCodes.Brfalse_S, skiplabel);
|
||||
yield return new CodeInstruction(OpCodes.Ldloc_0, null);
|
||||
//yield return new CodeInstruction(OpCodes.Ldc_R4, 2f);
|
||||
yield return new CodeInstruction(OpCodes.Mul, null);
|
||||
yield return new CodeInstruction(OpCodes.Stloc_0, null);
|
||||
//codeInstruction.labels.Add(skiplabel);
|
||||
finished = true;
|
||||
}
|
||||
}
|
||||
yield return codeInstruction;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_ExtraAnus : Gene
|
||||
public class Gene_ExtraAnus : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff additional_anus;
|
||||
|
@ -12,8 +12,6 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
if (additional_anus == null)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_ExtraBreasts : Gene
|
||||
public class Gene_ExtraBreasts : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff additional_breasts;
|
||||
|
@ -12,13 +12,11 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
// Penis are only added for female pawns!
|
||||
if (pawn.gender == Gender.Female && additional_breasts == null)
|
||||
// Tits are only added for female pawns!
|
||||
if (GenderUtility.IsFemale(pawn) && additional_breasts == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
CreateAndAddBreasts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,10 +24,10 @@ namespace RJW_Genes
|
|||
{
|
||||
base.PostAdd();
|
||||
|
||||
// Penis are only added for female pawns!
|
||||
if (pawn.gender == Gender.Female && additional_breasts == null)
|
||||
// Tits are only added for female pawns!
|
||||
if (GenderUtility.IsFemale(pawn) && additional_breasts == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
CreateAndAddBreasts();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +38,7 @@ namespace RJW_Genes
|
|||
pawn.health.RemoveHediff(additional_breasts);
|
||||
}
|
||||
|
||||
internal void createAndAddPenis()
|
||||
internal void CreateAndAddBreasts()
|
||||
{
|
||||
var correctGene = GenitaliaUtility.GetGenitaliaTypeGeneForPawn(pawn);
|
||||
var breastDef = GenitaliaUtility.GetBreastsForGene(correctGene);
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_ExtraPenis : Gene
|
||||
public class Gene_ExtraPenis : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff additional_penis;
|
||||
|
@ -12,13 +12,11 @@ namespace RJW_Genes
|
|||
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)
|
||||
if (GenderUtility.IsMale(pawn) && additional_penis == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
CreateAndAddPenis();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -27,9 +25,9 @@ namespace RJW_Genes
|
|||
base.PostAdd();
|
||||
|
||||
// Penis are only added for male pawns!
|
||||
if (pawn.gender == Gender.Male && additional_penis == null)
|
||||
if (GenderUtility.IsMale(pawn) && additional_penis == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
CreateAndAddPenis();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -40,7 +38,7 @@ namespace RJW_Genes
|
|||
pawn.health.RemoveHediff(additional_penis);
|
||||
}
|
||||
|
||||
internal void createAndAddPenis()
|
||||
internal void CreateAndAddPenis()
|
||||
{
|
||||
var correctGene = GenitaliaUtility.GetGenitaliaTypeGeneForPawn(pawn);
|
||||
HediffDef penisDef = GenitaliaUtility.GetPenisForGene(correctGene);
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_ExtraVagina : Gene
|
||||
public class Gene_ExtraVagina : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff additional_vagina;
|
||||
|
@ -17,11 +17,9 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
// Vaginas are only added for female pawns!
|
||||
if (pawn.gender == Gender.Female && additional_vagina == null)
|
||||
if (GenderUtility.IsFemale(pawn) && additional_vagina == null)
|
||||
{
|
||||
CreateAndAddVagina();
|
||||
}
|
||||
|
@ -32,7 +30,7 @@ namespace RJW_Genes
|
|||
base.PostAdd();
|
||||
|
||||
// Vaginas are only added for female pawns!
|
||||
if (pawn.gender == Gender.Female && additional_vagina == null)
|
||||
if (GenderUtility.IsFemale(pawn) && additional_vagina == null)
|
||||
{
|
||||
CreateAndAddVagina();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_Futa : Gene
|
||||
public class Gene_Futa : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff additional_genital;
|
||||
|
@ -12,14 +12,12 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
if (pawn.gender == Gender.Female && additional_genital == null)
|
||||
if (GenderUtility.IsFemale(pawn) && additional_genital == null)
|
||||
{
|
||||
createAndAddPenis();
|
||||
}
|
||||
if (pawn.gender == Gender.Male && additional_genital == null)
|
||||
if (GenderUtility.IsMale(pawn) && additional_genital == null)
|
||||
{
|
||||
CreateAndAddVagina();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_NoAnus : Gene
|
||||
public class Gene_NoAnus : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff removed_anus;
|
||||
|
@ -15,8 +15,6 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
if (removed_anus == null)
|
||||
{
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_NoBreasts : Gene
|
||||
public class Gene_NoBreasts : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff removed_breasts;
|
||||
|
@ -15,11 +15,9 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
// Breasts are removed for female pawns!
|
||||
if (pawn.gender == Gender.Female && removed_breasts == null)
|
||||
if (GenderUtility.IsFemale(pawn) && removed_breasts == null)
|
||||
{
|
||||
RemoveButStoreBreasts();
|
||||
}
|
||||
|
@ -30,7 +28,7 @@ namespace RJW_Genes
|
|||
base.PostAdd();
|
||||
|
||||
// Breasts are removed for female pawns!
|
||||
if (pawn.gender == Gender.Female && removed_breasts == null)
|
||||
if (GenderUtility.IsFemale(pawn) && removed_breasts == null)
|
||||
{
|
||||
RemoveButStoreBreasts();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_NoPenis : Gene
|
||||
public class Gene_NoPenis : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff removed_penis;
|
||||
|
@ -15,11 +15,9 @@ namespace RJW_Genes
|
|||
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)
|
||||
// Penis are only removed for male pawns!
|
||||
if (GenderUtility.IsMale(pawn) && removed_penis == null)
|
||||
{
|
||||
RemoveButStorePenis();
|
||||
}
|
||||
|
@ -29,8 +27,8 @@ namespace RJW_Genes
|
|||
{
|
||||
base.PostAdd();
|
||||
|
||||
// Penis are only added for male pawns!
|
||||
if (pawn.gender == Gender.Male && removed_penis == null)
|
||||
// Penis are only removed for male pawns!
|
||||
if (GenderUtility.IsMale(pawn) && removed_penis == null)
|
||||
{
|
||||
RemoveButStorePenis();
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ using RimWorld;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_NoVagina : Gene
|
||||
public class Gene_NoVagina : RJW_Gene
|
||||
{
|
||||
|
||||
internal Hediff removed_vagina;
|
||||
|
@ -15,11 +15,9 @@ namespace RJW_Genes
|
|||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
// Vaginas are only removed for female pawns!
|
||||
if (pawn.gender == Gender.Female && removed_vagina == null)
|
||||
if (GenderUtility.IsFemale(pawn) && removed_vagina == null)
|
||||
{
|
||||
RemoveButStoreVagina();
|
||||
}
|
||||
|
@ -30,7 +28,7 @@ namespace RJW_Genes
|
|||
base.PostAdd();
|
||||
|
||||
// Vaginas are only removed for female pawns!
|
||||
if (pawn.gender == Gender.Female && removed_vagina == null)
|
||||
if (GenderUtility.IsFemale(pawn) && removed_vagina == null)
|
||||
{
|
||||
RemoveButStoreVagina();
|
||||
}
|
||||
|
|
73
Source/Genes/Gender/GenderUtility.cs
Normal file
73
Source/Genes/Gender/GenderUtility.cs
Normal file
|
@ -0,0 +1,73 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using RimWorld;
|
||||
using System.Collections;
|
||||
using System.Linq;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class GenderUtility
|
||||
{
|
||||
/// <summary>
|
||||
/// Returns if a Pawn is female (Gender==Female) or if it should be (Gene==FemaleOnly)
|
||||
/// This is used as a small helper, as the genes might fire in different orders.
|
||||
/// </summary>
|
||||
public static bool IsFemale(Pawn pawn)
|
||||
{
|
||||
return
|
||||
pawn.gender == Gender.Female || pawn.genes.GenesListForReading.Any(gene => gene.def.defName.EqualsIgnoreCase(GeneDefOf.rjw_genes_female_only.defName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns if a Pawn is male (Gender==Male) or if it should be (Gene==MaleOnly)
|
||||
/// This is used as a small helper, as the genes might fire in different orders.
|
||||
/// </summary>
|
||||
public static bool IsMale(Pawn pawn)
|
||||
{
|
||||
return
|
||||
pawn.gender == Gender.Male || pawn.genes.GenesListForReading.Any(gene => gene.def.defName.EqualsIgnoreCase(GeneDefOf.rjw_genes_male_only.defName));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adjusts the Body Type to match the given target gender
|
||||
/// (for male and female only, baby,child and hulks don't change)
|
||||
/// </summary>
|
||||
/// <param name="pawn"></param>
|
||||
/// <param name="targetGender"></param>
|
||||
public static void AdjustBodyToTargetGender(Pawn pawn, Gender targetGender)
|
||||
{
|
||||
if (pawn == null)
|
||||
return;
|
||||
if (pawn.story.bodyType == BodyTypeDefOf.Baby || pawn.story.bodyType == BodyTypeDefOf.Hulk || pawn.story.bodyType == BodyTypeDefOf.Child)
|
||||
return;
|
||||
|
||||
if (targetGender == Gender.Male)
|
||||
{
|
||||
pawn.story.bodyType = BodyTypeDefOf.Male;
|
||||
}
|
||||
else if (targetGender == Gender.Female)
|
||||
{
|
||||
pawn.story.bodyType = BodyTypeDefOf.Female;
|
||||
pawn.style.beardDef = BeardDefOf.NoBeard;
|
||||
}
|
||||
|
||||
// Re-Choose heads if it is wrong gender
|
||||
if (pawn.story.headType.gender == Gender.None || pawn.story.headType.gender == targetGender)
|
||||
{
|
||||
// Do nothing, Gender of Heat is Neutral or matches
|
||||
}
|
||||
else
|
||||
{
|
||||
// Below line tries to get (and set) an available head from the backstory, if it returns true everything worked if it returns false we log it
|
||||
if(! pawn.story.TryGetRandomHeadFromSet(DefDatabase<HeadTypeDef>.AllDefs.Where((Func<HeadTypeDef, bool>)(x => x.randomChosen))))
|
||||
{
|
||||
Log.Message("Failed to retrieve a correct-gender head for the pawn " + pawn.Name);
|
||||
};
|
||||
}
|
||||
|
||||
// Force Redraw at the spot
|
||||
pawn.Drawer.renderer.graphics.SetAllGraphicsDirty();
|
||||
}
|
||||
}
|
||||
}
|
42
Source/Genes/Gender/Gene_FemaleOnly.cs
Normal file
42
Source/Genes/Gender/Gene_FemaleOnly.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_FemaleOnly : Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
AdjustPawnToFemale();
|
||||
// Here we call Sexualization after the Sex-Change
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostMake();
|
||||
AdjustPawnToFemale();
|
||||
}
|
||||
|
||||
private void AdjustPawnToFemale()
|
||||
{
|
||||
// Here we really use the Gender.Female and not our helper IsFemale(pawn)
|
||||
if (pawn.gender == Gender.Female)
|
||||
return;
|
||||
else
|
||||
{
|
||||
GenderHelper.ChangeSex(pawn, () => {
|
||||
pawn.gender = Gender.Female;
|
||||
GenitaliaChanger.RemoveAllGenitalia(pawn);
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
});
|
||||
GenderUtility.AdjustBodyToTargetGender(pawn, Gender.Female);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
42
Source/Genes/Gender/Gene_MaleOnly.cs
Normal file
42
Source/Genes/Gender/Gene_MaleOnly.cs
Normal file
|
@ -0,0 +1,42 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_MaleOnly : Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
AdjustPawnToMale();
|
||||
// Here we call Sexualization after the Sex-Change
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostMake();
|
||||
AdjustPawnToMale();
|
||||
}
|
||||
|
||||
private void AdjustPawnToMale()
|
||||
{
|
||||
if (pawn.gender == Gender.Male)
|
||||
return;
|
||||
else
|
||||
{
|
||||
GenderHelper.ChangeSex(pawn, () => {
|
||||
|
||||
pawn.gender = Gender.Male;
|
||||
GenitaliaChanger.RemoveAllGenitalia(pawn);
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
});
|
||||
GenderUtility.AdjustBodyToTargetGender(pawn, Gender.Male);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
44
Source/Genes/GeneUtility.cs
Normal file
44
Source/Genes/GeneUtility.cs
Normal file
|
@ -0,0 +1,44 @@
|
|||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class GeneUtility
|
||||
{
|
||||
public static bool IsMechbreeder(Pawn pawn)
|
||||
{
|
||||
if (pawn.genes == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_mechbreeder);
|
||||
}
|
||||
|
||||
public static bool IsInsectIncubator(Pawn pawn)
|
||||
{
|
||||
if (pawn.genes == null)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator);
|
||||
}
|
||||
|
||||
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;
|
||||
if (IsInsectIncubator(pawn))
|
||||
{
|
||||
MaxEggSize *= 2;
|
||||
}
|
||||
return MaxEggSize;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_CanineGenitalia : Gene
|
||||
public class Gene_CanineGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.canine_penis,Genital_Helper.canine_vagina,Genital_Helper.generic_anus);
|
||||
}
|
||||
|
|
|
@ -4,13 +4,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_DemonicGenitalia : Gene
|
||||
public class Gene_DemonicGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.demon_penis,Genital_Helper.demon_vagina,Genital_Helper.demon_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_DragonGenitalia : Gene
|
||||
public class Gene_DragonGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.dragon_penis,Genital_Helper.dragon_vagina,Genital_Helper.generic_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_EquineGenitalia : Gene
|
||||
public class Gene_EquineGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.equine_penis,Genital_Helper.equine_vagina,Genital_Helper.generic_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_FelineGenitalia : Gene
|
||||
public class Gene_FelineGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.feline_penis,Genital_Helper.feline_vagina,Genital_Helper.generic_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_HumanGenitalia : Gene
|
||||
public class Gene_HumanGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.average_penis,Genital_Helper.average_vagina,Genital_Helper.average_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_OvipositorGenitalia : Gene
|
||||
public class Gene_OvipositorGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.ovipositorM,Genital_Helper.ovipositorF,Genital_Helper.insect_anus);
|
||||
}
|
||||
|
|
|
@ -3,13 +3,11 @@ using rjw;
|
|||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SlimeGenitalia : Gene
|
||||
public class Gene_SlimeGenitalia : RJW_Gene
|
||||
{
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
GenitaliaChanger.ChangeGenitalia(this.pawn,Genital_Helper.slime_penis,Genital_Helper.slime_vagina,Genital_Helper.slime_anus);
|
||||
}
|
||||
|
|
|
@ -79,5 +79,14 @@ namespace RJW_Genes
|
|||
return candidate.def.defName.ToLower().Contains("bionic") || candidate.def.defName.ToLower().Contains("archo");
|
||||
}
|
||||
|
||||
public static void RemoveAllGenitalia(Pawn pawn)
|
||||
{
|
||||
var parts = Genital_Helper.get_AllPartsHediffList(pawn);
|
||||
foreach (var part in parts)
|
||||
{
|
||||
pawn.health.RemoveHediff(part);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,12 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigBreasts : Gene
|
||||
public class Gene_BigBreasts : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
if (pawn.gender == Gender.Female)
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn,0.5f,1.0f);
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigMaleGenitalia : Gene
|
||||
public class Gene_BigMaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.5f,1.0f);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseAnus : Gene
|
||||
public class Gene_LooseAnus : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
@ -24,6 +18,5 @@ namespace RJW_Genes
|
|||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseFemaleGenitalia : Gene
|
||||
public class Gene_LooseFemaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
|
|
@ -6,14 +6,12 @@ namespace RJW_Genes
|
|||
/// <summary>
|
||||
/// Dummy Gene that does not alter the genitalia size. Normal RJW Logic and rolled sizes are kept.
|
||||
/// </summary>
|
||||
public class Gene_NormalAnus : Gene
|
||||
public class Gene_NormalAnus : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,19 +1,16 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// Dummy Gene that does not alter the genitalia size. Normal RJW Logic and rolled sizes are kept.
|
||||
/// </summary>
|
||||
public class Gene_NormalBreasts : Gene
|
||||
public class Gene_NormalBreasts : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,14 +6,12 @@ namespace RJW_Genes
|
|||
/// <summary>
|
||||
/// Dummy Gene that does not alter the genitalia size. Normal RJW Logic and rolled sizes are kept.
|
||||
/// </summary>
|
||||
public class Gene_NormalFemaleGenitalia : Gene
|
||||
public class Gene_NormalFemaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1,19 +1,14 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// Dummy Gene that does not alter the genitalia size. Normal RJW Logic and rolled sizes are kept.
|
||||
/// </summary>
|
||||
public class Gene_NormalMaleGenitalia : Gene
|
||||
public class Gene_NormalMaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallBreasts : Gene
|
||||
public class Gene_SmallBreasts : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallMaleGenitalia : Gene
|
||||
public class Gene_SmallMaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.0f,0.5f);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightAnus : Gene
|
||||
public class Gene_TightAnus : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
|
|
@ -1,17 +1,11 @@
|
|||
using Verse;
|
||||
using rjw;
|
||||
using System;
|
||||
|
||||
namespace RJW_Genes
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightFemaleGenitalia : Gene
|
||||
public class Gene_TightFemaleGenitalia : RJW_Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
|
16
Source/Genes/RJW_Gene.cs
Normal file
16
Source/Genes/RJW_Gene.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using rjw;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class RJW_Gene : Gene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (GenitaliaUtility.PawnStillNeedsGenitalia(pawn))
|
||||
Sexualizer.sexualize_pawn(pawn);
|
||||
}
|
||||
}
|
||||
}
|
16
Source/HarmonyInit.cs
Normal file
16
Source/HarmonyInit.cs
Normal file
|
@ -0,0 +1,16 @@
|
|||
using Verse;
|
||||
using HarmonyLib;
|
||||
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
[StaticConstructorOnStartup]
|
||||
internal static class HarmonyInit
|
||||
{
|
||||
static HarmonyInit()
|
||||
{
|
||||
Harmony harmony = new Harmony("rjw_genes");
|
||||
harmony.PatchAll();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -22,6 +22,9 @@
|
|||
<Prefer32Bit>false</Prefer32Bit>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>..\..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Assembly-CSharp">
|
||||
<HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
|
@ -49,6 +52,10 @@
|
|||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="GeneDefOf.cs" />
|
||||
<Compile Include="Genes\Breeding\Gene_MechBreeder.cs" />
|
||||
<Compile Include="Genes\Breeding\PatchMechBirth.cs" />
|
||||
<Compile Include="Genes\Breeding\PatchPawnExtensions.cs" />
|
||||
<Compile Include="Genes\Breeding\PatchPregnancyHelper.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraBreasts.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraAnus.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_Futa.cs" />
|
||||
|
@ -58,6 +65,10 @@
|
|||
<Compile Include="Genes\ExtraGenitalia\Gene_NoVagina.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_NoPenis.cs" />
|
||||
<Compile Include="Genes\ExtraGenitalia\Gene_ExtraPenis.cs" />
|
||||
<Compile Include="Genes\Gender\GenderUtility.cs" />
|
||||
<Compile Include="Genes\Gender\Gene_FemaleOnly.cs" />
|
||||
<Compile Include="Genes\Gender\Gene_MaleOnly.cs" />
|
||||
<Compile Include="Genes\GeneUtility.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_BigBreasts.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_LooseAnus.cs" />
|
||||
<Compile Include="Genes\GenitaliaSize\Gene_LooseFemaleGenitalia.cs" />
|
||||
|
@ -80,7 +91,9 @@
|
|||
<Compile Include="Genes\Genitalia\Gene_EquineGenitalia.cs" />
|
||||
<Compile Include="Genes\Genitalia\Gene_HumanGenitalia.cs" />
|
||||
<Compile Include="Genes\Genitalia\GenitaliaChanger.cs" />
|
||||
<Compile Include="GenitaliaUtility.cs" />
|
||||
<Compile Include="Genes\RJW_Gene.cs" />
|
||||
<Compile Include="Genes\Genitalia\GenitaliaUtility.cs" />
|
||||
<Compile Include="HarmonyInit.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="RJW_Genes.cs" />
|
||||
</ItemGroup>
|
||||
|
|
Loading…
Reference in a new issue