Experimental quivering on orgasm

This commit is contained in:
Platinum 2020-04-20 20:07:15 -07:00
parent 0a5b504d29
commit 9d70c2cb59
11 changed files with 78 additions and 4 deletions

View file

@ -68,7 +68,7 @@ namespace Rimworld_Animations {
//TESTING ANIMATIONS ONLY REMEMBER TO COMMENT OUT BEFORE PUSH
/*
if (x.defName != "Cowgirl")
if (x.defName != "Doggystyle")
return false;
*/

View file

@ -13,6 +13,7 @@ namespace Rimworld_Animations {
public AltitudeLayer layer = AltitudeLayer.Pawn;
public Dictionary<int, string> SoundEffects = new Dictionary<int, string>();
public Dictionary<int, bool> quiver = new Dictionary<int, bool>();
public SimpleCurve BodyAngle = new SimpleCurve();
public SimpleCurve HeadAngle = new SimpleCurve();
public SimpleCurve HeadBob = new SimpleCurve();
@ -89,6 +90,11 @@ namespace Rimworld_Animations {
SoundEffects.Add(keyframePosition, frame.soundEffect);
}
if(frame.tickDuration != 1 && frame.quiver.HasValue) {
quiver.Add(keyframePosition, true);
quiver.Add(keyframePosition + frame.tickDuration - 1, false);
}
keyframePosition += frame.tickDuration;
}

View file

@ -21,6 +21,7 @@ namespace Rimworld_Animations {
public int? headFacing;
public string soundEffect;
public bool? quiver;
public float? atTick;
}

View file

@ -35,7 +35,7 @@ namespace Rimworld_Animations {
}
}
private bool Animating;
private bool mirror = false;
private bool mirror = false, quiver = false;
private int actor;
private int animTicks = 0, stageTicks = 0, clipTicks = 0;
@ -114,6 +114,8 @@ namespace Rimworld_Animations {
stageTicks = 0;
clipTicks = 0;
quiver = false;
//tick once for initialization
tickAnim();
@ -184,6 +186,9 @@ namespace Rimworld_Animations {
if(rjw.RJWSettings.sounds_enabled && clip.SoundEffects.ContainsKey(clipTicks)) {
SoundDef.Named(clip.SoundEffects[clipTicks]).PlayOneShot(new TargetInfo(pawn.Position, pawn.Map));
}
if(AnimationSettings.orgasmQuiver && clip.quiver.ContainsKey(clipTicks)) {
quiver = clip.quiver[clipTicks];
}
//loop animation if possible
if (clipPercent >= 1 && stage.isLooping) {
@ -197,7 +202,7 @@ namespace Rimworld_Animations {
public void calculateDrawValues() {
deltaPos = new Vector3(clip.BodyOffsetX.Evaluate(clipPercent) * (mirror ? -1 : 1), clip.layer.AltitudeFor(), clip.BodyOffsetZ.Evaluate(clipPercent));
bodyAngle = clip.BodyAngle.Evaluate(clipPercent) * (mirror ? -1 : 1);
bodyAngle = (clip.BodyAngle.Evaluate(clipPercent) + (quiver ? (Rand.Value * 2f) - 1f : 0f)) * (mirror ? -1 : 1);
headAngle = clip.HeadAngle.Evaluate(clipPercent) * (mirror ? -1 : 1);
bodyFacing = mirror ? new Rot4((int)clip.BodyFacing.Evaluate(clipPercent)).Opposite : new Rot4((int)clip.BodyFacing.Evaluate(clipPercent));
@ -243,6 +248,8 @@ namespace Rimworld_Animations {
Scribe_Values.Look(ref headFacing, "headFacing");
Scribe_Values.Look(ref headFacing, "bodyFacing");
Scribe_Values.Look(ref quiver, "orgasmQuiver");
}
}

View file

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Verse;
using UnityEngine;
namespace Rimworld_Animations {
public class AnimationSettings : ModSettings {
public static bool orgasmQuiver;
public override void ExposeData() {
Scribe_Values.Look(ref orgasmQuiver, "orgasmQuiver");
base.ExposeData();
}
}
public class RJW_Animations : Mod {
public RJW_Animations(ModContentPack content) : base(content) {
}
public override void DoSettingsWindowContents(Rect inRect) {
Listing_Standard listingStandard = new Listing_Standard();
listingStandard.Begin(inRect);
listingStandard.CheckboxLabeled("Enable Orgasm Quiver", ref AnimationSettings.orgasmQuiver);
listingStandard.End();
base.DoSettingsWindowContents(inRect);
}
public override string SettingsCategory() {
return "RJW Animation Settings";
}
}
}