Decompiled source of Toggle Enemies v1.0.5

ToggleEnemies.dll

Decompiled 3 months ago
using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EnemyToggle.Patches;
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("ToggleEnemies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ToggleEnemies")]
[assembly: AssemblyCopyright("Copyright ©  2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("fc359b6f-0904-41c8-ac4f-7db934547a95")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EnemyToggle
{
	[BepInPlugin("SpiralMods.EnemyToggle", "Toggle Enemies", "1.0.5")]
	public class EnemyToggleBase : BaseUnityPlugin
	{
		private const string modGUID = "SpiralMods.EnemyToggle";

		private const string modName = "Toggle Enemies";

		private const string modVersion = "1.0.5";

		private readonly Harmony harmony = new Harmony("SpiralMods.EnemyToggle");

		private static EnemyToggleBase Instance;

		internal ManualLogSource mls;

		public static ConfigEntry<bool> RemoveSnareFlea;

		public static ConfigEntry<bool> RemoveBunkerSpider;

		public static ConfigEntry<bool> RemoveLootBug;

		public static ConfigEntry<bool> RemoveBracken;

		public static ConfigEntry<bool> RemoveThumper;

		public static ConfigEntry<bool> RemoveSlime;

		public static ConfigEntry<bool> RemoveDressGirl;

		public static ConfigEntry<bool> RemovePuffer;

		public static ConfigEntry<bool> RemoveNutcracker;

		public static ConfigEntry<bool> RemoveCoilHead;

		public static ConfigEntry<bool> RemoveJester;

		public static ConfigEntry<bool> RemoveMasked;

		public static ConfigEntry<bool> RemoveMouthDog;

		public static ConfigEntry<bool> RemoveGiant;

		public static ConfigEntry<bool> RemoveWorm;

		public static ConfigEntry<bool> RemoveBaboonHawk;

		public static ConfigEntry<bool> RemoveOldBird;

		public static ConfigEntry<bool> RemoveButler;

		public static ConfigEntry<bool> RemoveFlowerSnake;

		private void Awake()
		{
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("SpiralMods.EnemyToggle");
			mls.LogInfo((object)"Toggle Enemies has loaded (ModVersion: 1.0.5, ModGUID: SpiralMods.EnemyToggle)!");
			SetBindings();
			harmony.PatchAll(typeof(FlowermanPatch));
			harmony.PatchAll(typeof(CentipedePatch));
			harmony.PatchAll(typeof(HoardingBugPatch));
			harmony.PatchAll(typeof(SandSpiderPatch));
			harmony.PatchAll(typeof(CrawlerPatch));
			harmony.PatchAll(typeof(BlobPatch));
			harmony.PatchAll(typeof(DressGirlPatch));
			harmony.PatchAll(typeof(PufferPatch));
			harmony.PatchAll(typeof(NutcrackerEnemyPatch));
			harmony.PatchAll(typeof(JesterPatch));
			harmony.PatchAll(typeof(MaskedPlayerEnemyPatch));
			harmony.PatchAll(typeof(MouthDogPatch));
			harmony.PatchAll(typeof(ForestGiantPatch));
			harmony.PatchAll(typeof(SandWormPatch));
			harmony.PatchAll(typeof(BaboonBirdPatch));
			harmony.PatchAll(typeof(SpringManPatch));
			harmony.PatchAll(typeof(FlowerSnakePatch));
		}

		private void SetBindings()
		{
			RemoveSnareFlea = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Snare Fleas", false, "If true, snare fleas will never spawn!");
			RemoveBunkerSpider = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Bunker Spiders", false, "If true, bunker spiders will never spawn!");
			RemoveLootBug = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Loot Bugs", false, "If true, loot bugs will never spawn!");
			RemoveBracken = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Brackens", false, "If true, brackens will never spawn!");
			RemoveThumper = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Thumpers", false, "If true, thumpers will never spawn!");
			RemoveSlime = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Slimes", false, "If true, slimes will never spawn!");
			RemoveDressGirl = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Ghost Girls", false, "If true, the ghost girl will never spawn!");
			RemovePuffer = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Spore Lizards", false, "If true, spore lizards will never spawn!");
			RemoveNutcracker = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Nutcrackers", false, "If true, nutcrackers will never spawn!");
			RemoveCoilHead = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Coil Heads", false, "If true, coil heads will never spawn!");
			RemoveJester = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Jesters", false, "If true, jesters will never spawn!");
			RemoveMasked = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Masked Players", false, "If true, masked players will never spawn!");
			RemoveMouthDog = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Eyeless Dogs", false, "If true, eyeless dogs will never spawn!");
			RemoveGiant = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Giants", false, "If true, giants will never spawn!");
			RemoveWorm = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Worms", false, "If true, worms will never spawn!");
			RemoveBaboonHawk = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Baboon Hawks", false, "If true, baboon hawks will never spawn!");
			RemoveButler = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Butlers", false, "If true, butlers will never spawn!");
			RemoveOldBird = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Old Birds", false, "If true, old birds will never spawn!");
			RemoveFlowerSnake = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Flower Snakes", false, "If true, flower snakes will never spawn!");
		}
	}
}
namespace EnemyToggle.Patches
{
	[HarmonyPatch(typeof(ButlerBeesEnemyAI))]
	internal class ButlerBeesPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveButler.Value && GameNetworkManager.Instance.isHostingGame)
			{
				ButlerBeesEnemyAI val = Object.FindObjectOfType<ButlerBeesEnemyAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A pack of butler bees has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(RadMechAI))]
	internal class OldBirdPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveBaboonHawk.Value && GameNetworkManager.Instance.isHostingGame)
			{
				RadMechAI val = Object.FindObjectOfType<RadMechAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("An old bird has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(ButlerEnemyAI))]
	internal class ButlerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveButler.Value && GameNetworkManager.Instance.isHostingGame)
			{
				ButlerEnemyAI val = Object.FindObjectOfType<ButlerEnemyAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A butler has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(CentipedeAI))]
	internal class CentipedePatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveSnareFlea.Value && GameNetworkManager.Instance.isHostingGame)
			{
				CentipedeAI val = Object.FindObjectOfType<CentipedeAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A snare flea has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(CrawlerAI))]
	internal class CrawlerPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveThumper.Value && GameNetworkManager.Instance.isHostingGame)
			{
				CrawlerAI val = Object.FindObjectOfType<CrawlerAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A thumper has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(BlobAI))]
	internal class BlobPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveSlime.Value && GameNetworkManager.Instance.isHostingGame)
			{
				BlobAI val = Object.FindObjectOfType<BlobAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A slime has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(DressGirlAI))]
	internal class DressGirlPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveDressGirl.Value && GameNetworkManager.Instance.isHostingGame)
			{
				DressGirlAI val = Object.FindObjectOfType<DressGirlAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A ghost girl has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(MaskedPlayerEnemy))]
	internal class MaskedPlayerEnemyPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveMasked.Value && GameNetworkManager.Instance.isHostingGame)
			{
				MaskedPlayerEnemy val = Object.FindObjectOfType<MaskedPlayerEnemy>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("An masked player has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(PufferAI))]
	internal class PufferPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemovePuffer.Value && GameNetworkManager.Instance.isHostingGame)
			{
				PufferAI val = Object.FindObjectOfType<PufferAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A spore lizard has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(NutcrackerEnemyAI))]
	internal class NutcrackerEnemyPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveNutcracker.Value && GameNetworkManager.Instance.isHostingGame)
			{
				NutcrackerEnemyAI val = Object.FindObjectOfType<NutcrackerEnemyAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A nutcracker has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(JesterAI))]
	internal class JesterPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveJester.Value && GameNetworkManager.Instance.isHostingGame)
			{
				JesterAI val = Object.FindObjectOfType<JesterAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A jester has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(MouthDogAI))]
	internal class MouthDogPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveMouthDog.Value && GameNetworkManager.Instance.isHostingGame)
			{
				MouthDogAI val = Object.FindObjectOfType<MouthDogAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("An eyeless dog has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(ForestGiantAI))]
	internal class ForestGiantPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveGiant.Value && GameNetworkManager.Instance.isHostingGame)
			{
				ForestGiantAI val = Object.FindObjectOfType<ForestGiantAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A giant has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(SandWormAI))]
	internal class SandWormPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveWorm.Value && GameNetworkManager.Instance.isHostingGame)
			{
				SandWormAI val = Object.FindObjectOfType<SandWormAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A sand worm has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(BaboonBirdAI))]
	internal class BaboonBirdPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveBaboonHawk.Value && GameNetworkManager.Instance.isHostingGame)
			{
				BaboonBirdAI val = Object.FindObjectOfType<BaboonBirdAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A baboon hawk has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(FlowerSnakeEnemy))]
	internal class FlowerSnakePatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveFlowerSnake.Value && GameNetworkManager.Instance.isHostingGame)
			{
				FlowerSnakeEnemy val = Object.FindObjectOfType<FlowerSnakeEnemy>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A flower snake has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(SpringManAI))]
	internal class SpringManPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveCoilHead.Value && GameNetworkManager.Instance.isHostingGame)
			{
				SpringManAI val = Object.FindObjectOfType<SpringManAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				SpringJoint val2 = Object.FindObjectOfType<SpringJoint>();
				Console.Write("A spring man has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val2);
				Object.DestroyImmediate((Object)(object)val2);
			}
		}
	}
	[HarmonyPatch(typeof(SandSpiderAI))]
	internal class SandSpiderPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveBunkerSpider.Value && GameNetworkManager.Instance.isHostingGame)
			{
				SandSpiderAI val = Object.FindObjectOfType<SandSpiderAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A bunker spider has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(HoarderBugAI))]
	internal class HoardingBugPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveLootBug.Value && GameNetworkManager.Instance.isHostingGame)
			{
				HoarderBugAI val = Object.FindObjectOfType<HoarderBugAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A hoarding bug has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
	[HarmonyPatch(typeof(FlowermanAI))]
	internal class FlowermanPatch
	{
		[HarmonyPatch("Update")]
		[HarmonyPostfix]
		private static void patchUpdate()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (EnemyToggleBase.RemoveBracken.Value && GameNetworkManager.Instance.isHostingGame)
			{
				FlowermanAI val = Object.FindObjectOfType<FlowermanAI>();
				((EnemyAI)val).serverPosition = new Vector3(1000f, 1000f, 1000f);
				((EnemyAI)val).enemyType.canDie = true;
				((EnemyAI)val).KillEnemyClientRpc(true);
				((EnemyAI)val).KillEnemyOnOwnerClient(true);
				Console.Write("A flowerman has been deleted.");
				Object.DestroyImmediate((Object)(object)val);
				Object.DestroyImmediate((Object)(object)val);
			}
		}
	}
}