diff --git a/CHANGELOG.md b/CHANGELOG.md
index 22ede1f..28a4e46 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,6 +6,7 @@ Features:
- Orgasm Rush got a Hediff
- Unbreakable Gene
- Age-Transfer and Youth-Fountain per Sex Gene
+- Bisexual and Homosexual Genes with Placeholder Icon
- Balancing some Genes by changing metabolism and complexity
Succubus:
@@ -14,6 +15,8 @@ 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)
diff --git a/Common/Defs/Genes/GeneCategories.xml b/Common/Defs/Genes/GeneCategories.xml
index ab92117..81208b9 100644
--- a/Common/Defs/Genes/GeneCategories.xml
+++ b/Common/Defs/Genes/GeneCategories.xml
@@ -57,7 +57,7 @@
rjw_genes_special
-
+
8
diff --git a/Common/Defs/Genes/GeneDefs_GenitaliaSizes.xml b/Common/Defs/Genes/GeneDefs_GenitaliaSizes.xml
index 89bc7f9..cc26c04 100644
--- a/Common/Defs/Genes/GeneDefs_GenitaliaSizes.xml
+++ b/Common/Defs/Genes/GeneDefs_GenitaliaSizes.xml
@@ -9,7 +9,7 @@
rjw_genes_big_male_genitalia
- Penises of this Xenotype are bigger.
+ Penises of this Xenotype are bigger.(Resizing takes place at 20th Birthday)Genes/Icons/Small_Male_GenitaliaRJW_Genes.Gene_BigMaleGenitalia751
@@ -21,7 +21,7 @@
rjw_genes_small_male_genitalia
- Penises of this Xenotype are smaller.
+ Penises of this Xenotype are smaller. (Resizing takes place at 20th Birthday)Genes/Icons/Big_Male_GenitaliaRJW_Genes.Gene_SmallMaleGenitalia753
@@ -34,7 +34,7 @@
rjw_genes_loose_female_genitalia
- Vaginas of this Xenotype are quite spacy.
+ Vaginas of this Xenotype are quite spacy. (Resizing takes place at 20th Birthday)Genes/Icons/Loose_Female_GenitaliaRJW_Genes.Gene_LooseFemaleGenitalia754
@@ -46,7 +46,7 @@
rjw_genes_tight_female_genitalia
- Vaginas of this Xenotype are pretty tight.
+ Vaginas of this Xenotype are pretty tight.(Resizing takes place at 20th Birthday)Genes/Icons/Tight_Female_GenitaliaRJW_Genes.Gene_TightFemaleGenitalia756
@@ -59,7 +59,7 @@
rjw_genes_big_breasts
- Females of this Xenotype have big honkers.
+ Females of this Xenotype have big honkers.(Resizing takes place at 20th Birthday)Genes/Icons/Big_BreastsRJW_Genes.Gene_BigBreasts757
@@ -71,7 +71,7 @@
rjw_genes_small_breasts
- Females of this Xenotype have smaller breasts.
+ Females of this Xenotype have smaller breasts.(Resizing takes place at 20th Birthday)Genes/Icons/Small_BreastsRJW_Genes.Gene_SmallBreasts759
@@ -84,7 +84,7 @@
rjw_genes_loose_anus
- The Anus of this Xenotype is roomy.
+ The Anus of this Xenotype is roomy.(Resizing takes place at 20th Birthday)Genes/Icons/Loose_AnusRJW_Genes.Gene_LooseAnus760
@@ -96,7 +96,7 @@
rjw_genes_tight_anus
- The anus of this Xenotype is small.
+ The anus of this Xenotype is small.(Resizing takes place at 20th Birthday)Genes/Icons/Tight_AnusRJW_Genes.Gene_TightAnus762
diff --git a/Common/Defs/Genes/GeneDefs_Reproduction.xml b/Common/Defs/Genes/GeneDefs_Reproduction.xml
index 614bb38..97fb937 100644
--- a/Common/Defs/Genes/GeneDefs_Reproduction.xml
+++ b/Common/Defs/Genes/GeneDefs_Reproduction.xml
@@ -29,4 +29,41 @@
+
+
+ rjw_genes_homosexual
+
+ Reproduction
+ This Gene makes you gay.
+ UI\Ideoligions\Universal\RoundC
+ 0
+ 3
+
+
+ Gay
+
+
+
+
rjw_genes_sexual_orientation
+
+
+
+
+ rjw_genes_bisexual
+
+ Reproduction
+ Carriers of this Gene are Bisexual.
+ UI\Ideoligions\Universal\RoundC
+ 0
+ 4
+
+
+ Bisexual
+
+
+
+
rjw_genes_sexual_orientation
+
+
+
\ No newline at end of file
diff --git a/Source/Animal_Inheritance/RaceGeneDef_Helper.cs b/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
index 680b155..3db664c 100644
--- a/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
+++ b/Source/Animal_Inheritance/RaceGeneDef_Helper.cs
@@ -1,11 +1,8 @@
-using System;
+using rjw;
+using System;
using System.Collections.Generic;
using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using rjw;
using Verse;
-using RimWorld;
namespace RJW_BGS
{
@@ -44,6 +41,7 @@ namespace RJW_BGS
}).ToList();
if (pawnKindDefs.Count() > 0)
return pawnKindDefs;
+
List raceKindDefs = allDefs.Where(delegate (RaceGeneDef group)
{
List raceNames = group.raceNames;
@@ -51,6 +49,7 @@ namespace RJW_BGS
}).ToList();
if (raceKindDefs.Count() > 0)
return raceKindDefs;
+
List raceGroupDefs = new List();
if (raceGroupDef != null)
{
@@ -60,8 +59,10 @@ namespace RJW_BGS
return raceGroupDefName != null && raceGroupDefName == raceGroupDef.defName;
}).ToList();
}
+
if (raceGroupDefs.Count() > 0)
return raceGroupDefs;
+
return new List();
}
}
diff --git a/Source/Common/ModLog.cs b/Source/Common/ModLog.cs
new file mode 100644
index 0000000..407520a
--- /dev/null
+++ b/Source/Common/ModLog.cs
@@ -0,0 +1,34 @@
+using Verse;
+
+namespace RJW_Genes
+{
+ internal class ModLog
+ {
+ public static string ModId => "RJW-Genes";
+
+ ///
+ /// Logs the given message with [SaveStorage.ModId] appended.
+ ///
+ public static void Error(string message)
+ {
+ Log.Error($"[{ModId}] {message}");
+ }
+
+ ///
+ /// Logs the given message with [SaveStorage.ModId] appended.
+ ///
+ public static void Message(string message)
+ {
+ Log.Message($"[{ModId}] {message}");
+ }
+
+ ///
+ /// Logs the given message with [SaveStorage.ModId] appended.
+ ///
+ public static void Warning(string message)
+ {
+ Log.Warning($"[{ModId}] {message}");
+ }
+
+ }
+}
diff --git a/Source/GeneDefOf.cs b/Source/GeneDefOf.cs
index d2130af..6b13cfb 100644
--- a/Source/GeneDefOf.cs
+++ b/Source/GeneDefOf.cs
@@ -51,6 +51,7 @@ namespace RJW_Genes
public static readonly GeneDef rjw_genes_mechbreeder;
public static readonly GeneDef rjw_genes_insectincubator;
public static readonly GeneDef rjw_genes_insectbreeder;
+ public static readonly GeneDef rjw_genes_zoophile;
// Cum
public static readonly GeneDef rjw_genes_no_cum;
@@ -63,7 +64,8 @@ namespace RJW_Genes
// Reproduction
public static readonly GeneDef rjw_genes_hypersexual;
public static readonly GeneDef rjw_genes_rapist;
- public static readonly GeneDef rjw_genes_zoophile;
+ public static readonly GeneDef rjw_genes_homosexual;
+ public static readonly GeneDef rjw_genes_bisexual;
// Damage & Side Effects
[MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity;
diff --git a/Source/Genes/ExtraGenitalia/Gene_Futa.cs b/Source/Genes/ExtraGenitalia/Gene_Futa.cs
index 2d9f367..812f381 100644
--- a/Source/Genes/ExtraGenitalia/Gene_Futa.cs
+++ b/Source/Genes/ExtraGenitalia/Gene_Futa.cs
@@ -13,6 +13,12 @@ namespace RJW_Genes
{
base.PostMake();
+ // If the Pawn is already a Futa, do not do anything. Can Happen by Base-RJW Spawn Chance or potentially races / other mods.
+ if (IsAlreadyFuta(pawn))
+ {
+ return;
+ }
+
if (GenderUtility.IsFemale(pawn) && additional_genital == null)
{
createAndAddPenis();
@@ -27,6 +33,12 @@ namespace RJW_Genes
{
base.PostAdd();
+ // If the Pawn is already a Futa, do not do anything. Can Happen by Base-RJW Spawn Chance or potentially races / other mods.
+ if (IsAlreadyFuta(pawn))
+ {
+ return;
+ }
+
if (pawn.gender == Gender.Female && additional_genital == null)
{
createAndAddPenis();
@@ -79,5 +91,15 @@ namespace RJW_Genes
pawn.health.AddHediff(additional_genital, partBPR);
}
+ private static bool IsAlreadyFuta(Pawn pawn)
+ {
+ if (pawn == null)
+ return false;
+ if (!Genital_Helper.has_genitals(pawn))
+ return false;
+ return
+ (Genital_Helper.has_penis_fertile(pawn) || Genital_Helper.has_penis_infertile(pawn))
+ && Genital_Helper.has_vagina(pawn) ;
+ }
}
}
diff --git a/Source/Genes/GeneUtility.cs b/Source/Genes/GeneUtility.cs
index 07a5c24..284aab2 100644
--- a/Source/Genes/GeneUtility.cs
+++ b/Source/Genes/GeneUtility.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using Verse;
namespace RJW_Genes
@@ -32,7 +33,7 @@ namespace RJW_Genes
return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain);
}
- internal static bool IsAgeDrainer(Pawn pawn)
+ public static bool IsAgeDrainer(Pawn pawn)
{
if (pawn.genes == null)
{
@@ -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 GetGenitaliaResizingGenes(Pawn pawn)
+ {
+ var ResizingGenes = new List();
+
+ // Error Handling: Issue with Pawn or Genes return empty.
+ if (pawn == null || pawn.genes == null)
+ return ResizingGenes;
+
+ foreach (Gene gene in pawn.genes.GenesListForReading)
+ if (gene is Gene_GenitaliaResizingGene resizing_gene)
+ ResizingGenes.Add(resizing_gene);
+
+ return ResizingGenes;
+ }
}
}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_BigBreasts.cs b/Source/Genes/GenitaliaSize/Gene_BigBreasts.cs
index b0e61ad..b1c6e4f 100644
--- a/Source/Genes/GenitaliaSize/Gene_BigBreasts.cs
+++ b/Source/Genes/GenitaliaSize/Gene_BigBreasts.cs
@@ -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);
}
-
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_BigMaleGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_BigMaleGenitalia.cs
index b04df46..8cee1ef 100644
--- a/Source/Genes/GenitaliaSize/Gene_BigMaleGenitalia.cs
+++ b/Source/Genes/GenitaliaSize/Gene_BigMaleGenitalia.cs
@@ -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);
}
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_GenitaliaResizingGene.cs b/Source/Genes/GenitaliaSize/Gene_GenitaliaResizingGene.cs
new file mode 100644
index 0000000..ee24126
--- /dev/null
+++ b/Source/Genes/GenitaliaSize/Gene_GenitaliaResizingGene.cs
@@ -0,0 +1,49 @@
+namespace RJW_Genes
+{
+ ///
+ /// 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)
+ ///
+ 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;
+ }
+ }
+
+ ///
+ /// 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.
+ ///
+ public abstract void Resize();
+
+ }
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_LooseAnus.cs b/Source/Genes/GenitaliaSize/Gene_LooseAnus.cs
index f5a5312..520eb5a 100644
--- a/Source/Genes/GenitaliaSize/Gene_LooseAnus.cs
+++ b/Source/Genes/GenitaliaSize/Gene_LooseAnus.cs
@@ -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);
- }
-
-
-
}
}
diff --git a/Source/Genes/GenitaliaSize/Gene_LooseFemaleGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_LooseFemaleGenitalia.cs
index 68578b6..2885c07 100644
--- a/Source/Genes/GenitaliaSize/Gene_LooseFemaleGenitalia.cs
+++ b/Source/Genes/GenitaliaSize/Gene_LooseFemaleGenitalia.cs
@@ -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);
- }
-
-
-
}
}
diff --git a/Source/Genes/GenitaliaSize/Gene_SmallBreasts.cs b/Source/Genes/GenitaliaSize/Gene_SmallBreasts.cs
index d5b4a4e..2e8af43 100644
--- a/Source/Genes/GenitaliaSize/Gene_SmallBreasts.cs
+++ b/Source/Genes/GenitaliaSize/Gene_SmallBreasts.cs
@@ -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);
}
}
diff --git a/Source/Genes/GenitaliaSize/Gene_SmallMaleGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_SmallMaleGenitalia.cs
index 12ba154..ce5d33a 100644
--- a/Source/Genes/GenitaliaSize/Gene_SmallMaleGenitalia.cs
+++ b/Source/Genes/GenitaliaSize/Gene_SmallMaleGenitalia.cs
@@ -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);
}
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_TightAnus.cs b/Source/Genes/GenitaliaSize/Gene_TightAnus.cs
index 56f52cd..443aba7 100644
--- a/Source/Genes/GenitaliaSize/Gene_TightAnus.cs
+++ b/Source/Genes/GenitaliaSize/Gene_TightAnus.cs
@@ -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);
- }
-
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Gene_TightFemaleGenitalia.cs b/Source/Genes/GenitaliaSize/Gene_TightFemaleGenitalia.cs
index 53ec2a7..306635d 100644
--- a/Source/Genes/GenitaliaSize/Gene_TightFemaleGenitalia.cs
+++ b/Source/Genes/GenitaliaSize/Gene_TightFemaleGenitalia.cs
@@ -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);
- }
-
}
-}
+}
\ No newline at end of file
diff --git a/Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs b/Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
new file mode 100644
index 0000000..b8542a0
--- /dev/null
+++ b/Source/Genes/GenitaliaSize/Patch_ResizingOnAdulthood.cs
@@ -0,0 +1,30 @@
+using HarmonyLib;
+using Verse;
+
+namespace RJW_Genes
+{
+ ///
+ /// 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).
+ ///
+ [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;
+ }
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Source/Genes/Special/Patch_AgeDrain.cs b/Source/Genes/Special/Patch_AgeDrain.cs
index 981f483..2c7e55d 100644
--- a/Source/Genes/Special/Patch_AgeDrain.cs
+++ b/Source/Genes/Special/Patch_AgeDrain.cs
@@ -13,9 +13,11 @@ namespace RJW_Genes.Genes.Special
{
const long AGE_TRANSFERED = 120000; // 120k == 2 days
+ // 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
+ const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
// Comment Below in for debugging, changes years
- // const long AGE_TRANSFERED = 6000000; // 6000k == 100 days
+ // const long AGE_TRANSFERED = 12000000;
public static void Postfix(SexProps props)
{
if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal() )
@@ -25,12 +27,12 @@ namespace RJW_Genes.Genes.Special
if (GeneUtility.IsAgeDrainer(props.pawn))
{
var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks;
- var pawnMinAge = props.pawn.ageTracker.AdultMinAgeTicks;
+ //ModLog.Error($"Firing Age Drain \nMinimum Age is \t{MINIMUM_AGE} \nPawn Age is \t{pawnAge} \nTransferred \t{AGE_TRANSFERED}\nResulting in \t{pawnAge - AGE_TRANSFERED}");
// Make Partner older
props.partner.ageTracker.AgeBiologicalTicks += AGE_TRANSFERED;
// Make Pawn younger
- props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(pawnMinAge, pawnAge - AGE_TRANSFERED);
+ props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(MINIMUM_AGE, (pawnAge - AGE_TRANSFERED));
}
}
diff --git a/Source/Genes/Special/Patch_Youth_Fountain.cs b/Source/Genes/Special/Patch_Youth_Fountain.cs
index f2c7e13..a1a1840 100644
--- a/Source/Genes/Special/Patch_Youth_Fountain.cs
+++ b/Source/Genes/Special/Patch_Youth_Fountain.cs
@@ -13,9 +13,11 @@ namespace RJW_Genes.Genes.Special
{
const long AGE_REDUCTION = 60000; // 60k == 1 day
+ // 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
+ const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
// Comment Below in for debugging
- //const long AGE_REDUCTION = 6000000; // 6000k == 100 days
+ // const long AGE_REDUCTION = 6000000; // 6000k == 100 days
public static void Postfix(SexProps props)
{
if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal())
@@ -25,12 +27,18 @@ namespace RJW_Genes.Genes.Special
if (GeneUtility.IsYouthFountain(props.pawn))
{
var partnerAge = props.partner.ageTracker.AgeBiologicalTicks;
- var minAge = props.partner.ageTracker.AdultMinAgeTicks;
- props.partner.ageTracker.AgeBiologicalTicks = Math.Max(minAge, partnerAge - AGE_REDUCTION);
+ //ModLog.Error($"Firing Youth Fountain \nMinimum Age is \t{MINIMUM_AGE}\t{ticksToYears(MINIMUM_AGE)}y\nPawn Age is \t{partnerAge}\t{ticksToYears(partnerAge)}y \nTransferred \t {AGE_REDUCTION}\t{ticksToYears(AGE_REDUCTION)}y\nResulting in \t{partnerAge - AGE_REDUCTION}\t{ticksToYears(partnerAge - AGE_REDUCTION)}y");
+
+ props.partner.ageTracker.AgeBiologicalTicks = Math.Max(MINIMUM_AGE, partnerAge - AGE_REDUCTION);
}
}
+ private static float ticksToYears(long ticks)
+ {
+ return (ticks / 60000f) / 60f;
+ }
}
+
}