mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Adjusted Age-Drain and Youth Fountain after short discussion in #26
This commit is contained in:
parent
b6ac823fd7
commit
f994cc6283
3 changed files with 24 additions and 9 deletions
Binary file not shown.
|
@ -11,12 +11,20 @@ namespace RJW_Genes.Genes.Special
|
||||||
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
|
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
|
||||||
public static class Patch_AgeDrain
|
public static class Patch_AgeDrain
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Update Issue #26:
|
||||||
|
* There are options that a 16 yo pawn and a 16 yo pawn have sex,
|
||||||
|
* or there are races that have a different age-limits.
|
||||||
|
* I don't want to account for "trust me this race is really adult with Age 6!!!"-stuff.
|
||||||
|
* As it is somewhat a bug when the pawns age tho, I added that the youth-fountain also needs to have MIN_AGE.
|
||||||
|
* If you'd like a different behaviour, you have to do it yourself.
|
||||||
|
*/
|
||||||
|
|
||||||
const long AGE_TRANSFERED = 120000; // 120k == 2 days
|
const long AGE_TRANSFERED = 120000; // 120k == 2 days
|
||||||
// 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
// 18 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
||||||
const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
|
const long MINIMUM_AGE = 18 * 60 * 60000 + 1;
|
||||||
|
|
||||||
// Comment Below in for debugging, changes years
|
// Comment AGE_TRANSFERED in for debugging, changes years
|
||||||
// const long AGE_TRANSFERED = 12000000;
|
// const long AGE_TRANSFERED = 12000000;
|
||||||
public static void Postfix(SexProps props)
|
public static void Postfix(SexProps props)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +32,7 @@ namespace RJW_Genes.Genes.Special
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GeneUtility.IsAgeDrainer(props.pawn))
|
if (GeneUtility.IsAgeDrainer(props.pawn) && props.pawn.ageTracker.AgeBiologicalTicks > MINIMUM_AGE)
|
||||||
{
|
{
|
||||||
var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks;
|
var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks;
|
||||||
//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}");
|
//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}");
|
||||||
|
|
|
@ -11,10 +11,19 @@ namespace RJW_Genes.Genes.Special
|
||||||
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
|
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
|
||||||
public static class Patch_Youth_Fountain
|
public static class Patch_Youth_Fountain
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* Update Issue #26:
|
||||||
|
* There are options that a 16 yo pawn and a 16 yo pawn have sex,
|
||||||
|
* or there are races that have a different age-limits.
|
||||||
|
* I don't want to account for "trust me this race is really adult with Age 6!!!"-stuff.
|
||||||
|
* As it is somewhat a bug when the pawns age tho, I added that the youth-fountain also needs to have MIN_AGE.
|
||||||
|
* If you'd like a different behaviour, you have to do it yourself.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
const long AGE_REDUCTION = 60000; // 60k == 1 day
|
const long AGE_REDUCTION = 60000; // 60k == 1 day
|
||||||
// 20 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
// 18 Years * 60 Days / Year * 60k Ticks/Day + 1 for safety
|
||||||
const long MINIMUM_AGE = 20 * 60 * 60000 + 1;
|
const long MINIMUM_AGE = 18 * 60 * 60000 + 1;
|
||||||
|
|
||||||
// Comment Below in for debugging
|
// Comment Below in for debugging
|
||||||
// const long AGE_REDUCTION = 6000000; // 6000k == 100 days
|
// const long AGE_REDUCTION = 6000000; // 6000k == 100 days
|
||||||
|
@ -24,12 +33,10 @@ namespace RJW_Genes.Genes.Special
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (GeneUtility.IsYouthFountain(props.pawn))
|
if (GeneUtility.IsYouthFountain(props.pawn) && props.pawn.ageTracker.AgeBiologicalTicks >= MINIMUM_AGE)
|
||||||
{
|
{
|
||||||
var partnerAge = props.partner.ageTracker.AgeBiologicalTicks;
|
var partnerAge = props.partner.ageTracker.AgeBiologicalTicks;
|
||||||
|
|
||||||
//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);
|
props.partner.ageTracker.AgeBiologicalTicks = Math.Max(MINIMUM_AGE, partnerAge - AGE_REDUCTION);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue