Decompiled source of DoubleJumping v1.0.0

Mikies mod.dll

Decompiled 5 months ago
using System.Collections;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GameNetcodeStuff;
using HarmonyLib;
using Mikies_mod.Patches;
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("Mikies mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Mikies mod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("b2fbf539-0689-4820-89ea-3543dcd20441")]
[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 Mikies_mod
{
	public class ExtraMovement : MonoBehaviour
	{
		private bool doubleJump;

		private void FixedUpdate()
		{
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if (!localPlayerController.thisController.isGrounded && doubleJump && IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).IsPressed())
			{
				doubleJump = false;
				localPlayerController.fallValue = localPlayerController.jumpForce;
				localPlayerController.fallValueUncapped = localPlayerController.jumpForce;
			}
			if (localPlayerController.thisController.isGrounded && IngamePlayerSettings.Instance.playerInput.actions.FindAction("Jump", false).IsPressed())
			{
				((MonoBehaviour)this).StartCoroutine(StartDoubleJump());
			}
		}

		private IEnumerator StartDoubleJump()
		{
			yield return (object)new WaitForSeconds(0.5f);
			doubleJump = true;
		}
	}
	[BepInPlugin("Poseidon.Double_Jump", "Double Jump", "1.0.0.0")]
	public class MikiesModBase : BaseUnityPlugin
	{
		private const string modGUID = "Poseidon.Double_Jump";

		private const string modName = "Double Jump";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Poseidon.Double_Jump");

		private static MikiesModBase instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("Poseidon.Double_Jump");
			mls.LogInfo((object)"All Mods in .dll are mine");
			harmony.PatchAll(typeof(MikiesModBase));
			harmony.PatchAll(typeof(playerControllerBPatch));
			harmony.PatchAll(typeof(StartOfRoundPatch));
		}
	}
	public class ShockAbsorbtion : MonoBehaviour
	{
		public Transform FollowOb;

		public GameObject LandOb;

		public float ThisLerpSpeed = 5f;

		public float FollowLerpSpeed = 6f;

		public float YPos = 0f;

		public float Timer = 0.15f;

		private float timer;

		public bool HasDone;

		public bool DoDone;

		private void Update()
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			((Component)localPlayerController.gameplayCamera).transform.localPosition = Vector3.Lerp(((Component)localPlayerController.gameplayCamera).transform.localPosition, FollowOb.localPosition, ThisLerpSpeed * Time.deltaTime);
			timer -= Time.deltaTime;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)localPlayerController).transform.position, Vector3.down, ref val, 4f) && !Physics.Raycast(((Component)localPlayerController).transform.position, Vector3.down, ref val, 1f) && localPlayerController.fallValue < -0.2f)
			{
				timer = Timer;
			}
			if (timer > 0f)
			{
				((Component)FollowOb).transform.localPosition = Vector3.Lerp(((Component)FollowOb).transform.localPosition, new Vector3(0f, YPos + localPlayerController.fallValue * 24f / 96f, 0f), FollowLerpSpeed * Time.deltaTime);
			}
			if (timer < 0f)
			{
				((Component)FollowOb).transform.localPosition = Vector3.Lerp(((Component)FollowOb).transform.localPosition, new Vector3(0f, 0.6f, 0f), FollowLerpSpeed * Time.deltaTime);
			}
		}
	}
}
namespace Mikies_mod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class playerControllerBPatch : MonoBehaviour
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void infiniteSprintPatch(ref Transform ___thisPlayerBody)
		{
			PlayerControllerB localPlayerController = GameNetworkManager.Instance.localPlayerController;
			if ((Object)(object)((Component)localPlayerController).GetComponent<ExtraMovement>() == (Object)null)
			{
				((Component)localPlayerController).gameObject.AddComponent<ExtraMovement>();
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void overrideAudio(StartOfRound __instance)
		{
		}
	}
}