Decompiled source of DoubleJump v1.0.0

DoubleJump.dll

Decompiled a day ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Photon.Pun;
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("DoubleJump")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("DoubleJump")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bda7da75-cb77-4768-a62f-746147108ee0")]
[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")]
namespace DoubleJump;

[BepInPlugin("com.peak.kr.DoubleJump", "DoubleJump", "1.0.0")]
public class ModBehaviour : BaseUnityPlugin
{
	[HarmonyPatch(typeof(Character))]
	public class Character_path
	{
		[HarmonyPostfix]
		[HarmonyPatch("OnLand")]
		private static void OnLand_Postfix(Character __instance)
		{
			double_jump = 0;
			character = __instance;
		}
	}

	private Harmony harmony;

	internal static ManualLogSource Log;

	private static ConfigEntry<int> JumpTime;

	private static ConfigEntry<float> JumpReturn;

	private static ConfigEntry<float> FastJumpReturn;

	private static int double_jump;

	private static Character character;

	private void Awake()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		harmony = new Harmony("com.peak.kr.DoubleJump");
		harmony.PatchAll();
		JumpTime = ((BaseUnityPlugin)this).Config.Bind<int>("PEAK_MultiFun", "JumpTime", 2, "Maximum number of jumps");
		JumpReturn = ((BaseUnityPlugin)this).Config.Bind<float>("PEAK_MultiFun", "JumpReturn", 0.05f, "Jump Stamina Compensation");
		FastJumpReturn = ((BaseUnityPlugin)this).Config.Bind<float>("PEAK_MultiFun", "FastJumpReturn", 0.15f, "Accelerated Jump Stamina Compensation");
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogInfo((object)"DoubleJump enble");
	}

	private void OnDestroy()
	{
		harmony.UnpatchSelf();
	}

	private void Update()
	{
		if (double_jump >= JumpTime.Value || !((Object)(object)character != (Object)null) || !Input.GetKeyDown((KeyCode)32))
		{
			return;
		}
		if (double_jump > 0)
		{
			if (Input.GetKey((KeyCode)304))
			{
				CharacterData data = character.data;
				data.currentStamina += FastJumpReturn.Value;
			}
			else
			{
				CharacterData data2 = character.data;
				data2.currentStamina += JumpReturn.Value;
			}
		}
		double_jump++;
		character.refs.view.RPC("JumpRpc", (RpcTarget)0, new object[1] { false });
	}
}