Decompiled source of Chinese myth v0.1.1

Chinese myth_0.1.1.dll

Decompiled 2 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 ChineseMythology;
using DM;
using FhpSLib;
using FhpSLib.BundleModCore;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.GameState;
using Landfall.TABS.UnitEditor;
using Landfall.TABS.Workshop;
using SLMA;
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("中国神话")]
[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 ChineseMythology
{
	public static class UManager
	{
		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_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: 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_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_079e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0838: Unknown result type (might be due to invalid IL or missing references)
			//IL_0843: Unknown result type (might be due to invalid IL or missing references)
			//IL_0887: Unknown result type (might be due to invalid IL or missing references)
			//IL_0890: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_093d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0951: Expected O, but got Unknown
			//IL_097c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_0996: Unknown result type (might be due to invalid IL or missing references)
			//IL_0459: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0626: Unknown result type (might be due to invalid IL or missing references)
			//IL_0676: Unknown result type (might be due to invalid IL or missing references)
			//IL_0553: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_051c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("Mnokeyking").PatchAll();
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("monkeyking");
			AssetBundle val = AssetBundle.LoadFromStream(stream);
			mod = SLMABundleMod.CreatSLMABundleMod("MonkeyKing", "1.0");
			mod.AddAssetBundle("Mod", val);
			hiteffect = val.LoadAsset<GameObject>("弹反特效");
			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))
				{
					GameObject gameObject = val2.gameObject;
					if (((Object)gameObject).name == "齐天大圣金箍棒")
					{
						gameObject.AddComponent<WeaponTrail>();
						gameObject.AddComponent<WeaponScaleChange>();
					}
					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)val2).name == "火眼金睛发射")
					{
						val2.AddComponent<火眼金睛>().project = val.LoadAsset<GameObject>("火眼金睛");
						val2.GetComponent<火眼金睛>().target = new Color(2f, 2f, 0f);
					}
				}
				if (Object.op_Implicit((Object)(object)val2.GetComponent<Unit>()) && !HelpLibrary.m_unitBases.ContainsKey(val2.GetComponent<Unit>().Entity.GUID))
				{
					GameObject gameObject2 = val2.gameObject;
					if (Object.op_Implicit((Object)(object)gameObject2.GetComponentInChildren<TeamColor>()))
					{
						TeamColor[] componentsInChildren = gameObject2.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)gameObject2.GetComponentInChildren<EyeSpawner>()))
					{
						gameObject2.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);
				}
			}
			SoundBank[] array2 = val.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj in array2)
			{
				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[] array3 = val.LoadAllAssets<VoiceBundle>();
			foreach (VoiceBundle val4 in array3)
			{
				if (!dictionary8.ContainsKey(val4.Entity.GUID))
				{
					dictionary8.Add(val4.Entity.GUID, val4);
				}
				dictionary7.Add(val4.Entity.GUID, (Object)(object)val4);
			}
			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>();
			GameObject val5 = CreateNewMove("PerMove");
			GameObject obj2 = UPool.MyPool.AddObject("弹反护甲", val5, true, (HideFlags)52, (Sprite)null, 20046816, true);
			((CharacterItem)obj2.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
			{
				new Tag
				{
					tagType = (TagType)0,
					value = "齐天大圣"
				}
			};
			obj2.AddComponent<MonkeyArmor>().armorhealth = 50f;
			GameObject obj3 = UPool.MyPool.AddObject("猴王护甲", val5, true, (HideFlags)52, (Sprite)null, 20046819, true);
			((CharacterItem)obj3.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
			{
				new Tag
				{
					tagType = (TagType)0,
					value = "齐天大圣"
				}
			};
			obj3.AddComponent<MonkeyKingArmor>().armorhealth = 100f;
			UPool.MyPool.AddObject("不易摔倒", (GameObject)SLMALoader.SDic["moves"]["Hover"], true, (HideFlags)52, (Sprite)null, 20046820, true).GetComponentInChildren<Wings>().flightForce = 0.0001f;
			((CharacterItem)UPool.MyPool.GetObject("不易摔倒").GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
			{
				new Tag
				{
					tagType = (TagType)0,
					value = "齐天大圣"
				}
			};
			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)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Expected O, but got Unknown
			GameObject val = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("大圣分身");
			mod.GetAssetBundle("Mod").LoadAsset<GameObject>("超级棒").AddComponent<SuperStick>();
			UnitBlueprint val2 = mod.GetAssetBundle("Mod").LoadAsset<UnitBlueprint>("齐天大圣");
			UnitBlueprint val3 = SLMATool.CreateUnit("齐天大圣", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("齐天大圣icon黑白"));
			val3.health = 1000f;
			val3.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("齐天大圣");
			val3.forceCost = 6000u;
			val3.RightWeapon = val2.RightWeapon;
			val3.holdinigWithTwoHands = true;
			val3.m_props = val2.m_props;
			val3.massMultiplier = 5f;
			val3.Entity.SetUnlockKey("MonkeyKing");
			val3.sizeMultiplier = 1.2f;
			val3.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("大圣Voice");
			s.SetField<UnitBlueprint>(val3, "DeathRef", (object)val3.voiceBundle.DeathRef);
			s.SetField<UnitBlueprint>(val3, "VocalRef", (object)val3.voiceBundle.VocalRef);
			val3.Validate();
			((CharacterItem)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火眼金睛发射").GetComponentInChildren<SpecialAbility>()).Entity.SpriteIcon = mod.GetAssetBundle("Mod").LoadAsset<Sprite>("火眼金睛图标");
			((CharacterItem)mod.GetAssetBundle("Mod").LoadAsset<GameObject>("超级一棒").GetComponentInChildren<SpecialAbility>()).Entity.SpriteIcon = mod.GetAssetBundle("Mod").LoadAsset<Sprite>("超级一棒");
			((CharacterItem)UPool.MyPool.GetObject("猴王护甲").GetComponentInChildren<SpecialAbility>()).Entity.SpriteIcon = mod.GetAssetBundle("Mod").LoadAsset<Sprite>("盔甲技能图标");
			((CharacterItem)UPool.MyPool.GetObject("弹反护甲").GetComponentInChildren<SpecialAbility>()).Entity.SpriteIcon = mod.GetAssetBundle("Mod").LoadAsset<Sprite>("盔甲技能图标");
			UnitBlueprint val4 = SLMATool.CreateUnit("齐天大圣-分身", val3, (Faction)null, mod.GetAssetBundle("Mod").LoadAsset<Sprite>("齐天大圣icon黑白"));
			val3.targetingPriorityMultiplier = 0.8f;
			val4.targetingPriorityMultiplier = 1f;
			val4.health = 500f;
			val4.damageMultiplier = 0.4f;
			val3.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[5]
			{
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火眼金睛发射"),
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("超级一棒"),
				UPool.MyPool.GetObject("不易摔倒"),
				UPool.MyPool.GetObject("猴王护甲"),
				val
			};
			val4.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
			{
				UPool.MyPool.GetObject("不易摔倒"),
				UPool.MyPool.GetObject("弹反护甲")
			};
			val.GetComponentsInChildren<UnitSpawner>()[0].unitBlueprint = val4;
			val.GetComponentsInChildren<UnitSpawner>()[1].unitBlueprint = val4;
		}

		public static void Init3()
		{
			//IL_0070: 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_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Expected O, but got Unknown
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_042a: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("风火轮");
			val.GetComponentInChildren<Wings>().flightForce = 105f;
			PhysicsFollowBodyPart[] componentsInChildren = val.GetComponentsInChildren<PhysicsFollowBodyPart>();
			for (int i = 0; i < componentsInChildren.Length; i++)
			{
				componentsInChildren[i].force = 100f;
			}
			Rotate[] componentsInChildren2 = val.GetComponentsInChildren<Rotate>();
			for (int j = 0; j < componentsInChildren2.Length; j++)
			{
				componentsInChildren2[j].rotation = new Vector3(0f, 0f, 720f);
			}
			UnitBlueprint val2 = SLMATool.CreateUnit("哪吒", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], mod.GetAssetBundle("Mod").LoadAsset<Sprite>("哪吒单位图标"));
			val2.health = 800f;
			mod.GetAssetBundle("Mod").LoadAsset<GameObject>("哪吒体型").AddComponent<ClearFire>();
			DamageOverTimeEffect componentInChildren = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("神火").GetComponentInChildren<DamageOverTimeEffect>();
			((UnitEffectBase)componentInChildren).damageMultiplier = ((UnitEffectBase)componentInChildren).damageMultiplier * 0.05f;
			val2.UnitBase = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("哪吒体型");
			val2.forceCost = 5000u;
			val2.RightWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("火尖枪");
			val2.LeftWeapon = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("乾坤圈武器");
			val2.movementSpeedMuiltiplier = 3f;
			val2.m_props = (GameObject[])(object)new GameObject[7]
			{
				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")
			};
			val2.massMultiplier = 1.6f;
			val2.Entity.SetUnlockKey("NeZha");
			val2.voiceBundle = mod.GetAssetBundle("Mod").LoadAsset<VoiceBundle>("哪吒Voice");
			s.SetField<UnitBlueprint>(val2, "DeathRef", (object)val2.voiceBundle.DeathRef);
			s.SetField<UnitBlueprint>(val2, "VocalRef", (object)val2.voiceBundle.VocalRef);
			val2.Validate();
			val2.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
			val2.targetingPriorityMultiplier = 0.8f;
			mod.GetAssetBundle("Mod").LoadAsset<GameObject>("混天绫").AddComponent<AddEffectToTarget>()
				.effect = mod.GetAssetBundle("Mod").LoadAsset<GameObject>("混天绫捆绑");
			val2.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[3]
			{
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("混天绫"),
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("M_三昧真火"),
				mod.GetAssetBundle("Mod").LoadAsset<GameObject>("风火轮")
			};
			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("齐天大圣", "齐天大圣#Great Sage Equal to Heaven#齊天大聖#Der Große Weise Gleich dem Himmel#Grand Sage Egal du Ciel#Великий мудрец, равный небу#Gran Sabio Igual al Cielo#Gran Saggio Uguale al Cielo");
			AddTransl("金箍棒", "金箍棒#Golden-Hooped Rod#金箍棒#Goldumwickelter Stab#Rod avec Cerceau en Or#Золотистый жезл с обручем#Vara con Aros Dorados#Bastone con Cerchi d’Oro");
			AddTransl("火尖枪", "火尖枪#Flaming Spear#火尖枪#Flammenspeer#Lance Flamboyante#Пламенное копье#Lanza Llameante#Lancia Fiammeggiante");
			AddTransl("乾坤圈", "乾坤圈#Ruyi Jingu Bang#乾坤圈#Ruyi Jingu Bang#Ruyi Jingu Bang#Небесно-Земная Палочка#Ruyi Jingu Bang#Ruyi Jingu Bang");
			AddTransl("火眼金睛", "火眼金睛#Fiery Eyes of Wisdom#火眼金睛#Flammende Augen der Weisheit#Yeux Flamboyants de Sagesse#Огненные глаза Мудрости#Ojos Ardientes de Sabiduría#Occhi Fiammeggianti di Saggezza");
			AddTransl("大圣分身", "大圣分身#Great Sage's Clone#大圣分身#Große Sage Klon#Clone du Grand Sage#Клон Великого Мудреца#Clon del Gran Sabio#Clone del Grande Saggio");
			AddTransl("超级一棒", "超级一棒#Superior Strike#超级一棒#Überlegener Schlag#Frappe Supérieure#Превосходный удар#Golpe Superior#Colpo Superiore");
			AddTransl("弹反护甲", "弹反护甲#Rebounce Armor#弹反护甲#Rebounce Rüstung#Armure Rebondissante#Арматура Отскока#Armadura de Rebote#Armatura Rimbalzo");
			AddTransl("猴王护甲", "猴王护甲#Monkey King Armor#猴王护甲#Affenkönig-Rüstung#Armure du Roi Singe#Броня Короля Обезьян#Armadura del Rey Mono#Armatura Re delle Scimmie");
			AddTransl("不易摔倒", "不易摔倒#Hard to Fall#不易摔倒#Schwer zu Fall#Difficile à Tomber#Трудно Падать#Difícil de Caer#Difficile da Cader");
			AddTransl("三昧真火", "三昧真火#Samadhi True Fire#三昧真火#Samadhi wahres Feuer#Feu Véritable de Samadhi#Наиверное огни Самадхи#Fuego Verdadero del Samadhi#Fuoco Vero di Samadhi");
			AddTransl("混天绫", "混天绫#Chaotic Silk#混天绫#Chaotische Seide#Soie Chaotique#Хаотический шелк#Seda Caótica#Seta Caotica");
			AddTransl("风火轮", "风火轮#Wind and Fire Wheels#风火轮#Wind und Feuerräder#Roues de Vent et de Feu#ВетроОгненные колеса#Ruedas de Viento y Fuego#Ruote di Vento e Fuoco");
			AddTransl("哪吒上衣", "哪吒上衣#Nezha's Top#哪吒上衣#Nezhas Oberteil#Haut de Nezha#Верхняя одежда Нежи#Parte Superior de Nezha#Top di Nezha");
			AddTransl("哪吒头发", "哪吒头发#Nezha's Hair#哪吒头发#Nezhas Haar#Cheveux de Nezha#Волосы Нежи#Cabello de Nezha#Capelli di Nezha");
			AddTransl("哪吒裙甲", "哪吒裙甲#Nezha's Skirt Armor#哪吒裙甲#Nezhas Rockrüstung#Jambières de Nezha#Нарядный покров Нежи#Armadura de Falda de Nezha#Armatura Gonna di Nezha");
			AddTransl("哪吒裤子", "哪吒裤子#Nezha's Pants#哪吒裤子#Nezhas Hose#Pantalon de Nezha#Штаны Нежи#Pantalones de Nezha#Pantaloni di Nezha");
			AddTransl("莲花臂甲", "莲花臂甲#Lotus Armlet#莲花臂甲#Lotus-Armschiene#Bracelet de Lotus#Лотосный браслет#Brazalete de Loto#Braccialetto di Loto");
			AddTransl("黄金锁子甲-裙甲", "黄金锁子甲-裙甲#Golden Lock Armor - Skirt#黄金锁子甲-裙甲#Rüstung mit Goldenen Schlössern - Rock#Armure à Verrous Dorés - Jupe#Замковая броня с золотыми подвесками - Юбка#Armadura con Cerradura Dorada - Falda#Armatura con Serratura Dorata - Gonna");
			AddTransl("黄金锁子甲-胸甲", "黄金锁子甲-胸甲#Golden Lock Armor - Chest#黄金锁子甲-胸甲#Rüstung mit Goldenen Schlössern - Brust#Armure à Verrous Dorés - Poitrine#Замковая броня с золотыми замками - Грудь#Armadura con Cerradura Dorada - Pecho#Armatura con Serratura Dorata - Torace");
			AddTransl("黄金锁子甲-肩甲", "黄金锁子甲-肩甲#Golden Lock Armor - Shoulder#黄金锁子甲-肩甲#Rüstung mit Goldenen Schlössern - Schulter#Armure à Verrous Dorés - Épaule#Замковая броня с золотыми пряжками - Плечо#Armadura con Cerradura Dorada - Hombro#Armatura con Serratura Dorata - Spalla");
			AddTransl("黄金锁子甲-束腰", "黄金锁子甲-束腰#Golden Lock Armor - Waist#黄金锁子甲-束腰#Rüstung mit Goldenen Schlössern - Taille#Armure à Verrous Dorés - Taille#Замковая броня с золотыми пряжками - Талия#Armadura con Cerradura Dorada - Cintura#Armatura con Serratura Dorata - Vita");
			AddTransl("黄金锁子甲-小臂铠甲", "黄金锁子甲-小臂铠甲#Golden Lock Armor - Bracers#黄金锁子甲-小臂铠甲#Rüstung mit Goldenen Schlössern - Armschienen#Armure à Verrous Dorés - Brassards#Замковая броня с золотыми пряжками - Наручи#Armadura con Cerradura Dorada - Brazaletes#Armatura con Serratura Dorata - Bracciali");
			AddTransl("藕丝步云履", "藕丝步云履#Lotus Silk Cloud Shoes#藕丝步云履#Lotos Seidenwolkenschuhe#Chaussures en Soie de Lotus#Лотосные шелковые обуви Облака#Zapatos de Nubes de Seda de Loto#Scarpe di Nuvole di Seta di Loto");
			AddTransl("披风", "披风#Cape#披风#Umhang#Cape#Плащ#Capa#Mantello");
			AddTransl("头毛", "头毛#Head Hair#头毛#Kopfhaare#Cheveux de Tête#Головные Волосы#Cabello de Cabeza#Capelli della Testa");
			AddTransl("头冠", "头冠#Headdress#头冠#Kopfschmuck#Coiffe#Венок#Diadema#Diadema");
			AddTransl("大圣裤子", "大圣裤子#Great Sage's Pants#大圣裤子#Große Sage Hose#Pantalon du Grand Sage#Брюки Великого Мудреца#Pantalones del Gran Sabio#Pantaloni del Grande Saggio");
			AddTransl("大圣上衣", "大圣上衣#Great Sage's Top#大圣上衣#Große Sage Oberteil#Haut du Grand Sage#Верхняя одежда Великого Мудреца#Parte Superior del Gran Sabio#Top del Grande Saggio");
			AddTransl("黄金锁子甲-包腰", "黄金锁子甲-包腰#Golden Lock Armor - Wrap#黄金锁子甲-包腰#Rüstung mit Goldenen Schlössern - Wickel#Armure à Verrous Dorés - Enveloppe#Замковая броня с золотыми пряжками - Пеленка#Armadura con Cerradura Dorada - Envolver#Armatura con Serratura Dorata - Avvolgere");
			AddTransl("哪吒", "哪吒#Nezha#哪吒#Nezha#哪吒#Нежа#Nezha#Nezha");
			AddTransl("猴子", "猴子#Monkey#猴子#Affe#Singe#Обезьяна#Mono#Scimmia");
			AddTransl("哪吒体型", "哪吒体型#Nezha’s physique#哪吒体型#Nezha-Körperbau#Morphologie de Nezha#Физическое состояние Нежи#Físico de Nezha#Fisico di Nezha");
		}
	}
	[BepInPlugin("monkeyking", "fhp.cc.monkeyking", "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
{
	public ScenesManager()
	{
		SceneManager.sceneLoaded += SceneLoaded;
	}

	public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0137: Expected O, but got Unknown
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_018d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0194: Expected O, but got Unknown
		//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00aa: Expected O, but got Unknown
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f5: Expected O, but got Unknown
		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 val = SLMATool.CreateUnit("MoreContent Custom:" + basis.Entity.Name, (UnitBlueprint)SLMALoader.SDic["blueprints"]["CustomWobbler"], (Faction)null, (Sprite)null);
				val.UnitBase = ((Component)basis).gameObject;
				list.Add(new UnitBaseWrapper
				{
					BaseDisplayName = basis.Entity.Name,
					BaseIcon = basis.Entity.SpriteIcon,
					UnitBaseBlueprint = val,
					UnitBaseRestriction = (UnitBaseRestrictions)0
				});
			}
			component.UnitBases = list.ToArray();
		}
		if (((Scene)(ref scene)).name == "05_AsiaTemple_VC")
		{
			GameObject val2 = new GameObject();
			((Object)val2).name = "Core";
			val2.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("Unlock"), val2.transform);
		}
		if (((Scene)(ref scene)).name == "01_Lvl2_Tribal_VC")
		{
			GameObject val3 = new GameObject();
			((Object)val3).name = "Core";
			val3.transform.position = Vector3.zero;
			Object.Instantiate<GameObject>(UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("Unlock2"), val3.transform);
		}
	}
}
[HarmonyPatch(typeof(HealthHandler), "TakeDamage")]
internal class TakeDamgePatch
{
	[HarmonyPrefix]
	public static bool Prefix(HealthHandler __instance, Unit ___unit, float damage, GameStateManager ___m_gameStateManager, bool ___isInvulnerable, DataHandler ___data, Action ___takeDamageAction, Unit damager, bool ___isRestrictedInGameMode, SettingsInstance ___m_bugUnitsDying)
	{
		//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c1: Invalid comparison between Unknown and I4
		if (Object.op_Implicit((Object)(object)((Component)___unit).gameObject.GetComponentInChildren<MonkeyArmor>()) && damage <= ((Component)___unit).gameObject.GetComponentInChildren<MonkeyArmor>().armorhealth)
		{
			return false;
		}
		if (Object.op_Implicit((Object)(object)((Component)___unit).gameObject.GetComponentInChildren<MonkeyKingArmor>()) && damage <= ((Component)___unit).gameObject.GetComponentInChildren<MonkeyKingArmor>().armorhealth)
		{
			return false;
		}
		if (Object.op_Implicit((Object)(object)((Component)___unit).gameObject.GetComponentInChildren<MonkeyKingArmor>()) && damage > ((Component)___unit).gameObject.GetComponentInChildren<MonkeyKingArmor>().armorhealth)
		{
			damage -= ((Component)___unit).gameObject.GetComponentInChildren<MonkeyKingArmor>().armorhealth;
			if (damage < 0f)
			{
				damage = 0f;
			}
			Mathf.Clamp(damage, 0f, float.MaxValue);
			if (___m_gameStateManager == null)
			{
				___m_gameStateManager = ServiceLocator.GetService<GameStateManager>();
			}
			if (___m_gameStateManager != null && (int)___m_gameStateManager.GameState != 1)
			{
				return false;
			}
			if (___isInvulnerable)
			{
				return false;
			}
			if (___data.immunityForSeconds > 0f && damage > 0f)
			{
				return false;
			}
			if (___data.lifeTime < 0.3f)
			{
				return false;
			}
			if (___unit.WasDamaged((Rigidbody)null, (Rigidbody)null))
			{
				return false;
			}
			___takeDamageAction?.Invoke();
			___unit.WasDamaged(damage);
			if (Object.op_Implicit((Object)(object)damager))
			{
				damager.DealDamage(damage);
			}
			bool flag = true;
			if (Bugs._DLC_ACTIVATED && ___m_bugUnitsDying.currentValue == 1)
			{
				flag = ___isRestrictedInGameMode;
			}
			if (flag)
			{
				___data.health -= damage;
				___data.health = Mathf.Clamp(___data.health, float.NegativeInfinity, ___data.maxHealth);
			}
			if (___data.health <= 0f)
			{
				__instance.Die(damager);
				return false;
			}
			OtherLibrary.InvokeMethod<HealthHandler>(__instance, "DamageFeedback", new object[1] { damage });
			return false;
		}
		return true;
	}
}
public class MonkeyArmor : MonoBehaviour
{
	public float armorhealth;
}
[HarmonyPatch(typeof(ProjectileHit), "Hit")]
internal class ProjectilePatch
{
	[HarmonyPrefix]
	public static bool Prefix(ProjectileHit __instance, RaycastHit sentHit, float multiplier, ref MoveTransform ___move, ref RaycastTrail ___trail, ref TeamHolder ___teamHolder)
	{
		//IL_00ab: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)((Component)((RaycastHit)(ref sentHit)).transform).gameObject.GetComponentInParent<Unit>()) && ((Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref sentHit)).transform).gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyArmor>()) && ((Component)((Component)((RaycastHit)(ref sentHit)).transform).gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyArmor>().armorhealth >= __instance.blockPoweredNeeded) || (Object.op_Implicit((Object)(object)((Component)((Component)((RaycastHit)(ref sentHit)).transform).gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyKingArmor>()) && ((Component)((Component)((RaycastHit)(ref sentHit)).transform).gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyKingArmor>().armorhealth >= __instance.blockPoweredNeeded)))
		{
			if (Object.op_Implicit((Object)(object)___move))
			{
				___move.velocity = Vector3.Reflect(___move.velocity, ((RaycastHit)(ref sentHit)).normal) * Random.Range(0.2f, 0.4f);
			}
			if (Object.op_Implicit((Object)(object)___trail))
			{
				___trail.ignoredFrames = 3;
			}
			Object.Instantiate<GameObject>(UManager.hiteffect, ((RaycastHit)(ref sentHit)).point, Quaternion.identity).GetComponentInChildren<ParticleSystem>().Play();
			return false;
		}
		return true;
	}
}
[HarmonyPatch(typeof(CollisionWeapon), "OnCollisionEnter")]
internal class WeaponPatch
{
	[HarmonyPrefix]
	public static bool Prefix(CollisionWeapon __instance, Collision collision, ref MeleeWeapon ___meleeWeapon, ref Rigidbody ___rig, ref DataHandler ___connectedData)
	{
		//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_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)
		if (Object.op_Implicit((Object)(object)collision.gameObject.GetComponentInParent<Unit>()) && ((Object.op_Implicit((Object)(object)((Component)collision.gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyArmor>()) && ((Component)collision.gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyArmor>().armorhealth >= __instance.damage) || (Object.op_Implicit((Object)(object)((Component)collision.gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyKingArmor>()) && ((Component)collision.gameObject.GetComponentInParent<Unit>()).GetComponentInChildren<MonkeyKingArmor>().armorhealth >= __instance.damage)) && ((Component)__instance).GetComponentInParent<Unit>().Team != collision.gameObject.GetComponentInParent<Unit>().Team)
		{
			___meleeWeapon.StopSwing();
			Object.Instantiate<GameObject>(UManager.hiteffect, ((ContactPoint)(ref collision.contacts[0])).point, Quaternion.identity).GetComponentInChildren<ParticleSystem>().Play();
		}
		return true;
	}
}
namespace ChineseMythology
{
	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 MonkeyKingArmor : MonoBehaviour
{
	public float armorhealth;
}
public class WeaponScaleChange : MonoBehaviour
{
	private Vector3 originalScale;

	private bool isScaling;

	private Coroutine scaleCoroutine;

	private float cooldownTime = 4.5f;

	private float lastSwingTime;

	private void Start()
	{
		//IL_0007: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Unknown result type (might be due to invalid IL or missing references)
		originalScale = ((Component)this).transform.localScale;
		lastSwingTime = 0f - cooldownTime;
	}

	private void Update()
	{
		if (((Component)this).GetComponentInChildren<MeleeWeapon>().isSwinging && !isScaling && Time.time - lastSwingTime >= cooldownTime)
		{
			scaleCoroutine = ((MonoBehaviour)this).StartCoroutine(ScaleWeapon());
			lastSwingTime = Time.time;
		}
	}

	private IEnumerator ScaleWeapon()
	{
		isScaling = true;
		float duration = 2f;
		float targetScale = 2.6f;
		for (float t2 = 0f; t2 < duration / 2f; t2 += Time.deltaTime)
		{
			float num = t2 / (duration / 2f);
			((Component)this).transform.localScale = Vector3.Lerp(originalScale, originalScale * targetScale, num);
			yield return null;
		}
		for (float t2 = duration / 2f; t2 < duration; t2 += Time.deltaTime)
		{
			float num2 = (t2 - duration / 2f) / (duration / 2f);
			((Component)this).transform.localScale = Vector3.Lerp(originalScale * targetScale, originalScale, num2);
			yield return null;
		}
		isScaling = false;
	}

	public void CancelScale()
	{
		if (scaleCoroutine != null)
		{
			((MonoBehaviour)this).StopCoroutine(scaleCoroutine);
			isScaling = false;
		}
	}
}
public class 火眼金睛 : Move
{
	public Transform[] eyes;

	public GameObject project;

	public Unit unit;

	public Color target;

	private Color org;

	private bool isattacking;

	private void Start()
	{
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_010f: Unknown result type (might be due to invalid IL or missing references)
		isattacking = false;
		unit = ((Component)this).GetComponentInParent<Unit>();
		eyes = (Transform[])(object)new Transform[((Component)((Component)this).GetComponentInParent<Unit>().data.head).GetComponentsInChildren<GooglyEye>().Length];
		int num = 0;
		GooglyEye[] componentsInChildren = ((Component)((Component)this).GetComponentInParent<Unit>().data.head).GetComponentsInChildren<GooglyEye>();
		foreach (GooglyEye val in componentsInChildren)
		{
			eyes[num] = val.pupil;
			num++;
		}
		Transform[] array = eyes;
		foreach (Transform val2 in array)
		{
			OtherLibrary.AddCopiedComponent<RangeWeapon>(((Component)val2).gameObject, ((GameObject)SLMALoader.SDic["weapons"]["Leg_WizardStaff"]).GetComponentInChildren<RangeWeapon>());
			((Component)val2).gameObject.GetComponentInChildren<RangeWeapon>().ObjectToSpawn = project;
			((Weapon)((Component)val2).gameObject.GetComponentInChildren<RangeWeapon>()).connectedData = ((Component)this).GetComponentInParent<Unit>().data;
			((Component)val2).gameObject.AddComponent<ShootPosition>();
			org = ((Component)val2).gameObject.GetComponentInChildren<Renderer>().materials[0].color;
		}
	}

	public override void DoMove(Rigidbody enemyWeapon, Rigidbody enemyTorso, DataHandler targetData)
	{
		if (!isattacking)
		{
			isattacking = true;
			((MonoBehaviour)this).StartCoroutine_Auto(Attack(enemyTorso));
		}
	}

	private IEnumerator Attack(Rigidbody enemyTorso)
	{
		yield return (object)new WaitUntil((Func<bool>)(() => eyes != null));
		((Component)((Component)this).GetComponentInParent<Unit>().data.head).GetComponentInChildren<GooglyEye>().SetState((EyeState)0);
		Transform[] array = eyes;
		foreach (Transform val in array)
		{
			ChineseLibrary.颜色设置(((Component)val).gameObject, target);
			RangeWeapon componentInChildren = ((Component)val).gameObject.GetComponentInChildren<RangeWeapon>();
			Vector3 position = val.position;
			Vector3 val2 = val.position - enemyTorso.position;
			((Weapon)componentInChildren).Attack(position, enemyTorso, ((Vector3)(ref val2)).normalized, false);
		}
		yield return (object)new WaitForSeconds(3f);
		Transform[] array2 = eyes;
		for (int j = 0; j < array2.Length; j++)
		{
			ChineseLibrary.颜色设置(((Component)array2[j]).gameObject, org);
		}
		isattacking = false;
	}
}
public class SuperStick : MonoBehaviour
{
	public float rotationSpeed;

	public float growthSpeed;

	private Vector3 initialScale;

	private GameObject nearestTarget;

	public float C = 1.2f;

	private void Start()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0006: 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)
		initialScale = Vector3.zero;
		((Component)this).transform.localScale = initialScale;
		((Component)this).transform.rotation = Quaternion.identity;
		FindNearestTarget();
		((Component)this).gameObject.AddComponent<RemoveAfterSeconds>().seconds = 8f;
	}

	private void Update()
	{
		//IL_000c: 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_0021: 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_006e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: 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_0092: 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_009e: 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)
		//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fd: 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_0112: 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_011c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0123: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: 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)
		((Component)this).transform.GetChild(0).Rotate(Vector3.forward * rotationSpeed * Time.deltaTime);
		FindNearestTarget();
		if ((Object)(object)nearestTarget != (Object)null)
		{
			C -= Time.deltaTime;
			Vector3 val = ((Component)nearestTarget.GetComponent<Unit>().data.mainRig).transform.position - ((Component)this).transform.position;
			((Vector3)(ref val)).Normalize();
			Transform transform = ((Component)this).transform;
			transform.position += val * growthSpeed * Time.deltaTime;
			if (C <= 0f)
			{
				((MonoBehaviour)this).StartCoroutine(TakeAttack());
			}
		}
		if (((Component)this).transform.localScale.x < 1.6f)
		{
			Vector3 val2 = ((Component)this).transform.localScale + Vector3.one * 1.6f * growthSpeed * Time.deltaTime;
			((Component)this).transform.localScale = Vector3.Min(val2, Vector3.one * 1.6f);
		}
	}

	public SuperStick()
	{
		growthSpeed = 30f;
		rotationSpeed = 1440f;
	}

	private void FindNearestTarget()
	{
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		//IL_0058: Unknown result type (might be due to invalid IL or missing references)
		Unit[] array = Object.FindObjectsOfType<Unit>();
		float num = float.PositiveInfinity;
		Unit[] array2 = array;
		foreach (Unit val in array2)
		{
			if ((Object)(object)val != (Object)null && val.Team != ((Component)this).GetComponent<TeamHolder>().team && !val.data.Dead)
			{
				float num2 = Vector3.Distance(((Component)this).transform.position, ((Component)val.data.mainRig).transform.position);
				if (num2 < num)
				{
					num = num2;
					nearestTarget = ((Component)val).gameObject;
				}
			}
		}
		if ((Object)(object)nearestTarget != (Object)null)
		{
			Debug.Log((object)("Nearest target: " + ((Object)nearestTarget).name));
		}
	}

	public IEnumerator TakeAttack()
	{
		Unit[] array = Object.FindObjectsOfType<Unit>();
		foreach (Unit val in array)
		{
			if ((Object)(object)val != (Object)null && val.Team != ((Component)this).GetComponent<TeamHolder>().team && !val.dead && Vector3.Distance(((Component)this).transform.position, ((Component)val.data.mainRig).transform.position) < 2.1f)
			{
				HealthHandler healthHandler = val.data.healthHandler;
				Vector3 val2 = ((Component)this).transform.position - nearestTarget.GetComponent<Unit>().data.mainRig.position;
				((Damagable)healthHandler).TakeDamage(100f, ((Vector3)(ref val2)).normalized * 5f, ((Component)this).GetComponent<TeamHolder>().spawner.GetComponentInChildren<Unit>(), (DamageType)0);
				val.data.mainRig.AddForce(((Component)nearestTarget.GetComponent<Unit>().data.mainRig).transform.forward * -1f * 200f, (ForceMode)1);
			}
		}
		C = 0.2f;
		yield break;
	}
}
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 ClearFire : MonoBehaviour
{
	private void Update()
	{
		if (!Object.op_Implicit((Object)(object)((Component)this).GetComponentInChildren<UnitEffectBase>()))
		{
			return;
		}
		UnitEffectBase[] componentsInChildren = ((Component)this).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);
			}
		}
	}
}