Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Toggle Enemies v1.0.9
ToggleEnemies.dll
Decompiled 5 days agousing 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 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 ToggleEnemies { [BepInPlugin("SpiralMods.ToggleEnemies", "ToggleEnemies", "1.0.9")] public class ToggleEnemiesBase : BaseUnityPlugin { private const string ModGuid = "SpiralMods.ToggleEnemies"; private const string ModName = "ToggleEnemies"; private const string ModVersion = "1.0.9"; private readonly Harmony _harmony = new Harmony("SpiralMods.ToggleEnemies"); private static ToggleEnemiesBase _instance; public static ManualLogSource logger = Logger.CreateLogSource("SpiralMods.ToggleEnemies"); 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; public static ConfigEntry<bool> RemoveBarber; public static ConfigEntry<bool> RemoveFox; public static ConfigEntry<bool> RemoveLasso; public static ConfigEntry<bool> RemoveCadaver; public static ConfigEntry<bool> RemovePuma; public static ConfigEntry<bool> RemoveGiantKiwi; public static ConfigEntry<bool> RemoveStingray; private void Awake() { if ((Object)(object)_instance == (Object)null) { _instance = this; } logger = Logger.CreateLogSource("SpiralMods.ToggleEnemies"); logger.LogInfo((object)"ToggleEnemies has loaded (ModVersion: 1.0.9, ModGUID: SpiralMods.ToggleEnemies)!"); SetBindings(); _harmony.PatchAll(Assembly.GetExecutingAssembly()); } private void SetBindings() { RemoveSnareFlea = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Snare Fleas", false, "If true, snare fleas won't ever spawn!"); RemoveBunkerSpider = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Bunker Spiders", false, "If true, bunker spiders won't ever spawn!"); RemoveLootBug = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Loot Bugs", false, "If true, loot bugs won't ever spawn!"); RemoveBracken = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Brackens", false, "If true, brackens won't ever spawn!"); RemoveThumper = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Thumpers", false, "If true, thumpers won't ever spawn!"); RemoveSlime = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Slimes", false, "If true, slimes won't ever spawn!"); RemoveDressGirl = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Ghost Girls", false, "If true, the ghost girl won't ever spawn!"); RemovePuffer = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Spore Lizards", false, "If true, spore lizards won't ever spawn!"); RemoveNutcracker = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Nutcrackers", false, "If true, nutcrackers won't ever spawn!"); RemoveCoilHead = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Coil Heads", false, "If true, coil heads won't ever spawn!"); RemoveJester = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Jesters", false, "If true, jesters won't ever spawn!"); RemoveMasked = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Masked Players", false, "If true, masked players won't ever spawn!"); RemoveMouthDog = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Eyeless Dogs", false, "If true, eyeless dogs won't ever spawn!"); RemoveGiant = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Giants", false, "If true, giants won't ever spawn!"); RemoveWorm = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Worms", false, "If true, worms won't ever spawn!"); RemoveBaboonHawk = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Baboon Hawks", false, "If true, baboon hawks won't ever spawn!"); RemoveButler = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Butlers", false, "If true, butlers won't ever spawn!"); RemoveOldBird = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Old Birds", false, "If true, old birds won't ever spawn!"); RemoveFlowerSnake = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Flower Snakes", false, "If true, flower snakes won't ever spawn!"); RemoveBarber = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Barbers", false, "If true, barbers won't ever spawn!"); RemoveFox = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Kidnapper Foxes", false, "If true, foxes won't ever spawn!"); RemoveLasso = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Lasso Man", false, "If true, lasso Man won't spawn during modded!"); RemoveCadaver = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Cadaver", false, "If true, cadavers won't ever spawn!"); RemoveGiantKiwi = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Giant Kiwi", false, "If true, Giant Kiwi won't ever spawn!"); RemovePuma = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Feiopar", false, "If true, Feiopar won't ever spawn!"); RemoveStingray = ((BaseUnityPlugin)this).Config.Bind<bool>("Settings (Restart Required)", "Disable Backwater Gunkfish", false, "If true, Backwater Gunkfish won't ever spawn!"); } } } namespace ToggleEnemies.Patches { [HarmonyPatch(typeof(PumaAI))] internal class PumaPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemovePuma.Value && GameNetworkManager.Instance.isHostingGame) { PumaAI val = Object.FindObjectOfType<PumaAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A Feiopar has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(GiantKiwiAI))] internal class GiantKiwiPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveGiantKiwi.Value && GameNetworkManager.Instance.isHostingGame) { GiantKiwiAI val = Object.FindObjectOfType<GiantKiwiAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A Giant Sapsucker has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(StingrayAI))] internal class StingrayPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveStingray.Value && GameNetworkManager.Instance.isHostingGame) { StingrayAI val = Object.FindObjectOfType<StingrayAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A backwater gunkfish has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(ClaySurgeonAI))] internal class BarberPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveBarber.Value && GameNetworkManager.Instance.isHostingGame) { ClaySurgeonAI val = Object.FindObjectOfType<ClaySurgeonAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A barber has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(ButlerBeesEnemyAI))] internal class ButlerBeesPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void PatchStart() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveButler.Value && GameNetworkManager.Instance.isHostingGame) { ButlerBeesEnemyAI val = Object.FindObjectOfType<ButlerBeesEnemyAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A swarm of butler bees has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(BushWolfEnemy))] internal class BushWolfPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveFox.Value && GameNetworkManager.Instance.isHostingGame) { BushWolfEnemy val = Object.FindObjectOfType<BushWolfEnemy>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A bush wolf has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(CadaverGrowthAI))] internal class CadaverGrowthPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveCadaver.Value && GameNetworkManager.Instance.isHostingGame) { CadaverGrowthAI val = Object.FindObjectOfType<CadaverGrowthAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A cadaver growth has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(LassoManAI))] internal class LassoManPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveLasso.Value && GameNetworkManager.Instance.isHostingGame) { LassoManAI val = Object.FindObjectOfType<LassoManAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A lasso man has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(CadaverBloomAI))] internal class CadaverBloomPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveCadaver.Value && GameNetworkManager.Instance.isHostingGame) { CadaverBloomAI val = Object.FindObjectOfType<CadaverBloomAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A cadaver bloom 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveOldBird.Value && GameNetworkManager.Instance.isHostingGame) { RadMechAI val = Object.FindObjectOfType<RadMechAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveButler.Value && GameNetworkManager.Instance.isHostingGame) { ButlerEnemyAI val = Object.FindObjectOfType<ButlerEnemyAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveSnareFlea.Value && GameNetworkManager.Instance.isHostingGame) { CentipedeAI val = Object.FindObjectOfType<CentipedeAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveThumper.Value && GameNetworkManager.Instance.isHostingGame) { CrawlerAI val = Object.FindObjectOfType<CrawlerAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveSlime.Value && GameNetworkManager.Instance.isHostingGame) { BlobAI val = Object.FindObjectOfType<BlobAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A blob 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveDressGirl.Value && GameNetworkManager.Instance.isHostingGame) { DressGirlAI val = Object.FindObjectOfType<DressGirlAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveMasked.Value && GameNetworkManager.Instance.isHostingGame) { MaskedPlayerEnemy val = Object.FindObjectOfType<MaskedPlayerEnemy>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemovePuffer.Value && GameNetworkManager.Instance.isHostingGame) { PufferAI val = Object.FindObjectOfType<PufferAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveNutcracker.Value && GameNetworkManager.Instance.isHostingGame) { NutcrackerEnemyAI val = Object.FindObjectOfType<NutcrackerEnemyAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveJester.Value && GameNetworkManager.Instance.isHostingGame) { JesterAI val = Object.FindObjectOfType<JesterAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveMouthDog.Value && GameNetworkManager.Instance.isHostingGame) { MouthDogAI val = Object.FindObjectOfType<MouthDogAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveGiant.Value && GameNetworkManager.Instance.isHostingGame) { ForestGiantAI val = Object.FindObjectOfType<ForestGiantAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A forest 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveWorm.Value && GameNetworkManager.Instance.isHostingGame) { SandWormAI val = Object.FindObjectOfType<SandWormAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveBaboonHawk.Value && GameNetworkManager.Instance.isHostingGame) { BaboonBirdAI val = Object.FindObjectOfType<BaboonBirdAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveFlowerSnake.Value && GameNetworkManager.Instance.isHostingGame) { FlowerSnakeEnemy val = Object.FindObjectOfType<FlowerSnakeEnemy>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveCoilHead.Value && GameNetworkManager.Instance.isHostingGame) { SpringManAI val = Object.FindObjectOfType<SpringManAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A coil-head has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(SandSpiderAI))] internal class SandSpiderPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveBunkerSpider.Value && GameNetworkManager.Instance.isHostingGame) { SandSpiderAI val = Object.FindObjectOfType<SandSpiderAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A bunker spider has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } [HarmonyPatch(typeof(HoarderBugAI))] internal class HoarderBugPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void PatchUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveLootBug.Value && GameNetworkManager.Instance.isHostingGame) { HoarderBugAI val = Object.FindObjectOfType<HoarderBugAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (ToggleEnemiesBase.RemoveBracken.Value && GameNetworkManager.Instance.isHostingGame) { FlowermanAI val = Object.FindObjectOfType<FlowermanAI>(); ((EnemyAI)val).serverPosition = new Vector3(0f, -1000f, 0f); ((EnemyAI)val).SyncPositionToClients(); ((EnemyAI)val).enemyType.canDie = true; ((EnemyAI)val).KillEnemyClientRpc(true); ((EnemyAI)val).KillEnemyOnOwnerClient(true); ToggleEnemiesBase.logger.LogInfo((object)"A bracken has been deleted."); Object.DestroyImmediate((Object)(object)val); Object.DestroyImmediate((Object)(object)val); } } } }