Decompiled source of More gift genie v1.0.0

PRESENTMOD.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Xml;
using BepInEx;
using DM;
using Landfall.TABS;
using Landfall.TABS.UnitEditor;
using ModdingForDummies.AssetManagement;
using ModdingForDummies.TABSSimp;
using SLMA;
using Sirenix.Serialization;
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("ModdingForDummies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ModdingForDummies")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("1619c49c-bc45-486c-bbca-6b52cef4f478")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ModdingForDummies
{
	[BepInPlugin("PRESENTMOD", "PRESENTMOD", "1.0.1")]
	public class Launcher : BaseUnityPlugin
	{
		public Launcher()
		{
			Debug.Log((object)"OHHHHHHHHHH");
			AssetImporter.Initialize();
			new Main();
		}
	}
	public class Main : Mod
	{
		private string comment;

		public Main()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Expected O, but got Unknown
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Expected O, but got Unknown
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Expected O, but got Unknown
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Expected O, but got Unknown
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: Expected O, but got Unknown
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Expected O, but got Unknown
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Expected O, but got Unknown
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Expected O, but got Unknown
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Expected O, but got Unknown
			//IL_026d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Expected O, but got Unknown
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Expected O, but got Unknown
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Expected O, but got Unknown
			//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e6: Expected O, but got Unknown
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_030b: Expected O, but got Unknown
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Expected O, but got Unknown
			//IL_034b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Expected O, but got Unknown
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Expected O, but got Unknown
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Expected O, but got Unknown
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cb: Expected O, but got Unknown
			//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f0: Expected O, but got Unknown
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Expected O, but got Unknown
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Expected O, but got Unknown
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_045f: Expected O, but got Unknown
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0484: Expected O, but got Unknown
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a9: Expected O, but got Unknown
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Expected O, but got Unknown
			//IL_04e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Expected O, but got Unknown
			//IL_050e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0518: Expected O, but got Unknown
			//IL_053a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0544: Expected O, but got Unknown
			//IL_055f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Expected O, but got Unknown
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_058e: Expected O, but got Unknown
			//IL_05a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Expected O, but got Unknown
			//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Expected O, but got Unknown
			//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Expected O, but got Unknown
			//IL_0618: Unknown result type (might be due to invalid IL or missing references)
			//IL_0622: Expected O, but got Unknown
			//IL_063d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0647: Expected O, but got Unknown
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_066c: Expected O, but got Unknown
			//IL_0687: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Expected O, but got Unknown
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b6: Expected O, but got Unknown
			//IL_06d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e2: Expected O, but got Unknown
			//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0707: Expected O, but got Unknown
			//IL_0722: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Expected O, but got Unknown
			//IL_0747: Unknown result type (might be due to invalid IL or missing references)
			//IL_0751: Expected O, but got Unknown
			//IL_076c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0776: Expected O, but got Unknown
			//IL_0791: Unknown result type (might be due to invalid IL or missing references)
			//IL_079b: Expected O, but got Unknown
			//IL_07b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Expected O, but got Unknown
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Expected O, but got Unknown
			//IL_0800: Unknown result type (might be due to invalid IL or missing references)
			//IL_080a: Expected O, but got Unknown
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			//IL_082f: Expected O, but got Unknown
			//IL_0851: Unknown result type (might be due to invalid IL or missing references)
			//IL_085b: Expected O, but got Unknown
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Expected O, but got Unknown
			//IL_089b: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a5: Expected O, but got Unknown
			//IL_08c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Expected O, but got Unknown
			//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ef: Expected O, but got Unknown
			//IL_090a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0914: Expected O, but got Unknown
			//IL_092f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0939: Expected O, but got Unknown
			//IL_0954: Unknown result type (might be due to invalid IL or missing references)
			//IL_095e: Expected O, but got Unknown
			//IL_0979: Unknown result type (might be due to invalid IL or missing references)
			//IL_0983: Expected O, but got Unknown
			//IL_099e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09a8: Expected O, but got Unknown
			//IL_09c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09cd: Expected O, but got Unknown
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f2: Expected O, but got Unknown
			//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a17: Expected O, but got Unknown
			//IL_0a39: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a43: Expected O, but got Unknown
			//IL_0a5e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a68: Expected O, but got Unknown
			//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8d: Expected O, but got Unknown
			//IL_0aa8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab2: Expected O, but got Unknown
			//IL_0acd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Expected O, but got Unknown
			//IL_0af2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afc: Expected O, but got Unknown
			//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b21: Expected O, but got Unknown
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b46: Expected O, but got Unknown
			//IL_0b68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b72: Expected O, but got Unknown
			//IL_0b8d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b97: Expected O, but got Unknown
			//IL_0bb2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bbc: Expected O, but got Unknown
			//IL_0bd7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be1: Expected O, but got Unknown
			//IL_0bfc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c06: Expected O, but got Unknown
			//IL_0c21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2b: Expected O, but got Unknown
			//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c50: Expected O, but got Unknown
			//IL_0c6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c75: Expected O, but got Unknown
			//IL_0c90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9a: Expected O, but got Unknown
			//IL_0cb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbf: Expected O, but got Unknown
			//IL_0cda: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce4: Expected O, but got Unknown
			//IL_0d06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d10: Expected O, but got Unknown
			//IL_0d2b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d35: Expected O, but got Unknown
			//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5a: Expected O, but got Unknown
			//IL_0d75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d7f: Expected O, but got Unknown
			//IL_0d9a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da4: Expected O, but got Unknown
			//IL_0dbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dc9: Expected O, but got Unknown
			//IL_0de4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dee: Expected O, but got Unknown
			//IL_0e09: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e13: Expected O, but got Unknown
			//IL_0e2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e38: Expected O, but got Unknown
			//IL_0e53: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e5d: Expected O, but got Unknown
			//IL_0e78: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e82: Expected O, but got Unknown
			//IL_0ea4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0eae: Expected O, but got Unknown
			//IL_0ec9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ed3: Expected O, but got Unknown
			//IL_0eee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef8: Expected O, but got Unknown
			//IL_0f13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f1d: Expected O, but got Unknown
			//IL_0f38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f42: Expected O, but got Unknown
			//IL_0f5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f67: Expected O, but got Unknown
			//IL_0f82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f8c: Expected O, but got Unknown
			//IL_0fa7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fb1: Expected O, but got Unknown
			//IL_0fcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fd6: Expected O, but got Unknown
			//IL_0ff1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ffb: Expected O, but got Unknown
			//IL_101d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1027: Expected O, but got Unknown
			//IL_1042: Unknown result type (might be due to invalid IL or missing references)
			//IL_104c: Expected O, but got Unknown
			//IL_1067: Unknown result type (might be due to invalid IL or missing references)
			//IL_1071: Expected O, but got Unknown
			//IL_108c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1096: Expected O, but got Unknown
			//IL_10b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_10bb: Expected O, but got Unknown
			//IL_10d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e0: Expected O, but got Unknown
			//IL_10fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_1105: Expected O, but got Unknown
			//IL_1120: Unknown result type (might be due to invalid IL or missing references)
			//IL_112a: Expected O, but got Unknown
			//IL_1145: Unknown result type (might be due to invalid IL or missing references)
			//IL_114f: Expected O, but got Unknown
			//IL_116a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1174: Expected O, but got Unknown
			//IL_118f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1199: Expected O, but got Unknown
			//IL_11b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_11be: Expected O, but got Unknown
			//IL_11d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e3: Expected O, but got Unknown
			//IL_11fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_1208: Expected O, but got Unknown
			//IL_1223: Unknown result type (might be due to invalid IL or missing references)
			//IL_122d: Expected O, but got Unknown
			//IL_1248: Unknown result type (might be due to invalid IL or missing references)
			//IL_1252: Expected O, but got Unknown
			//IL_1274: Unknown result type (might be due to invalid IL or missing references)
			//IL_127e: Expected O, but got Unknown
			//IL_1299: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a3: Expected O, but got Unknown
			//IL_12be: Unknown result type (might be due to invalid IL or missing references)
			//IL_12c8: Expected O, but got Unknown
			//IL_12e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_12ed: Expected O, but got Unknown
			//IL_1308: Unknown result type (might be due to invalid IL or missing references)
			//IL_1312: Expected O, but got Unknown
			//IL_132d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1337: Expected O, but got Unknown
			//IL_1352: Unknown result type (might be due to invalid IL or missing references)
			//IL_135c: Expected O, but got Unknown
			//IL_1377: Unknown result type (might be due to invalid IL or missing references)
			//IL_1381: Expected O, but got Unknown
			//IL_13a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_13ad: Expected O, but got Unknown
			//IL_13c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_13d2: Expected O, but got Unknown
			//IL_13ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_13f7: Expected O, but got Unknown
			//IL_1412: Unknown result type (might be due to invalid IL or missing references)
			//IL_141c: Expected O, but got Unknown
			//IL_1437: Unknown result type (might be due to invalid IL or missing references)
			//IL_1441: Expected O, but got Unknown
			//IL_145c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1466: Expected O, but got Unknown
			//IL_1481: Unknown result type (might be due to invalid IL or missing references)
			//IL_148b: Expected O, but got Unknown
			//IL_14a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_14b0: Expected O, but got Unknown
			//IL_1ba4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1bb8: Expected O, but got Unknown
			//IL_1bec: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c00: Expected O, but got Unknown
			//IL_1c34: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c48: Expected O, but got Unknown
			//IL_1c7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1c90: Expected O, but got Unknown
			//IL_1cc4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1cd8: Expected O, but got Unknown
			//IL_1d0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d20: Expected O, but got Unknown
			//IL_1d54: Unknown result type (might be due to invalid IL or missing references)
			//IL_1d68: Expected O, but got Unknown
			//IL_1d9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1db0: Expected O, but got Unknown
			//IL_1de4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1df8: Expected O, but got Unknown
			//IL_1e2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e40: Expected O, but got Unknown
			//IL_1e74: Unknown result type (might be due to invalid IL or missing references)
			//IL_1e88: Expected O, but got Unknown
			//IL_1ebc: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ed0: Expected O, but got Unknown
			//IL_1f04: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f18: Expected O, but got Unknown
			//IL_1f47: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f65: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f83: Unknown result type (might be due to invalid IL or missing references)
			//IL_1f8d: Expected O, but got Unknown
			//IL_1f8d: Expected O, but got Unknown
			//IL_1f8d: Expected O, but got Unknown
			//IL_1fb7: Unknown result type (might be due to invalid IL or missing references)
			//IL_1fd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ff3: Unknown result type (might be due to invalid IL or missing references)
			//IL_1ffd: Expected O, but got Unknown
			//IL_1ffd: Expected O, but got Unknown
			//IL_1ffd: Expected O, but got Unknown
			//IL_2027: Unknown result type (might be due to invalid IL or missing references)
			//IL_2045: Unknown result type (might be due to invalid IL or missing references)
			//IL_2063: Unknown result type (might be due to invalid IL or missing references)
			//IL_206d: Expected O, but got Unknown
			//IL_206d: Expected O, but got Unknown
			//IL_206d: Expected O, but got Unknown
			//IL_2097: Unknown result type (might be due to invalid IL or missing references)
			//IL_20b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_20d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_20dd: Expected O, but got Unknown
			//IL_20dd: Expected O, but got Unknown
			//IL_20dd: Expected O, but got Unknown
			//IL_2107: Unknown result type (might be due to invalid IL or missing references)
			//IL_2125: 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_214d: Expected O, but got Unknown
			//IL_214d: Expected O, but got Unknown
			//IL_214d: Expected O, but got Unknown
			//IL_2177: Unknown result type (might be due to invalid IL or missing references)
			//IL_2195: Unknown result type (might be due to invalid IL or missing references)
			//IL_21b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_21bd: Expected O, but got Unknown
			//IL_21bd: Expected O, but got Unknown
			//IL_21bd: Expected O, but got Unknown
			//IL_21e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_2205: Unknown result type (might be due to invalid IL or missing references)
			//IL_2223: Unknown result type (might be due to invalid IL or missing references)
			//IL_222d: Expected O, but got Unknown
			//IL_222d: Expected O, but got Unknown
			//IL_222d: Expected O, but got Unknown
			//IL_2257: Unknown result type (might be due to invalid IL or missing references)
			//IL_2275: Unknown result type (might be due to invalid IL or missing references)
			//IL_2293: Unknown result type (might be due to invalid IL or missing references)
			//IL_229d: Expected O, but got Unknown
			//IL_229d: Expected O, but got Unknown
			//IL_229d: Expected O, but got Unknown
			//IL_22c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_22e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_2303: Unknown result type (might be due to invalid IL or missing references)
			//IL_230d: Expected O, but got Unknown
			//IL_230d: Expected O, but got Unknown
			//IL_230d: Expected O, but got Unknown
			//IL_2337: Unknown result type (might be due to invalid IL or missing references)
			//IL_2355: Unknown result type (might be due to invalid IL or missing references)
			//IL_2373: Unknown result type (might be due to invalid IL or missing references)
			//IL_237d: Expected O, but got Unknown
			//IL_237d: Expected O, but got Unknown
			//IL_237d: Expected O, but got Unknown
			//IL_23a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_23c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_23e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_23ed: Expected O, but got Unknown
			//IL_23ed: Expected O, but got Unknown
			//IL_23ed: Expected O, but got Unknown
			//IL_2417: Unknown result type (might be due to invalid IL or missing references)
			//IL_2435: Unknown result type (might be due to invalid IL or missing references)
			//IL_2453: Unknown result type (might be due to invalid IL or missing references)
			//IL_245d: Expected O, but got Unknown
			//IL_245d: Expected O, but got Unknown
			//IL_245d: Expected O, but got Unknown
			//IL_2487: Unknown result type (might be due to invalid IL or missing references)
			//IL_24a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_24c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_24cd: Expected O, but got Unknown
			//IL_24cd: Expected O, but got Unknown
			//IL_24cd: Expected O, but got Unknown
			comment = "modfgjuia";
			Mod.DEV_MODE = false;
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			Stream manifestResourceStream = executingAssembly.GetManifestResourceStream("PRESENTMOD.myproj");
			AssetBundle val = AssetBundle.LoadFromStream(manifestResourceStream);
			List<UnitBlueprint> list = new List<UnitBlueprint>();
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			foreach (UnitBlueprint item in array)
			{
				list.Add(item);
			}
			List<UnitBlueprint> units = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_PROTECTOR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_THROWER_SPEAR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_THROWER_BOULDER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_BONEMAGE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CHIEFTAIN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_MAMMOTH"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_RAPTOR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_RAPTORWITHRIDER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_CHEERLEADER"]
			};
			List<UnitBlueprint> units2 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_PITCHFORK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_HAY"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_POTIONSELLER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_SCYTHE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_WHEELBARROW"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_SCARECROW"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FARMER_HALFLING"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEMAGE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_WHEELBARROW_FIRE"]
			};
			List<UnitBlueprint> units3 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_CATAPULT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_BANJO"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_SQUIRE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_ARCHER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_PRIEST"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_KNIGHT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_MEDIEVAL_THEKING"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_VLAD"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_TREEGIANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_EXECUTIONER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_MACESPINNER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_CLAM"]
			};
			List<UnitBlueprint> units4 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_SHIELD_ROMAN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_SARISSA"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_HOPLITE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_ARCHER_SNAKE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_BALLISTA"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_MINOTAUR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ANCIENT_ZEUS"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ARTEMIS"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_CUPID"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_FANBEARER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_TEACHER"]
			};
			List<UnitBlueprint> units5 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_HEADBUTTER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_ARCHER_ICE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_BRAWLER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_BERSERKER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_VALKYRIE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_VIKINGBOAT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_VIKING_JARL"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ULLR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SHOUTER"]
			};
			List<UnitBlueprint> units6 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_SAMURAI"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_ARCHER_FIREWORK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_MONK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_NINJA"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_DRAGON"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_HWACHA"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_MONKEY_KING"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_CHUKONU"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_TAEKWONDO"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SAMURAI_GIANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_REDJADE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SENSEI"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SHOGUN"]
			};
			List<UnitBlueprint> units7 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_PAINTER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_FENCER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_BALLOON_ARCHER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_MUSKET"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_HALBERD"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_JOUSTERONHORSE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_RENAISSANCE_DAVINCITANK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BALLOONER"]
			};
			List<UnitBlueprint> units8 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_FLINTLOCK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_BLUNDERBUSS"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_THROWER_BOMB"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_HARPOONER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_CANNON"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_CAPTAIN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_PIRATE_PIRATEQUEEN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BOMBONASTICK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BLACKBEARD"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BOMBCANNON"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_CLAM"]
			};
			List<UnitBlueprint> units9 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_SKELETONWARRIOR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_SKELETONARCHER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_CANDLEHEAD"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_VAMPIREBITER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_SPOOKYCATAPULT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_SWORDCASTER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_HALLOWEEN_REAPER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SKELETONGIANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_WITCH_BROOM"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BANSHEE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_NECROMANCER"]
			};
			List<UnitBlueprint> units10 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_THROWER_DYNAMITE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_MINER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_CACTUS"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_GUNSLINGER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_LASSOHORSE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_DEADEYE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_QUICKDRAW"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_GATLINGGUN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SHOUTER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_BALLANDCHAIN"]
			};
			List<UnitBlueprint> units11 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_PEASANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_BANNER_BEARER_STAY"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_POACHER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_BLOWDART"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_PIKE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_BARRELROLLER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_BOXER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_FLAG_BEARER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_PHARAOH"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_WIZARD"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_CHARIOT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_THOR"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_TANK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_SUPERBOXER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_DARKP"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_LEGACY_LEG_SUPERPEASANT"]
			};
			List<UnitBlueprint> units12 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_SOLARARCHITECT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_GAUNTLET"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_ORBCASTER"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_THROWN_GLAIVE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_GOOD_CLERIC"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_SMITE_PRIEST"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_ELEPHANT"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYGOOD_TIMENINJA"]
			};
			List<UnitBlueprint> units13 = new List<UnitBlueprint>
			{
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_INFERNAL_WHIP"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_FANTASYASSASSIN"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_EVILTANK"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_MECHANIC"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_EVIL_CLERIC"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_STORMPRIEST"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_WARGLAIVE"],
				(UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_FANTASYEVIL_DARKKING"]
			};
			GameObject val2 = UPool.MyPool.AddObject("部落礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341920, true);
			((Component)val2.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units;
			GameObject val3 = UPool.MyPool.AddObject("农夫礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341921, true);
			((Component)val3.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units2;
			GameObject val4 = UPool.MyPool.AddObject("中世纪礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341922, true);
			((Component)val4.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units3;
			GameObject val5 = UPool.MyPool.AddObject("古代礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341923, true);
			((Component)val5.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units4;
			GameObject val6 = UPool.MyPool.AddObject("王朝礼物盒盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341924, true);
			((Component)val6.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units6;
			GameObject val7 = UPool.MyPool.AddObject("文艺复兴礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341925, true);
			((Component)val7.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units7;
			GameObject val8 = UPool.MyPool.AddObject("海盗礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341926, true);
			((Component)val8.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units8;
			GameObject val9 = UPool.MyPool.AddObject("亡灵礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341927, true);
			((Component)val9.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units9;
			GameObject val10 = UPool.MyPool.AddObject("西部礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341928, true);
			((Component)val10.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units10;
			GameObject val11 = UPool.MyPool.AddObject("传奇礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341929, true);
			((Component)val11.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units11;
			GameObject val12 = UPool.MyPool.AddObject("魔幻善礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341930, true);
			((Component)val12.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units12;
			GameObject val13 = UPool.MyPool.AddObject("魔幻恶礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341931, true);
			((Component)val13.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units13;
			GameObject val14 = UPool.MyPool.AddObject("维京礼物盒召唤", val.LoadAsset<GameObject>("E_RandomUnitSpawner123"), true, (HideFlags)52, (Sprite)null, 341952, true);
			((Component)val14.transform.Find("Spawner")).GetComponentInChildren<UnitSpawner>().units = units5;
			GameObject val15 = UPool.MyPool.AddObject("部落礼物", val.LoadAsset<GameObject>("muxiang"), true, (HideFlags)52, (Sprite)null, 5642313, true);
			((Component)val15.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val2;
			GameObject val16 = UPool.MyPool.AddObject("农夫礼物盒", val.LoadAsset<GameObject>("mubaoxiang"), true, (HideFlags)52, (Sprite)null, 5642314, true);
			((Component)val16.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val3;
			GameObject val17 = UPool.MyPool.AddObject("中世纪礼物盒", val.LoadAsset<GameObject>("jingzhimuxiang"), true, (HideFlags)52, (Sprite)null, 5642316, true);
			((Component)val17.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val4;
			GameObject val18 = UPool.MyPool.AddObject("古代礼物盒", val.LoadAsset<GameObject>("jingzhimuxiang"), true, (HideFlags)52, (Sprite)null, 5642326, true);
			((Component)val18.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val5;
			GameObject val19 = UPool.MyPool.AddObject("王朝礼物盒", val.LoadAsset<GameObject>("gaojiwuzixiang"), true, (HideFlags)52, (Sprite)null, 341912, true);
			((Component)val19.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val6;
			GameObject val20 = UPool.MyPool.AddObject("文艺复兴礼物盒", val.LoadAsset<GameObject>("jingzhimuxiang"), true, (HideFlags)52, (Sprite)null, 341913, true);
			((Component)val20.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val7;
			GameObject val21 = UPool.MyPool.AddObject("海盗礼物盒", val.LoadAsset<GameObject>("haidaomuxiang"), true, (HideFlags)52, (Sprite)null, 341914, true);
			((Component)val21.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val8;
			GameObject val22 = UPool.MyPool.AddObject("亡灵礼物盒", val.LoadAsset<GameObject>("heiseliwuhe"), true, (HideFlags)52, (Sprite)null, 341915, true);
			((Component)val22.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val9;
			GameObject val23 = UPool.MyPool.AddObject("西部礼物盒", val.LoadAsset<GameObject>("xianrenzhanghez"), true, (HideFlags)52, (Sprite)null, 341916, true);
			((Component)val23.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val10;
			GameObject val24 = UPool.MyPool.AddObject("传奇礼物盒", val.LoadAsset<GameObject>("huanwenliwuhe"), true, (HideFlags)52, (Sprite)null, 341917, true);
			((Component)val24.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val11;
			GameObject val25 = UPool.MyPool.AddObject("魔幻善礼物盒", val.LoadAsset<GameObject>("zijinliwuhe"), true, (HideFlags)52, (Sprite)null, 341918, true);
			((Component)val25.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val12;
			GameObject val26 = UPool.MyPool.AddObject("魔幻恶礼物盒", val.LoadAsset<GameObject>("jianciliwuhe"), true, (HideFlags)52, (Sprite)null, 341919, true);
			((Component)val26.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val13;
			GameObject val27 = UPool.MyPool.AddObject("维京礼物盒", val.LoadAsset<GameObject>("bingxuebaoxiang"), true, (HideFlags)52, (Sprite)null, 341951, true);
			((Component)val27.transform.Find("SpawnUnit")).GetComponentInChildren<SpawnObject>().objectToSpawn = val14;
			GameObject val28 = UPool.MyPool.AddObject("部落礼物ab", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 5642312, true);
			val28.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val15;
			GameObject val29 = UPool.MyPool.AddObject("农夫礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 5642315, true);
			val29.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val16;
			GameObject val30 = UPool.MyPool.AddObject("中世纪礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 5642317, true);
			val30.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val17;
			GameObject val31 = UPool.MyPool.AddObject("古代礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 5642221, true);
			val31.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val18;
			GameObject val32 = UPool.MyPool.AddObject("王朝礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341936, true);
			val32.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val19;
			GameObject val33 = UPool.MyPool.AddObject("文艺复兴礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341937, true);
			val33.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val20;
			GameObject val34 = UPool.MyPool.AddObject("亡灵礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341938, true);
			val34.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val22;
			GameObject val35 = UPool.MyPool.AddObject("西部礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341939, true);
			val35.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val23;
			GameObject val36 = UPool.MyPool.AddObject("传奇礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341940, true);
			val36.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val24;
			GameObject val37 = UPool.MyPool.AddObject("魔幻善礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341941, true);
			val37.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val25;
			GameObject val38 = UPool.MyPool.AddObject("魔幻恶礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341942, true);
			val38.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val26;
			GameObject val39 = UPool.MyPool.AddObject("海盗礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 341943, true);
			val39.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val21;
			GameObject val40 = UPool.MyPool.AddObject("维京礼物", (GameObject)SLMALoader.SDic["weapons"]["Thrown_Present"], true, (HideFlags)52, (Sprite)null, 3411021, true);
			val40.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = val27;
			UnitBlueprint val41 = SLMATool.CreateUnit("部落礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Tribal"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val41.RightWeapon = val28;
			UnitBlueprint val42 = SLMATool.CreateUnit("农夫礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Farmer"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val42.RightWeapon = val29;
			UnitBlueprint val43 = SLMATool.CreateUnit("中世纪礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Medieval"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val43.RightWeapon = val30;
			UnitBlueprint val44 = SLMATool.CreateUnit("古代礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Ancient"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val44.RightWeapon = val31;
			UnitBlueprint val45 = SLMATool.CreateUnit("维京礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Viking"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val45.RightWeapon = val40;
			UnitBlueprint val46 = SLMATool.CreateUnit("王朝礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Asia"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val46.RightWeapon = val32;
			UnitBlueprint val47 = SLMATool.CreateUnit("文艺复兴礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Renaissance"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val47.RightWeapon = val33;
			UnitBlueprint val48 = SLMATool.CreateUnit("海盗礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Pirate"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val48.RightWeapon = val39;
			UnitBlueprint val49 = SLMATool.CreateUnit("亡灵礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Halloween"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val49.RightWeapon = val34;
			UnitBlueprint val50 = SLMATool.CreateUnit("西部礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Western"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val50.RightWeapon = val35;
			UnitBlueprint val51 = SLMATool.CreateUnit("传奇礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["Legacy"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val51.RightWeapon = val36;
			UnitBlueprint val52 = SLMATool.CreateUnit("魔幻善礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["FantasyGood"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val52.RightWeapon = val37;
			UnitBlueprint val53 = SLMATool.CreateUnit("魔幻恶礼物精灵", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_THROWER_PRESENT"], (Faction)SLMALoader.SDic["factions"]["FantasyEvil"], (Sprite)SLMALoader.SDic["sprites"]["Thrown_Present"]);
			val53.RightWeapon = val38;
		}
	}
	public static class Utilities
	{
		private static readonly string[] sanitizationFilter;

		private static readonly Dictionary<GearType, string[]> boneDictionary;

		public static readonly Quaternion blenderToUnity;

		public static readonly string rootPath;

		public static Dictionary<string, string> language;

		public static readonly ContentDatabase fullDatabase;

		public static readonly LandfallContentDatabase database;

		public static Explosion[] explosions;

		public static UnitEffectBase[] effects;

		public static Sprite[] sprites;

		public static readonly ModExplosion unitSpawner;

		public static readonly ModFaction baseFaction;

		static Utilities()
		{
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Expected O, but got Unknown
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0473: Unknown result type (might be due to invalid IL or missing references)
			sanitizationFilter = new string[33]
			{
				"Icon_Legacy_", "Icons_128x128_", "Icons_", "Icon_", "CP_", "P_", "E_", " Prefabs_VB", " Effects_VB", "_1",
				"_2", "_3", " (1)", " (2)", " (3)", " (4)", " (5)", " (6)", "B_", "Move_",
				"Leg_", "1_", "12_", "15_", "6__", "7_", "14_", "2_", "8_", "10_",
				"16_", "5_", "3_"
			};
			boneDictionary = new Dictionary<GearType, string[]>
			{
				{
					(GearType)0,
					new string[1] { "M_Head" }
				},
				{
					(GearType)1,
					new string[1] { "M_Neck" }
				},
				{
					(GearType)2,
					new string[2] { "M_Shoulder_Right", "M_Shoulder_Left" }
				},
				{
					(GearType)3,
					new string[1] { "M_Torso" }
				},
				{
					(GearType)4,
					new string[2] { "M_Arm_Right", "M_Arm_Left" }
				},
				{
					(GearType)5,
					new string[2] { "M_Wrist_Right", "M_Wrist_Left" }
				},
				{
					(GearType)7,
					new string[1] { "M_Waist" }
				},
				{
					(GearType)8,
					new string[2] { "M_Leg_Right", "M_Leg_Left" }
				},
				{
					(GearType)9,
					new string[2] { "M_Foot_Right", "M_Foot_Left" }
				}
			};
			blenderToUnity = Quaternion.Euler(-90f, 0f, 0f);
			rootPath = Directory.GetParent(Assembly.GetExecutingAssembly().Location)?.ToString();
			language = Localizer.GetLanguage((Language)0);
			fullDatabase = ContentDatabase.Instance();
			database = ContentDatabase.Instance().LandfallContentDatabase;
			explosions = Resources.FindObjectsOfTypeAll<Explosion>();
			effects = Resources.FindObjectsOfTypeAll<UnitEffectBase>();
			sprites = Resources.FindObjectsOfTypeAll<Sprite>();
			unitSpawner = new ModExplosion(Mod.PoolObject(new GameObject("UnitSpawner", new Type[1] { typeof(UnitSpawner) })));
			List<string> source = (from z in (from z in language
					group z by z.Value into z
					where z.Count() > 1
					select z).SelectMany((IGrouping<string, KeyValuePair<string, string>> z) => z)
				select z.Key).ToList();
			Dictionary<string, int> dictionary = new Dictionary<string, int>();
			foreach (string item in source.Where((string v) => language[v] != null && language[v] != string.Empty))
			{
				if (!dictionary.ContainsKey(language[item]))
				{
					dictionary.Add(language[item], 1);
					continue;
				}
				dictionary[language[item]]++;
				language[item] = language[item] + " " + dictionary[language[item]];
			}
			Faction val = Object.Instantiate<Faction>(GetFaction("Medieval"));
			val.Entity.GenerateNewID();
			val.Entity.Name = "Base Faction";
			val.Units = Array.Empty<UnitBlueprint>();
			val.index = database.GetFactions().ToList().Count;
			val.m_FactionColor = HexColor("#888888");
			val.m_displayFaction = false;
			AddFactionToDatabase(val);
			baseFaction = new ModFaction(val);
			if (Mod.DEV_MODE)
			{
				string text = Path.Combine(rootPath, "MFDPrints");
				if (!Directory.Exists(text))
				{
					Directory.CreateDirectory(text);
				}
				string contents = string.Join(Environment.NewLine, from GameObject weapon in database.GetWeapons()
					where (Object)(object)weapon != (Object)null
					select GetProperName(((CharacterItem)weapon.GetComponentInChildren<WeaponItem>()).Entity.Name));
				File.WriteAllText(Path.Combine(text, "weapons.txt"), contents);
				string contents2 = string.Join(Environment.NewLine, from GameObject unitBase in database.GetUnitBases()
					where (Object)(object)unitBase != (Object)null
					select GetProperName(unitBase.GetComponentInChildren<Unit>().Entity.Name));
				File.WriteAllText(Path.Combine(text, "bases.txt"), contents2);
				string contents3 = string.Join(Environment.NewLine, from GameObject clothing in database.GetCharacterProps()
					where (Object)(object)clothing != (Object)null
					select GetProperName(((CharacterItem)clothing.GetComponentInChildren<PropItem>()).Entity.Name));
				File.WriteAllText(Path.Combine(text, "clothing.txt"), contents3);
				string contents4 = string.Join(Environment.NewLine, from IDatabaseEntity unit in database.GetUnitBlueprints()
					select GetProperName(unit.Entity.Name));
				File.WriteAllText(Path.Combine(text, "unit.txt"), contents4);
				string contents5 = string.Join(Environment.NewLine, from IDatabaseEntity faction in database.GetFactions()
					select GetProperName(faction.Entity.Name));
				File.WriteAllText(Path.Combine(text, "factions.txt"), contents5);
				string contents6 = string.Join(Environment.NewLine, from Explosion explosion in explosions
					where (Object)(object)explosion != (Object)null
					select GetProperName(((Object)((Component)explosion).gameObject).name));
				File.WriteAllText(Path.Combine(text, "explosions.txt"), contents6);
				string contents7 = string.Join(Environment.NewLine, from UnitEffectBase effect in effects
					where (Object)(object)effect != (Object)null
					select GetProperName(((Object)((Component)effect).gameObject).name));
				File.WriteAllText(Path.Combine(text, "effects.txt"), contents7);
				string contents8 = string.Join(Environment.NewLine, from GameObject projectile in database.GetProjectiles()
					select GetProperName(projectile.GetComponentInChildren<ProjectileEntity>().Entity.Name));
				File.WriteAllText(Path.Combine(text, "projectiles.txt"), contents8);
				string contents9 = string.Join(Environment.NewLine, from GameObject move in database.GetCombatMoves()
					select GetProperName(((CharacterItem)move.GetComponentInChildren<SpecialAbility>()).Entity.Name));
				File.WriteAllText(Path.Combine(text, "moves.txt"), contents9);
				string contents10 = string.Join(Environment.NewLine, from FactionIcon icon in fullDatabase.GetFactionIcons()
					select GetProperName(icon.Entity.Name));
				File.WriteAllText(Path.Combine(text, "icons.txt"), contents10);
				string contents11 = string.Join(Environment.NewLine, from Sprite icon in Resources.FindObjectsOfTypeAll<Sprite>()
					select GetProperName(((Object)icon).name));
				File.WriteAllText(Path.Combine(text, "iconsExtra.txt"), contents11);
			}
		}

		public static object CallMethod(this object o, string methodName, params object[] args)
		{
			MethodInfo method = o.GetType().GetMethod(methodName, (BindingFlags)(-1));
			if (method != null)
			{
				return method.Invoke(o, args);
			}
			Debug.Log((object)("Call Method " + methodName + " nulled"));
			return null;
		}

		public static object GetField<T>(this T instance, string fieldName, BindingFlags flags = (BindingFlags)(-1))
		{
			FieldInfo field = typeof(T).GetField(fieldName, flags);
			try
			{
				field.GetValue(instance);
			}
			catch
			{
				Debug.Log((object)$"(GetField) Failed to get field '{fieldName}' for object '{typeof(T)}'. Try using manual BindingFlags.");
			}
			return field.GetValue(instance);
		}

		public static void SetField<T>(this T instance, string fieldName, object newValue, BindingFlags flags = (BindingFlags)(-1))
		{
			FieldInfo field = typeof(T).GetField(fieldName, flags);
			Debug.Log((object)field);
			try
			{
				field.SetValue(instance, newValue);
			}
			catch
			{
				Debug.Log((object)$"(SetField) Failed to set field '{fieldName}' for object '{typeof(T)}'. Try using manual BindingFlags.");
			}
		}

		public static Transform SetHideFlagsChildren(this Transform t, HideFlags hf = 52)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((Component)t).gameObject))
			{
				((Object)((Component)t).gameObject).hideFlags = hf;
			}
			if (t.childCount > 0)
			{
				for (int i = 0; i < t.childCount; i++)
				{
					t.GetChild(i).SetHideFlagsChildren(hf);
				}
			}
			return t;
		}

		public static Sprite CreateSprite(string path)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_005c: 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)
			if (string.IsNullOrEmpty(path))
			{
				return null;
			}
			if (!File.Exists(path))
			{
				return null;
			}
			byte[] array = File.ReadAllBytes(path);
			Texture2D val = new Texture2D(1, 1);
			ImageConversion.LoadImage(val, array);
			((Texture)val).filterMode = (FilterMode)0;
			return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0f, 0f), 1f);
		}

		public static bool NullCheck(this object self, string flag = "Object")
		{
			Debug.Log((object)("[NULLCHECK] " + flag + " is " + ((self == null) ? "NULL" : "REAL") + "!"));
			return self == null;
		}

		public static T GetResourcesObj<T>(string obj)
		{
			Object[] source = Resources.FindObjectsOfTypeAll(typeof(T));
			return (T)(object)((IEnumerable<Object>)source).FirstOrDefault((Func<Object, bool>)((Object x) => x.name.Contains(obj)));
		}

		public static string IncrementName(string name)
		{
			return name.Contains(";") ? (name.Split(new char[1] { ';' })[0] + int.Parse(name.Split(new char[1] { ';' })[1]) + 1) : (name + ";1");
		}

		public static void ForEach<T>(this IEnumerable<T> collection, Action<T> action)
		{
			foreach (T item in collection)
			{
				action(item);
			}
		}

		public static void ForEach<T>(this T[] array, Action<T> action)
		{
			foreach (T obj in array)
			{
				action(obj);
			}
		}

		public static Dictionary<V, U> Reverse<U, V>(this Dictionary<U, V> self)
		{
			Dictionary<V, U> dictionary = new Dictionary<V, U>();
			foreach (U key in self.Keys)
			{
				dictionary[self[key]] = key;
			}
			return dictionary;
		}

		public static Color HexColor(string hexCode)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			hexCode = (hexCode.StartsWith("#") ? hexCode : ("#" + hexCode)).ToUpper();
			Color result = default(Color);
			ColorUtility.TryParseHtmlString(hexCode, ref result);
			return result;
		}

		public static T FindVanillaObject<T>(IEnumerable<T> source, string name, Func<T, string> getName)
		{
			return source.FirstOrDefault((T o) => name == GetProperName(getName(o)));
		}

		public static string GetProperName(string name)
		{
			string text = null;
			if (language.ContainsKey(name))
			{
				text = language[name];
			}
			else
			{
				text = name;
				string[] array = sanitizationFilter;
				foreach (string oldValue in array)
				{
					text = text.Replace(oldValue, "");
				}
			}
			return text;
		}

		public static string DeepString(this GameObject self)
		{
			string text = "\nGameObject '" + ((Object)self).name + "':\n{\n\tComponents:\n\t{\n";
			text = string.Concat(text, string.Concat(from Component component in self.GetComponents<Component>()
				select "\t\t" + ((object)component).GetType().Name + "\n"));
			text += "\t}\n";
			if (self.transform.childCount > 0)
			{
				text += "\tChildren:\n\t{\n";
				text = string.Concat(text, string.Concat(from Transform child in (IEnumerable)self.transform
					select ((Component)child).gameObject.DeepString().Replace("\n", "\n\t\t")));
				text += "\n\t}\n";
			}
			return text + "}\n";
		}

		public static void PlaceMeshOnBone(SkinnedMeshRenderer renderer, GameObject mesh, GearType gearType)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: 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 text = boneDictionary[gearType][0];
			Transform[] bones = renderer.bones;
			foreach (Transform val in bones)
			{
				if (((Object)val).name == text)
				{
					mesh.transform.parent = ((Component)val).transform;
					mesh.transform.localPosition = Vector3.zero;
					mesh.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f);
				}
			}
		}

		public static void SetMeshRenderers(GameObject gameObject, bool enabled)
		{
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				Type type = ((object)componentsInChildren[i]).GetType();
				if (type == typeof(MeshRenderer) || type == typeof(SkinnedMeshRenderer))
				{
					componentsInChildren[i].enabled = enabled;
				}
			}
		}

		public static void SetObjectColor(GameObject colorObject, int index, Color color, float glow)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Expected O, but got Unknown
			//IL_003f: 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)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			Renderer[] bestRenderers = GetBestRenderers(colorObject);
			Renderer bestRenderer = GetBestRenderer(colorObject);
			bool flag = (Object)(object)colorObject.GetComponentInChildren<LODGroup>() != (Object)null;
			Dictionary<Color, Material> dictionary = new Dictionary<Color, Material>();
			Material[] materials = bestRenderer.materials;
			Material val = new Material(Shader.Find("Standard"));
			val.color = color;
			if (glow > 0f)
			{
				val.EnableKeyword("_EMISSION");
				val.SetColor("_EmissionColor", val.color * glow);
			}
			val.SetFloat("_Glossiness", 0f);
			if (!Object.op_Implicit((Object)(object)bestRenderer))
			{
				return;
			}
			for (int j = 0; j < materials.Length; j++)
			{
				if (j == index)
				{
					dictionary[materials[j].color] = val;
				}
			}
			if (bestRenderers == null || bestRenderers.Length == 0)
			{
				return;
			}
			if (flag)
			{
				Renderer[] array = bestRenderers;
				foreach (Renderer val2 in array)
				{
					List<TeamColor> source = ((Component)val2).GetComponents<TeamColor>().ToList();
					List<TeamColor> removed = new List<TeamColor>();
					Material[] materials2 = val2.materials;
					List<Material> list = new List<Material>();
					int i;
					for (i = 0; i < materials2.Length; i++)
					{
						Material val3 = null;
						if (dictionary.ContainsKey(materials2[i].color))
						{
							val3 = dictionary[materials2[i].color];
						}
						if ((Object)(object)val3 != (Object)null)
						{
							list.Add(val3);
							foreach (TeamColor item in source.Where((TeamColor tc) => !removed.Contains(tc) && tc.materialID == i))
							{
								removed.Add(item);
								Object.DestroyImmediate((Object)(object)item);
							}
						}
						else
						{
							list.Add(materials2[i]);
						}
					}
					val2.materials = list.ToArray();
				}
				return;
			}
			int num = 0;
			Renderer[] array2 = bestRenderers;
			foreach (Renderer val4 in array2)
			{
				Material[] materials3 = val4.materials;
				List<TeamColor> list2 = ((Component)val4).GetComponents<TeamColor>().ToList();
				for (int m = 0; m < materials3.Length; m++)
				{
					if (num + m != index)
					{
						continue;
					}
					materials3[m] = val;
					foreach (TeamColor item2 in list2)
					{
						if (item2.materialID == m)
						{
							Object.DestroyImmediate((Object)(object)item2);
						}
					}
				}
				num++;
				val4.materials = materials3;
			}
		}

		public static void SetClothScale(ModClothing clothing, Vector3 scale)
		{
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			GameObject internalObject = clothing.internalObject;
			if ((Object)(object)internalObject.GetComponentInChildren<MeshRenderer>() != (Object)null)
			{
				MeshRenderer[] componentsInChildren = internalObject.GetComponentsInChildren<MeshRenderer>();
				foreach (MeshRenderer val in componentsInChildren)
				{
					((Component)val).transform.localScale = scale;
				}
			}
			if (!((Object)(object)internalObject.GetComponentInChildren<SkinnedMeshRenderer>() != (Object)null))
			{
				return;
			}
			Vector3 localScale = internalObject.transform.localScale;
			SkinnedMeshRenderer[] componentsInChildren2 = internalObject.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val2 in componentsInChildren2)
			{
				val2.sharedMesh = Object.Instantiate<Mesh>(val2.sharedMesh);
				Mesh sharedMesh = val2.sharedMesh;
				((Object)sharedMesh).name = clothing.Name + "sharedmesh";
				Vector3[] vertices = sharedMesh.vertices;
				if (vertices == null)
				{
					vertices = sharedMesh.vertices;
				}
				Debug.Log((object)("baseVertices " + vertices.Length));
				Vector3[] array = (Vector3[])(object)new Vector3[vertices.Length];
				for (int k = 0; k < array.Length; k++)
				{
					Vector3 val3 = vertices[k];
					val3.x /= localScale.x;
					val3.y /= localScale.y;
					val3.z /= localScale.z;
					val3.x *= scale.x;
					val3.y *= scale.y;
					val3.z *= scale.z;
					array[k] = val3;
				}
				internalObject.transform.localScale = scale;
				sharedMesh.vertices = array;
				sharedMesh.RecalculateBounds();
				val2.sharedMesh = sharedMesh;
			}
		}

		public static Renderer GetBestRenderer(GameObject gameObject, Type rendererType = null)
		{
			if (rendererType == null)
			{
				rendererType = typeof(Renderer);
			}
			else if (!rendererType.IsSubclassOf(typeof(Renderer)))
			{
				return null;
			}
			Renderer val = null;
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			bool flag = false;
			Renderer[] array = componentsInChildren;
			foreach (Renderer val2 in array)
			{
				if (((object)val2).GetType() == rendererType || rendererType == typeof(Renderer))
				{
					string name = ((Object)((Component)val2).gameObject).name;
					if (name.Contains("LOD0"))
					{
						val = val2;
						flag = true;
					}
					else if (name.Contains("CP_") && !flag)
					{
						val = val2;
						flag = true;
					}
					else if (name.ToLower().Contains(((Object)gameObject.gameObject).name.ToLower()) && !flag)
					{
						val = val2;
					}
					else if (!Object.op_Implicit((Object)(object)val) && name != "RightHand" && name != "LeftHand" && !flag)
					{
						val = val2;
					}
				}
			}
			return val;
		}

		public static Renderer[] GetBestRenderers(GameObject gameObject, Type rendererType = null)
		{
			if (rendererType == null)
			{
				rendererType = typeof(Renderer);
			}
			else if (!rendererType.IsSubclassOf(typeof(Renderer)))
			{
				return null;
			}
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			List<Renderer> list = new List<Renderer>();
			bool flag = false;
			LODGroup componentInChildren = gameObject.GetComponentInChildren<LODGroup>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				flag = true;
				list.AddRange(componentInChildren.GetLODs().SelectMany((LOD lod) => lod.renderers));
			}
			Renderer[] array = componentsInChildren;
			foreach (Renderer val in array)
			{
				if (!list.Contains(val) && (((object)val).GetType() == rendererType || rendererType == typeof(Renderer)))
				{
					string name = ((Object)gameObject).name;
					if (name.Contains("LOD") && ((Object)((Component)val).transform.parent).name.ToLower().Contains("base"))
					{
						list.Add(val);
						flag = true;
					}
					else if (name.Contains("LOD"))
					{
						list.Add(val);
						flag = true;
					}
					else if (name.Contains("CP_") && !flag)
					{
						list.Add(val);
						flag = true;
					}
					else if (name.ToLower().Contains(((Object)gameObject).name.ToLower()) && !flag)
					{
						list.Add(val);
					}
					else if (list.Count <= 0 && name != "RightHand" && name != "LeftHand" && !flag)
					{
						list.Add(val);
					}
				}
			}
			return list.ToArray();
		}

		public static GameObject GetUnitBase(string name)
		{
			return FindVanillaObject(database.GetUnitBases(), name, (GameObject ub) => ub.GetComponentInChildren<Unit>().Entity.Name);
		}

		public static GameObject GetClothing(string name)
		{
			return FindVanillaObject(database.GetCharacterProps(), name, (GameObject c) => ((CharacterItem)c.GetComponentInChildren<PropItem>()).Entity.Name);
		}

		public static GameObject GetWeapon(string name)
		{
			return FindVanillaObject(database.GetWeapons(), name, (GameObject w) => ((CharacterItem)w.GetComponentInChildren<WeaponItem>()).Entity.Name);
		}

		public static GameObject GetMove(string name)
		{
			return FindVanillaObject(database.GetCombatMoves(), name, (GameObject m) => ((CharacterItem)m.GetComponentInChildren<SpecialAbility>()).Entity.Name);
		}

		public static GameObject GetProjectile(string name)
		{
			GameObject gameObject = FindVanillaObject(database.GetProjectiles(), name, (GameObject p) => p.GetComponent<ProjectileEntity>().Entity.Name).gameObject;
			return ((Object)(object)gameObject != (Object)null) ? gameObject.gameObject : null;
		}

		public static GameObject GetExplosion(string name)
		{
			Explosion val = FindVanillaObject(explosions, name, (Explosion e) => ((Object)((Component)e).gameObject).name);
			return ((Object)(object)val != (Object)null) ? ((Component)val).gameObject : null;
		}

		public static UnitEffectBase GetEffect(string name)
		{
			return FindVanillaObject(effects, name, (UnitEffectBase e) => ((Object)((Component)e).gameObject).name);
		}

		public static Sprite GetIcon(string name)
		{
			FactionIcon val = FindVanillaObject(fullDatabase.GetFactionIcons(), name, (FactionIcon i) => i.Entity.Name);
			if ((Object)(object)val != (Object)null)
			{
				return val.Entity.SpriteIcon;
			}
			Sprite val2 = FindVanillaObject(AssetImporter.Sprites, name, (Sprite s) => ((Object)s).name);
			if ((Object)(object)val2 != (Object)null)
			{
				return val2;
			}
			return FindVanillaObject(sprites, name, (Sprite s) => ((Object)s).name);
		}

		public static UnitBlueprint GetUnit(string name)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			UnitBlueprint val = FindVanillaObject(database.GetUnitBlueprints(), name, (UnitBlueprint u) => u.Entity.Name);
			return ((Object)(object)val != (Object)null) ? database.GetUnitBlueprint(val.Entity.GUID) : null;
		}

		public static Faction GetFaction(string name)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			Faction val = FindVanillaObject(database.GetFactions(), name, (Faction f) => f.Entity.Name);
			return ((Object)(object)val != (Object)null) ? database.GetFaction(val.Entity.GUID) : null;
		}

		public static void AddUnitToDatabase(UnitBlueprint unit)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<DatabaseID, Object> dictionary = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fullDatabase.AssetLoader);
			Dictionary<DatabaseID, UnitBlueprint> dictionary2 = (Dictionary<DatabaseID, UnitBlueprint>)typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(database);
			if (!dictionary2.ContainsKey(unit.Entity.GUID))
			{
				dictionary2.Add(unit.Entity.GUID, unit);
				dictionary.Add(unit.Entity.GUID, (Object)(object)unit);
			}
			typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(database, dictionary2);
			typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fullDatabase.AssetLoader, dictionary);
		}

		public static void AddFactionToDatabase(Faction faction)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<DatabaseID, Object> dictionary = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(fullDatabase.AssetLoader);
			Dictionary<DatabaseID, Faction> dictionary2 = (Dictionary<DatabaseID, Faction>)typeof(LandfallContentDatabase).GetField("m_factions", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(database);
			if (!dictionary2.ContainsKey(faction.Entity.GUID))
			{
				dictionary2.Add(faction.Entity.GUID, faction);
				dictionary.Add(faction.Entity.GUID, (Object)(object)faction);
			}
			typeof(LandfallContentDatabase).GetField("m_factions", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(database, dictionary2);
			typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(fullDatabase.AssetLoader, dictionary);
		}

		public static GameObject GetModel(string name)
		{
			GameObject val = FindVanillaObject(AssetImporter.Models, name, (GameObject m) => ((Object)m.gameObject).name);
			return ((Object)(object)val != (Object)null) ? val.gameObject : null;
		}

		public static void SetFlagsChildren(Transform child, HideFlags flag)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			((Object)((Component)child).gameObject).hideFlags = flag;
			for (int i = 0; i < child.childCount; i++)
			{
				SetFlagsChildren(child.GetChild(i), flag);
			}
		}
	}
}
namespace ModdingForDummies.TABSSimp
{
	public abstract class Mod
	{
		private const string KEY_BASES = "bases";

		private const string KEY_UNITS = "units";

		private const string KEY_FACTIONS = "factions";

		private const string KEY_WEAPONS = "weapons";

		private const string KEY_CLOTHES = "clothes";

		private const string KEY_PROJECTILES = "projectiles";

		private const string KEY_MOVES = "moves";

		private const string KEY_EXPLOSIONS = "explosions";

		private const string KEY_ICONS = "icons";

		private const string KEY_EFFECTS = "effects";

		private const string KEY_MODELS = "models";

		private static Dictionary<string, Dictionary<string, object>> vanilla;

		private static Dictionary<string, Dictionary<string, object>> modified;

		private static GameObject pool;

		public static bool DEV_MODE { get; protected set; }

		static Mod()
		{
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Expected O, but got Unknown
			DEV_MODE = true;
			vanilla = new Dictionary<string, Dictionary<string, object>>();
			modified = new Dictionary<string, Dictionary<string, object>>();
			vanilla["bases"] = new Dictionary<string, object>();
			vanilla["units"] = new Dictionary<string, object>();
			vanilla["factions"] = new Dictionary<string, object>();
			vanilla["weapons"] = new Dictionary<string, object>();
			vanilla["clothes"] = new Dictionary<string, object>();
			vanilla["projectiles"] = new Dictionary<string, object>();
			vanilla["moves"] = new Dictionary<string, object>();
			vanilla["explosions"] = new Dictionary<string, object>();
			vanilla["icons"] = new Dictionary<string, object>();
			vanilla["effects"] = new Dictionary<string, object>();
			vanilla["models"] = new Dictionary<string, object>();
			modified["bases"] = new Dictionary<string, object>();
			modified["units"] = new Dictionary<string, object>();
			modified["factions"] = new Dictionary<string, object>();
			modified["weapons"] = new Dictionary<string, object>();
			modified["clothes"] = new Dictionary<string, object>();
			modified["projectiles"] = new Dictionary<string, object>();
			modified["moves"] = new Dictionary<string, object>();
			modified["explosions"] = new Dictionary<string, object>();
			modified["icons"] = new Dictionary<string, object>();
			modified["effects"] = new Dictionary<string, object>();
			modified["models"] = new Dictionary<string, object>();
			GameObject val = new GameObject("Pool")
			{
				hideFlags = (HideFlags)61
			};
			val.transform.position = Vector3.down * -1000f;
			pool = val;
			pool.SetActive(false);
		}

		public static GameObject PoolObject(GameObject gameObject)
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			gameObject.transform.parent = pool.transform;
			gameObject.transform.localPosition = Vector3.zero;
			pool.transform.SetHideFlagsChildren((HideFlags)61);
			return gameObject;
		}

		public static GameObject CloneAndPoolObject(GameObject obj)
		{
			GameObject val = Object.Instantiate<GameObject>(obj, pool.transform);
			PoolObject(val);
			return val;
		}

		private static M CreateObject<M>(string key, Func<string, M> query, Action<M> processClone, string name, string originalName) where M : ModdingClass<M>
		{
			M val = null;
			M val2 = query(originalName);
			if (val2 != null)
			{
				val = val2.Clone();
				processClone?.Invoke(val);
				val.Name = name;
				modified[key][name] = val;
			}
			return val;
		}

		private static M GetObject<M, R>(string key, Func<string, R> query, Func<R, M> generate, string name)
		{
			M val = default(M);
			if (modified[key].ContainsKey(name))
			{
				val = (M)modified[key][name];
			}
			else if (vanilla[key].ContainsKey(name))
			{
				val = (M)vanilla[key][name];
			}
			else
			{
				R val2 = query(name);
				if (val2 != null)
				{
					val = generate(val2);
					vanilla[key][name] = val;
				}
			}
			if (val == null)
			{
				Debug.LogError((object)("[MFD] Could not find '" + name + "' in '" + key + "'."));
			}
			return val;
		}

		public static ModUnit GetUnit(string name)
		{
			return GetObject("units", Utilities.GetUnit, (UnitBlueprint u) => new ModUnit(u), name);
		}

		public static ModUnit CreateUnit(string name, string originalName = null)
		{
			return CreateObject("units", GetUnit, delegate(ModUnit mu)
			{
				if (originalName == null)
				{
					mu.Clothes.Clear();
				}
			}, name, (originalName == null) ? "Peasant" : originalName);
		}

		public static ModFaction GetFaction(string name)
		{
			return GetObject("factions", Utilities.GetFaction, (Faction f) => new ModFaction(f), name);
		}

		public static ModFaction CreateFaction(string name, string originalName = null)
		{
			return CreateObject("factions", GetFaction, delegate(ModFaction mf)
			{
				mf.Units.Clear();
				mf.Visible = true;
			}, name, (originalName == null) ? "Base Faction" : originalName);
		}

		public static ModWeapon GetWeapon(string name)
		{
			return GetObject("weapons", Utilities.GetWeapon, (GameObject w) => new ModWeapon(w), name);
		}

		public static ModWeapon CreateWeapon(string name, string originalName)
		{
			return CreateObject("weapons", GetWeapon, null, name, originalName);
		}

		public static ModClothing GetClothing(string name)
		{
			return GetObject("clothes", Utilities.GetClothing, (GameObject c) => new ModClothing(c), name);
		}

		public static ModClothing CreateClothing(string name, string originalName)
		{
			return CreateObject("clothes", GetClothing, null, name, originalName);
		}

		public static ModMove GetMove(string name)
		{
			return GetObject("moves", Utilities.GetMove, (GameObject m) => new ModMove(m), name);
		}

		public static ModMove CreateMove(string name, string originalName)
		{
			return CreateObject("moves", GetMove, null, name, originalName);
		}

		public static ModProjectile GetProjectile(string name)
		{
			return GetObject("projectiles", Utilities.GetProjectile, (GameObject p) => new ModProjectile(p), name);
		}

		public static ModProjectile CreateProjectile(string name, string originalName)
		{
			return CreateObject("projectiles", GetProjectile, null, name, originalName);
		}

		public static ModExplosion GetExplosion(string name)
		{
			return GetObject("explosions", Utilities.GetExplosion, (GameObject e) => new ModExplosion(e), name);
		}

		public static ModExplosion CreateExplosion(string name, string originalName)
		{
			return CreateObject("explosions", GetExplosion, null, name, originalName);
		}

		public static ModEffect GetEffect(string name)
		{
			return GetObject("effects", Utilities.GetEffect, (UnitEffectBase e) => new ModEffect(e), name);
		}

		public static ModEffect CreateEffect(string name, string originalName)
		{
			return CreateObject("effects", GetEffect, null, name, originalName);
		}

		public static ModBase GetBase(string name)
		{
			return GetObject("bases", Utilities.GetUnitBase, (GameObject b) => new ModBase(b), name);
		}

		public static ModBase CreateBase(string name, string originalName)
		{
			return CreateObject("bases", GetBase, null, name, originalName);
		}

		public static ModModel GetModel(string name)
		{
			return GetObject("models", Utilities.GetModel, (GameObject m) => new ModModel(m), name);
		}

		public static ModModel CreateModel(string name, string originalName)
		{
			return CreateObject("models", GetModel, null, name, originalName);
		}

		public static Sprite GetIcon(string name)
		{
			return GetObject("icons", Utilities.GetIcon, (Sprite s) => s, name);
		}
	}
	public class ModBase : ModdingClass<ModBase>
	{
		public GameObject internalObject { get; private set; }

		public override string Name
		{
			get
			{
				return ((Object)internalObject.gameObject).name;
			}
			set
			{
				((Object)internalObject.gameObject).name = value;
			}
		}

		public override void ColorInternal(int index, Color color, float glow = 0f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Utilities.SetObjectColor(internalObject, index, color, glow);
		}

		public ModBase(GameObject unitBase)
		{
			internalObject = unitBase;
		}

		public override ModBase Clone()
		{
			GameObject unitBase = Mod.CloneAndPoolObject(internalObject);
			return new ModBase(unitBase);
		}

		public override void Separate()
		{
		}
	}
	public enum ClothingType
	{
		Static,
		Skinned
	}
	public class ModClothing : ModdingClass<ModClothing>
	{
		private PropItem item;

		private SkinnedMeshRenderer renderer;

		private ModModel model;

		public GameObject internalObject { get; private set; }

		public ClothingType Type { get; private set; }

		public override string Name
		{
			get
			{
				return ((CharacterItem)item).Entity.Name;
			}
			set
			{
				((CharacterItem)item).Entity.Name = value;
			}
		}

		public ModModel Model
		{
			get
			{
				return model;
			}
			set
			{
				//IL_0065: Unknown result type (might be due to invalid IL or missing references)
				//IL_008f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
				if (value != null)
				{
					Utilities.SetMeshRenderers(internalObject, enabled: false);
					model = value.Clone();
					if (Type == ClothingType.Static)
					{
						model.internalObject.transform.parent = internalObject.transform;
						model.internalObject.transform.localPosition = Vector3.zero;
						model.internalObject.transform.localRotation = Quaternion.Euler(-90f, 0f, 0f);
					}
					else if (Type == ClothingType.Skinned)
					{
						Utilities.PlaceMeshOnBone(renderer, model.internalObject, ((CharacterItem)item).GearT);
					}
				}
				else
				{
					if (model != null)
					{
						Utilities.SetMeshRenderers(internalObject, enabled: true);
					}
					model = null;
				}
			}
		}

		public float Size
		{
			get
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: 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)
				Vector3 localScale = internalObject.transform.localScale;
				return (localScale.x + localScale.y + localScale.z) / 3f;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				Utilities.SetClothScale(this, Vector3.one * value);
			}
		}

		public Vector3 Scale
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return internalObject.transform.localScale;
			}
			set
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				Utilities.SetClothScale(this, value);
			}
		}

		public override void ColorInternal(int index, Color color, float glow = 0f)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (model == null)
			{
				Utilities.SetObjectColor(internalObject, index, color, glow);
			}
			else
			{
				model.Color(index, color, glow);
			}
		}

		public ModClothing(GameObject prop)
		{
			internalObject = Mod.CloneAndPoolObject(prop);
			renderer = internalObject.GetComponentInChildren<SkinnedMeshRenderer>();
			Type = (((Object)(object)renderer != (Object)null) ? ClothingType.Skinned : ClothingType.Static);
			item = internalObject.GetComponentInChildren<PropItem>();
		}

		public override ModClothing Clone()
		{
			ModClothing modClothing = new ModClothing(internalObject)
			{
				Model = Model
			};
			modClothing.Separate();
			return modClothing;
		}

		public override void Separate()
		{
		}
	}
	public abstract class ModdingClass<T> where T : ModdingClass<T>
	{
		public abstract string Name { get; set; }

		public abstract T Clone();

		public abstract void Separate();

		public abstract void ColorInternal(int index, Color color, float glow = 0f);

		public void Color(Color color, float glow = 0f)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			ColorInternal(0, color, glow);
		}

		public void Color(string color, float glow = 0f)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			Color(0, Utilities.HexColor(color), glow);
		}

		public void Color(int index, Color color, float glow = 0f)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			ColorInternal(index, color, glow);
		}

		public void Color(int index, string color, float glow = 0f)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			Color(index, Utilities.HexColor(color), glow);
		}

		public void Colors(params Color[] colors)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < colors.Length; i++)
			{
				Color(i, colors[i]);
			}
		}

		public void Colors(params string[] colors)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < colors.Length; i++)
			{
				Color(i, Utilities.HexColor(colors[i]));
			}
		}

		public void Colors(params (Color color, float glow)[] colors)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < colors.Length; i++)
			{
				Color(i, colors[i].color, colors[i].glow);
			}
		}

		public void Colors(params (string color, float glow)[] colors)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < colors.Length; i++)
			{
				Color(i, Utilities.HexColor(colors[i].color), colors[i].glow);
			}
		}
	}
	public class ModEffect : ModdingClass<ModEffect>
	{
		public UnitEffectBase internalObject { get; private set; }

		public override string Name
		{
			get
			{
				return ((Object)((Component)internalObject).gameObject).name;
			}
			set
			{
				((Object)((Component)internalObject).gameObject).name = value;
			}
		}

		public override void ColorInternal(int index, Color color, float glow = 0f)
		{
		}

		public ModEffect(UnitEffectBase effect)
		{
			internalObject = effect;
		}

		public override ModEffect Clone()
		{
			GameObject val = Mod.CloneAndPoolObject(((Component)internalObject).gameObject);
			return new ModEffect(val.GetComponent<UnitEffectBase>());
		}

		public override void Separate()
		{
		}
	}
	public class ModExplosion : ModdingClass<ModExplosion>
	{
		private Explosion explosion;

		private ExplosionAddEffect addEffect;

		private ModEffect effect;

		public GameObject internalObject { get; private set; }

		public override string Name
		{
			get
			{
				return ((Object)internalObject).name;
			}
			set
			{
				((Object)internalObject).name = value;
			}
		}

		public float Damage
		{
			get
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					return explosion.damage;
				}
				return 0f;
			}
			set
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					explosion.damage = value;
				}
			}
		}

		public float Force
		{
			get
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					return explosion.force;
				}
				return 0f;
			}
			set
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					explosion.force = value;
				}
			}
		}

		public ForceDirection ForceDirection
		{
			get
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_001b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0022: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)explosion))
				{
					return explosion.forceDirection;
				}
				return (ForceDirection)0;
			}
			set
			{
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)explosion))
				{
					explosion.forceDirection = value;
				}
			}
		}

		public float Radius
		{
			get
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					return explosion.radius;
				}
				return 0f;
			}
			set
			{
				if (Object.op_Implicit((Object)(object)explosion))
				{
					explosion.radius = value;
				}
			}
		}

		public ModEffect Effect
		{
			get
			{
				return effect;
			}
			set
			{
				effect = value;
				if (!Object.op_Implicit((Object)(object)addEffect))
				{
					addEffect = internalObject.AddComponent<ExplosionAddEffect>();
				}
				if (value != null)
				{
					addEffect.EffectPrefab = value.internalObject;
				}
				else
				{
					addEffect.EffectPrefab = null;
				}
			}
		}

		public float Size
		{
			get
			{
				//IL_000c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0018: 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)
				Vector3 localScale = internalObject.transform.localScale;
				return (localScale.x + localScale.y + localScale.z) / 3f;
			}
			set
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Unknown result type (might be due to invalid IL or missing references)
				internalObject.transform.localScale = Vector3.one * value;
			}
		}

		public Vector3 Scale
		{
			get
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				return internalObject.transform.localScale;
			}
			set
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				internalObject.transform.localScale = value;
			}
		}

		public override void ColorInternal(int index, Color color, float glow = 0f)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			Utilities.SetObjectColor(internalObject, index, color, glow);
		}

		public ModExplosion(GameObject explosionObject)
		{
			internalObject = explosionObject;
			explosion = internalObject.GetComponentInChildren<Explosion>();
			addEffect = internalObject.GetComponentInChildren<ExplosionAddEffect>();
		}

		public override ModExplosion Clone()
		{
			GameObject explosionObject = Mod.CloneAndPoolObject(internalObject);
			ModExplosion modExplosion = new ModExplosion(explosionObject);
			if (Effect != null)
			{
				modExplosion.Effect = Effect;
			}
			return modExplosion;
		}

		public override void Separate()
		{
			if (Effect != null)
			{
				Effect = Effect.Clone();
			}
		}
	}
	public class ModFaction : ModdingClass<ModFaction>
	{
		public Faction internalObject { get; private set; }

		public WrapperDelineation<ModUnit> Units { get; private set; }

		public UnitBlueprint[] Blueprints => Units.List.Select((ModUnit w) => w.internalObject).ToArray();

		public override string Name
		{
			get
			{
				return internalObject.Entity.Name;
			}
			set
			{
				internalObject.Entity.Name = value;
			}
		}

		public bool Visible
		{
			get
			{
				return internalObject.m_displayFaction;
			}
			set
			{
				internalObject.m_displayFaction = value;
			}
		}

		public Sprite Icon
		{
			get
			{
				return internalObject.Entity.SpriteIcon;
			}
			set
			{
				internalObject.Entity.SetSpriteIcon(value);
			}
		}

		private void UpdateBlueprints(List<ModUnit> units)
		{
			internalObject.Units = (from ModUnit unit in units
				select unit.internalObject).ToArray();
		}

		public ModUnit NewUnit(string name, string originalName = null)
		{
			ModUnit modUnit = Mod.CreateUnit(name, originalName);
			Units.Add(modUnit);
			return modUnit;
		}

		public override void ColorInternal(int index, Color color, float glow = 0f)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			internalObject.m_FactionColor = color;
		}

		public ModFaction(Faction faction)
		{
			internalObject = faction;
			Units = new WrapperDelineation<ModUnit>(UpdateBlueprints, Mod.GetUnit)
			{
				List = (from UnitBlueprint blueprint in internalObject.Units
					select new ModUnit(blueprint)).ToList()
			};
		}

		public override ModFaction Clone()
		{
			Faction val = Object.Instantiate<Faction>(internalObject);
			val.Entity.GenerateNewID();
			val.Entity.Name = Utilities.IncrementName(Name);
			val.Units = Array.Empty<UnitBlueprint>();
			val.index = Utilities.database.GetFactions().ToList().Count;
			Utilities.AddFactionToDatabase(val);
			ModFaction modFaction = new ModFaction(val);
			modFaction.Separate();
			return modFaction;
		}

		public override void Separate()
		{
			Units.List = (from ModUnit unit in Units.List
				select unit.Clone()).ToList();
		}
	}
	public class ModModel : ModdingClass<ModModel>
	{
		private Vector3 position;

		private Quaternion rotation;

		public GameObject internalObject { get; private set; }

		public override string Name
		{
			get
			{
				return ((Object)internalObject.gameObject).name;
			}
			set
			{
				((Object)internalObject.gameObject).name = value;
			}
		}

		public Vector3 Position
		{
			get
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				return position;
			}
			set
			{
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				position = value;
				internalObject.transform.localPosition = position;
			}
		}

		public Quaternion Rotation
		{
			get
			{
				//IL_0001: Unknown result type (might