diff --git a/1.5/Assemblies/Rimworld-Animations.dll b/1.5/Assemblies/Rimworld-Animations.dll index 4cf85bf..bca6532 100644 Binary files a/1.5/Assemblies/Rimworld-Animations.dll and b/1.5/Assemblies/Rimworld-Animations.dll differ diff --git a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Masturbate.cs b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Masturbate.cs new file mode 100644 index 0000000..a0b0ec6 --- /dev/null +++ b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Masturbate.cs @@ -0,0 +1,22 @@ +using HarmonyLib; +using rjw; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Rimworld_Animations +{ + [HarmonyPatch(typeof(JobDriver_Masturbate), "SetupDurationTicks")] + public class HarmonyPatch_JobDriver_Masturbate + { + public static void Postfix(JobDriver_Masturbate __instance) + { + //prevent early stoppage of masturbate jobdriver during animation + __instance.duration = 10000000; + __instance.ticks_left = __instance.duration; + + } + } +} diff --git a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs index b229832..e134abd 100644 --- a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -49,6 +49,25 @@ namespace Rimworld_Animations } } } + + else + { + + //backup check for if masturbation doesn't have anim + //reset duration and ticks_left to the regular RJW values + //because of HarmonyPatch_JobDriver_Masturbate setting the values large to prevent early stoppage + foreach (Pawn participant in participants) + { + if (participant?.jobs?.curDriver is JobDriver_Sex participantJobDriver) + { + participantJobDriver.duration = (int)(xxx.is_frustrated(participant) ? (2500f * Rand.Range(0.2f, 0.7f)) : (2500f * Rand.Range(0.2f, 0.4f))); + participantJobDriver.ticks_left = participantJobDriver.duration; + + } + + } + } + } public static List GetAllSexParticipants(this Pawn pawn) diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 708b103..83bab5e 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -124,6 +124,7 @@ +