mirror of
https://github.com/vegapnk/RJW-Genes.git
synced 2024-08-15 00:23:31 +00:00
Restructuring, some sorting into folders
This commit is contained in:
parent
ac1fdc99be
commit
31e96bd5e3
36 changed files with 80 additions and 65 deletions
|
@ -0,0 +1,57 @@
|
|||
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 to know 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) && GeneUtility.HasGeneNullCheck(sub,GeneDefOf.rjw_genes_cum_eater)&& 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
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue