Decompiled source of Aura Farming v1.0.1

Sancheroids Cool Stuffs.dll

Decompiled a week ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Sancheroids_Cool_Stuffs;
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("ClassLibrary Sancheroid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ClassLibrary Sancheroid")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("30926145-b4a8-4367-846e-3b2c82c0da14")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[HarmonyPatch(typeof(ENT_Player), "Jump")]
public class ENT_Player_Jump_Patch
{
	private static float DotProduct;

	[HarmonyPrefix]
	private static void VectorDecider(ENT_Player __instance)
	{
		//IL_004e: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_015e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0163: Unknown result type (might be due to invalid IL or missing references)
		Debug.Log((object)"Jump");
		Debug.Log((object)("move vector: " + ((object)Unsafe.As<Vector2, Vector2>(ref InputManager.GetVector("Move").vector)/*cast due to .constrained prefix*/).ToString()));
		if (Establishment.DegRemaining <= 0f)
		{
			DotProduct = Vector3.Dot(((GameEntity)__instance).GetTrueVelocity(), ((Component)__instance.camRoot).transform.forward);
			if (Math.Round(DotProduct) >= 0.0 && (!(Math.Round(DotProduct) <= 0.0) || !(InputManager.GetVector("Move").vector.y < 0f)))
			{
				Establishment.FlipVector = new Vector3(8f, 0f, 0f);
			}
			else
			{
				Establishment.FlipVector = new Vector3(-8f, 0f, 0f);
			}
			if (!__instance.IsHanging() && __instance.IsCrouching() && __instance.IsGrounded(true) && (__instance.HasPerk("Perk_RabbitDNA") || __instance.HasPerk("Perk_Binding_RoachMode")))
			{
				Establishment.DegRemaining += 360f;
				Establishment.FlipVector = new Vector3(Math.Abs(Establishment.FlipVector.x), 0f, 0f);
			}
		}
		if (__instance.IsHanging() && Establishment.DegRemaining >= 220f)
		{
			Establishment.FlipSpeed -= 1f;
			Establishment.DegRemaining -= 360 * (1 + (int)ENT_Player.GetPlayer().GetBuffMaxBetweenPlayerAndHands("addJump", false));
		}
		Establishment.FlipSpeed += 1f;
		Establishment.DegRemaining += 360 * (1 + (int)ENT_Player.GetPlayer().GetBuffMaxBetweenPlayerAndHands("addJump", false));
	}
}
[HarmonyPatch(typeof(Inventory), "HideInventory")]
public class Hide_Inventory_Patch
{
	[HarmonyPostfix]
	public static void InventoryClosureValidityCheck(Inventory __instance)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		if (!(Vector3.Angle(((Component)Camera.main).transform.forward, __instance.inventory.forward) <= 75f) && !InputManager.GetButton("Inventory").Down && !InputManager.GetButton("Inventory").Up)
		{
			__instance.showingInventory = true;
			((Component)__instance.inventory).gameObject.SetActive(true);
		}
	}
}
[HarmonyPatch(typeof(Inventory), "Update")]
public class Inventory_Patch
{
	private static float Ychange;

	private static float Ylimit = 45f;

	private static Quaternion PrevRotation = Establishment.camRotation;

	[HarmonyPostfix]
	public static void Inventory_Mover(Inventory __instance)
	{
		//IL_0109: Unknown result type (might be due to invalid IL or missing references)
		//IL_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0060: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		if (__instance.showingInventory)
		{
			((Component)__instance.inventory).transform.rotation = PrevRotation;
			if (Math.Abs(((Quaternion)(ref Establishment.camRotation)).eulerAngles.y - ((Component)__instance.inventory).transform.eulerAngles.y) > Ylimit)
			{
				Ychange = ((Quaternion)(ref Establishment.camRotation)).eulerAngles.y - ((Component)__instance.inventory).transform.eulerAngles.y - Ylimit * (float)Math.Sign(((Quaternion)(ref Establishment.camRotation)).eulerAngles.y - ((Component)__instance.inventory).transform.eulerAngles.y);
			}
			else
			{
				Ychange = 0f;
			}
			((Component)__instance.inventory).transform.Rotate(0f, Ychange, 0f);
			PrevRotation = ((Component)__instance.inventory).transform.rotation;
		}
		else
		{
			Ychange = 0f;
			PrevRotation = Establishment.camRotation;
		}
	}
}
[HarmonyPatch(typeof(ENT_Player), "Update")]
public class ENT_Player_Update_Patch
{
	[HarmonyPostfix]
	public static void Flipper(ENT_Player __instance)
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0169: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02be: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		Establishment.camRotation = ((Component)__instance.cam).transform.rotation;
		if (Establishment.DegRemaining > 0f)
		{
			if (__instance.IsGrounded(false))
			{
				Establishment.FlipSpeed *= 1f + Time.deltaTime * Establishment.MagicNumber;
				Establishment.DegRemaining %= 360f;
				if (Establishment.DegRemaining > 180f && (double)Establishment.FlipSpeed > 0.01)
				{
					Establishment.FlipSpeed *= -1f;
					Establishment.DegRemaining = 360f - Establishment.DegRemaining;
				}
			}
			if (Math.Abs((Establishment.FlipVector.x + Establishment.FlipVector.y) * Establishment.FlipSpeed) * Time.deltaTime * Establishment.MagicNumber <= Establishment.DegRemaining)
			{
				((Component)__instance.camRoot).transform.Rotate(Time.deltaTime * Establishment.MagicNumber * Establishment.FlipVector * Establishment.FlipSpeed);
				Establishment.DegRemaining -= Time.deltaTime * Establishment.MagicNumber * Math.Abs((Establishment.FlipVector.x + Establishment.FlipVector.y) * Establishment.FlipSpeed);
				__instance.AddRotationVelocity(Time.deltaTime * Establishment.MagicNumber * Establishment.FlipVector * Establishment.FlipSpeed / 3f);
			}
			else
			{
				((Component)__instance.camRoot).transform.Rotate(Time.deltaTime * Establishment.MagicNumber * Establishment.Clamp(Establishment.FlipVector.x, Establishment.DegRemaining * -1f, Establishment.DegRemaining) * (Establishment.FlipSpeed / Math.Abs(Establishment.FlipSpeed)), Time.deltaTime * Establishment.Clamp(Establishment.FlipVector.y, Establishment.DegRemaining * -1f, Establishment.DegRemaining) * (Establishment.FlipSpeed / Math.Abs(Establishment.FlipSpeed)), 0f);
				Establishment.DegRemaining -= Time.deltaTime * Establishment.MagicNumber * Math.Abs(Establishment.Clamp(Establishment.FlipVector.x, Establishment.DegRemaining * -1f, Establishment.DegRemaining) + Establishment.Clamp(Establishment.FlipVector.y, Establishment.DegRemaining * -1f, Establishment.DegRemaining));
			}
			if (Math.Round(Establishment.DegRemaining, 2) <= 0.0)
			{
				Establishment.FlipSpeed = 0f;
				Establishment.DegRemaining = 0f;
				Transform transform = ((Component)__instance.camRoot).transform;
				Quaternion rotation = ((Component)__instance.camRoot).transform.rotation;
				transform.Rotate(-1f * ((Quaternion)(ref rotation)).eulerAngles.x, 0f, 0f);
			}
		}
		if (__instance.IsGrounded(false))
		{
		}
	}
}
namespace Sancheroid.SancheroidsCoolPerks
{
	[BepInPlugin("com.sancheroid.sancheroidscoolstuffs", "Aura_Farming", "1.0.0")]
	public sealed class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Log;

		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Log = ((BaseUnityPlugin)this).Logger;
			new Harmony("com.sancheroid.sancheroidscoolstuffs").PatchAll();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"SancheroidsCoolStuffs loaded.");
		}
	}
}
namespace Sancheroids_Cool_Stuffs
{
	internal class Establishment
	{
		public static float FlipSpeed;

		public static float DegRemaining;

		public static float MagicNumber = 64f;

		public static Vector3 FlipVector = new Vector3(0f, 0f, 0f);

		public static Quaternion camRotation = Quaternion.identity;

		public static float Clamp(float value, float min, float max)
		{
			return (value < min) ? min : ((value > max) ? max : value);
		}
	}
}