patch for rmb menu joinninbed job

This commit is contained in:
Platinum 2020-07-24 16:36:11 -07:00
parent 4f6fc144e1
commit 49c9ca341d
4 changed files with 26 additions and 4 deletions

View File

@ -104,6 +104,7 @@
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_DrawSemen.cs" />
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_JoinInBedGiveJob.cs" />
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_PlayAnimJoinInBedRMB.cs" />
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_SexTick.cs" />
<Compile Include="Source\Patches\rjwPatches\HarmonyPatch_WorkGiverSex.cs" />
<Compile Include="Source\Settings\AnimationSettings.cs" />

View File

@ -22,10 +22,6 @@ namespace Rimworld_Animations {
return;
}
if(__instance is JobDriver_JoinInBed) {
Log.Warning("Playing regular RJW joininbed jobdriver, if it animates properly ignore this warning");
}
Pawn pawn = __instance.pawn;
Building_Bed bed = __instance.Bed;

View File

@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using RimWorld;
using Verse.AI;
using rjw;
using HarmonyLib;
using Verse;
namespace Rimworld_Animations {
[HarmonyPatch(typeof(Pawn_JobTracker), "TryTakeOrderedJob")]
class HarmonyPatch_PlayAnimJoinInBedRMB {
public static void Prefix(ref Job job) {
if(job.def == xxx.casual_sex) {
Log.Message("Replacing vanilla RJW JoinInBed JobDriver for animation JobDriver");
job = new Job(DefDatabase<JobDef>.GetNamed("JoinInBedAnimation", true), job.targetA, job.targetB, job.targetC);
}
}
}
}