Compare commits

...

2 commits

Author SHA1 Message Date
c0ffee
7ca301f90a fixed audio bug 2022-10-24 17:50:20 -07:00
c0ffee
7ae88ba6ed fixed errors with transpiler patches 2022-10-24 13:49:49 -07:00
11 changed files with 104 additions and 73 deletions

View file

@ -10,8 +10,8 @@
<subSounds> <subSounds>
<li> <li>
<grains> <grains>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/cum</clipFolderPath> <clipPath>Sex/cum</clipPath>
</li> </li>
</grains> </grains>
<volumeRange> <volumeRange>
@ -39,8 +39,8 @@
<subSounds> <subSounds>
<li> <li>
<grains> <grains>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/kucyu04</clipFolderPath> <clipPath>Sex/kucyu04</clipPath>
</li> </li>
</grains> </grains>
<volumeRange> <volumeRange>
@ -68,35 +68,35 @@
<subSounds> <subSounds>
<li> <li>
<grains> <grains>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_1</clipFolderPath> <clipPath>Sex/Suck/Suck_1</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_2</clipFolderPath> <clipPath>Sex/Suck/Suck_2</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_3</clipFolderPath> <clipPath>Sex/Suck/Suck_3</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_4</clipFolderPath> <clipPath>Sex/Suck/Suck_4</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_5</clipFolderPath> <clipPath>Sex/Suck/Suck_5</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_6</clipFolderPath> <clipPath>Sex/Suck/Suck_6</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_7</clipFolderPath> <clipPath>Sex/Suck/Suck_7</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_8</clipFolderPath> <clipPath>Sex/Suck/Suck_8</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_9</clipFolderPath> <clipPath>Sex/Suck/Suck_9</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Suck/Suck_10</clipFolderPath> <clipPath>Sex/Suck/Suck_10</clipPath>
</li> </li>
</grains> </grains>
<volumeRange> <volumeRange>
@ -125,29 +125,29 @@
<subSounds> <subSounds>
<li> <li>
<grains> <grains>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_1</clipFolderPath> <clipPath>Sex/Clap_1</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_2</clipFolderPath> <clipPath>Sex/Clap_2</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_3</clipFolderPath> <clipPath>Sex/Clap_3</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_4</clipFolderPath> <clipPath>Sex/Clap_4</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_5</clipFolderPath> <clipPath>Sex/Clap_5</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_6</clipFolderPath> <clipPath>Sex/Clap_6</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_7</clipFolderPath> <clipPath>Sex/Clap_7</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Clap_8</clipFolderPath> <clipPath>Sex/Clap_8</clipPath>
</li> </li>
</grains> </grains>
<volumeRange> <volumeRange>
@ -176,20 +176,20 @@
<subSounds> <subSounds>
<li> <li>
<grains> <grains>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Slime/Slimy1</clipFolderPath> <clipPath>Sex/Slime/Slimy1</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Slime/Slimy2</clipFolderPath> <clipPath>Sex/Slime/Slimy2</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Slime/Slimy3</clipFolderPath> <clipPath>Sex/Slime/Slimy3</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Slime/Slimy4</clipFolderPath> <clipPath>Sex/Slime/Slimy4</clipPath>
</li> </li>
<li Class="AudioGrain_Folder"> <li Class="AudioGrain_Clip">
<clipFolderPath>Sex/Slime/Slimy5</clipFolderPath> <clipPath>Sex/Slime/Slimy5</clipPath>
</li> </li>
</grains> </grains>
<volumeRange> <volumeRange>

View file

@ -7,6 +7,7 @@ using Rimworld_Animations;
namespace Rimworld_Animations namespace Rimworld_Animations
{ {
/* todo: fix for 1.4
[StaticConstructorOnStartup] [StaticConstructorOnStartup]
public static class PawnWoundDrawerExtension public static class PawnWoundDrawerExtension
{ {
@ -15,7 +16,7 @@ namespace Rimworld_Animations
if (pawn == null) if (pawn == null)
{ return; } { return; }
if (!flags.FlagSet(PawnRenderFlags.Portrait) && layer == BodyTypeDef.WoundLayer.Head) if (!flags.FlagSet(PawnRenderFlags.Portrait) && layer == BodyTypeDef.WoundAnchor.)
{ {
CompBodyAnimator pawnAnimator = pawn.TryGetComp<CompBodyAnimator>(); CompBodyAnimator pawnAnimator = pawn.TryGetComp<CompBodyAnimator>();
if (pawnAnimator != null && pawnAnimator.isAnimating && pawn.Drawer.renderer.graphics.headGraphic != null) if (pawnAnimator != null && pawnAnimator.isAnimating && pawn.Drawer.renderer.graphics.headGraphic != null)
@ -31,4 +32,6 @@ namespace Rimworld_Animations
pawnWoundDrawer.RenderOverBody(drawLoc, bodyMesh, quat, drawNow, layer, pawnRot, overApparel); pawnWoundDrawer.RenderOverBody(drawLoc, bodyMesh, quat, drawNow, layer, pawnRot, overApparel);
} }
} }
*/
} }

View file

@ -18,12 +18,40 @@ namespace Rimworld_Animations {
{ {
static HarmonyPatch_AlienRace() static HarmonyPatch_AlienRace()
{ {
/*
(new Harmony("rjwanim")).Patch(AccessTools.Method(AccessTools.TypeByName("AlienRace.HarmonyPatches"), "DrawAddons"), (new Harmony("rjwanim")).Patch(AccessTools.Method(AccessTools.TypeByName("AlienRace.HarmonyPatches"), "DrawAddons"),
prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_AlienRace), "Prefix_AnimateHeadAddons"))); prefix: new HarmonyMethod(AccessTools.Method(typeof(HarmonyPatch_AlienRace), "Prefix_AnimateHeadAddons")));
*/
} }
public static void Prefix_DrawAddonsFinalHook(ref Pawn pawn, ref AlienPartGenerator.BodyAddon addon, ref Rot4 rot, ref Graphic graphic, ref Vector3 offsetVector, ref float angle, ref Material mat)
{
CompBodyAnimator animator = pawn.TryGetComp<CompBodyAnimator>();
public static bool Prefix_AnimateHeadAddons(PawnRenderFlags renderFlags, Vector3 vector /*rootloc*/, Vector3 headOffset, Pawn pawn, Quaternion quat, Rot4 rotation) if (animator == null || !animator.isAnimating)
{
return;
}
if(addon.alignWithHead || addon.drawnInBed)
{
rot = animator.headFacing;
angle = animator.headAngle;
offsetVector += angle * animator.headBob;
}
else
{
rot = animator.bodyFacing;
angle = animator.bodyAngle;
offsetVector += animator.deltaPos;
}
}
/*
public static bool Prefix_AnimateHeadAddons(PawnRenderFlags renderFlags, Vector3 vector, Vector3 headOffset, Pawn pawn, Quaternion quat, Rot4 rotation)
{ {
if (renderFlags.FlagSet(PawnRenderFlags.Portrait) || pawn.TryGetComp<CompBodyAnimator>() == null || !pawn.TryGetComp<CompBodyAnimator>().isAnimating) return true; if (renderFlags.FlagSet(PawnRenderFlags.Portrait) || pawn.TryGetComp<CompBodyAnimator>() == null || !pawn.TryGetComp<CompBodyAnimator>().isAnimating) return true;
@ -130,17 +158,8 @@ namespace Rimworld_Animations {
{ {
Quaternion addonRotation = Quaternion.AngleAxis(pawnAnimator.headAngle < 0 ? 360 - (360 % pawnAnimator.headAngle) : pawnAnimator.headAngle, Vector3.up); Quaternion addonRotation = Quaternion.AngleAxis(pawnAnimator.headAngle < 0 ? 360 - (360 % pawnAnimator.headAngle) : pawnAnimator.headAngle, Vector3.up);
/*
*
* genital rotation is borked
if (AnimationSettings.controlGenitalRotation && pawnAnimator.controlGenitalAngle && ba?.hediffGraphics != null && ba.hediffGraphics.Count != 0 && ba.hediffGraphics[0]?.path != null && (ba.hediffGraphics[0].path.Contains("Penis") || ba.hediffGraphics[0].path.Contains("penis")))
{
addonRotation = Quaternion.AngleAxis(angle: pawnAnimator.genitalAngle < 0 ? 360 - (360 % pawnAnimator.genitalAngle) : pawnAnimator.genitalAngle, axis: Vector3.up);
}
*/ GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: pawnAnimator.headFacing), loc: vector + orassanv + (ba.alignWithHead && !orassan ? headOffset : headOffset - addonRotation * pawn.Drawer.renderer.BaseHeadOffsetAt(pawnAnimator.headFacing)) + vector2.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: addonRotation)) * 2f * 57.29578f),
GenDraw.DrawMeshNowOrLater(mesh: addonGraphic.MeshAt(rot: pawnAnimator.headFacing), loc: vector /*rootloc*/ + orassanv + (ba.alignWithHead && !orassan ? headOffset : headOffset - addonRotation * pawn.Drawer.renderer.BaseHeadOffsetAt(pawnAnimator.headFacing)) + vector2.RotatedBy(angle: Mathf.Acos(f: Quaternion.Dot(a: Quaternion.identity, b: addonRotation)) * 2f * 57.29578f),
quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * addonRotation, mat: addonGraphic.MatAt(rot: pawnAnimator.headFacing), renderFlags.FlagSet(PawnRenderFlags.DrawNow)); quat: Quaternion.AngleAxis(angle: num, axis: Vector3.up) * addonRotation, mat: addonGraphic.MatAt(rot: pawnAnimator.headFacing), renderFlags.FlagSet(PawnRenderFlags.DrawNow));
@ -168,6 +187,8 @@ namespace Rimworld_Animations {
return false; return false;
} }
*/
} }
[HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")] [HarmonyPatch(typeof(PawnGraphicSet), "ResolveApparelGraphics")]

View file

@ -8,6 +8,7 @@ using RimWorld;
using Verse; using Verse;
using rjw; using rjw;
using System.Reflection.Emit; using System.Reflection.Emit;
using Verse.AI;
namespace Rimworld_Animations namespace Rimworld_Animations
{ {
@ -15,16 +16,16 @@ namespace Rimworld_Animations
[HarmonyPatch(typeof(JobDriver_SexBaseRecieverLoved), "MakeSexToil")] [HarmonyPatch(typeof(JobDriver_SexBaseRecieverLoved), "MakeSexToil")]
public static class HarmonyPatch_JobDriver_SexBaseReceiverLoved public static class HarmonyPatch_JobDriver_SexBaseReceiverLoved
{ {
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions) public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
{ {
var ins = codeInstructions.ToList(); var ins = codeInstructions.ToList();
for(int i = 0; i < ins.Count; i++) for(int i = 0; i < ins.Count; i++)
{ {
if(i + 13 < ins.Count && ins[i + 13].opcode == OpCodes.Call && ins[i + 13].OperandIs(AccessTools.DeclaredMethod(typeof(Toils_LayDown), "LayDown"))) { if(i < ins.Count && ins[i].opcode == OpCodes.Call && ins[i].OperandIs(AccessTools.DeclaredMethod(typeof(Toils_LayDown), "LayDown"))) {
ins.RemoveRange(i, 14); ins[i].operand = AccessTools.DeclaredMethod(typeof(HarmonyPatch_JobDriver_SexBaseReceiverLoved), "DoNotLayDown");
yield return ins[i];
} }
@ -36,5 +37,10 @@ namespace Rimworld_Animations
} }
public static Toil DoNotLayDown(TargetIndex bedOrRestSpotIndex, bool hasBed, bool lookForOtherJobs, bool canSleep = true, bool gainRestAndHealth = true, PawnPosture noBedLayingPosture = PawnPosture.LayingMask, bool deathrest = false)
{
return new Toil();
}
} }
} }

View file

@ -63,7 +63,7 @@ namespace Rimworld_Animations {
yield return ins[i]; yield return ins[i];
//headFacing equals true //headFacing equals true
} }
/*
// Fixes the offsets for eye implants and wounds on the head during animations // Fixes the offsets for eye implants and wounds on the head during animations
else if (ins[i].opcode == OpCodes.Callvirt && ins[i].operand != null && ins[i].OperandIs(AccessTools.DeclaredMethod(typeof(PawnWoundDrawer), "RenderOverBody"))) else if (ins[i].opcode == OpCodes.Callvirt && ins[i].operand != null && ins[i].OperandIs(AccessTools.DeclaredMethod(typeof(PawnWoundDrawer), "RenderOverBody")))
{ {
@ -73,7 +73,7 @@ namespace Rimworld_Animations {
yield return new CodeInstruction(OpCodes.Ldarg_S, (object)6); // renderer flags yield return new CodeInstruction(OpCodes.Ldarg_S, (object)6); // renderer flags
yield return new CodeInstruction(OpCodes.Call, AccessTools.DeclaredMethod(typeof(PawnWoundDrawerExtension), "RenderOverBody")); yield return new CodeInstruction(OpCodes.Call, AccessTools.DeclaredMethod(typeof(PawnWoundDrawerExtension), "RenderOverBody"));
} }
*/
else else
{ {
yield return ins[i]; yield return ins[i];

View file

@ -21,7 +21,7 @@
<li>1.4</li> <li>1.4</li>
<li IfModActive="velc.HatsDisplaySelection">Patch_HatsDisplaySelection/1.2</li> <li IfModActive="velc.HatsDisplaySelection">Patch_HatsDisplaySelection/1.2</li>
<li IfModActive="c0ffee.SexToysMasturbation">Patch_SexToysMasturbation</li> <li IfModActive="c0ffee.SexToysMasturbation">Patch_SexToysMasturbation</li>
<li IfModActive="c0ffee.SexToysMasturbation">Patch_SexToysMasturbation/1.3</li> <li IfModActive="c0ffee.SexToysMasturbation">Patch_SexToysMasturbation/1.4</li>
</v1.4> </v1.4>

View file

@ -17,7 +17,7 @@
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>
<DebugType>none</DebugType> <DebugType>none</DebugType>
<Optimize>false</Optimize> <Optimize>false</Optimize>
<OutputPath>1.3\Assemblies\</OutputPath> <OutputPath>1.4\Assemblies\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants> <DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport> <ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel> <WarningLevel>4</WarningLevel>
@ -73,8 +73,8 @@
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Source\Defs\SexToyAnimationDef.cs" /> <Compile Include="Source\Defs\SexToyAnimationDef.cs" />
<Compile Include="Source\Patches\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
<Compile Include="Source\Harmony\Harmony_PatchAll.cs" /> <Compile Include="Source\Harmony\Harmony_PatchAll.cs" />
<Compile Include="Source\Patches\HarmonyPatch_JobDriver_SexBaseInitiator.cs" />
<Compile Include="Source\Utilities\AnimSexToyUtility.cs" /> <Compile Include="Source\Utilities\AnimSexToyUtility.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View file

@ -9,9 +9,10 @@
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Rimworld_Animations</RootNamespace> <RootNamespace>Rimworld_Animations</RootNamespace>
<AssemblyName>Rimworld-Animations</AssemblyName> <AssemblyName>Rimworld-Animations</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion> <TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<Deterministic>true</Deterministic> <Deterministic>true</Deterministic>
<TargetFrameworkProfile />
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>false</DebugSymbols> <DebugSymbols>false</DebugSymbols>
@ -32,11 +33,11 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="0Harmony"> <Reference Include="0Harmony">
<HintPath>..\..\..\..\workshop\content\294100\2009463077\Current\Assemblies\0Harmony.dll</HintPath> <HintPath>..\..\..\..\workshop\content\294100\839005762\1.4\Assemblies\0Harmony.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="AlienRace"> <Reference Include="AlienRace">
<HintPath>..\..\..\..\workshop\content\294100\839005762\1.3\Assemblies\AlienRace.dll</HintPath> <HintPath>..\..\..\..\workshop\content\294100\839005762\1.4\Assemblies\AlienRace.dll</HintPath>
<Private>False</Private> <Private>False</Private>
</Reference> </Reference>
<Reference Include="Assembly-CSharp"> <Reference Include="Assembly-CSharp">