using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("BloodyCheckpoints")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BloodyCheckpoints")]
[assembly: AssemblyTitle("BloodyCheckpoints")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace BloodyCheckpoints;
[BepInPlugin("BloodyCheckpoints.adry.ultrakill", "Bloody Checkpoints", "1.2.0")]
[BepInProcess("ULTRAKILL.exe")]
public class BloodyCheckpoints : BaseUnityPlugin
{
[HarmonyPatch(typeof(CheckPoint), "ActivateCheckPoint")]
public class PatchActivateCheckPoint
{
private static void Postfix()
{
NewMovement instance = MonoSingleton<NewMovement>.Instance;
if ((Object)(object)instance != (Object)null)
{
int hp = instance.hp;
int num = 100;
if (hp < num)
{
instance.GetHealth(num - hp, true, false);
Debug.Log((object)("Checkpoint activated: Player health restored to " + num + "."));
}
else
{
Debug.Log((object)("Checkpoint activated: Player health preserved at " + hp + "."));
}
instance.FullStamina();
Debug.Log((object)"Checkpoint activated: Player stamina fully restored.");
}
else
{
Debug.LogError((object)"Checkpoint activated: Player instance not found.");
}
}
}
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Harmony val = new Harmony("BloodyCheckpoints.adry.ultrakill");
val.PatchAll();
Debug.Log((object)"Bloody Checkpoints mod loaded successfully.");
}
}