Decompiled source of DoubleJump v1.0.0

DoubleJump.dll

Decompiled 6 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using PluginLethalCompanyTest.Patches;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("PluginLethalCompanyTest")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PluginLethalCompanyTest")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bb6ced17-f1b9-4eb9-b980-d2392c6eaddc")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace PluginLethalCompanyTest
{
	[BepInPlugin("DoubleJump.DoubleJump", "Double Jump", "1.0.0")]
	public class PluginBase : BaseUnityPlugin
	{
		private const string modGUID = "DoubleJump.DoubleJump";

		private const string modName = "Double Jump";

		private const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("DoubleJump.DoubleJump");

		private static PluginBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("DoubleJump.DoubleJump");
			mls.LogInfo((object)"On est parti pour sauter giga haut");
			harmony.PatchAll(typeof(PluginBase));
			harmony.PatchAll(typeof(JumpForcePatch));
		}
	}
}
namespace PluginLethalCompanyTest.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class JumpForcePatch
	{
		public static ManualLogSource test;

		private static int reserveSaut = 1;

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void jumpForcePatch(ref bool ___isExhausted, ref bool ___isJumping, ref float ___playerSlidingTimer, ref PlayerControllerB __instance, ref float ___sprintMeter, ref float ___jumpForce, ref bool ___isFallingNoJump, ref bool ___isFallingFromJump)
		{
			if (reserveSaut > 0 && !___isExhausted && (___isFallingNoJump | ___isFallingFromJump) && ((ButtonControl)Keyboard.current.spaceKey).wasPressedThisFrame)
			{
				reserveSaut--;
				test = Logger.CreateLogSource("Test.Test");
				test.LogInfo((object)"input double saut");
				((MonoBehaviour)__instance).StartCoroutine("PlayerJump");
				___sprintMeter = Mathf.Clamp(___sprintMeter - 0.08f, 0f, 1f);
				___playerSlidingTimer = 0f;
				___isJumping = true;
			}
			if (__instance.thisController.isGrounded)
			{
				reserveSaut = 1;
			}
		}
	}
}