diff --git a/1.1/Assemblies/Rimworld-Animations.dll b/1.1/Assemblies/Rimworld-Animations.dll index 6fe10ae..341fd9d 100644 Binary files a/1.1/Assemblies/Rimworld-Animations.dll and b/1.1/Assemblies/Rimworld-Animations.dll differ diff --git a/Source/Comps/CompBodyAnimator.cs b/Source/Comps/CompBodyAnimator.cs index 4cf8102..7a2f2c4 100644 --- a/Source/Comps/CompBodyAnimator.cs +++ b/Source/Comps/CompBodyAnimator.cs @@ -94,7 +94,7 @@ namespace Rimworld_Animations { anchor = thing.Position.ToVector3Shifted(); } } - public void StartAnimation(AnimationDef anim, int actor, bool mirror = false, bool shiver = false) { + public void StartAnimation(AnimationDef anim, int actor, bool mirror = false, bool shiver = false, bool fastAnimForQuickie = false) { isAnimating = true; @@ -111,7 +111,7 @@ namespace Rimworld_Animations { this.anim = anim; this.mirror = mirror; - curStage = 0; + curStage = fastAnimForQuickie ? 1 : 0; animTicks = 0; stageTicks = 0; clipTicks = 0; @@ -180,11 +180,15 @@ namespace Rimworld_Animations { clipPercent = 0; } - if(curStage >= anim.animationStages.Count && animTicks < anim.animationTimeTicks && pawn.jobs.curDriver is JobDriver_SexBaseInitiator) { + if(curStage >= anim.animationStages.Count) { + isAnimating = false; pawn.jobs.curDriver.ReadyForNextToil(); + + } else { + tickClip(); } - tickClip(); + } diff --git a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs index 310aee1..b297ff8 100644 --- a/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/Source/Patches/rjwPatches/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -52,16 +52,18 @@ namespace Rimworld_Animations { (Target.jobs.curDriver as JobDriver_SexBaseReciever).parteners.Add(pawn); } + bool quickie = (__instance is JobDriver_SexQuick) && AnimationSettings.fastAnimForQuickie; + if (bed != null) { - RerollAnimations(Target, __instance.duration, bed as Thing, __instance.sexType); + RerollAnimations(Target, __instance.duration, bed as Thing, __instance.sexType, quickie); } else { - RerollAnimations(Target, __instance.duration, sexType: __instance.sexType); + RerollAnimations(Target, __instance.duration, sexType: __instance.sexType, fastAnimForQuickie: quickie); } } } - public static void RerollAnimations(Pawn pawn, int duration, Thing bed = null, xxx.rjwSextype sexType = xxx.rjwSextype.None) { + public static void RerollAnimations(Pawn pawn, int duration, Thing bed = null, xxx.rjwSextype sexType = xxx.rjwSextype.None, bool fastAnimForQuickie = false) { if(pawn == null || !(pawn.jobs?.curDriver is JobDriver_SexBaseReciever)) { Log.Message("Error: Tried to reroll animations when pawn isn't sexing"); @@ -82,8 +84,6 @@ namespace Rimworld_Animations { Log.Message("Now playing " + anim.defName + (mirror ? " mirrored" : "")); - - IntVec3 pos = pawn.Position; for (int i = 0; i < pawnsToAnimate.Count; i++) { @@ -96,7 +96,7 @@ namespace Rimworld_Animations { } bool shiver = pawnsToAnimate[i].jobs.curDriver is JobDriver_SexBaseRecieverRaped; - pawnsToAnimate[i].TryGetComp().StartAnimation(anim, i, mirror, shiver); + pawnsToAnimate[i].TryGetComp().StartAnimation(anim, i, mirror, shiver, fastAnimForQuickie); (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; @@ -105,7 +105,7 @@ namespace Rimworld_Animations { (pawnsToAnimate[i].jobs.curDriver as JobDriver_Sex).ticks_between_hearts = Int32.MaxValue; } - } + } } else { Log.Message("Anim not found"); diff --git a/Source/Settings/AnimationSettings.cs b/Source/Settings/AnimationSettings.cs index b563e0c..f385c10 100644 --- a/Source/Settings/AnimationSettings.cs +++ b/Source/Settings/AnimationSettings.cs @@ -9,7 +9,7 @@ using UnityEngine; namespace Rimworld_Animations { public class AnimationSettings : ModSettings { - public static bool orgasmQuiver, rapeShiver, soundOverride = true, hearts = true, controlGenitalRotation = false, applySemenOnAnimationOrgasm = false; + public static bool orgasmQuiver, rapeShiver, soundOverride = true, hearts = true, controlGenitalRotation = false, applySemenOnAnimationOrgasm = false, fastAnimForQuickie = false; public static float shiverIntensity = 2f; public override void ExposeData() { @@ -18,6 +18,7 @@ namespace Rimworld_Animations { Scribe_Values.Look(ref controlGenitalRotation, "controlGenitalRotation", false); Scribe_Values.Look(ref orgasmQuiver, "orgasmQuiver"); + Scribe_Values.Look(ref fastAnimForQuickie, "fastAnimForQuickie"); Scribe_Values.Look(ref rapeShiver, "rapeShiver"); Scribe_Values.Look(ref hearts, "heartsOnLovin"); Scribe_Values.Look(ref applySemenOnAnimationOrgasm, "applySemenOnOrgasm", false); @@ -42,6 +43,7 @@ namespace Rimworld_Animations { listingStandard.CheckboxLabeled("Enable Sound Override", ref AnimationSettings.soundOverride); listingStandard.CheckboxLabeled("Control Genital Rotation", ref AnimationSettings.controlGenitalRotation); + listingStandard.CheckboxLabeled("Play Fast Animation for Quickie", ref AnimationSettings.fastAnimForQuickie); listingStandard.CheckboxLabeled("Apply Semen on Animation Orgasm", ref AnimationSettings.applySemenOnAnimationOrgasm); if(AnimationSettings.applySemenOnAnimationOrgasm) {