diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 7a5e864..85618f5 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/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index c9053f8..7628d89 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -34,10 +34,6 @@ ..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll - - ..\..\..\..\workshop\content\294100\839005762\1.1\Assemblies\AlienRace.dll - False - False ..\..\RimWorldWin64_Data\Managed\Assembly-CSharp.dll diff --git a/Source/AnimationUtility.cs b/Source/AnimationUtility.cs index 52a86d6..3022b65 100644 --- a/Source/AnimationUtility.cs +++ b/Source/AnimationUtility.cs @@ -288,5 +288,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 4b5d844..29c6f3d 100644 --- a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs @@ -47,7 +47,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/HarmonyPatch_AlienRace.cs b/Source/Patches/HarmonyPatch_AlienRace.cs index 9ebfed0..09e216e 100644 --- a/Source/Patches/HarmonyPatch_AlienRace.cs +++ b/Source/Patches/HarmonyPatch_AlienRace.cs @@ -1,4 +1,5 @@ -using HarmonyLib; +/* +using HarmonyLib; using System; using System.Collections.Generic; using System.Linq; @@ -144,4 +145,4 @@ namespace Rimworld_Animations { return false; } } -} \ No newline at end of file +}*/ \ No newline at end of file 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()); } } }