2023-01-15 08:18:04 +00:00
|
|
|
|
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).
|
2023-05-10 14:19:45 +00:00
|
|
|
|
///
|
|
|
|
|
/// See `Gene_GenitaliaResizingGene` for a short summary of Issue #34.
|
2023-01-15 08:18:04 +00:00
|
|
|
|
/// </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))
|
|
|
|
|
{
|
2023-05-10 14:19:45 +00:00
|
|
|
|
if (!gene.ResizingWasApplied)
|
2023-01-15 08:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
gene.Resize();
|
2023-05-10 14:19:45 +00:00
|
|
|
|
gene.ResizingWasApplied = true;
|
2023-01-15 08:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|