mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Compare commits
4 commits
0b4cca30a2
...
a458f3b83f
Author | SHA1 | Date | |
---|---|---|---|
|
a458f3b83f | ||
|
31cba83bc2 | ||
|
2f7bae49db | ||
|
77874ad5b0 |
12 changed files with 78 additions and 2 deletions
Binary file not shown.
|
@ -128,7 +128,6 @@
|
||||||
<priority>1</priority>
|
<priority>1</priority>
|
||||||
<actorShift>1</actorShift>
|
<actorShift>1</actorShift>
|
||||||
<whitelist>
|
<whitelist>
|
||||||
<li Class="Rimworld_Animations.PawnTest_RJWCanBeFucked" /> <!-- Human -->
|
|
||||||
<li Class="Rimworld_Animations.PawnTest_Multi"> <!-- Dog -->
|
<li Class="Rimworld_Animations.PawnTest_Multi"> <!-- Dog -->
|
||||||
<tests>
|
<tests>
|
||||||
<li Class="Rimworld_Animations.PawnTest_RJWCanFuck" />
|
<li Class="Rimworld_Animations.PawnTest_RJWCanFuck" />
|
||||||
|
@ -136,6 +135,7 @@
|
||||||
<races>
|
<races>
|
||||||
<li>Wolf_Timber</li>
|
<li>Wolf_Timber</li>
|
||||||
<li>Wolf_Arctic</li>
|
<li>Wolf_Arctic</li>
|
||||||
|
<li>Whitefox</li>
|
||||||
<li>Warg</li>
|
<li>Warg</li>
|
||||||
<li>Husky</li>
|
<li>Husky</li>
|
||||||
<li>LabradorRetriever</li>
|
<li>LabradorRetriever</li>
|
||||||
|
@ -143,6 +143,7 @@
|
||||||
</li>
|
</li>
|
||||||
</tests>
|
</tests>
|
||||||
</li>
|
</li>
|
||||||
|
<li Class="Rimworld_Animations.PawnTest_RJWCanBeFucked" /> <!-- Human -->
|
||||||
</whitelist>
|
</whitelist>
|
||||||
<interactionDefs>
|
<interactionDefs>
|
||||||
<li>Bestiality_Vaginal</li>
|
<li>Bestiality_Vaginal</li>
|
||||||
|
|
|
@ -24,6 +24,12 @@ namespace Rimworld_Animations
|
||||||
List<BodyTypeOffset_AgeRange> pawnOffsets = (pawn.gender == Gender.Male ? offsetsMale : offsetsFemale);
|
List<BodyTypeOffset_AgeRange> 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;
|
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<BodyTypeOffset_AgeRange> 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
|
public class BodyTypeOffset_AgeRange : BodyTypeOffset
|
||||||
|
|
|
@ -23,6 +23,11 @@ namespace Rimworld_Animations
|
||||||
{
|
{
|
||||||
return offsets.Find(x => x.bodyType == pawn.story.bodyType)?.rotation;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ namespace Rimworld_Animations
|
||||||
|
|
||||||
public Vector3 offset;
|
public Vector3 offset;
|
||||||
public int? rotation;
|
public int? rotation;
|
||||||
|
public Vector3? scale = Vector3.one;
|
||||||
|
|
||||||
public override Vector3? getOffset(Pawn pawn)
|
public override Vector3? getOffset(Pawn pawn)
|
||||||
{
|
{
|
||||||
|
@ -23,5 +24,10 @@ namespace Rimworld_Animations
|
||||||
{
|
{
|
||||||
return rotation;
|
return rotation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override Vector3? getScale(Pawn pawn)
|
||||||
|
{
|
||||||
|
return scale;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,6 +17,8 @@ namespace Rimworld_Animations
|
||||||
|
|
||||||
public abstract int? getRotation(Pawn pawn);
|
public abstract int? getRotation(Pawn pawn);
|
||||||
|
|
||||||
|
public abstract Vector3? getScale(Pawn pawn);
|
||||||
|
|
||||||
public bool appliesToPawn(Pawn pawn)
|
public bool appliesToPawn(Pawn pawn)
|
||||||
{
|
{
|
||||||
return races.Contains(pawn.def);
|
return races.Contains(pawn.def);
|
||||||
|
|
|
@ -14,5 +14,6 @@ namespace Rimworld_Animations
|
||||||
public BodyTypeDef bodyType;
|
public BodyTypeDef bodyType;
|
||||||
public int rotation = 0;
|
public int rotation = 0;
|
||||||
public Vector3 offset;
|
public Vector3 offset;
|
||||||
|
public Vector3 scale = Vector3.one;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
17
1.5/Source/Animations/PawnTests/PawnTest_Humanlike.cs
Normal file
17
1.5/Source/Animations/PawnTests/PawnTest_Humanlike.cs
Normal file
|
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -87,6 +87,29 @@ namespace Rimworld_Animations
|
||||||
return regularOffsets;
|
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<BaseAnimationOffset> 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)
|
public override Quaternion RotationFor(PawnRenderNode node, PawnDrawParms parms)
|
||||||
{
|
{
|
||||||
Quaternion rotation = base.RotationFor(node, parms);
|
Quaternion rotation = base.RotationFor(node, parms);
|
||||||
|
|
|
@ -47,7 +47,7 @@ namespace Rimworld_Animations {
|
||||||
|
|
||||||
if (RJWAnimationSettings.debugMode)
|
if (RJWAnimationSettings.debugMode)
|
||||||
{
|
{
|
||||||
Log.Message("Now playing animation: " + groupAnimationDef.defName);
|
Log.Message("Now playing animation: " + groupAnimationDef.defName + " Actor Shift: " + reorder);
|
||||||
}
|
}
|
||||||
|
|
||||||
participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, position, rotation, animatorAnchor);
|
participants[i].TryGetComp<CompExtendedAnimator>().PlayGroupAnimation(allAnimationsForPawn, position, rotation, animatorAnchor);
|
||||||
|
|
|
@ -86,6 +86,7 @@
|
||||||
<Compile Include="1.5\Source\Animations\AnimationProps\AnimationPropDef.cs" />
|
<Compile Include="1.5\Source\Animations\AnimationProps\AnimationPropDef.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\AnimationWorkers\AnimationWorker_KeyframesExtended.cs" />
|
<Compile Include="1.5\Source\Animations\AnimationWorkers\AnimationWorker_KeyframesExtended.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\BasePawnTest.cs" />
|
<Compile Include="1.5\Source\Animations\PawnTests\BasePawnTest.cs" />
|
||||||
|
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Humanlike.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_PrisonerOfColony.cs" />
|
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_PrisonerOfColony.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_SlaveOfColony.cs" />
|
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_SlaveOfColony.cs" />
|
||||||
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Always.cs" />
|
<Compile Include="1.5\Source\Animations\PawnTests\PawnTest_Always.cs" />
|
||||||
|
|
Loading…
Reference in a new issue