mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Resizing Genes now trigger on 20th Birthday Earliest, Fixes #11
This commit is contained in:
parent
fd88a13848
commit
4cd77eba50
14 changed files with 140 additions and 119 deletions
30
Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
Normal file
30
Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
Normal file
|
@ -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…
Add table
Add a link
Reference in a new issue