rjw-genes/1.6/Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
Telanda-DDS dde1c98b18 - Incremented version to 2.5.1
- Removed DDS Files
- Added Initial Support for Rimworld 1.6
- Added Additional mod requirement to PatchBSShared.xml to prevent premature loading.
- Refactored Cumpilation integration to make it optional rather then a Required Mod.
- Disabled succubus tail interactions pending rewrite for RJW's new interactions system.
- Disabled Quirks pending rewrite RJW separating them into their own mod.
2025-07-17 21:07:51 +10:00

32 lines
No EOL
1.1 KiB
C#

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).
///
/// See `Gene_GenitaliaResizingGene` for a short summary of Issue #34.
/// </summary>
[HarmonyPatch(typeof(Pawn_AgeTracker), "BirthdayBiological")]
public class Patch_ResizingOnAdulthood
{
static void Postfix(Pawn ___pawn, int birthdayAge)
{
if (birthdayAge >= RJW_Genes_Settings.rjw_genes_resizing_age)
{
foreach(Gene_GenitaliaResizingGene gene in GeneUtility.GetGenitaliaResizingGenes(___pawn))
{
if (!gene.ResizingWasApplied)
{
gene.Resize();
gene.ResizingWasApplied = true;
}
}
}
}
}
}