using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
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("MaxRoaches")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("MaxRoaches")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e9ba2d9c-3a78-4768-b824-a3207cf7cfe5")]
[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 MaxRoaches
{
[BepInPlugin("nachariah.whiteknuckle.maxroaches", "MaxRoaches", "1.1.0")]
public class PLugin : BaseUnityPlugin
{
public const string pluginGuid = "nachariah.whiteknuckle.maxroaches";
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)"[MaxRoaches] Loaded");
Harmony val = new Harmony("whiteknuckle.maxroaches");
val.PatchAll();
}
}
}
namespace MaxRoaches.Patches
{
[HarmonyPatch(typeof(CL_GameManager), "Start")]
public class AddRoaches
{
[HarmonyPostfix]
public static void Postfix(CL_GameManager __instance)
{
string gamemodeName = CL_GameManager.GetCurrentGamemode().GetGamemodeName(true);
if (gamemodeName.Contains("-Iron") || gamemodeName.Contains("Playground") || gamemodeName.Contains("Advanced Course") || gamemodeName.Contains("Fractured Territory") || gamemodeName.Contains("Roach Run") || gamemodeName.Contains("Comms Array") || gamemodeName.Contains("Shuttered Rift"))
{
Debug.Log((object)("[MaxRoaches] Flagged Gamemode: " + gamemodeName));
return;
}
Debug.Log((object)"[MaxRoaches] Maxing Roaches");
CL_GameManager.AddRoaches(999);
}
}
}