From 022e6cf5c711f15ac17f780de5568c297c7a688f Mon Sep 17 00:00:00 2001 From: Ed86 <email@email.com> Date: Sun, 21 Jul 2019 00:01:50 +0300 Subject: [PATCH] patch for animal mating --- Source/Harmony/patch_lovin.cs | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Source/Harmony/patch_lovin.cs b/Source/Harmony/patch_lovin.cs index 452efba4..0d5c98c4 100644 --- a/Source/Harmony/patch_lovin.cs +++ b/Source/Harmony/patch_lovin.cs @@ -23,6 +23,20 @@ namespace rjw } } + [HarmonyPatch(typeof(JobDriver_Mate))] + [HarmonyPatch("MakeNewToils")] + internal static class PATCH_JobDriver_Mate_MakeNewToils + { + [HarmonyPrefix] + private static bool on_begin_lovin(JobDriver_Mate __instance) + { + //--Log.Message("[RJW]patches_lovin::PATCH_JobDriver_Mate_MakeNewToils is called"); + //if (__instance == null) return true; + __instance.FailOn(() => (!(xxx.can_fuck(__instance.pawn) || xxx.can_be_fucked(__instance.pawn)))); + return true; + } + } + //JobDriver_DoLovinCasual from RomanceDiversified should have handled whether pawns can do casual lovin, //so I don't bothered to do a check here, unless some bugs occur due to this. @@ -43,6 +57,9 @@ namespace rjw //vanilla lovin private readonly static Type JobDriverLovin = typeof(JobDriver_Lovin); + //vanilla mate + private readonly static Type JobDriverMate = typeof(JobDriver_Mate); + [HarmonyPrefix] private static bool on_cleanup_driver(JobDriver __instance, JobCondition condition) { @@ -77,6 +94,10 @@ namespace rjw PregnancyHelper.cleanup_CnP(partner); } } + //Vanilla mating + else if (__instance.GetType() == JobDriverMate) + { + } else return true; -- GitLab