using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using CrazyHeadRotations.Patches;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CrazyHeadRotations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CrazyHeadRotations")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("81030cde-9bf7-415d-8ea7-02c6f2c20f20")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CrazyHeadRotations
{
[BepInPlugin("DuckyVR.DucksHeadMod", "Crazy Heads", "1.0.0.0")]
public class CrazyTalkBase : BaseUnityPlugin
{
private const string modGUID = "DuckyVR.DucksHeadMod";
private const string modName = "Crazy Heads";
private const string modVersion = "1.0.0.0";
internal ConfigEntry<float> PatchRotation;
private readonly Harmony harmony = new Harmony("DuckyVR.DucksHeadMod");
public static CrazyTalkBase Instance;
internal ManualLogSource mls;
private void Awake()
{
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
if ((Object)(object)Instance == (Object)null)
{
Instance = this;
}
mls = Logger.CreateLogSource("DuckyVR.DucksHeadMod");
PatchRotation = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Head Rotation", 45f, new ConfigDescription("Sets the maximum rotation of the head.", (AcceptableValueBase)new AcceptableValueRange<float>(0f, 360f), Array.Empty<object>()));
mls.LogInfo((object)("ROTATION: " + PatchRotation.Value));
harmony.PatchAll(typeof(PlayerTalkPatch));
mls.LogInfo((object)"mod awake fr");
}
}
}
namespace CrazyHeadRotations.Patches
{
[HarmonyPatch(typeof(PlayerAvatarTalkAnimation))]
internal class PlayerTalkPatch
{
[HarmonyPatch("Update")]
[HarmonyPostfix]
public static void talkPatch(PlayerAvatarTalkAnimation __instance)
{
__instance.rotationMaxAngle = CrazyTalkBase.Instance.PatchRotation.Value;
}
}
}