Decompiled source of Big Run v1.0.1

BigRun.dll

Decompiled 2 hours ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mirror;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("BigRun")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BigRun")]
[assembly: AssemblyTitle("BigRun")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace bigrun
{
	[BepInPlugin("bayturtleking.bigwalk.bigrun", "Big Run", "1.0.0")]
	public class runnnnnnn : BasePlugin
	{
		internal static ManualLogSource logsource;

		internal static ConfigEntry<KeyCode> keytotoggle;

		public override void Load()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			logsource = ((BasePlugin)this).Log;
			keytotoggle = ((BasePlugin)this).Config.Bind<KeyCode>("General", "keytotoggle", (KeyCode)106, "the key that toggles the mod off/on");
			new Harmony("bayturtleking.bigwalk.bigrun").PatchAll();
			((BasePlugin)this).Log.LogInfo((object)"big run loaded");
		}
	}
	[HarmonyPatch(typeof(PlayerCharacter), "Update")]
	public static class bigrunner
	{
		private const float howmuchfaster = 6f;

		private static bool havegamersups;

		private static float oldforward;

		private static float oldforwardsprint;

		private static float oldforwardscrouch;

		private static float oldforwardcrouchsprint;

		private static float oldforwardswim;

		private static float oldforwardswimsprint;

		private static float oldjump;

		private static float oldmaxup;

		[HarmonyPostfix]
		private static void Postfix(PlayerCharacter __instance)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)__instance == (Object)null || !((NetworkBehaviour)__instance).isLocalPlayer || !Input.GetKeyDown(runnnnnnn.keytotoggle.Value))
			{
				return;
			}
			PlayerTunings tunings = __instance.tunings;
			if (tunings != null)
			{
				havegamersups = !havegamersups;
				if (havegamersups)
				{
					oldforward = tunings.forwardSpeed;
					oldforwardsprint = tunings.forwardSprintSpeed;
					oldforwardscrouch = tunings.crouchForwardSpeed;
					oldforwardcrouchsprint = tunings.crouchForwardSprintSpeed;
					oldforwardswim = tunings.swimForwardSpeed;
					oldforwardswimsprint = tunings.swimForwardSprintSpeed;
					oldjump = tunings.jumpForce;
					oldmaxup = tunings.maxUpwardsVelocity;
					tunings.forwardSpeed = oldforward * 6f;
					tunings.forwardSprintSpeed = oldforwardsprint * 6f;
					tunings.crouchForwardSpeed = oldforwardscrouch * 6f;
					tunings.crouchForwardSprintSpeed = oldforwardcrouchsprint * 6f;
					tunings.swimForwardSpeed = oldforwardswim * 6f;
					tunings.swimForwardSprintSpeed = oldforwardswimsprint * 6f;
					tunings.jumpForce = oldjump * 6f;
					tunings.maxUpwardsVelocity = oldmaxup * 6f;
					runnnnnnn.logsource.LogInfo((object)"turned big run on");
				}
				else
				{
					tunings.forwardSpeed = oldforward;
					tunings.forwardSprintSpeed = oldforwardsprint;
					tunings.crouchForwardSpeed = oldforwardscrouch;
					tunings.crouchForwardSprintSpeed = oldforwardcrouchsprint;
					tunings.swimForwardSpeed = oldforwardswim;
					tunings.swimForwardSprintSpeed = oldforwardswimsprint;
					tunings.jumpForce = oldjump;
					tunings.maxUpwardsVelocity = oldmaxup;
					runnnnnnn.logsource.LogInfo((object)"turned big run off");
				}
			}
		}
	}
}