mirror of
https://gitgud.io/AbstractConcept/rimworld-animations-patch.git
synced 2024-08-15 00:43:27 +00:00
767317773b
Change log v 2.0.1 - Fixed issue with a hand animation calling a missing method - Fixed errored that was triggering at the end of sex - Dependency on Humanoid Alien Race is now listed and enforced in the mod load screen - Made XML patching more robust
33 lines
1.1 KiB
C#
33 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Xml;
|
|
using UnityEngine;
|
|
using Verse;
|
|
|
|
namespace Rimworld_Animations_Patch
|
|
{
|
|
public class StrokeGenitalsUpAndDown_FacingNS : HandMotion
|
|
{
|
|
public override Vector3 GetHandPosition(Pawn pawn, HandAnimationData handAnimationData, float baseAngle)
|
|
{
|
|
Vector3 handPosition = new Vector3();
|
|
ActorAnimationData data = pawn.GetAnimationData();
|
|
|
|
float p = (Mathf.PingPong(data.stageTicks, handAnimationData.cycleTime) / handAnimationData.cycleTime);
|
|
float size = HandAnimationUtility.GetGenitalSize(pawn, handAnimationData.targetBodyPart) * 0.2f;
|
|
float m = (data.actorFacing == Rot4.North ? -1f : 1f) * (handAnimationData.mirror ? -1f : 1f) * (data.isMirrored ? -1f : 1f);
|
|
|
|
handPosition.x = 0.025f * m;
|
|
handPosition.z = size * p;
|
|
|
|
handPosition = handPosition.RotatedBy(baseAngle);
|
|
|
|
return handPosition;
|
|
}
|
|
}
|
|
}
|