diff --git a/1.5/Assemblies/Rimworld-Animations.dll b/1.5/Assemblies/Rimworld-Animations.dll index 634cfa9..93d7989 100644 Binary files a/1.5/Assemblies/Rimworld-Animations.dll and b/1.5/Assemblies/Rimworld-Animations.dll differ diff --git a/1.5/Defs/AnimationDefs/TestAnimation1.xml b/1.5/Defs/AnimationDefs/TestAnimation1.xml deleted file mode 100644 index f106da7..0000000 --- a/1.5/Defs/AnimationDefs/TestAnimation1.xml +++ /dev/null @@ -1,114 +0,0 @@ - - - - TestAnimation1 - 400 - False - -
  • - Pawn -
  • -
    - - -
  • - Root - - Rimworld_Animations.AnimationWorker_KeyframesExtended - -
  • - 30 - 0 - North - true -
  • -
  • - 100 - 0 - East - true -
  • -
  • - 200 - 0 - South - true -
  • -
  • - 300 - 0 - West - true -
  • - - - - -
  • - Head - - Rimworld_Animations.AnimationWorker_KeyframesExtended - -
  • - 0 - 0 - North - true -
  • -
  • - 2 - 0 - East - true -
  • -
  • - 4 - 0 - South - true -
  • -
  • - 6 - 0 - West - false -
  • -
  • - 8 - 0 - North - false -
  • - - - -
    -
    -
    diff --git a/1.5/Defs/AnimationDefs/TestAnimation2.xml b/1.5/Defs/AnimationDefs/TestAnimation2.xml deleted file mode 100644 index 712cb2c..0000000 --- a/1.5/Defs/AnimationDefs/TestAnimation2.xml +++ /dev/null @@ -1,60 +0,0 @@ - - - - TestAnimation2 - 200 - False - False - - -
  • - Root - - AnimationWorker_Keyframes - -
  • - 0 - 23 -
  • -
  • - 6 - -5 -
  • -
  • - 12 - 4 -
  • -
  • - 188 - -1 -
  • - - - -
  • - Head - - AnimationWorker_Keyframes - -
  • - 0 - 5 -
  • -
  • - 6 - -5 -
  • -
  • - 12 - 4 -
  • -
  • - 128 - -1 -
  • - - - -
    -
    -
    diff --git a/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml b/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml deleted file mode 100644 index 0bf9f68..0000000 --- a/1.5/Defs/GroupAnimationDefs/TestGroupAnimation1.xml +++ /dev/null @@ -1,111 +0,0 @@ - - - - TestGroupAnimation1 - 2 - -
  • - 200 - -
  • Pawn1_Stage1_TestAnimation1
  • -
  • Pawn2_Stage1_TestAnimation2
  • - - -
  • - 10 - -
  • - 3 - -
  • Pawn1_Stage2_Variant1
  • -
  • Pawn2_Stage2_Variant1
  • - - - -
  • - 1 - -
  • Pawn1_Stage2_Variant2
  • -
  • Pawn2_Stage2_Variant2
  • - - - - - -
  • - -
  • - 10 - -
  • - 3 -
  • Pawn1_Stage2_Variant1
  • -
  • Pawn2_Stage2_Variant1
  • - - -
  • - 1 -
  • Pawn1_Stage2_Variant2
  • -
  • Pawn2_Stage2_Variant2
  • - - - - -
  • - 10 - -
  • - 3 -
  • Pawn1_Stage2_Variant1
  • -
  • Pawn2_Stage2_Variant1
  • - - -
  • - 1 -
  • Pawn1_Stage2_Variant2
  • -
  • Pawn2_Stage2_Variant2
  • - - - - - - -
    - - -
  • - -
  • Sex
  • - - 0 - -
  • - -
  • Sex_Reverse
  • - - 1 - -
  • - -
  • Sex
  • - - -
  • Human
  • -
  • Dog
  • -
    - 0 - -
  • - -
  • Sex_Reverse
  • - - -
  • Dog
  • -
  • Human
  • -
    - 1 - -
    - -
    -
    diff --git a/1.5/Patches/Patch_GenitaliaRenderNode.xml b/1.5/Patches/Patch_GenitaliaRenderNode.xml deleted file mode 100644 index 553374a..0000000 --- a/1.5/Patches/Patch_GenitaliaRenderNode.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs b/1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs deleted file mode 100644 index 50af003..0000000 --- a/1.5/Source/AnimationWorkers/AnimationWorker_KeyframesExtended.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using Verse; - -namespace Rimworld_Animations -{ - class AnimationWorker_KeyframesExtended : AnimationWorker_Keyframes - { - - public AnimationWorker_KeyframesExtended(AnimationDef def, Pawn pawn, AnimationPart part, PawnRenderNode node) : base(def, pawn, part, node) - { - } - - - - //use extendedkeyframes to determine addon facing - public Rot4 facingAtTick(int tick) - { - //if ticks are < first keyframe tick, just be stuck to first keyframe rot - if (tick <= this.part.keyframes[0].tick) { - - return (this.part.keyframes[0] as ExtendedKeyframe).rotation; - - } - - //if ticks are > last keyframe tick, just be stuck to last keyframe rot - if (tick >= this.part.keyframes[this.part.keyframes.Count - 1].tick) - { - - return (this.part.keyframes[this.part.keyframes.Count - 1] as ExtendedKeyframe).rotation; - - } - Verse.Keyframe keyframe = this.part.keyframes[0]; - Verse.Keyframe keyframe2 = this.part.keyframes[this.part.keyframes.Count - 1]; - int i = 0; - while (i < this.part.keyframes.Count) - { - if (tick <= this.part.keyframes[i].tick) - { - keyframe2 = this.part.keyframes[i]; - if (i > 0) - { - keyframe = this.part.keyframes[i - 1]; - break; - } - break; - } - else - { - i++; - } - } - - return (keyframe as ExtendedKeyframe).rotation; - - } - - - public bool visibleAtTick(int tick) - { - //if ticks are < first keyframe tick, just be stuck to first keyframe rot - if (tick <= this.part.keyframes[0].tick) - { - - return (this.part.keyframes[0] as ExtendedKeyframe).visible; - - } - - //if ticks are > last keyframe tick, just be stuck to last keyframe rot - if (tick >= this.part.keyframes[this.part.keyframes.Count - 1].tick) - { - - return (this.part.keyframes[this.part.keyframes.Count - 1] as ExtendedKeyframe).visible; - - } - - Verse.Keyframe keyframe = this.part.keyframes[0]; - Verse.Keyframe keyframe2 = this.part.keyframes[this.part.keyframes.Count - 1]; - - int i = 0; - while (i < this.part.keyframes.Count) - { - if (tick <= this.part.keyframes[i].tick) - { - keyframe2 = this.part.keyframes[i]; - if (i > 0) - { - keyframe = this.part.keyframes[i - 1]; - break; - } - break; - } - else - { - i++; - } - } - - return (keyframe as ExtendedKeyframe).visible; - - - } - } -} diff --git a/1.5/Source/Defs/AnimationDefOf.cs b/1.5/Source/Defs/AnimationDefOf.cs deleted file mode 100644 index 9c62e50..0000000 --- a/1.5/Source/Defs/AnimationDefOf.cs +++ /dev/null @@ -1,22 +0,0 @@ -using RimWorld; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - [DefOf] - public static class AnimationDefOf - { - static AnimationDefOf() - { - DefOfHelper.EnsureInitializedInCtor(typeof(SoundDefOf)); - } - - public static AnimationDef TestAnimation1; - public static AnimationDef TestAnimation2; - } -} diff --git a/1.5/Source/GroupAnimationStages/AnimationStage.cs b/1.5/Source/GroupAnimationStages/AnimationStage.cs deleted file mode 100644 index 58e86ab..0000000 --- a/1.5/Source/GroupAnimationStages/AnimationStage.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - public abstract class AnimationStage - { - - //Return a list containing a tuple; int for how long the animation should play for - public abstract List> GetAnimations(int actor, int seed); - - } -} diff --git a/1.5/Source/GroupAnimationStages/AnimationStage_Branch.cs b/1.5/Source/GroupAnimationStages/AnimationStage_Branch.cs deleted file mode 100644 index deb7751..0000000 --- a/1.5/Source/GroupAnimationStages/AnimationStage_Branch.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - public class AnimationStage_Branch : AnimationStage - { - List paths; - public override List> GetAnimations(int actor, int seed) - { - return paths[(seed * 59) % paths.Count].GetAnimations(actor, seed); - } - } -} diff --git a/1.5/Source/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs b/1.5/Source/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs deleted file mode 100644 index 6ef1ad4..0000000 --- a/1.5/Source/GroupAnimationStages/AnimationStage_LoopRandomSelectChance.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - public class AnimationStage_LoopRandomSelectChance : AnimationStage - { - public int loops; - public List animationOptions; - - public override List> GetAnimations(int actor, int seed) - { - int numberOfActors = animationOptions[0].animationDefs.Count; - List> animations = new List>(); - - for (int i = 0; i < loops; i++) - { - - AnimationLoopOption option = getAnimationLoopOptionByWeight(seed + i, out int longestAnimLength); - Tuple animation = Tuple.Create(longestAnimLength, option.animationDefs[actor]); - animations.Append(animation); - } - - return animations; - } - - public class AnimationLoopOption - { - public int probability; - public List animationDefs; - } - - //select random element from loop options by weight; also calculate the longest anim length - public AnimationLoopOption getAnimationLoopOptionByWeight(int seed, out int longestAnimLength) - { - int totalWeight = animationOptions.Sum(x => x.probability); - int randomNumber = (seed * 56) % totalWeight; - - int cumulativeWeight = 0; - foreach(AnimationLoopOption option in animationOptions) { - cumulativeWeight += option.probability; - if (randomNumber <= cumulativeWeight) - { - longestAnimLength = option.animationDefs.Max(x => x.durationTicks); - return option; - } - } - - longestAnimLength = animationOptions[0].animationDefs.Max(x => x.durationTicks); - return animationOptions[0]; - } - - - } -} diff --git a/1.5/Source/GroupAnimationStages/AnimationStage_TicksDuration.cs b/1.5/Source/GroupAnimationStages/AnimationStage_TicksDuration.cs deleted file mode 100644 index e502596..0000000 --- a/1.5/Source/GroupAnimationStages/AnimationStage_TicksDuration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - public class AnimationStage_TicksDuration : AnimationStage - { - int ticks; - List animationDefs; - - public override List> GetAnimations(int actor, int seed) - { - return new List>() { Tuple.Create(ticks, animationDefs[actor]) }; - } - } -} diff --git a/1.5/Source/Keyframes/ExtendedKeyframe.cs b/1.5/Source/Keyframes/ExtendedKeyframe.cs deleted file mode 100644 index e5e6701..0000000 --- a/1.5/Source/Keyframes/ExtendedKeyframe.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using UnityEngine; -using Verse; - -namespace Rimworld_Animations -{ - public class ExtendedKeyframe : Verse.Keyframe - { - - public Rot4 rotation; - public SoundDef sound = null; - public bool visible; - - } -} diff --git a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Sex.cs b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Sex.cs deleted file mode 100644 index f18dbcf..0000000 --- a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_Sex.cs +++ /dev/null @@ -1,24 +0,0 @@ -using HarmonyLib; -using rjw; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - /* - [HarmonyPatch(typeof(JobDriver_Sex), "SexTick")] - public class HarmonyPatch_JobDriver_Sex - { - public static void Prefix(JobDriver_Sex __instance) - { - Pawn partner = __instance.Partner; - - } - } - - */ -} diff --git a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs index 9f11a1c..56d756c 100644 --- a/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs +++ b/1.5/Source/Patches/RJWPatches/JobDrivers/HarmonyPatch_JobDriver_SexBaseInitiator.cs @@ -16,9 +16,7 @@ namespace Rimworld_Animations { don't play anim for now */ if(__instance is JobDriver_Masturbate || __instance is JobDriver_ViolateCorpse) { - return; - } if(!AnimationSettings.PlayAnimForNonsexualActs && NonSexualAct(__instance)) @@ -27,10 +25,10 @@ namespace Rimworld_Animations { } Pawn pawn = __instance.pawn; - Pawn partner = __instance.Target as Pawn; + Building_Bed bed = __instance.Bed; - if (partner?.jobs?.curDriver is JobDriver_SexBaseReciever partnerSexBaseReceiver) { + if ((__instance.Target as Pawn)?.jobs?.curDriver is JobDriver_SexBaseReciever) { Pawn Target = __instance.Target as Pawn; @@ -39,12 +37,17 @@ namespace Rimworld_Animations { int preAnimDuration = __instance.duration; int AnimationTimeTicks = 0; - List participants = partnerSexBaseReceiver.parteners.Append(partner).ToList(); - RerollAnimations(participants); + + if (bed != null) { + RerollAnimations(bed as Thing); + } + else { + RerollAnimations(); + } //Modify Orgasm ticks to only orgasm as many times as RJW stock orgasm allows - if (AnimationTimeTicks != 0) + if(AnimationTimeTicks != 0) { __instance.orgasmstick = preAnimDuration * __instance.orgasmstick / AnimationTimeTicks; } @@ -53,11 +56,9 @@ namespace Rimworld_Animations { } } - public static void RerollAnimations(List participants) { - - participants[0].Drawer.renderer.SetAnimation(AnimationDefOf.TestAnimation1); - participants[1].Drawer.renderer.SetAnimation(AnimationDefOf.TestAnimation2); + public static void RerollAnimations(Thing bed = null) { + } diff --git a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderNode.cs b/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderNode.cs deleted file mode 100644 index 8855f47..0000000 --- a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_PawnRenderNode.cs +++ /dev/null @@ -1,47 +0,0 @@ -using HarmonyLib; -using RimWorld; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Verse; - -namespace Rimworld_Animations -{ - //Head Rotation Code - [HarmonyPatch(typeof(PawnRenderNode), "AppendRequests")] - public static class HarmonyPatch_PawnRenderNode - { - //if rendernodetag is head, update PawnDrawParms so that head, and all children, are rotated for anim - public static bool Prefix(ref PawnRenderNode __instance, ref PawnDrawParms parms) - { - if (__instance.AnimationWorker is AnimationWorker_KeyframesExtended extendedAnimWorker) - { - //INVIS IF ANIM CALLS FOR IT - //replace maybe? - if (!extendedAnimWorker.visibleAtTick(__instance.tree.AnimationTick)) - { - __instance.requestRecache = true; - return false; - } - - - // HEAD ROTATION ADJUST FACING - - Rot4 animFacing = extendedAnimWorker.facingAtTick(__instance.tree.AnimationTick); - - if (parms.facing != animFacing) - { - //requestRecache or else it won't update properly - __instance.requestRecache = true; - parms.facing = animFacing; - } - - } - - return true; - - } - } -} diff --git a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_Pawn_DrawTracker.cs b/1.5/Source/Patches/RimworldPatches/HarmonyPatch_Pawn_DrawTracker.cs deleted file mode 100644 index b02b20a..0000000 --- a/1.5/Source/Patches/RimworldPatches/HarmonyPatch_Pawn_DrawTracker.cs +++ /dev/null @@ -1,27 +0,0 @@ -using HarmonyLib; -using rjw; -using UnityEngine; -using Verse; - -namespace Rimworld_Animations { - - [HarmonyPatch(typeof(Pawn_DrawTracker), "DrawPos", MethodType.Getter)] - public static class HarmonyPatch_Pawn_DrawTracker { - public static bool Prefix(ref Pawn ___pawn, ref Vector3 __result) { - - if (___pawn?.Drawer?.renderer?.renderTree?.rootNode?.AnimationWorker is AnimationWorker_KeyframesExtended - && ___pawn.jobs?.curDriver is JobDriver_SexBaseInitiator sexdriver) - { - //align pos on top of partner - __result = sexdriver.Partner.Drawer.DrawPos; - - //change height so that they're all layered properly - if (sexdriver.Partner.jobs.curDriver is JobDriver_SexBaseReciever) - for (int i = 0; i < ) - return false; - } - - return true; - } - } -} diff --git a/Patch_SexToysMasturbation/1.5/Assemblies/Patch_SexToysMasturbation.dll b/Patch_SexToysMasturbation/1.5/Assemblies/Patch_SexToysMasturbation.dll index e213401..858a7e1 100644 Binary files a/Patch_SexToysMasturbation/1.5/Assemblies/Patch_SexToysMasturbation.dll and b/Patch_SexToysMasturbation/1.5/Assemblies/Patch_SexToysMasturbation.dll differ diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 4aff51e..1f5a8fb 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -72,27 +72,17 @@ - - - - - - - - - - @@ -100,16 +90,10 @@ - - - - - - + - @@ -149,7 +133,10 @@ - + + + +