diff --git a/1.2/Assemblies/Rimworld-Animations.dll b/1.2/Assemblies/Rimworld-Animations.dll index 98f2634..c1f2488 100644 Binary files a/1.2/Assemblies/Rimworld-Animations.dll and b/1.2/Assemblies/Rimworld-Animations.dll differ diff --git a/About/Manifest.xml b/About/Manifest.xml index a33398c..dcde0e4 100644 --- a/About/Manifest.xml +++ b/About/Manifest.xml @@ -1,5 +1,5 @@  Rimworld-Animations - 1.0.14 + 1.0.15 \ No newline at end of file diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index c878498..98c35d0 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -45,7 +45,7 @@ False - ..\RJW\1.2\Assemblies\RJW.dll + ..\rjw-master\1.2\Assemblies\RJW.dll False diff --git a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs index 4b5d844..d8d99d2 100644 --- a/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs +++ b/Source/JobDrivers/JobDriver_SexBaseRecieverLovedForAnimation.cs @@ -47,7 +47,19 @@ 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(() => { + + for (int i = 0; i < parteners.Count; i++) + { + if (parteners[i].CurJobDef != DefDatabase.GetNamed("JoinInBedAnimation", true)) + { + return true; + } + } + + return false; + + }); get_loved.defaultCompleteMode = ToilCompleteMode.Never; get_loved.socialMode = RandomSocialMode.Off; get_loved.handlingFacing = true; @@ -55,6 +67,15 @@ namespace Rimworld_Animations { if (pawn.IsHashIntervalTick(ticks_between_hearts)) MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); }); + get_loved.AddEndCondition(() => + { + if (parteners.Count <= 0) + { + return JobCondition.Succeeded; + } + return JobCondition.Ongoing; + + }); get_loved.AddFinishAction(delegate { if (xxx.is_human(pawn)) pawn.Drawer.renderer.graphics.ResolveApparelGraphics(); diff --git a/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs b/Source/JobDrivers/JobDriver_SexCasualForAnimation.cs index 25e46f3..3fabe14 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 != DefDatabase.GetNamed("GettinLovedAnimation") && !xxx.in_same_bed(Partner, pawn)); yield return goToPawnInBed; @@ -35,10 +35,14 @@ 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 != DefDatabase.GetNamed("GettinLovedAnimation")) // allows threesomes + { + Job gettinLovedJob = JobMaker.MakeJob(DefDatabase.GetNamed("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; @@ -55,6 +59,11 @@ namespace Rimworld_Animations { sexToil.AddPreTickAction(delegate { + if(!Partner.TryGetComp().isAnimating) + { + pawn.TryGetComp().isAnimating = false; + } + ticks_left--; if(Gen.IsHashIntervalTick(pawn, ticks_between_hearts)) { MoteMaker.ThrowMetaIcon(pawn.Position, pawn.Map, ThingDefOf.Mote_Heart); diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index f5cb52d..87a9ef2 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -106,7 +106,6 @@ namespace Rimworld_Animations { (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_left = anim.animationTimeTicks; (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticksLeftThisToil = anim.animationTimeTicks; (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).duration = anim.animationTimeTicks; - (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_remaining = anim.animationTimeTicks; if(!AnimationSettings.hearts) { (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_between_hearts = Int32.MaxValue; } @@ -115,11 +114,16 @@ namespace Rimworld_Animations { } else { Log.Message("No animation found"); + + /* + //if pawn isn't already animating, if (!pawn.TryGetComp().isAnimating) { (pawn.jobs.curDriver as JobDriver_SexBaseReciever).increase_time(duration); //they'll just do the thrusting anim } + + */ } } }