diff --git a/1.5/Assemblies/Rimworld-Animations.dll b/1.5/Assemblies/Rimworld-Animations.dll index d531c03..7fc6159 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/GroupAnimationDefs/Beast/DogBeast/GroupAnimation_DogBeast.xml b/1.5/Defs/GroupAnimationDefs/Beast/DogBeast/GroupAnimation_DogBeast.xml index 62371c8..7168ff7 100644 --- a/1.5/Defs/GroupAnimationDefs/Beast/DogBeast/GroupAnimation_DogBeast.xml +++ b/1.5/Defs/GroupAnimationDefs/Beast/DogBeast/GroupAnimation_DogBeast.xml @@ -128,7 +128,6 @@ 1 1 -
  • @@ -136,6 +135,7 @@
  • Wolf_Timber
  • Wolf_Arctic
  • +
  • Whitefox
  • Warg
  • Husky
  • LabradorRetriever
  • @@ -143,6 +143,7 @@ +
  • Bestiality_Vaginal
  • diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_AgeRange.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_AgeRange.cs index f9134a3..d17f3c9 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_AgeRange.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_AgeRange.cs @@ -24,6 +24,12 @@ namespace Rimworld_Animations List pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale); return pawnOffsets.Find(x => x.bodyType == pawn.story.bodyType && x.ageRange.Includes(pawn.ageTracker.AgeBiologicalYears))?.rotation ?? pawnOffsets.Last().rotation; } + + public override Vector3? getScale(Pawn pawn) + { + List pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale); + return pawnOffsets.Find(x => x.bodyType == pawn.story.bodyType && x.ageRange.Includes(pawn.ageTracker.AgeBiologicalYears))?.scale ?? pawnOffsets.Last().scale; + } } public class BodyTypeOffset_AgeRange : BodyTypeOffset diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs index 3777af7..d0d93ae 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyType.cs @@ -23,6 +23,11 @@ namespace Rimworld_Animations { return offsets.Find(x => x.bodyType == pawn.story.bodyType)?.rotation; } + + public override Vector3? getScale(Pawn pawn) + { + return offsets.Find(x => x.bodyType == pawn.story.bodyType)?.scale; + } } } diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs index f6d44a3..5470448 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_BodyTypeGendered.cs @@ -40,5 +40,19 @@ namespace Rimworld_Animations } } + + public override Vector3? getScale(Pawn pawn) + { + + if (pawn.gender == Gender.Female) + { + return offsetsFemale.Find(x => x.bodyType == pawn.story.bodyType)?.scale; + } + else + { + return offsetsMale.Find(x => x.bodyType == pawn.story.bodyType)?.scale; + } + + } } } diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs index 2744039..a728834 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/AnimationOffset_Single.cs @@ -13,6 +13,7 @@ namespace Rimworld_Animations public Vector3 offset; public int? rotation; + public Vector3? scale = Vector3.one; public override Vector3? getOffset(Pawn pawn) { @@ -23,5 +24,10 @@ namespace Rimworld_Animations { return rotation; } + + public override Vector3? getScale(Pawn pawn) + { + return scale; + } } } diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs index 57bab15..ab6d42d 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/BaseAnimationOffset.cs @@ -17,6 +17,8 @@ namespace Rimworld_Animations public abstract int? getRotation(Pawn pawn); + public abstract Vector3? getScale(Pawn pawn); + public bool appliesToPawn(Pawn pawn) { return races.Contains(pawn.def); diff --git a/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs b/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs index df35501..b441262 100644 --- a/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs +++ b/1.5/Source/Animations/AnimationOffsets/Offsets/BodyTypeOffset.cs @@ -14,5 +14,6 @@ namespace Rimworld_Animations public BodyTypeDef bodyType; public int rotation = 0; public Vector3 offset; + public Vector3 scale = Vector3.one; } } diff --git a/1.5/Source/Animations/PawnTests/PawnTest_Humanlike.cs b/1.5/Source/Animations/PawnTests/PawnTest_Humanlike.cs new file mode 100644 index 0000000..dbbf8fe --- /dev/null +++ b/1.5/Source/Animations/PawnTests/PawnTest_Humanlike.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Verse; + +namespace Rimworld_Animations +{ + public class PawnTest_Humanlike : BasePawnTest + { + public override bool PawnTest(Pawn pawn) + { + return pawn.RaceProps.Humanlike; + } + } +} diff --git a/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs index e45c0d3..188d707 100644 --- a/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs +++ b/1.5/Source/PawnRenderNode/GraphicVariants/PawnRenderNodeWorker_GraphicVariants.cs @@ -87,6 +87,29 @@ namespace Rimworld_Animations return regularOffsets; } + public override Vector3 ScaleFor(PawnRenderNode node, PawnDrawParms parms) + { + Vector3 regularScale = base.ScaleFor(node, parms); + + if ((node.Props as PawnRenderNodeProperties_GraphicVariants)?.propOffsetDef?.offsets is List offsets) + { + foreach (BaseAnimationOffset offset in offsets) + { + + if (offset.appliesToPawn(node.tree.pawn)) + { + + //modify scale of prop for animationOffset position + regularScale = regularScale.MultipliedBy(offset.getScale(node.tree.pawn) ?? Vector3.one); + return regularScale; + + } + } + } + + return regularScale; + } + public override Quaternion RotationFor(PawnRenderNode node, PawnDrawParms parms) { Quaternion rotation = base.RotationFor(node, parms); diff --git a/1.5/Source/Utilities/AnimationUtility.cs b/1.5/Source/Utilities/AnimationUtility.cs index 1fdc73c..ab3bb0d 100644 --- a/1.5/Source/Utilities/AnimationUtility.cs +++ b/1.5/Source/Utilities/AnimationUtility.cs @@ -47,7 +47,7 @@ namespace Rimworld_Animations { if (RJWAnimationSettings.debugMode) { - Log.Message("Now playing animation: " + groupAnimationDef.defName); + Log.Message("Now playing animation: " + groupAnimationDef.defName + " Actor Shift: " + reorder); } participants[i].TryGetComp().PlayGroupAnimation(allAnimationsForPawn, position, rotation, animatorAnchor); diff --git a/Rimworld-Animations.csproj b/Rimworld-Animations.csproj index 25ed36e..b8d26fa 100644 --- a/Rimworld-Animations.csproj +++ b/Rimworld-Animations.csproj @@ -86,6 +86,7 @@ +