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