using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using PluginConfig.API;
using PluginConfig.API.Fields;
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("MirrorReaperNameChangerV2")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MirrorReaperNameChangerV2")]
[assembly: AssemblyCopyright("Copyright © 2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("d175f9fd-927e-4557-88a6-3ec87a2e12b3")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("gabi.mirrorreapernamechanger", "Mirror Reaper Name Changer", "2.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
public class MirrorReaperNameChanger : BaseUnityPlugin
{
public static MirrorReaperNameChanger Instance;
public static StringField customName;
public static ManualLogSource Log;
private void Awake()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
Instance = this;
Log = ((BaseUnityPlugin)this).Logger;
PluginConfigurator val = PluginConfigurator.Create("Mirror Reaper Name Changer", "gabi.mirrorreapernamechanger");
val.SetIconWithURL("https://raw.githubusercontent.com/Prospekt-18/ultrakill-mod-thumbnail/main/meaper.png");
customName = new StringField(val.rootPanel, "Boss Name", "bossName", "Stupid Mirror Chud");
new Harmony("gabi.mirrorreapernamechanger").PatchAll();
}
}
[HarmonyPatch(typeof(BossHealthBar), "Awake")]
internal class MirrorReaperBossBarPatch
{
private static void Prefix(BossHealthBar __instance)
{
if (__instance.bossName == "MIRROR REAPER")
{
__instance.bossName = MirrorReaperNameChanger.customName.value;
}
else if (string.IsNullOrEmpty(__instance.bossName))
{
IEnemyHealthDetails val = ((Component)__instance).GetComponent<IEnemyHealthDetails>() ?? ((Component)__instance).GetComponentInChildren<IEnemyHealthDetails>();
if (val != null && val.FullName == "MIRROR REAPER")
{
__instance.bossName = MirrorReaperNameChanger.customName.value;
}
}
}
}