Resizing Genes now trigger on 20th Birthday Earliest, Fixes #11
This commit is contained in:
parent
fd88a13848
commit
4cd77eba50
|
@ -16,6 +16,7 @@ Fixes:
|
|||
- Issue with Breast-Size (#8) fixed by lowercasing breast-match (Shabakur)
|
||||
- Error on Game Load when Licentia Genes are tried to be added to Xenotypes for players without Licentia (#5)
|
||||
- Futa Gene only triggers if Pawn is not a futa already (#2)
|
||||
- Genitalia Resizing triggers on 20th Birthday (#11)
|
||||
|
||||
# 1.0.1 (2022-12-20)
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
|
||||
<GeneCategoryDef>
|
||||
<defName>rjw_genes_special</defName>
|
||||
<label>Genital Related Damage</label>
|
||||
<label>Genital Based Special Abilities</label>
|
||||
<displayPriorityInXenotype>8</displayPriorityInXenotype>
|
||||
</GeneCategoryDef>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_big_male_genitalia</defName>
|
||||
<label>Big Male Genitaliasize</label>
|
||||
<description>Penises of this Xenotype are bigger.</description>
|
||||
<description>Penises of this Xenotype are bigger.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Small_Male_Genitalia</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_BigMaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>751</displayOrderInCategory>
|
||||
|
@ -21,7 +21,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_small_male_genitalia</defName>
|
||||
<label>Small Male Genitaliasize</label>
|
||||
<description>Penises of this Xenotype are smaller.</description>
|
||||
<description>Penises of this Xenotype are smaller. (Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Big_Male_Genitalia</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_SmallMaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>753</displayOrderInCategory>
|
||||
|
@ -34,7 +34,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_loose_female_genitalia</defName>
|
||||
<label>Loose Female Genitalia</label>
|
||||
<description>Vaginas of this Xenotype are quite spacy.</description>
|
||||
<description>Vaginas of this Xenotype are quite spacy. (Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Loose_Female_Genitalia</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_LooseFemaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>754</displayOrderInCategory>
|
||||
|
@ -46,7 +46,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_tight_female_genitalia</defName>
|
||||
<label>Tight Female Genitalia</label>
|
||||
<description>Vaginas of this Xenotype are pretty tight.</description>
|
||||
<description>Vaginas of this Xenotype are pretty tight.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Tight_Female_Genitalia</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_TightFemaleGenitalia</geneClass>
|
||||
<displayOrderInCategory>756</displayOrderInCategory>
|
||||
|
@ -59,7 +59,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_big_breasts</defName>
|
||||
<label>Big Breasts</label>
|
||||
<description>Females of this Xenotype have big honkers.</description>
|
||||
<description>Females of this Xenotype have big honkers.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Big_Breasts</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_BigBreasts</geneClass>
|
||||
<displayOrderInCategory>757</displayOrderInCategory>
|
||||
|
@ -71,7 +71,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_small_breasts</defName>
|
||||
<label>Small Breasts</label>
|
||||
<description>Females of this Xenotype have smaller breasts.</description>
|
||||
<description>Females of this Xenotype have smaller breasts.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Small_Breasts</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_SmallBreasts</geneClass>
|
||||
<displayOrderInCategory>759</displayOrderInCategory>
|
||||
|
@ -84,7 +84,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_loose_anus</defName>
|
||||
<label>Loose Anus</label>
|
||||
<description>The Anus of this Xenotype is roomy.</description>
|
||||
<description>The Anus of this Xenotype is roomy.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Loose_Anus</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_LooseAnus</geneClass>
|
||||
<displayOrderInCategory>760</displayOrderInCategory>
|
||||
|
@ -96,7 +96,7 @@
|
|||
<GeneDef ParentName="GeneGenitaliaSizeBase">
|
||||
<defName>rjw_genes_tight_anus</defName>
|
||||
<label>Tight Anus</label>
|
||||
<description>The anus of this Xenotype is small.</description>
|
||||
<description>The anus of this Xenotype is small.(Resizing takes place at 20th Birthday)</description>
|
||||
<iconPath>Genes/Icons/Tight_Anus</iconPath>
|
||||
<geneClass>RJW_Genes.Gene_TightAnus</geneClass>
|
||||
<displayOrderInCategory>762</displayOrderInCategory>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
|
@ -95,5 +96,25 @@ namespace RJW_Genes
|
|||
return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable);
|
||||
}
|
||||
|
||||
|
||||
public static bool HasGenitaliaResizingGenes(Pawn pawn)
|
||||
{
|
||||
return !GetGenitaliaResizingGenes(pawn).NullOrEmpty();
|
||||
}
|
||||
|
||||
public static List<Gene> GetGenitaliaResizingGenes(Pawn pawn)
|
||||
{
|
||||
var ResizingGenes = new List<Gene>();
|
||||
|
||||
// Error Handling: Issue with Pawn or Genes return empty.
|
||||
if (pawn == null || pawn.genes == null)
|
||||
return ResizingGenes;
|
||||
|
||||
foreach (Gene g in pawn.genes.GenesListForReading)
|
||||
if (g is Gene_GenitaliaResizingGene)
|
||||
ResizingGenes.Add(g);
|
||||
|
||||
return ResizingGenes;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,24 +1,12 @@
|
|||
using Verse;
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigBreasts : RJW_Gene
|
||||
public class Gene_BigBreasts : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
if (pawn.gender == Gender.Female)
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn,0.5f,1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (pawn.gender == Gender.Female)
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_BigMaleGenitalia : RJW_Gene
|
||||
public class Gene_BigMaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.5f,1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// Parent Gene for Genitalia Resizing. All Resizing genes should inherit for this class.
|
||||
///
|
||||
/// This helps with some functions (e.g. "hasGenitaliaResizingGenes(pawn)") but also to fire genitalia resizing later in life for Pawns.
|
||||
/// (No Children with huge ding dongs, and I don't want kids with tight anuses I am not that degenerate)
|
||||
/// </summary>
|
||||
public abstract class Gene_GenitaliaResizingGene : RJW_Gene
|
||||
{
|
||||
|
||||
public const int RESIZING_AGE = 20;
|
||||
public bool WasApplied { get; set; }
|
||||
|
||||
public override void PostMake()
|
||||
{
|
||||
base.PostMake();
|
||||
if (pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE)
|
||||
{
|
||||
Resize();
|
||||
WasApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
if (pawn.ageTracker.AgeBiologicalYears >= RESIZING_AGE)
|
||||
{
|
||||
Resize();
|
||||
WasApplied = true;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used to resize the pawns genitalia.
|
||||
/// All Logic should be put here:
|
||||
/// 1. Filters for Gender
|
||||
/// 2. Filters for Genitalia Existance
|
||||
/// 3. Selection of right Genitalia
|
||||
/// 4. Adjustment of Size
|
||||
///
|
||||
/// I kept it intentionally broad, so that e.g. the Penis Resize can resize multiple penises and also for futas,
|
||||
/// while the breast-gene is female only.
|
||||
/// </summary>
|
||||
public abstract void Resize();
|
||||
|
||||
}
|
||||
}
|
|
@ -1,22 +1,12 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseAnus : RJW_Gene
|
||||
public class Gene_LooseAnus : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_LooseFemaleGenitalia : RJW_Gene
|
||||
public class Gene_LooseFemaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.5f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
namespace RJW_Genes
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallBreasts : RJW_Gene
|
||||
public class Gene_SmallBreasts : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllBreastSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_SmallMaleGenitalia : RJW_Gene
|
||||
public class Gene_SmallMaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn,0.0f,0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllPenisSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,21 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightAnus : RJW_Gene
|
||||
public class Gene_TightAnus : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllAnusSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,20 +1,10 @@
|
|||
namespace RJW_Genes
|
||||
{
|
||||
public class Gene_TightFemaleGenitalia : RJW_Gene
|
||||
public class Gene_TightFemaleGenitalia : Gene_GenitaliaResizingGene
|
||||
{
|
||||
|
||||
public override void PostMake()
|
||||
public override void Resize()
|
||||
{
|
||||
base.PostMake();
|
||||
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
public override void PostAdd()
|
||||
{
|
||||
base.PostAdd();
|
||||
SizeAdjuster.AdjustAllVaginaSizes(pawn, 0.0f, 0.5f);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
using HarmonyLib;
|
||||
using Verse;
|
||||
|
||||
namespace RJW_Genes
|
||||
{
|
||||
/// <summary>
|
||||
/// This Patch adds behavior to all resizing genes:
|
||||
/// At Age RESIZING_MIN_AGE the Pawns Resizing Genes will trigger again, if not already triggered somewhere else.
|
||||
/// This is meant to allow kids to grow up without resized genitals, and resize later (Fixing #11).
|
||||
/// </summary>
|
||||
[HarmonyPatch(typeof(Pawn_AgeTracker), "BirthdayBiological")]
|
||||
public class Patch_ResizingOnAdulthood
|
||||
{
|
||||
|
||||
static void Postfix(Pawn ___pawn, int birthdayAge)
|
||||
{
|
||||
if (birthdayAge >= Gene_GenitaliaResizingGene.RESIZING_AGE)
|
||||
{
|
||||
foreach(Gene_GenitaliaResizingGene gene in GeneUtility.GetGenitaliaResizingGenes(___pawn))
|
||||
{
|
||||
if (!gene.WasApplied)
|
||||
{
|
||||
gene.Resize();
|
||||
gene.WasApplied = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue