mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
masturbate tick fix
This commit is contained in:
parent
b2c6838cb1
commit
1532339602
4 changed files with 42 additions and 0 deletions
Binary file not shown.
|
@ -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;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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<Pawn> GetAllSexParticipants(this Pawn pawn)
|
||||
|
|
|
@ -124,6 +124,7 @@
|
|||
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_PawnRenderTree.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_Pawn_DrawTracker.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RimworldPatches\HarmonyPatch_Thing.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\HarmonyPatch_JobDriver_Masturbate.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_Animate.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_PlaySexSounds.cs" />
|
||||
<Compile Include="1.5\Source\Patches\RJWPatches\JobDrivers\JobDriver_Sex\HarmonyPatch_SexTick.cs" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue