Decompiled source of UKAbominator v1.0.0

UKAbominator.dll

Decompiled 9 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using Configgy;
using HarmonyLib;
using UKAbominator;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("UKAbominator")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("The Cruelty Squad abominator, but in ULTRAKILL.")]
[assembly: AssemblyTitle("UKAbominator")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class NewMovementAdditions : MonoBehaviour
{
	public bool isFlipped = false;

	public static void FlipPlayer(NewMovement mov)
	{
		//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Expected O, but got Unknown
		//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0134: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		if (mov.gc.onGround)
		{
			Transform transform = ((Component)mov).gameObject.transform;
			transform.position += Vector3.up * 2f;
		}
		mov.jumpPower *= -1f;
		((Component)mov).gameObject.GetComponent<NewMovementAdditions>().isFlipped = !((Component)mov).gameObject.GetComponent<NewMovementAdditions>().isFlipped;
		mov.cc.reverseY = !mov.cc.reverseY;
		CameraController cc = mov.cc;
		cc.rotationX *= -1f;
		Camera val = (Camera)AccessTools.Field(typeof(CameraController), "hudCamera").GetValue(mov.cc);
		((Component)val).transform.localScale = new Vector3(((Component)val).transform.localScale.x, 0f - ((Component)val).transform.localScale.y, ((Component)val).transform.localScale.z);
		((Component)mov).gameObject.transform.localScale = new Vector3(((Component)mov).gameObject.transform.localScale.x, 0f - ((Component)mov).gameObject.transform.localScale.y, ((Component)mov).gameObject.transform.localScale.z);
	}

	public static void UpdateFlipPlayer(NewMovement mov)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_004c: 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_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		mov.rb.useGravity = false;
		mov.rb.AddForce(-2f * Physics.gravity, (ForceMode)5);
		int mask = LayerMask.GetMask(new string[2] { "Environment", "Outdoors" });
		RaycastHit val = default(RaycastHit);
		if (Physics.Raycast(((Component)mov).transform.position - new Vector3(0f, 2f, 0f), Vector3.down, ref val, 1f, mask) && !((Object)(object)((Component)((RaycastHit)(ref val)).collider).transform.parent == (Object)(object)((Component)mov).transform))
		{
			Transform transform = ((Component)mov).gameObject.transform;
			transform.position += Vector3.up * 2f;
		}
	}
}
public class Patches
{
	[HarmonyPatch(typeof(NewMovement), "Update")]
	[HarmonyPostfix]
	public static void p_NewMovement_Update(ref NewMovement __instance)
	{
		if (Plugin.abominator.WasPeformed())
		{
			NewMovementAdditions.FlipPlayer(__instance);
		}
		if (((Component)__instance).gameObject.GetComponent<NewMovementAdditions>().isFlipped)
		{
			NewMovementAdditions.UpdateFlipPlayer(__instance);
		}
	}

	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	[HarmonyPrefix]
	public static void p_set_Rigidbody_velocity(ref Rigidbody __instance, ref Vector3 __0)
	{
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)((Component)__instance).gameObject.GetComponent<NewMovementAdditions>()) && ((Component)__instance).gameObject.GetComponent<NewMovementAdditions>().isFlipped && __0 == new Vector3(0f, -100f, 0f))
		{
			__0.y = 100f;
		}
	}

	[HarmonyPatch(typeof(NewMovement), "Start")]
	[HarmonyPostfix]
	public static void p_NewMovement_Start(ref NewMovement __instance)
	{
		((Component)__instance).gameObject.AddComponent<NewMovementAdditions>();
	}
}
public class PluginData
{
	public const string GUID = "com.ssar.abominator";

	public const string Name = "UKAbominator";

	public const string Version = "1.0.0";
}
namespace UKAbominator;

[BepInPlugin("com.ssar.abominator", "UKAbominator", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private ConfigBuilder config;

	[Configgable("", "Abominator Keybind", 0, null)]
	public static ConfigKeybind abominator = new ConfigKeybind((KeyCode)116);

	private void Awake()
	{
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Expected O, but got Unknown
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_002d: Expected O, but got Unknown
		config = new ConfigBuilder("com.ssar.abominator", "UKAbominator");
		config.BuildAll();
		Harmony val = new Harmony("com.ssar.abominator");
		val.PatchAll(typeof(Patches));
	}
}
public static class MyPluginInfo
{
	public const string PLUGIN_GUID = "UKAbominator";

	public const string PLUGIN_NAME = "The Cruelty Squad abominator, but in ULTRAKILL.";

	public const string PLUGIN_VERSION = "1.0.0";
}