Decompiled source of Randomizer Mod v2.0.5

UMM/Mods/Randomizer Mod/Randomizer Mod.dll

Decompiled a month ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using HarmonyLib;
using RocketLib.UMM;
using TFBGames.Management.Asset;
using UnityEngine;
using UnityModManagerNet;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("Randomizer Mod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Randomizer Mod")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("45393a77-27b2-49ea-add3-21e40825b1b1")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Randomizer_Mod;

[HarmonyPatch(typeof(MapController), "SpawnMook_Networked")]
internal static class MapController_SpawnMook_Networked
{
	public static Random rnd = new Random();

	public static Mook getRandomMookPrefab()
	{
		Mook result = null;
		if (rnd.NextDouble() * 100.0 > (double)Main.settings.enemyPercent || (Object)(object)Map_PlaceDoodad.mapInstance == (Object)null)
		{
			return result;
		}
		double num = rnd.NextDouble() * (double)(int)((Main.settings.enableNormalSummoned ? Main.settings.normalEnemyPercent : 0f) + (Main.settings.enableBossSummoned ? Main.settings.bossPercent : 0f));
		if (Main.settings.DEBUG)
		{
			num = ((Main.settings.debugMookTypeSummoned >= Main.normalList.Length) ? ((int)(Main.settings.normalEnemyPercent + 1f)) : 0);
		}
		if (Main.settings.enableNormalSummoned && num < (double)Main.settings.normalEnemyPercent && Main.settings.enabledNormal.Count > 0)
		{
			int index = rnd.Next(0, Main.settings.enabledNormal.Count);
			index = Main.settings.enabledNormal[index];
			if (Main.settings.DEBUG)
			{
				index = Main.settings.debugMookTypeSummoned;
			}
			switch (index)
			{
			case 0:
			{
				TestVanDammeAnim mook = Map_PlaceDoodad.mapInstance.activeTheme.mook;
				result = (Mook)(object)((mook is Mook) ? mook : null);
				break;
			}
			case 1:
			{
				TestVanDammeAnim mookSuicide = Map_PlaceDoodad.mapInstance.activeTheme.mookSuicide;
				result = (Mook)(object)((mookSuicide is Mook) ? mookSuicide : null);
				break;
			}
			case 2:
			{
				TestVanDammeAnim mookBigGuy = Map_PlaceDoodad.mapInstance.activeTheme.mookBigGuy;
				result = (Mook)(object)((mookBigGuy is Mook) ? mookBigGuy : null);
				break;
			}
			case 3:
			{
				TestVanDammeAnim mookSuicideBigGuy = Map_PlaceDoodad.mapInstance.activeTheme.mookSuicideBigGuy;
				result = (Mook)(object)((mookSuicideBigGuy is Mook) ? mookSuicideBigGuy : null);
				break;
			}
			case 4:
				result = ((Component)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.mookBigGuyStrong).GetComponent<Mook>();
				break;
			case 5:
			{
				TestVanDammeAnim mookBigGuyElite = Map_PlaceDoodad.mapInstance.activeTheme.mookBigGuyElite;
				result = (Mook)(object)((mookBigGuyElite is Mook) ? mookBigGuyElite : null);
				break;
			}
			case 6:
			{
				TestVanDammeAnim mookScout = Map_PlaceDoodad.mapInstance.activeTheme.mookScout;
				result = (Mook)(object)((mookScout is Mook) ? mookScout : null);
				break;
			}
			case 7:
			{
				TestVanDammeAnim mookRiotShield = Map_PlaceDoodad.mapInstance.activeTheme.mookRiotShield;
				result = (Mook)(object)((mookRiotShield is Mook) ? mookRiotShield : null);
				break;
			}
			case 8:
			{
				TestVanDammeAnim mookArmoured = Map_PlaceDoodad.mapInstance.activeTheme.mookArmoured;
				result = (Mook)(object)((mookArmoured is Mook) ? mookArmoured : null);
				break;
			}
			case 9:
				result = ((Component)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.mechBrown).GetComponent<Mook>();
				break;
			case 10:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.mookJetpack;
				break;
			case 11:
			{
				TestVanDammeAnim mookGrenadier = Map_PlaceDoodad.mapInstance.activeTheme.mookGrenadier;
				result = (Mook)(object)((mookGrenadier is Mook) ? mookGrenadier : null);
				break;
			}
			case 12:
			{
				TestVanDammeAnim mookBazooka = Map_PlaceDoodad.mapInstance.activeTheme.mookBazooka;
				result = (Mook)(object)((mookBazooka is Mook) ? mookBazooka : null);
				break;
			}
			case 13:
			{
				TestVanDammeAnim mookJetpackBazooka = Map_PlaceDoodad.mapInstance.activeTheme.mookJetpackBazooka;
				result = (Mook)(object)((mookJetpackBazooka is Mook) ? mookJetpackBazooka : null);
				break;
			}
			case 14:
			{
				TestVanDammeAnim mookNinja = Map_PlaceDoodad.mapInstance.activeTheme.mookNinja;
				result = (Mook)(object)((mookNinja is Mook) ? mookNinja : null);
				break;
			}
			case 15:
				result = ((Component)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.treasureMook).GetComponent<Mook>();
				break;
			case 16:
			{
				TestVanDammeAnim mookDog = Map_PlaceDoodad.mapInstance.activeTheme.mookDog;
				result = (Mook)(object)((mookDog is Mook) ? mookDog : null);
				break;
			}
			case 17:
			{
				TestVanDammeAnim skinnedMook = Map_PlaceDoodad.mapInstance.activeTheme.skinnedMook;
				result = (Mook)(object)((skinnedMook is Mook) ? skinnedMook : null);
				break;
			}
			case 18:
			{
				TestVanDammeAnim mookGeneral = Map_PlaceDoodad.mapInstance.activeTheme.mookGeneral;
				result = (Mook)(object)((mookGeneral is Mook) ? mookGeneral : null);
				break;
			}
			case 19:
			{
				TestVanDammeAnim mookAlarmist = Map_PlaceDoodad.mapInstance.activeTheme.mookAlarmist;
				result = (Mook)(object)((mookAlarmist is Mook) ? mookAlarmist : null);
				break;
			}
			case 20:
			{
				TestVanDammeAnim mookStrong = Map_PlaceDoodad.mapInstance.activeTheme.mookStrong;
				result = (Mook)(object)((mookStrong is Mook) ? mookStrong : null);
				break;
			}
			case 21:
			{
				TestVanDammeAnim mookScientist = Map_PlaceDoodad.mapInstance.activeTheme.mookScientist;
				result = (Mook)(object)((mookScientist is Mook) ? mookScientist : null);
				break;
			}
			case 22:
			{
				TestVanDammeAnim snake = Map_PlaceDoodad.mapInstance.activeTheme.snake;
				result = (Mook)(object)((snake is Mook) ? snake : null);
				break;
			}
			case 23:
			{
				TestVanDammeAnim satan = Map_PlaceDoodad.mapInstance.activeTheme.satan;
				result = (Mook)(object)((satan is Mook) ? satan : null);
				break;
			}
			case 24:
			{
				TestVanDammeAnim alienFaceHugger = Map_PlaceDoodad.mapInstance.activeTheme.alienFaceHugger;
				result = (Mook)(object)((alienFaceHugger is Mook) ? alienFaceHugger : null);
				break;
			}
			case 25:
			{
				TestVanDammeAnim alienXenomorph = Map_PlaceDoodad.mapInstance.activeTheme.alienXenomorph;
				result = (Mook)(object)((alienXenomorph is Mook) ? alienXenomorph : null);
				break;
			}
			case 26:
			{
				TestVanDammeAnim alienBrute = Map_PlaceDoodad.mapInstance.activeTheme.alienBrute;
				result = (Mook)(object)((alienBrute is Mook) ? alienBrute : null);
				break;
			}
			case 27:
			{
				TestVanDammeAnim alienBaneling = Map_PlaceDoodad.mapInstance.activeTheme.alienBaneling;
				result = (Mook)(object)((alienBaneling is Mook) ? alienBaneling : null);
				break;
			}
			case 28:
			{
				TestVanDammeAnim alienMosquito = Map_PlaceDoodad.mapInstance.activeTheme.alienMosquito;
				result = (Mook)(object)((alienMosquito is Mook) ? alienMosquito : null);
				break;
			}
			case 29:
			{
				TestVanDammeAnim mookXenomorphBrainbox = Map_PlaceDoodad.mapInstance.activeTheme.mookXenomorphBrainbox;
				result = (Mook)(object)((mookXenomorphBrainbox is Mook) ? mookXenomorphBrainbox : null);
				break;
			}
			case 30:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[0].GetComponent<Mook>();
				break;
			case 31:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[1].GetComponent<Mook>();
				break;
			case 32:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[2].GetComponent<Mook>();
				break;
			case 33:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[3].GetComponent<Mook>();
				break;
			case 34:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[4].GetComponent<Mook>();
				break;
			case 35:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[5].GetComponent<Mook>();
				break;
			case 36:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[6].GetComponent<Mook>();
				break;
			case 37:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[8].GetComponent<Mook>();
				break;
			case 38:
				result = ((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.hellEnemies[10].GetComponent<Mook>();
				break;
			}
		}
		else if (Main.settings.enableBossSummoned && num - (double)(Main.settings.enableNormal ? Main.settings.normalEnemyPercent : 0f) < (double)Main.settings.bossPercent && Main.settings.enabledBosses.Count > 0)
		{
			int index2 = rnd.Next(0, Main.settings.enabledBosses.Count);
			index2 = Main.settings.enabledBosses[index2];
			if (Main.settings.DEBUG)
			{
				index2 = Main.settings.debugMookTypeSummoned - Main.normalList.Length;
			}
			switch (index2)
			{
			case 0:
				result = ((Component)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.satanMiniboss).GetComponent<Mook>();
				break;
			case 1:
			{
				TestVanDammeAnim mookDolfLundgren = Map_PlaceDoodad.mapInstance.activeTheme.mookDolfLundgren;
				result = (Mook)(object)((mookDolfLundgren is Mook) ? mookDolfLundgren : null);
				break;
			}
			}
		}
		return result;
	}

	public static void Prefix(ref Mook mookPrefab, float x, float y, float xI, float yI, bool tumble, bool useParachuteDelay, bool useParachute, bool onFire, bool isAlert)
	{
		if (Main.enabled && Main.settings.enableSpawnedEnemiesRandomization && !(mookPrefab is TankBroTank) && !(mookPrefab is MookArmouredGuy) && (double)Main.settings.enemyPercent > rnd.NextDouble() * 100.0)
		{
			Mook randomMookPrefab = getRandomMookPrefab();
			if ((Object)(object)randomMookPrefab != (Object)null)
			{
				mookPrefab = randomMookPrefab;
			}
		}
	}
}
[HarmonyPatch(typeof(MapController), "SpawnMook_Local")]
internal static class MapController_SpawnMook_Local
{
	public static void Prefix(ref Mook mookPrefab, float x, float y, float xI, float yI, bool tumble, bool useParachuteDelay, bool useParachute, bool onFire, bool isAlert)
	{
		if (Main.enabled && Main.settings.enableSpawnedEnemiesRandomization && (double)Main.settings.enemyPercent > MapController_SpawnMook_Networked.rnd.NextDouble() * 100.0)
		{
			Mook randomMookPrefab = MapController_SpawnMook_Networked.getRandomMookPrefab();
			if ((Object)(object)randomMookPrefab != (Object)null)
			{
				mookPrefab = randomMookPrefab;
			}
		}
	}
}
[HarmonyPatch(typeof(Map), "PlaceDoodad")]
internal static class Map_PlaceDoodad
{
	private static readonly Random rnd = new Random();

	private const int NUMWORMS = 5;

	private const int NUMBOSSES = 2;

	private const int NUMLARGEBOSSES = 4;

	public static Map mapInstance;

	public static bool Prefix(Map __instance, ref DoodadInfo doodad, ref GameObject __result)
	{
		//IL_15e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_15ea: Invalid comparison between Unknown and I4
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0026: Invalid comparison between Unknown and I4
		//IL_15ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_15f5: Invalid comparison between Unknown and I4
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: 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
		//IL_163a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fba: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fbb: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fde: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fdf: Unknown result type (might be due to invalid IL or missing references)
		//IL_1002: Unknown result type (might be due to invalid IL or missing references)
		//IL_1003: Unknown result type (might be due to invalid IL or missing references)
		//IL_1026: Unknown result type (might be due to invalid IL or missing references)
		//IL_1027: Unknown result type (might be due to invalid IL or missing references)
		//IL_104a: Unknown result type (might be due to invalid IL or missing references)
		//IL_104b: Unknown result type (might be due to invalid IL or missing references)
		//IL_106e: Unknown result type (might be due to invalid IL or missing references)
		//IL_106f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1092: Unknown result type (might be due to invalid IL or missing references)
		//IL_1093: Unknown result type (might be due to invalid IL or missing references)
		//IL_10c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_10c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_10eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_10ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_110f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1110: Unknown result type (might be due to invalid IL or missing references)
		//IL_1134: Unknown result type (might be due to invalid IL or missing references)
		//IL_1135: Unknown result type (might be due to invalid IL or missing references)
		//IL_1159: Unknown result type (might be due to invalid IL or missing references)
		//IL_115a: Unknown result type (might be due to invalid IL or missing references)
		//IL_117b: Unknown result type (might be due to invalid IL or missing references)
		//IL_117c: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_11a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_11d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_11fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_11ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_1237: Unknown result type (might be due to invalid IL or missing references)
		//IL_1238: Unknown result type (might be due to invalid IL or missing references)
		//IL_1259: Unknown result type (might be due to invalid IL or missing references)
		//IL_125a: Unknown result type (might be due to invalid IL or missing references)
		//IL_127b: Unknown result type (might be due to invalid IL or missing references)
		//IL_127c: Unknown result type (might be due to invalid IL or missing references)
		//IL_129d: Unknown result type (might be due to invalid IL or missing references)
		//IL_129e: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_12c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_1384: Unknown result type (might be due to invalid IL or missing references)
		//IL_1385: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_13a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_13c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_13c9: Unknown result type (might be due to invalid IL or missing references)
		//IL_13ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_13eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_140c: Unknown result type (might be due to invalid IL or missing references)
		//IL_140d: Unknown result type (might be due to invalid IL or missing references)
		//IL_142e: Unknown result type (might be due to invalid IL or missing references)
		//IL_142f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1450: Unknown result type (might be due to invalid IL or missing references)
		//IL_1451: Unknown result type (might be due to invalid IL or missing references)
		//IL_1477: Unknown result type (might be due to invalid IL or missing references)
		//IL_1478: Unknown result type (might be due to invalid IL or missing references)
		//IL_149e: Unknown result type (might be due to invalid IL or missing references)
		//IL_149f: Unknown result type (might be due to invalid IL or missing references)
		//IL_14c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_14c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_14e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_14e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_150b: Unknown result type (might be due to invalid IL or missing references)
		//IL_150c: Unknown result type (might be due to invalid IL or missing references)
		//IL_152f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1530: Unknown result type (might be due to invalid IL or missing references)
		//IL_1553: Unknown result type (might be due to invalid IL or missing references)
		//IL_1554: Unknown result type (might be due to invalid IL or missing references)
		//IL_156f: Unknown result type (might be due to invalid IL or missing references)
		//IL_1570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0303: Unknown result type (might be due to invalid IL or missing references)
		//IL_0304: Unknown result type (might be due to invalid IL or missing references)
		//IL_036e: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0506: Unknown result type (might be due to invalid IL or missing references)
		//IL_0507: Unknown result type (might be due to invalid IL or missing references)
		//IL_052a: Unknown result type (might be due to invalid IL or missing references)
		//IL_052b: Unknown result type (might be due to invalid IL or missing references)
		//IL_054e: Unknown result type (might be due to invalid IL or missing references)
		//IL_054f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0572: Unknown result type (might be due to invalid IL or missing references)
		//IL_0573: Unknown result type (might be due to invalid IL or missing references)
		//IL_0596: Unknown result type (might be due to invalid IL or missing references)
		//IL_0597: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05db: Unknown result type (might be due to invalid IL or missing references)
		//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_060c: Unknown result type (might be due to invalid IL or missing references)
		//IL_060d: Unknown result type (might be due to invalid IL or missing references)
		//IL_062e: Unknown result type (might be due to invalid IL or missing references)
		//IL_062f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0648: Unknown result type (might be due to invalid IL or missing references)
		//IL_0649: Unknown result type (might be due to invalid IL or missing references)
		//IL_0707: Unknown result type (might be due to invalid IL or missing references)
		//IL_070e: Invalid comparison between Unknown and I4
		//IL_0774: Unknown result type (might be due to invalid IL or missing references)
		//IL_0775: Unknown result type (might be due to invalid IL or missing references)
		//IL_0799: Unknown result type (might be due to invalid IL or missing references)
		//IL_079a: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_07bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0813: Unknown result type (might be due to invalid IL or missing references)
		//IL_0814: Unknown result type (might be due to invalid IL or missing references)
		//IL_08db: Unknown result type (might be due to invalid IL or missing references)
		//IL_08dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0728: Unknown result type (might be due to invalid IL or missing references)
		//IL_072e: Invalid comparison between Unknown and I4
		//IL_0914: Unknown result type (might be due to invalid IL or missing references)
		//IL_0915: Unknown result type (might be due to invalid IL or missing references)
		//IL_074f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0750: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a13: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a14: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a35: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a57: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a58: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a7f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bdf: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c01: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c02: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c23: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c24: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c45: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c67: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c68: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c89: Unknown result type (might be due to invalid IL or missing references)
		//IL_0c8a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cab: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cac: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cd3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cf9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0cfa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d20: Unknown result type (might be due to invalid IL or missing references)
		//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
		if (!Main.enabled)
		{
			return true;
		}
		mapInstance = __instance;
		if (Main.settings.enableEnemyRandomization && ((int)doodad.type == 5 || (int)doodad.type == 6 || (int)doodad.type == 74) && (Main.settings.enableNormal || Main.settings.enableWorms || Main.settings.enableBosses || Main.settings.enableLargeBosses || Main.settings.enableVehicles))
		{
			if (rnd.NextDouble() * 100.0 > (double)Main.settings.enemyPercent)
			{
				return true;
			}
			GridPoint position = doodad.position;
			position.c -= Map.lastXLoadOffset;
			position.r -= Map.lastYLoadOffset;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor((float)(position.c * 16), (float)(position.r * 16), 5f);
			TestVanDammeAnim val2 = null;
			double num = rnd.NextDouble() * (double)(int)((Main.settings.enableNormal ? Main.settings.normalEnemyPercent : 0f) + (Main.settings.enableWorms ? Main.settings.wormPercent : 0f) + (Main.settings.enableBosses ? Main.settings.bossPercent : 0f) + (Main.settings.enableLargeBosses ? Main.settings.largeBossPercent : 0f) + (Main.settings.enableVehicles ? Main.settings.vehiclePercent : 0f));
			if (!Main.settings.DEBUG)
			{
				if (Main.settings.enableNormal && num < (double)Main.settings.normalEnemyPercent && Main.settings.enabledNormal.Count > 0)
				{
					int index = rnd.Next(0, Main.settings.enabledNormal.Count);
					switch (Main.settings.enabledNormal[index])
					{
					case 0:
						val2 = __instance.activeTheme.mook;
						break;
					case 1:
						val2 = __instance.activeTheme.mookSuicide;
						break;
					case 2:
						val2 = __instance.activeTheme.mookBigGuy;
						break;
					case 3:
						val2 = __instance.activeTheme.mookSuicideBigGuy;
						break;
					case 4:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookBigGuyStrong, val, Quaternion.identity)).gameObject;
						break;
					case 5:
						val2 = __instance.activeTheme.mookBigGuyElite;
						break;
					case 6:
						val2 = __instance.activeTheme.mookScout;
						break;
					case 7:
						val2 = __instance.activeTheme.mookRiotShield;
						break;
					case 8:
						val2 = __instance.activeTheme.mookArmoured;
						break;
					case 9:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mechBrown, val, Quaternion.identity)).gameObject;
						break;
					case 10:
						val2 = (TestVanDammeAnim)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookJetpack;
						break;
					case 11:
						val2 = __instance.activeTheme.mookGrenadier;
						break;
					case 12:
						val2 = __instance.activeTheme.mookBazooka;
						break;
					case 13:
						val2 = __instance.activeTheme.mookJetpackBazooka;
						break;
					case 14:
						val2 = __instance.activeTheme.mookNinja;
						break;
					case 15:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.treasureMook, val, Quaternion.identity)).gameObject;
						break;
					case 16:
						val2 = __instance.activeTheme.mookDog;
						break;
					case 17:
						val2 = __instance.activeTheme.skinnedMook;
						break;
					case 18:
						val2 = __instance.activeTheme.mookGeneral;
						break;
					case 19:
						val2 = __instance.activeTheme.mookAlarmist;
						break;
					case 20:
						val2 = __instance.activeTheme.mookStrong;
						break;
					case 21:
						val2 = __instance.activeTheme.mookScientist;
						break;
					case 22:
						val2 = __instance.activeTheme.snake;
						break;
					case 23:
						val2 = __instance.activeTheme.satan;
						break;
					case 24:
						val2 = __instance.activeTheme.alienFaceHugger;
						break;
					case 25:
						val2 = __instance.activeTheme.alienXenomorph;
						break;
					case 26:
						val2 = __instance.activeTheme.alienBrute;
						break;
					case 27:
						val2 = __instance.activeTheme.alienBaneling;
						break;
					case 28:
						val2 = __instance.activeTheme.alienMosquito;
						break;
					case 29:
						val2 = __instance.activeTheme.mookXenomorphBrainbox;
						break;
					case 30:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[0], val, Quaternion.identity);
						break;
					case 31:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[1], val, Quaternion.identity);
						break;
					case 32:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[2], val, Quaternion.identity);
						break;
					case 33:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[3], val, Quaternion.identity);
						break;
					case 34:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[4], val, Quaternion.identity);
						break;
					case 35:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[5], val, Quaternion.identity);
						break;
					case 36:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[6], val, Quaternion.identity);
						break;
					case 37:
						val.y += 5f;
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[8], val, Quaternion.identity);
						break;
					case 38:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[10], val, Quaternion.identity);
						break;
					}
					if ((Object)(object)val2 != (Object)null)
					{
						__result = ((Component)Object.Instantiate<TestVanDammeAnim>(val2, val, Quaternion.identity)).gameObject;
					}
				}
				else if (Main.settings.enableWorms && num - (double)(Main.settings.enableNormal ? Main.settings.normalEnemyPercent : 0f) < (double)Main.settings.wormPercent && Main.settings.enabledWorms.Count > 0)
				{
					int index2 = rnd.Next(0, Main.settings.enabledWorms.Count);
					switch (Main.settings.enabledWorms[index2])
					{
					case 0:
						if (((int)doodad.type == 74 && (doodad.variation == 12 || doodad.variation == 13)) || ((int)doodad.type == 6 && doodad.variation == 2))
						{
							return true;
						}
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[7], val, Quaternion.identity);
						break;
					case 1:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[12], val, Quaternion.identity);
						break;
					case 2:
						__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[13], val, Quaternion.identity);
						break;
					case 3:
					{
						Unit obj3 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienMinibossSandWorm, val, Quaternion.identity);
						__result = ((Component)((obj3 is AlienMinibossSandWorm) ? obj3 : null)).gameObject;
						break;
					}
					case 4:
					{
						Unit obj2 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienSandWormFacehuggerSpitter, val, Quaternion.identity);
						__result = ((Component)((obj2 is AlienMinibossSandWorm) ? obj2 : null)).gameObject;
						break;
					}
					case 5:
					{
						Unit obj = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienSandWormFacehuggerSpitterBehind, val, Quaternion.identity);
						__result = ((Component)((obj is AlienMinibossSandWorm) ? obj : null)).gameObject;
						break;
					}
					}
				}
				else if (Main.settings.enableBosses && num - (double)Main.settings.normalEnemyPercent - (double)(Main.settings.enableWorms ? Main.settings.wormPercent : 0f) < (double)Main.settings.bossPercent && Main.settings.enabledBosses.Count > 0)
				{
					int index3 = rnd.Next(0, Main.settings.enabledBosses.Count);
					switch (Main.settings.enabledBosses[index3])
					{
					case 0:
					{
						Unit obj4 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.satanMiniboss, val, Quaternion.identity);
						SatanMiniboss val3 = (SatanMiniboss)(object)((obj4 is SatanMiniboss) ? obj4 : null);
						if ((Object)(object)val3 != (Object)null)
						{
							__result = ((Component)val3).gameObject;
						}
						break;
					}
					case 1:
						__result = ((Component)Object.Instantiate<TestVanDammeAnim>(__instance.activeTheme.mookDolfLundgren, val, Quaternion.identity)).gameObject;
						break;
					}
				}
				else if (Main.settings.enableLargeBosses && num - (double)(Main.settings.enableNormal ? Main.settings.normalEnemyPercent : 0f) - (double)(Main.settings.enableWorms ? Main.settings.wormPercent : 0f) - (double)(Main.settings.enableBosses ? Main.settings.bossPercent : 0f) < (double)Main.settings.largeBossPercent && Main.settings.enabledLargeBosses.Count > 0)
				{
					int index4 = rnd.Next(0, Main.settings.enabledLargeBosses.Count);
					switch (Main.settings.enabledLargeBosses[index4])
					{
					case 0:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookMammothTank, val, Quaternion.identity)).gameObject;
						break;
					case 1:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookKopterMiniBoss, val, Quaternion.identity)).gameObject;
						break;
					case 2:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.goliathMech, val, Quaternion.identity)).gameObject;
						break;
					case 3:
					{
						Unit obj5 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienGiantSandWormBoss, val, Quaternion.identity);
						__result = ((Component)((obj5 is AlienMinibossSandWorm) ? obj5 : null)).gameObject;
						break;
					}
					}
				}
				else if (Main.settings.enableVehicles && num - (double)(Main.settings.enableNormal ? Main.settings.normalEnemyPercent : 0f) - (double)(Main.settings.enableWorms ? Main.settings.wormPercent : 0f) - (double)(Main.settings.enableBosses ? Main.settings.bossPercent : 0f) - (double)(Main.settings.enableLargeBosses ? Main.settings.largeBossPercent : 0f) < (double)Main.settings.vehiclePercent && Main.settings.enabledVehicles.Count > 0)
				{
					int index5 = rnd.Next(0, Main.settings.enabledVehicles.Count);
					switch (Main.settings.enabledVehicles[index5])
					{
					case 0:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankMookLauncher, val, Quaternion.identity)).gameObject;
						break;
					case 1:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankCannon, val, Quaternion.identity)).gameObject;
						break;
					case 2:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankRockets, val, Quaternion.identity)).gameObject;
						break;
					case 3:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookArtilleryTruck, val, Quaternion.identity)).gameObject;
						break;
					case 4:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookBlimp, val, Quaternion.identity)).gameObject;
						break;
					case 5:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookDrillCarrier, val, Quaternion.identity)).gameObject;
						break;
					case 6:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTruck, val, Quaternion.identity)).gameObject;
						break;
					case 7:
						__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.sandbag, val, Quaternion.identity)).gameObject;
						break;
					case 8:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookMotorBike, val, Quaternion.identity)).gameObject;
						break;
					case 9:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookMotorBikeNuclear, val, Quaternion.identity)).gameObject;
						break;
					case 10:
						__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookDumpTruck, val, Quaternion.identity)).gameObject;
						break;
					}
				}
			}
			else
			{
				switch (Main.settings.debugMookType)
				{
				case 0:
					val2 = __instance.activeTheme.mook;
					break;
				case 1:
					val2 = __instance.activeTheme.mookSuicide;
					break;
				case 2:
					val2 = __instance.activeTheme.mookRiotShield;
					break;
				case 3:
					val2 = __instance.activeTheme.mookBigGuy;
					break;
				case 4:
					val2 = __instance.activeTheme.mookScout;
					break;
				case 5:
					val2 = __instance.activeTheme.mookDog;
					break;
				case 6:
					val2 = __instance.activeTheme.mookArmoured;
					break;
				case 7:
					val2 = __instance.activeTheme.mookGrenadier;
					break;
				case 8:
					val2 = __instance.activeTheme.mookBazooka;
					break;
				case 9:
					val2 = __instance.activeTheme.mookNinja;
					break;
				case 10:
					val2 = (TestVanDammeAnim)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookJetpack;
					break;
				case 11:
					val2 = __instance.activeTheme.mookXenomorphBrainbox;
					break;
				case 12:
					val2 = __instance.activeTheme.skinnedMook;
					break;
				case 13:
					val2 = __instance.activeTheme.mookGeneral;
					break;
				case 14:
					val2 = __instance.activeTheme.satan;
					break;
				case 15:
					val2 = __instance.activeTheme.alienFaceHugger;
					break;
				case 16:
					val2 = __instance.activeTheme.alienXenomorph;
					break;
				case 17:
					val2 = __instance.activeTheme.alienBrute;
					break;
				case 18:
					val2 = __instance.activeTheme.alienBaneling;
					break;
				case 19:
					val2 = __instance.activeTheme.alienMosquito;
					break;
				case 20:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[0], val, Quaternion.identity);
					break;
				case 21:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[1], val, Quaternion.identity);
					break;
				case 22:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[2], val, Quaternion.identity);
					break;
				case 23:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[3], val, Quaternion.identity);
					break;
				case 24:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[4], val, Quaternion.identity);
					break;
				case 25:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[5], val, Quaternion.identity);
					break;
				case 26:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[6], val, Quaternion.identity);
					break;
				case 27:
					val.y += 5f;
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[8], val, Quaternion.identity);
					break;
				case 28:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[10], val, Quaternion.identity);
					break;
				case 29:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[7], val, Quaternion.identity);
					break;
				case 30:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[12], val, Quaternion.identity);
					break;
				case 31:
					__result = Object.Instantiate<GameObject>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.hellEnemies[13], val, Quaternion.identity);
					break;
				case 32:
				{
					Unit obj10 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienMinibossSandWorm, val, Quaternion.identity);
					__result = ((Component)((obj10 is AlienMinibossSandWorm) ? obj10 : null)).gameObject;
					break;
				}
				case 33:
				{
					Unit obj9 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienSandWormFacehuggerSpitter, val, Quaternion.identity);
					__result = ((Component)((obj9 is AlienMinibossSandWorm) ? obj9 : null)).gameObject;
					break;
				}
				case 34:
				{
					Unit obj8 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienSandWormFacehuggerSpitterBehind, val, Quaternion.identity);
					__result = ((Component)((obj8 is AlienMinibossSandWorm) ? obj8 : null)).gameObject;
					break;
				}
				case 35:
				{
					Unit obj7 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.satanMiniboss, val, Quaternion.identity);
					SatanMiniboss val4 = (SatanMiniboss)(object)((obj7 is SatanMiniboss) ? obj7 : null);
					if ((Object)(object)val4 != (Object)null)
					{
						__result = ((Component)val4).gameObject;
					}
					break;
				}
				case 36:
					__result = ((Component)Object.Instantiate<TestVanDammeAnim>(__instance.activeTheme.mookDolfLundgren, val, Quaternion.identity)).gameObject;
					break;
				case 37:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookMammothTank, val, Quaternion.identity)).gameObject;
					break;
				case 38:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookKopterMiniBoss, val, Quaternion.identity)).gameObject;
					break;
				case 39:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.goliathMech, val, Quaternion.identity)).gameObject;
					break;
				case 40:
				{
					Unit obj6 = Object.Instantiate<Unit>(((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.alienGiantSandWormBoss, val, Quaternion.identity);
					__result = ((Component)((obj6 is AlienMinibossSandWorm) ? obj6 : null)).gameObject;
					break;
				}
				case 41:
					val2 = __instance.activeTheme.evilAgent;
					break;
				case 42:
					val2 = __instance.activeTheme.mookMortar;
					break;
				case 43:
					val2 = __instance.activeTheme.mookJetpackBazooka;
					break;
				case 44:
					val2 = __instance.activeTheme.mookAlarmist;
					break;
				case 45:
					val2 = __instance.activeTheme.mookStrong;
					break;
				case 46:
					val2 = __instance.activeTheme.mookBigGuyElite;
					break;
				case 47:
					val2 = __instance.activeTheme.mookScientist;
					break;
				case 48:
					val2 = __instance.activeTheme.mookSuicideBigGuy;
					break;
				case 49:
					val2 = __instance.activeTheme.snake;
					break;
				case 50:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankMookLauncher, val, Quaternion.identity)).gameObject;
					break;
				case 51:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankCannon, val, Quaternion.identity)).gameObject;
					break;
				case 52:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTankRockets, val, Quaternion.identity)).gameObject;
					break;
				case 53:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookArtilleryTruck, val, Quaternion.identity)).gameObject;
					break;
				case 54:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookBlimp, val, Quaternion.identity)).gameObject;
					break;
				case 55:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookDrillCarrier, val, Quaternion.identity)).gameObject;
					break;
				case 56:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.mookTruck, val, Quaternion.identity)).gameObject;
					break;
				case 57:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mechBrown, val, Quaternion.identity)).gameObject;
					break;
				case 58:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.treasureMook, val, Quaternion.identity)).gameObject;
					break;
				case 59:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookBigGuyStrong, val, Quaternion.identity)).gameObject;
					break;
				case 60:
					__result = ((Component)Object.Instantiate<Unit>(__instance.activeTheme.sandbag, val, Quaternion.identity)).gameObject;
					break;
				case 61:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookMotorBike, val, Quaternion.identity)).gameObject;
					break;
				case 62:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookMotorBikeNuclear, val, Quaternion.identity)).gameObject;
					break;
				case 63:
					__result = ((Component)Object.Instantiate<Unit>((Unit)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)__instance.sharedObjectsReference).Asset.mookDumpTruck, val, Quaternion.identity)).gameObject;
					break;
				}
				if ((Object)(object)val2 != (Object)null)
				{
					__result = ((Component)Object.Instantiate<TestVanDammeAnim>(val2, val, Quaternion.identity)).gameObject;
				}
			}
			if ((Object)(object)__result != (Object)null)
			{
				doodad.entity = __result;
				__result.transform.parent = ((Component)__instance).transform;
				Block component = __result.GetComponent<Block>();
				if ((Object)(object)component != (Object)null)
				{
					component.OnSpawned();
				}
				Registry.RegisterDeterminsiticGameObject(__result.gameObject);
				if ((Object)(object)component != (Object)null)
				{
					component.FirstFrame();
				}
				return false;
			}
		}
		else if (((int)doodad.type == 59 || (int)doodad.type == 46) && Main.settings.enableAmmoRandomization && Main.settings.enabledAmmoTypes.Count > 0 && (double)Main.settings.ammoRandomizationPercent > rnd.NextDouble() * 100.0)
		{
			doodad.type = (DoodadType)59;
			doodad.variation = Main.settings.enabledAmmoTypes[rnd.Next(0, Main.settings.enabledAmmoTypes.Count)];
		}
		return true;
	}
}
[HarmonyPatch(typeof(Map), "PlaceGround")]
internal static class Map_PlaceGround
{
	private static readonly Random rnd = new Random();

	public static Block getRandomBlockPrefab()
	{
		Block result = null;
		if ((Object)(object)Map_PlaceDoodad.mapInstance != (Object)null)
		{
			int index = rnd.Next(0, Main.settings.enabledAmmoTypes.Count);
			switch (Main.settings.enabledAmmoTypes[index])
			{
			case 0:
				result = (Block)(object)Map_PlaceDoodad.mapInstance.activeTheme.crateAmmo;
				break;
			case 1:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateTimeCop;
				break;
			case 2:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateRCCar;
				break;
			case 3:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateAirstrike;
				break;
			case 4:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateMechDrop;
				break;
			case 5:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateAlienPheromonesDrop;
				break;
			case 6:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.crateSteroids;
				break;
			case 7:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.cratePiggy;
				break;
			case 8:
				result = (Block)(object)((AssetBundleReference<SharedLevelObjectsHolder>)(object)Map_PlaceDoodad.mapInstance.sharedObjectsReference).Asset.cratePerk;
				break;
			}
		}
		return result;
	}

	public static bool Prefix(Map __instance, ref GroundType placeGroundType, ref int x, ref int y, ref Block[,] newBlocks, ref bool addToRegistry, ref Block __result, ref GroundType[,] ___groundTypes, ref Block ___currentBlock)
	{
		//IL_0068: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Invalid comparison between Unknown and I4
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		if (!Main.enabled)
		{
			return true;
		}
		if (Main.settings.enableCratesTurningIntoAmmo && (int)placeGroundType == 33 && (double)Main.settings.cratesToAmmoPercent > rnd.NextDouble() * 100.0)
		{
			Map_PlaceDoodad.mapInstance = __instance;
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor((float)(x * 16), (float)(y * 16), 5f);
			Block val2 = Object.Instantiate<Block>(getRandomBlockPrefab(), val, Quaternion.identity);
			if ((int)placeGroundType != 29 && ((int)placeGroundType != 62 || newBlocks != Map.backGroundBlocks))
			{
				newBlocks[x, y] = val2;
				___groundTypes[x, y] = placeGroundType;
			}
			if ((Object)(object)val2 != (Object)null)
			{
				val2.OnSpawned();
				if ((int)val2.groundType == 2 && val2.size == 2)
				{
					Map.SetBlockEmpty(newBlocks[x + 1, y], x + 1, y);
					newBlocks[x + 1, y] = val2;
					Map.SetBlockEmpty(newBlocks[x, y - 1], x, y - 1);
					newBlocks[x, y - 1] = val2;
					Map.SetBlockEmpty(newBlocks[x + 1, y - 1], x + 1, y - 1);
					newBlocks[x + 1, y - 1] = val2;
				}
			}
			if ((Object)(object)val2 != (Object)null)
			{
				((Component)val2).transform.parent = ((Component)__instance).transform;
				__result = val2;
				___currentBlock = val2;
			}
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(SatanMiniboss), "ForceCameraToFollow")]
internal static class SatanMiniboss_ForceCameraToFollow
{
	public static bool Prefix(SatanMiniboss __instance)
	{
		if (!Main.enabled)
		{
			return true;
		}
		return false;
	}
}
[HarmonyPatch(typeof(SatanMiniboss), "AnimateDeath")]
internal static class SatanMiniboss_AnimateDeath
{
	public static void Prefix(SatanMiniboss __instance)
	{
		if (Main.enabled && Main.settings.enableDeathField)
		{
			__instance.primedToSelfDestruct = true;
		}
	}
}
[HarmonyPatch(typeof(DolphLundrenSoldier), "Gib")]
internal static class DolphLundrenSoldier_Gib
{
	public static void Prefix()
	{
		if (Main.enabled && !Main.settings.enableInstantWin && (!(LevelSelectionController.currentCampaign.name == "WM_Village1(mouse)") || LevelSelectionController.CurrentLevelNum != 3))
		{
			Main.ignoreNextWin = true;
		}
	}
}
[HarmonyPatch(typeof(MinibossEndCheck), "Update")]
internal static class MinibossEndCheck_Update
{
	public static void Prefix(MinibossEndCheck __instance, Unit ___miniBossUnit, int ___explosionDeathCount, ref float ___explosionDeathCounter)
	{
		if (Main.enabled && !Main.settings.enableInstantWin && (!(LevelSelectionController.currentCampaign.name == "WM_Mission1(mouse)") || LevelSelectionController.CurrentLevelNum != 3) && (!(LevelSelectionController.currentCampaign.name == "WM_Bombardment(mouse)") || LevelSelectionController.CurrentLevelNum != 2) && ((BroforceObject)___miniBossUnit).health <= 0 && ___explosionDeathCount > 0 && ___explosionDeathCounter + Time.deltaTime > 0.33f && ___explosionDeathCount - 1 <= 0)
		{
			Main.ignoreNextWin = true;
		}
	}
}
[HarmonyPatch(typeof(GoliathMech), "Death")]
internal static class GoliathMech_Death
{
	public static void Prefix()
	{
		if (Main.enabled && !Main.settings.enableInstantWin && (!(LevelSelectionController.currentCampaign.name == "WM_KazakhstanRainy(mouse)") || LevelSelectionController.CurrentLevelNum != 3))
		{
			Main.ignoreNextWin = true;
		}
	}

	public static void Postfix(GoliathMech __instance)
	{
		if (Main.enabled && !Main.settings.enableInstantWin && (!(LevelSelectionController.currentCampaign.name == "WM_KazakhstanRainy(mouse)") || LevelSelectionController.CurrentLevelNum != 3))
		{
			((Unit)__instance).actionState = (ActionState)0;
		}
	}
}
[HarmonyPatch(typeof(GameModeController), "LevelFinish")]
internal static class GameModeController_LevelFinish
{
	public static bool Prefix()
	{
		if (!Main.enabled || !Main.ignoreNextWin)
		{
			return true;
		}
		Main.ignoreNextWin = false;
		return false;
	}
}
[HarmonyPatch(typeof(PlayerProgress), "GetUnlockedFlexPickups")]
internal static class PlayerProgress_GetUnlockedFlexPickups
{
	public static bool Prefix(ref List<PickupType> __result)
	{
		if (!Main.enabled || !Main.settings.unlockAllFlexPowers)
		{
			return true;
		}
		__result = new List<PickupType>();
		__result.Add((PickupType)10);
		__result.Add((PickupType)12);
		__result.Add((PickupType)11);
		__result.Add((PickupType)13);
		return false;
	}
}
internal static class Main
{
	public static ModEntry mod;

	public static bool enabled;

	public static Settings settings;

	public static string debugMookString = "0";

	public static string debugMookStringSummoned = "0";

	public static string debugAmmoTypeString = "0";

	public static int debugAmmoType = 0;

	public static string[] debugMookTypeList = new string[64]
	{
		"mook", "mookSuicide", "mookRiotShield", "mookBigGuy", "mookScout", "mookDog", "mookArmoured", "mookGrenadier", "mookBazooka", "mookNinja",
		"mookJetpack", "mookXenomorphBrainbox", "skinnedMook", "mookGeneral", "satan", "alienFaceHugger", "alienXenomorph", "alienBrute", "alienBaneling", "alienMosquito",
		"ZHellDog - class HellDog", "ZMookUndead - class UndeadTrooper", "ZMookUndeadStartDead - class UndeadTrooper", "ZMookWarlock - class Warlock", "ZMookHellBoomer - class MookHellBoomer", "ZMookUndeadSuicide - class MookSuicideUndead", "ZHellBigGuy - class MookHellBigGuy", "ZHellLostSoul - class HellLostSoul", "ZMookHellSoulCatcher - class MookHellSoulCatcher", "Hell BoneWorm - class AlienGiantSandWorm",
		"Hell MiniBoss BoneWorm - class HellBoneWormMiniboss", "Hell MiniBoss BoneWorm Behind - class HellBoneWormMiniboss", "Alien Worm", "Alien Facehugger Worm", "Alien Facehugger Worm Behind", "Satan Miniboss", "mookDolfLundgren", "mookMammothTank", "mookKopterMiniBoss", "goliathMech",
		"Large Alien Worm", "evilAgent", "mookMortar", "mookJetpackBazooka", "mookAlarmist", "mookStrong", "mookBigGuyElite", "mookScientist", "mookSuicideBigGuy", "snake",
		"mookTankMookLauncher", "mookTankCannon", "mookTankRockets", "mookArtilleryTruck", "mookBlimp", "mookDrillCarrier", "mookTruck", "mechBrown", "treasureMook", "mookBigGuyStrong",
		"sandbag", "mookMotorBike", "mookMotorBikeNuclear", "mookDumpTruck"
	};

	public static string[] debugMookSummonedList = new string[37]
	{
		"Mook", "Suicide Mook", "Bruiser", "Suicide Bruiser", "Elite Bruiser", "Scout Mook", "Riot Shield Mook", "Mech", "Jetpack Mook", "Grenadier Mook",
		"Bazooka Mook", "Jetpack Bazooka Mook", "Ninja Mook", "Attack Dog", "Skinned Mook", "Mook General", "Strong Mook", "Scientist Mook", "Snake", "Satan",
		"Facehugger", "Xenomorph", "Brute", "Screecher", "Baneling", "Xenomorph Brainbox", "Hellhound", "Undead Mook", "Undead Mook (Start Dead)", "Warlock",
		"Boomer", "Undead Suicide Mook", "Executioner", "Lost Soul", "Soul Catcher", "Satan Boss", "CR666"
	};

	public static bool ignoreNextWin = false;

	public static string[] normalList = new string[39]
	{
		"Mook", "Suicide Mook", "Bruiser", "Suicide Bruiser", "Strong Bruiser", "Elite Bruiser", "Scout Mook", "Riot Shield Mook", "Mech", "Brown Mech",
		"Jetpack Mook", "Grenadier Mook", "Bazooka Mook", "Jetpack Bazooka Mook", "Ninja Mook", "Treasure Mook", "Attack Dog", "Skinned Mook", "Mook General", "Alarmist",
		"Strong Mook", "Scientist Mook", "Snake", "Satan", "Facehugger", "Xenomorph", "Brute", "Screecher", "Baneling", "Xenomorph Brainbox",
		"Hellhound", "Undead Mook", "Undead Mook (Start Dead)", "Warlock", "Boomer", "Undead Suicide Mook", "Executioner", "Lost Soul", "Soul Catcher"
	};

	public static string[] wormList = new string[6] { "SandWorm", "Boneworm", "Boneworm Behind", "Alien Worm", "Alien Facehugger Worm", "Alien Facehugger Worm Behind" };

	public static string[] bossList = new string[2] { "Satan", "CR666" };

	public static string[] largeBossList = new string[4] { "Stealth Tank", "Terrorkopter", "Terrorbot", "Large Alien Worm" };

	public static string[] vehicleList = new string[11]
	{
		"Mook Launcher Tank", "Cannon Tank", "Rocket Tank", "Artillery Truck", "Blimp", "Drill carrier", "Mook Truck", "Turret", "Motorbike", "Motorbike Nuclear",
		"Dump Truck"
	};

	public static string[] ammoList = new string[9] { "Ammo", "Slow Time", "RC Car", "Air Strike", "Mech Drop", "Alien Pheromones", "Steroids", "Pig", "Flex Power" };

	private static bool Load(ModEntry modEntry)
	{
		//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bd: Expected O, but got Unknown
		modEntry.OnGUI = OnGUI;
		modEntry.OnSaveGUI = OnSaveGUI;
		modEntry.OnToggle = OnToggle;
		settings = ModSettings.Load<Settings>(modEntry);
		if (settings.defaultSettings)
		{
			settings.enabledNormal = new List<int>();
			settings.enabledWorms = new List<int>();
			settings.enabledBosses = new List<int>();
			settings.enabledLargeBosses = new List<int>();
			settings.enabledVehicles = new List<int>();
			settings.enabledAmmoTypes = new List<int>();
			for (int i = 0; i < normalList.Length; i++)
			{
				settings.enabledNormal.Add(i);
			}
			for (int j = 0; j < wormList.Length; j++)
			{
				settings.enabledWorms.Add(j);
			}
			for (int k = 0; k < bossList.Length; k++)
			{
				settings.enabledBosses.Add(k);
			}
			for (int l = 0; l < largeBossList.Length; l++)
			{
				settings.enabledLargeBosses.Add(l);
			}
			for (int m = 0; m < vehicleList.Length; m++)
			{
				settings.enabledVehicles.Add(m);
			}
			for (int n = 0; n < ammoList.Length; n++)
			{
				settings.enabledAmmoTypes.Add(n);
			}
			settings.enabledAmmoTypes.Remove(7);
			settings.defaultSettings = false;
		}
		mod = modEntry;
		Harmony val = new Harmony(modEntry.Info.Id);
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		try
		{
			val.PatchAll(executingAssembly);
		}
		catch (Exception ex)
		{
			Log("Harmony Patch Exception: " + ex.ToString());
		}
		debugMookString = settings.debugMookType.ToString();
		debugMookStringSummoned = settings.debugMookTypeSummoned.ToString();
		return true;
	}

	private static void OnGUI(ModEntry modEntry)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Expected O, but got Unknown
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: Expected O, but got Unknown
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ec: Expected O, but got Unknown
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Unknown result type (might be due to invalid IL or missing references)
		//IL_012f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_0316: Expected O, but got Unknown
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0354: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0507: Expected O, but got Unknown
		//IL_0525: Unknown result type (might be due to invalid IL or missing references)
		//IL_0535: Expected O, but got Unknown
		//IL_054c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0551: Unknown result type (might be due to invalid IL or missing references)
		//IL_0578: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_0720: Expected O, but got Unknown
		//IL_0732: Unknown result type (might be due to invalid IL or missing references)
		//IL_0737: Unknown result type (might be due to invalid IL or missing references)
		//IL_075e: Unknown result type (might be due to invalid IL or missing references)
		//IL_08f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0906: Expected O, but got Unknown
		//IL_0918: Unknown result type (might be due to invalid IL or missing references)
		//IL_091d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0944: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b46: Expected O, but got Unknown
		//IL_0b64: Unknown result type (might be due to invalid IL or missing references)
		//IL_0b74: Expected O, but got Unknown
		//IL_0b92: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ba2: Expected O, but got Unknown
		//IL_0bb9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0bbe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0be5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0dcc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ddc: Expected O, but got Unknown
		//IL_0e4e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e5e: Expected O, but got Unknown
		//IL_0dee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0df3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e1a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ed0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ee0: Expected O, but got Unknown
		//IL_0e70: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e75: Unknown result type (might be due to invalid IL or missing references)
		//IL_0e9c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f52: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f62: Expected O, but got Unknown
		//IL_0ef2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0ef7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f1e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fd0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fed: Expected O, but got Unknown
		//IL_1066: Unknown result type (might be due to invalid IL or missing references)
		//IL_1083: Expected O, but got Unknown
		//IL_10f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_110f: Expected O, but got Unknown
		//IL_117e: Unknown result type (might be due to invalid IL or missing references)
		//IL_119b: Expected O, but got Unknown
		//IL_120a: Unknown result type (might be due to invalid IL or missing references)
		//IL_1227: Expected O, but got Unknown
		//IL_1296: Unknown result type (might be due to invalid IL or missing references)
		//IL_12b3: Expected O, but got Unknown
		//IL_1322: Unknown result type (might be due to invalid IL or missing references)
		//IL_133f: Expected O, but got Unknown
		//IL_13ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_13cb: Expected O, but got Unknown
		//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
		//IL_0f79: Unknown result type (might be due to invalid IL or missing references)
		//IL_0fa0: Unknown result type (might be due to invalid IL or missing references)
		//IL_143c: Unknown result type (might be due to invalid IL or missing references)
		//IL_1441: Unknown result type (might be due to invalid IL or missing references)
		//IL_1468: Unknown result type (might be due to invalid IL or missing references)
		WindowScaling.Enabled = settings.scaleUIWithWindowWidth;
		WindowScaling.TryCaptureWidth();
		settings.enableEnemyRandomization = GUILayout.Toggle(settings.enableEnemyRandomization, new GUIContent("Enable Enemy Randomization", "Randomly replaces enemies of one type with another"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		Rect lastRect = GUILayoutUtility.GetLastRect();
		((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
		((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
		GUI.Label(lastRect, GUI.tooltip);
		string tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableNormal = GUILayout.Toggle(settings.enableNormal, new GUIContent("Allow Enemies to become other Normal Enemies", "Chance for enemies to become other normal enemies, aliens, or hell enemies"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableNormalSummoned = GUILayout.Toggle(settings.enableNormalSummoned, new GUIContent("Allow Summoned Enemies to become other Normal Enemies", "Chance for enemies summoned by parachute, doors, bosses, or other enemies to become other normal enemies, aliens, or hell enemies"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Normal Enemies", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showNormal = !settings.showNormal;
		}
		if (settings.showNormal)
		{
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int i = 0; i < normalList.Length; i++)
			{
				if (i != 0 && i % 5 == 0)
				{
					GUILayout.EndHorizontal();
					GUILayout.Space(5f);
				}
				if (i % 5 == 0)
				{
					GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
				}
				bool flag = settings.enabledNormal.Contains(i);
				if (flag != GUILayout.Toggle(flag, normalList[i], (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(175f) }))
				{
					if (flag)
					{
						settings.enabledNormal.Remove(i);
					}
					else
					{
						settings.enabledNormal.Add(i);
					}
				}
				if (i + 1 == normalList.Length)
				{
					GUILayout.EndHorizontal();
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledNormal.Clear();
				for (int j = 0; j < normalList.Length; j++)
				{
					settings.enabledNormal.Add(j);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledNormal.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		settings.enableWorms = GUILayout.Toggle(settings.enableWorms, new GUIContent("Allow Enemies to become Worms", "Chance for enemies to become Sandworms or Boneworms"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Worms", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showWorms = !settings.showWorms;
		}
		if (settings.showWorms)
		{
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int k = 0; k < wormList.Length; k++)
			{
				bool flag2 = settings.enabledWorms.Contains(k);
				if (flag2 != GUILayout.Toggle(flag2, wormList[k], (GUILayoutOption[])(object)new GUILayoutOption[0]))
				{
					if (flag2)
					{
						settings.enabledWorms.Remove(k);
					}
					else
					{
						settings.enabledWorms.Add(k);
					}
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledWorms.Clear();
				for (int l = 0; l < wormList.Length; l++)
				{
					settings.enabledWorms.Add(l);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledWorms.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableBosses = GUILayout.Toggle(settings.enableBosses, new GUIContent("Allow Enemies to become Bosses", "Chance for enemies to become certain minibosses"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableBossSummoned = GUILayout.Toggle(settings.enableBossSummoned, new GUIContent("Allow Summoned Enemies to become Bosses", "Chance for enemies summoned by parachute, doors, bosses, or other enemies to become certain minibosses"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Bosses", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showBosses = !settings.showBosses;
		}
		if (settings.showBosses)
		{
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int m = 0; m < bossList.Length; m++)
			{
				bool flag3 = settings.enabledBosses.Contains(m);
				if (flag3 != GUILayout.Toggle(flag3, bossList[m], (GUILayoutOption[])(object)new GUILayoutOption[0]))
				{
					if (flag3)
					{
						settings.enabledBosses.Remove(m);
					}
					else
					{
						settings.enabledBosses.Add(m);
					}
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledBosses.Clear();
				for (int n = 0; n < bossList.Length; n++)
				{
					settings.enabledBosses.Add(n);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledBosses.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		settings.enableLargeBosses = GUILayout.Toggle(settings.enableLargeBosses, new GUIContent("Allow Enemies to become Large Bosses", "Chance for enemies to become certain large bosses"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Large Bosses", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showLargeBosses = !settings.showLargeBosses;
		}
		if (settings.showLargeBosses)
		{
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int num = 0; num < largeBossList.Length; num++)
			{
				bool flag4 = settings.enabledLargeBosses.Contains(num);
				if (flag4 != GUILayout.Toggle(flag4, largeBossList[num], (GUILayoutOption[])(object)new GUILayoutOption[0]))
				{
					if (flag4)
					{
						settings.enabledLargeBosses.Remove(num);
					}
					else
					{
						settings.enabledLargeBosses.Add(num);
					}
				}
			}
			GUILayout.EndHorizontal();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledLargeBosses.Clear();
				for (int num2 = 0; num2 < largeBossList.Length; num2++)
				{
					settings.enabledLargeBosses.Add(num2);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledLargeBosses.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		settings.enableVehicles = GUILayout.Toggle(settings.enableVehicles, new GUIContent("Allow Enemies to become Vehicles", "Chance for enemies to become certain vehicles"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Vehicles", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showVehicles = !settings.showVehicles;
		}
		if (settings.showVehicles)
		{
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int num3 = 0; num3 < vehicleList.Length; num3++)
			{
				if (num3 != 0 && num3 % 5 == 0)
				{
					GUILayout.EndHorizontal();
					GUILayout.Space(5f);
				}
				if (num3 % 5 == 0)
				{
					GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
				}
				bool flag5 = settings.enabledVehicles.Contains(num3);
				if (flag5 != GUILayout.Toggle(flag5, vehicleList[num3], (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(175f) }))
				{
					if (flag5)
					{
						settings.enabledVehicles.Remove(num3);
					}
					else
					{
						settings.enabledVehicles.Add(num3);
					}
				}
				if (num3 + 1 == vehicleList.Length)
				{
					GUILayout.EndHorizontal();
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledVehicles.Clear();
				for (int num4 = 0; num4 < vehicleList.Length; num4++)
				{
					settings.enabledVehicles.Add(num4);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledVehicles.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableAmmoRandomization = GUILayout.Toggle(settings.enableAmmoRandomization, new GUIContent("Randomize Ammo Crates", "Enables crates being randomized to other pickup types"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.enableCratesTurningIntoAmmo = GUILayout.Toggle(settings.enableCratesTurningIntoAmmo, new GUIContent("Convert Wooden Boxes to Ammo Crates", "Converts wooden boxes to ammo crates, percentage chance can be controlled below"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		settings.unlockAllFlexPowers = GUILayout.Toggle(settings.unlockAllFlexPowers, new GUIContent("Unlock All Flex Powers", "Unlocks all flex powers immediately when starting a new game"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		if (GUILayout.Button("Ammo Types", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			settings.showAmmo = !settings.showAmmo;
		}
		if (settings.showAmmo)
		{
			GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[0]);
			for (int num5 = 0; num5 < ammoList.Length; num5++)
			{
				if (num5 != 0 && num5 % 5 == 0)
				{
					GUILayout.EndHorizontal();
					GUILayout.Space(5f);
				}
				if (num5 % 5 == 0)
				{
					GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
				}
				bool flag6 = settings.enabledAmmoTypes.Contains(num5);
				if (flag6 != GUILayout.Toggle(flag6, ammoList[num5], (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(175f) }))
				{
					if (flag6)
					{
						settings.enabledAmmoTypes.Remove(num5);
					}
					else
					{
						settings.enabledAmmoTypes.Add(num5);
					}
				}
				if (num5 + 1 == ammoList.Length)
				{
					GUILayout.EndHorizontal();
				}
			}
			GUILayout.EndVertical();
			GUILayout.Space(20f);
			GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (GUILayout.Button("Select All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledAmmoTypes.Clear();
				for (int num6 = 0; num6 < ammoList.Length; num6++)
				{
					settings.enabledAmmoTypes.Add(num6);
				}
			}
			GUILayout.Space(10f);
			if (GUILayout.Button("Deselect All", (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) }))
			{
				settings.enabledAmmoTypes.Clear();
			}
			GUILayout.EndHorizontal();
		}
		GUILayout.Space(40f);
		settings.enableInstantWin = GUILayout.Toggle(settings.enableInstantWin, new GUIContent("Killing Bosses triggers level finish", "If this is enabled, killing a boss will trigger a level end even if you're not on a boss level"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		settings.enableDeathField = GUILayout.Toggle(settings.enableDeathField, new GUIContent("Enable Satan Death Field", "This causes randomly spawned satan bosses to spawn their death fields after they are fully killed"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		settings.enableSpawnedEnemiesRandomization = GUILayout.Toggle(settings.enableSpawnedEnemiesRandomization, new GUIContent("Enable Summoned Enemy Randomization", "This causes enemies summoned by parachute, doors, bosses, or other enemies to be randomized as well"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(20f);
		settings.scaleUIWithWindowWidth = GUILayout.Toggle(settings.scaleUIWithWindowWidth, new GUIContent("Scale UI with Window Width", "Scales UI elements based on window width"), (GUILayoutOption[])(object)new GUILayoutOption[0]);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 500f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(25f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Randomized Enemy Percent: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.enemyPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.enemyPercent = GUILayout.HorizontalSlider(settings.enemyPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.Space(15f);
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Normal Enemy Chance: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.normalEnemyPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.normalEnemyPercent = GUILayout.HorizontalSlider(settings.normalEnemyPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Worm Chance: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.wormPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.wormPercent = GUILayout.HorizontalSlider(settings.wormPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Boss Chance: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.bossPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.bossPercent = GUILayout.HorizontalSlider(settings.bossPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Large Boss Chance: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.largeBossPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.largeBossPercent = GUILayout.HorizontalSlider(settings.largeBossPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Vehicle Chance: ", "Randomized enemy percent determines the chance for each enemy to be randomized, each of the other sliders determines how likely that enemy is to become an enemy of that type."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.vehiclePercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.vehiclePercent = GUILayout.HorizontalSlider(settings.vehiclePercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Ammo Chance: ", "Chance for ammo crates to be randomized to other ammo types."), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.ammoRandomizationPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.ammoRandomizationPercent = GUILayout.HorizontalSlider(settings.ammoRandomizationPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.Label(new GUIContent("Wooden Box to Ammo Chance: ", "Chance for wooden boxes to be turned into random ammo crates"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(200f) });
		GUILayout.Label(settings.cratesToAmmoPercent.ToString("0.00"), (GUILayoutOption[])(object)new GUILayoutOption[1] { WindowScaling.ScaledWidth(100f) });
		settings.cratesToAmmoPercent = GUILayout.HorizontalSlider(settings.cratesToAmmoPercent, 0f, 100f, (GUILayoutOption[])(object)new GUILayoutOption[0]);
		GUILayout.EndHorizontal();
		GUILayout.Space(10f);
		if (tooltip != GUI.tooltip)
		{
			lastRect = GUILayoutUtility.GetLastRect();
			((Rect)(ref lastRect)).y = ((Rect)(ref lastRect)).y + 20f;
			((Rect)(ref lastRect)).width = ((Rect)(ref lastRect)).width + 900f;
			GUI.Label(lastRect, GUI.tooltip);
		}
		tooltip = GUI.tooltip;
		GUILayout.Space(50f);
		if (settings.DEBUG)
		{
			debugMookString = GUILayout.TextField(debugMookString, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (int.TryParse(debugMookString, out var result))
			{
				settings.debugMookType = result;
			}
			if (settings.debugMookType > debugMookTypeList.Length - 1)
			{
				settings.debugMookType = debugMookTypeList.Length - 1;
			}
			if (settings.debugMookType < 0)
			{
				settings.debugMookType = 0;
			}
			GUILayout.Label("Current Enemy Type: " + debugMookTypeList[settings.debugMookType], (GUILayoutOption[])(object)new GUILayoutOption[0]);
			GUILayout.Space(15f);
			debugMookStringSummoned = GUILayout.TextField(debugMookStringSummoned, (GUILayoutOption[])(object)new GUILayoutOption[0]);
			if (int.TryParse(debugMookStringSummoned, out result))
			{
				settings.debugMookTypeSummoned = result;
			}
			if (settings.debugMookTypeSummoned > debugMookSummonedList.Length)
			{
				settings.debugMookTypeSummoned = debugMookSummonedList.Length - 1;
			}
			if (settings.debugMookTypeSummoned < 0)
			{
				settings.debugMookTypeSummoned = 0;
			}
			int debugMookTypeSummoned = settings.debugMookTypeSummoned;
			GUILayout.Label("Current Summoned Enemy Type: " + debugMookSummonedList[debugMookTypeSummoned], (GUILayoutOption[])(object)new GUILayoutOption[0]);
		}
	}

	private static void OnSaveGUI(ModEntry modEntry)
	{
		((ModSettings)settings).Save(modEntry);
	}

	private static bool OnToggle(ModEntry modEntry, bool value)
	{
		enabled = value;
		return true;
	}

	public static void Log(string str)
	{
		mod.Logger.Log(str);
	}
}
public class Settings : ModSettings
{
	public bool enableEnemyRandomization = true;

	public bool enableNormal = true;

	public bool enableWorms = true;

	public bool enableBosses = true;

	public bool enableLargeBosses = true;

	public bool enableVehicles;

	public bool enableNormalSummoned = true;

	public bool enableBossSummoned = true;

	public bool enableAmmoRandomization;

	public bool enableCratesTurningIntoAmmo;

	public bool unlockAllFlexPowers;

	public bool showNormal;

	public bool showWorms;

	public bool showBosses;

	public bool showLargeBosses;

	public bool showVehicles;

	public bool showAmmo;

	public List<int> enabledNormal;

	public List<int> enabledWorms;

	public List<int> enabledBosses;

	public List<int> enabledLargeBosses;

	public List<int> enabledVehicles;

	public List<int> enabledAmmoTypes;

	public bool enableInstantWin = true;

	public bool enableDeathField = true;

	public bool enableSpawnedEnemiesRandomization = true;

	public float enemyPercent = 100f;

	public float normalEnemyPercent = 100f;

	public float wormPercent = 2f;

	public float bossPercent = 5f;

	public float largeBossPercent = 3f;

	public float vehiclePercent = 1f;

	public float ammoRandomizationPercent = 100f;

	public float cratesToAmmoPercent = 1f;

	public bool defaultSettings = true;

	public bool scaleUIWithWindowWidth = true;

	public bool DEBUG;

	public int debugMookType;

	public int debugMookTypeSummoned;

	public override void Save(ModEntry modEntry)
	{
		ModSettings.Save<Settings>(this, modEntry);
	}
}