play fast anim for quickie -- enable in options

This commit is contained in:
Platinum 2020-05-05 13:31:42 -07:00
parent 1509e9fff6
commit d3db12f744
4 changed files with 18 additions and 12 deletions

View File

@ -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();
}

View File

@ -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<CompBodyAnimator>().StartAnimation(anim, i, mirror, shiver);
pawnsToAnimate[i].TryGetComp<CompBodyAnimator>().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");

View File

@ -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) {