using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MoreBossHealth")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MoreBossHealth")]
[assembly: AssemblyTitle("MoreBossHealth")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MoreBossHealth;
[HarmonyPatch]
[BepInPlugin("TryhardV2.zv7i.ultrakill", "TryhardV2", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Log;
private void Start()
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
Log = ((BaseUnityPlugin)this).Logger;
Log.LogInfo((object)"Loading TryhardV2...");
new Harmony("zv7i.ultrakill.tryhardv2").PatchAll();
Log.LogInfo((object)"TryhardV2 loaded!");
}
[HarmonyPrefix]
[HarmonyPatch(typeof(EnemyIdentifier), "Start")]
public static void V2EnemyPatch(EnemyIdentifier __instance)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Invalid comparison between Unknown and I4
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Invalid comparison between Unknown and I4
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Invalid comparison between Unknown and I4
if ((int)__instance.enemyType == 8 || (int)__instance.enemyType == 22)
{
__instance.healthBuff = true;
__instance.healthBuffModifier = 2.5f;
__instance.speedBuff = true;
__instance.speedBuffModifier = 1.2f;
__instance.difficultyOverride = 4;
if ((int)__instance.enemyType == 22)
{
__instance.speedBuffModifier = 2f;
__instance.healthBuffModifier = 3.5f;
__instance.damageBuff = true;
__instance.damageBuffModifier = 2f;
}
}
}
[HarmonyPrefix]
[HarmonyPatch(typeof(V2), "Start")]
public static void V2AIPatch(V2 __instance)
{
__instance.secondEncounter = true;
}
[HarmonyPrefix]
[HarmonyPatch(typeof(V2), "Die")]
public static void V2DeathFix(V2 __instance)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Invalid comparison between Unknown and I4
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Invalid comparison between Unknown and I4
EnemyIdentifier component = ((Component)__instance).GetComponent<EnemyIdentifier>();
if (!((Object)(object)component == (Object)null))
{
if ((int)component.enemyType != 22 || SceneHelper.CurrentScene != "Level 4-4")
{
__instance.secondEncounter = false;
}
if ((int)component.enemyType == 22 || SceneHelper.CurrentScene == "Level 4-4")
{
__instance.secondEncounter = true;
}
}
}
}