rjw-quirks/RJW-Quirks/HarmonyPatches/Patch_SexUtility.cs

82 lines
2.6 KiB
C#

using HarmonyLib;
using RimWorld;
using rjw;
using rjwquirks.Modules.Quirks;
using rjwquirks.Modules.Shared.Events;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using Verse;
namespace rjwquirks.HarmonyPatches
{
[HarmonyPatch(typeof(SexUtility))]
public class Patch_SexUtility
{
[HarmonyPrefix]
[HarmonyPatch(nameof(SexUtility.DrawNude))]
public static bool Prefix(Pawn pawn)
{
if (pawn.HasQuirk(QuirkDefOf.Endytophile))
return false;
return true;
}
// Increases cum filth generated by pawn
[HarmonyPostfix]
[HarmonyPatch(nameof(SexUtility.CumOutputModifier))]
public static void FilthAdder(Pawn pawn, ref float __result)
{
if(pawn.GetQuirks() != null)
pawn.GetQuirks().ApplyValueModifiers("cumFilthAmount", ref __result);
}
// Change how much the pawn wants to clean post sex
[HarmonyPostfix]
[HarmonyPatch(nameof(SexUtility.CleaningChance))]
public static void AdjustConsiderScore(Pawn fapper, ref float __result)
{
fapper.GetQuirks().ApplyValueModifiers("cleanAfterFapChance", ref __result);
}
// Change satisfaction from sex
[HarmonyPostfix]
[HarmonyPatch(nameof(SexUtility.ExtraSatisfaction))]
public static void Satisfaction(SexProps props, ref float __result)
{
var quirkCount = props.pawn.GetQuirks().GetSatisfiedBySex(props).Count();
if (quirkCount > 0)
{
__result += props.pawn.GetQuirks().GetSatisfiedBySex(props).Count() * 0.20f;
RjwEventManager.NotifyEvent(new RjwEvent(RjwEventDefOf.Orgasm, props.Named(RjwEventArgNames.SexProps), __result.Named(RjwEventArgNames.Satisfaction)));
}
}
// Change ticks to next lovin
[HarmonyPostfix]
[HarmonyPatch(nameof(SexUtility.MinLovinTicks))]
public static void ChangeTicksToNextLovin(Pawn pawn, ref float __result)
{
if(pawn.GetQuirks() != null)
{
pawn.GetQuirks().ApplyValueModifiers("ticksToNextLovin", ref __result);
}
}
// Rest adjustments
[HarmonyPrefix]
[HarmonyPatch(nameof(SexUtility.reduce_rest))]
public static void AdjustRest(Pawn pawn, ref float x)
{
if (pawn.GetQuirks() != null)
pawn.GetQuirks().ApplyValueModifiers("reduceRest", ref x);
}
}
}