rjw-genes/Source/Genes/Life_Force/Patch_SexTicks_ChangePsyfocus.cs
Shabakur 400b48787d Several genes and changes
- Succubus wings now have the flight abilty (same as longjump)
- Modified aphrodisiac pheromones to increase with strenght based on carrier's sexdrive.
- Added paralysing kiss, touch range stun which uses fertilin
- Added seduce, beckon like ability which results in sex if target reached caster. Uses fertilin
2023-01-06 12:42:04 +01:00

57 lines
1.5 KiB
C#

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)
{
//We need who the pawn on top is and if reverse we need to make the sub the pawn on top
if (__instance.Sexprops.isRevese)
{
DrinkCumflation(pawn2, pawn);
}
else
{
//
DrinkCumflation(pawn, pawn2);
return;
}
}
}
}
}
public static void DrinkCumflation(Pawn dom, Pawn sub)
{
if (GeneUtility.HasLifeForce(sub) && dom.health.hediffSet.HasHediff(HediffDef.Named("Cumflation")))
{
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;
}
}
//Maybe I can store gene and hediff so I dont need to look them up every time
}
}