Decompiled source of NoInfestations v1.0.0

NoInfestations.dll

Decompiled 3 days ago
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 UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("NoInfestations")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NoInfestations")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("61b7a6ee-62b0-4a72-8eea-099fdaa1e624")]
[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 NoInfestations
{
	[BepInPlugin("Reigliss.NoInfestations", "NoInfestations", "1.0.0")]
	public class NoInfestations : BaseUnityPlugin
	{
		public const string modGUID = "Reigliss.NoInfestations";

		public const string modName = "NoInfestations";

		public const string modVersion = "1.0.0";

		private readonly Harmony harmony = new Harmony("Reigliss.NoInfestations");

		public static ManualLogSource mls;

		private static NoInfestations Instance;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("Reigliss.NoInfestations");
			mls.LogInfo((object)"NoInfestations is open");
			harmony.PatchAll();
		}
	}
}
namespace NoInfestations.Patches
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		[HarmonyPatch("RefreshEnemiesList")]
		[HarmonyPostfix]
		public static void RefreshEnemiesListPatch(ref RoundManager __instance)
		{
			FieldInfo field = typeof(RoundManager).GetField("enemyRushIndex", BindingFlags.Instance | BindingFlags.NonPublic);
			field.SetValue(__instance, -1);
			__instance.currentMaxInsidePower = __instance.currentLevel.maxEnemyPowerCount;
			((Component)__instance.indoorFog).gameObject.SetActive(false);
			NoInfestations.mls.LogInfo((object)"Infestation removed");
		}
	}
}