Decompiled source of ChouChou s Unit v0.1.1

ChouChou's Units-part2.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using DARK;
using DM;
using FhpSLib.BundleModCore;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI;
using Landfall.TABS.AI.Components;
using Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.AI.Components.Tags;
using Landfall.TABS.AI.Systems;
using Landfall.TABS.GameMode;
using Landfall.TABS.GameState;
using Landfall.TABS.UnitEditor;
using Photon.Bolt;
using SLMA;
using TFBGames;
using Unity.Entities;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("fixmod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("made in SFT by FhpSlime")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace DARK
{
	public static class UManager
	{
		public static string modname;

		public static string modder;

		private static string com;

		public static SLMABundleMod bundleMod;

		public static List<Unit> bases;

		public static SLMABundleMod bundleMod2;

		public static SLMABundleMod bundleMod3;

		public static SLMABundleMod bundleMod4;

		static UManager()
		{
			modname = "SFT";
			modder = "FhpSlime";
			bases = new List<Unit>();
		}

		public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
		{
			s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
		}

		public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
			//IL_0309: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: Expected O, but got Unknown
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Expected O, but got Unknown
			//IL_0727: Unknown result type (might be due to invalid IL or missing references)
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c8: Expected O, but got Unknown
			//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Expected O, but got Unknown
			//IL_0804: 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_082b: Expected O, but got Unknown
			//IL_0846: Unknown result type (might be due to invalid IL or missing references)
			//IL_084c: Expected O, but got Unknown
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Expected O, but got Unknown
			//IL_0930: Unknown result type (might be due to invalid IL or missing references)
			//IL_0936: Unknown result type (might be due to invalid IL or missing references)
			if (unit.Entity.Name == "瘟疫医生")
			{
				unit.voiceBundle = bundleMod.GetAssetBundle("dark").LoadAsset<VoiceBundle>("doctor_VoiceBundle 2");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)unit.voiceBundle.DeathRef);
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)unit.voiceBundle.VocalRef);
				unit.UnitBase = bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("Humanoid 1");
				unit.health = 666f;
				unit.maxSizeRandom = 1f;
				unit.minSizeRandom = 1f;
				unit.forceCost = 3000u;
				unit.Entity.SetUnlockKey("darkon");
				unit.Validate();
				unit.sizeMultiplier = 1f;
				unit.RightWeapon = bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("手杖");
				unit.LeftWeapon = bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("提灯");
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[3]
				{
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("瘟疫召唤"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("黑雾"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("黑雾 1")
				});
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[7]
				{
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生上衣"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生帽子"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生披肩"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生腰带"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生裤子"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生面具"),
					bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("医生鞋子")
				});
			}
			if (unit.Entity.Name == "火枪矮人")
			{
				unit.voiceBundle = bundleMod2.GetAssetBundle("airen").LoadAsset<VoiceBundle>("矮人Voice 1");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)unit.voiceBundle.DeathRef);
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)unit.voiceBundle.VocalRef);
				unit.UnitBase = bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人体型 211");
				unit.sizeMultiplier = 1.2f;
				unit.health = 120f;
				unit.forceCost = 500u;
				unit.Entity.SetUnlockKey("airengun");
				unit.holdinigWithTwoHands = true;
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
				unit.movementSpeedMuiltiplier = 1.2f;
				unit.massMultiplier = 10f;
				unit.Validate();
				((Weapon)bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("Musket_Bayonet_v2_1 Weapons_VB 1").GetComponent<RangeWeapon>()).internalCooldown = 8f;
				unit.RightWeapon = bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("Musket_Bayonet_v2_1 Weapons_VB 1");
				GameObject obj = UPool.MyPool.AddObject("浮空", (GameObject)SLMALoader.SDic["moves"]["Wings_Leg_SuperP"], true, (HideFlags)52, (Sprite)null, 0, false);
				obj.GetComponentInChildren<Wings>().heightVariance = 0f;
				obj.GetComponentInChildren<Wings>().flightForce = -30f;
				obj.GetComponentInChildren<Wings>().variationSpeed = 0f;
				obj.GetComponentInChildren<Wings>().headM = 0f;
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[2]
				{
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("Move_Jarl_Enrage 1"),
					(GameObject)SLMALoader.SDic["moves"]["Fencer_Dodge"]
				});
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[8]
				{
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人上衣"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人下摆"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人头盔"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人小腿甲"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人小臂甲"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人胡子"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人胸甲"),
					bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("矮人裤子")
				});
			}
			if (unit.Entity.Name == "天灾")
			{
				bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("天灾").AddComponent<Cleareffect>();
				unit.voiceBundle = bundleMod4.GetAssetBundle("tianzai").LoadAsset<VoiceBundle>("天灾Voice 2");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)unit.voiceBundle.DeathRef);
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)unit.voiceBundle.VocalRef);
				unit.forceCost = 5000u;
				unit.massMultiplier = 200f;
				unit.health = 10000f;
				unit.sizeMultiplier = 1f;
				unit.targetingPriorityMultiplier = 10f;
				unit.Entity.SetUnlockKey("tianzai");
				unit.Validate();
				unit.RightWeapon = bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("MinoTaurGrab_1 Weapons_VB 2");
				unit.LeftWeapon = bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("MinoTaurGrab_1 Weapons_VB 5");
				unit.UnitBase = bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("天灾");
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[3]
				{
					bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("地刺"),
					bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("旋转投"),
					bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("Move_Jarl_Enrage 3")
				});
			}
			if (unit.Entity.Name == "燃烧爆炸桶")
			{
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Pirate Attack Vocals/Thrower_Bomb");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Pirate Death Vocals/Thrower_Bomb");
				s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Small");
				s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)1.3f);
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
				unit.targetingPriorityMultiplier = 3f;
				unit.Entity.SetUnlockKey("huo1");
				unit.Validate();
				unit.forceCost = 500u;
				unit.RightWeapon = null;
				unit.holdinigWithTwoHands = false;
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[1] { bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("燃烧桶") });
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[7]
				{
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Scarf001"],
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Belt002"],
					(GameObject)SLMALoader.SDic["clothes"]["pirate_Queen_armbands001"],
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Jacket001"],
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Pants001"],
					(GameObject)SLMALoader.SDic["clothes"]["Pirate_Shoes003"],
					bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("火刀头")
				});
			}
			if (unit.Entity.Name == "火伊布")
			{
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Fantasy Dark Attack Vocals/DarkKingHuman");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Fantasy Dark Death Vocals/DarkKingHuman");
				s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Small");
				s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)1.3f);
				unit.Entity.SetUnlockKey("huo2");
				unit.Validate();
				bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("火伊布").AddComponent<ClearFire>();
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
				unit.health = 200f;
				unit.forceCost = 600u;
				unit.holdinigWithTwoHands = false;
				((Weapon)bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("地狱火球2").GetComponent<RangeWeapon>()).internalCooldown = 9f;
				unit.RightWeapon = bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("地狱火球2");
				unit.LeftWeapon = bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("地狱火球2");
				unit.UnitBase = bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("火伊布");
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[0]);
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[1] { bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("DragonPunch 1") });
			}
		}

		public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
		{
		}

		public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
		{
		}

		public static void Init(LandfallContentDatabase db)
		{
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_033b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0382: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Expected O, but got Unknown
			//IL_03c3: Expected O, but got Unknown
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Expected O, but got Unknown
			//IL_0423: Expected O, but got Unknown
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0460: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: Expected O, but got Unknown
			//IL_0483: Expected O, but got Unknown
			//IL_04a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Expected O, but got Unknown
			//IL_04e3: Expected O, but got Unknown
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0543: Expected O, but got Unknown
			//IL_0543: Expected O, but got Unknown
			com = "Bundle Mod Init";
			com = "Bundle Mod Init";
			AssetBundle val;
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("tianzai"))
			{
				val = AssetBundle.LoadFromStream(stream);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj = SLMABundleMod.CreatSLMABundleMod("TestMod4", "0.0.4");
				obj.AddAssetBundle("tianzai", val);
				obj.Dev_mode = true;
				obj.LoadAssetBundle("tianzai");
				bundleMod4 = obj;
			}
			AssetBundle val2;
			using (Stream stream2 = Assembly.GetExecutingAssembly().GetManifestResourceStream("dark"))
			{
				val2 = AssetBundle.LoadFromStream(stream2);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj2 = SLMABundleMod.CreatSLMABundleMod("TestMod", "0.0.1");
				obj2.AddAssetBundle("dark", val2);
				obj2.Dev_mode = true;
				obj2.LoadAssetBundle("dark");
				bundleMod = obj2;
			}
			AssetBundle val3;
			using (Stream stream3 = Assembly.GetExecutingAssembly().GetManifestResourceStream("airen"))
			{
				val3 = AssetBundle.LoadFromStream(stream3);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj3 = SLMABundleMod.CreatSLMABundleMod("TestMod2", "0.0.2");
				obj3.AddAssetBundle("airen", val3);
				obj3.Dev_mode = true;
				obj3.LoadAssetBundle("airen");
				bundleMod2 = obj3;
			}
			AssetBundle val4;
			using (Stream stream4 = Assembly.GetExecutingAssembly().GetManifestResourceStream("huo"))
			{
				val4 = AssetBundle.LoadFromStream(stream4);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj4 = SLMABundleMod.CreatSLMABundleMod("TestMod5", "0.0.4");
				obj4.AddAssetBundle("huo", val4);
				obj4.Dev_mode = true;
				obj4.LoadAssetBundle("huo");
				bundleMod3 = obj4;
			}
			SoundBank[] array = val3.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj5 in array)
			{
				SoundBank soundBank = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list = soundBank.Categories.ToList();
				SoundBankCategory[] categories = obj5.Categories;
				foreach (SoundBankCategory item in categories)
				{
					list.Add(item);
				}
				soundBank.Categories = list.ToArray();
			}
			array = val.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj6 in array)
			{
				SoundBank soundBank2 = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list2 = soundBank2.Categories.ToList();
				SoundBankCategory[] categories = obj6.Categories;
				foreach (SoundBankCategory item2 in categories)
				{
					list2.Add(item2);
				}
				soundBank2.Categories = list2.ToArray();
			}
			SoundBank soundBank3 = ServiceLocator.GetService<SoundPlayer>().soundBank;
			SoundBank[] array2 = bundleMod.GetAssetBundle("dark").LoadAllAssets<SoundBank>();
			if (array2 != null)
			{
				List<SoundBankCategory> list3 = soundBank3.Categories.ToList();
				array = array2;
				foreach (SoundBank val5 in array)
				{
					if ((Object)(object)val5 != (Object)null)
					{
						list3.AddRange(val5.Categories);
					}
				}
				soundBank3.Categories = list3.ToArray();
			}
			VoiceBundle[] array3 = bundleMod.GetAssetBundle("dark").LoadAllAssets<VoiceBundle>();
			if (array3 != null && array3.Length != 0)
			{
				VoiceBundleDatabaseUpdater.AddVoiceBundles(array3.ToList());
			}
			else
			{
				Debug.LogError((object)"No VoiceBundle found in the loaded AssetBundle.");
			}
			new GameObject
			{
				name = "MapsCore",
				hideFlags = (HideFlags)52
			}.AddComponent<ScenesManager>();
			bundleMod.GetAssetBundle("dark").LoadAllAssets<VoiceBundle>();
			MyModItems.GetInstance();
			SLMATool.CreateUnit("瘟疫医生", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_THROWER_SPEAR"], (Faction)SLMALoader.SDic["factions"]["Secret"], bundleMod.GetAssetBundle("dark").LoadAsset<Sprite>("瘟疫医生图标2"));
			SLMATool.CreateUnit("火枪矮人", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], (Faction)SLMALoader.SDic["factions"]["Secret"], bundleMod2.GetAssetBundle("airen").LoadAsset<Sprite>("火枪矮人icon"));
			SLMATool.CreateUnit("天灾", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"], (Faction)SLMALoader.SDic["factions"]["Secret"], bundleMod4.GetAssetBundle("tianzai").LoadAsset<Sprite>("天灾icon"));
			SLMATool.CreateUnit("燃烧爆炸桶", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], (Faction)SLMALoader.SDic["factions"]["Secret"], bundleMod3.GetAssetBundle("huo").LoadAsset<Sprite>("火焰爆炸桶icon"));
			SLMATool.CreateUnit("火伊布", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], (Faction)SLMALoader.SDic["factions"]["Secret"], bundleMod3.GetAssetBundle("huo").LoadAsset<Sprite>("小恶魔icon"));
			com = "——————————Fations and Units——————————";
			com = "——————————Clothes——————————";
			com = "——————————Weapons——————————";
			com = "——————————Effects——————————";
			com = "——————————Explosions——————————";
			com = "——————————UnitBases——————————";
			com = "——————————Projectiles——————————";
			com = "——————————Moves——————————";
		}

		public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
		}

		public static void SetMoveConditionalValue(this ConditionalEventInstance gameObject, ConditionType type, ValueType valuet, float value)
		{
			//IL_0012: 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)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			bool flag = false;
			EventCondition[] conditions = gameObject.conditions;
			foreach (EventCondition val in conditions)
			{
				if (val.conditionType == type)
				{
					val.valueType = valuet;
					val.value = value;
					flag = true;
				}
			}
			if (!flag)
			{
				List<EventCondition> list = gameObject.conditions.ToList();
				list.Add(new EventCondition
				{
					conditionType = type,
					valueType = valuet,
					value = value
				});
				gameObject.conditions = list.ToArray();
			}
		}
	}
	[BepInPlugin("dark", "dark", "1.0.0")]
	internal class Loader : BaseUnityPlugin
	{
		public static bool BundleMode;

		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("call");
		}

		private IEnumerator call()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony(UManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				UManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
			Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime"));
			Debug.Log((object)(UManager.modder + "wished you a pleasant trip"));
		}

		static Loader()
		{
			BundleMode = true;
		}
	}
}
public class Item : MonoBehaviour
{
	public enum kind
	{
		Weapon,
		Cloth,
		Skill,
		Unit,
		Projectile,
		Other
	}

	public string name;

	public kind Kind;
}
namespace DARK
{
	public class MyModItems : MonoBehaviour
	{
		private static Dictionary<string, Item> items;

		private static MyModItems instance { get; set; }

		public static MyModItems GetInstance()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)instance == (Object)null)
			{
				instance = new GameObject("MyModItems").AddComponent<MyModItems>();
				Object.DontDestroyOnLoad((Object)(object)instance);
			}
			return instance;
		}

		public void AddItem(Item item)
		{
			items.Add(item.name, item);
		}

		public Item GetItem(string name)
		{
			Item value = new Item
			{
				name = null,
				Kind = Item.kind.Other
			};
			items.TryGetValue(name, out value);
			return value;
		}
	}
}
public class Example : MonoBehaviour
{
	public GameObject prefab;

	private void Start()
	{
		if ((Object)(object)prefab != (Object)null)
		{
			Transform[] componentsInChildren = prefab.GetComponentsInChildren<Transform>();
			if (componentsInChildren.Length > 1)
			{
				_ = componentsInChildren[1];
			}
		}
	}
}
public class VoiceBundleDatabaseUpdater
{
	public static void AddVoiceBundles(IEnumerable<VoiceBundle> newVoiceBundles)
	{
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
		FieldInfo field = typeof(LandfallContentDatabase).GetField("m_voiceBundles", BindingFlags.Instance | BindingFlags.NonPublic);
		if (field == null)
		{
			Debug.LogError((object)"m_voiceBundles field not found.");
			return;
		}
		Dictionary<DatabaseID, VoiceBundle> voiceBundlesDictionary = (Dictionary<DatabaseID, VoiceBundle>)field.GetValue(landfallContentDatabase);
		if (voiceBundlesDictionary == null)
		{
			Debug.LogError((object)"m_voiceBundles dictionary is null.");
			return;
		}
		Func<VoiceBundle, bool> predicate = (VoiceBundle voiceBundle) => Object.op_Implicit((Object)(object)voiceBundle) && voiceBundlesDictionary != null && !voiceBundlesDictionary.ContainsKey(voiceBundle.Entity.GUID);
		foreach (VoiceBundle item in newVoiceBundles.Where(predicate))
		{
			voiceBundlesDictionary.Add(item.Entity.GUID, item);
		}
		field.SetValue(landfallContentDatabase, voiceBundlesDictionary);
		Debug.Log((object)$"{newVoiceBundles.Count()} VoiceBundles added to the database.");
	}
}
public class ChangeMaterial : MonoBehaviour
{
	private List<Material> originalMaterials = new List<Material>();

	private Team team;

	[Header("Material Settings")]
	public Renderer renderer;

	public int index;

	public Material newMaterial;

	[Header("Team Color Settings")]
	public Material redMaterial;

	public Material blueMaterial;

	public void Start()
	{
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_007e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		Material[] materials = renderer.materials;
		foreach (Material val in materials)
		{
			originalMaterials.Add(Object.Instantiate<Material>(val));
		}
		Unit component = ((Component)((Component)this).transform.root).GetComponent<Unit>();
		TeamHolder component2 = ((Component)this).GetComponent<TeamHolder>();
		TeamHolder componentInParent = ((Component)this).GetComponentInParent<TeamHolder>();
		TeamHolder componentInChildren = ((Component)this).GetComponentInChildren<TeamHolder>();
		if (Object.op_Implicit((Object)(object)component))
		{
			team = component.Team;
		}
		else if (Object.op_Implicit((Object)(object)component2))
		{
			team = component2.team;
		}
		else if (Object.op_Implicit((Object)(object)componentInParent))
		{
			team = componentInParent.team;
		}
		else if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			team = componentInChildren.team;
		}
	}

	public void MaterialChange(float speed)
	{
		((MonoBehaviour)this).StartCoroutine(DoMaterialChange(index, Object.Instantiate<Material>(renderer.materials[index]), newMaterial, speed));
	}

	public void MaterialRevert(float speed)
	{
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine(DoMaterialChange(index, newMaterial, originalMaterials[index], speed));
	}

	public void MaterialTeamChange(float speed)
	{
		//IL_0026: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine(DoMaterialChange(index, Object.Instantiate<Material>(renderer.materials[index]), ((int)team == 0) ? redMaterial : blueMaterial, speed));
	}

	public void MaterialTeamRevert(float speed)
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StopAllCoroutines();
		((MonoBehaviour)this).StartCoroutine(DoMaterialChange(index, ((int)team == 0) ? redMaterial : blueMaterial, originalMaterials[index], speed));
	}

	public void AllMaterialsChange(float speed)
	{
		((MonoBehaviour)this).StopAllCoroutines();
		for (int i = 0; i < renderer.materials.Length; i++)
		{
			((MonoBehaviour)this).StartCoroutine(DoMaterialChange(i, Object.Instantiate<Material>(renderer.materials[i]), newMaterial, speed));
		}
	}

	public void AllMaterialsRevert(float speed)
	{
		((MonoBehaviour)this).StopAllCoroutines();
		for (int i = 0; i < renderer.materials.Length; i++)
		{
			((MonoBehaviour)this).StartCoroutine(DoMaterialChange(i, newMaterial, originalMaterials[i], speed));
		}
	}

	public void AllMaterialsTeamChange(float speed)
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StopAllCoroutines();
		for (int i = 0; i < renderer.materials.Length; i++)
		{
			((MonoBehaviour)this).StartCoroutine(DoMaterialChange(i, Object.Instantiate<Material>(renderer.materials[i]), ((int)team == 0) ? redMaterial : blueMaterial, speed));
		}
	}

	public void AllMaterialsTeamRevert(float speed)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StopAllCoroutines();
		for (int i = 0; i < renderer.materials.Length; i++)
		{
			((MonoBehaviour)this).StartCoroutine(DoMaterialChange(i, ((int)team == 0) ? redMaterial : blueMaterial, originalMaterials[i], speed));
		}
	}

	public void Stop()
	{
		((MonoBehaviour)this).StopAllCoroutines();
	}

	private IEnumerator DoMaterialChange(int indexToLerp, Material materialToStartWith, Material matToLerpTo, float lerpSpeed)
	{
		float t = 0f;
		while (t < 1f && !Object.op_Implicit((Object)(object)((Component)((Component)this).transform.root).GetComponentsInChildren<UnitEffectBase>().ToList().Find((UnitEffectBase x) => x.effectID == 1987)))
		{
			t += Time.deltaTime * lerpSpeed;
			renderer.materials[indexToLerp].Lerp(materialToStartWith, matToLerpTo, Mathf.Clamp(t, 0f, 1f));
			yield return null;
		}
	}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class DeathPatch
{
	[HarmonyPrefix]
	public static bool Prefix(DataHandler __instance, ref bool value)
	{
		if (value && !(bool)GetField(typeof(DataHandler), __instance, "dead"))
		{
			GameModeService service = ServiceLocator.GetService<GameModeService>();
			if (service.CurrentGameMode == null)
			{
				Debug.LogError((object)"Could not find CurrentGameMode!");
			}
			else if (!__instance.healthHandler.willBeRewived)
			{
				service.CurrentGameMode.OnUnitDied(__instance.unit);
			}
		}
		SetField(__instance, "dead", value);
		return false;
	}

	public static object GetField(Type type, object instance, string fieldName)
	{
		BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
		return type.GetField(fieldName, bindingAttr).GetValue(instance);
	}

	public static void SetField<T>(object originalObject, string fieldName, T newValue)
	{
		BindingFlags bindingAttr = BindingFlags.Instance | BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic;
		originalObject.GetType().GetField(fieldName, bindingAttr).SetValue(originalObject, newValue);
	}
}
public class Effect_Plague : UnitEffectBase
{
	public enum ZombificationType
	{
		Standard,
		Virus,
		Support
	}

	private Unit unit;

	private GameObject weapon1;

	private GameObject weapon2;

	private bool done;

	[Header("Zombification")]
	public ZombificationType zombieType;

	private float currentProgress;

	public float progressToAdd = 100f;

	[Header("Revive")]
	public UnityEvent reviveEvent;

	public float reviveDelay;

	[Range(0f, 1f)]
	public float reviveHealthMultiplier = 0.5f;

	public float reviveTargetingPriority = 0.2f;

	public GameObject reviveWeapon;

	public List<GameObject> reviveAbilities = new List<GameObject>();

	public GameObject reviveEye;

	public GameObject zombieStats;

	[Header("Color")]
	public UnitColorInstance color = new UnitColorInstance();

	private float lerpProgress;

	public float lerpSpeed = 1f;

	public override void DoEffect()
	{
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0150: Invalid comparison between Unknown and I4
		unit = ((Component)((Component)this).transform.root).GetComponent<Unit>();
		if (Object.op_Implicit((Object)(object)unit.holdingHandler))
		{
			weapon1 = (Object.op_Implicit((Object)(object)unit.holdingHandler.rightObject) ? ((Component)unit.holdingHandler.rightObject).gameObject : null);
			weapon2 = (Object.op_Implicit((Object)(object)unit.holdingHandler.leftObject) ? ((Component)unit.holdingHandler.leftObject).gameObject : null);
			if (zombieType != ZombificationType.Virus)
			{
				if (Object.op_Implicit((Object)(object)weapon1) && Object.op_Implicit((Object)(object)weapon1.GetComponent<Holdable>()))
				{
					weapon1.GetComponent<Holdable>().ignoreDissarm = true;
				}
				if (Object.op_Implicit((Object)(object)weapon2) && Object.op_Implicit((Object)(object)weapon2.GetComponent<Holdable>()))
				{
					weapon2.GetComponent<Holdable>().ignoreDissarm = true;
				}
			}
		}
		UnitEffectBase val = ((Component)unit).GetComponentsInChildren<UnitEffectBase>().ToList().Find((UnitEffectBase x) => x.effectID == 1984);
		if ((Object.op_Implicit((Object)(object)val) && (Object)(object)val != (Object)(object)this) || (int)unit.unitType == 1)
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
			unit.data.healthHandler.RemoveDieAction((Action)Revive);
		}
		else
		{
			unit.data.healthHandler.AddDieAction((Action)Revive);
		}
		((UnitEffectBase)this).Ping();
	}

	public override void Ping()
	{
		if (!done)
		{
			currentProgress += Mathf.Clamp(progressToAdd / unit.data.health, 0f, 1f);
			if (zombieType != ZombificationType.Support)
			{
				AddLerpProgress();
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(DoZombieChecks());
			}
		}
	}

	public void AddLerpProgress()
	{
		if (!done || zombieType == ZombificationType.Support)
		{
			((MonoBehaviour)this).StopCoroutine(DoLerp());
			((MonoBehaviour)this).StartCoroutine(DoLerp());
		}
	}

	public IEnumerator DoLerp()
	{
		if (!done || zombieType == ZombificationType.Support)
		{
			float c = 0f;
			float startProgress = lerpProgress;
			while (c < 1f)
			{
				c += Mathf.Clamp(Time.deltaTime * lerpSpeed, 0f, 1f);
				lerpProgress = Mathf.Lerp(startProgress, currentProgress, c);
				yield return null;
			}
			((MonoBehaviour)this).StartCoroutine(DoZombieChecks());
		}
	}

	public IEnumerator DoZombieChecks()
	{
		if (done)
		{
			yield break;
		}
		yield return (object)new WaitForEndOfFrame();
		if (done)
		{
			yield break;
		}
		if (currentProgress >= 0.5f)
		{
			unit.data.healthHandler.willBeRewived = true;
			if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<AddRigidbodyOnDeath>()))
			{
				AddRigidbodyOnDeath[] componentsInChildren = ((Component)unit).GetComponentsInChildren<AddRigidbodyOnDeath>();
				foreach (AddRigidbodyOnDeath val in componentsInChildren)
				{
					unit.data.healthHandler.RemoveDieAction((Action)val.Die);
					Object.Destroy((Object)(object)val);
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<SinkOnDeath>()))
			{
				SinkOnDeath[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren<SinkOnDeath>();
				foreach (SinkOnDeath val2 in componentsInChildren2)
				{
					unit.data.healthHandler.RemoveDieAction((Action)val2.Sink);
					Object.Destroy((Object)(object)val2);
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<RemoveJointsOnDeath>()))
			{
				RemoveJointsOnDeath[] componentsInChildren3 = ((Component)unit).GetComponentsInChildren<RemoveJointsOnDeath>();
				foreach (RemoveJointsOnDeath val3 in componentsInChildren3)
				{
					unit.data.healthHandler.RemoveDieAction((Action)val3.Die);
					Object.Destroy((Object)(object)val3);
				}
			}
			if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<DisableAllSkinnedClothes>()))
			{
				DisableAllSkinnedClothes[] componentsInChildren4 = ((Component)unit).GetComponentsInChildren<DisableAllSkinnedClothes>();
				for (int j = 0; j < componentsInChildren4.Length; j++)
				{
					Object.Destroy((Object)(object)componentsInChildren4[j]);
				}
			}
		}
		if (currentProgress >= 1f && zombieType != ZombificationType.Support)
		{
			((Damagable)unit.data.healthHandler).TakeDamage(unit.data.maxHealth, Vector3.zero, unit, (DamageType)3);
		}
	}

	public void Revive()
	{
		if (!done && unit.data.healthHandler.willBeRewived)
		{
			done = true;
			((MonoBehaviour)this).StartCoroutine(DoRevive());
		}
	}

	public IEnumerator DoRevive()
	{
		ServiceLocator.GetService<GameModeService>().CurrentGameMode.OnUnitDied(unit);
		Team newTeam = ((zombieType != ZombificationType.Support) ? ((Team)(((int)unit.data.team == 0) ? 1 : 0)) : unit.data.team);
		unit.data.team = newTeam;
		unit.Team = newTeam;
		unit.targetingPriorityMultiplier = reviveTargetingPriority;
		GameObjectEntity component = ((Component)unit).GetComponent<GameObjectEntity>();
		component.EntityManager.RemoveComponent<IsDead>(component.Entity);
		component.EntityManager.AddComponent(component.Entity, ComponentType.Create<UnitTag>());
		component.EntityManager.SetSharedComponentData<Team>(component.Entity, new Team
		{
			Value = (int)unit.Team
		});
		World.Active.GetOrCreateManager<TeamSystem>().AddUnit(component.Entity, ((Component)unit).gameObject, ((Component)unit).transform, unit.data.mainRig, unit.data, newTeam, unit, false);
		if (zombieType == ZombificationType.Support)
		{
			AddLerpProgress();
		}
		yield return (object)new WaitForSeconds(reviveDelay);
		unit.data.Dead = false;
		unit.dead = false;
		unit.data.hasBeenRevived = true;
		unit.data.healthHandler.willBeRewived = false;
		unit.data.ragdollControl = 1f;
		s.SetField<UnitBlueprint>(unit.unitBlueprint, "VocalRef", (object)"Fantasy Dark Attack Vocals/DarkKingHuman");
		s.SetField<UnitBlueprint>(unit.unitBlueprint, "DeathRef", (object)"Fantasy Dark Death Vocals/DarkKingHuman");
		unit.data.muscleControl = 1f;
		unit.data.health = unit.data.maxHealth * reviveHealthMultiplier;
		if (zombieType == ZombificationType.Virus)
		{
			if (Object.op_Implicit((Object)(object)unit.holdingHandler))
			{
				if (Object.op_Implicit((Object)(object)weapon1))
				{
					weapon1.AddComponent<RemoveAfterSeconds>().shrink = true;
				}
				if (Object.op_Implicit((Object)(object)weapon2))
				{
					weapon1.AddComponent<RemoveAfterSeconds>().shrink = true;
				}
				unit.holdingHandler.LetGoOfAll();
				unit.unitBlueprint.SetWeapon(unit, newTeam, reviveWeapon, new PropItemData(), (HandType)0, unit.data.mainRig.rotation, new List<GameObject>(), false);
				unit.unitBlueprint.SetWeapon(unit, newTeam, reviveWeapon, new PropItemData(), (HandType)1, unit.data.mainRig.rotation, new List<GameObject>(), false);
			}
		}
		else
		{
			if (Object.op_Implicit((Object)(object)weapon1) && Object.op_Implicit((Object)(object)weapon1.GetComponent<Holdable>()))
			{
				weapon1.GetComponent<Holdable>().ignoreDissarm = false;
			}
			if (Object.op_Implicit((Object)(object)weapon2) && Object.op_Implicit((Object)(object)weapon2.GetComponent<Holdable>()))
			{
				weapon2.GetComponent<Holdable>().ignoreDissarm = false;
			}
		}
		foreach (GameObject reviveAbility in reviveAbilities)
		{
			Object.Instantiate<GameObject>(reviveAbility, ((Component)unit).transform.position, ((Component)unit).transform.rotation, ((Component)unit).transform);
		}
		if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<TeamColor>()))
		{
			TeamColor[] componentsInChildren = ((Component)unit).GetComponentsInChildren<TeamColor>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].SetTeamColor(newTeam);
			}
		}
		if (Object.op_Implicit((Object)(object)((Component)unit.data).GetComponent<StandingHandler>()) && (((Object)unit).name.Contains("Humanoid") || ((Object)unit).name.Contains("Stiffy") || ((Object)unit).name.Contains("Blackbeard") || ((Object)unit).name.Contains("Halfling")))
		{
			RandomCharacterStats obj = ((Component)unit.data).gameObject.AddComponent<RandomCharacterStats>();
			obj.minStandingOffset = zombieStats.GetComponent<RandomCharacterStats>().minStandingOffset;
			obj.maxStandingOffset = zombieStats.GetComponent<RandomCharacterStats>().maxStandingOffset;
			obj.minMovement = zombieStats.GetComponent<RandomCharacterStats>().minMovement;
			obj.maxMovemenmt = zombieStats.GetComponent<RandomCharacterStats>().maxMovemenmt;
			obj.randomCurve = zombieStats.GetComponent<RandomCharacterStats>().randomCurve;
		}
		if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<EyeSpawner>()))
		{
			EyeSpawner[] componentsInChildren2 = ((Component)unit).GetComponentsInChildren<EyeSpawner>();
			foreach (EyeSpawner val in componentsInChildren2)
			{
				foreach (GooglyEye spawnedEye in val.spawnedEyes)
				{
					GooglyEyes.instance.eyes.Remove(spawnedEye);
					Object.Destroy((Object)(object)((Component)spawnedEye).gameObject);
				}
				val.spawnedEyes.Clear();
				val.eyeObject = reviveEye;
				((object)val).GetType().GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(val, new object[0]);
			}
		}
		unit.api.SetTargetingType(unit.unitBlueprint.TargetingComponent);
		ServiceLocator.GetService<UnitHealthbars>().HandleUnitSpawned(unit);
		unit.api.UpdateECSValues();
		unit.InitializeUnit(newTeam);
		reviveEvent.Invoke();
	}

	public void Update()
	{
		if (Object.op_Implicit((Object)(object)unit))
		{
			((Component)unit.data).GetComponent<UnitColorHandler>().SetColor(color, lerpProgress);
		}
	}
}
public class PlaguePhases : MonoBehaviour
{
	public enum PlagueState
	{
		Alive,
		Sickly,
		Zombie
	}

	private Unit unit;

	public PlagueState currentState;

	public Renderer renderer;

	public Renderer sickRenderer;

	public Renderer zombieRenderer;

	public ParticleSystem part;

	public List<Material> sicklyMaterials = new List<Material>();

	public List<int> aliveMaterialIndexes = new List<int>();

	public GameObject reviveEye;

	public float sickenTime = 6f;

	private void Start()
	{
		unit = ((Component)((Component)this).transform.root).GetComponent<Unit>();
		unit.data.healthHandler.willBeRewived = false;
	}

	public void BeginTransition()
	{
		((MonoBehaviour)this).StartCoroutine(DoSickening());
	}

	private IEnumerator DoSickening()
	{
		((MonoBehaviour)this).StartCoroutine(PlayPartWithDelay(sickenTime - 0.5f));
		List<Material> storedAliveMaterials = new List<Material>();
		foreach (int aliveMaterialIndex in aliveMaterialIndexes)
		{
			storedAliveMaterials.Add(Object.Instantiate<Material>(renderer.materials[aliveMaterialIndex]));
		}
		float t = 0f;
		while (t < sickenTime && !unit.data.Dead)
		{
			for (int i = 0; i < aliveMaterialIndexes.Count; i++)
			{
				renderer.materials[aliveMaterialIndexes[i]].Lerp(storedAliveMaterials[i], sicklyMaterials[i], t / sickenTime);
			}
			t += Time.deltaTime;
			yield return null;
		}
		if (unit.data.Dead)
		{
			part.Stop();
			Object.Destroy((Object)(object)((Component)this).gameObject);
			yield break;
		}
		currentState = PlagueState.Sickly;
		SetRenderer();
		if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<EyeSpawner>()))
		{
			EyeSpawner[] componentsInChildren = ((Component)unit).GetComponentsInChildren<EyeSpawner>();
			foreach (EyeSpawner val in componentsInChildren)
			{
				foreach (GooglyEye spawnedEye in val.spawnedEyes)
				{
					Object.Destroy((Object)(object)((Component)spawnedEye).gameObject);
				}
				val.spawnedEyes.Clear();
				val.eyeObject = reviveEye;
				((object)val).GetType().GetMethod("Awake", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(val, new object[0]);
			}
		}
		((MonoBehaviour)this).StartCoroutine(PlayPartWithDelay(0.5f));
	}

	public IEnumerator PlayPartWithDelay(float delay = 0f)
	{
		yield return (object)new WaitForSeconds(delay);
		part.Play();
	}

	public void SetRenderer()
	{
		if (currentState == PlagueState.Alive)
		{
			((Component)renderer).gameObject.SetActive(true);
			((Component)sickRenderer).gameObject.SetActive(false);
			((Component)zombieRenderer).gameObject.SetActive(false);
		}
		else if (currentState == PlagueState.Sickly)
		{
			((Component)renderer).gameObject.SetActive(false);
			((Component)sickRenderer).gameObject.SetActive(true);
			((Component)zombieRenderer).gameObject.SetActive(false);
		}
		else if (currentState == PlagueState.Zombie)
		{
			((Component)renderer).gameObject.SetActive(false);
			((Component)sickRenderer).gameObject.SetActive(false);
			((Component)zombieRenderer).gameObject.SetActive(true);
		}
	}
}
public class RiseOnSpawn : MonoBehaviour
{
	private DataHandler ownData;

	public float startDelay;

	public float time = 2f;

	public float moveMultiplier = 0.6f;

	public bool setRigsKinematic;

	public bool setArmsKinematic;

	private void Start()
	{
		ownData = ((Component)this).GetComponent<Unit>().data;
		((MonoBehaviour)this).StartCoroutine(DoRise());
	}

	private IEnumerator DoRise()
	{
		ownData.mainRig.isKinematic = true;
		yield return (object)new WaitForSeconds(startDelay);
		float t = 0f;
		Rigidbody[] allRigs;
		while (t < time)
		{
			allRigs = ownData.allRigs.AllRigs;
			foreach (Rigidbody val in allRigs)
			{
				if (setRigsKinematic && (setArmsKinematic || ((Object)(object)((Component)val).transform != (Object)(object)ownData.leftArm && (Object)(object)((Component)val).transform != (Object)(object)ownData.rightArm && (Object)(object)((Component)val).transform != (Object)(object)ownData.leftHand && (Object)(object)((Component)val).transform != (Object)(object)ownData.rightHand)))
				{
					val.isKinematic = true;
				}
			}
			Transform transform = ((Component)this).transform;
			transform.position += Vector3.up * (Mathf.Clamp(t * 0.1f, 0f, 1f) * Time.deltaTime * moveMultiplier);
			t += Time.deltaTime;
			yield return null;
		}
		allRigs = ownData.allRigs.AllRigs;
		for (int i = 0; i < allRigs.Length; i++)
		{
			allRigs[i].isKinematic = false;
		}
	}
}
public class ChangeSpriteColor : MonoBehaviour
{
	[Header("Material Settings")]
	public SpriteRenderer spriteRenderer;

	public Color newColor;

	public void SpriteColorChange(float speed)
	{
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StartCoroutine(DoSpriteColorChange(newColor, speed));
	}

	public void AllSpritesColorChange(float speed)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		SpriteRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<SpriteRenderer>();
		foreach (SpriteRenderer targetRenderer in componentsInChildren)
		{
			((MonoBehaviour)this).StartCoroutine(DoSpriteColorChange(newColor, speed, targetRenderer));
		}
	}

	public void SpriteColorRevert(float speed)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		((MonoBehaviour)this).StartCoroutine(DoSpriteColorChange(spriteRenderer.color, speed));
	}

	public void AllSpritesColorRevert(float speed)
	{
		//IL_0012: Unknown result type (might be due to invalid IL or missing references)
		SpriteRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<SpriteRenderer>();
		foreach (SpriteRenderer val in componentsInChildren)
		{
			((MonoBehaviour)this).StartCoroutine(DoSpriteColorChange(val.color, speed, val));
		}
	}

	private IEnumerator DoSpriteColorChange(Color targetColor, float lerpSpeed, SpriteRenderer targetRenderer = null)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		SpriteRenderer sr = (((Object)(object)targetRenderer != (Object)null) ? targetRenderer : spriteRenderer);
		float t = 0f;
		while (t < 1f)
		{
			t += Time.deltaTime * lerpSpeed;
			sr.color = Color.Lerp(sr.color, targetColor, Mathf.Clamp01(t));
			yield return null;
		}
	}
}
public class SCModTools
{
	public static UnitBlueprint CloneUnit(DatabaseID targetID)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		Dictionary<DatabaseID, UnitBlueprint> dictionary = (Dictionary<DatabaseID, UnitBlueprint>)typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().LandfallContentDatabase);
		if (dictionary.TryGetValue(targetID, out var value))
		{
			UnitBlueprint val = Object.Instantiate<UnitBlueprint>(value);
			((Object)val).name = value.Entity.Name + "_Clone";
			val.Entity.Name = value.Entity.Name + "_Clone";
			val.Entity.GenerateNewID();
			dictionary.Add(val.Entity.GUID, val);
			typeof(LandfallContentDatabase).GetField("m_unitBlueprints", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().LandfallContentDatabase, dictionary);
			return val;
		}
		return null;
	}

	public extern void GetSprite();

	public static Sprite GetSprite(string name)
	{
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0014: Expected O, but got Unknown
		//IL_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Unknown result type (might be due to invalid IL or missing references)
		using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
		Texture2D val = new Texture2D(4, 4);
		byte[] array = new byte[stream.Length];
		stream.Read(array, 0, (int)stream.Length);
		ImageConversion.LoadImage(val, array);
		return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
	}
}
public class newice : UnitEffectBase
{
	public float effectAmount = 10f;

	public float dragPerAmount = 1f;

	public float removeDragSpeed = 2f;

	private RigidbodyHolder rigHolder;

	private const float UpdateEffectColorTimeInterval = 0.6f;

	public Color fostColor;

	public UnitColorInstance color;

	public Material iceMaterial;

	public float amount;

	private float healthMultiplier = 1f;

	private WeaponHandler weapons;

	private DataHandler data;

	private DragHandler dragHandler;

	private UnitColorHandler colorHandler;

	private bool done;

	private float timer;

	private INetworkService m_networkService;

	private NetworkBattleController m_networkBattle;

	[SerializeField]
	private float maxAmount = 100f;

	private NetworkBattleController NetworkBattle
	{
		get
		{
			if ((Object)(object)m_networkBattle == (Object)null)
			{
				m_networkBattle = ServiceLocator.GetService<NetworkBattleController>();
			}
			return m_networkBattle;
		}
	}

	private void Start()
	{
		m_networkService = ServiceLocator.GetService<INetworkService>();
		m_networkBattle = ServiceLocator.GetService<NetworkBattleController>();
	}

	private void Update()
	{
		if (done || !Object.op_Implicit((Object)(object)rigHolder) || (data.Dead && !((UnitEffectBase)this).ShouldSkipDeadTests))
		{
			return;
		}
		bool flag = false;
		for (int i = 0; i < rigHolder.AllDrags.Length; i++)
		{
			if (rigHolder.AllDrags[i].x > rigHolder.defaultDrags[i].x)
			{
				flag = true;
				Vector2[] allDrags = rigHolder.AllDrags;
				int num = i;
				allDrags[num].x = allDrags[num].x - Time.deltaTime * removeDragSpeed * 0.5f;
			}
			if (rigHolder.AllDrags[i].y > rigHolder.defaultDrags[i].y)
			{
				flag = true;
				Vector2[] allDrags2 = rigHolder.AllDrags;
				int num2 = i;
				allDrags2[num2].y = allDrags2[num2].y - Time.deltaTime * removeDragSpeed * 0.5f;
			}
		}
		if (flag)
		{
			amount -= Time.deltaTime * removeDragSpeed * dragPerAmount * 0.5f;
		}
		timer += Time.deltaTime;
		if ((Object)(object)colorHandler != (Object)null)
		{
			colorHandler.SetColor(color, Mathf.Clamp(amount * 0.03f, 0f, 1f));
		}
		if ((Object)(object)dragHandler != (Object)null)
		{
			dragHandler.UpdateDrag();
		}
	}

	public override void DoEffect()
	{
		Add(effectAmount);
	}

	public override void Ping()
	{
		Add(effectAmount);
	}

	private void Add(float a)
	{
		if ((Object.op_Implicit((Object)(object)data) && data.Dead && !((UnitEffectBase)this).ShouldSkipDeadTests) || done)
		{
			return;
		}
		if (!Object.op_Implicit((Object)(object)rigHolder))
		{
			rigHolder = ((Component)((Component)this).transform.parent).GetComponentInChildren<RigidbodyHolder>();
			if (Object.op_Implicit((Object)(object)rigHolder))
			{
				dragHandler = ((Component)rigHolder).GetComponent<DragHandler>();
				data = ((Component)rigHolder).GetComponent<DataHandler>();
				colorHandler = ((Component)rigHolder).GetComponent<UnitColorHandler>();
				weapons = ((Component)rigHolder).GetComponent<WeaponHandler>();
				healthMultiplier = 1f / Mathf.Clamp(5f, 1f, float.PositiveInfinity);
			}
		}
		if ((Object.op_Implicit((Object)(object)data) && data.Dead && !((UnitEffectBase)this).ShouldSkipDeadTests) || !Object.op_Implicit((Object)(object)rigHolder))
		{
			return;
		}
		float num = 16.666668f - amount * 0.03f;
		a = Mathf.Min(a, num);
		a *= healthMultiplier;
		for (int i = 0; i < rigHolder.AllDrags.Length; i++)
		{
			Vector2[] allDrags = rigHolder.AllDrags;
			int num2 = i;
			allDrags[num2].x = allDrags[num2].x + a * dragPerAmount;
			Vector2[] allDrags2 = rigHolder.AllDrags;
			int num3 = i;
			allDrags2[num3].y = allDrags2[num3].y + a * dragPerAmount;
			if (allDrags[num2].x >= 25f)
			{
				allDrags[num2].x = allDrags[num2].x - a * dragPerAmount;
				allDrags2[num3].y = allDrags2[num3].y - a * dragPerAmount;
			}
		}
		amount += a;
		if ((Object)(object)dragHandler != (Object)null)
		{
			dragHandler.UpdateDrag();
		}
		timer = 0.1f;
	}

	private void Done()
	{
		if (!done && (!Object.op_Implicit((Object)(object)data) || !data.Dead || ((UnitEffectBase)this).ShouldSkipDeadTests))
		{
			PlaySoundEffect component = ((Component)this).GetComponent<PlaySoundEffect>();
			if ((Object)(object)component != (Object)null)
			{
				component.Go();
			}
			done = true;
		}
	}

	private void StandardDeath()
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001c: 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_0069: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Unknown result type (might be due to invalid IL or missing references)
		//IL_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_018b: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0215: Unknown result type (might be due to invalid IL or missing references)
		//IL_021f: Unknown result type (might be due to invalid IL or missing references)
		Joint[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<Joint>();
		float num = 0f;
		Vector3 val = Vector3.zero;
		for (int i = 0; i < componentsInChildren.Length; i++)
		{
			Object.Destroy((Object)(object)componentsInChildren[i]);
		}
		for (int j = 0; j < data.allRigs.AllRigs.Length; j++)
		{
			Rigidbody val2 = data.allRigs.AllRigs[j];
			if (!((Object)(object)val2 == (Object)null))
			{
				num += val2.mass;
				val += val2.velocity / (float)data.allRigs.AllDrags.Length;
				Object.Destroy((Object)(object)val2);
			}
		}
		if (Object.op_Implicit((Object)(object)colorHandler))
		{
			colorHandler.SetMaterial(iceMaterial);
		}
		if (Object.op_Implicit((Object)(object)weapons))
		{
			if (Object.op_Implicit((Object)(object)weapons.leftWeapon) && Object.op_Implicit((Object)(object)weapons.leftWeapon.rigidbody))
			{
				Object.Destroy((Object)(object)weapons.leftWeapon.rigidbody);
			}
			if (Object.op_Implicit((Object)(object)weapons.rightWeapon) && Object.op_Implicit((Object)(object)weapons.rightWeapon.rigidbody))
			{
				Object.Destroy((Object)(object)weapons.rightWeapon.rigidbody);
			}
		}
		Rigidbody val3 = ((Component)((Component)data).transform.root).gameObject.AddComponent<Rigidbody>();
		data.mainRig = val3;
		val3.mass = num * 3f;
		val3.velocity = val;
		((Component)val3).gameObject.AddComponent<SinkOnDeath>().Sink();
		val3.drag = 1f;
		val3.angularDrag = 1f;
		val3.interpolation = (RigidbodyInterpolation)1;
		Collider component = ((Component)val3).GetComponent<Collider>();
		if (Object.op_Implicit((Object)(object)component))
		{
			Object.Destroy((Object)(object)component);
		}
		val3.ResetCenterOfMass();
		data.healthHandler.Die((Unit)null);
		Object.Destroy((Object)(object)((Component)this).gameObject);
		DatabaseID gUID = data.unit.unitBlueprint.Entity.GUID;
		if (gUID.m_modID == -1 && gUID.m_ID == 1610400248)
		{
			ServiceLocator.GetService<AchievementService>().UnlockAchievement("FREEZE_ICE_GIANT");
		}
	}
}
public class ScenesManager : MonoBehaviour
{
	public ScenesManager()
	{
		SceneManager.sceneLoaded += SceneLoaded;
	}

	public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		//IL_0102: Unknown result type (might be due to invalid IL or missing references)
		//IL_0108: Expected O, but got Unknown
		//IL_0119: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0081: Expected O, but got Unknown
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Expected O, but got Unknown
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0161: Expected O, but got Unknown
		//IL_0172: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bb: Expected O, but got Unknown
		//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0218: Expected O, but got Unknown
		//IL_022b: Unknown result type (might be due to invalid IL or missing references)
		//IL_026e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0275: Expected O, but got Unknown
		//IL_0288: Unknown result type (might be due to invalid IL or missing references)
		if (((Scene)(ref scene)).name == "UnitCreator_GamepadUI")
		{
			UnitEditorManager component = ((Scene)(ref scene)).GetRootGameObjects().ToList().Find((GameObject x) => Object.op_Implicit((Object)(object)x.GetComponent<UnitEditorManager>()))
				.GetComponent<UnitEditorManager>();
			List<UnitBaseWrapper> list = component.UnitBases.ToList();
			UnitBlueprint val = SLMATool.CreateUnit("MoreContent Custom:病变体", (UnitBlueprint)SLMALoader.SDic["blueprints"]["CustomWobbler"], (Faction)null, (Sprite)null);
			val.UnitBase = UManager.bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("病变体");
			list.Add(new UnitBaseWrapper
			{
				BaseDisplayName = "病变体",
				BaseIcon = UManager.bundleMod.GetAssetBundle("dark").LoadAsset<Sprite>("瘟疫医生图标2"),
				UnitBaseBlueprint = val,
				UnitBaseRestriction = (UnitBaseRestrictions)0
			});
			component.UnitBases = list.ToArray();
		}
		if (((Scene)(ref scene)).name == "00_Lvl1_Halloween_VC")
		{
			GameObject val2 = new GameObject();
			((Object)val2).name = "dark123";
			val2.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.bundleMod.GetAssetBundle("dark").LoadAsset<GameObject>("Unlock1986"), val2.transform);
		}
		if (((Scene)(ref scene)).name == "05_Lvl2_Medieval_VC")
		{
			GameObject val3 = new GameObject();
			((Object)val3).name = "airen123";
			val3.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.bundleMod2.GetAssetBundle("airen").LoadAsset<GameObject>("unlock 1"), val3.transform);
		}
		if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Evil_VC")
		{
			GameObject val4 = new GameObject();
			((Object)val4).name = "tianzai123";
			val4.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.bundleMod4.GetAssetBundle("tianzai").LoadAsset<GameObject>("unlock 45"), val4.transform);
		}
		if (((Scene)(ref scene)).name == "08_Lvl1_Pirate_VC")
		{
			GameObject val5 = new GameObject();
			((Object)val5).name = "huo123";
			val5.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("unlock 2 1"), val5.transform);
		}
		if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Evil_VC")
		{
			GameObject val6 = new GameObject();
			((Object)val6).name = "huoi123";
			val6.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.bundleMod3.GetAssetBundle("huo").LoadAsset<GameObject>("unlock 2 2 1"), val6.transform);
		}
	}
}
public class SecretUnlock2 : GameStateListener
{
	[SerializeField]
	private string m_secret_key = "";

	[SerializeField]
	private string m_secretDescription = "";

	[SerializeField]
	private Sprite m_secretIcon;

	[SerializeField]
	private float m_distanceToUnlock = 5f;

	private RotationShake m_rotationShake;

	private Rigidbody m_secretObject;

	private float m_lookValue;

	private float m_unlockValue;

	public AudioClip hitClip;

	private AudioSource loopSource;

	private Transform m_mainCamTransform;

	public UnityEvent unlockEvent;

	public UnityEvent hideEvent;

	private bool done;

	public Color glowColor;

	public GameObject unlockSparkEffect;

	[SerializeField]
	private int materialIndexToChange;

	public Renderer meshRenderer;

	protected override void Awake()
	{
		((GameStateListener)this).Awake();
		if ((Object)(object)m_mainCamTransform == (Object)null)
		{
			((GameStateListener)this).OnEnterNewScene();
		}
	}

	private void Update()
	{
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0117: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_012d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0132: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)m_mainCamTransform != (Object)null) || !Object.op_Implicit((Object)(object)m_secretObject) || done)
		{
			return;
		}
		loopSource.volume = ((m_unlockValue <= 0f) ? 0f : Mathf.Pow(m_unlockValue * 0.25f, 1.3f));
		if (float.IsNaN(loopSource.volume))
		{
			loopSource.volume = 0f;
		}
		float num = 1f + 1f * m_unlockValue;
		loopSource.pitch = ((num >= 0f) ? num : 0f);
		if (m_unlockValue > 0f || m_lookValue > 10f)
		{
			SetColor(materialIndexToChange);
		}
		float num2 = Vector3.Distance(m_secretObject.worldCenterOfMass, m_mainCamTransform.position);
		if (num2 > m_distanceToUnlock)
		{
			m_unlockValue -= Time.unscaledDeltaTime * 0.2f;
			return;
		}
		float num3 = Vector3.Angle(m_mainCamTransform.forward, m_secretObject.worldCenterOfMass - m_mainCamTransform.position);
		m_lookValue = 1000f / (num2 * num3);
		if (m_lookValue > 8f)
		{
			float num4 = 0.2f;
			m_unlockValue += num4 * Time.unscaledDeltaTime;
			UnlockProgressFeedback();
			if (m_unlockValue > 1f)
			{
				UnlockSecret();
			}
		}
		else
		{
			m_unlockValue -= Time.unscaledDeltaTime * 0.2f;
		}
	}

	private void UnlockProgressFeedback()
	{
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_005c: 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_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)m_rotationShake))
		{
			if (m_unlockValue <= 0f)
			{
				m_rotationShake.AddForce(Random.onUnitSphere * 2f);
				m_unlockValue = 0f;
			}
			((Behaviour)m_rotationShake).enabled = true;
			m_rotationShake.AddForce(Random.onUnitSphere * m_unlockValue * Time.deltaTime * 50f);
		}
	}

	private void UnlockSecret()
	{
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		//IL_0055: Unknown result type (might be due to invalid IL or missing references)
		//IL_007d: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing references)
		//IL_0159: Unknown result type (might be due to invalid IL or missing references)
		//IL_0160: 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)
		if (!((Behaviour)this).enabled || string.IsNullOrWhiteSpace(m_secret_key) || ServiceLocator.GetService<ISaveLoaderService>().HasUnlockedSecret(m_secret_key))
		{
			return;
		}
		if (Object.op_Implicit((Object)(object)ScreenShake.Instance))
		{
			ScreenShake.Instance.AddForce(Vector3.up * 8f, ((Component)m_secretObject).transform.position);
		}
		if (Object.op_Implicit((Object)(object)unlockSparkEffect))
		{
			Object.Instantiate<GameObject>(unlockSparkEffect, ((Component)m_secretObject).transform.position, ((Component)m_secretObject).transform.rotation).AddComponent<RemoveAfterSeconds>().seconds = 5f;
			((Component)m_secretObject).GetComponentInChildren<MeshRenderer>();
		}
		((Component)m_secretObject).gameObject.SetActive(false);
		UnityEvent val = unlockEvent;
		if (val != null)
		{
			val.Invoke();
		}
		loopSource.Stop();
		loopSource.volume = 1f;
		loopSource.PlayOneShot(hitClip);
		done = true;
		if (string.IsNullOrWhiteSpace(m_secret_key))
		{
			return;
		}
		List<SecretUnlockCondition> list = ServiceLocator.GetService<ISaveLoaderService>().UnlockSecret(m_secret_key);
		ServiceLocator.GetService<ModalPanel>().OpenUnlockPanel(m_secretDescription, m_secretIcon);
		if (list != null && list.Count > 0)
		{
			foreach (SecretUnlockCondition item in list)
			{
				ServiceLocator.GetService<ModalPanel>().OpenUnlockPanel(item.m_unlockDescription, item.m_unlockImage);
			}
		}
		PlacementUI val2 = Object.FindObjectOfType<PlacementUI>();
		if ((Object)(object)val2 != (Object)null)
		{
			val2.RedrawUI(m_secret_key);
		}
	}

	public override void OnEnterNewScene()
	{
		((GameStateListener)this).OnEnterNewScene();
		loopSource = ((Component)this).GetComponent<AudioSource>();
		if (Object.op_Implicit((Object)(object)loopSource))
		{
			loopSource.volume = 0f;
		}
		m_rotationShake = ((Component)this).GetComponentInChildren<RotationShake>();
		m_secretObject = ((Component)this).GetComponentInChildren<Rigidbody>();
		if (Object.op_Implicit((Object)(object)m_secretObject))
		{
			m_secretObject.isKinematic = true;
		}
		if (!string.IsNullOrWhiteSpace(m_secret_key) && ServiceLocator.GetService<ISaveLoaderService>().HasUnlockedSecret(m_secret_key))
		{
			if (Object.op_Implicit((Object)(object)m_secretObject))
			{
				((Component)m_secretObject).gameObject.SetActive(false);
			}
			((Behaviour)this).enabled = false;
			UnityEvent val = hideEvent;
			if (val != null)
			{
				val.Invoke();
			}
		}
		PlayerCamerasManager service = ServiceLocator.GetService<PlayerCamerasManager>();
		MainCam val2 = ((service != null) ? service.GetMainCam((Player)0) : null);
		m_mainCamTransform = (((Object)(object)val2 != (Object)null) ? ((Component)val2).transform : null);
	}

	public override void OnEnterPlacementState()
	{
	}

	public override void OnEnterBattleState()
	{
	}

	private void SetColor(int materialIndex)
	{
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00af: Unknown result type (might be due to invalid IL or missing references)
		m_unlockValue = Mathf.Clamp(m_unlockValue, 0f, float.PositiveInfinity);
		if ((Object)(object)meshRenderer != (Object)null)
		{
			if (materialIndex < 0 || materialIndex >= meshRenderer.materials.Length)
			{
				Debug.LogError((object)("Invalid material index: " + materialIndex));
				return;
			}
			Material val = meshRenderer.materials[materialIndex];
			if (!(((Object)val.shader).name == "TFBG/EmitVertexColor") && val.HasProperty("_EmissionColor"))
			{
				val.EnableKeyword("_EMISSION");
				val.SetColor("_EmissionColor", glowColor * m_unlockValue * 2f);
			}
		}
		else
		{
			Debug.LogError((object)"Mesh Renderer not assigned!");
		}
	}
}
public class AddDeathEvent2 : MonoBehaviour
{
	public UnityEvent deathEvent;

	public bool addToParent;

	private HealthHandler healthHandler;

	public bool onStart;

	private void Start()
	{
		if (onStart)
		{
			Init();
		}
	}

	private void Die()
	{
		deathEvent.Invoke();
	}

	private void OnDestroy()
	{
		if (Object.op_Implicit((Object)(object)healthHandler))
		{
			healthHandler.RemoveDieAction((Action)Die);
		}
	}

	public void Init()
	{
		healthHandler = (addToParent ? ((Component)((Component)this).transform).GetComponentInParent<DataHandler>().healthHandler : ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>().healthHandler);
		if (Object.op_Implicit((Object)(object)healthHandler))
		{
			healthHandler.AddDieAction((Action)Die);
		}
	}
}
public class UnitDeathEffect3 : MonoBehaviour
{
	public List<Collider> collisions = new List<Collider>();

	private List<MeshRenderer> renderersM = new List<MeshRenderer>();

	private List<SkinnedMeshRenderer> renderersS = new List<SkinnedMeshRenderer>();

	public bool teleportDown;

	public bool hideColliderParent;

	public bool autoRenderers;

	public void Go()
	{
		//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < collisions.Count; i++)
		{
			if (collisions[i].enabled)
			{
				collisions[i].enabled = false;
			}
			if (hideColliderParent && ((Component)((Component)collisions[i]).transform.parent).gameObject.activeInHierarchy)
			{
				((Component)((Component)collisions[i]).transform.parent).gameObject.SetActive(false);
			}
		}
		Rigidbody[] allRigs = ((Component)this).GetComponentInChildren<DataHandler>().allRigs.AllRigs;
		foreach (Rigidbody val in allRigs)
		{
			if (!val.isKinematic)
			{
				val.isKinematic = true;
			}
		}
		if (autoRenderers)
		{
			ManageRenderersManual();
		}
		else
		{
			ManageRenderers();
		}
		if (teleportDown)
		{
			((Component)((Component)this).GetComponentInChildren<DataHandler>()).gameObject.transform.position = new Vector3(0f, -100f, 0f);
		}
	}

	private void Start()
	{
		MeshRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<MeshRenderer>();
		foreach (MeshRenderer item in componentsInChildren)
		{
			renderersM.Add(item);
		}
		SkinnedMeshRenderer[] componentsInChildren2 = ((Component)this).GetComponentsInChildren<SkinnedMeshRenderer>();
		foreach (SkinnedMeshRenderer item2 in componentsInChildren2)
		{
			renderersS.Add(item2);
		}
	}

	private void ManageRenderersManual()
	{
		for (int i = 0; i < renderersM.Count; i++)
		{
			if (((Renderer)renderersM[i]).enabled)
			{
				((Renderer)renderersM[i]).enabled = false;
			}
		}
		for (int j = 0; j < renderersS.Count; j++)
		{
			if (((Renderer)renderersS[j]).enabled)
			{
				((Renderer)renderersS[j]).enabled = false;
			}
		}
	}

	private void ManageRenderers()
	{
		List<Renderer> list = new List<Renderer>();
		Renderer[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<Renderer>();
		foreach (Renderer val in componentsInChildren)
		{
			if (!((Object)(object)((Component)val).gameObject.GetComponent<RangeWeapon>() != (Object)null) && !((Object)(object)((Component)val).gameObject.GetComponent<MeleeWeapon>() != (Object)null))
			{
				list.Add(val);
			}
		}
		foreach (Renderer item in list)
		{
			if (item.enabled)
			{
				item.enabled = false;
			}
		}
	}
}
public class deadSpawner : MonoBehaviour, IPoolable
{
	public bool spawnOnStart;

	public UnitBlueprint unitBlueprint;

	public int amountToSpawn;

	public float spawnDelay;

	public Team team;

	public bool useUnitTeam;

	public float unitInvincibleFor;

	public bool transferHp;

	private DataHandler rootData;

	public Unit rootUnit;

	private float originalSize;

	private float originalMass;

	private float sizeMultiplier;

	private float massMultiplier;

	private bool originalHoldingWithTwoHands;

	private float originalanimationMultiplier;

	private float originalStepMultiplier;

	private float originalBalanceMultiplier;

	private float originalBalanceForceMultiplier;

	public bool addRemoveAfterSecons;

	public bool destroyroot;

	public float time;

	public float eventtimer;

	public GameObject poofEffect;

	private RiderHolder riders;

	private TeamHolder teamHolder;

	private EffectSpawnedUnit effectSpawnedUnit;

	public UnitBlueprint rangedUnitBlueprint;

	public bool switchIfRanged;

	public bool useHealthOfRootForAmount;

	public bool spawnWithRootScaleAndMass;

	public bool useRootWeapon;

	public bool useSpawnerBlueprint;

	public bool spawnRandomUnits;

	public List<UnitBlueprint> units;

	private Vector3 spawnPos;

	private bool isHumanoid;

	private bool isRangedUnit;

	private int allowedUnitsToSpawn;

	private int unitsSpawnedSinceWait;

	private GameObject originalRightWeapon;

	private GameObject originalLeftWeapon;

	private IceGiant isIceGiant;

	public Action<GameObject> spawnUnitAction;

	private SpawnerBlueprintHolder blueprintHolder;

	private WaitForSeconds waitForSpawnDelay;

	private int originalAmountToSpawn;

	private bool didInitializeForMultiplayer;

	private Projectile parentProjectile;

	private Unit parentUnit;

	private float originalhealth;

	private float health;

	public bool isBox;

	private Unit lastRecordedRootUnit;

	public bool IsManagedByPool { get; set; }

	public Action ReleaseSelf { get; set; }

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		waitForSpawnDelay = new WaitForSeconds(spawnDelay);
		originalAmountToSpawn = amountToSpawn;
		if (!IsManagedByPool)
		{
			InitializeOnSpawn();
		}
	}

	public void Initialize()
	{
		InitializeOnSpawn();
	}

	public void Reset()
	{
	}

	public void Release()
	{
		amountToSpawn = originalAmountToSpawn;
	}

	public void Spawnerino()
	{
		((MonoBehaviour)this).StartCoroutine(Spawnfixer());
	}

	private IEnumerator Spawnfixer()
	{
		int amountspawned = 0;
		while (amountspawned < amountToSpawn)
		{
			if (unitsSpawnedSinceWait < allowedUnitsToSpawn)
			{
				if (amountspawned > 1)
				{
					spawnPos = new Vector3(((Component)this).transform.position.x + Random.Range(-2.5f, 2.5f), ((Component)this).transform.position.y + Random.Range(-0.5f, 0.5f), ((Component)this).transform.position.z + Random.Range(-2.5f, 2.5f));
				}
				else
				{
					spawnPos = ((Component)this).transform.position;
				}
				Spawn();
				unitsSpawnedSinceWait++;
				amountspawned++;
			}
			else
			{
				unitsSpawnedSinceWait = 0;
				yield return waitForSpawnDelay;
			}
		}
	}

	public Unit Spawn()
	{
		//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00db: Unknown result type (might be due to invalid IL or missing references)
		//IL_014d: Unknown result type (might be due to invalid IL or missing references)
		//IL_011f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_01db: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b1: Expected O, but got Unknown
		if (isBox)
		{
			new RootUnitData(rootUnit);
		}
		if (!IsAllowedToSpawnInMultiplayer())
		{
			return null;
		}
		if (switchIfRanged && isHumanoid)
		{
			if (Object.op_Implicit((Object)(object)rootData.weaponHandler.rightWeapon) && !isRangedUnit && rootData.weaponHandler.rightWeapon.isRange)
			{
				isRangedUnit = true;
			}
			if (Object.op_Implicit((Object)(object)rootData.weaponHandler.leftWeapon) && !isRangedUnit && rootData.weaponHandler.leftWeapon.isRange)
			{
				isRangedUnit = true;
			}
			if (isRangedUnit)
			{
				unitBlueprint = rangedUnitBlueprint;
			}
		}
		if (Object.op_Implicit((Object)(object)teamHolder))
		{
			team = teamHolder.team;
		}
		if (useUnitTeam && Object.op_Implicit((Object)(object)rootUnit))
		{
			team = rootUnit.Team;
		}
		if (Object.op_Implicit((Object)(object)isIceGiant))
		{
			sizeMultiplier = ((Component)this).transform.root.localScale.x * 3f;
			massMultiplier = 1.5f;
		}
		else
		{
			sizeMultiplier = ((Component)this).transform.root.localScale.x;
		}
		if (Object.op_Implicit((Object)(object)blueprintHolder) && useSpawnerBlueprint)
		{
			unitBlueprint = blueprintHolder.unitBlueprint;
		}
		Unit val = default(Unit);
		if (spawnWithRootScaleAndMass)
		{
			unitBlueprint = rootUnit.unitBlueprint;
			unitBlueprint.Spawn(spawnPos, ((Component)this).transform.rotation, team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null);
		}
		else
		{
			unitBlueprint.Spawn(spawnPos, ((Component)this).transform.rotation, team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null);
		}
		if (addRemoveAfterSecons)
		{
			KillAfterSeconds val2 = ((Component)val).gameObject.AddComponent<KillAfterSeconds>();
			val2.seconds = time;
			val2.destroyRoot = destroyroot;
			if (eventtimer != 0f)
			{
				val2.eventTimer = eventtimer;
				SpawnObject val3 = ((Component)((Component)((Component)val).transform).GetComponentInChildren<Hip>()).gameObject.AddComponent<SpawnObject>();
				val3.spawnIfUnitDead = false;
				val3.followMe = true;
				if (Object.op_Implicit((Object)(object)poofEffect))
				{
					val3.objectToSpawn = poofEffect;
				}
				val2.killEvent.AddListener(new UnityAction(val3.SpawnCharacterForward));
			}
			riders = ((Component)val).GetComponent<RiderHolder>();
			if (Object.op_Implicit((Object)(object)riders))
			{
				foreach (GameObject rider in riders.riders)
				{
					val2 = rider.AddComponent<KillAfterSeconds>();
					val2.seconds = time;
					val2.destroyRoot = destroyroot;
				}
			}
		}
		PlacementSpawnEffects componentInChildren = ((Component)val).GetComponentInChildren<PlacementSpawnEffects>();
		if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			Object.Destroy((Object)(object)((Component)componentInChildren).gameObject);
		}
		if (Object.op_Implicit((Object)(object)effectSpawnedUnit))
		{
			effectSpawnedUnit.Spawn(((Component)val).gameObject);
		}
		spawnUnitAction?.Invoke(((Component)val).gameObject);
		if (transferHp && Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)rootData))
		{
			float num = rootData.health / rootData.maxHealth;
			((Component)val).gameObject.AddComponent<HealthTransfer>().TransferHealth(val, num);
		}
		if (unitInvincibleFor != 0f)
		{
			UnitDontTakeDamageForSeconds obj = ((Component)val).gameObject.AddComponent<UnitDontTakeDamageForSeconds>();
			obj.seconds = unitInvincibleFor;
			obj.playOnStart = true;
		}
		SpawnerBlueprintHolder componentInChildren2 = ((Component)((Component)val).transform.root).GetComponentInChildren<SpawnerBlueprintHolder>();
		if (Object.op_Implicit((Object)(object)rootUnit) && Object.op_Implicit((Object)(object)componentInChildren2))
		{
			componentInChildren2.unitBlueprint = rootUnit.unitBlueprint;
		}
		return val;
	}

	private void InitializeOnSpawn()
	{
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Invalid comparison between Unknown and I4
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Invalid comparison between Unknown and I4
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Invalid comparison between Unknown and I4
		teamHolder = ((Component)this).GetComponentInParent<TeamHolder>();
		effectSpawnedUnit = ((Component)this).GetComponentInParent<EffectSpawnedUnit>();
		rootData = ((Component)((Component)this).transform.root).GetComponentInChildren<DataHandler>();
		rootUnit = ((Component)((Component)this).transform.root).GetComponent<Unit>();
		isIceGiant = ((Component)((Component)this).transform.root).GetComponent<IceGiant>();
		blueprintHolder = ((Component)((Component)this).transform.root).GetComponentInChildren<SpawnerBlueprintHolder>();
		if (Object.op_Implicit((Object)(object)rootUnit) && (int)rootUnit.RigType != 1 && (int)rootUnit.RigType != 2 && (int)rootUnit.RigType != 5)
		{
			isHumanoid = false;
		}
		if (spawnRandomUnits && units.Count > 0)
		{
			unitBlueprint = units[Random.Range(0, units.Count)];
		}
		if (useHealthOfRootForAmount && !isHumanoid)
		{
			amountToSpawn += Mathf.RoundToInt(rootData.maxHealth);
		}
		if (spawnOnStart)
		{
			Spawnerino();
		}
	}

	private bool IsAllowedToSpawnInMultiplayer()
	{
		InitializeForMultiplayer();
		if (!((Object)(object)parentProjectile != (Object)null) || !parentProjectile.IsRemotelyControlled)
		{
			if ((Object)(object)parentUnit != (Object)null)
			{
				return !parentUnit.IsRemotelyControlled;
			}
			return true;
		}
		return false;
	}

	private void InitializeForMultiplayer()
	{
		if (!didInitializeForMultiplayer)
		{
			didInitializeForMultiplayer = true;
			if (BoltNetwork.IsRunning)
			{
				parentProjectile = ((Component)this).GetComponentInParent<Projectile>();
				parentUnit = ((Component)this).GetComponentInParent<Unit>();
			}
		}
	}

	public deadSpawner()
	{
		spawnOnStart = true;
		amountToSpawn = 1;
		useUnitTeam = true;
		originalSize = 1f;
		originalhealth = 1f;
		originalMass = 1f;
		sizeMultiplier = 1f;
		massMultiplier = 1f;
		originalHoldingWithTwoHands = true;
		originalanimationMultiplier = 1f;
		originalStepMultiplier = 1f;
		originalBalanceMultiplier = 1f;
		originalBalanceForceMultiplier = 1f;
		time = 1f;
		units = new List<UnitBlueprint>();
		isHumanoid = true;
		allowedUnitsToSpawn = 1;
	}

	public void UpdateDeadSpawner__0BlueprintWithRootUnitData()
	{
		deadSpawner__0[] array = Object.FindObjectsOfType<deadSpawner__0>();
		foreach (deadSpawner__0 deadSpawner__ in array)
		{
			if ((Object)(object)deadSpawner__ != (Object)null && (Object)(object)lastRecordedRootUnit != (Object)null)
			{
				deadSpawner__.unitBlueprint = lastRecordedRootUnit.unitBlueprint;
			}
		}
	}

	public void SaveLastRecordedRootUnit(Unit rootUnit)
	{
		lastRecordedRootUnit = rootUnit;
	}

	public Unit GetLastRecordedRootUnit()
	{
		return lastRecordedRootUnit;
	}
}
public class deadSpawner__0 : MonoBehaviour, IPoolable
{
	public bool spawnOnStart;

	public UnitBlueprint unitBlueprint;

	public int amountToSpawn;

	public float spawnDelay;

	public Team team;

	public bool useUnitTeam;

	public float unitInvincibleFor;

	public bool transferHp;

	private DataHandler rootData;

	public Unit rootUnit;

	private float originalSize;

	private float originalMass;

	private float sizeMultiplier;

	private float massMultiplier;

	private bool originalHoldingWithTwoHands;

	private float originalanimationMultiplier;

	private float originalStepMultiplier;

	private float originalBalanceMultiplier;

	private float originalBalanceForceMultiplier;

	public bool addRemoveAfterSecons;

	public bool destroyroot;

	public float time;

	public float eventtimer;

	public GameObject poofEffect;

	private RiderHolder riders;

	private TeamHolder teamHolder;

	private EffectSpawnedUnit effectSpawnedUnit;

	public UnitBlueprint rangedUnitBlueprint;

	public bool switchIfRanged;

	public bool useHealthOfRootForAmount;

	public bool spawnWithRootScaleAndMass;

	public bool useRootWeapon;

	public bool useSpawnerBlueprint;

	public bool spawnRandomUnits;

	public List<UnitBlueprint> units;

	private Vector3 spawnPos;

	private bool isHumanoid;

	private bool isRangedUnit;

	private int allowedUnitsToSpawn;

	private int unitsSpawnedSinceWait;

	private GameObject originalRightWeapon;

	private GameObject originalLeftWeapon;

	private IceGiant isIceGiant;

	public Action<GameObject> spawnUnitAction;

	private SpawnerBlueprintHolder blueprintHolder;

	private WaitForSeconds waitForSpawnDelay;

	private int originalAmountToSpawn;

	private bool didInitializeForMultiplayer;

	private Projectile parentProjectile;

	private Unit parentUnit;

	private float originalhealth;

	private float health;

	public bool isBox;

	public RootUnitDataHolder rootUnitDataHolder;

	public bool IsManagedByPool { get; set; }

	public Action ReleaseSelf { get; set; }

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Expected O, but got Unknown
		waitForSpawnDelay = new WaitForSeconds(spawnDelay);
		originalAmountToSpawn = amountToSpawn;
		if (!IsManagedByPool)
		{
			InitializeOnSpawn();
		}
	}

	public void Initialize()
	{
		InitializeOnSpawn();
	}

	public void Reset()
	{
	}

	public void Release()
	{
		amountToSpawn = originalAmountToSpawn;
	}

	public void Spawnerino()
	{
		((MonoBehaviour)this).StartCoroutine(Spawnfixer());
		if ((Object)(object)rootUnitDataHolder != (Object)null)
		{
			Unit val = rootUnitDataHolder.CreateNewRootUnit();
			if ((Object)(object)val != (Object)null)
			{
				unitBlueprint = val.unitBlueprint;
				Spawn();
			}
		}
		else
		{
			Debug.LogError((object)"RootUnitDataHolder not assigned!");
		}
	}

	private IEnumerator Spawnfixer()
	{
		int amountspawned = 0;
		while (amountspawned < amountToSpawn)
		{
			if (unitsSpawnedSinceWait < allowedUnitsToSpawn)
			{
				if (amountspawned > 1)
				{
					spawnPos = new Vector3(((Component)this).transform.position.x + Random.Range(-2.5f, 2.5f), ((Component)this).transform.position.y + Random.Range(-0.5f, 0.5f), ((Component)this).transform.position.z + Random.Range(-2.5f, 2.5f));
				}
				else
				{
					spawnPos = ((Component)this).transform.position;
				}
				Spawn();
				unitsSpawnedSinceWait++;
				amountspawned++;
			}
			else
			{
				unitsSpawnedSinceWait = 0;
				yield return waitForSpawnDelay;
			}
		}
	}

	public Unit Spawn()
	{
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0178: Unknown result type (might be due to invalid IL or missing references)
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_012c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0206: Unknown result type (might be due to invalid IL or missing references)
		//IL_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_0217: Unknown result type (might be due to invalid IL or missing references)
		//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Expected O, but got Unknown
		if (!IsAllowedToSpawnInMultiplayer())
		{
			return null;
		}
		RootUnitDataHolder rootUnitDataHolder = Object.FindObjectOfType<RootUnitDataHolder>();
		if ((Object)(object)rootUnitDataHolder != (Object)null)
		{
			Unit rootUnitData = rootUnitDataHolder.rootUnitData;
			if ((Object)(object)rootUnitData != (Object)null)
			{
				rootUnitData.data.health = rootUnitData.data.maxHealth * 0.5f;
			}
		}
		if (switchIfRanged && isHumanoid)
		{
			if (Object.op_Implicit((Object)(object)rootData.weaponHandler.rightWeapon) && !isRangedUnit && rootData.weaponHandler.rightWeapon.isRange)
			{
				isRangedUnit = true;
			}
			if (Object.op_Implicit((Object)(object)rootData.weaponHandler.leftWeapon) && !isRangedUnit && rootData.weaponHandler.leftWeapon.isRange)
			{
				isRangedUnit = true;
			}
			if (isRangedUnit)
			{
				unitBlueprint = rangedUnitBlueprint;
			}
		}
		if (Object.op_Implicit((Object)(object)teamHolder))
		{
			team = teamHolder.team;
		}
		if (useUnitTeam && Object.op_Implicit((Object)(object)rootUnit))
		{
			team = rootUnit.Team;
		}
		if (Object.op_Implicit((Object)(object)isIceGiant))
		{
			sizeMultiplier = ((Component)this).transform.root.localScale.x * 3f;
			massMultiplier = 1.5f;
		}
		else
		{
			sizeMultiplier = ((Component)this).transform.root.localScale.x;
		}
		if (Object.op_Implicit((Object)(object)blueprintHolder) && useSpawnerBlueprint)
		{
			unitBlueprint = blueprintHolder.unitBlueprint;
		}
		Unit val = default(Unit);
		if (spawnWithRootScaleAndMass)
		{
			unitBlueprint = rootUnit.unitBlueprint;
			unitBlueprint.Spawn(spawnPos, ((Component)this).transform.rotation, team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null);
		}
		else
		{
			unitBlueprint.Spawn(spawnPos, ((Component)this).transform.rotation, team, ref val, 1f, false, true, 0, (UnitPoolInfo?)null);
		}
		if (addRemoveAfterSecons)
		{
			KillAfterSeconds val2 = ((Component)val).gameObject.AddComponent<KillAfterSeconds>();
			val2.seconds = time;
			val2.destroyRoot = destroyroot;
			if (eventtimer != 0f)
			{
				val2.eventTimer = eventtimer;
				SpawnObject val3 = ((Component)((Component)((Component)val).transform).GetComponentInChildren<Hip>()).gameObject.AddComponent<SpawnObject>();
				val3.spawnIfUnitDead = false;
				val3.followMe = true;
				if (Object.op_Implicit((Object)(object)poofEffect))
				{
					val3.objectToSpawn = poofEffect;
				}
				val2.killEvent.AddListener(new UnityAction(val3.SpawnCharacterForward));
			}
			riders = ((Component)val).GetComponent<RiderHolder>();
			if (Object.op_Implicit((Object)(object)riders))
			{
				foreach (GameObject rider in riders.riders)
				{
					val2 = rider.AddComponent<KillAfterSeconds>();
					val2.seconds = time;
					val2.destroyRoot = destroyroot;
				}
			}
		}
		PlacementSpawnEffects componentInChildren = ((Component)val).GetComponentInChildren<PlacementSpawnEffects>();
		if (Object.op_Implicit((Object)(object)componentInChildren))
		{
			Object.Destroy((Object)(object)((Component)componentInChildren).gameObject);
		}
		if (Object.op_Implicit((Object)(object)effectSpawnedUnit))
		{
			effectSpawnedUnit.Spawn(((Component)val).gameObject);
		}
		spawnUnitAction?.Invoke(((Component)val).gameObject);
		if (transferHp)
		{
			float num = rootData.maxHealth / 2f / rootData.maxHealth;
			((Component)val).gameObject.AddComponent<HealthTransfer>().TransferHealth(val, num);
		}
		if (unitInvincibleFor != 0f)
		{
			UnitDontTakeDamageForSeconds obj = ((Component)val).gameObject.AddComponent<UnitDontTakeDamageForSeconds>();
			obj.seconds = unitInvincibleFor;
			obj.playOnStart = true;
		}
		SpawnerBlueprintHolder componentInChildren2 = ((Component)((Component)val).transform.root).GetComponentInChildren<SpawnerBlueprintHolder>();
		if (Object.op_Implicit((Object)(object)rootUnit) && Object.op_Implicit((Object)(object)componentInChildren2))
		{
			componentInChildren2.unitBlueprint = rootUnit.unitBlueprint;
		}
		return val;
	}

	private void InitializeOnSpawn()
	{
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Invalid comparison between Unknown and I4
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Invalid comparison between Unknown and I4
		//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: Invalid comparison between Unknown and I4
		RootUnitDataHolder rootUnitDataHolder = Object.FindObjectOfType<RootUnitDataHolder>();
		if ((Object)(object)rootUnitDataHolder != (Object)null)
		{
			Unit rootUnitData = rootUnitDataHolder.rootUnitData;
			rootUnit = rootUnitData;
		}
		teamHolder = ((Component)this).GetComponentInParent<TeamHolder>();
		effectSpawnedUnit = ((Component)this).GetComponentInParent<EffectSpawnedUnit>();
		rootData = ((Component)rootUnit).GetComponentInChildren<DataHandler>();
		isIceGiant = ((Component)((Component)this).transform.root).GetComponent<IceGiant>();
		blueprintHolder = ((Component)((Component)this).transform.root).GetComponentInChildren<SpawnerBlueprintHolder>();
		if (Object.op_Implicit((Object)(object)rootUnit) && (int)rootUnit.RigType != 1 && (int)rootUnit.RigType != 2 && (int)rootUnit.RigType != 5)
		{
			isHumanoid = false;
		}
		if (spawnRandomUnits && units.Count > 0)
		{
			unitBlueprint = units[Random.Range(0, units.Count)];
		}
		if (useHealthOfRootForAmount && !isHumanoid)
		{
			amountToSpawn += Mathf.RoundToInt(rootData.maxHealth);
		}
		if (spawnOnStart)
		{
			Spawnerino();
		}
	}

	private bool IsAllowedToSpawnInMultiplayer()
	{
		InitializeForMultiplayer();
		if (!((Object)(object)parentProjectile != (Object)null) || !parentProjectile.IsRemotelyControlled)
		{
			if ((Object)(object)parentUnit != (Object)null)
			{
				return !parentUnit.IsRemotelyControlled;
			}
			return true;
		}
		return false;
	}

	private void InitializeForMultiplayer()
	{
		if (!didInitializeForMultiplayer)
		{
			didInitializeForMultiplayer = true;
			if (BoltNetwork.IsRunning)
			{
				parentProjectile = ((Component)this).GetComponentInParent<Projectile>();
				parentUnit = ((Component)this).GetComponentInParent<Unit>();
			}
		}
	}

	public deadSpawner__0()
	{
		spawnOnStart = true;
		amountToSpawn = 1;
		useUnitTeam = true;
		originalSize = 1f;
		originalhealth = 1f;
		originalMass = 1f;
		sizeMultiplier = 1f;
		massMultiplier = 1f;
		originalHoldingWithTwoHands = true;
		originalanimationMultiplier = 1f;
		originalStepMultiplier = 1f;
		originalBalanceMultiplier = 1f;
		originalBalanceForceMultiplier = 1f;
		time = 1f;
		units = new List<UnitBlueprint>();
		isHumanoid = true;
		allowedUnitsToSpawn = 1;
	}

	public void SpawnUnit()
	{
		if ((Object)(object)rootUnitDataHolder != (Object)null)
		{
			Unit val = rootUnitDataHolder.CreateNewRootUnit();
			if ((Object)(object)val != (Object)null)
			{
				unitBlueprint = val.unitBlueprint;
				Spawn();
			}
		}
		else
		{
			Debug.LogError((object)"RootUnitDataHolder not assigned!");
		}
	}
}
public class RootUnitDataHolder : MonoBehaviour
{
	public Unit rootUnitData;

	public Unit CreateNewRootUnit()
	{
		if ((Object)(object)rootUnitData != (Object)null)
		{
			Unit obj = Object.Instantiate<Unit>(rootUnitData);
			obj.data.health = rootUnitData.data.maxHealth * 0.5f;
			return obj;
		}
		Debug.LogError((object)"No rootUnitData stored in RootUnitDataHolder!");
		return null;
	}
}
public class RootUnitData
{
	public RootUnitData(Unit unit)
	{
		//IL_000b: Unknown result type (might be due to invalid IL or missing references)
		new GameObject("RootUnitDataHolder").AddComponent<RootUnitDataHolder>().rootUnitData = unit;
	}
}
public class BoomMove : MonoBehaviour
{
	public DodgeMove dodge;

	public UnityEvent unityEvent;

	private DataHandler data;

	public void OnTriggerEnter(Collider other)
	{
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
		Rigidbody attachedRigidbody = other.attachedRigidbody;
		if (!Object.op_Implicit((Object)(object)attachedRigidbody) || !Object.op_Implicit((Object)(object)((Component)attachedRigidbody).GetComponent<CollisionWeapon>()) || !Object.op_Implicit((Object)(object)((Component)attachedRigidbody).GetComponent<Compensation>()) || !Object.op_Implicit((Object)(object)((Component)attachedRigidbody).GetComponent<RemoveAfterSeconds>()))
		{
			return;
		}
		if (!Object.op_Implicit((Object)(object)data))
		{
			Unit component = ((Component)((Component)this).gameObject.transform.root).GetComponent<Unit>();
			if (Object.op_Implicit((Object)(object)component))
			{
				data = component.data;
			}
		}
		TeamHolder componentInChildren = ((Component)((Component)attachedRigidbody).transform.root).GetComponentInChildren<TeamHolder>();
		if (!Object.op_Implicit((Object)(object)componentInChildren) || !Object.op_Implicit((Object)(object)data) || data.unit.Team != componentInChildren.team)
		{
			dodge.targetObject = ((Component)attachedRigidbody).transform;
			unityEvent.Invoke();
		}
	}
}
public class SelfAddEffectOnHit : CollisionWeaponEffect
{
	public bool ignoreTeamMates;

	public UnitEffectBase SelfEffectPrefab;

	public override void DoEffect(Transform hitTransform, Collision hit)
	{
		//IL_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		Unit component = ((Component)((Component)this).transform.root).GetComponent<Unit>();
		if ((Object)(object)component == (Object)null)
		{
			Debug.LogError((object)"Attacker unit not found!");
			return;
		}
		if (ignoreTeamMates)
		{
			Unit component2 = ((Component)hitTransform.root).GetComponent<Unit>();
			if ((Object)(object)component2 != (Object)null && component.Team == component2.Team)
			{
				return;
			}
		}
		UnitEffectBase obj = Object.Instantiate<UnitEffectBase>(SelfEffectPrefab, ((Component)component).transform);
		((Component)obj).transform.position = ((Component)component).transform.position;
		((Component)obj).transform.rotation = Quaternion.LookRotation(component.data.mainRig.position);
		TeamHolder.AddTeamHolder(((Component)obj).gameObject, component, (TeamHolder)null);
		obj.DoEffect();
	}
}
public class AttackSpeedOverTimeEffect2 : UnitEffectBase
{
	public float cooldownMultiplier = 1f;

	public float attackSpeedToAdd = 0.1f;

	public float decaySpeed;

	public float scalingDecaySpeed;

	public float dragWhenAdd = 0.9f;

	public UnityEvent procEvent;

	private Unit unit;

	private bool inited;

	private void Init()
	{
		if (!inited)
		{
			inited = true;
			unit = ((Component)((Component)this).transform.root).GetComponentInChildren<Unit>();
		}
	}

	public override void DoEffect()
	{
		AddAttackSpeed();
	}

	public override void Ping()
	{
		AddAttackSpeed();
	}

	private void AddAttackSpeed()
	{
		Init();
		procEvent.Invoke();
		if (Object.op_Implicit((Object)(object)unit))
		{
			unit.AddAttackSpeed(attackSpeedToAdd);
			float num = unit.attackSpeedMultiplier * dragWhenAdd - unit.attackSpeedMultiplier;
			unit.AddAttackSpeed(num);
		}
	}

	private void Update

ChouChou's Units.dll

Decompiled 3 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using ChouChousUnit;
using DM;
using FhpSLib;
using FhpSLib.BundleModCore;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.AI.Systems;
using Landfall.TABS.GameMode;
using Landfall.TABS.GameState;
using Landfall.TABS.Save;
using Landfall.TABS.UnitEditor;
using Landfall.TABS.Workshop;
using SLMA;
using TFBGames;
using Unity.Collections;
using Unity.Entities;
using Unity.Jobs;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ChouChou的兵种")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("made in SFTBM by FhpSlime")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ChouChousUnit
{
	public static class UManager
	{
		public static class Units
		{
			public static void FireGiant(LandfallContentDatabase db)
			{
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Expected O, but got Unknown
				//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0100: Unknown result type (might be due to invalid IL or missing references)
				//IL_0129: Unknown result type (might be due to invalid IL or missing references)
				//IL_0229: Unknown result type (might be due to invalid IL or missing references)
				//IL_0238: Expected O, but got Unknown
				//IL_025d: Unknown result type (might be due to invalid IL or missing references)
				//IL_026c: Expected O, but got Unknown
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("熔岩发射").AddComponent<StoneThrower>()
					.stonePrefab = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("石头");
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("石头").AddComponent<StoneThrower.DestorySelf>();
				UnitBlueprint val = SLMATool.CreateUnit("熔岩巨人", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("火巨人"));
				val.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("熔岩巨人");
				val.massMultiplier = ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"]).massMultiplier;
				val.movementSpeedMuiltiplier = ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"]).movementSpeedMuiltiplier;
				val.sizeMultiplier = ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"]).sizeMultiplier;
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("熔岩巨人拳");
				val.LeftWeapon = val.RightWeapon;
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("红温").AddComponent<DoMoveWhenEffect>();
				val.m_props = (GameObject[])(object)new GameObject[2]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火巨人服装 - 副本"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火巨人服装")
				};
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("熔岩发射"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("红温")
				};
				s.SetField<UnitBlueprint>(val, "deathRef", s.GetField<UnitBlueprint>((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"], "deathRef"));
				s.SetField<UnitBlueprint>(val, "vocalRef", s.GetField<UnitBlueprint>((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SECRET_ICEGIANT"], "vocalRef"));
				val.Entity.SetUnlockKey("FireGiant");
				val.health = 12000f;
				val.forceCost = 10000u;
				val.Validate();
			}

			public static void Gladiator(LandfallContentDatabase db)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				UnitBlueprint val = SLMATool.CreateUnit("角斗士", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("短剑角斗士图标"));
				val.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士模型");
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士剑");
				val.LeftWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士拳");
				WeaponAddEffectPoss weaponAddEffectPoss = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士拳").AddComponent<WeaponAddEffectPoss>();
				weaponAddEffectPoss.poss = 30.1f;
				weaponAddEffectPoss.EffectPrefab = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("E_眩晕").GetComponentInChildren<UnitEffectBase>();
				val.m_props = (GameObject[])(object)new GameObject[8]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士01"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士02"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士03"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士04"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士05"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士06"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士07"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("角斗士08")
				};
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { mod.GetAssetBundle("Mod").LoadAsset<GameObject>("狂暴") };
				val.Entity.SetUnlockKey("Gladiator");
				val.VocalPathData.Category = "Viking Attack Vocals";
				val.VocalPathData.Effect = "Berserker";
				val.VocalPathData.EffectPitch = 1f;
				val.VocalPathData.EffectVolume = 1f;
				s.SetField<UnitBlueprint>(val, "deathRef", (object)"Viking Death Vocals/Berserker");
				s.SetField<UnitBlueprint>(val, "vocalRef", (object)"Viking Attack Vocals/Berserker");
				val.health = 580f;
				val.forceCost = 500u;
				val.massMultiplier = 1.5f;
			}

			public static void Dwarves(LandfallContentDatabase db)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				UnitBlueprint val = SLMATool.CreateUnit("重装矮人", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("重装矮人图标"));
				val.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人体型");
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("重装战锤");
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("重装战锤").AddComponent<CanChangeMode>();
				val.LeftWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("重装盾牌");
				val.m_props = (GameObject[])(object)new GameObject[9]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人01"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人02"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人03"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人04"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人05"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人06"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人07"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人08"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人09")
				};
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { mod.GetAssetBundle("Mod").LoadAsset<GameObject>("锤子形态切换") };
				HammerChageMode hammerChageMode = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("锤子形态切换").AddComponent<HammerChageMode>();
				hammerChageMode.green = mod.GetAssetBundle("Mod").LoadAsset<Material>("Glow Green");
				hammerChageMode.red = mod.GetAssetBundle("Mod").LoadAsset<Material>("Glow Red");
				hammerChageMode.Heal = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("E_治愈");
				val.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("矮人Voice");
				val.Validate();
				val.health = 1800f;
				val.forceCost = 1500u;
				val.massMultiplier = 20f;
				val.Entity.SetUnlockKey("Dwarves");
				val.sizeMultiplier = 1.2f;
				val.movementSpeedMuiltiplier = 1.2f;
			}

			public static void Ghoul(LandfallContentDatabase db)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00da: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_022e: Unknown result type (might be due to invalid IL or missing references)
				//IL_023f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0289: Unknown result type (might be due to invalid IL or missing references)
				//IL_028f: Expected O, but got Unknown
				UnitBlueprint val = SLMATool.CreateUnit("尸鬼", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("尸鬼Icon"));
				UnitBlueprint val2 = SLMATool.CreateUnit("尸鬼灵魂", (UnitBlueprint)null, (Faction)null, (Sprite)null);
				val2.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("灵魂");
				val2.movementSpeedMuiltiplier = 4f;
				val2.health = 1f;
				val.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼模型DontSetEye");
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("长柄盾斧");
				val.holdinigWithTwoHands = true;
				val.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
				val.m_props = (GameObject[])(object)new GameObject[8]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼01"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼02"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼03"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼04"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼05"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼06"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼07"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("尸鬼08")
				};
				GameObject val3 = UPool.MyPool.AddObject("尸鬼灵魂出窍", CreateNewMove("尸鬼", 541613124), true, (HideFlags)52, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("尸鬼Icon"), 551239154, true);
				((CharacterItem)val3.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
				{
					new Tag
					{
						tagType = (TagType)0,
						value = "ChouChou'sUnits"
					}
				};
				val3.AddComponent<Ghoul>().blueprint = val2;
				val2.m_props = (GameObject[])(object)new GameObject[0];
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
				{
					val3,
					(GameObject)SLMALoader.SDic["moves"]["SpinToWin_Red Jade"]
				};
				val.Entity.SetUnlockKey("Ghorl");
				val.VocalPathData.Category = "Halloween Attack Vocals";
				val.VocalPathData.Effect = "SkeletonWarrior";
				val.VocalPathData.EffectPitch = 0.8f;
				val.VocalPathData.EffectVolume = 1f;
				s.SetField<UnitBlueprint>(val, "deathRef", (object)"Halloween Attack Vocals/SkeletonWarrior");
				s.SetField<UnitBlueprint>(val, "vocalRef", (object)"Halloween Attack Vocals/SkeletonWarrior");
				val.health = 1200f;
				val.forceCost = 800u;
				val.massMultiplier = 10f;
				val.Validate();
			}

			public static void Mourners(LandfallContentDatabase db)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_016c: Expected O, but got Unknown
				//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
				//IL_0208: Unknown result type (might be due to invalid IL or missing references)
				UnitBlueprint val = SLMATool.CreateUnit("送葬人", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("送葬人icon"));
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("铲子_Weapon");
				WeaponAddEffectPoss weaponAddEffectPoss = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("铲子_Weapon").AddComponent<WeaponAddEffectPoss>();
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("拍进地底").AddComponent<MournersEffect>();
				weaponAddEffectPoss.EffectPrefab = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("拍进地底").GetComponent<UnitEffectBase>();
				weaponAddEffectPoss.poss = 40f;
				val.holdinigWithTwoHands = true;
				val.m_props = (GameObject[])(object)new GameObject[5]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("送葬人01"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("送葬人02"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("送葬人03"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("送葬人04"),
					(GameObject)SLMALoader.SDic["clothes"]["Farmer_Moustache001"]
				};
				GameObject val2 = UPool.MyPool.AddObject("入殓", CreateNewMove("per"), true, (HideFlags)52, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("送葬人icon"), 541154, true);
				val2.GetComponentInChildren<ConditionalEvent>().events[0].SetMoveConditionalValue((ConditionType)0, (ValueType)0, 1E+15f);
				val2.GetComponentInChildren<ConditionalEvent>().events[0].SetMoveConditionalValue((ConditionType)1, (ValueType)1, 1E+19f);
				((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
				{
					new Tag
					{
						tagType = (TagType)0,
						value = "ChouChou'sUnits"
					}
				};
				val2.AddComponent<MournersMove>();
				val.Entity.SetUnlockKey("Mourners");
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val2 };
				s.SetField<UnitBlueprint>(val, "deathRef", (object)"Halloween Attack Vocals/Swordcaster");
				s.SetField<UnitBlueprint>(val, "vocalRef", (object)"Halloween Death Vocals/Swordcaster");
				val.health = 357.14285f;
				val.forceCost = 1000u;
				val.sizeMultiplier = 1.2f;
				val.massMultiplier = 1.5f;
				val.attackSpeedMultiplier = 1.5f;
				val.movementSpeedMuiltiplier = 1.5f;
				val.Validate();
			}

			public static void TheCount(LandfallContentDatabase db)
			{
				//IL_001f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				//IL_0176: Unknown result type (might be due to invalid IL or missing references)
				//IL_019a: Expected O, but got Unknown
				//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b4: Expected O, but got Unknown
				//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f4: Expected O, but got Unknown
				//IL_0376: Unknown result type (might be due to invalid IL or missing references)
				//IL_037c: Expected O, but got Unknown
				//IL_0397: Unknown result type (might be due to invalid IL or missing references)
				//IL_039d: Expected O, but got Unknown
				//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_03be: Expected O, but got Unknown
				UnitBlueprint val = SLMATool.CreateUnit("吸血鬼伯爵", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("吸血鬼伯爵icon"));
				val.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血剑");
				val.RightWeapon.AddComponent<TheCountAttack>();
				val.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼体型");
				val.holdinigWithTwoHands = false;
				val.m_props = (GameObject[])(object)new GameObject[6]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-00"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-01"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-02"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-03"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-04"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵-05")
				};
				val.Entity.SetUnlockKey("TheCount");
				UnitBlueprint val2 = SLMATool.CreateUnit("吸血鬼伯爵-蝙蝠", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_SUBUNITS_VAMPBAT"], (Faction)null, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("吸血鬼伯爵icon"));
				val2.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵蝙蝠");
				val2.UnitBase.AddComponent<BatHealth>();
				val2.UnitBase.AddComponent<TheCountBat>();
				((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵蝙蝠").transform.GetChild(1).GetChild(0).GetChild(0)
					.GetChild(3)
					.GetChild(0)
					.GetChild(3)).gameObject.AddComponent<BatWing>().isLeftWing = true;
				((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼伯爵蝙蝠").transform.GetChild(1).GetChild(0).GetChild(0)
					.GetChild(3)
					.GetChild(0)
					.GetChild(4)).gameObject.AddComponent<BatWing>().isLeftWing = false;
				val2.health = 600f;
				GameObject val3 = UPool.MyPool.AddObject("变身蝙蝠", (GameObject)SLMALoader.SDic["moves"]["Move_BatTransformation"], true, (HideFlags)52, (Sprite)null, 0, false);
				val3.GetComponentInChildren<UnitSpawner>().unitBlueprint = val2;
				GameObject val4 = UPool.MyPool.AddObject("变身吸血鬼", (GameObject)SLMALoader.SDic["moves"]["Move_Vamp"], true, (HideFlags)52, (Sprite)null, 0, false);
				val4.GetComponentInChildren<UnitSpawner>().unitBlueprint = val;
				val2.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val4 };
				val2.movementSpeedMuiltiplier = 3f;
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[6]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("吸血鬼法阵"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("猩红审判"),
					(GameObject)SLMALoader.SDic["moves"]["SwordArtParry"],
					(GameObject)SLMALoader.SDic["moves"]["Fencer_Dodge"],
					(GameObject)SLMALoader.SDic["moves"]["Wings_Leg_SuperP"],
					val3
				};
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("猩红审判").AddComponent<BloodPunish>();
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("E_吸血鬼法阵").AddComponent<TheCountEffectChange>();
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("落剑").AddComponent<BSword>();
				s.SetField<UnitBlueprint>(val, "deathRef", (object)"Halloween Attack Vocals/VampireBiter");
				s.SetField<UnitBlueprint>(val, "vocalRef", (object)"Halloween Death Vocals/VampireBiter");
				val.health = 1041.6666f;
				val.sizeMultiplier = 1.2f;
				val.forceCost = 4000u;
				val.massMultiplier = 2f;
				val.attackSpeedMultiplier = 1.5f;
				val.movementSpeedMuiltiplier = 1.5f;
				val.Validate();
			}

			public static void RedKing(LandfallContentDatabase db)
			{
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Expected O, but got Unknown
				//IL_0057: Unknown result type (might be due to invalid IL or missing references)
				//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)
				ProjectileEntity[] array = Resources.FindObjectsOfTypeAll<ProjectileEntity>();
				foreach (ProjectileEntity val in array)
				{
					((Component)val).gameObject.AddComponent<RaycastTrailSp>();
					Debug.Log((object)val);
					if (!Object.op_Implicit((Object)(object)((Component)val).GetComponent<RaycastTrail>()))
					{
						RaycastTrailSp raycastTrailSp = ((Component)val).gameObject.AddComponent<RaycastTrailSp>();
						raycastTrailSp.mask = ((GameObject)SLMALoader.SDic["projectiles"]["P_FireBall"]).GetComponent<RaycastTrail>().mask;
						raycastTrailSp.radius = 0.5f;
						Debug.LogError((object)val);
					}
				}
				UnitBlueprint val2 = SLMATool.CreateUnit("深红之王", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("深红图标"));
				val2.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王模型");
				val2.holdinigWithTwoHands = true;
				((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").transform.GetChild(2)).gameObject.AddComponent<RedKingBlock>().blockHand = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").GetComponentInChildren<DarkPHandsBlock>()
					.blockHand;
				((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").transform.GetChild(3)).gameObject.AddComponent<RedKingBlock>().blockHand = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").GetComponentInChildren<DarkPHandsBlock>()
					.blockHand;
				Object.Destroy((Object)(object)((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").transform.GetChild(2)).gameObject.GetComponentInChildren<DarkPHandsBlock>());
				Object.Destroy((Object)(object)((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡").transform.GetChild(3)).gameObject.GetComponentInChildren<DarkPHandsBlock>());
				UnitBlueprint val3 = SLMATool.CreateUnit("深红高塔", (UnitBlueprint)null, (Faction)null, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("深红图标"));
				val3.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红柱子");
				val3.rangeMultiplier = 100f;
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王模型").AddComponent<RedKingAlive>();
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王模型").AddComponent<RedKing>()
					.unit = val3;
				val2.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
				{
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红之王格挡"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("剑气"),
					mod.GetAssetBundle("Mod").LoadAsset<GameObject>("鲜血回响")
				};
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("鲜血回响").AddComponent<EchoBlood>();
				val2.health = 7777777f;
				val2.forceCost = 9999999u;
				val2.sizeMultiplier = 1.55f;
				val2.Entity.SetUnlockKey("RedKing");
				val2.massMultiplier = 50f;
				val2.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("食肉大剑_W");
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("食肉大剑_W").AddComponent<WeaponTrail2>();
				val2.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("深红之王");
				val2.movementSpeedMuiltiplier = 1.5f;
				val2.Validate();
				((Component)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红剑气").GetComponentInChildren<Explosion>()).gameObject.AddComponent<ShenHongSw>();
				RedKingCamp(db);
			}

			public static void RedKingCamp(LandfallContentDatabase db)
			{
				//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
				UnitBlueprint obj = SLMATool.CreateUnit("深红之王-观察者", (UnitBlueprint)null, (Faction)null, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("深红图标"));
				obj.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红王座");
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红王座").AddComponent<DeathQuit>();
				obj.targetingPriorityMultiplier = 0f;
				obj.health = 77777f;
				obj.forceCost = 99999999u;
				obj.massMultiplier = 20000f;
				obj.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("深红之王");
				obj.Validate();
				UnitBlueprint obj2 = SLMATool.CreateUnit("深红传送门", (UnitBlueprint)null, (Faction)null, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("深红图标"));
				obj2.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红传送门");
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红传送门").AddComponent<UnlockOnDeath>();
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("深红传送门").AddComponent<SpawnDoor>();
				obj2.health = 30000f;
				obj2.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("深红之王");
				obj2.targetingPriorityMultiplier = 10f;
				obj2.Validate();
				Debug.Log((object)"1");
				mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignLevelAsset>("深红挑战").MapAsset = HelpLibrary.landfallContentDatabase.GetMapAsset(new DatabaseID(89, 8489));
			}
		}

		public static string modname;

		public static string modder;

		private static string com;

		public static SLMABundleMod mod;

		public static List<Unit> bases;

		public static GameObject hiteffect;

		static UManager()
		{
			modname = "ChineseMythology";
			modder = "FhpSlime";
			bases = new List<Unit>();
		}

		public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
		}

		public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
		{
		}

		public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
		{
		}

		public static void Init(LandfallContentDatabase db)
		{
			//IL_0005: 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_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_0785: Unknown result type (might be due to invalid IL or missing references)
			//IL_081a: Unknown result type (might be due to invalid IL or missing references)
			//IL_081f: Unknown result type (might be due to invalid IL or missing references)
			//IL_082a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0538: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("ChouChouUnits").PatchAll();
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("chouchou");
			AssetBundle val = AssetBundle.LoadFromStream(stream);
			mod = SLMABundleMod.CreatSLMABundleMod("ChouChou", "1.0");
			mod.AddAssetBundle("Mod", val);
			GameObject[] array = val.LoadAllAssets<GameObject>();
			foreach (GameObject val2 in array)
			{
				Debug.Log((object)((Object)val2).name);
				if (Object.op_Implicit((Object)(object)val2.GetComponent<WeaponItem>()) && !HelpLibrary.m_weapons.ContainsKey(((CharacterItem)val2.GetComponent<WeaponItem>()).Entity.GUID))
				{
					_ = val2.gameObject;
					Dictionary<DatabaseID, GameObject> weapons = HelpLibrary.m_weapons;
					weapons.Add(((CharacterItem)val2.GetComponentInChildren<WeaponItem>()).Entity.GUID, val2.gameObject);
					HelpLibrary.m_weapons = weapons;
					Dictionary<DatabaseID, Object> dictionary = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary.Add(((CharacterItem)val2.GetComponentInChildren<WeaponItem>()).Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary);
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<ProjectileEntity>()) && !HelpLibrary.m_weapons.ContainsKey(val2.GetComponent<ProjectileEntity>().Entity.GUID))
				{
					_ = val2.gameObject;
					Dictionary<DatabaseID, GameObject> projectiles = HelpLibrary.m_projectiles;
					projectiles.Add(val2.GetComponentInChildren<ProjectileEntity>().Entity.GUID, val2.gameObject);
					HelpLibrary.m_projectiles = projectiles;
					Dictionary<DatabaseID, Object> dictionary2 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary2.Add(val2.GetComponentInChildren<ProjectileEntity>().Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary2);
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<PropItem>()) && !HelpLibrary.m_characterProps.ContainsKey(((CharacterItem)val2.GetComponent<PropItem>()).Entity.GUID))
				{
					_ = val2.gameObject;
					Dictionary<DatabaseID, GameObject> characterProps = HelpLibrary.m_characterProps;
					characterProps.Add(((CharacterItem)val2.GetComponentInChildren<PropItem>()).Entity.GUID, val2.gameObject);
					HelpLibrary.m_characterProps = characterProps;
					Dictionary<DatabaseID, Object> dictionary3 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary3.Add(((CharacterItem)val2.GetComponentInChildren<PropItem>()).Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary3);
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<SpecialAbility>()) && !HelpLibrary.m_combatMoves.ContainsKey(((CharacterItem)val2.GetComponent<SpecialAbility>()).Entity.GUID))
				{
					_ = val2.gameObject;
					Dictionary<DatabaseID, GameObject> combatMoves = HelpLibrary.m_combatMoves;
					combatMoves.Add(((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).Entity.GUID, val2.gameObject);
					HelpLibrary.m_combatMoves = combatMoves;
					Dictionary<DatabaseID, Object> dictionary4 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary4.Add(((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary4);
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<Unit>()) && !HelpLibrary.m_unitBases.ContainsKey(val2.GetComponent<Unit>().Entity.GUID))
				{
					GameObject gameObject = val2.gameObject;
					if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<TeamColor>()))
					{
						TeamColor[] componentsInChildren = gameObject.GetComponentsInChildren<TeamColor>();
						foreach (TeamColor val3 in componentsInChildren)
						{
							if ((Object)(object)val3.redMaterial == (Object)null)
							{
								int materialID = val3.materialID;
								s.DeepCopyOf<TeamColor>(val3, ((GameObject)SLMALoader.SDic["bases"]["Humanoid"]).GetComponentInChildren<TeamColor>());
								val3.materialID = materialID;
							}
						}
					}
					if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<EyeSpawner>()) && !((Object)gameObject).name.Contains("DontSetEye"))
					{
						gameObject.GetComponentInChildren<EyeSpawner>().eyeObject = ((GameObject)SLMALoader.SDic["bases"]["Humanoid"]).GetComponentInChildren<EyeSpawner>().eyeObject;
					}
					Dictionary<DatabaseID, GameObject> unitBases = HelpLibrary.m_unitBases;
					bases.Add(val2.GetComponentInChildren<Unit>());
					unitBases.Add(val2.GetComponentInChildren<Unit>().Entity.GUID, val2.gameObject);
					HelpLibrary.m_unitBases = unitBases;
					Dictionary<DatabaseID, Object> dictionary5 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary5.Add(val2.GetComponentInChildren<Unit>().Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary5);
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<SpecialAbility>()) && !HelpLibrary.m_combatMoves.ContainsKey(((CharacterItem)val2.GetComponent<SpecialAbility>()).Entity.GUID))
				{
					_ = val2.gameObject;
					Dictionary<DatabaseID, GameObject> combatMoves2 = HelpLibrary.m_combatMoves;
					combatMoves2.Add(((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).Entity.GUID, val2.gameObject);
					HelpLibrary.m_combatMoves = combatMoves2;
					Dictionary<DatabaseID, Object> dictionary6 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary6.Add(((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).Entity.GUID, (Object)(object)val2.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary6);
				}
			}
			Material[] array2 = val.LoadAllAssets<Material>();
			foreach (Material val4 in array2)
			{
				if (Object.op_Implicit((Object)(object)Shader.Find(((Object)val4.shader).name)))
				{
					val4.shader = Shader.Find(((Object)val4.shader).name);
				}
			}
			SoundBank[] array3 = val.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj in array3)
			{
				SoundBank soundBank = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list = soundBank.Categories.ToList();
				SoundBankCategory[] categories = obj.Categories;
				foreach (SoundBankCategory item in categories)
				{
					list.Add(item);
				}
				soundBank.Categories = list.ToArray();
			}
			Dictionary<DatabaseID, Object> dictionary7 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
			Dictionary<DatabaseID, VoiceBundle> dictionary8 = (Dictionary<DatabaseID, VoiceBundle>)typeof(LandfallContentDatabase).GetField("m_voiceBundles", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(HelpLibrary.landfallContentDatabase);
			VoiceBundle[] array4 = val.LoadAllAssets<VoiceBundle>();
			foreach (VoiceBundle val5 in array4)
			{
				if (!dictionary8.ContainsKey(val5.Entity.GUID))
				{
					dictionary8.Add(val5.Entity.GUID, val5);
				}
				dictionary7.Add(val5.Entity.GUID, (Object)(object)val5);
			}
			typeof(LandfallContentDatabase).GetField("m_voiceBundles", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(HelpLibrary.landfallContentDatabase, dictionary8);
			typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary7);
			ServiceLocator.GetService<CustomContentLoaderModIO>().QuickRefresh((WorkshopContentType)0, (Action)null);
			new GameObject
			{
				name = "MapsCore",
				hideFlags = (HideFlags)52
			}.AddComponent<ScenesManager>();
			Init2(db);
			Init3();
			DoTrans();
		}

		public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
		}

		public static void TryChangeColorbyindex(this GameObject gameObject, Color color, int index)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Material val = new Material(Shader.Find("Standard"));
			val.SetColor("_Color", color);
			val.SetFloat("_Mode", 3f);
			val.SetInt("_SrcBlend", 5);
			val.SetInt("_DstBlend", 10);
			val.EnableKeyword("_ALPHABLEND_ON");
			val.renderQueue = 3000;
			if (Object.op_Implicit((Object)(object)gameObject.GetComponentInChildren<TeamColor>()))
			{
				Object.Destroy((Object)(object)gameObject.GetComponentInChildren<TeamColor>());
			}
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				Material[] materials = componentsInChildren[i].materials;
				int num = 0;
				if (num < materials.Length)
				{
					componentsInChildren[i].materials[num] = val;
					break;
				}
			}
		}

		public static Sprite GetSprite(string name)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
			Texture2D val = new Texture2D(4, 4);
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, (int)stream.Length);
			ImageConversion.LoadImage(val, array);
			return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
		}

		public static void DestoryAll<T>(this GameObject game) where T : Object
		{
			if (Object.op_Implicit((Object)(object)game.GetComponentInChildren<T>()))
			{
				T[] componentsInChildren = game.GetComponentsInChildren<T>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					Object.Destroy((Object)(object)componentsInChildren[i]);
				}
			}
		}

		public static GameObject CreateNewMove(string name, int id = 0)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Expected O, but got Unknown
			GameObject obj = UPool.MyPool.AddObject(name, (GameObject)SLMALoader.SDic["moves"]["Halfling_Jump"], true, (HideFlags)52, (Sprite)null, id, false);
			obj.DestoryAll<DodgeMove>();
			((UnityEventBase)obj.GetComponentInChildren<ConditionalEvent>().events[0].turnOnEvent).RemoveAllListeners();
			((UnityEventBase)obj.GetComponentInChildren<ConditionalEvent>().events[0].continuousEvent).RemoveAllListeners();
			return obj;
		}

		public static void SetMoveConditionalValue(this ConditionalEventInstance gameObject, ConditionType type, ValueType valuet, float value)
		{
			//IL_0012: 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)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			bool flag = false;
			EventCondition[] conditions = gameObject.conditions;
			foreach (EventCondition val in conditions)
			{
				if (val.conditionType == type)
				{
					val.valueType = valuet;
					val.value = value;
					flag = true;
				}
			}
			if (!flag)
			{
				List<EventCondition> list = gameObject.conditions.ToList();
				list.Add(new EventCondition
				{
					conditionType = type,
					valueType = valuet,
					value = value
				});
				gameObject.conditions = list.ToArray();
			}
		}

		public static bool LoadAssetBundle(SLMABundleMod mod, string name)
		{
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			AssetBundle assetBundle = mod.GetAssetBundle(name);
			if (!Object.op_Implicit((Object)(object)assetBundle))
			{
				return false;
			}
			GameObject[] array = assetBundle.LoadAllAssets<GameObject>();
			foreach (GameObject val in array)
			{
				if (val.GetComponentInChildren<IDatabaseEntity>() != null)
				{
					IDatabaseEntity componentInChildren = val.GetComponentInChildren<IDatabaseEntity>();
					Dictionary<DatabaseID, GameObject> dictionary = new Dictionary<DatabaseID, GameObject>();
					if (componentInChildren is WeaponItem)
					{
						dictionary = HelpLibrary.m_weapons;
					}
					else if (componentInChildren is SpecialAbility)
					{
						dictionary = HelpLibrary.m_combatMoves;
					}
					else if (componentInChildren is PropItem)
					{
						dictionary = HelpLibrary.m_characterProps;
					}
					else if (componentInChildren is Unit)
					{
						dictionary = HelpLibrary.m_unitBases;
					}
					else if (componentInChildren is ProjectileEntity)
					{
						dictionary = HelpLibrary.m_projectiles;
					}
					Debug.Log((object)("[FhpSlib]Load:" + val.GetComponentInChildren<IDatabaseEntity>().Entity.Name));
					dictionary.Add(val.GetComponentInChildren<IDatabaseEntity>().Entity.GUID, val.gameObject);
					Dictionary<DatabaseID, Object> dictionary2 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
					dictionary2.Add(val.GetComponentInChildren<IDatabaseEntity>().Entity.GUID, (Object)(object)val.gameObject);
					typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary2);
					if (componentInChildren is WeaponItem)
					{
						HelpLibrary.m_weapons = dictionary;
					}
					else if (componentInChildren is SpecialAbility)
					{
						HelpLibrary.m_combatMoves = dictionary;
					}
					else if (componentInChildren is PropItem)
					{
						HelpLibrary.m_characterProps = dictionary;
					}
					else if (componentInChildren is Unit)
					{
						HelpLibrary.m_unitBases = dictionary;
					}
					else if (componentInChildren is ProjectileEntity)
					{
						HelpLibrary.m_projectiles = dictionary;
					}
				}
			}
			UnitBlueprint[] array2 = assetBundle.LoadAllAssets<UnitBlueprint>();
			foreach (UnitBlueprint val2 in array2)
			{
				Dictionary<DatabaseID, UnitBlueprint> unitBlueprints = HelpLibrary.m_unitBlueprints;
				unitBlueprints.Add(val2.Entity.GUID, val2);
				Dictionary<DatabaseID, Object> dictionary3 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
				dictionary3.Add(val2.Entity.GUID, (Object)(object)val2);
				typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary3);
				HelpLibrary.m_unitBlueprints = unitBlueprints;
			}
			Faction[] array3 = assetBundle.LoadAllAssets<Faction>();
			foreach (Faction val3 in array3)
			{
				Dictionary<DatabaseID, Faction> factions = HelpLibrary.m_factions;
				factions.Add(val3.Entity.GUID, val3);
				Dictionary<DatabaseID, Object> dictionary4 = (Dictionary<DatabaseID, Object>)typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(ContentDatabase.Instance().AssetLoader);
				dictionary4.Add(val3.Entity.GUID, (Object)(object)val3);
				typeof(AssetLoader).GetField("m_nonStreamableAssets", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(ContentDatabase.Instance().AssetLoader, dictionary4);
				HelpLibrary.m_factions = factions;
			}
			return true;
		}

		public static void Init2(LandfallContentDatabase db)
		{
			Units.FireGiant(db);
			Units.Gladiator(db);
			Units.Dwarves(db);
			Units.Ghoul(db);
			Units.Mourners(db);
			Units.TheCount(db);
			Units.RedKing(db);
		}

		public static void Init3()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			List<UnitBlueprint> list = new List<UnitBlueprint>();
			UnitBlueprint[] units = ((Faction)SLMALoader.SDic["factions"]["Secret"]).Units;
			foreach (UnitBlueprint item in units)
			{
				list.Add(item);
			}
			list.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
			((Faction)SLMALoader.SDic["factions"]["Secret"]).Units = list.ToArray();
		}

		public static void AddTransl(string key, string trans)
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			Dictionary<int, Language> dictionary = new Dictionary<int, Language>();
			dictionary.Add(0, (Language)7);
			dictionary.Add(1, (Language)0);
			dictionary.Add(2, (Language)8);
			dictionary.Add(3, (Language)3);
			dictionary.Add(4, (Language)1);
			dictionary.Add(5, (Language)6);
			dictionary.Add(6, (Language)4);
			dictionary.Add(7, (Language)2);
			Dictionary<Language, Dictionary<string, string>> dictionary2 = (Dictionary<Language, Dictionary<string, string>>)typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
			string[] array = trans.Split(new string[1] { "#" }, StringSplitOptions.RemoveEmptyEntries);
			for (int i = 0; i < dictionary.Count; i++)
			{
				dictionary2[dictionary[i]].Add(key, array[i]);
			}
			typeof(Localizer).GetField("m_localization", BindingFlags.Static | BindingFlags.NonPublic).SetValue(typeof(Localizer), dictionary2);
		}

		public static void DoTrans()
		{
			AddTransl("重装矮人", "重装矮人#Heavy Dwarf#ヘビー・ドワーフ#Schwere Zwerg#Nain lourd#Тяжелый гном#Anão Pesado#Nano pesante");
			AddTransl("角斗士", "角斗士#Gladiator#グラディエーター#Gladiator#Gladiateur#Гладиатор#Gladiador#Gladiaore");
			AddTransl("熔岩巨人", "熔岩巨人#Lava Giant#溶岩巨人#Lavagigant#Géant de lave#Лавовый гигант#Gigante de Lava#Gigante di lava");
			AddTransl("瘟疫医生", "瘟疫医生#Plague Doctor#ペスト医師#Pestarzt#Docteur de la peste#Чума Доктор#Médico da Peste#Medico della Peste");
			AddTransl("角斗士体型", "角斗士体型#Gladiator Form#グラディエーター形態#Gladiator Form#Forme de gladiateur#Форма гладиатора#Forma de Gladiador#Forma di Gladiatore");
			AddTransl("熔岩巨人体型", "熔岩巨人体型#Lava Giant Form#溶岩巨人形態#Lavagigant Form#Forme de géant de lave#Форма лавового гиганта#Forma de Gigante de Lava#Forma di Gigante di Lava");
			AddTransl("矮人体型", "矮人体型#Dwarf Form#ドワーフ形態#Zwerg Form#Forme de nain#Форма гнома#Forma de Anão#Forma di Nano");
			AddTransl("病变体", "病变体#Mutant#ミュータント#Mutant#Mutant#Мутант#Mutante#Mutante");
			AddTransl("吐毒", "吐毒#Poison Spit#毒吐き#Giftspritzen#Crachat empoisonné#Ядовитый плевок#Cuspe Venenoso#Sputo Velenoso");
			AddTransl("黑雾", "黑雾#Dark Mist#闇の霧#Dunkler Nebel#Brume noire#Темный туман#Névoa Negra#Nebbia Oscura");
			AddTransl("瘟疫召唤", "瘟疫召唤#Plague Summon#疫病召喚#Seuchenbeschwörung#Invocation de peste#Вызов чумы#Invocação de Peste#Invocazione di Peste");
			AddTransl("熔岩发射", "熔岩发射#Lava Blast#溶岩ブラスト#Lavageschoss#Tir de lave#Выстрел лавы#Explosão de Lava#Esplosione di Lava");
			AddTransl("暴怒", "暴怒#Rage#激怒#Wut#Rage#Ярость#Raiva#Rabbia");
			AddTransl("锤子切换", "锤子切换#Hammer Switch#ハンマー切り替え#Hammerwechsel#Changement de marteau#Переключение молота#Troca de Martelo#Cambio di Martello");
			AddTransl("熔岩巨人拳", "熔岩巨人拳#Lava Giant Fist#溶岩巨人拳#Lavagigantenfaust#Poing de géant de lave#Кулак лавового гиганта#Punho de Gigante de Lava#Pugno di Gigante di Lava");
			AddTransl("重装战锤", "重装战锤#Heavy Warhammer#重装戦鎚#Schwere Kriegshammer#Marteau de guerre lourd#Тяжелый боевой молот#Martelo de Guerra Pesado#Mazza da Guerra Pesante");
			AddTransl("重装盾牌", "重装盾牌#Heavy Shield#重装シールド#Schwerer Schild#Bouclier lourd#Тяжелый щит#Escudo Pesado#Scudo Pesante");
			AddTransl("西福斯短剑", "西福斯短剑#Sefos Shortsword#セフォス短剣#Sefos Kurzschwert#Épée courte de Sefos#Короткий меч Сефоса#Espada Curta de Sefos#Spada Corta di Sefos");
			AddTransl("角斗士拳", "角斗士拳#Gladiator's Fist#グラディエーターの拳#Gladiatorenfaust#Poing de gladiateur#Кулак гладиатора#Punho de Gladiador#Pugno di Gladiatore");
			AddTransl("手杖", "手杖#Staff#杖#Stab#Bâton#Посох#Cajado#Bastone");
			AddTransl("提灯", "提灯#Lantern#提灯#Laterne#Lanterne#Фонарь#Lanterna#Lanterna");
			AddTransl("病变魔之盾", "病变魔之盾#Mutant Demon's Shield#ミュータントデーモンの盾#Mutanten Dämonenschild#Bouclier de démon mutant#Щит демона-мутанта#Escudo de Demônio Mutante#Scudo di Demone Mutante");
			AddTransl("病变魔之剑", "病变魔之剑#Mutant Demon's Sword#ミュータントデーモンの剣#Mutanten Dänomenschwert#Épée de démon mutant#Меч демона-мутанта#Espada de Demônio Mutante#Spada di Demone Mutante");
			AddTransl("树杈", "树杈#Branch#枝#Zweig#Branche#Ветка#Ramo#Ramo");
			AddTransl("尸鬼", "尸鬼#Heavy Ghost#ヘビー・ゴースト#Schwere Geist#Fantôme lourd#Тяжелый призрак#Fantasma Pesado#Fantasma Pesado");
			AddTransl("长柄盾斧", "长柄盾斧#Long Pole Axe Shield#ロングポールアックスシールド#Langer Pfahlaxt Schild#Hache à longue poignée bouclier#Escudo de Hacha de Palo Largo#Щит с длинной топор#Escudo de Hacha de Palo Largo");
			AddTransl("食肉大剑", "食肉大剑#Meat Cleaver#ミートクリーバー#Fleischbeil#Hachoir à viande#Мясной тесак#Cuchiillo de carne#Affettatrice di carne");
			AddTransl("鲜血回响", "鲜血回响#Echo of Blood#血のエコー#Echo des Blutes#Écho de sang#Эхо крови#Eco de sangre#Eco di sangue");
			AddTransl("剑气", "剑气#Sword Qi#剣気#Schwert Qi#Épée Qi#Меч Ки#Espada Qi#Spada Qi");
			AddTransl("火伊布", "火伊布#Fire Eevee#ファイアイーブイ#Feuer Evoli#Eevee de feu#Огненное Иви#Eevee de fuego#Eevee di fuoco");
			AddTransl("天灾", "天灾#Calamity#災害#Katastrophe#Calamité#Бедствие#Calamidad#Calamità");
			AddTransl("火枪矮人", "火枪矮人#Dwarf with Firegun#火銃ドワーフ#Zwerg mit Feuergewehr#Nain avec arme à feu#Гном с огнестрельным ружьем#Enano con pistola de fuego#Nano con fucile da fuoco");
			AddTransl("燃烧爆炸桶", "燃烧爆炸桶#Burning Explosive Barrel#バーニング爆発性バレル#Brennendes Explosionsfass#Baril explosif brûlant#Горящий взрывной бочонок#Barril explosivo ardiente#Barile esplosivo ardente");
			AddTransl("深红之王", "深红之王#Crimson King#クリムゾンキング#König in Karmesin#Roi Cramoisi#Карминный король#Rey Carmesí#Re Cremisi");
			AddTransl("深红之王格挡", "深红之王格挡#Crimson King Crest#クリムゾンキングクレスト#König in Karmesin Wappen#Emblème du Roi Cramoisi#Герб Карминного короля#Escudo del Rey Carmesí#Stemma Re Cremisi");
			AddTransl("魔幻中世纪", "魔幻中世纪#The Magical Middle Ages#魔法中世紀#Magisches Mittelalter#Le Moyen Âge magique#Волшебное Средневековье#La mágica Edad Media#Il Medioevo magico");
			AddTransl("送葬人", "送葬人#Funeral Escort#送葬人#Leichenwagen#Funérarium#Похоронный эскорт#Funeral Escort#Funeral Escort");
			AddTransl("吸血鬼伯爵", "吸血鬼伯爵#Vampire Count#吸血鬼伯爵#Vampir-Gräf#Comte Vampire#Вампир-Граф#Vampiro#Conte Vampiro");
			AddTransl("你感受一个声音……在指引你去找……一把神器", "你感受一个声音……在指引你去找……一把神器#You sense a mysterious voice guiding you to find a legendary treasure#あなたは、神器を探しに向かうための謎の声に導かれています#Du hörst eine geheimnisvolle Stimme, die dich zu einem legendären Schatz führt#Tu sens une voix mystérieuse qui t'invite à trouver un trésor légendaire#Вы чувствуете таинственный голос, который направляет вас к легендарному сокровищу#Sientes una voz misteriosa que te guía hacia un tesoro legendario#Sentisci una voce misteriosa che ti guida verso un tesoro leggendario#");
			AddTransl("有趣的凡人,完成我的挑战你就可以拥有我的力量", "有趣的凡人,完成我的挑战你就可以拥有我的力量#Interesting mortal, complete my challenge and you can possess my power#面白い凡人、私の挑戦を完了すると、私の力を持つことができます#Interessanter Mensch, erfülle meine Herausforderung und du kannst meine Macht erlangen#Intéressant être humain, termine mon défi et tu pourras posséder mon puissance#Интересный человек, выполните мой вызов, и вы сможете обладать моими силами#Interesante persona, cumple mi desafío y podrás poseer mi poder#Interessante persona, completa il mio sfida e potrai possedere il mio potere#");
			AddTransl("门开了?!", "门开了?!#Is the door open?!#ドアが開いたの?!#Ist die Tür auf?!#Est-ce que la porte est ouverte?!#Дверь открыта?!#¿Está la puerta abierta?!#È la porta aperta?#!");
			AddTransl("找到钥匙了,试着打开门吧!", "找到钥匙了,试着打开门吧!#I found the key, let's try to open the door!#鍵を発見したため、ドアを開こう!#Ich habe den Schlüssel gefunden, lass uns die Tür öffnen!#J'ai trouvé la clé, essayons d'ouvrir la porte!#Я нашел ключ, давайте откроем дверь!#He encontrado la llave, ¡vamos a tratar de abrir la puerta!#Ho trovato la chiave, proviamo a aprire la porta!#");
			AddTransl("哈哈哈哈哈,很好,很有意思呢", "哈哈哈哈哈,很好,很有意思呢#Hahaha, that's great, isn't it?#ははははは、すごいですね#Hahaha, das ist großartig, nicht wahr?#Hahaha, c'est génial, n'est-ce pas?#Хахаха, это здорово, не так ли?#Hahaha, ¡eso es genial, ¿no?!#Hahaha, è fantastico, non è vero?#!");
			AddTransl("你通过了,,,", "你通过了,,,#You passed,,,#あなたは、,,#Du hast,,#Tu as,,#Вы прошли,,#Tú has,,#Hai,,#");
			AddTransl("真是有意思的人类呢", "真是有意思的人类呢#You're really an interesting human being#本当は興味深い人間ですね#Sie sind wirklich ein interessanter Mensch#Vous êtes vraiment un être humain intéressant#Вы на самом деле интересный человек#Eres realmente un ser humano interesante#Sei veramente un essere umano interessante#");
			AddTransl("你..作弊了", "你..作弊了#You cheated#あなたは、詐欺です#Du hast betrügt#Tu as triché#Вы совершили обман#Tú has engañado#Hai truffato#");
		}
	}
	[BepInPlugin("chouchou", "fhp.cc.chouchou", "1.0.0")]
	internal class Loader : BaseUnityPlugin
	{
		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("call");
		}

		private IEnumerator call()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
			yield return (object)new WaitForSecondsRealtime(0.3f);
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony(UManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				UManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
			Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime"));
			Debug.Log((object)(UManager.modder + "wished you a pleasant trip"));
		}
	}
}
public static class STool
{
	public static void RendererColorChanger(Renderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = renderers[i].materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static List<T> ToList<T>(T[] ts)
	{
		List<T> list = new List<T>();
		foreach (T item in ts)
		{
			list.Add(item);
		}
		return list;
	}

	public static void RendererColorChanger(MeshRenderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = ((Renderer)renderers[i]).materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = ((Renderer)renderers[i]).materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static void RendererColorChanger(Renderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			renderers[i].materials = color;
		}
	}

	public static void RendererColorChanger(MeshRenderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			((Renderer)renderers[i]).materials = color;
		}
	}

	public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			((Renderer)renderers[i]).materials = color;
		}
	}

	public static Vector3 AddV3(Vector3 vector3, float x, float y, float z)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: 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)
		return new Vector3(vector3.x + x, vector3.y + y, vector3.z + z);
	}
}
public class ScenesManager : MonoBehaviour
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c__17
	{
		public static readonly <>c__17 <>9 = new <>c__17();

		public static UnityAction <>9__0_0;

		public static Predicate<GameObject> <>9__0_1;

		internal void <SceneLoaded>b__0_0()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Expected O, but got Unknown
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Expected O, but got Unknown
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Expected O, but got Unknown
			TABSCampaignLevelAsset val = UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignLevelAsset>("深红挑战");
			val.BlueUnits[0].m_unitBlueprint = (UnitBlueprint)SLMATool.SLMADic["深红传送门"];
			val.BlueUnits[1].m_unitBlueprint = (UnitBlueprint)SLMATool.SLMADic["深红之王-观察者"];
			val.m_budget = 10000;
			HelpLibrary.m_campaignLevels.Add(val.Entity.GUID, val);
			HelpLibrary.m_campaigns.Add(UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou").Entity.GUID, UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou"));
			UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou").SetLevels((TABSCampaignLevelAsset[])(object)new TABSCampaignLevelAsset[1] { val });
			CampaignPlayerDataHolder.StartedPlayingNewCampaign(UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou"), 0, true, true);
			TABSSceneManager.LoadCampaign();
			List<string> list = (List<string>)OtherLibrary.GetField<TABSSave>((TABSSave)OtherLibrary.GetField<SteamSavesLoader>((SteamSavesLoader)ServiceLocator.GetService<ISaveLoaderService>(), "m_currentSave"), "m_UnlockedSecrets");
			list.Remove("RedKingChair");
			OtherLibrary.SetField<TABSSave>((TABSSave)OtherLibrary.GetField<SteamSavesLoader>((SteamSavesLoader)ServiceLocator.GetService<ISaveLoaderService>(), "m_currentSave"), "m_UnlockedSecrets", (object)list);
		}

		internal bool <SceneLoaded>b__0_1(GameObject x)
		{
			return Object.op_Implicit((Object)(object)x.GetComponent<UnitEditorManager>());
		}
	}

	public ScenesManager()
	{
		SceneManager.sceneLoaded += SceneLoaded;
	}

	public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		//IL_024b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0252: Expected O, but got Unknown
		//IL_0265: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02af: Expected O, but got Unknown
		//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f8: Invalid comparison between Unknown and I4
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Invalid comparison between Unknown and I4
		//IL_0305: Unknown result type (might be due to invalid IL or missing references)
		//IL_030c: Expected O, but got Unknown
		//IL_031f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0362: Unknown result type (might be due to invalid IL or missing references)
		//IL_0369: Expected O, but got Unknown
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01bf: Expected O, but got Unknown
		//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fa: 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_0204: Unknown result type (might be due to invalid IL or missing references)
		//IL_020e: Expected O, but got Unknown
		//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ed: Expected O, but got Unknown
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c6: Expected O, but got Unknown
		//IL_03d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0453: Unknown result type (might be due to invalid IL or missing references)
		//IL_045a: Expected O, but got Unknown
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		if (((Scene)(ref scene)).name.Contains("ForestMap"))
		{
			GameObject val = null;
			GameObject val2 = null;
			GameObject val3 = null;
			GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects();
			foreach (GameObject val4 in rootGameObjects)
			{
				if (((Object)val4).name == "深红塔 Lock")
				{
					val2 = val4;
				}
				if (((Object)val4).name == "深红塔")
				{
					val = val4;
				}
				if (((Object)val4).name == "王座")
				{
					val3 = val4;
				}
			}
			if (ServiceLocator.GetService<ISaveLoaderService>().HasUnlockedSecret("RedKingSwordFind") && (int)CampaignPlayerDataHolder.CurrentGameModeState != 4)
			{
				val.SetActive(false);
				val2.SetActive(false);
				val3.SetActive(true);
				((Component)val3.transform.GetChild(0)).gameObject.SetActive(true);
				UnityEvent unlockEvent = val3.GetComponent<SecretUnlock>().unlockEvent;
				object obj = <>c__17.<>9__0_0;
				if (obj == null)
				{
					UnityAction val5 = delegate
					{
						//IL_0031: Unknown result type (might be due to invalid IL or missing references)
						//IL_003b: Expected O, but got Unknown
						//IL_0052: Unknown result type (might be due to invalid IL or missing references)
						//IL_005c: Expected O, but got Unknown
						//IL_0072: Unknown result type (might be due to invalid IL or missing references)
						//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
						//IL_0116: Unknown result type (might be due to invalid IL or missing references)
						//IL_0125: Expected O, but got Unknown
						//IL_0125: Unknown result type (might be due to invalid IL or missing references)
						//IL_0134: Expected O, but got Unknown
						//IL_014b: Unknown result type (might be due to invalid IL or missing references)
						//IL_015a: Expected O, but got Unknown
						//IL_015a: Unknown result type (might be due to invalid IL or missing references)
						//IL_016a: Expected O, but got Unknown
						TABSCampaignLevelAsset val13 = UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignLevelAsset>("深红挑战");
						val13.BlueUnits[0].m_unitBlueprint = (UnitBlueprint)SLMATool.SLMADic["深红传送门"];
						val13.BlueUnits[1].m_unitBlueprint = (UnitBlueprint)SLMATool.SLMADic["深红之王-观察者"];
						val13.m_budget = 10000;
						HelpLibrary.m_campaignLevels.Add(val13.Entity.GUID, val13);
						HelpLibrary.m_campaigns.Add(UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou").Entity.GUID, UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou"));
						UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou").SetLevels((TABSCampaignLevelAsset[])(object)new TABSCampaignLevelAsset[1] { val13 });
						CampaignPlayerDataHolder.StartedPlayingNewCampaign(UManager.mod.GetAssetBundle("Mod").LoadAsset<TABSCampaignAsset>("ChouChou"), 0, true, true);
						TABSSceneManager.LoadCampaign();
						List<string> list2 = (List<string>)OtherLibrary.GetField<TABSSave>((TABSSave)OtherLibrary.GetField<SteamSavesLoader>((SteamSavesLoader)ServiceLocator.GetService<ISaveLoaderService>(), "m_currentSave"), "m_UnlockedSecrets");
						list2.Remove("RedKingChair");
						OtherLibrary.SetField<TABSSave>((TABSSave)OtherLibrary.GetField<SteamSavesLoader>((SteamSavesLoader)ServiceLocator.GetService<ISaveLoaderService>(), "m_currentSave"), "m_UnlockedSecrets", (object)list2);
					};
					<>c__17.<>9__0_0 = val5;
					obj = (object)val5;
				}
				unlockEvent.AddListener((UnityAction)obj);
			}
			if ((int)CampaignPlayerDataHolder.CurrentGameModeState == 4)
			{
				val.SetActive(false);
				val2.SetActive(false);
				val3.SetActive(false);
			}
		}
		if (((Scene)(ref scene)).name == "UnitCreator_GamepadUI")
		{
			UnitEditorManager component = ((Scene)(ref scene)).GetRootGameObjects().ToList().Find((GameObject x) => Object.op_Implicit((Object)(object)x.GetComponent<UnitEditorManager>()))
				.GetComponent<UnitEditorManager>();
			List<UnitBaseWrapper> list = component.UnitBases.ToList();
			foreach (Unit basis in UManager.bases)
			{
				UnitBlueprint val6 = SLMATool.CreateUnit("MoreContent Custom:" + basis.Entity.Name, (UnitBlueprint)SLMALoader.SDic["blueprints"]["CustomWobbler"], (Faction)null, (Sprite)null);
				val6.UnitBase = ((Component)basis).gameObject;
				list.Add(new UnitBaseWrapper
				{
					BaseDisplayName = basis.Entity.Name,
					BaseIcon = basis.Entity.SpriteIcon,
					UnitBaseBlueprint = val6,
					UnitBaseRestriction = (UnitBaseRestrictions)0
				});
			}
			component.UnitBases = list.ToArray();
		}
		if (((Scene)(ref scene)).name == "01_Lvl2_Tribal_VC")
		{
			GameObject val7 = new GameObject();
			((Object)val7).name = "Core";
			val7.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockFireGiant"), val7.transform);
		}
		if (((Scene)(ref scene)).name == "03_Lvl2_Ancient_VC")
		{
			GameObject val8 = new GameObject();
			((Object)val8).name = "Core";
			val8.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockGladiator"), val8.transform);
		}
		if (((Scene)(ref scene)).name == "05_Lvl2_Medieval_VC")
		{
			GameObject val9 = new GameObject();
			((Object)val9).name = "Core";
			val9.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockDwarves 1"), val9.transform);
		}
		if (((Scene)(ref scene)).name == "04_Sandbox_Viking_VC")
		{
			GameObject val10 = new GameObject();
			((Object)val10).name = "Core";
			val10.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockGhorl"), val10.transform);
		}
		if (((Scene)(ref scene)).name == "00_Lvl1_Halloween_VC")
		{
			GameObject val11 = new GameObject();
			((Object)val11).name = "Core";
			val11.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockMourners"), val11.transform);
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockTheCount"), val11.transform);
		}
		if (((Scene)(ref scene)).name == "09_Lvl1_Fantasy_Evil_VC" && ServiceLocator.GetService<ISaveLoaderService>().HasUnlockedSecret("RedKingSword"))
		{
			GameObject val12 = new GameObject();
			((Object)val12).name = "Core";
			val12.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("UnlockRedKing"), val12.transform);
		}
	}
}
namespace ChouChousUnit
{
	public class WeaponTrail : MonoBehaviour
	{
		public void Update()
		{
			if (!((Component)this).GetComponentInChildren<MeleeWeapon>().isSwinging)
			{
				if (((Component)this).GetComponentInChildren<TrailRenderer>().emitting)
				{
					((Component)this).GetComponentInChildren<TrailRenderer>().emitting = false;
					((Component)this).GetComponentsInChildren<TrailRenderer>()[1].emitting = false;
				}
			}
			else if (!((Component)this).GetComponentInChildren<TrailRenderer>().emitting)
			{
				((Component)this).GetComponentInChildren<TrailRenderer>().emitting = true;
				((Component)this).GetComponentsInChildren<TrailRenderer>()[1].emitting = true;
			}
		}
	}
}
public class AddEffectToTarget : Move
{
	public GameObject effect;

	public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
	{
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cd: 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_0086: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		Unit componentInParent = ((Component)enemyTorso).gameObject.GetComponentInParent<Unit>();
		GameObject val = Object.Instantiate<GameObject>(effect, UPool.MyPool.Pooler.transform);
		val.GetComponentsInChildren<ParticleSystemRenderer>();
		UnitEffectBase val2 = UnitEffectBase.AddEffectToTarget(((Component)((Component)componentInParent).transform).gameObject, val.GetComponent<UnitEffectBase>());
		if ((Object)(object)val2 == (Object)null)
		{
			GameObject obj = Object.Instantiate<GameObject>(val, ((Component)componentInParent).transform.root);
			obj.transform.position = ((Component)componentInParent).transform.position;
			obj.transform.rotation = Quaternion.LookRotation(componentInParent.data.mainRig.position);
			val2 = obj.GetComponent<UnitEffectBase>();
			TeamHolder.AddTeamHolder(obj, ((Component)((Component)this).transform.root).gameObject);
			val2.DoEffect();
		}
		((Component)val2).transform.rotation = Quaternion.LookRotation(componentInParent.data.mainRig.position);
		val2.Ping();
	}
}
public class StoneThrower : Move
{
	public class DestorySelf : MonoBehaviour
	{
		private void Start()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			((Component)this).GetComponentInChildren<CollisionEvent>().collisionEvent.AddListener((UnityAction)delegate
			{
				Desrtoys();
			});
		}

		public void Desrtoys()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("E攻击效果 - 副本"), ((Component)this).transform.position, Quaternion.identity, (Transform)null).AddComponent<TeamHolder>().team = ((Component)this).GetComponentInChildren<TeamHolder>().team;
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public class AddPos : MonoBehaviour
	{
		public Vector3 vector3;

		public void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: 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_0022: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = ((Component)this).transform;
			transform.position += vector3;
			((Component)this).transform.rotation = Quaternion.identity;
		}
	}

	public GameObject stonePrefab;

	public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
	{
		//IL_001c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003b: Unknown result type (might be due to invalid IL or missing references)
		RangeWeapon componentInChildren = ((Component)((Component)this).transform.GetChild(0)).gameObject.GetComponentInChildren<RangeWeapon>();
		Vector3 position = ((Component)this).transform.position;
		Vector3 val = ((Component)this).transform.position - enemyTorso.position;
		((Weapon)componentInChildren).Attack(position, enemyTorso, ((Vector3)(ref val)).normalized, false);
	}

	private void Start()
	{
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		s.AddCopiedComponent<RangeWeapon>(((Component)((Component)this).transform.GetChild(0)).gameObject, ((GameObject)SLMALoader.SDic["weapons"]["CatapultRock"]).GetComponentInChildren<RangeWeapon>());
		((Component)((Component)this).transform.GetChild(0)).gameObject.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = stonePrefab;
		((Weapon)((Component)((Component)this).transform.GetChild(0)).gameObject.GetComponentInChildren<RangeWeapon>()).connectedData = ((Component)this).GetComponentInParent<Unit>().data;
		((Component)((Component)this).transform.GetChild(0)).gameObject.GetComponentInChildren<RangeWeapon>().SoundRef = "";
		((Component)((Component)this).transform.GetChild(0)).gameObject.AddComponent<ShootPosition>();
	}
}
public class WeaponAddEffectPoss : CollisionWeaponEffect
{
	public UnitEffectBase EffectPrefab;

	public float poss;

	public bool ignoreTeamMates;

	public override void DoEffect(Transform hitTransform, Collision hit)
	{
		//IL_0073: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Expected O, but got Unknown
		//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_003c: Unknown result type (might be due to invalid IL or missing references)
		if (ignoreTeamMates)
		{
			Unit component = ((Component)((Component)this).transform.root).GetComponent<Unit>();
			Unit component2 = ((Component)hitTransform.root).GetComponent<Unit>();
			if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2) && component.Team == component2.Team)
			{
				return;
			}
		}
		Type type = ((object)EffectPrefab).GetType();
		if (Random.Range(0f, 100f) < poss)
		{
			UnitEffectBase val = (UnitEffectBase)((Component)hitTransform.root).GetComponentInChildren(type);
			if ((Object)(object)val == (Object)null)
			{
				GameObject obj = Object.Instantiate<GameObject>(((Component)EffectPrefab).gameObject, hitTransform.root);
				obj.transform.position = hitTransform.root.position;
				obj.GetComponent<UnitEffectBase>().DoEffect();
			}
			else
			{
				val.Ping();
			}
		}
	}
}
public class CanChangeMode : MonoBehaviour
{
}
public class HammerChageMode : Move
{
	public enum Mode
	{
		Common,
		Attack,
		Heal
	}

	public Mode mode;

	public Unit unit;

	public GameObject weapon;

	public Material red;

	public Material green;

	public GameObject Heal;

	public void Start()
	{
		unit = ((Component)this).GetComponentInParent<Unit>();
		weapon = ((Component)((Component)unit).GetComponentInChildren<WeaponHandler>().rightWeapon).gameObject;
		if (!Object.op_Implicit((Object)(object)weapon.GetComponent<CanChangeMode>()))
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
		mode = Mode.Common;
	}

	public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
	{
		if (mode == Mode.Common)
		{
			if (Random.Range(0, 2) == 1)
			{
				mode = Mode.Attack;
				((Component)weapon.transform.Find("Power")).GetComponentInChildren<ParticleSystem>().Play();
			}
			else
			{
				mode = Mode.Heal;
				((Component)weapon.transform.Find("Heal")).GetComponentInChildren<ParticleSystem>().Play();
				doHeal();
				doHeal();
			}
		}
		else if (mode == Mode.Attack)
		{
			mode = Mode.Heal;
			((Component)weapon.transform.Find("Heal")).GetComponentInChildren<ParticleSystem>().Play();
			doHeal();
			doHeal();
		}
		else if (mode == Mode.Heal)
		{
			mode = Mode.Attack;
			((Component)weapon.transform.Find("Power")).GetComponentInChildren<ParticleSystem>().Play();
		}
		CheckMat();
		CheckMode();
	}

	public void CheckMode()
	{
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Expected O, but got Unknown
		//IL_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Expected O, but got Unknown
		//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b5: Expected O, but got Unknown
		if (mode == Mode.Attack)
		{
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent = null;
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent = new UnityEvent();
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent.AddListener(new UnityAction(Explo));
			weapon.GetComponentInChildren<CollisionWeapon>().damage = 400f;
		}
		if (mode == Mode.Heal)
		{
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent = null;
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent = new UnityEvent();
			weapon.GetComponentInChildren<CollisionWeapon>().dealDamageEvent.AddListener(new UnityAction(doHeal));
			weapon.GetComponentInChildren<CollisionWeapon>().damage = 250f;
		}
	}

	public void CheckMat()
	{
		if (mode == Mode.Attack)
		{
			Material[] materials = ((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials;
			((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials = (Material[])(object)new Material[3]
			{
				materials[0],
				red,
				materials[2]
			};
			Debug.Log((object)mode);
			Debug.Log((object)((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials[1]);
		}
		if (mode == Mode.Heal)
		{
			Material[] materials2 = ((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials;
			((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials = (Material[])(object)new Material[3]
			{
				materials2[0],
				green,
				materials2[2]
			};
			Debug.Log((object)mode);
			Debug.Log((object)((Renderer)((Component)weapon.gameObject.transform.GetChild(3)).GetComponentInChildren<MeshRenderer>()).materials[1]);
		}
	}

	public void Explo()
	{
		((Component)weapon.transform).GetComponentInChildren<Explosion>().Explode();
		((Component)((Component)weapon.GetComponentInChildren<Explosion>()).transform.GetChild(0)).GetComponentInChildren<ParticleSystem>().Play();
		((Component)((Component)weapon.GetComponentInChildren<Explosion>()).transform.GetChild(1)).GetComponentInChildren<ParticleSystem>().Play();
	}

	public void doHeal()
	{
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = Object.Instantiate<GameObject>(Heal, UPool.MyPool.Pooler.transform);
		UnitEffectBase val2 = UnitEffectBase.AddEffectToTarget(((Component)((Component)unit).transform).gameObject, val.GetComponent<UnitEffectBase>());
		if ((Object)(object)val2 == (Object)null)
		{
			GameObject val3 = Object.Instantiate<GameObject>(val, ((Component)unit.data.hip).transform.root);
			val3.transform.position = ((Component)unit).transform.position;
			val3.transform.rotation = Quaternion.LookRotation(unit.data.mainRig.position);
			ParticleSystemRenderer[] componentsInChildren = val3.GetComponentsInChildren<ParticleSystemRenderer>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				Object.Destroy((Object)(object)componentsInChildren[i]);
			}
			val2 = val3.GetComponent<UnitEffectBase>();
			TeamHolder.AddTeamHolder(val3, ((Component)unit).gameObject);
		}
		val2.DoEffect();
		((Component)val2).transform.rotation = Quaternion.LookRotation(unit.data.mainRig.position);
		val2.Ping();
	}
}
public class DoMoveWhenEffect : MonoBehaviour
{
	public Unit unit;

	private void Update()
	{
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)((Component)unit).gameObject.GetComponentInChildren<UnitEffectBase>()))
		{
			return;
		}
		UnitEffectBase[] componentsInChildren = ((Component)unit).gameObject.GetComponentsInChildren<UnitEffectBase>();
		foreach (UnitEffectBase val in componentsInChildren)
		{
			if (((Object)val).name.ToUpper().Contains("FIRE") || ((Object)val).name.Contains("火"))
			{
				Object.Destroy((Object)(object)((Component)val).gameObject);
				Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火"), ((Component)((Component)((Component)this).GetComponentInParent<Unit>()).GetComponentInChildren<GooglyEye>()).gameObject.transform);
				((Component)this).GetComponentInChildren<ParticleSystem>().Play();
				((Component)this).GetComponentInChildren<CountEvent>().countEvent.AddListener((UnityAction)delegate
				{
					((Component)this).GetComponentInChildren<Explosion>().Explode();
				});
				((Component)this).GetComponentInChildren<CountEvent>().StartCounting();
				Object.Destroy((Object)(object)((Component)this).GetComponentInChildren<DoMoveWhenEffect>());
			}
		}
	}

	private void Start()
	{
		unit = ((Component)this).GetComponentInParent<Unit>();
	}
}
namespace ChouChousUnit
{
	public class Ghoul : MonoBehaviour
	{
		private Unit unit;

		public UnitBlueprint blueprint;

		public void Start()
		{
			unit = ((Component)this).GetComponentInParent<Unit>();
			unit.data.healthHandler.AddDieAction((Action)OnDeath);
		}

		private void OnDeath()
		{
			//IL_0016: 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)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			blueprint.Spawn(new Vector3(unit.data.head.position.x, unit.data.head.position.y + 0.5f, unit.data.head.position.z), unit.data.head.rotation, unit.Team, 1f, (UnitPoolInfo?)null);
			blueprint.Spawn(new Vector3(unit.data.head.position.x, unit.data.head.position.y + 0.5f, unit.data.head.position.z), unit.data.head.rotation, unit.Team, 1f, (UnitPoolInfo?)null);
			blueprint.Spawn(new Vector3(unit.data.head.position.x, unit.data.head.position.y + 0.5f, unit.data.head.position.z), unit.data.head.rotation, unit.Team, 1f, (UnitPoolInfo?)null);
		}
	}
}
public class Encoffin : MonoBehaviour
{
	private void Start()
	{
		if (Object.op_Implicit((Object)(object)((Component)this).GetComponentInParent<Unit>()))
		{
			((Component)this).GetComponentInParent<Unit>().data.healthHandler.AddDieAction((Action)delegate
			{
				((MonoBehaviour)this).StartCoroutine("OnDeath");
			});
		}
	}

	private IEnumerator OnDeath()
	{
		yield return (object)new WaitForSeconds(1f);
		yield return (object)new WaitUntil((Func<bool>)(() => ((Component)this).GetComponentInParent<Unit>().data.isGrounded));
		GameObject obj = UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("棺材Per");
		Vector3 val = STool.AddV3(((Component)((Component)this).GetComponentInParent<Unit>().data.mainRig).transform.position, 0f, -2.15f * ((Component)((Component)this).GetComponentInParent<Unit>()).transform.localScale.x + -0.1f * ((Component)((Component)this).GetComponentInParent<Unit>()).transform.localScale.x, 0f);
		Quaternion rotation = UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("棺材Per").transform.rotation;
		float x = ((Quaternion)(ref rotation)).ToEuler().x;
		rotation = ((Component)((Component)this).GetComponentInParent<Unit>().data.targetMainRig).transform.rotation;
		float num = ((Quaternion)(ref rotation)).ToEuler().y * -1f + 90f;
		rotation = UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("棺材Per").transform.rotation;
		GameObject obj2 = Object.Instantiate<GameObject>(obj, val, Quaternion.Euler(x, num, ((Quaternion)(ref rotation)).ToEuler().z), (Transform)null);
		Transform transform = obj2.transform;
		transform.localScale *= ((Component)((Component)this).GetComponentInParent<Unit>()).transform.localScale.x;
		Guan guan = obj2.AddComponent<Guan>();
		guan.unitBlueprint = ((Component)this).GetComponentInParent<Unit>().unitBlueprint;
		guan.team = ((Component)this).GetComponentInParent<Unit>().data.team;
		guan.targetY = ((Component)this).GetComponentInParent<Unit>().data.groundPosition.y + 0.25f;
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}
}
public class MournersMove : Move
{
	public static List<GameObject> white;

	public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
	{
		//IL_0060: 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_030e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0313: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_015d: Unknown result type (might be due to invalid IL or missing references)
		//IL_017d: 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)
		List<Unit> list = Object.FindObjectsOfType<Unit>().ToList();
		Debug.Log((object)"1");
		list.Sort((Unit u1, Unit u2) => u1.unitBlueprint.GetUnitCost(true).CompareTo(u2.unitBlueprint.GetUnitCost(true)));
		for (int num = list.Count - 1; num > 0; num--)
		{
			if (!list[num].dead && list[num].Team == ((Component)this).GetComponentInParent<Unit>().Team && !Object.op_Implicit((Object)(object)((Component)list[num]).GetComponentInChildren<Encoffin>()) && white.Contains(list[num].unitBlueprint.UnitBase))
			{
				if ((Object)(object)list[num] == (Object)(object)((Component)this).GetComponentInParent<Unit>())
				{
					GameObject val = Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("标记").gameObject, UPool.MyPool.Pooler.transform);
					UnitEffectBase val2 = UnitEffectBase.AddEffectToTarget(((Component)((Component)((Component)this).GetComponentInParent<Unit>()).transform).gameObject, val.GetComponent<UnitEffectBase>());
					if ((Object)(object)val2 == (Object)null)
					{
						GameObject obj = Object.Instantiate<GameObject>(val, ((Component)((Component)this).GetComponentInParent<Unit>().data.hip).transform.root);
						obj.transform.position = ((Component)((Component)this).GetComponentInParent<Unit>().data.hip).transform.position;
						obj.transform.rotation = Quaternion.LookRotation(((Component)this).GetComponentInParent<Unit>().data.mainRig.position);
						val2 = obj.GetComponent<UnitEffectBase>();
						TeamHolder.AddTeamHolder(obj, ((Component)((Component)this).GetComponentInParent<Unit>()).gameObject);
					}
					val2.DoEffect();
					((Component)val2).transform.rotation = Quaternion.LookRotation(((Component)this).GetComponentInParent<Unit>().data.mainRig.position);
					((Component)val2).gameObject.transform.SetParent(((Component)((Component)this).GetComponentInParent<Unit>().data.hip).transform);
					val2.Ping();
					((Component)((Component)this).GetComponentInParent<Unit>()).gameObject.AddComponent<Encoffin>();
				}
				else
				{
					GameObject val3 = Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("标记").gameObject, UPool.MyPool.Pooler.transform);
					UnitEffectBase val4 = UnitEffectBase.AddEffectToTarget(((Component)((Component)list[num]).transform).gameObject, val3.GetComponent<UnitEffectBase>());
					if ((Object)(object)val4 == (Object)null)
					{
						GameObject obj2 = Object.Instantiate<GameObject>(val3, ((Component)list[num].data.hip).transform.root);
						obj2.transform.position = ((Component)list[num].data.hip).transform.position;
						obj2.transform.rotation = Quaternion.LookRotation(list[num].data.mainRig.position);
						val4 = obj2.GetComponent<UnitEffectBase>();
						TeamHolder.AddTeamHolder(obj2, ((Component)list[num]).gameObject);
					}
					val4.DoEffect();
					((Component)val4).transform.rotation = Quaternion.LookRotation(list[num].data.mainRig.position);
					((Component)val4).gameObject.transform.SetParent(((Component)list[num].data.hip).transform);
					val4.Ping();
					((Component)list[num]).gameObject.AddComponent<Encoffin>();
				}
				break;
			}
		}
	}

	static MournersMove()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Expected O, but got Unknown
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_0071: Expected O, but got Unknown
		white = new List<GameObject>
		{
			(GameObject)SLMALoader.SDic["bases"]["Humanoid"],
			(GameObject)SLMALoader.SDic["bases"]["Halfling"],
			(GameObject)SLMALoader.SDic["bases"]["Stiffy"]
		};
	}
}
public static class STool__0
{
	public static void RendererColorChanger(Renderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = renderers[i].materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static List<T> ToList<T>(T[] ts)
	{
		List<T> list = new List<T>();
		foreach (T item in ts)
		{
			list.Add(item);
		}
		return list;
	}

	public static void RendererColorChanger(MeshRenderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = ((Renderer)renderers[i]).materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Color color)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		for (int i = 0; i < renderers.Length; i++)
		{
			Material[] materials = ((Renderer)renderers[i]).materials;
			for (int j = 0; j < materials.Length; j++)
			{
				materials[j].color = color;
			}
		}
	}

	public static void RendererColorChanger(Renderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			renderers[i].materials = color;
		}
	}

	public static void RendererColorChanger(MeshRenderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			((Renderer)renderers[i]).materials = color;
		}
	}

	public static void RendererColorChanger(SkinnedMeshRenderer[] renderers, Material[] color)
	{
		for (int i = 0; i < renderers.Length; i++)
		{
			((Renderer)renderers[i]).materials = color;
		}
	}

	public static Vector3 AddV3(Vector3 vector3, float x, float y, float z)
	{
		//IL_0000: Unknown result type (might be due to invalid IL or missing references)
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (migh

ChouChou's Map.dll

Decompiled 3 months ago
using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using ChouChouMap;
using ChouChouMap.Properties;
using DM;
using FhpSLib;
using FhpSLib.BundleModCore;
using HarmonyLib;
using Landfall.TABS;
using Pathfinding;
using SLMA;
using TFBGames;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("ChouChouMap")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("made in SFT by FhpSlime")]
[assembly: AssemblyCopyright("Copyright ©  2022")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("3a45c3cf-230c-4310-952f-0887d4266a22")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ChouChouMap
{
	public static class UManager
	{
		public static string modname;

		public static string modder;

		private static string com;

		public static SLMABundleMod bundleMod;

		public static UnitBlueprint sheep;

		public static UnitBlueprint farmer;

		static UManager()
		{
			modname = "SFT";
			modder = "FhpSlime";
		}

		public static void SetRiders(UnitBlueprint me, UnitBlueprint[] riders)
		{
			s.SetField<UnitBlueprint>(me, "Riders", (object)riders);
		}

		public static void EditBlueprint(UnitBlueprint unit, LandfallContentDatabase db)
		{
		}

		public static void EditClothes(GameObject cloth, CharacterItem item, PropItemData data, Unit unit, int index, LandfallContentDatabase db)
		{
		}

		public static void EditProjectiles(GameObject proj, ProjectileHit projhit, Unit unit, LandfallContentDatabase db)
		{
		}

		public static void EditCombatMoves(GameObject move, int index, Unit unit, LandfallContentDatabase db)
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Expected O, but got Unknown
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: 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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: 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_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Expected O, but got Unknown
			//IL_01f7: 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_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: Expected O, but got Unknown
			if (unit.unitBlueprint.Entity.Name == "666" && Object.op_Implicit((Object)(object)move.GetComponentInChildren<DodgeMove>()) && index == 2)
			{
				move.GetComponentInChildren<DodgeMove>().moves[0].forceCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[5]
				{
					new Keyframe(0f, 0f),
					new Keyframe(1f, 1f),
					new Keyframe(2f, 1f),
					new Keyframe(0f, 0f),
					new Keyframe(0f, 0f)
				});
				move.GetComponentInChildren<DodgeMove>().forceMultiplier = -1f;
			}
			if (unit.unitBlueprint.Entity.Name == "666" && Object.op_Implicit((Object)(object)move.GetComponentInChildren<DodgeMove>()) && index == 3)
			{
				move.GetComponentInChildren<DodgeMove>().moves[0].forceCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[5]
				{
					new Keyframe(-1f, 1f),
					new Keyframe(1f, 1f),
					new Keyframe(5f, 4f),
					new Keyframe(0f, 0f),
					new Keyframe(0f, 0f)
				});
				move.GetComponentInChildren<DodgeMove>().forceMultiplier = -2f;
			}
			if (unit.unitBlueprint.Entity.Name == "666" && Object.op_Implicit((Object)(object)move.GetComponentInChildren<DodgeMove>()) && index == 4)
			{
				move.GetComponentInChildren<DodgeMove>().moves[0].forceCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[5]
				{
					new Keyframe(-1f, 1f),
					new Keyframe(1f, 1f),
					new Keyframe(5f, 4f),
					new Keyframe(0f, 0f),
					new Keyframe(0f, 0f)
				});
			}
		}

		public static void CodeAfterSpawn(Unit unit, LandfallContentDatabase db)
		{
			//IL_0028: 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)
			if (unit.unitBlueprint.Entity.Name == "unit name")
			{
				Transform head = unit.data.head;
				head.localScale *= 2f;
			}
		}

		public static void Init(LandfallContentDatabase db)
		{
			//IL_022e: Unknown result type (might be due to invalid IL or missing references)
			//IL_025f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Expected O, but got Unknown
			com = "Bundle Mod Init";
			com = "Bundle Mod Init";
			AssetBundle val = AssetBundle.LoadFromMemory(Resources.ChouChouMapData);
			if (Loader.BundleMode)
			{
				SLMABundleMod obj = SLMABundleMod.CreatSLMABundleMod("TestMod", "0.0.1");
				obj.AddAssetBundle("chouchoumapdata\u200e", val);
				obj.Dev_mode = true;
				obj.LoadAssetBundle("chouchoumapdata\u200e");
				bundleMod = obj;
			}
			SoundBank[] array = bundleMod.GetAssetBundle("chouchoumapdata\u200e").LoadAllAssets<SoundBank>();
			foreach (SoundBank val2 in array)
			{
				if (((Object)val2).name.Contains("Sound"))
				{
					SoundBank soundBank = ServiceLocator.GetService<SoundPlayer>().soundBank;
					SoundBankCategory[] categories = val2.Categories;
					for (int j = 0; j < categories.Length; j++)
					{
						categories[j].categoryMixerGroup = soundBank.Categories[0].categoryMixerGroup;
					}
					List<SoundBankCategory> list = soundBank.Categories.ToList();
					list.AddRange(val2.Categories);
					soundBank.Categories = list.ToArray();
				}
				if (!((Object)val2).name.Contains("Music"))
				{
					continue;
				}
				SoundBank bank = ServiceLocator.GetService<MusicHandler>().bank;
				List<SoundBankCategory> list2 = bank.Categories.ToList();
				list2.AddRange(val2.Categories);
				SoundBankCategory[] categories2 = val2.Categories;
				foreach (SoundBankCategory val3 in categories2)
				{
					SoundEffectInstance[] soundEffects = val3.soundEffects;
					foreach (SoundEffectInstance val4 in soundEffects)
					{
						SongInstance val5 = new SongInstance();
						val5.clip = val4.clipTypes[0].clips[0];
						val5.soundEffectInstance = val4;
						val5.songRef = val3.categoryName + "/" + val4.soundRef;
						ServiceLocator.GetService<MusicHandler>().m_songs.Add(val5.songRef, val5);
					}
				}
				bank.Categories = list2.ToArray();
			}
			AssetBundle.LoadFromMemory(Resources.ChouChouMap);
			MapAsset val6 = val.LoadAsset<MapAsset>("ForestMap");
			val6.m_mapIndex = 113513;
			Dictionary<DatabaseID, int> mapAssetIndexLookup = HelpLibrary.m_mapAssetIndexLookup;
			mapAssetIndexLookup.Add(val6.Entity.GUID, mapAssetIndexLookup.Count);
			HelpLibrary.m_mapAssetIndexLookup = mapAssetIndexLookup;
			List<MapAsset> list3 = HelpLibrary.m_orderedMapAssets.ToList();
			list3.Add(val6);
			HelpLibrary.m_orderedMapAssets = list3.ToArray();
			new GameObject
			{
				name = "MapsCore",
				hideFlags = (HideFlags)52
			}.AddComponent<ScenesManager>();
			MadeUnits();
		}

		public static void EditWeapons(GameObject weapon, Team team, Unit unit, MeleeWeapon melee, RangeWeapon range, LandfallContentDatabase db)
		{
		}

		public static void SetMoveConditionalValue(this ConditionalEventInstance gameObject, ConditionType type, ValueType valuet, float value)
		{
			//IL_0012: 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)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			bool flag = false;
			EventCondition[] conditions = gameObject.conditions;
			foreach (EventCondition val in conditions)
			{
				if (val.conditionType == type)
				{
					val.valueType = valuet;
					val.value = value;
					flag = true;
				}
			}
			if (!flag)
			{
				List<EventCondition> list = gameObject.conditions.ToList();
				list.Add(new EventCondition
				{
					conditionType = type,
					valueType = valuet,
					value = value
				});
				gameObject.conditions = list.ToArray();
			}
		}

		private static void MadeUnits()
		{
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: 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)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Expected O, but got Unknown
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Expected O, but got Unknown
			//IL_018c: 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_01b3: Expected O, but got Unknown
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Expected O, but got Unknown
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Expected O, but got Unknown
			//IL_0258: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: 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_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Expected O, but got Unknown
			//IL_0388: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Expected O, but got Unknown
			//IL_03be: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Expected O, but got Unknown
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Expected O, but got Unknown
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0453: Expected O, but got Unknown
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Expected O, but got Unknown
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Expected O, but got Unknown
			//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b6: Expected O, but got Unknown
			//IL_04d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d7: Expected O, but got Unknown
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Expected O, but got Unknown
			//IL_0513: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Expected O, but got Unknown
			//IL_0535: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Expected O, but got Unknown
			//IL_0557: Unknown result type (might be due to invalid IL or missing references)
			//IL_055d: Expected O, but got Unknown
			//IL_0579: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Expected O, but got Unknown
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Expected O, but got Unknown
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Expected O, but got Unknown
			//IL_05df: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Expected O, but got Unknown
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Expected O, but got Unknown
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Expected O, but got Unknown
			//IL_0645: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Expected O, but got Unknown
			//IL_0667: Unknown result type (might be due to invalid IL or missing references)
			//IL_066d: Expected O, but got Unknown
			//IL_0689: Unknown result type (might be due to invalid IL or missing references)
			//IL_068f: Expected O, but got Unknown
			//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b1: Expected O, but got Unknown
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Expected O, but got Unknown
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f5: Expected O, but got Unknown
			//IL_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Expected O, but got Unknown
			//IL_0733: Unknown result type (might be due to invalid IL or missing references)
			//IL_0739: Expected O, but got Unknown
			//IL_0755: Unknown result type (might be due to invalid IL or missing references)
			//IL_075b: Expected O, but got Unknown
			//IL_0777: Unknown result type (might be due to invalid IL or missing references)
			//IL_077d: Expected O, but got Unknown
			//IL_0799: Unknown result type (might be due to invalid IL or missing references)
			//IL_079f: Expected O, but got Unknown
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cc: Expected O, but got Unknown
			//IL_07e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ed: Expected O, but got Unknown
			//IL_0808: Unknown result type (might be due to invalid IL or missing references)
			//IL_080e: Expected O, but got Unknown
			//IL_081c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0822: Expected O, but got Unknown
			//IL_084e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0853: Unknown result type (might be due to invalid IL or missing references)
			//IL_0868: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Expected O, but got Unknown
			//IL_08af: Unknown result type (might be due to invalid IL or missing references)
			//IL_08b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_08dd: Expected O, but got Unknown
			//IL_0910: Unknown result type (might be due to invalid IL or missing references)
			//IL_0915: Unknown result type (might be due to invalid IL or missing references)
			//IL_092a: Unknown result type (might be due to invalid IL or missing references)
			//IL_092f: Unknown result type (might be due to invalid IL or missing references)
			UnitBlueprint val = SLMATool.CreateUnit("羊", (UnitBlueprint)null, (Faction)null, (Sprite)null);
			val.Entity.Name = "羊";
			val.health = 2000f;
			val.forceCost = 60u;
			val.sizeMultiplier = 1f;
			val.damageMultiplier = 1f;
			val.massMultiplier = 1f;
			val.movementSpeedMuiltiplier = 1f;
			val.holdinigWithTwoHands = false;
			val.Validate();
			val.UnitBase = (GameObject)SLMALoader.SDic["bases"]["Humanoid"];
			val.LeftWeaponData = new PropItemData
			{
				m_colors = new int[0],
				m_isTeamColor = new bool[0],
				m_positionOffset = new Vector3(0f, 0f, 0f),
				m_scale = new Vector3(1f, 1f, 1f)
			};
			val.RightWeaponData = new PropItemData
			{
				m_colors = new int[0],
				m_isTeamColor = new bool[0],
				m_positionOffset = new Vector3(0f, 0f, 0f),
				m_scale = new Vector3(1f, 1f, 1f)
			};
			val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { (GameObject)SLMALoader.SDic["moves"]["MinotaurCharge"] };
			val.m_props = (GameObject[])(object)new GameObject[2]
			{
				(GameObject)SLMALoader.SDic["clothes"]["SheepMask001"],
				(GameObject)SLMALoader.SDic["clothes"]["SkeletonSuit001"]
			};
			UnitBlueprint obj = val;
			PropItemData[] array = new PropItemData[2];
			PropItemData val2 = new PropItemData();
			val2.m_colors = new int[2] { 40, -1 };
			val2.m_isTeamColor = new bool[2];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			array[0] = val2;
			val2 = new PropItemData();
			val2.m_colors = new int[2] { 40, 40 };
			val2.m_isTeamColor = new bool[2];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			array[1] = val2;
			obj.m_propData = (PropItemData[])(object)array;
			sheep = val;
			val = SLMATool.CreateUnit("草叉战神", (UnitBlueprint)null, (Faction)null, (Sprite)null);
			val.health = float.PositiveInfinity;
			val.forceCost = 110u;
			val.sizeMultiplier = 1f;
			val.damageMultiplier = 1f;
			val.massMultiplier = 1f;
			val.movementSpeedMuiltiplier = 1f;
			val.holdinigWithTwoHands = false;
			val.UnitBase = (GameObject)SLMALoader.SDic["bases"]["Humanoid"];
			val.damageMultiplier = 100f;
			val.RightWeapon = (GameObject)SLMALoader.SDic["weapons"]["Pitchfork"];
			val.LeftWeaponData = new PropItemData
			{
				m_colors = new int[0],
				m_isTeamColor = new bool[0],
				m_positionOffset = new Vector3(0f, 0f, 0f),
				m_scale = new Vector3(1f, 1f, 1f)
			};
			UnitBlueprint obj2 = val;
			val2 = new PropItemData();
			val2.m_colors = new int[2] { -1, -1 };
			val2.m_isTeamColor = new bool[2];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			obj2.RightWeaponData = val2;
			val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[28]
			{
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"],
				(GameObject)SLMALoader.SDic["moves"]["Move_Jarl_Enrage"]
			};
			val.m_props = (GameObject[])(object)new GameObject[3]
			{
				(GameObject)SLMALoader.SDic["clothes"]["Farmer_Beard001"],
				(GameObject)SLMALoader.SDic["clothes"]["ScarecrowHat"],
				(GameObject)SLMALoader.SDic["clothes"]["ScarecrowPants"]
			};
			UnitBlueprint obj3 = val;
			PropItemData[] array2 = new PropItemData[3];
			val2 = new PropItemData();
			val2.m_colors = new int[1] { -1 };
			val2.m_isTeamColor = new bool[1];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			array2[0] = val2;
			val2 = new PropItemData();
			val2.m_colors = new int[3] { -1, -1, -1 };
			val2.m_isTeamColor = new bool[3];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			array2[1] = val2;
			val2 = new PropItemData();
			val2.m_colors = new int[6] { -1, -1, 1, 0, 0, -1 };
			val2.m_isTeamColor = new bool[6];
			val2.m_positionOffset = new Vector3(0f, 0f, 0f);
			val2.m_scale = new Vector3(1f, 1f, 1f);
			array2[2] = val2;
			obj3.m_propData = (PropItemData[])(object)array2;
			farmer = val;
		}
	}
	[BepInPlugin("ChouChouMap", "ChouChouMap", "1.0.0")]
	internal class Loader : BaseUnityPlugin
	{
		public static bool BundleMode;

		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("call");
		}

		private IEnumerator call()
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
			yield return (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
			yield return (object)new WaitForSecondsRealtime(0.3f);
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			UManager.Init(landfallContentDatabase);
			new Harmony(UManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(UManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(UManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(UManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(UManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(UManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				UManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + UManager.modname + " Successfully"));
			Debug.Log((object)(UManager.modname + "is made in SFT by FhpSlime"));
			Debug.Log((object)(UManager.modder + "wished you a pleasant trip"));
		}

		static Loader()
		{
			BundleMode = true;
		}
	}
}
public class Item : MonoBehaviour
{
	public enum kind
	{
		Weapon,
		Cloth,
		Skill,
		Unit,
		Projectile,
		Other
	}

	public string name;

	public kind Kind;
}
namespace ChouChouMap
{
	public class MyModItems : MonoBehaviour
	{
		private static Dictionary<string, Item> items;

		private static MyModItems instance { get; set; }

		public static MyModItems GetInstance()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)instance == (Object)null)
			{
				instance = new GameObject("MyModItems").AddComponent<MyModItems>();
				Object.DontDestroyOnLoad((Object)(object)instance);
			}
			return instance;
		}

		public void AddItem(Item item)
		{
			items.Add(item.name, item);
		}

		public Item GetItem(string name)
		{
			Item value = new Item
			{
				name = null,
				Kind = Item.kind.Other
			};
			items.TryGetValue(name, out value);
			return value;
		}
	}
}
public class Example : MonoBehaviour
{
	public GameObject prefab;

	private void Start()
	{
		if ((Object)(object)prefab != (Object)null)
		{
			Transform[] componentsInChildren = prefab.GetComponentsInChildren<Transform>();
			if (componentsInChildren.Length > 1)
			{
				_ = componentsInChildren[1];
			}
		}
	}
}
public class VoiceBundleDatabaseUpdater
{
	public static void AddVoiceBundles(IEnumerable<VoiceBundle> newVoiceBundles)
	{
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
		FieldInfo field = typeof(LandfallContentDatabase).GetField("m_voiceBundles", BindingFlags.Instance | BindingFlags.NonPublic);
		if (field == null)
		{
			Debug.LogError((object)"m_voiceBundles field not found.");
			return;
		}
		Dictionary<DatabaseID, VoiceBundle> voiceBundlesDictionary = (Dictionary<DatabaseID, VoiceBundle>)field.GetValue(landfallContentDatabase);
		if (voiceBundlesDictionary == null)
		{
			Debug.LogError((object)"m_voiceBundles dictionary is null.");
			return;
		}
		Func<VoiceBundle, bool> predicate = (VoiceBundle voiceBundle) => Object.op_Implicit((Object)(object)voiceBundle) && voiceBundlesDictionary != null && !voiceBundlesDictionary.ContainsKey(voiceBundle.Entity.GUID);
		foreach (VoiceBundle item in newVoiceBundles.Where(predicate))
		{
			voiceBundlesDictionary.Add(item.Entity.GUID, item);
		}
		field.SetValue(landfallContentDatabase, voiceBundlesDictionary);
		Debug.Log((object)$"{newVoiceBundles.Count()} VoiceBundles added to the database.");
	}
}
public class ScenesManager : MonoBehaviour
{
	public ScenesManager()
	{
		SceneManager.sceneLoaded += SceneLoaded;
	}

	public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0518: Unknown result type (might be due to invalid IL or missing references)
		//IL_051d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0381: Unknown result type (might be due to invalid IL or missing references)
		//IL_038b: Expected O, but got Unknown
		//IL_039e: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a8: Expected O, but got Unknown
		if (!((Scene)(ref scene)).name.Contains("ForestMap"))
		{
			return;
		}
		GameObject val = null;
		GameObject val2 = null;
		GameObject val3 = null;
		GameObject gameObject4 = null;
		GameObject val4 = null;
		GameObject doorR = null;
		GameObject doorL = null;
		GameObject[] rootGameObjects = ((Scene)(ref scene)).GetRootGameObjects();
		foreach (GameObject val5 in rootGameObjects)
		{
			if (((Object)val5).name == "AStar_WanLi")
			{
				val = val5;
				Debug.Log((object)"find astar");
			}
			if (((Object)val5).name == "Plane")
			{
				val2 = val5;
				Debug.Log((object)"find setting");
			}
			if (Object.op_Implicit((Object)(object)val5.GetComponentInChildren<Water>()))
			{
				((Renderer)((Component)((Component)val5.GetComponentInChildren<Water>()).transform.parent).gameObject.GetComponent<MeshRenderer>()).material.shader = Shader.Find(((Object)((Renderer)((Component)((Component)val5.GetComponentInChildren<Water>()).transform.parent).GetComponent<MeshRenderer>()).material.shader).name) ?? Shader.Find(((Object)((Renderer)((Component)((Component)val5.GetComponentInChildren<Water>()).transform.parent).GetComponent<MeshRenderer>()).material.shader).name);
			}
			if (Object.op_Implicit((Object)(object)val5.GetComponentInChildren<SecretUnlock>()))
			{
				if (((Object)val5).name == "Key")
				{
					val3 = val5;
					Debug.Log((object)"find Key");
				}
				if (((Object)val5).name == "门锁 (3)")
				{
					val4 = val5;
					Debug.Log((object)"find Lock True");
				}
			}
			if (((Object)val5).name == "门锁 (2)")
			{
				gameObject4 = val5;
				Debug.Log((object)"find Lock Model");
			}
			if (((Object)val5).name == "半边门 (1)")
			{
				doorR = val5;
				Debug.Log((object)"find DoorR");
			}
			if (((Object)val5).name == "半边门 (2)")
			{
				doorL = val5;
				Debug.Log((object)"find DoorL");
			}
			if (((Object)val5).name == "农夫")
			{
				val5.AddComponent<Spawn>().unit = UManager.farmer;
				Debug.Log((object)("find" + ((Object)val5).name));
			}
			if (((Object)val5).name == "羊1")
			{
				val5.AddComponent<Spawn>().unit = UManager.sheep;
				Debug.Log((object)("find" + ((Object)val5).name));
			}
			if (((Object)val5).name == "羊2")
			{
				val5.AddComponent<Spawn>().unit = UManager.sheep;
				Debug.Log((object)("find" + ((Object)val5).name));
			}
		}
		if ((Object)(object)val3 != (Object)null && (Object)(object)val4 != (Object)null && (Object)(object)gameObject4 != (Object)null && (Object)(object)doorR != (Object)null && (Object)(object)doorL != (Object)null)
		{
			doorR.AddComponent<Door>().isleft = false;
			doorL.AddComponent<Door>().isleft = true;
			if (ServiceLocator.GetService<ISaveLoaderService>().HasUnlockedSecret((string)s.GetField<SecretUnlock>(val4.GetComponent<SecretUnlock>(), "m_secret_key")))
			{
				Debug.Log((object)"Open");
				doorR.GetComponent<Door>().Open();
				doorL.GetComponent<Door>().Open();
				gameObject4.SetActive(false);
				val3.SetActive(false);
				val4.SetActive(false);
			}
			val3.GetComponent<SecretUnlock>().hideEvent.AddListener((UnityAction)delegate
			{
				gameObject4.SetActive(false);
			});
			val4.GetComponent<SecretUnlock>().unlockEvent.AddListener((UnityAction)delegate
			{
				doorR.GetComponent<Door>().Open();
				doorL.GetComponent<Door>().Open();
			});
			val4.GetComponent<SecretUnlock>().hideEvent = val4.GetComponent<SecretUnlock>().unlockEvent;
		}
		if ((Object)(object)val != (Object)null && (Object)(object)val2 != (Object)null)
		{
			Debug.Log((object)"Start Bake Pathfinder");
			AstarPath componentInChildren = val.GetComponentInChildren<AstarPath>(true);
			val.SetActive(true);
			if (componentInChildren.data.graphs.Length != 0)
			{
				componentInChildren.data.RemoveGraph(componentInChildren.data.graphs[0]);
			}
			componentInChildren.data.AddGraph(typeof(RecastGraph));
			componentInChildren.data.recastGraph.minRegionSize = 0.1f;
			componentInChildren.data.recastGraph.characterRadius = 0.3f;
			componentInChildren.data.recastGraph.cellSize = 0.2f;
			((NavmeshBase)componentInChildren.data.recastGraph).forcedBoundsSize = new Vector3(val2.GetComponent<MapSettings>().m_mapRadius * 2f, val2.GetComponent<MapSettings>().m_mapRadius * val2.GetComponent<MapSettings>().mapRadiusYMultiplier * 2f, val2.GetComponent<MapSettings>().m_mapRadius * 2f);
			componentInChildren.data.recastGraph.rasterizeMeshes = false;
			componentInChildren.data.recastGraph.rasterizeColliders = true;
			componentInChildren.data.recastGraph.mask = UManager.bundleMod.GetAssetBundle("chouchoumapdata\u200e").LoadAsset<GameObject>("Astar").GetComponent<Explosion>()
				.layerMask;
			componentInChildren.Scan((NavGraph[])null);
		}
	}
}
namespace ChouChouMap.Properties
{
	[GeneratedCode("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")]
	[DebuggerNonUserCode]
	[CompilerGenerated]
	internal class Resources
	{
		private static ResourceManager resourceMan;

		private static CultureInfo resourceCulture;

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static ResourceManager ResourceManager
		{
			get
			{
				if (resourceMan == null)
				{
					resourceMan = new ResourceManager("ChouChouMap.Properties.Resources", typeof(Resources).Assembly);
				}
				return resourceMan;
			}
		}

		[EditorBrowsable(EditorBrowsableState.Advanced)]
		internal static CultureInfo Culture
		{
			get
			{
				return resourceCulture;
			}
			set
			{
				resourceCulture = value;
			}
		}

		internal static byte[] ChouChouMap => (byte[])ResourceManager.GetObject("chouchoumap", resourceCulture);

		internal static byte[] ChouChouMapData => (byte[])ResourceManager.GetObject("chouchoumapdata", resourceCulture);

		internal Resources()
		{
		}
	}
}
public class Door : MonoBehaviour
{
	public bool isleft;

	public void Open()
	{
		((MonoBehaviour)this).StartCoroutine("Do");
	}

	private IEnumerator Do()
	{
		for (float i = 0f; i < 3f; i += 0.01f)
		{
			((Component)this).transform.Rotate(new Vector3(0f, 0f, isleft ? (-0.45f) : 0.45f), (Space)1);
			yield return (object)new WaitForSeconds(0.01f);
		}
	}
}
public class Spawn : Damagable
{
	public UnitBlueprint unit;

	public override void TakeDamage(float damage, Vector3 direction, Unit unit, DamageType damageType = 0)
	{
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		Object[] array = Object.FindSceneObjectsOfType(typeof(Spawn));
		for (int i = 0; i < array.Length; i++)
		{
			if (Object.op_Implicit((Object)(object)((Component)(Spawn)(object)array[i]).gameObject.GetComponent<PlaySoundEffect>()))
			{
				((Component)(Spawn)(object)array[i]).gameObject.GetComponent<PlaySoundEffect>().Go();
			}
			((Spawn)(object)array[i]).Destruct(unit.Team);
		}
	}

	public Team OppositeTeam(Team originalTeam)
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0004: Invalid comparison between Unknown and I4
		//IL_000a: 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)
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		//IL_000e: Unknown result type (might be due to invalid IL or missing references)
		Team result = (Team)0;
		if ((int)originalTeam == 1)
		{
			result = (Team)0;
		}
		else if ((int)originalTeam == 0)
		{
			result = (Team)1;
		}
		return result;
	}

	private void Destruct(Team team)
	{
		//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_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_002a: Unknown result type (might be due to invalid IL or missing references)
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_008b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		GameObject obj = Object.Instantiate<UnitBlueprint>(unit).Spawn(((Component)this).GetComponent<UnitRig>().m_torso.position + Vector3.up * 1000f, ((Component)this).GetComponent<UnitRig>().m_torso.rotation, OppositeTeam(team), 1f, (UnitPoolInfo?)null)[0];
		Unit component = obj.GetComponent<Unit>();
		Rigidbody[] allRigs = ((Component)this).GetComponentInChildren<RigidbodyHolder>().AllRigs;
		Rigidbody[] allRigs2 = component.data.allRigs.AllRigs;
		obj.transform.localScale = ((Component)this).transform.localScale;
		for (int i = 0; i < allRigs2.Length; i++)
		{
			((Component)allRigs2[i]).transform.localScale = ((Component)allRigs[i]).transform.localScale;
			((Component)allRigs2[i]).transform.position = ((Component)allRigs[i]).transform.position;
			((Component)allRigs2[i]).transform.rotation = ((Component)allRigs[i]).transform.rotation;
			allRigs2[i].velocity = allRigs[i].velocity;
		}
		ParticleSystem[] componentsInChildren = ((Component)((Component)component).gameObject.transform.Find("SpawnEffects")).GetComponentsInChildren<ParticleSystem>();
		for (int j = 0; j < componentsInChildren.Length; j++)
		{
			componentsInChildren[j].maxParticles = 0;
		}
		component.data.fallTime = 0.3f;
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}
}