private static bool on_begin_lovin(JobDriver_Lovin __instance) { Pawn pawn = __instance.pawn; Pawn partner = null; var any_ins = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; partner = (Pawn)(__instance.GetType().GetProperty("Partner", any_ins).GetValue(__instance, null)); __instance.FailOn(() => (!(xxx.can_fuck(pawn) || xxx.can_be_fucked(pawn)))); __instance.FailOn(() => (!(xxx.can_fuck(partner) || xxx.can_be_fucked(partner)))); //this breaks job //Log.Message("[RJW]patches_lovin::would_fuck" + xxx.would_fuck(pawn, partner)); //__instance.FailOn(() => (xxx.would_fuck(pawn, partner) < 0.1f)); return(true); }
private static bool on_begin_lovin(JobDriver_Lovin __instance) { //--Log.Message("[RJW]patches_lovin::PATCH_JobDriver_Lovin_MakeNewToils is called0"); //if (__instance == null) return true; __instance.FailOn(() => (!xxx.can_fuck(__instance.pawn))); return(true); }
private static bool on_begin_lovin(JobDriver_Lovin __instance) { Pawn pawn = __instance.pawn; Pawn partner = null; Building_Bed Bed = null; var any_ins = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; partner = (Pawn)(__instance.GetType().GetProperty("Partner", any_ins).GetValue(__instance, null)); Bed = (Building_Bed)(__instance.GetType().GetProperty("Bed", any_ins).GetValue(__instance, null)); __instance.FailOn(() => (!(xxx.can_fuck(pawn) || xxx.can_be_fucked(pawn)))); __instance.FailOn(() => (!(xxx.can_fuck(partner) || xxx.can_be_fucked(partner)))); if (RJWSettings.override_lovin) { pawn.jobs.EndCurrentJob(JobCondition.Incompletable); Job job = JobMaker.MakeJob(xxx.casual_sex, partner, Bed); pawn.jobs.jobQueue.EnqueueFirst(job); } return(true); }