2021-04-20 18:37:50 +00:00
|
|
|
|
using HarmonyLib;
|
2021-04-20 19:07:49 +00:00
|
|
|
|
using RimWorld;
|
2021-04-20 18:37:50 +00:00
|
|
|
|
using rjw;
|
|
|
|
|
using System;
|
2020-04-09 00:43:01 +00:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using Verse;
|
2021-04-20 18:37:50 +00:00
|
|
|
|
using Verse.AI;
|
2020-04-09 00:43:01 +00:00
|
|
|
|
|
2021-04-20 18:37:50 +00:00
|
|
|
|
namespace Rimworld_Animations
|
|
|
|
|
{
|
|
|
|
|
[HarmonyPatch(typeof(JobDriver_Sex), "SexTick")]
|
|
|
|
|
public class HarmonyPatch_SexTick
|
|
|
|
|
{
|
|
|
|
|
public static bool Prefix(JobDriver_Sex __instance, Pawn pawn, Thing target)
|
|
|
|
|
{
|
2020-04-09 00:43:01 +00:00
|
|
|
|
|
2021-04-21 15:19:50 +00:00
|
|
|
|
if ((target is Pawn) &&
|
2021-04-20 18:37:50 +00:00
|
|
|
|
!(
|
|
|
|
|
(target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever
|
|
|
|
|
&&
|
|
|
|
|
((target as Pawn).jobs.curDriver as JobDriver_SexBaseReciever).parteners.Any()
|
|
|
|
|
&&
|
|
|
|
|
((target as Pawn).jobs.curDriver as JobDriver_SexBaseReciever).parteners[0] == pawn))
|
|
|
|
|
{
|
2020-04-09 00:43:01 +00:00
|
|
|
|
|
2021-04-20 18:37:50 +00:00
|
|
|
|
__instance.ticks_left--;
|
|
|
|
|
__instance.sex_ticks--;
|
|
|
|
|
__instance.Orgasm();
|
2020-05-29 20:12:35 +00:00
|
|
|
|
|
2021-04-20 19:07:49 +00:00
|
|
|
|
|
|
|
|
|
if (pawn.IsHashIntervalTick(__instance.ticks_between_thrusts))
|
|
|
|
|
{
|
|
|
|
|
__instance.ChangePsyfocus(pawn, target);
|
|
|
|
|
__instance.Animate(pawn, target);
|
|
|
|
|
__instance.PlaySexSound();
|
|
|
|
|
if (!__instance.isRape)
|
|
|
|
|
{
|
|
|
|
|
pawn.GainComfortFromCellIfPossible(false);
|
|
|
|
|
if (target is Pawn)
|
|
|
|
|
{
|
|
|
|
|
(target as Pawn).GainComfortFromCellIfPossible(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-04-21 05:24:56 +00:00
|
|
|
|
if(!__instance.isEndytophile)
|
|
|
|
|
{
|
|
|
|
|
SexUtility.DrawNude(pawn, false);
|
|
|
|
|
}
|
2021-04-20 19:07:49 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
2021-04-20 18:37:50 +00:00
|
|
|
|
}
|
2020-05-29 20:12:35 +00:00
|
|
|
|
|
2021-04-20 18:37:50 +00:00
|
|
|
|
return true;
|
|
|
|
|
}
|
2020-04-09 00:43:01 +00:00
|
|
|
|
|
2021-04-20 18:37:50 +00:00
|
|
|
|
}
|
2020-07-11 16:25:13 +00:00
|
|
|
|
|
2020-04-09 00:43:01 +00:00
|
|
|
|
}
|