Merge branch 'dev' into dev

This commit is contained in:
Shabakur 2023-01-08 14:12:58 +01:00 committed by GitHub
commit 6f2c4dc374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 444 additions and 77 deletions

View file

@ -1,3 +1,20 @@
# 1.1.0 (2023-xx-xx)
Features:
- Succubus (see below)
- Orgasm Rush got a Hediff
- Unbreakable Gene
- Age-Transfer and Youth-Fountain per Sex Gene
- Balancing some Genes by changing metabolism and complexity
Succubus:
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)
# 1.0.1 (2022-12-20) # 1.0.1 (2022-12-20)
- Fix issue with Orgasm Rush throwing an Error on Animal Orgasm (Thanks Shabakur) - Fix issue with Orgasm Rush throwing an Error on Animal Orgasm (Thanks Shabakur)

View file

@ -8,7 +8,9 @@
<description>Pawns with this gene are able to birth mechanoids unharmed.</description> <description>Pawns with this gene are able to birth mechanoids unharmed.</description>
<iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath> <iconPath>World/WorldObjects/Expanding/Mechanoids</iconPath>
<displayOrderInCategory>51</displayOrderInCategory> <displayOrderInCategory>51</displayOrderInCategory>
<displayCategory>rjw_genes_breeding</displayCategory> <displayCategory>rjw_genes_breeding</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef> </GeneDef>
<GeneDef> <GeneDef>
@ -17,7 +19,9 @@
<description>Pawns with this gene are able to hold more insect eggs.</description> <description>Pawns with this gene are able to hold more insect eggs.</description>
<iconPath>Genes/Icons/More_Egg_Space</iconPath> <iconPath>Genes/Icons/More_Egg_Space</iconPath>
<displayOrderInCategory>52</displayOrderInCategory> <displayOrderInCategory>52</displayOrderInCategory>
<displayCategory>rjw_genes_breeding</displayCategory> <displayCategory>rjw_genes_breeding</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef> </GeneDef>
<GeneDef> <GeneDef>
@ -27,6 +31,8 @@
<iconPath>World/WorldObjects/Expanding/Insects</iconPath> <iconPath>World/WorldObjects/Expanding/Insects</iconPath>
<displayOrderInCategory>53</displayOrderInCategory> <displayOrderInCategory>53</displayOrderInCategory>
<displayCategory>rjw_genes_breeding</displayCategory> <displayCategory>rjw_genes_breeding</displayCategory>
<biostatCpx>1</biostatCpx>
<biostatMet>-1</biostatMet>
</GeneDef> </GeneDef>
<GeneDef> <GeneDef>

View file

@ -8,7 +8,25 @@
<description>This Xenotype cannot get stretched by huge penetrators.</description> <description>This Xenotype cannot get stretched by huge penetrators.</description>
<iconPath>Genes/Icons/Elasticity</iconPath> <iconPath>Genes/Icons/Elasticity</iconPath>
<geneClass>RJW_Genes.Gene_Elasticity</geneClass> <geneClass>RJW_Genes.Gene_Elasticity</geneClass>
<biostatMet>-1</biostatMet>
<biostatCpx>1</biostatCpx>
<displayOrderInCategory>1</displayOrderInCategory> <displayOrderInCategory>1</displayOrderInCategory>
</GeneDef> </GeneDef>
<GeneDef >
<defName>rjw_genes_unbreakable</defName>
<label>Unbreakable</label>
<displayCategory>rjw_genes_damage</displayCategory>
<description>This Gene makes the Carrier unable to get mood or social penalties from being raped and they cannot be broken for a long period of time.</description>
<iconPath>UI/Icons/Rituals/TrialDefend</iconPath>
<displayOrderInCategory>2</displayOrderInCategory>
<biostatMet>-1</biostatMet>
<biostatCpx>1</biostatCpx>
<!-- Note: This Gene is mostly handled by patching XMLs -->
<geneClass>RJW_Genes.Gene_Unbreakable</geneClass>
<hediffGiversCannotGive>
<li>FeelingBroken</li>
</hediffGiversCannotGive>
</GeneDef>
</Defs> </Defs>

View file

@ -21,6 +21,7 @@
<displayCategory>Reproduction</displayCategory> <displayCategory>Reproduction</displayCategory>
<description>Xenotypes with this Gene are Rapists.</description> <description>Xenotypes with this Gene are Rapists.</description>
<iconPath>Genes/Icons/Rape</iconPath> <iconPath>Genes/Icons/Rape</iconPath>
<biostatMet>1</biostatMet>
<displayOrderInCategory>2</displayOrderInCategory> <displayOrderInCategory>2</displayOrderInCategory>
<forcedTraits> <forcedTraits>
<li> <li>

View file

@ -6,6 +6,7 @@
<displayCategory>rjw_genes_special</displayCategory> <displayCategory>rjw_genes_special</displayCategory>
<description>On Orgasm, carriers of this gene get a boost in activity. (rest-need is partially filled)</description> <description>On Orgasm, carriers of this gene get a boost in activity. (rest-need is partially filled)</description>
<biostatCpx>1</biostatCpx> <biostatCpx>1</biostatCpx>
<biostatMet>-2</biostatMet>
<iconPath>UI/Memes/FleshPurity</iconPath> <iconPath>UI/Memes/FleshPurity</iconPath>
<displayOrderInCategory>1</displayOrderInCategory> <displayOrderInCategory>1</displayOrderInCategory>
</GeneDef> </GeneDef>
@ -14,11 +15,34 @@
<defName>rjw_genes_aphrodisiac_pheromones</defName> <defName>rjw_genes_aphrodisiac_pheromones</defName>
<label>Aphrodisiac Pheromones</label> <label>Aphrodisiac Pheromones</label>
<displayCategory>rjw_genes_special</displayCategory> <displayCategory>rjw_genes_special</displayCategory>
<geneClass>RJW_Genes.Gene_Aphrodisiac_Pheromones</geneClass> <geneClass>RJW_Genes.Gene_Aphrodisiac_Pheromones</geneClass>
<description>Carriers of this gene create an aphrodisiac pheremones which induce an increased sexdrive to others nearby, increasing in strength as the sexdrive of the carrier increases.\n\nCarriers are unaffected by others with this gene.</description> <description>Carriers of this gene create an aphrodisiac pheremones which induce an increased sexdrive to others nearby, increasing in strength as the sexdrive of the carrier increases.\n\nCarriers are unaffected by others with this gene.</description>
<iconPath>Things/Mote/Heart</iconPath> <iconPath>Things/Mote/Heart</iconPath>
<displayOrderInCategory>2</displayOrderInCategory> <displayOrderInCategory>2</displayOrderInCategory>
<biostatCpx>1</biostatCpx> <biostatCpx>1</biostatCpx>
<biostatMet>1</biostatMet> <biostatMet>1</biostatMet>
</GeneDef>
<GeneDef>
<defName>rjw_genes_youth_fountain</defName>
<label>Youth Fountain</label>
<displayCategory>rjw_genes_special</displayCategory>
<description>Having sex with a carrier of this gene makes the partner slightly younger. (Partner stays adult)</description>
<biostatCpx>2</biostatCpx>
<biostatMet>-2</biostatMet>
<iconPath>UI/Ideoligions/FireLeaves</iconPath>
<displayOrderInCategory>2</displayOrderInCategory>
</GeneDef>
<GeneDef>
<defName>rjw_genes_sex_age_drain</defName>
<label>Sexual Age Drain</label>
<displayCategory>rjw_genes_special</displayCategory>
<description>Having sex transfers some of the partners life-time to themselves. (Pawn stays adult)</description>
<biostatCpx>2</biostatCpx>
<biostatMet>-1</biostatMet>
<iconPath>UI/Icons/ColonistBar/Idle</iconPath>
<displayOrderInCategory>3</displayOrderInCategory>
</GeneDef> </GeneDef>
</Defs> </Defs>

View file

@ -0,0 +1,78 @@
<?xml version="1.0" encoding="utf-8" ?>
<Defs>
<HediffDef>
<defName>rjw_genes_orgasm_rush_hediff</defName>
<hediffClass>HediffWithComps</hediffClass>
<label>Orgasm Rush</label>
<description>Xenotypes with this Gene are pushed beyond normal limits when they have an orgasm.</description>
<defaultLabelColor>(240,200,110)</defaultLabelColor>
<scenarioCanAdd>false</scenarioCanAdd>
<maxSeverity>1.0</maxSeverity>
<isBad>false</isBad>
<tendable>false</tendable>
<comps>
<li Class="HediffCompProperties_SeverityPerDay">
<severityPerDay>-0.75</severityPerDay>
</li>
</comps>
<stages>
<li>
<label>pumped</label>
<statOffsets>
<MeleeDodgeChance>4</MeleeDodgeChance>
<ShootingAccuracyPawn>4</ShootingAccuracyPawn>
</statOffsets>
<capMods>
<li>
<capacity>Consciousness</capacity>
<offset>0.05</offset>
</li>
</capMods>
</li>
<li>
<label>charged</label>
<minSeverity>0.4</minSeverity>
<statOffsets>
<MeleeDodgeChance>8</MeleeDodgeChance>
<ShootingAccuracyPawn>8</ShootingAccuracyPawn>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>0.08</offset>
</li>
<li>
<capacity>Consciousness</capacity>
<offset>0.08</offset>
</li>
</capMods>
</li>
<li>
<label>super-charged</label>
<minSeverity>0.7</minSeverity>
<statOffsets>
<MeleeDodgeChance>10</MeleeDodgeChance>
<ShootingAccuracyPawn>10</ShootingAccuracyPawn>
</statOffsets>
<capMods>
<li>
<capacity>Moving</capacity>
<offset>0.1</offset>
</li>
<li>
<capacity>Consciousness</capacity>
<offset>0.1</offset>
</li>
<li>
<capacity>BloodPumping</capacity>
<offset>0.1</offset>
</li>
</capMods>
</li>
</stages>
</HediffDef>
</Defs>

View file

@ -0,0 +1,68 @@
<?xml version="1.0" encoding="utf-8" ?>
<Patch>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="FeelingBroken"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="GotRaped"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="GotAnalRaped"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="GotAnalRapedByFemale"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="GotRapedUnconscious"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="HateMyRapist"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/ThoughtDef[defName="AllowedMeToGetRaped"]</xpath>
<value>
<nullifyingGenes>
<li>rjw_genes_unbreakable</li>
</nullifyingGenes>
</value>
</Operation>
</Patch>

View file

@ -1,44 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<Patch> <Patch>
<!--TODO: The Baseline does not show up with human genitalia? -->
<!--
<Operation Class="PatchOperationAdd">
<xpath>Defs/XenotypeDef[defName="Baseline"]</xpath>
<value>
<genes>
<li>rjw_genes_human_genitalia</li>
<li>rjw_genes_normal_anus</li>
<li>rjw_genes_normal_breasts</li>
<li>rjw_genes_normal_male_genitalia</li>
<li>rjw_genes_normal_female_genitalia</li>
</genes>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/XenotypeDef[defName="Dirtmole"]/genes</xpath>
<value>
<li>rjw_genes_human_genitalia</li>
<li>rjw_genes_normal_anus</li>
<li>rjw_genes_normal_breasts</li>
<li>rjw_genes_normal_male_genitalia</li>
<li>rjw_genes_normal_female_genitalia</li>
</value>
</Operation>
<Operation Class="PatchOperationAdd">
<xpath>Defs/XenotypeDef[defName="Hussar"]/genes</xpath>
<value>
<li>rjw_genes_human_genitalia</li>
<li>rjw_genes_normal_anus</li>
<li>rjw_genes_normal_breasts</li>
<li>rjw_genes_normal_male_genitalia</li>
<li>rjw_genes_normal_female_genitalia</li>
</value>
</Operation>
-->
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">
<xpath>Defs/XenotypeDef[defName="Neanderthal"]/genes</xpath> <xpath>Defs/XenotypeDef[defName="Neanderthal"]/genes</xpath>
<value> <value>
@ -77,16 +39,18 @@
</value> </value>
</Operation> </Operation>
<!-- Conditional Patch, only add these Genes for players with Licentia
I tried "mayRequire" but that cannot be put so fine-grained into the <li> -->
<Operation Class="PatchOperationFindMod"> <Operation Class="PatchOperationFindMod">
<mods> <mods>
<li>RimJobWorld - Licentia Labs</li> <li>LustLicentia.RJWLabs</li>
</mods> </mods>
<match Class="PatchOperationAdd"> <match Class="PatchOperationAddModExtension">
<xpath>Defs/XenotypeDef[defName="Highmate"]/genes</xpath> <xpath>Defs/XenotypeDef[defName="Highmate"]/genes</xpath>
<value> <value>
<li>rjw_genes_likes_cumflation</li> <li>rjw_genes_likes_cumflation</li>
</value> </value>
</match> </match>
</Operation> </Operation>
<Operation Class="PatchOperationAdd"> <Operation Class="PatchOperationAdd">

View file

@ -5,6 +5,7 @@ using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Verse; using Verse;
using RimWorld; using RimWorld;
using rjw;
namespace RJW_BGS namespace RJW_BGS
{ {
@ -120,5 +121,22 @@ namespace RJW_BGS
} }
} }
/// <summary>
/// Used only for debugging, to see what you loaded and how it looks.
/// </summary>
private static void logAllFoundRaceGroupGenes()
{
foreach (RaceGroupDef def in DefDatabase<RaceGroupDef>.AllDefs)
{
Log.Message("defName = " + def.defName);
if (def.raceNames != null)
{
foreach (string race in def.raceNames)
{
Log.Message(race);
}
}
}
}
} }
} }

View file

@ -29,20 +29,21 @@ namespace RJW_BGS
baby.genes = new Pawn_GeneTracker(baby); baby.genes = new Pawn_GeneTracker(baby);
} }
//Remove the hair and skin genes pawns always start with, should get correct ones from human parent anyway. //Remove the hair and skin genes pawns always start with, should get correct ones from human parent anyway.
for (int i = baby.genes.Endogenes.Count - 1; i >= 0; i--) for (int i = baby.genes.Endogenes.Count - 1; i >= 0; i--)
{ {
baby.genes.RemoveGene(baby.genes.Endogenes[i]); baby.genes.RemoveGene(baby.genes.Endogenes[i]);
} }
List<GeneDef> genes = PregnancyUtility.GetInheritedGenes(dad, mother); List<GeneDef> humangenes = PregnancyUtility.GetInheritedGenes(dad, mother);
List<GeneDef> beastgenes = InheritanceUtility.AnimalInheritedGenes(dad, mother); List<GeneDef> beastgenes = InheritanceUtility.AnimalInheritedGenes(dad, mother);
InheritanceUtility.AddGenes(baby, beastgenes); InheritanceUtility.AddGenes(baby, beastgenes);
InheritanceUtility.AddGenes(baby, genes); InheritanceUtility.AddGenes(baby, humangenes);
//foreach (GeneDef gene in genes)
//{ // The mix-breed babies should be labelled hybrids
// baby.genes.AddGene(gene, false); baby.genes.hybrid = true;
//} baby.genes.xenotypeName = "Hybrid";
} }
} }
} }

View file

@ -67,6 +67,7 @@ namespace RJW_Genes
// Damage & Side Effects // Damage & Side Effects
[MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity; [MayRequire("LustLicentia.RJWLabs")] public static readonly GeneDef rjw_genes_elasticity;
public static readonly GeneDef rjw_genes_unbreakable;
// Special // Special
public static readonly GeneDef rjw_genes_orgasm_rush; public static readonly GeneDef rjw_genes_orgasm_rush;
@ -81,5 +82,10 @@ namespace RJW_Genes
// Cosmetic // Cosmetic
public static readonly GeneDef rjw_genes_succubus_tail; public static readonly GeneDef rjw_genes_succubus_tail;
public static readonly GeneDef rjw_genes_youth_fountain;
public static readonly GeneDef rjw_genes_sex_age_drain;
public static readonly HediffDef rjw_genes_orgasm_rush_hediff;
} }
} }

View file

@ -14,9 +14,8 @@ namespace RJW_Genes
/// Normal Egg-Pregnancy logic is in https://gitgud.io/Ed86/rjw/-/blob/master/1.4/Source/Modules/Pregnancy/Pregnancy_Helper.cs /// Normal Egg-Pregnancy logic is in https://gitgud.io/Ed86/rjw/-/blob/master/1.4/Source/Modules/Pregnancy/Pregnancy_Helper.cs
/// </summary> /// </summary>
[HarmonyPatch(typeof(SexUtility), "Aftersex")] [HarmonyPatch(typeof(SexUtility), "Aftersex")]
static class PatchEggFertilizationHelper static class Patch_EggFertilization
{ {
[HarmonyTranspiler]
public static void Postfix(SexProps props) public static void Postfix(SexProps props)
{ {
// Only Fertilize on vaginal / anal sex // Only Fertilize on vaginal / anal sex
@ -59,7 +58,7 @@ namespace RJW_Genes
} }
private static Boolean canDoEggFertilization(Pawn a, Pawn b) private static bool canDoEggFertilization(Pawn a, Pawn b)
{ {
// No Partner / Other Errors // No Partner / Other Errors

View file

@ -10,8 +10,6 @@ namespace RJW_Genes
/// </summary> /// </summary>
public class Gene_Elasticity : Gene public class Gene_Elasticity : Gene
{ {
private int ticksToReset = RESET_INTERVAL;
private const int RESET_INTERVAL = 60000; // 60k should be 1 day private const int RESET_INTERVAL = 60000; // 60k should be 1 day
public override void PostAdd() public override void PostAdd()
@ -26,11 +24,8 @@ namespace RJW_Genes
public override void Tick() public override void Tick()
{ {
base.Tick(); base.Tick();
--this.ticksToReset; if (pawn.IsHashIntervalTick(RESET_INTERVAL))
if (this.ticksToReset > 0) ResetSeverity();
return;
this.ticksToReset = RESET_INTERVAL;
ResetSeverity();
} }
public override void PostRemove() public override void PostRemove()

View file

@ -0,0 +1,41 @@
using LicentiaLabs;
using rjw;
using Verse;
namespace RJW_Genes
{
/// <summary>
/// This Gene regularly removes the broken hediff of a pawn.
/// Blocking / Removing thoughts are done in an XML Patch.
/// </summary>
public class Gene_Unbreakable : Gene
{
/// DevNote: I first tried to Harmony-Postfix the AfterSexUtility and never add it - but that failed?
private const int RESET_INTERVAL = 30000; // 30k should be 0.5 day
public override void PostAdd()
{
base.PostAdd();
RemoveBrokenHediff();
}
public override void Tick()
{
base.Tick();
if (pawn.IsHashIntervalTick(RESET_INTERVAL))
RemoveBrokenHediff();
}
private void RemoveBrokenHediff()
{
// Clean-Up of existing feeling brokens
var maybeBrokenHediff = pawn.health.hediffSet.GetFirstHediffOfDef(xxx.feelingBroken);
if (maybeBrokenHediff != null)
{
pawn.health.RemoveHediff(maybeBrokenHediff);
}
}
}
}

View file

@ -86,6 +86,24 @@ namespace RJW_Genes
return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator); return pawn.genes.HasGene(GeneDefOf.rjw_genes_insectincubator);
} }
public static bool IsYouthFountain(Pawn pawn)
{
if (pawn.genes == null)
{
return false;
}
return pawn.genes.HasGene(GeneDefOf.rjw_genes_youth_fountain);
}
internal static bool IsAgeDrainer(Pawn pawn)
{
if (pawn.genes == null)
{
return false;
}
return pawn.genes.HasGene(GeneDefOf.rjw_genes_sex_age_drain);
}
public static bool IsInsectBreeder(Pawn pawn) public static bool IsInsectBreeder(Pawn pawn)
{ {
if (pawn.genes == null) if (pawn.genes == null)
@ -139,5 +157,14 @@ namespace RJW_Genes
} }
return pawn.genes.HasGene(GeneDefOf.rjw_genes_pussyhealer); return pawn.genes.HasGene(GeneDefOf.rjw_genes_pussyhealer);
} }
public static bool IsUnbreakable(Pawn pawn)
{
if (pawn.genes == null)
{
return false;
}
return pawn.genes.HasGene(GeneDefOf.rjw_genes_unbreakable);
}
} }
} }

View file

@ -0,0 +1,38 @@
using HarmonyLib;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RJW_Genes.Genes.Special
{
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
public static class Patch_AgeDrain
{
const long AGE_TRANSFERED = 120000; // 120k == 2 days
// Comment Below in for debugging, changes years
// const long AGE_TRANSFERED = 6000000; // 6000k == 100 days
public static void Postfix(SexProps props)
{
if (props == null || props.pawn == null || props.partner == null || props.partner.IsAnimal() )
{
return;
}
if (GeneUtility.IsAgeDrainer(props.pawn))
{
var pawnAge = props.pawn.ageTracker.AgeBiologicalTicks;
var pawnMinAge = props.pawn.ageTracker.AdultMinAgeTicks;
// Make Partner older
props.partner.ageTracker.AgeBiologicalTicks += AGE_TRANSFERED;
// Make Pawn younger
props.pawn.ageTracker.AgeBiologicalTicks = Math.Max(pawnMinAge, pawnAge - AGE_TRANSFERED);
}
}
}
}

View file

@ -5,6 +5,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Verse;
namespace RJW_Genes namespace RJW_Genes
{ {
@ -14,6 +15,7 @@ namespace RJW_Genes
{ {
private const float REST_INCREASE = 0.05f; private const float REST_INCREASE = 0.05f;
private const float ORGASMS_NEEDED_FOR_SUPERCHARGE = 3.0f;
public static void Postfix(SexProps props) public static void Postfix(SexProps props)
{ {
@ -23,9 +25,37 @@ namespace RJW_Genes
if (props.pawn.genes != null && props.pawn.genes.HasGene(GeneDefOf.rjw_genes_orgasm_rush)) if (props.pawn.genes != null && props.pawn.genes.HasGene(GeneDefOf.rjw_genes_orgasm_rush))
{ {
props.pawn.needs.rest.CurLevel += REST_INCREASE;
} // Pump up Wake-Ness
if (props.pawn.needs.rest != null)
props.pawn.needs.rest.CurLevel += REST_INCREASE;
// Add or Update Hediff for Orgasm Rush
Hediff rush = GetOrgasmRushHediff(props.pawn);
float added_severity = props.orgasms / ORGASMS_NEEDED_FOR_SUPERCHARGE;
rush.Severity += added_severity;
// Severity should be capped to 1 by the XML logic
}
}
/// <summary>
/// Helps to get the Orgasm Rush Hediff of a Pawn. If it does not exist, one is added.
/// </summary>
/// <param name="orgasmed">The pawn that had the orgasm, for which a hediff is looked up or created.</param>
/// <returns></returns>
public static Hediff GetOrgasmRushHediff(Pawn orgasmed)
{
Hediff orgasmRushHediff = orgasmed.health.hediffSet.GetFirstHediffOfDef(GeneDefOf.rjw_genes_orgasm_rush_hediff);
if (orgasmRushHediff == null)
{
orgasmRushHediff = HediffMaker.MakeHediff(GeneDefOf.rjw_genes_orgasm_rush_hediff, orgasmed);
orgasmRushHediff.Severity = 0;
orgasmed.health.AddHediff(orgasmRushHediff);
}
return orgasmRushHediff;
} }
} }
} }

View file

@ -0,0 +1,36 @@
using HarmonyLib;
using rjw;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace RJW_Genes.Genes.Special
{
[HarmonyPatch(typeof(SexUtility), "Aftersex")]
public static class Patch_Youth_Fountain
{
const long AGE_REDUCTION = 60000; // 60k == 1 day
// Comment Below in for debugging
//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())
{
return;
}
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);
}
}
}
}

View file

@ -27,16 +27,14 @@
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath> <HintPath>..\..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="LicentiaLabs"> <Reference Include="LicentiaLabs">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\licentia-labs-master\Assemblies\LicentiaLabs.dll</HintPath> <HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\licentia-labs-master\Assemblies\LicentiaLabs.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="RJW"> <Reference Include="RJW">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\Mods\rjw-master\1.4\Assemblies\RJW.dll</HintPath> <HintPath>..\..\rjw\1.4\Assemblies\RJW.dll</HintPath>
<Private>False</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@ -51,12 +49,14 @@
<None Include="..\Common\Languages\**" /> <None Include="..\Common\Languages\**" />
<None Include="..\Common\Patches\**" /> <None Include="..\Common\Patches\**" />
<Reference Include="UnityEngine"> <Reference Include="UnityEngine">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath> <HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="UnityEngine.CoreModule"> <Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\..\..\..\..\..\Program Files (x86)\Steam\steamapps\common\RimWorld\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath> <HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
<Private>False</Private> </Reference>
<Reference Include="UnityEngine.IMGUIModule">
<HintPath>..\..\..\RimWorldWin64_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
</Reference> </Reference>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>