2023-05-10 14:19:45 +00:00
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Genes
|
2023-01-15 08:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Parent Gene for Genitalia Resizing. All Resizing genes should inherit for this class.
|
2023-05-10 14:19:45 +00:00
|
|
|
|
/// There is a companion-patch `Patch_ResizingOnAdulthood`.
|
2023-01-15 08:18:04 +00:00
|
|
|
|
///
|
|
|
|
|
/// 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)
|
2023-05-10 14:19:45 +00:00
|
|
|
|
///
|
|
|
|
|
///
|
|
|
|
|
/// There was an Issue (#34) that re-sized the genitalia over multiple birthdays.
|
|
|
|
|
/// Before the addition of `ExposeData`, it lost track whether the resizing was already run,
|
|
|
|
|
/// leading to a change with every birthday over multiple game starts.
|
2023-01-15 08:18:04 +00:00
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract class Gene_GenitaliaResizingGene : RJW_Gene
|
|
|
|
|
{
|
|
|
|
|
|
2024-05-28 10:16:10 +00:00
|
|
|
|
|
2023-05-10 14:19:45 +00:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Whether or not the gene was already applied.
|
|
|
|
|
/// If not, it is checked on every birthday and will be applied accordingly.
|
|
|
|
|
/// </summary>
|
|
|
|
|
private bool resizingWasApplied = false;
|
|
|
|
|
public bool ResizingWasApplied { get => resizingWasApplied; set => resizingWasApplied = value; }
|
|
|
|
|
|
2023-01-15 08:18:04 +00:00
|
|
|
|
|
|
|
|
|
public override void PostMake()
|
|
|
|
|
{
|
|
|
|
|
base.PostMake();
|
2024-05-28 10:16:10 +00:00
|
|
|
|
if (pawn.ageTracker.AgeBiologicalYears >= RJW_Genes_Settings.rjw_genes_resizing_age)
|
2023-01-15 08:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
Resize();
|
2023-05-10 14:19:45 +00:00
|
|
|
|
ResizingWasApplied = true;
|
2023-01-15 08:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override void PostAdd()
|
|
|
|
|
{
|
|
|
|
|
base.PostAdd();
|
2024-05-28 10:16:10 +00:00
|
|
|
|
if (pawn.ageTracker.AgeBiologicalYears >= RJW_Genes_Settings.rjw_genes_resizing_age)
|
2023-01-15 08:18:04 +00:00
|
|
|
|
{
|
|
|
|
|
Resize();
|
2023-05-10 14:19:45 +00:00
|
|
|
|
ResizingWasApplied = true;
|
2023-01-15 08:18:04 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2023-05-10 14:19:45 +00:00
|
|
|
|
public override void ExposeData()
|
|
|
|
|
{
|
|
|
|
|
base.ExposeData();
|
|
|
|
|
Scribe_Values.Look(ref resizingWasApplied, "wasApplied");
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-15 08:18:04 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Used to resize the pawns genitalia.
|
|
|
|
|
/// All Logic should be put here:
|
|
|
|
|
/// 1. Filters for Gender
|
2023-05-10 14:19:45 +00:00
|
|
|
|
/// 2. Filters for Genitalia Existence
|
2023-01-15 08:18:04 +00:00
|
|
|
|
/// 3. Selection of right Genitalia
|
|
|
|
|
/// 4. Adjustment of Size
|
|
|
|
|
///
|
2023-05-10 14:19:45 +00:00
|
|
|
|
/// I kept it intentionally broad, so that e.g. the Penis Resize can resize multiple penises and or futas,
|
2023-01-15 08:18:04 +00:00
|
|
|
|
/// while the breast-gene is female only.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public abstract void Resize();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|