diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 289e448..fcecfae 100644 Binary files a/1.1/Assemblies/Rimworld-Animations.dll and b/1.1/Assemblies/Rimworld-Animations.dll differ diff --git a/Defs/AnimationDefs/Animations_Multi.xml b/Defs/AnimationDefs/Animations_Multi.xml index a5c2ba5..d91744e 100644 --- a/Defs/AnimationDefs/Animations_Multi.xml +++ b/Defs/AnimationDefs/Animations_Multi.xml @@ -20,6 +20,9 @@ true true + + (0, 0.2) +
  • @@ -27,6 +30,9 @@ true true + + (0, 0.2) +
  • diff --git a/Source/AnimationUtility.cs b/Source/AnimationUtility.cs index 6f40e3b..0072650 100644 --- a/Source/AnimationUtility.cs +++ b/Source/AnimationUtility.cs @@ -182,5 +182,9 @@ namespace Rimworld_Animations { GenDraw.DrawMeshNowOrLater(mesh, pawnHeadPosition, Quaternion.AngleAxis(pawnAnimator.headAngle, Vector3.up), material, portrait); } } + + public static readonly JobDef JoinInBedAnimation = DefDatabase.GetNamed("JoinInBedAnimation", true); + public static readonly JobDef GettinLovedAnimation = DefDatabase.GetNamed("GettinLovedAnimation", true); + } } diff --git a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs index 30302e1..4c88d0e 100644 --- a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs @@ -38,7 +38,7 @@ namespace Rimworld_Animations { yield return Toils_Reserve.Reserve(ibed, Bed.SleepingSlotsCount, 0); Toil get_loved = new Toil(); - get_loved.FailOn(() => Partner.CurJobDef != DefDatabase.GetNamed("JoinInBedAnimation", true)); + get_loved.FailOn(() => Partner.CurJobDef != AnimationUtility.JoinInBedAnimation); get_loved.defaultCompleteMode = ToilCompleteMode.Never; get_loved.socialMode = RandomSocialMode.Off; get_loved.handlingFacing = true; diff --git a/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs b/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs index 25e46f3..8f69d8c 100644 --- a/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs @@ -27,7 +27,7 @@ namespace Rimworld_Animations { yield return Toils_Reserve.Reserve(ipartner, xxx.max_rapists_per_prisoner, 0, null); Toil goToPawnInBed = Toils_Goto.GotoThing(ipartner, PathEndMode.OnCell); - goToPawnInBed.FailOn(() => !RestUtility.InBed(Partner) && !xxx.in_same_bed(Partner, pawn)); + goToPawnInBed.FailOn(() => !(RestUtility.InBed(Partner) || Partner.CurJobDef == AnimationUtility.GettinLovedAnimation)); yield return goToPawnInBed; @@ -35,15 +35,17 @@ namespace Rimworld_Animations { Toil startPartnerSex = new Toil(); startPartnerSex.initAction = delegate { - Job gettinLovedJob = JobMaker.MakeJob(DefDatabase.GetNamed("GettinLovedAnimation"), pawn, Bed); // new gettin loved toil that wakes up the pawn goes here + if(Partner.CurJobDef != AnimationUtility.GettinLovedAnimation) { + Job gettinLovedJob = JobMaker.MakeJob(AnimationUtility.GettinLovedAnimation, pawn, Bed); // new gettin loved toil that wakes up the pawn goes here + Partner.jobs.jobQueue.EnqueueFirst(gettinLovedJob); + Partner.jobs.EndCurrentJob(JobCondition.InterruptForced); + } - Partner.jobs.jobQueue.EnqueueFirst(gettinLovedJob); - Partner.jobs.EndCurrentJob(JobCondition.InterruptForced); }; yield return startPartnerSex; Toil sexToil = new Toil(); - sexToil.FailOn(() => (Partner.CurJobDef == null) || Partner.CurJobDef != DefDatabase.GetNamed("GettinLovedAnimation", true)); //partner jobdriver is not sexbaserecieverlovedforanim + sexToil.FailOn(() => (Partner.CurJobDef == null) || Partner.CurJobDef != AnimationUtility.GettinLovedAnimation); //partner jobdriver is not sexbaserecieverlovedforanim sexToil.socialMode = RandomSocialMode.Off; sexToil.defaultCompleteMode = ToilCompleteMode.Never; sexToil.handlingFacing = true; diff --git a/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs b/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs index c508266..797a279 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_DoLovinAnimationPatch.cs @@ -19,7 +19,7 @@ namespace Rimworld_Animations { if(__result != null) { Pawn partnerInMyBed = LovePartnerRelationUtility.GetPartnerInMyBed(pawn); RestUtility.WakeUp(pawn); - __result = JobMaker.MakeJob(DefDatabase.GetNamed("JoinInBedAnimation", true), partnerInMyBed, partnerInMyBed.CurrentBed()); + __result = JobMaker.MakeJob(AnimationUtility.JoinInBedAnimation, partnerInMyBed, partnerInMyBed.CurrentBed()); } } }