Decompiled source of MapImprovements v0.9.1

MapImprovements.dll

Decompiled a day ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using MapImprovements.Patches;
using Unity.AI.Navigation;
using Unity.Collections;
using Unity.Netcode;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Map Improvements")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Map Improvements")]
[assembly: AssemblyCopyright("Copyright Spookybuddy 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("28f2f16b-6471-4c7e-b0a4-007e3a2450d4")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MapImprovements
{
	internal class ConfigControl : SyncedInstance<ConfigControl>
	{
		public enum Setting
		{
			Enabled,
			Disabled,
			Always,
			Never,
			CombineA,
			CombineB,
			CombineC,
			CombineAll,
			RandomA,
			RandomB,
			RandomC,
			RandomAny
		}

		public struct MoonConfig
		{
			public ConfigEntry<bool> cfgEnabled;

			public ConfigEntry<bool> cfgIncludeDefault;

			public ObjectConfig[] cfgObjects;

			internal bool Enabled
			{
				get
				{
					return cfgEnabled.Value;
				}
				set
				{
					cfgEnabled.Value = value;
				}
			}

			internal bool Vanilla
			{
				get
				{
					return cfgIncludeDefault.Value;
				}
				set
				{
					cfgIncludeDefault.Value = value;
				}
			}
		}

		public struct ObjectConfig
		{
			public ConfigEntry<Setting> cfgSetting;

			internal Setting Settings
			{
				get
				{
					if (cfgSetting != null)
					{
						return cfgSetting.Value;
					}
					return (Setting)((ConfigEntryBase)cfgSetting).DefaultValue;
				}
				set
				{
					cfgSetting.Value = value;
				}
			}
		}

		public ConfigEntry<bool> cfgModEnabled;

		public MoonConfig[] cfgMoons;

		internal bool ModEnabled
		{
			get
			{
				return cfgModEnabled.Value;
			}
			set
			{
				cfgModEnabled.Value = value;
			}
		}

		public ConfigControl(ConfigFile cfg)
		{
			InitInstance(this);
			cfgMoons = new MoonConfig[MapImprovementModBase.Instance.Moons.Count];
			cfgModEnabled = cfg.Bind<bool>("Basics", "Enable Map Improvements", true, "Turns the mod on.");
			cfg.Bind<Setting>("Basics", "Guide to Dropdown:", Setting.Enabled, "Enabled: Object can spawn.\nDiabled: Object cannot spawn.\nAlways: Object always spawns.\nNever: Object can only be spawned when Combined/Randomed from another Object.\nCombine A/B/C: Spawns Object A/B/C too.\nCombineAll: Spawns all other Objects.\nRandom A/B/C: 50% to spawn Object A/B/C too.\nRandomAny: 50% to spawn any other Object.");
			for (int i = 0; i < cfgMoons.Length; i++)
			{
				if (MapImprovementModBase.Instance.Moons[i].Adjustments == null || MapImprovementModBase.Instance.Moons[i].Adjustments.Count < 1)
				{
					continue;
				}
				string planet = MapImprovementModBase.Instance.Moons[i].Planet;
				planet = planet[0].ToString().ToUpper() + planet.Substring(1);
				cfgMoons[i].cfgEnabled = cfg.Bind<bool>(planet, "Enabled", true, "Enable improvements spawning on " + planet);
				cfgMoons[i].cfgIncludeDefault = cfg.Bind<bool>(planet, "Vanilla", true, "Adds chance for the vanilla " + planet + " to spawn.");
				cfgMoons[i].cfgObjects = new ObjectConfig[MapImprovementModBase.Instance.Moons[i].Adjustments.Count];
				for (int j = 0; j < MapImprovementModBase.Instance.Moons[i].Adjustments.Count; j++)
				{
					if (!((Object)(object)MapImprovementModBase.Instance.Moons[i].Adjustments[j].Object == (Object)null))
					{
						cfgMoons[i].cfgObjects[j].cfgSetting = cfg.Bind<Setting>(planet, ((Object)MapImprovementModBase.Instance.Moons[i].Adjustments[j].Object).name, Setting.Enabled, MapImprovementModBase.Instance.Moons[i].Adjustments[j].Description);
					}
				}
			}
			MapImprovementModBase.mls.LogInfo((object)"Generated Config file for all loaded objects.");
		}
	}
	[BepInPlugin("MapImprovements", "MapImprovements", "0.9.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class MapImprovementModBase : BaseUnityPlugin
	{
		internal struct Collection
		{
			internal List<MapData> Adjustments;

			internal string Planet;

			public Collection(List<MapData> A, string name)
			{
				Adjustments = A;
				Planet = name;
			}
		}

		internal struct MapData
		{
			internal GameObject Object;

			internal List<Edits> Edit;

			internal string Description;

			public MapData(GameObject O, string D = null)
			{
				Object = O;
				Edit = new List<Edits>();
				Description = D;
			}
		}

		internal struct Edits
		{
			internal string Name;

			internal string Tag;

			internal EditEnums Do;

			internal Vector3 Postion;

			internal Vector3 Rotation;

			internal Vector3 Scale;

			internal int FireExitIndex;

			public Edits(string N, string T, EditEnums D, Vector3 P = default(Vector3), Vector3 R = default(Vector3), Vector3 S = default(Vector3), int F = 0)
			{
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0021: Unknown result type (might be due to invalid IL or missing references)
				//IL_0027: Unknown result type (might be due to invalid IL or missing references)
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				Name = N;
				Tag = T;
				Do = D;
				Postion = P;
				Rotation = R;
				Scale = S;
				FireExitIndex = F;
			}
		}

		internal enum EditEnums
		{
			Move,
			Rotate,
			Scale,
			AllTransforms,
			Destroy,
			FireExit,
			Clone,
			Enable,
			Disable,
			Water,
			Reverb,
			StoryLog,
			Bridge,
			HasTrees
		}

		public const string modGUID = "MapImprovements";

		private const string modName = "MapImprovements";

		private const string modVersion = "0.9.1";

		private readonly Harmony harmony = new Harmony("MapImprovements");

		internal static MapImprovementModBase Instance;

		internal static ManualLogSource mls;

		internal ConfigControl Configuration;

		internal static string[] foundOutsideAssetFiles;

		internal static AssetBundle currentAsset;

		internal static GameObject[] currentAssetObjects;

		internal static TextAsset[] currentInstructions;

		internal List<Collection> Moons = new List<Collection>
		{
			new Collection(new List<MapData>(), "experimentation"),
			new Collection(new List<MapData>(), "assurance"),
			new Collection(new List<MapData>(), "vow"),
			new Collection(new List<MapData>(), "offense"),
			new Collection(new List<MapData>(), "march"),
			new Collection(new List<MapData>(), "adamance"),
			new Collection(new List<MapData>(), "rend"),
			new Collection(new List<MapData>(), "dine"),
			new Collection(new List<MapData>(), "titan"),
			new Collection(new List<MapData>(), "artifice"),
			new Collection(new List<MapData>(), "embrion"),
			new Collection(new List<MapData>(), "gordion")
		};

		private void Awake()
		{
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0611: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0652: Unknown result type (might be due to invalid IL or missing references)
			//IL_0656: Unknown result type (might be due to invalid IL or missing references)
			//IL_065c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0686: Unknown result type (might be due to invalid IL or missing references)
			//IL_068d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0693: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_071c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0730: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: 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_03f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_222c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2240: Unknown result type (might be due to invalid IL or missing references)
			//IL_2254: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e30: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e37: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e67: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e74: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e78: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e7e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ea8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1eaf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1eb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1eb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ebf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ee9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ef0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ef6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1efa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f00: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f31: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f37: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f41: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f64: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f68: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f6e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f72: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f78: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f95: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f9f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fa5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fa9: Unknown result type (might be due to invalid IL or missing references)
			//IL_1faf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fd6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fdc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fe0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fe6: Unknown result type (might be due to invalid IL or missing references)
			//IL_2003: Unknown result type (might be due to invalid IL or missing references)
			//IL_2009: Unknown result type (might be due to invalid IL or missing references)
			//IL_200d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2013: Unknown result type (might be due to invalid IL or missing references)
			//IL_2017: Unknown result type (might be due to invalid IL or missing references)
			//IL_201d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0476: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0484: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0515: Unknown result type (might be due to invalid IL or missing references)
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_051f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_0529: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0552: Unknown result type (might be due to invalid IL or missing references)
			//IL_0556: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0560: Unknown result type (might be due to invalid IL or missing references)
			//IL_0566: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Unknown result type (might be due to invalid IL or missing references)
			//IL_0589: Unknown result type (might be due to invalid IL or missing references)
			//IL_058d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0593: 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_059d: 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_05c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fc6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fca: 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_0fd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fda: Unknown result type (might be due to invalid IL or missing references)
			//IL_20cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_20db: Unknown result type (might be due to invalid IL or missing references)
			//IL_20df: Unknown result type (might be due to invalid IL or missing references)
			//IL_20e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_2102: Unknown result type (might be due to invalid IL or missing references)
			//IL_2108: Unknown result type (might be due to invalid IL or missing references)
			//IL_210c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2112: Unknown result type (might be due to invalid IL or missing references)
			//IL_2116: Unknown result type (might be due to invalid IL or missing references)
			//IL_211c: Unknown result type (might be due to invalid IL or missing references)
			//IL_2139: Unknown result type (might be due to invalid IL or missing references)
			//IL_213f: Unknown result type (might be due to invalid IL or missing references)
			//IL_2143: Unknown result type (might be due to invalid IL or missing references)
			//IL_2149: Unknown result type (might be due to invalid IL or missing references)
			//IL_214d: Unknown result type (might be due to invalid IL or missing references)
			//IL_2153: Unknown result type (might be due to invalid IL or missing references)
			//IL_2170: Unknown result type (might be due to invalid IL or missing references)
			//IL_2176: Unknown result type (might be due to invalid IL or missing references)
			//IL_217a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2180: Unknown result type (might be due to invalid IL or missing references)
			//IL_2184: Unknown result type (might be due to invalid IL or missing references)
			//IL_218a: Unknown result type (might be due to invalid IL or missing references)
			//IL_21b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_21c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_21dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_165e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1672: Unknown result type (might be due to invalid IL or missing references)
			//IL_1679: Unknown result type (might be due to invalid IL or missing references)
			//IL_167f: Unknown result type (might be due to invalid IL or missing references)
			//IL_169c: Unknown result type (might be due to invalid IL or missing references)
			//IL_16a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_16a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_16b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_16d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_16d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_16dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_16e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_16e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_16ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_170a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1710: Unknown result type (might be due to invalid IL or missing references)
			//IL_1714: Unknown result type (might be due to invalid IL or missing references)
			//IL_171a: Unknown result type (might be due to invalid IL or missing references)
			//IL_171e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1724: Unknown result type (might be due to invalid IL or missing references)
			//IL_1741: Unknown result type (might be due to invalid IL or missing references)
			//IL_1747: Unknown result type (might be due to invalid IL or missing references)
			//IL_174b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1751: Unknown result type (might be due to invalid IL or missing references)
			//IL_1755: Unknown result type (might be due to invalid IL or missing references)
			//IL_175b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1778: Unknown result type (might be due to invalid IL or missing references)
			//IL_177e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1782: Unknown result type (might be due to invalid IL or missing references)
			//IL_1788: Unknown result type (might be due to invalid IL or missing references)
			//IL_178c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1792: Unknown result type (might be due to invalid IL or missing references)
			//IL_17af: Unknown result type (might be due to invalid IL or missing references)
			//IL_17b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_17b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_17bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_17c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_17c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_17e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_17ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_17f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_17f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_17fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1800: Unknown result type (might be due to invalid IL or missing references)
			//IL_181d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1823: Unknown result type (might be due to invalid IL or missing references)
			//IL_1827: Unknown result type (might be due to invalid IL or missing references)
			//IL_182d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1831: Unknown result type (might be due to invalid IL or missing references)
			//IL_1837: Unknown result type (might be due to invalid IL or missing references)
			//IL_1854: Unknown result type (might be due to invalid IL or missing references)
			//IL_185a: Unknown result type (might be due to invalid IL or missing references)
			//IL_185e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1864: Unknown result type (might be due to invalid IL or missing references)
			//IL_1868: Unknown result type (might be due to invalid IL or missing references)
			//IL_186e: Unknown result type (might be due to invalid IL or missing references)
			//IL_188b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1891: Unknown result type (might be due to invalid IL or missing references)
			//IL_1895: Unknown result type (might be due to invalid IL or missing references)
			//IL_189b: Unknown result type (might be due to invalid IL or missing references)
			//IL_189f: Unknown result type (might be due to invalid IL or missing references)
			//IL_18a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_18c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_18c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_18cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_18d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_18d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_18dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_18f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_18ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1903: Unknown result type (might be due to invalid IL or missing references)
			//IL_1909: Unknown result type (might be due to invalid IL or missing references)
			//IL_190d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1913: Unknown result type (might be due to invalid IL or missing references)
			//IL_193d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1951: Unknown result type (might be due to invalid IL or missing references)
			//IL_1965: Unknown result type (might be due to invalid IL or missing references)
			//IL_1992: Unknown result type (might be due to invalid IL or missing references)
			//IL_1999: Unknown result type (might be due to invalid IL or missing references)
			//IL_199f: Unknown result type (might be due to invalid IL or missing references)
			//IL_19a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_19a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_19d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_19e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_19ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_19f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a25: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a2f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a35: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a5f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a66: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a70: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a76: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a94: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1a9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1aa4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1aae: Unknown result type (might be due to invalid IL or missing references)
			//IL_11bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_11c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_11ce: 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_1205: Unknown result type (might be due to invalid IL or missing references)
			//IL_120b: Unknown result type (might be due to invalid IL or missing references)
			//IL_120f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1215: Unknown result type (might be due to invalid IL or missing references)
			//IL_123f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1246: Unknown result type (might be due to invalid IL or missing references)
			//IL_124c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1250: Unknown result type (might be due to invalid IL or missing references)
			//IL_1256: Unknown result type (might be due to invalid IL or missing references)
			//IL_1280: Unknown result type (might be due to invalid IL or missing references)
			//IL_1287: Unknown result type (might be due to invalid IL or missing references)
			//IL_128d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1291: Unknown result type (might be due to invalid IL or missing references)
			//IL_1297: Unknown result type (might be due to invalid IL or missing references)
			//IL_12c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_12c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_12d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_12d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_12f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_12fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_1305: Unknown result type (might be due to invalid IL or missing references)
			//IL_1309: Unknown result type (might be due to invalid IL or missing references)
			//IL_130f: Unknown result type (might be due to invalid IL or missing references)
			//IL_132c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1332: Unknown result type (might be due to invalid IL or missing references)
			//IL_1336: Unknown result type (might be due to invalid IL or missing references)
			//IL_133c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1340: Unknown result type (might be due to invalid IL or missing references)
			//IL_1346: Unknown result type (might be due to invalid IL or missing references)
			//IL_1363: Unknown result type (might be due to invalid IL or missing references)
			//IL_1369: Unknown result type (might be due to invalid IL or missing references)
			//IL_136d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1373: Unknown result type (might be due to invalid IL or missing references)
			//IL_1377: Unknown result type (might be due to invalid IL or missing references)
			//IL_137d: Unknown result type (might be due to invalid IL or missing references)
			//IL_139a: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_13a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_13aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_13ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_13b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_13d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_13d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_13db: Unknown result type (might be due to invalid IL or missing references)
			//IL_13e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_13e5: 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_1408: Unknown result type (might be due to invalid IL or missing references)
			//IL_140e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1412: Unknown result type (might be due to invalid IL or missing references)
			//IL_1418: Unknown result type (might be due to invalid IL or missing references)
			//IL_141c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1422: Unknown result type (might be due to invalid IL or missing references)
			//IL_143f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1445: Unknown result type (might be due to invalid IL or missing references)
			//IL_1449: Unknown result type (might be due to invalid IL or missing references)
			//IL_144f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1453: Unknown result type (might be due to invalid IL or missing references)
			//IL_1459: Unknown result type (might be due to invalid IL or missing references)
			//IL_1476: Unknown result type (might be due to invalid IL or missing references)
			//IL_147c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1480: Unknown result type (might be due to invalid IL or missing references)
			//IL_1486: Unknown result type (might be due to invalid IL or missing references)
			//IL_148a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1490: Unknown result type (might be due to invalid IL or missing references)
			//IL_14ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_14b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_14b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_14bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_14e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_14ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_14ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_14fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_151b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1521: Unknown result type (might be due to invalid IL or missing references)
			//IL_1525: Unknown result type (might be due to invalid IL or missing references)
			//IL_152b: 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_1535: Unknown result type (might be due to invalid IL or missing references)
			//IL_1552: Unknown result type (might be due to invalid IL or missing references)
			//IL_1558: Unknown result type (might be due to invalid IL or missing references)
			//IL_155c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1562: Unknown result type (might be due to invalid IL or missing references)
			//IL_1566: Unknown result type (might be due to invalid IL or missing references)
			//IL_156c: Unknown result type (might be due to invalid IL or missing references)
			//IL_158a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1590: Unknown result type (might be due to invalid IL or missing references)
			//IL_1594: Unknown result type (might be due to invalid IL or missing references)
			//IL_159a: Unknown result type (might be due to invalid IL or missing references)
			//IL_159e: Unknown result type (might be due to invalid IL or missing references)
			//IL_15a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_2402: Unknown result type (might be due to invalid IL or missing references)
			//IL_240a: Unknown result type (might be due to invalid IL or missing references)
			//IL_2412: Unknown result type (might be due to invalid IL or missing references)
			//IL_1af4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b08: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b15: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b32: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b38: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b42: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b46: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b69: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b73: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b79: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1b83: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bad: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bba: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bbe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bee: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c02: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c16: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c43: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c50: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c54: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c78: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c7e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c82: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c88: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c92: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cb6: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cba: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cc0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cca: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ce8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cee: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cf2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d02: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d20: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d26: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d2a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d30: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d34: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d58: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d62: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d68: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d72: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d90: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d96: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1da0: Unknown result type (might be due to invalid IL or missing references)
			//IL_1da4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1daa: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dc8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dce: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dd2: Unknown result type (might be due to invalid IL or missing references)
			//IL_1dd8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ddc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1de2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e97: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ea5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ee9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_07de: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0804: Unknown result type (might be due to invalid IL or missing references)
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_080e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0812: Unknown result type (might be due to invalid IL or missing references)
			//IL_0818: Unknown result type (might be due to invalid IL or missing references)
			//IL_0835: Unknown result type (might be due to invalid IL or missing references)
			//IL_083b: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0845: Unknown result type (might be due to invalid IL or missing references)
			//IL_0849: Unknown result type (might be due to invalid IL or missing references)
			//IL_084f: Unknown result type (might be due to invalid IL or missing references)
			//IL_086c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_08da: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0911: Unknown result type (might be due to invalid IL or missing references)
			//IL_0917: Unknown result type (might be due to invalid IL or missing references)
			//IL_091b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0921: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_092b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0948: Unknown result type (might be due to invalid IL or missing references)
			//IL_094e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0952: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_095c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0962: Unknown result type (might be due to invalid IL or missing references)
			//IL_097f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_0989: Unknown result type (might be due to invalid IL or missing references)
			//IL_098f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0993: Unknown result type (might be due to invalid IL or missing references)
			//IL_0999: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a31: 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_0a3d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a43: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1086: Unknown result type (might be due to invalid IL or missing references)
			//IL_108c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1090: Unknown result type (might be due to invalid IL or missing references)
			//IL_1096: Unknown result type (might be due to invalid IL or missing references)
			//IL_109a: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c3: 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_10cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1101: Unknown result type (might be due to invalid IL or missing references)
			//IL_1115: Unknown result type (might be due to invalid IL or missing references)
			//IL_111c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f30: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f44: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f74: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f88: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f95: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b05: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b19: 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_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b40: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0baa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb8: 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_0bdb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be1: 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_0beb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c12: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c53: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c86: 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_0c90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c94: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ccb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf5: 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_0cff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d09: Unknown result type (might be due to invalid IL or missing references)
			//IL_1162: Unknown result type (might be due to invalid IL or missing references)
			//IL_1176: Unknown result type (might be due to invalid IL or missing references)
			//IL_117d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1183: Unknown result type (might be due to invalid IL or missing references)
			//IL_2452: Unknown result type (might be due to invalid IL or missing references)
			//IL_2454: Unknown result type (might be due to invalid IL or missing references)
			//IL_2456: Unknown result type (might be due to invalid IL or missing references)
			//IL_247b: Unknown result type (might be due to invalid IL or missing references)
			//IL_2483: Unknown result type (might be due to invalid IL or missing references)
			//IL_248b: Unknown result type (might be due to invalid IL or missing references)
			//IL_28e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_28ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_28fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_2901: Unknown result type (might be due to invalid IL or missing references)
			//IL_290f: Unknown result type (might be due to invalid IL or missing references)
			//IL_2914: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			mls = Logger.CreateLogSource("MapImprovements");
			foundOutsideAssetFiles = Directory.GetFiles(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "*improvements.bundle");
			if (foundOutsideAssetFiles != null && foundOutsideAssetFiles.Length != 0)
			{
				for (int i = 0; i < foundOutsideAssetFiles.Length; i++)
				{
					mls.LogInfo((object)("Found " + foundOutsideAssetFiles[i]));
					currentAsset = AssetBundle.LoadFromFile(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), foundOutsideAssetFiles[i]));
					if ((Object)(object)currentAsset != (Object)null)
					{
						currentAssetObjects = currentAsset.LoadAllAssets<GameObject>();
						currentInstructions = currentAsset.LoadAllAssets<TextAsset>();
						string[] array = foundOutsideAssetFiles[i].ToLower().Split(new string[1] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
						if (currentAssetObjects != null && currentAssetObjects.Length != 0)
						{
							for (int j = 0; j < currentAssetObjects.Length; j++)
							{
								string[] array2 = ((Object)currentAssetObjects[j]).name.ToLower().Split(new string[1] { "_" }, StringSplitOptions.RemoveEmptyEntries);
								MapData item = default(MapData);
								List<Edits> list = new List<Edits>();
								string description = "";
								int num;
								switch (array2[0])
								{
								case "experimentation":
								{
									num = 0;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result7))
									{
										switch (result7)
										{
										}
									}
									break;
								}
								case "assurance":
									num = 1;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result2))
										{
											switch (result2)
											{
											case 1:
												list.Add(new Edits("OutsideNode (22)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(-0.85f, 9.147f, 76.25f), default(Vector3), default(Vector3), 2));
												description = "Adds in a new Fire Exit and more environmental detailing.";
												break;
											case 2:
												list.Add(new Edits("rock.012 (1)", "Rock", EditEnums.Destroy));
												list.Add(new Edits("rock.007", "Rock", EditEnums.Destroy));
												list.Add(new Edits("RockSingle4", "Rock", EditEnums.Destroy));
												list.Add(new Edits("rock.001 (1)", "Rock", EditEnums.Destroy));
												list.Add(new Edits("OutsideAINode (29)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("RockObstacles/NavObs (4)", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("RockObstacles/NavObs (6)", "Untagged", EditEnums.Destroy));
												description = "Removes rocks to create a path for the Cruiser to get to the Main Entrance.";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("Cube", "Concrete", EditEnums.Destroy));
										list.Add(new Edits("ReverbTriggers (1)/Cube", "Untagged", EditEnums.Move, new Vector3(-274.25f, 7.5f, -76f)));
										list.Add(new Edits("ReverbTriggers (1)/Cube (16)", "Untagged", EditEnums.AllTransforms, new Vector3(-265f, 16f, -83f), default(Vector3), new Vector3(0.5f, 36f, 50f)));
										list.Add(new Edits("ReverbTriggers (1)/Cube (1)", "Untagged", EditEnums.AllTransforms, new Vector3(-268.5f, 10f, -80f), default(Vector3), new Vector3(0.5f, 16f, 40f)));
										list.Add(new Edits("Ladder1.5x", "Untagged", EditEnums.Clone, new Vector3(142.6f, -0.9f, 75.85f), new Vector3(0f, 108f, 0f), new Vector3(0.6f, 1.2f, 0.6f)));
										description = "Modifies the Main Entrance buidling, allowing access to the pipe to the Fire Exit through a bit of parkour.";
									}
									break;
								case "vow":
									num = 2;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result11))
										{
											switch (result11)
											{
											case 1:
												list.Add(new Edits("DangerousBridge", "Untagged", EditEnums.Clone, new Vector3(-68.25f, -9.7f, 104.25f), new Vector3(1.75f, 159.25f, 1.1f), new Vector3(0.81f, 0.81f, 0.82f)));
												list.Add(new Edits("WaterDam", "Concrete", EditEnums.Destroy));
												list.Add(new Edits("WaterBig", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("WaterTriggers", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("BoundsWalls/Cube (4)", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("BoundsWalls/Cube (5)", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("FireExitDoorContainer", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("StoryLogCollectable (3)", "InteractTrigger", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (97)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (98)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (99)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.AllTransforms, new Vector3(93.2f, -7f, 162.15f), Vector3.zero));
												list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
												description = "The river has dried up, leaving behind a valley with trees and rocks. The dam has been replaced with another breakable bridge, and the Fire Exit has been moved to the right end of the Facility.";
												break;
											case 2:
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(119.9f, -29.5f, 37.65f), new Vector3(0f, 180f, 0f), default(Vector3), 2));
												list.Add(new Edits("OutsideNode (55)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (54)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (44)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (32)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (31)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (26)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("tree.002_LOD0 (30)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("tree.003_LOD0 (26)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("tree.003_LOD0 (25)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
												description = "Adds in a new facility building right behind the ship, with a Fire Exit that has been flooded.";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("ChainlinkFence (4)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(12.75f, 8f, 211.25f), new Vector3(0f, 180f, 0f), default(Vector3), 2));
										description = "Expands the Facility building, adding in a new area with Fire Exit through the alleyway.";
									}
									break;
								case "offense":
								{
									num = 3;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result12))
									{
										switch (result12)
										{
										}
									}
									break;
								}
								case "march":
								{
									num = 4;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result4))
									{
										switch (result4)
										{
										}
									}
									break;
								}
								case "adamance":
									num = 5;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result9))
										{
											switch (result9)
											{
											case 1:
												list.Add(new Edits("Cube.002", "Concrete", EditEnums.Destroy));
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.AllTransforms, new Vector3(-75.9f, -2.4f, -112.35f), new Vector3(0f, 223f, 0f)));
												description = "Adds in easier pathing to and from the Fire Exit while also adjusting it slightly.";
												break;
											case 2:
												list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(56.8f, 13.1f, -92.3f), new Vector3(0f, -220f, 0f), default(Vector3), 2));
												description = "Adds in a new Fire Exit and environmental detailing on the left side of the ship landing area.";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
										description = "Adds in unique mineshaft environmental details to differentiate it from other forest moons. Makes certain hills easier to climb.";
									}
									break;
								case "rend":
								{
									num = 6;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result3))
									{
										switch (result3)
										{
										}
									}
									break;
								}
								case "dine":
									num = 7;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result8))
										{
											switch (result8)
											{
											case 1:
												list.Add(new Edits("treeLeafless.003_LOD0 (39)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("treeLeafless.003_LOD0 (41)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(195f, -0.4f, 11.5f), new Vector3(0f, 84f, 0f), default(Vector3), 2));
												description = "Expands on the facility building, adding a new fire exit on top, with additional fences and pipes.";
												break;
											case 2:
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(-64.4f, -1.6f, 15.3f), new Vector3(0f, -85.546f, 0f), default(Vector3), 2));
												description = "Adds in a new Fire Exit only accessible via jumping off the ship early, similar to Offense.";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("EntranceTeleportA", "InteractTrigger", EditEnums.Move, new Vector3(144.4f, -21.25f, 2.5f)));
										list.Add(new Edits("DoorFrame (1)", "Untagged", EditEnums.Move, new Vector3(144.33f, -23.91f, 2.34f)));
										list.Add(new Edits("SteelDoorFake", "Untagged", EditEnums.Move, new Vector3(145.85f, -20.41f, 2.37f)));
										list.Add(new Edits("SteelDoorFake (1)", "Untagged", EditEnums.Move, new Vector3(142.94f, -20.41f, 2.4f)));
										list.Add(new Edits("Environment/Plane", "Untagged", EditEnums.Move, new Vector3(144.33f, -20.51f, 2.38f)));
										list.Add(new Edits("NeonLightsSingle", "PoweredLight", EditEnums.Destroy));
										list.Add(new Edits("Cube.002", "Concrete", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFence", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFence (1)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFence (2)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFence (3)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFenceHoleModifier", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("ChainlinkFenceBend", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("Environment/Map/Collider", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("Environment/Map/Collider (1)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("CliffJump (2)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("CliffJump (3)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
										description = "Adds in fences around the edges, with holes to allow for escaping Giants. Adjusts the main entrance area to prevent Giants loitering.";
									}
									break;
								case "titan":
								{
									num = 8;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result5))
									{
										switch (result5)
										{
										}
									}
									break;
								}
								case "artifice":
									num = 9;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result13))
										{
											switch (result13)
											{
											case 1:
												list.Add(new Edits("ItemShipAnimContainer", "Untagged", EditEnums.AllTransforms, new Vector3(72f, 2.75f, -62.5f), new Vector3(-90f, 45f, -50f)));
												list.Add(new Edits("treeLeafless", "Wood", EditEnums.Destroy));
												list.Add(new Edits("treeLeafless (4)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (97)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (95)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (94)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (93)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (92)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (90)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (8)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (7)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("OutsideNode (6)", "OutsideAINode", EditEnums.Destroy));
												list.Add(new Edits("treeLeafless.002_LOD0 (3)", "Wood", EditEnums.Destroy));
												list.Add(new Edits("SteelDoorMapModel (4)", "Untagged", EditEnums.Clone, new Vector3(12.25f, 4.5f, -11.21f), new Vector3(180f, -92f, -180f), new Vector3(1f, 1.05f, 1f)));
												list.Add(new Edits("FogExclusionZone (2)", "Untagged", EditEnums.Clone, new Vector3(30.5f, 14f, -0.75f)));
												list.Add(new Edits("BuildingAmbience", "Untagged", EditEnums.Clone, new Vector3(46.25f, 7f, -73f), new Vector3(180f, 0f, 180f)));
												list.Add(new Edits("BuildingAmbience (7)", "Untagged", EditEnums.Clone, new Vector3(10.75f, 3f, -84f)));
												list.Add(new Edits("InsideAmbience (1)", "Untagged", EditEnums.Clone, new Vector3(47.5f, 7f, -73f)));
												list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
												description = "Adds in a warehouse and platform for the ship to land in.";
												break;
											case 2:
												list.Add(new Edits("EntranceTeleportB", "InteractTrigger", EditEnums.FireExit, new Vector3(14f, 157.4f, -274.9f), new Vector3(180f, 26f, 180f), default(Vector3), 2));
												list.Add(new Edits("OuterFence/ChainlinkFence (57)", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("Colliders/ChainlinkFence (45)", "Untagged", EditEnums.Destroy));
												list.Add(new Edits("Colliders/Cube", "Untagged", EditEnums.Move, new Vector3(126f, 1.4f, -69.5f)));
												list.Add(new Edits("BuildingAmbience (3)", "Untagged", EditEnums.Clone, new Vector3(140f, 7f, -79f), new Vector3(180f, 0f, 180f), new Vector3(0.5f, 10f, 20f)));
												list.Add(new Edits("OutsideAmbience (1)", "Untagged", EditEnums.Clone, new Vector3(138f, 7f, -79f)));
												list.Add(new Edits("Ocean", "Puddle", EditEnums.Water));
												list.Add(new Edits("Ocean (1)", "Puddle", EditEnums.Water));
												list.Add(new Edits("Ocean (2)", "Puddle", EditEnums.Water));
												list.Add(new Edits("Ocean (3)", "Puddle", EditEnums.Water));
												list.Add(new Edits("Ocean (4)", "Puddle", EditEnums.Water));
												list.Add(new Edits("WaterTrigger", "Untagged", EditEnums.Water));
												list.Add(new Edits("_", "Wood", EditEnums.HasTrees));
												description = "Adds in large bodies of water and dams.";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("ItemShipAnimContainer", "Untagged", EditEnums.AllTransforms, new Vector3(82f, -4.66f, -98.5f), new Vector3(-86f, 28f, -43f)));
										list.Add(new Edits("OutsideAmbience (3)", "Untagged", EditEnums.Clone, new Vector3(55f, 2f, -187f)));
										list.Add(new Edits("OutsideAmbience (4)", "Untagged", EditEnums.Clone, new Vector3(14f, -1f, -198f)));
										list.Add(new Edits("BuildingAmbience (7)", "Untagged", EditEnums.Clone, new Vector3(15.25f, -1f, -198f)));
										list.Add(new Edits("BuildingAmbience (6)", "Untagged", EditEnums.Clone, new Vector3(53.5f, 3f, -188f)));
										list.Add(new Edits("GarageDoorContainer (2)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("GreyRockGrouping2 (6)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("Colliders/Cube (4)", "Untagged", EditEnums.Destroy));
										list.Add(new Edits("OuterFence/ChainlinkFence (65)", "Untagged", EditEnums.Destroy));
										description = "Allows access to the 4th warehouse. Adjusts the dropship position. Adds in more nodes for AI pathfinding.";
									}
									break;
								case "embrion":
								{
									num = 10;
									if (array2.Length > 1 && int.TryParse(array2[1], out var result10))
									{
										switch (result10)
										{
										}
									}
									break;
								}
								case "companybuilding":
									num = 11;
									if (array2.Length > 1)
									{
										if (int.TryParse(array2[1], out var result6))
										{
											switch (result6)
											{
											case 1:
												list.Add(new Edits("ShippingContainer", "Aluminum", EditEnums.Destroy));
												list.Add(new Edits("ShippingContainer (3)", "Aluminum", EditEnums.Destroy));
												list.Add(new Edits("ShippingContainer (5)", "Aluminum", EditEnums.Destroy));
												list.Add(new Edits("ShippingContainer (6)", "Aluminum", EditEnums.Destroy));
												list.Add(new Edits("Puddle2", "Untagged", EditEnums.Clone, new Vector3(-11f, 3.853f, 55.5f), new Vector3(0f, 55f, 0f), new Vector3(3f, 2.25f, 2.5f)));
												description = "Removes some shipping containers for easy driving of the Company Cruiser.";
												break;
											case 2:
												description = "Secret drill :)";
												break;
											}
										}
									}
									else
									{
										list.Add(new Edits("Puddle", "Untagged", EditEnums.Clone, new Vector3(-9f, 3.85f, -74.5f), new Vector3(-180f, -41f, 180f), new Vector3(-1.5f, 1.5f, 1.5f)));
										description = "Recieves more shipments, with some of them being open. Great for playing hide and seek with friends, while also limiting the area with walls.";
									}
									break;
								default:
								{
									string[] map = foundOutsideAssetFiles[i].ToLower().Split(new string[1] { "\\" }, StringSplitOptions.RemoveEmptyEntries);
									map[0] = map[map.Length - 1].ToLower().Split(new string[1] { "improvements.bundle" }, StringSplitOptions.RemoveEmptyEntries)[0];
									if (!map[0].Equals(array2[0]))
									{
										continue;
									}
									num = Moons.FindIndex((Collection x) => x.Planet.Equals(map[0]));
									if (num < 0)
									{
										Moons.Add(new Collection(new List<MapData>(), map[0]));
										num = Moons.FindIndex((Collection x) => x.Planet.Equals(map[0]));
										mls.LogInfo((object)("Created new collection for " + map[0] + "."));
									}
									for (int k = 0; k < currentInstructions.Length; k++)
									{
										if (!((Object)currentAssetObjects[j]).name.ToLower().Equals(((Object)currentInstructions[k]).name.ToLower()))
										{
											continue;
										}
										mls.LogWarning((object)("Found instructions for " + array2[0]));
										map = currentInstructions[k].text.Split(new string[1] { "\n" }, StringSplitOptions.None);
										int num2 = 0;
										string n = "";
										string t = "";
										EditEnums d = EditEnums.Disable;
										Vector3 p = default(Vector3);
										Vector3 r = default(Vector3);
										Vector3 s = default(Vector3);
										int f = 0;
										description = "Improvements for the modded moon " + array2[0];
										for (int l = 0; l < map.Length; l++)
										{
											if (Utility.IsNullOrWhiteSpace(map[l]))
											{
												list.Add(new Edits(n, t, d, p, r, s, f));
												num2 = 0;
												n = "";
												t = "";
												d = EditEnums.Disable;
												p = default(Vector3);
												r = default(Vector3);
												s = default(Vector3);
												f = 0;
												continue;
											}
											if (map[l][0].Equals('#'))
											{
												description = map[l].Substring(1);
												mls.LogInfo((object)"Found config description, ending parsing.");
												break;
											}
											map[l] = map[l].Trim();
											switch (num2)
											{
											case 0:
												n = map[l];
												break;
											case 1:
												t = map[l];
												break;
											case 2:
												switch (map[l].ToLower())
												{
												case "move":
													d = EditEnums.Move;
													break;
												case "rotate":
													d = EditEnums.Rotate;
													break;
												case "scale":
													d = EditEnums.Scale;
													break;
												case "transform":
												case "transforms":
												case "alltransforms":
													d = EditEnums.AllTransforms;
													break;
												case "destroy":
													d = EditEnums.Destroy;
													break;
												case "fire":
												case "fireexit":
													d = EditEnums.FireExit;
													break;
												case "clone":
													d = EditEnums.Clone;
													break;
												case "enable":
													d = EditEnums.Enable;
													break;
												case "disable":
													d = EditEnums.Disable;
													break;
												case "water":
													d = EditEnums.Water;
													break;
												case "reverb":
												case "reverbtrigger":
													d = EditEnums.Reverb;
													break;
												case "log":
												case "storylog":
													d = EditEnums.StoryLog;
													break;
												case "bridge":
													d = EditEnums.Bridge;
													break;
												case "trees":
												case "hastrees":
													d = EditEnums.HasTrees;
													break;
												default:
													mls.LogError((object)"Unable to parse Edit Enum. Please make sure things are formatted properly.");
													d = EditEnums.Disable;
													break;
												}
												break;
											case 3:
												p = StringToVector3(map[l]);
												break;
											case 4:
												r = StringToVector3(map[l]);
												break;
											case 5:
												s = StringToVector3(map[l]);
												break;
											case 6:
											{
												if (int.TryParse(map[l], out var result))
												{
													f = result;
												}
												break;
											}
											default:
												mls.LogError((object)"Error parsing instructions. Please make sure things are formatted properly.");
												num2 = 0;
												break;
											}
											num2++;
										}
									}
									break;
								}
								}
								mls.LogInfo((object)(array2[0] + " improvements found!"));
								item.Object = currentAssetObjects[j];
								item.Description = description;
								item.Edit = list;
								Moons[num].Adjustments.Add(item);
							}
						}
						else
						{
							mls.LogError((object)("No Objects found in " + foundOutsideAssetFiles[i] + "."));
						}
					}
					else
					{
						mls.LogError((object)("Failed to load " + foundOutsideAssetFiles[i] + "."));
					}
				}
				harmony.PatchAll(typeof(MapImprovementModBase));
				harmony.PatchAll(typeof(RoundManagerPatch));
				Configuration = new ConfigControl(((BaseUnityPlugin)this).Config);
				mls.LogInfo((object)"Maps Improved.");
			}
			else
			{
				mls.LogWarning((object)"No Map Improvements were found.");
			}
		}

		internal static Vector3 StringToVector3(string parse)
		{
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			string[] array = parse.Split(new char[1] { ',' });
			float[] array2 = new float[3];
			for (int i = 0; i < array.Length && i <= 2; i++)
			{
				array[i].Trim();
				if (float.TryParse(array[i], out var result))
				{
					array2[i] = result;
				}
			}
			return new Vector3(array2[0], array2[1], array2[2]);
		}
	}
	[Serializable]
	public class SyncedInstance<T>
	{
		[NonSerialized]
		protected static int IntSize = 4;

		internal static CustomMessagingManager MessageManager => NetworkManager.Singleton.CustomMessagingManager;

		internal static bool IsClient => NetworkManager.Singleton.IsClient;

		internal static bool IsHost => NetworkManager.Singleton.IsHost;

		public static T Default { get; private set; }

		public static T Instance { get; private set; }

		public static bool Synced { get; internal set; }

		protected void InitInstance(T instance)
		{
			Default = instance;
			Instance = instance;
			IntSize = 4;
		}

		internal static void SyncInstance(byte[] data)
		{
			Instance = DeserializeFromBytes(data);
			Synced = true;
		}

		internal static void RevertSync()
		{
			Instance = Default;
			Synced = false;
		}

		public static byte[] SerializeToBytes(T val)
		{
			BinaryFormatter binaryFormatter = new BinaryFormatter();
			MemoryStream memoryStream = new MemoryStream();
			try
			{
				binaryFormatter.Serialize(memoryStream, val);
				return memoryStream.ToArray();
			}
			catch (Exception arg)
			{
				MapImprovementModBase.mls.LogError((object)$"Error serializing instance: {arg}");
				return null;
			}
		}

		public static T DeserializeFromBytes(byte[] data)
		{
			BinaryFormatter binaryFormatter = new BinaryFormatter();
			MemoryStream serializationStream = new MemoryStream(data);
			try
			{
				return (T)binaryFormatter.Deserialize(serializationStream);
			}
			catch (Exception arg)
			{
				MapImprovementModBase.mls.LogError((object)$"Error deserializing instance: {arg}");
				return default(T);
			}
		}

		public static void RequestSync()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			if (IsClient)
			{
				FastBufferWriter val = default(FastBufferWriter);
				((FastBufferWriter)(ref val))..ctor(IntSize, (Allocator)2, -1);
				MessageManager.SendNamedMessage("MapImprovements_OnRequestConfigSync", 0uL, val, (NetworkDelivery)3);
			}
		}

		public static void OnRequestSync(ulong clientId, FastBufferReader _)
		{
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			if (!IsHost)
			{
				return;
			}
			MapImprovementModBase.mls.LogInfo((object)$"Config sync request received from client: {clientId}");
			byte[] array = SerializeToBytes(Instance);
			int num = array.Length;
			FastBufferWriter val = default(FastBufferWriter);
			((FastBufferWriter)(ref val))..ctor(num + IntSize, (Allocator)2, -1);
			try
			{
				((FastBufferWriter)(ref val)).WriteValueSafe<int>(ref num, default(ForPrimitives));
				((FastBufferWriter)(ref val)).WriteBytesSafe(array, -1, 0);
				MessageManager.SendNamedMessage("MapImprovements_OnReceiveConfigSync", clientId, val, (NetworkDelivery)3);
			}
			catch (Exception arg)
			{
				MapImprovementModBase.mls.LogInfo((object)$"Error occurred syncing config with client: {clientId}\n{arg}");
			}
		}

		public static void OnReceiveSync(ulong _, FastBufferReader reader)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (!((FastBufferReader)(ref reader)).TryBeginRead(IntSize))
			{
				MapImprovementModBase.mls.LogError((object)"Config sync error: Could not begin reading buffer.");
				return;
			}
			int num = default(int);
			((FastBufferReader)(ref reader)).ReadValueSafe<int>(ref num, default(ForPrimitives));
			if (!((FastBufferReader)(ref reader)).TryBeginRead(num))
			{
				MapImprovementModBase.mls.LogError((object)"Config sync error: Host could not sync.");
				return;
			}
			byte[] data = new byte[num];
			((FastBufferReader)(ref reader)).ReadBytesSafe(ref data, num, 0);
			SyncInstance(data);
			MapImprovementModBase.mls.LogInfo((object)"Successfully synced config with host.");
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "SteamMatchmaking_OnLobbyMemberJoined")]
		public static void InitializeLocalPlayer()
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Expected O, but got Unknown
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Expected O, but got Unknown
			if (IsHost)
			{
				MessageManager.RegisterNamedMessageHandler("MapImprovements_OnRequestConfigSync", new HandleNamedMessageDelegate(OnRequestSync));
				Synced = true;
			}
			else
			{
				Synced = false;
				MessageManager.RegisterNamedMessageHandler("MapImprovements_OnReceiveConfigSync", new HandleNamedMessageDelegate(OnReceiveSync));
				RequestSync();
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(GameNetworkManager), "StartDisconnect")]
		public static void PlayerLeave()
		{
			SyncedInstance<ConfigControl>.RevertSync();
		}
	}
}
namespace MapImprovements.Patches
{
	[HarmonyPatch(typeof(RoundManager))]
	internal class RoundManagerPatch
	{
		private static Material WaterMat;

		[HarmonyPatch("Start")]
		[HarmonyPostfix]
		private static void GetWaterMat()
		{
			WaterMat = ((Renderer)((Component)GameObject.Find("TimeAndWeather").transform.GetChild(4).GetChild(1)).GetComponent<MeshRenderer>()).material;
		}

		[HarmonyPatch("SetChallengeFileRandomModifiers")]
		[HarmonyPrefix]
		private static void AddImprovements(RoundManager __instance)
		{
			if (!MapImprovementModBase.Instance.Configuration.ModEnabled)
			{
				return;
			}
			string text = ((Object)__instance.currentLevel).name.ToLower().Trim();
			string[] level = text.Split(new string[1] { "level" }, StringSplitOptions.RemoveEmptyEntries);
			GameObject val = GameObject.FindGameObjectWithTag("MapPropsContainer");
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			int num;
			switch (level[0])
			{
			case "experimentation":
				num = 0;
				break;
			case "assurance":
				num = 1;
				break;
			case "vow":
				num = 2;
				break;
			case "offense":
				num = 3;
				break;
			case "march":
				num = 4;
				break;
			case "adamance":
				num = 5;
				break;
			case "rend":
				num = 6;
				break;
			case "dine":
				num = 7;
				break;
			case "titan":
				num = 8;
				break;
			case "artifice":
				num = 9;
				break;
			case "embrion":
				num = 10;
				break;
			case "companybuilding":
				num = 11;
				break;
			default:
				num = MapImprovementModBase.Instance.Moons.FindIndex((MapImprovementModBase.Collection x) => x.Planet.ToLower().Equals(level[0]));
				if (num < 0)
				{
					return;
				}
				break;
			}
			if (MapImprovementModBase.Instance.Moons[num].Adjustments == null || MapImprovementModBase.Instance.Moons[num].Adjustments.Count < 1 || !MapImprovementModBase.Instance.Configuration.cfgMoons[num].Enabled)
			{
				return;
			}
			Mod(num, __instance.playersManager.randomMapSeed, val);
			if (num > 11)
			{
				GameObject val2 = GameObject.FindGameObjectWithTag("OutsideLevelNavMesh");
				NavMeshSurface val3 = default(NavMeshSurface);
				if ((Object)(object)val2 != (Object)null && val2.TryGetComponent<NavMeshSurface>(ref val3))
				{
					val3.BuildNavMesh();
				}
			}
		}

		private static void Mod(int moon, int randomSeed, GameObject container)
		{
			bool vanilla = MapImprovementModBase.Instance.Configuration.cfgMoons[moon].Vanilla;
			int num = 0;
			for (int i = 0; i < MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects.Length; i++)
			{
				if (MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[i].Settings.Equals(ConfigControl.Setting.Always))
				{
					num += ApplyObject(moon, i, container.transform);
				}
			}
			int num2 = RandomIndex(moon, randomSeed, vanilla);
			if (num2 < 0 || num2 >= MapImprovementModBase.Instance.Moons[moon].Adjustments.Count || MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[num2].Settings.Equals(ConfigControl.Setting.Disabled) || MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[num2].Settings.Equals(ConfigControl.Setting.Never))
			{
				return;
			}
			num += ApplyObject(moon, num2, container.transform);
			switch (MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[num2].Settings)
			{
			case ConfigControl.Setting.CombineA:
				if (num2 != 0)
				{
					ApplyObject(moon, 0, container.transform, num);
				}
				break;
			case ConfigControl.Setting.CombineB:
				if (num2 != 1)
				{
					ApplyObject(moon, 1, container.transform, num);
				}
				break;
			case ConfigControl.Setting.CombineC:
				if (num2 != 2)
				{
					ApplyObject(moon, 2, container.transform, num);
				}
				break;
			case ConfigControl.Setting.CombineAll:
			{
				for (int j = 0; j < MapImprovementModBase.Instance.Moons[moon].Adjustments.Count; j++)
				{
					if (num2 != j)
					{
						num += ApplyObject(moon, j, container.transform, num);
					}
				}
				break;
			}
			case ConfigControl.Setting.RandomA:
				if (num2 != 0 && Fifty_Fifty(moon, (int)((float)(randomSeed * 5) / 3f), 0))
				{
					ApplyObject(moon, 0, container.transform, num);
				}
				break;
			case ConfigControl.Setting.RandomB:
				if (num2 != 1 && Fifty_Fifty(moon, (int)((float)(randomSeed * 5) / 3f), 1))
				{
					ApplyObject(moon, 1, container.transform, num);
				}
				break;
			case ConfigControl.Setting.RandomC:
				if (num2 != 2 && Fifty_Fifty(moon, (int)((float)(randomSeed * 5) / 3f), 2))
				{
					ApplyObject(moon, 2, container.transform, num);
				}
				break;
			case ConfigControl.Setting.RandomAny:
			{
				int num3 = RandomIndex(moon, randomSeed, vanilla);
				if (num3 != num2 && num3 >= 0 && num3 < MapImprovementModBase.Instance.Moons[moon].Adjustments.Count)
				{
					ApplyObject(moon, num3, container.transform, num);
				}
				break;
			}
			}
		}

		private static int RandomIndex(int moon, int seed, bool vanilla)
		{
			byte b = 0;
			for (int i = 0; i < MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects.Length; i++)
			{
				if (!MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[i].Settings.Equals(ConfigControl.Setting.Always) && !MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[i].Settings.Equals(ConfigControl.Setting.Disabled) && !MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[i].Settings.Equals(ConfigControl.Setting.Never))
				{
					b += (byte)Mathf.Pow(2f, (float)i);
				}
			}
			if (b > 0)
			{
				if (vanilla)
				{
					b += 8;
				}
				switch (b)
				{
				case 1:
					return 0;
				case 2:
					return 1;
				case 3:
					return seed % 2;
				case 4:
					return 2;
				case 5:
					return seed % 2 * 2;
				case 6:
					return seed % 2 + 1;
				case 7:
					return seed % 3;
				case 9:
					return seed % 2 - 1;
				case 10:
					return seed % 2 * 2 - 1;
				case 11:
					return seed % 3 - 1;
				case 12:
					return seed % 2 * 3 - 1;
				case 13:
					return seed % 3 * 2 - 2;
				case 14:
					return seed % 3 + 1;
				case 15:
					return seed % 4;
				}
			}
			return -1;
		}

		private static bool Fifty_Fifty(int moon, int seed, int index)
		{
			if (!MapImprovementModBase.Instance.Configuration.cfgMoons[moon].cfgObjects[index].Settings.Equals(ConfigControl.Setting.Disabled))
			{
				return seed % 2 == 0;
			}
			return false;
		}

		private static int ApplyObject(int moon, int index, Transform parent, int fireOffset = 0)
		{
			SpawnObject(moon, index, parent);
			if (MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit == null || MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit.Count < 1)
			{
				return 0;
			}
			return AdjustObject(moon, index, fireOffset);
		}

		private static void SpawnObject(int moon, int index, Transform parent)
		{
			if ((Object)(object)MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Object != (Object)null)
			{
				Object.Instantiate<GameObject>(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Object, parent, true);
				MapImprovementModBase.mls.LogInfo((object)("Spawned in " + ((Object)MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Object).name));
			}
			else
			{
				MapImprovementModBase.mls.LogWarning((object)"Moon's object was null!");
			}
		}

		private static int AdjustObject(int moon, int index, int fireOffset = 0)
		{
			int num = 0;
			for (int i = 0; i < MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit.Count; i++)
			{
				if (MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Do.Equals(MapImprovementModBase.EditEnums.Enable))
				{
					GameObject[] array = (from sr in Object.FindObjectsByType<GameObject>((FindObjectsInactive)1, (FindObjectsSortMode)0)
						where !sr.gameObject.activeInHierarchy
						select sr).ToArray();
					for (int j = 0; j < array.Length; j++)
					{
						if (array[j].tag.Equals(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Tag))
						{
							num += ApplyEnum(array[j], moon, index, i, fireOffset);
							break;
						}
					}
					continue;
				}
				if (MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Tag.Equals("Untagged"))
				{
					GameObject val = GameObject.Find(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Name);
					if (val.tag.Equals(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Tag))
					{
						num += ApplyEnum(val, moon, index, i, fireOffset);
					}
					continue;
				}
				GameObject[] array2 = GameObject.FindGameObjectsWithTag(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Tag);
				for (int k = 0; k < array2.Length; k++)
				{
					if (((Object)array2[k]).name.Equals(MapImprovementModBase.Instance.Moons[moon].Adjustments[index].Edit[i].Name))
					{
						num += ApplyEnum(array2[k], moon, index, i, fireOffset);
						break;
					}
				}
			}
			return num;
		}

		private static int ApplyEnum(GameObject find, int moon, int index, int i, int fireOffset)
		{
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_01da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_028f: Unknown result type (might be due to invalid IL or missing references)