Decompiled source of AlbertsModMenu v1.0.0

Mods/God Mode.dll

Decompiled a day ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BoneLib.BoneMenu;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using MelonLoader;
using Microsoft.CodeAnalysis;
using UnityEngine;
using lowgravity;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Main), "Albert's Mod Menu", "1.0.0", "Albert", null)]
[assembly: MelonGame("Stress Level Zero", "BONELAB")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("God Mode")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("God Mode")]
[assembly: AssemblyTitle("God Mode")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace lowgravity
{
	public class Main : MelonMod
	{
		private float gravityMultiplier = 1f;

		private Vector3 normalGravity = new Vector3(0f, -9.81f, 0f);

		private float timeScale = 1f;

		private bool showFps = false;

		private float deltaTime = 0f;

		private GUIStyle style;

		private GUIStyle crosshairStyle;

		private bool playgroundOn = false;

		private float playgroundRadius = 10f;

		private bool showCrosshair = false;

		private bool bouncyOn = false;

		private float bounciness = 1.5f;

		public override void OnInitializeMelon()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			((MelonBase)this).LoggerInstance.Msg("Albert's Mod Menu loaded!");
			Page val = Page.Root.CreatePage("Albert's Mod Menu", Color.cyan, 0, true);
			Page val2 = val.CreatePage("Gravity Control", Color.blue, 0, true);
			val2.CreateFloat("Gravity Strength", Color.white, gravityMultiplier, 0.05f, 0f, 2f, (Action<float>)delegate(float value)
			{
				//IL_0009: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				gravityMultiplier = value;
				Physics.gravity = normalGravity * gravityMultiplier;
			});
			Page val3 = val.CreatePage("Time Warp", Color.magenta, 0, true);
			val3.CreateFloat("Time Scale", Color.white, timeScale, 0.05f, 0.1f, 1f, (Action<float>)delegate(float value)
			{
				timeScale = value;
				Time.timeScale = value;
				Time.fixedDeltaTime = 0.02f * value;
			});
			val3.CreateFunction("Reset Time", Color.red, (Action)delegate
			{
				timeScale = 1f;
				Time.timeScale = 1f;
				Time.fixedDeltaTime = 0.02f;
			});
			Page val4 = val.CreatePage("FPS Counter", Color.green, 0, true);
			val4.CreateBool("Show FPS", Color.white, showFps, (Action<bool>)delegate(bool value)
			{
				showFps = value;
			});
			Page val5 = val.CreatePage("Physics Playground", Color.yellow, 0, true);
			val5.CreateBool("Enable Playground Mode", Color.white, playgroundOn, (Action<bool>)delegate(bool value)
			{
				playgroundOn = value;
			});
			val5.CreateFloat("Effect Radius", Color.white, playgroundRadius, 1f, 2f, 30f, (Action<float>)delegate(float value)
			{
				playgroundRadius = value;
			});
			Page val6 = val.CreatePage("Bouncy World", new Color(1f, 0.5f, 0f), 0, true);
			val6.CreateBool("Enable Bouncy Physics", Color.white, bouncyOn, (Action<bool>)delegate(bool value)
			{
				bouncyOn = value;
				ApplyBounciness();
			});
			val6.CreateFloat("Bounciness", Color.white, bounciness, 0.1f, 0.5f, 3f, (Action<float>)delegate(float value)
			{
				bounciness = value;
				if (bouncyOn)
				{
					ApplyBounciness();
				}
			});
			Page val7 = val.CreatePage("Crosshair", Color.white, 0, true);
			val7.CreateBool("Show Crosshair", Color.white, showCrosshair, (Action<bool>)delegate(bool value)
			{
				showCrosshair = value;
			});
			Page val8 = val.CreatePage("Coming Soon", Color.gray, 0, true);
		}

		private void ApplyBounciness()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			Collider[] array = Il2CppArrayBase<Collider>.op_Implicit((Il2CppArrayBase<Collider>)(object)Physics.OverlapSphere(Vector3.zero, 1000f));
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				if ((Object)(object)val.material != (Object)null)
				{
					val.material.bounciness = (bouncyOn ? bounciness : 0f);
				}
			}
			((MelonBase)this).LoggerInstance.Msg(bouncyOn ? $"Bounciness applied: {bounciness}" : "Bounciness reset");
		}

		public override void OnUpdate()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			deltaTime += (Time.unscaledDeltaTime - deltaTime) * 0.1f;
			if (!playgroundOn)
			{
				return;
			}
			Collider[] array = Il2CppArrayBase<Collider>.op_Implicit((Il2CppArrayBase<Collider>)(object)Physics.OverlapSphere(Vector3.zero, playgroundRadius));
			Collider[] array2 = array;
			foreach (Collider val in array2)
			{
				Rigidbody component = ((Component)val).GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null && !component.isKinematic)
				{
					component.AddForce(Vector3.up * 0.5f, (ForceMode)5);
				}
			}
		}

		public override void OnGUI()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Expected O, but got Unknown
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Expected O, but got Unknown
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			if (showFps)
			{
				if (style == null)
				{
					style = new GUIStyle();
					style.fontSize = 28;
					style.normal.textColor = Color.green;
				}
				float num = 1f / deltaTime;
				GUI.Label(new Rect(20f, 20f, 300f, 40f), $"FPS: {Mathf.RoundToInt(num)}", style);
			}
			if (showCrosshair)
			{
				if (crosshairStyle == null)
				{
					crosshairStyle = new GUIStyle();
					crosshairStyle.fontSize = 24;
					crosshairStyle.normal.textColor = Color.red;
				}
				float num2 = (float)Screen.width / 2f;
				float num3 = (float)Screen.height / 2f;
				GUI.Label(new Rect(num2 - 5f, num3 - 10f, 20f, 20f), "+", crosshairStyle);
			}
		}
	}
}