Decompiled source of Repo 1HP Challenge v1.0.0

RepoOneHpMod.dll

Decompiled 2 weeks ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;

[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.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace RepoOneHpMod;

[BepInPlugin("yourname.repo.onehpchallenge", "R.E.P.O. 1 HP Challenge Mod", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		((BaseUnityPlugin)this).Logger.LogInfo((object)"Mod R.E.P.O. 1 HP Challenge has started successfully!");
		Harmony val = new Harmony("yourname.repo.onehpchallenge");
		val.PatchAll();
	}
}
[HarmonyPatch(typeof(PlayerHealth), "Update")]
public class PatchPlayerHealth
{
	private static void Postfix(PlayerHealth __instance)
	{
		AccessTools.Field(typeof(PlayerHealth), "maxHealth").SetValue(__instance, 1);
		AccessTools.Field(typeof(PlayerHealth), "health").SetValue(__instance, 1);
	}
}