Decompiled source of GodMode v0.1.0

GodMode.dll

Decompiled 2 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using GodMode.Patches;
using HarmonyLib;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
namespace GodMode
{
	[BepInPlugin("coolcat0.NineSolsGodMode", "NineSolsGodMode", "0.1.0")]
	public class Plugin : BaseUnityPlugin
	{
		private const string modGUID = "coolcat0.NineSolsGodMode";

		private const string modName = "NineSolsGodMode";

		private const string modVersion = "0.1.0";

		public static Plugin instance;

		public static ManualLogSource mls;

		private void Awake()
		{
			instance = this;
			Harmony.CreateAndPatchAll(typeof(PlayerPatch), (string)null);
			mls = Logger.CreateLogSource("coolcat0.NineSolsGodMode");
			mls.LogInfo((object)"NineSolsGodMode version 0.1.0 has been loaded");
		}
	}
}
namespace GodMode.Patches
{
	public class PlayerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch(typeof(Player), "Awake")]
		public static void AwakePostFix(ref Player __instance)
		{
			((UnityEventBase)((Health)__instance.health).OnTakeDamageDataEvent).RemoveAllListeners();
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Player), "Update")]
		public static void UpdatePostFix(ref Player __instance)
		{
			__instance.RestoreEverything();
		}
	}
}