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

82 lines
2.6 KiB
C#
Raw Normal View History

2022-11-01 16:15:06 +00:00
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;
}
2022-11-01 16:15:06 +00:00
// 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)
2022-11-01 16:15:06 +00:00
{
fapper.GetQuirks().ApplyValueModifiers("cleanAfterFapChance", ref __result);
2022-11-01 16:15:06 +00:00
}
// Change satisfaction from sex
[HarmonyPostfix]
[HarmonyPatch(nameof(SexUtility.ExtraSatisfaction))]
2022-11-01 16:15:06 +00:00
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)
2022-11-01 16:15:06 +00:00
{
if(pawn.GetQuirks() != null)
2022-11-01 16:15:06 +00:00
{
pawn.GetQuirks().ApplyValueModifiers("ticksToNextLovin", ref __result);
2022-11-01 16:15:06 +00:00
}
}
// Rest adjustments
[HarmonyPrefix]
2022-11-01 16:15:06 +00:00
[HarmonyPatch(nameof(SexUtility.reduce_rest))]
public static void AdjustRest(Pawn pawn, ref float x)
2022-11-01 16:15:06 +00:00
{
if (pawn.GetQuirks() != null)
2022-11-01 16:15:06 +00:00
pawn.GetQuirks().ApplyValueModifiers("reduceRest", ref x);
}
}
}