Decompiled source of God Mode Mod v0.0.4

CMGodModeMod.dll

Decompiled 3 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using CMGodModeMod.Patches;
using GameNetcodeStuff;
using HarmonyLib;
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("CMGodModeMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CMGodModeMod")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d64e3109-41dd-4e9e-a4ae-8de83f605bcb")]
[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 CMGodModeMod
{
	[BepInPlugin("Christianm.CMGodModeMod", "God Mode Mod", "1.5.0.0")]
	public class GodModeModBase : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(TimeOfDay), "Awake")]
		private class infiniteTimeToDeadline
		{
			private static void Postfix(ref TimeOfDay __instance)
			{
				if (GameNetworkManager.Instance.isHostingGame)
				{
					int startingCredits = 99999;
					int deadlineDaysAmount = 9999;
					__instance.quotaVariables.startingCredits = startingCredits;
					__instance.quotaVariables.deadlineDaysAmount = deadlineDaysAmount;
				}
			}
		}

		private const string modGUID = "Christianm.CMGodModeMod";

		private const string modName = "God Mode Mod";

		private const string modVersion = "1.5.0.0";

		private static GodModeModBase instance;

		private Harmony harmony = new Harmony("Christianm.CMGodModeMod");

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			mls = Logger.CreateLogSource("Christianm.CMGodModeMod");
			mls.LogInfo((object)"GOD MOD IS ACTIVE!");
			harmony.PatchAll(typeof(GodModeModBase));
			mls.LogInfo((object)"Successfully Patched Main Class.");
			harmony.PatchAll(typeof(PlayerControllerBPatch));
			mls.LogInfo((object)"Successfully Patched Player Movement.");
			harmony.PatchAll(typeof(infiniteTimeToDeadline));
			mls.LogInfo((object)"Successfully Patched Quota Variables.");
		}
	}
}
namespace CMGodModeMod.Patches
{
	[HarmonyPatch(typeof(PlayerControllerB))]
	internal class PlayerControllerBPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void increaseMovementSpeed(ref float ___movementSpeed)
		{
			if (GameNetworkManager.Instance.isHostingGame)
			{
				___movementSpeed = 10f;
			}
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void infiniteSprintPatch(ref float ___sprintMeter)
		{
			if (GameNetworkManager.Instance.isHostingGame)
			{
				___sprintMeter = 1f;
			}
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void increasedJumpForcePatch(ref float ___jumpForce)
		{
			if (GameNetworkManager.Instance.isHostingGame)
			{
				___jumpForce = 15f;
			}
		}

		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void fullHealthPatch(ref int ___health)
		{
			if (GameNetworkManager.Instance.isHostingGame)
			{
				___health = 1000000000;
			}
		}
	}
}