Decompiled source of Infinite Health v1.0.0

CWInfiniteHealth.dll

Decompiled 8 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 CWInfiniteHealth.Patches;
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("CWInfiniteHealth")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CWInfiniteHealth")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("bec0a275-bb07-4292-8f3b-8ac84c246bdd")]
[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 CWInfiniteHealth
{
	[BepInPlugin("Uprank.InfiniteHealth", "Infinite Health", "1.0.0.0")]
	public class CWInfiniteHealthBase : BaseUnityPlugin
	{
		private const string modGUID = "Uprank.InfiniteHealth";

		private const string modName = "Infinite Health";

		private const string modVersion = "1.0.0.0";

		private readonly Harmony harmony = new Harmony("Uprank.InfiniteHealth");

		private static CWInfiniteHealthBase Instance;

		internal ManualLogSource mls;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Uprank.InfiniteHealth");
			mls.LogInfo((object)"Upranks Infinite Health Mod started successfully!");
			harmony.PatchAll(typeof(CWInfiniteHealthBase));
			harmony.PatchAll(typeof(PlayerControllerPatch));
		}
	}
}
namespace CWInfiniteHealth.Patches
{
	[HarmonyPatch(typeof(PlayerController))]
	internal class PlayerControllerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void UpdatePatch()
		{
			PlayerData data = Player.localPlayer.data;
			data.health = 100f;
			data.remainingOxygen = data.maxOxygen;
			data.usingOxygen = false;
		}
	}
}