Decompiled source of Funny Jump Mod v0.1.0

Funny_Jump_Mod.dll

Decompiled 7 months 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 GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Funny_Jump_Mod")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Makes jump height random")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Funny_Jump_Mod")]
[assembly: AssemblyTitle("Funny_Jump_Mod")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.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 LCOS.JumpMod
{
	[BepInPlugin("Funny_Jump_Mod", "Funny_Jump_Mod", "1.0.0")]
	public class Plugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(PlayerControllerB), "PlayerJump")]
		private class Patch
		{
			private static bool Prefix(ref PlayerControllerB __instance)
			{
				int num = Random.Range(0, 100);
				if (num >= 50)
				{
					__instance.jumpForce = 5f;
				}
				else if (num >= 25)
				{
					__instance.jumpForce = Random.Range(7f, 20f);
				}
				else if (num >= 15)
				{
					__instance.jumpForce = Random.Range(25f, 40f);
				}
				else if (num >= 5)
				{
					__instance.jumpForce = Random.Range(3f, 4.5f);
				}
				else if (num >= 1)
				{
					__instance.jumpForce = Random.Range(0.5f, 2f);
				}
				else
				{
					__instance.jumpForce = Random.Range(50f, 200f);
				}
				return true;
			}
		}

		private Harmony harmony = new Harmony("Funny_Jump_Mod");

		private void Awake()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Funny jump active.");
			harmony.PatchAll();
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "Funny_Jump_Mod";

		public const string PLUGIN_NAME = "Funny_Jump_Mod";

		public const string PLUGIN_VERSION = "1.0.0";
	}
}