Decompiled source of JesterInstantMaxSpeed v1.1.0

BepInEx/plugins/JesterInstantMaxSpeed/JesterInstantMaxSpeed.dll

Decompiled 3 weeks ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("JesterInstantMaxSpeed")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("JesterInstantMaxSpeed")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("06ec0dac-3836-4e0d-bdc4-096cee0df17e")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace JesterInstantMaxSpeed;

[BepInPlugin("catgocri.JesterInstantMaxSpeed", "Jester Instant Max Speed", "1.1.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch]
	private class Patches
	{
		[HarmonyPatch(typeof(JesterAI), "Update")]
		[HarmonyTranspiler]
		private static IEnumerable<CodeInstruction> UpdateTranspiler(IEnumerable<CodeInstruction> instructions)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Expected O, but got Unknown
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Expected O, but got Unknown
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			CodeMatcher val = new CodeMatcher(instructions, (ILGenerator)null);
			val.MatchForward(false, (CodeMatch[])(object)new CodeMatch[5]
			{
				new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)1.45f, (string)null),
				new CodeMatch((OpCode?)OpCodes.Mul, (object)null, (string)null),
				new CodeMatch((OpCode?)OpCodes.Add, (object)null, (string)null),
				new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)0f, (string)null),
				new CodeMatch((OpCode?)OpCodes.Ldc_R4, (object)18f, (string)null)
			}).Advance(3);
			val.SetOperandAndAdvance((object)18f);
			return val.InstructionEnumeration();
		}
	}

	private const string pluginGUID = "catgocri.JesterInstantMaxSpeed";

	private const string pluginName = "Jester Instant Max Speed";

	private const string pluginVersion = "1.1.0";

	private readonly Harmony _harmony = new Harmony("catgocri.JesterInstantMaxSpeed");

	internal static ManualLogSource Logger { get; private set; }

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		_harmony.PatchAll();
		Logger.LogInfo((object)"Plugin Jester Instant Max Speed has loaded! v1.1.0");
	}
}