2022-12-31 15:40:37 +00:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using rjw;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using RimWorld;
|
|
|
|
|
using Verse;
|
|
|
|
|
|
|
|
|
|
namespace RJW_Genes
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
//[HarmonyPatch(typeof(JobDriver_Sex), nameof(JobDriver_Sex.ChangePsyfocus))]
|
|
|
|
|
public static class Patch_SexTicks_ChangePsyfocus
|
|
|
|
|
{
|
|
|
|
|
//Using ChangePsyfocus as it is something that fires every 60 ticks
|
|
|
|
|
public static void Postfix(ref JobDriver_Sex __instance, ref Pawn pawn, ref Thing target)
|
|
|
|
|
{
|
|
|
|
|
if (__instance.Sexprops.sexType == xxx.rjwSextype.Cunnilingus)
|
|
|
|
|
{
|
|
|
|
|
if (target != null)
|
|
|
|
|
{
|
|
|
|
|
Pawn pawn2 = target as Pawn;
|
|
|
|
|
if (pawn2 != null)
|
|
|
|
|
{
|
2023-01-17 15:44:08 +00:00
|
|
|
|
//We need to know who the pawn on top is and if reverse we need to make the sub the pawn on top
|
2022-12-31 15:40:37 +00:00
|
|
|
|
if (__instance.Sexprops.isRevese)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
DrinkCumflation(pawn2, pawn);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//
|
|
|
|
|
DrinkCumflation(pawn, pawn2);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static void DrinkCumflation(Pawn dom, Pawn sub)
|
|
|
|
|
{
|
2023-01-17 15:44:08 +00:00
|
|
|
|
if (GeneUtility.HasLifeForce(sub) && GeneUtility.HasGeneNullCheck(sub,GeneDefOf.rjw_genes_cum_eater)&& dom.health.hediffSet.HasHediff(HediffDef.Named("Cumflation")))
|
2022-12-31 15:40:37 +00:00
|
|
|
|
{
|
|
|
|
|
Hediff cumflation = dom.health.hediffSet.GetFirstHediffOfDef(HediffDef.Named("Cumflation"));
|
|
|
|
|
Gene_LifeForce gene_LifeForce = sub.genes.GetFirstGeneOfType<Gene_LifeForce>();
|
|
|
|
|
cumflation.Severity -= 0.1f;
|
|
|
|
|
gene_LifeForce.Resource.Value += 0.05f;
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-01-06 11:42:04 +00:00
|
|
|
|
//Maybe I can store gene and hediff so I dont need to look them up every time
|
2022-12-31 15:40:37 +00:00
|
|
|
|
}
|
|
|
|
|
}
|