Decompiled source of ChouChou s Unit v0.3.0

ChouChou's Map.dll

Decompiled a week 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);
	}
}

ChouChou's Units-part2.dll

Decompiled a week 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 DARK;
using DM;
using FhpSLib;
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 CManager
	{
		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;

		public static SLMABundleMod bundleMod5;

		public static AssetBundle devilbundle;

		public static bool isC;

		public static AssetBundle dlc3;

		public static SLMABundleMod bundleMod6;

		static CManager()
		{
			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_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0367: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b5: Expected O, but got Unknown
			//IL_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b1: Expected O, but got Unknown
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0634: Expected O, but got Unknown
			//IL_0929: 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)
			//IL_09c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ca: Expected O, but got Unknown
			//IL_09e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_09eb: Expected O, but got Unknown
			//IL_0a06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0c: Expected O, but got Unknown
			//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2d: Expected O, but got Unknown
			//IL_0a48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4e: Expected O, but got Unknown
			//IL_0a69: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6f: Expected O, but got Unknown
			//IL_0b15: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b25: Expected O, but got Unknown
			//IL_0c96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c9c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff4: Unknown result type (might be due to invalid IL or missing references)
			//IL_1418: Unknown result type (might be due to invalid IL or missing references)
			//IL_11b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_11bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_1263: Unknown result type (might be due to invalid IL or missing references)
			//IL_12a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_1484: Unknown result type (might be due to invalid IL or missing references)
			com = "----------------------------------------------------------------------------------------------------------------------------";
			com = "Tropical";
			com = "----------------------------------------------------------------------------------------------------------------------------";
			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 == "圣骑士")
			{
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"Legacy Attack Vocals/Thor");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"Legacy Death Vocals/Thor");
				s.SetField<UnitBlueprint>(unit, "footRef", (object)"Footsteps/Normal");
				s.SetField<UnitBlueprint>(unit, "VoicePitch", (object)0.7f);
				unit.holdinigWithTwoHands = false;
				unit.Entity.SetUnlockKey("sqs1");
				unit.UnitBase = bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士体型");
				unit.sizeMultiplier = 1.4f;
				unit.health = 1200f;
				unit.forceCost = 2500u;
				unit.RightWeapon = bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士剑");
				unit.LeftWeapon = bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士的盾");
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
				unit.movementSpeedMuiltiplier = 1.2f;
				unit.massMultiplier = 10f;
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[2]
				{
					(GameObject)SLMALoader.SDic["moves"]["KnightCharge"],
					bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("不摔倒")
				});
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[3]
				{
					bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士头盔"),
					bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士披风"),
					bundleMod6.GetAssetBundle("sqs").LoadAsset<GameObject>("圣骑士上4衣")
				});
				unit.Validate();
			}
			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 = 8000u;
				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>("天灾");
				unit.m_props = null;
				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 == "小恶魔")
			{
				unit.Entity.SpriteIcon = devilbundle.LoadAsset<Sprite>("R1");
				unit.health = 150f;
			}
			if (unit.Entity.Name == "恶魔掷叉手")
			{
				List<GameObject> list = unit.objectsToSpawnAsChildren.ToList();
				GameObject val = UPool.MyPool.AddObject("xr", (GameObject)SLMALoader.SDic["moves"]["DragonKick"], true, (HideFlags)52, (Sprite)null, 0, false);
				Object.Destroy((Object)(object)((Component)val.transform.Find("DragonKick_L")).gameObject);
				GameObject val2 = UPool.MyPool.AddObject("xr2", val.GetComponentInChildren<SpawnObject>().objectToSpawn, true, (HideFlags)52, (Sprite)null, 0, false);
				val2.GetComponentInChildren<Explosion>().damage = 80f;
				val.GetComponentInChildren<SpawnObject>().objectToSpawn = val2;
				CollisionWeapon[] componentsInChildren = val.GetComponentsInChildren<CollisionWeapon>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].damage = 20f;
				}
				list.Add(val);
				unit.objectsToSpawnAsChildren = list.ToArray();
			}
			if (unit.Entity.Name == "恶魔祭司")
			{
				unit.Entity.SpriteIcon = devilbundle.LoadAsset<Sprite>("R2");
			}
			UnitBlueprint[] units;
			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") });
				List<UnitBlueprint> list2 = new List<UnitBlueprint>();
				units = Devils.devilfaction.Units;
				foreach (UnitBlueprint item in units)
				{
					list2.Add(item);
				}
				list2.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
				Devils.devilfaction.Units = list2.ToArray();
			}
			if (unit.Entity.Name == "地狱猎犬")
			{
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"emo1/Def");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"emo1/Dead");
				unit.Entity.SetUnlockKey("emo1");
				unit.Validate();
				bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("地狱犬").AddComponent<ClearFire>();
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(NeverStopRunning) };
				unit.health = 150f;
				unit.sizeMultiplier = 1.5f;
				unit.forceCost = 400u;
				unit.sizeMultiplier = 1.5f;
				unit.animationMultiplier = 2f;
				unit.movementSpeedMuiltiplier = 4f;
				unit.holdinigWithTwoHands = false;
				unit.RightWeapon = null;
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[0]);
				unit.UnitBase = bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("地狱犬");
				List<UnitBlueprint> list3 = new List<UnitBlueprint>();
				units = Devils.devilfaction.Units;
				foreach (UnitBlueprint item2 in units)
				{
					list3.Add(item2);
				}
				list3.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
				Devils.devilfaction.Units = list3.ToArray();
			}
			if (unit.Entity.Name == "恶魔军团")
			{
				s.SetField<UnitBlueprint>(unit, "VocalRef", (object)"emo2/Def");
				s.SetField<UnitBlueprint>(unit, "DeathRef", (object)"");
				unit.Entity.SetUnlockKey("emo2");
				unit.Validate();
				unit.sizeMultiplier = 1.2f;
				bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("恶魔军团 Prefabs_VB 1").AddComponent<ClearFire>();
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
				unit.health = 500f;
				unit.forceCost = 1500u;
				unit.holdinigWithTwoHands = false;
				unit.RightWeapon = bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("恶魔之刃");
				bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("恶魔之刃").GetComponentInChildren<MeleeWeapon>()
					.SoundRef = "DevilSounds/EMJT HD";
				unit.UnitBase = bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("恶魔军团 Prefabs_VB 1");
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[1] { bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("恶魔军团服装") });
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[1] { bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("军团复制") });
				List<UnitBlueprint> list4 = new List<UnitBlueprint>();
				units = Devils.devilfaction.Units;
				foreach (UnitBlueprint item3 in units)
				{
					list4.Add(item3);
				}
				list4.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
				Devils.devilfaction.Units = list4.ToArray();
			}
			if (unit.Entity.Name == "贪食魔")
			{
				unit.voiceBundle = devilbundle.LoadAsset<VoiceBundle>("贪食魔VB");
				s.SetField<UnitBlueprint>(unit, "foodRef", (object)"Footsteps/IceGiant");
				unit.Entity.SetUnlockKey("emo3");
				unit.Validate();
				devilbundle.LoadAsset<GameObject>("贪食魔").AddComponent<ClearFire>();
				unit.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
				unit.massMultiplier = 20f;
				unit.turnSpeed = 50f;
				unit.sizeMultiplier = 1.5f;
				unit.health = 1300f;
				unit.stepMultiplier = 2f;
				unit.forceCost = 3000u;
				unit.animationMultiplier = 0.8f;
				unit.holdinigWithTwoHands = false;
				unit.RightWeapon = bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("武器右 Weapons_VB 1");
				unit.RightWeapon.GetComponentInChildren<CollisionSound>().SoundEffectRef = "DevilSounds/TSM Hit";
				unit.RightWeapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = (CallEffectsOn)2;
				unit.LeftWeapon = bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("左手 Weapons_VB 2");
				unit.LeftWeapon.GetComponentInChildren<CollisionSound>().SoundEffectRef = "DevilSounds/TSM Hit";
				unit.LeftWeapon.GetComponentInChildren<CollisionWeapon>().callEffectsOn = (CallEffectsOn)2;
				unit.UnitBase = devilbundle.LoadAsset<GameObject>("贪食魔");
				unit.UnitBase.AddComponent<TanShiDeavil>();
				devilbundle.LoadAsset<GameObject>("吞噬").AddComponent<EatMove>();
				ChineseLibrary.服装设置(unit, (GameObject[])(object)new GameObject[1] { devilbundle.LoadAsset<GameObject>("衣服 -贪食魔") });
				ChineseLibrary.技能设置(unit, (GameObject[])(object)new GameObject[5]
				{
					bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("测试"),
					bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("Wings_Leg_SuperP 1"),
					bundleMod5.GetAssetBundle("emo").LoadAsset<GameObject>("Wings_Leg_SuperP 1"),
					devilbundle.LoadAsset<GameObject>("死亡自爆"),
					devilbundle.LoadAsset<GameObject>("吞噬")
				});
				List<UnitBlueprint> list5 = new List<UnitBlueprint>();
				units = Devils.devilfaction.Units;
				foreach (UnitBlueprint item4 in units)
				{
					list5.Add(item4);
				}
				list5.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
				Devils.devilfaction.Units = list5.ToArray();
			}
			unit.Validate();
			List<UnitBlueprint> list6 = new List<UnitBlueprint>();
			units = ((Faction)SLMALoader.SDic["factions"]["Secret"]).Units;
			foreach (UnitBlueprint item5 in units)
			{
				list6.Add(item5);
			}
			list6.Sort((UnitBlueprint unit1, UnitBlueprint unit2) => unit1.GetUnitCost(true).CompareTo(unit2.GetUnitCost(true)));
			((Faction)SLMALoader.SDic["factions"]["Secret"]).Units = list6.ToArray();
		}

		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_0464: Unknown result type (might be due to invalid IL or missing references)
			//IL_0469: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fc: Expected O, but got Unknown
			//IL_04fc: Expected O, but got Unknown
			//IL_051b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_055c: Expected O, but got Unknown
			//IL_055c: Expected O, but got Unknown
			//IL_057b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0599: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bc: Expected O, but got Unknown
			//IL_05bc: Expected O, but got Unknown
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_061c: Expected O, but got Unknown
			//IL_061c: Expected O, but got Unknown
			//IL_063b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Unknown result type (might be due to invalid IL or missing references)
			//IL_067c: Expected O, but got Unknown
			//IL_067c: 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;
			}
			AssetBundle val5;
			using (Stream stream5 = Assembly.GetExecutingAssembly().GetManifestResourceStream("emo"))
			{
				val5 = AssetBundle.LoadFromStream(stream5);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj5 = SLMABundleMod.CreatSLMABundleMod("TestMod6", "0.0.5");
				obj5.AddAssetBundle("emo", val5);
				obj5.Dev_mode = true;
				obj5.LoadAssetBundle("emo");
				bundleMod5 = obj5;
			}
			AssetBundle val6;
			using (Stream stream6 = Assembly.GetExecutingAssembly().GetManifestResourceStream("sqs"))
			{
				val6 = AssetBundle.LoadFromStream(stream6);
			}
			if (Loader.BundleMode)
			{
				SLMABundleMod obj6 = SLMABundleMod.CreatSLMABundleMod("TestMod7", "0.0.6");
				obj6.AddAssetBundle("sqs", val6);
				obj6.Dev_mode = true;
				obj6.LoadAssetBundle("sqs");
				bundleMod6 = obj6;
			}
			SoundBank[] array = val3.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj7 in array)
			{
				SoundBank soundBank = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list = soundBank.Categories.ToList();
				SoundBankCategory[] categories = obj7.Categories;
				foreach (SoundBankCategory item in categories)
				{
					list.Add(item);
				}
				soundBank.Categories = list.ToArray();
			}
			array = val.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj8 in array)
			{
				SoundBank soundBank2 = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list2 = soundBank2.Categories.ToList();
				SoundBankCategory[] categories = obj8.Categories;
				foreach (SoundBankCategory item2 in categories)
				{
					list2.Add(item2);
				}
				soundBank2.Categories = list2.ToArray();
			}
			array = val5.LoadAllAssets<SoundBank>();
			foreach (SoundBank obj9 in array)
			{
				SoundBank soundBank3 = ServiceLocator.GetService<SoundPlayer>().soundBank;
				List<SoundBankCategory> list3 = soundBank3.Categories.ToList();
				SoundBankCategory[] categories = obj9.Categories;
				foreach (SoundBankCategory item3 in categories)
				{
					list3.Add(item3);
				}
				soundBank3.Categories = list3.ToArray();
			}
			SoundBank soundBank4 = ServiceLocator.GetService<SoundPlayer>().soundBank;
			SoundBank[] array2 = bundleMod.GetAssetBundle("dark").LoadAllAssets<SoundBank>();
			if (array2 != null)
			{
				List<SoundBankCategory> list4 = soundBank4.Categories.ToList();
				array = array2;
				foreach (SoundBank val7 in array)
				{
					if ((Object)(object)val7 != (Object)null)
					{
						list4.AddRange(val7.Categories);
					}
				}
				soundBank4.Categories = list4.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"], bundleMod6.GetAssetBundle("sqs").LoadAsset<Sprite>("圣骑士图标"));
			Devil();
			Init3();
			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();
			}
		}

		public static void Init3()
		{
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_00bc: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			if (!isC)
			{
				isC = true;
				UnitBlueprint val = SLMATool.CreateUnit("矿工矮人", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], devilbundle.LoadAsset<Sprite>("矿工矮人icon"));
				val.UnitBase = UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人体型");
				val.RightWeapon = devilbundle.LoadAsset<GameObject>("锤稿");
				val.holdinigWithTwoHands = true;
				val.m_props = (GameObject[])(object)new GameObject[1] { devilbundle.LoadAsset<GameObject>("矿工矮人") };
				val.voiceBundle = ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_WESTERN_MINER"]).voiceBundle;
				GameObject val2 = CreateNewMove("挖矿遁地", 249343534);
				((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
				{
					new Tag
					{
						tagType = (TagType)0,
						value = "ChouChou'sUnits"
					}
				};
				val2.AddComponent<Miner>().Mining = devilbundle.LoadAsset<GameObject>("遁地特效");
				val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val2 };
				val.VoicePitch = 0.86f;
				val.Validate();
				val.Entity.SetUnlockKey("DwarvesGZ");
				val.health = 312.5f;
				val.forceCost = 220u;
				val.massMultiplier = 20f;
				val.sizeMultiplier = 1.2f;
				val.movementSpeedMuiltiplier = 1.2f;
				val.attackSpeedMultiplier = 2f;
				Init4();
			}
			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 Devil()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: 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_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: 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_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0592: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0787: Unknown result type (might be due to invalid IL or missing references)
			//IL_0773: 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_085c: Expected O, but got Unknown
			//IL_087b: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Expected O, but got Unknown
			//IL_08be: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e2: Expected O, but got Unknown
			//IL_0901: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Expected O, but got Unknown
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("chouchoudlc"))
			{
				devilbundle = AssetBundle.LoadFromStream(stream);
				AssetBundle val = devilbundle;
				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;
									OtherLibrary.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);
			}
			CPline();
			Faction val6 = SLMATool.CreateFaction("恶魔", (UnitBlueprint[])null, devilbundle.LoadAsset<Sprite>("恶魔派系icon"), 998534534);
			SLMATool.CreateUnit("火伊布", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], val6, bundleMod3.GetAssetBundle("huo").LoadAsset<Sprite>("小恶魔icon"));
			SLMATool.CreateUnit("地狱猎犬", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], val6, bundleMod5.GetAssetBundle("emo").LoadAsset<Sprite>("地狱猎犬icon"));
			SLMATool.CreateUnit("恶魔军团", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], val6, bundleMod5.GetAssetBundle("emo").LoadAsset<Sprite>("恶魔军团icon"));
			SLMATool.CreateUnit("贪食魔", (UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_TRIBAL_CLUB"], val6, bundleMod5.GetAssetBundle("emo").LoadAsset<Sprite>("贪食魔icon"));
			Devils.devilfaction = val6;
			Devils.GoCreate();
		}

		public static Sprite GetSprite(string name)
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Expected O, but got Unknown
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name);
			if (stream == null)
			{
				Debug.LogError((object)("Resource stream not found: " + name));
				return null;
			}
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, (int)stream.Length);
			Texture2D val = new Texture2D(2, 2);
			if (ImageConversion.LoadImage(val, array))
			{
				((Texture)val).filterMode = (FilterMode)0;
				return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
			}
			Debug.LogError((object)("Failed to load image from resource: " + name));
			return null;
		}

		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 Init4()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			UnitBlueprint val = SLMATool.CreateUnit("散弹矮人", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], devilbundle.LoadAsset<Sprite>("霰弹矮人icon"));
			val.UnitBase = UManager.mod.GetAssetBundle("Mod").LoadAsset<GameObject>("矮人体型");
			val.RightWeapon = devilbundle.LoadAsset<GameObject>("符文霰弹枪");
			val.holdinigWithTwoHands = true;
			val.m_props = (GameObject[])(object)new GameObject[1] { devilbundle.LoadAsset<GameObject>("散弹矮人") };
			val.voiceBundle = devilbundle.LoadAsset<VoiceBundle>("XD");
			GameObject val2 = CreateNewMove("回头逃跑", 343242212);
			((CharacterItem)val2.GetComponentInChildren<SpecialAbility>()).tags = new List<Tag>
			{
				new Tag
				{
					tagType = (TagType)0,
					value = "ChouChou'sUnits"
				}
			};
			val2.AddComponent<DwarfRunFear>();
			val.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[1] { val2 };
			val.Validate();
			val.health = 194.44444f;
			val.Entity.SetUnlockKey("DwarvesXD");
			val.forceCost = 800u;
			val.massMultiplier = 20f;
			val.sizeMultiplier = 1.2f;
			val.movementSpeedMuiltiplier = 1f;
			val.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepPreferredDistance) };
			((Weapon)val.RightWeapon.GetComponentInChildren<RangeWeapon>()).internalCooldown = 2f;
			val.RightWeapon.GetComponentInChildren<RangeWeapon>().ObjectToSpawn.GetComponentInChildren<ProjectileHit>().damage = 50f;
			Init5();
		}

		public static void Init5()
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Expected O, but got Unknown
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			UnitBlueprint val = SLMATool.CreateUnit("镭射枪手", (UnitBlueprint)null, (Faction)SLMALoader.SDic["factions"]["Secret"], dlc3.LoadAsset<Sprite>("镭射步枪icon"));
			val.RightWeapon = dlc3.LoadAsset<GameObject>("镭射步枪");
			((Weapon)val.RightWeapon.GetComponentInChildren<RangeWeapon>()).maxRange = 60f;
			val.RightWeapon.GetComponentInChildren<RangeWeapon>().ObjectToSpawn.AddComponent<TakeDamagePercent>().percent = 0.1f;
			Compensation componentInChildren = val.RightWeapon.GetComponentInChildren<RangeWeapon>().ObjectToSpawn.GetComponentInChildren<Compensation>();
			componentInChildren.rangePow *= 0f;
			val.holdinigWithTwoHands = true;
			val.m_props = (GameObject[])(object)new GameObject[1] { dlc3.LoadAsset<GameObject>("霓虹狙击手") };
			val.voiceBundle = ((UnitBlueprint)SLMALoader.SDic["blueprints"]["UNIT_ASIA_ARCHER_FIREWORK"]).voiceBundle;
			val.VoicePitch = 1.1f;
			val.Validate();
			val.health = 150f;
			val.Entity.SetUnlockKey("NeonGun");
			val.forceCost = 1000u;
			val.massMultiplier = 20f;
			val.sizeMultiplier = 1f;
			val.movementSpeedMuiltiplier = 1f;
			val.MovementComponents = new List<IMovementComponent> { (IMovementComponent)(object)default(KeepRangedDistance) };
			DoTrans();
		}

		public static void CPline()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: 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_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b2: 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_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_075c: 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_05e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0784: Unknown result type (might be due to invalid IL or missing references)
			//IL_0770: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0488: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("chouchoudlc3");
			dlc3 = AssetBundle.LoadFromStream(stream);
			AssetBundle val = dlc3;
			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;
								OtherLibrary.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);
		}

		public static void AddTransl(string key, string trans)
		{
			//IL_0085: 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)
			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++)
			{
				if (!dictionary2[dictionary[i]].ContainsKey(key))
				{
					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("小恶魔", "小恶魔#Little Demon#小悪魔#Kleiner Dämon#Petit démon#Маленький бес#Pequeno demônio#Piccolo demonio");
			AddTransl("地狱猎犬", "地狱猎犬#Hell Hound#地獄の猟犬#Höllenhund#Chien d'enfer#Адский пёс#Cão do inferno#Cane dell'inferno");
			AddTransl("恶魔掷叉手", "恶魔掷叉手#Demon Javelin Thrower#悪魔の投槍兵#Dämonischer Speerwerfer#Lanceur de javelot démoniaque#Демон-копьеметатель#Lançador de dardos demoníaco#Lanciatore di giavellotti demoniaco");
			AddTransl("恶魔军团", "恶魔军团#Demon Legion#悪魔の軍団#Dämonische Legion#Légion démoniaque#Демоническая легион#Legião demoníaca#Legione demoniaca");
			AddTransl("恶魔祭司", "恶魔祭司#Demon Priest#悪魔の祭司#Dämonischer Priester#Prêtre démoniaque#Демонический жрец#Sacerdote demoníaco#Sacerdote demoniaco");
			AddTransl("贪食魔", "贪食魔#Gluttonous Demon#食いしん坊の悪魔#Fressdämon#Démon glouton#Чревоугодник#Demoníaco glutão#Demone goloso");
			AddTransl("矿工矮人", "矿工矮人#Miner Dwarf#鉱山小人#Minen-Zwerg#Nain mineur#Шахтёр-карлик#Anão mineiro#Nane minatore");
			AddTransl("散弹矮人", "散弹矮人#Shotgun Dwarf#散弾小人#Schrotzwerg#Nain à fusil à pompe#Штурмовой карлик#Anão com espingarda#Nano con fucile a pompa");
			AddTransl("镭射枪手", "镭射枪手#Laser Gunner#レーザー銃兵#Lasergewehrschütze#Tireur au laser#Лазерный стрелок#Atirador a laser#Fuciliere laser");
			AddTransl("回头逃跑", "回头逃跑#Run Away#逃げる#Weglaufen#S'enfuir#Убегать#Correr para longe#Fuggire");
			AddTransl("挖矿遁地", "挖矿遁地#Mining and Tunneling#鉱山掘り#Bergbau und Tunneln#Minage et tunnelage#Рудничное туннелирование#Mineração e fuga#Minerazione e fuga");
			AddTransl("吞噬", "吞噬#Devour#飲み込む#Verschlingen#Dévorer#Пожирать#Devorar#Divorare");
			AddTransl("死亡自爆", "死亡自爆#Suicide Explosion#自爆#Selbstzerstörung#Explosion suicide#Самоубийственное взрыв#Autoexplosão#Autoesplosione");
			AddTransl("圣骑士", "圣骑士#Paladin#パラディン#Paladin#Paladin#Паладин#Paladín#Paladino");
		}
	}
	[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));
			yield return (object)new WaitForSecondsRealtime(0.3f);
			SLMALoader.GetInstance();
			LandfallContentDatabase landfallContentDatabase = ContentDatabase.Instance().LandfallContentDatabase;
			CManager.Init(landfallContentDatabase);
			CManager.Init3();
			new Harmony(CManager.modname).PatchAll();
			GOSLMA.EditWeapons = ((GOSLMA.EditWeapons == null) ? new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(CManager.EditWeapons) : ((Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, Team, Unit, MeleeWeapon, RangeWeapon, LandfallContentDatabase>(CManager.EditWeapons), GOSLMA.EditWeapons)));
			GOSLMA.EditClothes = ((GOSLMA.EditClothes == null) ? new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(CManager.EditClothes) : ((Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, CharacterItem, PropItemData, Unit, int, LandfallContentDatabase>(CManager.EditClothes), GOSLMA.EditClothes)));
			GOSLMA.EditCombatMoves = ((GOSLMA.EditCombatMoves == null) ? new Action<GameObject, int, Unit, LandfallContentDatabase>(CManager.EditCombatMoves) : ((Action<GameObject, int, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, int, Unit, LandfallContentDatabase>(CManager.EditCombatMoves), GOSLMA.EditCombatMoves)));
			GOSLMA.CodeAfterSpawn = ((GOSLMA.CodeAfterSpawn == null) ? new Action<Unit, LandfallContentDatabase>(CManager.CodeAfterSpawn) : ((Action<Unit, LandfallContentDatabase>)Delegate.Combine(new Action<Unit, LandfallContentDatabase>(CManager.CodeAfterSpawn), GOSLMA.CodeAfterSpawn)));
			GOSLMA.EditProjectiles = ((GOSLMA.EditProjectiles == null) ? new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(CManager.EditProjectiles) : ((Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>)Delegate.Combine(new Action<GameObject, ProjectileHit, Unit, LandfallContentDatabase>(CManager.EditProjectiles), GOSLMA.EditProjectiles)));
			UnitBlueprint[] array = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
			for (int i = 0; i < array.Length; i++)
			{
				CManager.EditBlueprint(array[i], landfallContentDatabase);
			}
			Debug.Log((object)("Loaded " + CManager.modname + " Successfully"));
			Debug.Log((object)(CManager.modname + "is made in SFT by FhpSlime"));
			Debug.Log((object)(CManager.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 = allD

ChouChou's Units-part3.dll

Decompiled a week 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 DM;
using FhpSLib.BundleModCore;
using HarmonyLib;
using Landfall.TABS;
using Landfall.TABS.AI.Components.Modifiers;
using Landfall.TABS.AI.Components.Tags;
using Landfall.TABS.AI.Systems;
using SLMA;
using TFBGames;
using TMPro;
using Unity.Entities;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using rwdseerfd;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("Mod name")]
[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.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
public class Item : MonoBehaviour
{
	public enum kind
	{
		Weapon,
		Cloth,
		Skill,
		Unit,
		Projectile,
		Other
	}

	public string name;

	public kind Kind;
}
public class 隐藏项判定345t : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <解锁项目判定嘻嘻额23>d__12 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 隐藏项判定345t <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <解锁项目判定嘻嘻额23>d__12(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(3f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.解锁项目判定();
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private SecretUnlock secretUnlock23;

	public string finalUnlock = "BAjssdsssd";

	private ISaveLoaderService Save;

	public string unlockDescription = "元素召唤师";

	public Sprite unlockImage;

	private AudioSource LoopSource;

	public AudioClip hitClip;

	public string iceUnlock = "Aicedfgf";

	public string fifirelUnlock = "Bfireasfghd";

	public string flelelUnlock = "Cdaswdfef";

	public void Start()
	{
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		secretUnlock23 = ((Component)this).GetComponent<SecretUnlock>();
		secretUnlock23.unlockEvent.AddListener(new UnityAction(启动携程目标解释判断));
		unlockImage = UManager.元素法师3124;
		Save = ServiceLocator.GetService<ISaveLoaderService>();
	}

	private void 启动携程目标解释判断()
	{
		((MonoBehaviour)this).StartCoroutine(解锁项目判定嘻嘻额23());
	}

	[IteratorStateMachine(typeof(<解锁项目判定嘻嘻额23>d__12))]
	private IEnumerator 解锁项目判定嘻嘻额23()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <解锁项目判定嘻嘻额23>d__12(0)
		{
			<>4__this = this
		};
	}

	private void 解锁项目判定()
	{
		Debug.Log((object)"触发解锁判断前");
		if (Save.HasUnlockedSecret(iceUnlock) && Save.HasUnlockedSecret(fifirelUnlock) && Save.HasUnlockedSecret(flelelUnlock))
		{
			Debug.Log((object)"已触发解锁判断");
			UnlockSelf();
		}
	}

	public void UnlockSelf()
	{
		if (!Save.HasUnlockedSecret(finalUnlock))
		{
			Save.UnlockSecret(finalUnlock);
			ServiceLocator.GetService<ModalPanel>().OpenUnlockPanel(unlockDescription, unlockImage);
			PlacementUI val = Object.FindObjectOfType<PlacementUI>();
			if ((Object)(object)val != (Object)null)
			{
				val.RedrawUI(finalUnlock);
			}
			LoopSource.PlayOneShot(hitClip);
		}
	}
}
namespace rwdseerfd;

public static class asss兵编物体语言存储处
{
	public static string 蠕虫人上衣 = "warm_sahndd";

	public static string 蠕虫人裤子 = "warm_kuai";

	public static string 蠕虫人腿刺 = "warm_tuici";

	public static string 蠕虫人臂刺 = "warm_bici";

	public static string 蠕虫人护腿 = "warm_hutuui";

	public static string 蠕虫头 = "warm_hard";

	public static void 导入进游戏()
	{
		多国语言部分2r.语言添加(蠕虫人上衣, "蠕虫人上衣#Worm Man Upper#ワームマン上衣#Wurm-Mann-Oberteil#Haut du Homme-Ver#Верхняя часть Червечеловека#Parte Superior de Hombre Gusano#Corpetto Uomo Verme");
		多国语言部分2r.语言添加(蠕虫人裤子, "蠕虫人裤子#Worm Man Pants#ワームマンパンツ#Wurm-Mann-Hose#Pantalon du Homme-Ver#Штаны Червечеловека#Pantalones de Hombre Gusano#Pantaloni Uomo Verme");
		多国语言部分2r.语言添加(蠕虫人腿刺, "蠕虫人腿刺#Worm Man Leg Spikes#ワームマンレッグスパイク#Wurm-Mann-Beinspitzen#Épines de Jambe du Homme-Ver#Шипы на ногах Червечеловека#Púas de Pierna de Hombre Gusano#Spine delle Gambe Uomo Verme");
		多国语言部分2r.语言添加(蠕虫人臂刺, "蠕虫人臂刺#Worm Man Arm Spikes#ワームマンアームスパイク#Wurm-Mann-Armspitzen#Épines de Bras du Homme-Ver#Шипы на руках Червечеловека#Púas de Brazo de Hombre Gusano#Spine delle Braccia Uomo Verme");
		多国语言部分2r.语言添加(蠕虫人护腿, "蠕虫人护腿#Worm Man Leggings#ワームマンレギンス#Wurm-Mann-Gamaschen#Jambieres du Homme-Ver#Поножи Червечеловека#Leotardos de Hombre Gusano#Gambali Uomo Verme");
		多国语言部分2r.语言添加(蠕虫头, "蠕虫头#Worm Head#ワームヘッド#Wurmkopf#Tête de Ver#Голова Червя#Cabeza de Gusano#Testa di Verme");
	}
}
[HarmonyPatch(typeof(HealthHandler))]
internal class TakeDamgePatch
{
	[CompilerGenerated]
	private sealed class <DelayedDamageReflect>d__3 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public Unit originalTarget;

		public Unit damager;

		public float originalDamage;

		private float <reflectedDamage>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <DelayedDamageReflect>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = null;
				<>1__state = 1;
				return true;
			case 1:
			{
				<>1__state = -1;
				if ((Object)(object)damager == (Object)null || (Object)(object)damager.data == (Object)null || damager.data.Dead)
				{
					return false;
				}
				<reflectedDamage>5__1 = originalDamage * 0.5f;
				DataHandler data = damager.data;
				data.health -= <reflectedDamage>5__1;
				Debug.Log((object)$"反弹伤害: {<reflectedDamage>5__1}, 目标剩余血量: {damager.data.health}");
				if (damager.data.health <= 0f)
				{
					damager.data.healthHandler.Die(originalTarget);
				}
				if ((Object)(object)UManager.反伤反馈1 != (Object)null)
				{
					TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(UManager.反伤反馈1, ((Component)damager.data.mainRig).transform.position, Quaternion.identity), ((Component)originalTarget).gameObject);
				}
				return false;
			}
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private static readonly HashSet<int> processingUnits = new HashSet<int>();

	[HarmonyPatch("TakeDamage")]
	[HarmonyPrefix]
	public static bool TakeDamage_Prefix(HealthHandler __instance, Unit ___unit, float damage, Unit damager)
	{
		if ((Object)(object)___unit == (Object)null)
		{
			return true;
		}
		int instanceID = ((Object)___unit).GetInstanceID();
		if (processingUnits.Contains(instanceID))
		{
			Debug.LogWarning((object)("检测到递归调用,跳过补丁逻辑: " + ((Object)___unit).name));
			return true;
		}
		processingUnits.Add(instanceID);
		try
		{
			伤害补丁获取值 componentInChildren = ((Component)___unit).GetComponentInChildren<伤害补丁获取值>();
			护盾脚本 componentInChildren2 = ((Component)___unit).GetComponentInChildren<护盾脚本>();
			if ((Object)(object)componentInChildren2 != (Object)null && componentInChildren2.是否启用护盾 && componentInChildren2.护盾值 > 0f)
			{
				componentInChildren2.护盾值 -= damage * 0.5f;
				bool flag = componentInChildren2.护盾值 <= 0f;
				if (!flag)
				{
					Debug.Log((object)$"护盾吸收了伤害,剩余护盾值: {componentInChildren2.护盾值}");
				}
				return flag;
			}
			if ((Object)(object)componentInChildren != (Object)null && componentInChildren.是否启用)
			{
				return HandleDamagePatch(__instance, ___unit, damage, damager, componentInChildren);
			}
			return true;
		}
		finally
		{
			processingUnits.Remove(instanceID);
		}
	}

	private static bool HandleDamagePatch(HealthHandler __instance, Unit unit, float damage, Unit damager, 伤害补丁获取值 damagePatch)
	{
		if (unit.WasDamaged((Rigidbody)null, (Rigidbody)null))
		{
			return false;
		}
		unit.WasDamaged(damage);
		if ((Object)(object)damager != (Object)null)
		{
			damager.DealDamage(damage);
		}
		float num = damage * damagePatch.伤害补丁乘数;
		DataHandler data = unit.data;
		data.health -= num;
		if (unit.data.health <= 0f)
		{
			__instance.Die(damager);
			return false;
		}
		if ((Object)(object)damager != (Object)null && !damager.data.Dead && damagePatch.是否反弹)
		{
			((MonoBehaviour)__instance).StartCoroutine(DelayedDamageReflect(unit, damager, damage));
		}
		return false;
	}

	[IteratorStateMachine(typeof(<DelayedDamageReflect>d__3))]
	private static IEnumerator DelayedDamageReflect(Unit originalTarget, Unit damager, float originalDamage)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <DelayedDamageReflect>d__3(0)
		{
			originalTarget = originalTarget,
			damager = damager,
			originalDamage = originalDamage
		};
	}

	[HarmonyPatch("Die", new Type[] { typeof(Unit) })]
	[HarmonyPrefix]
	public static bool Die_Prefix(HealthHandler __instance, Unit damager, ref bool __result)
	{
		Traverse val = Traverse.Create((object)__instance).Field("unit");
		Traverse val2 = Traverse.Create((object)__instance).Field("data");
		if (!val.FieldExists() || !val2.FieldExists())
		{
			return true;
		}
		Unit value = val.GetValue<Unit>();
		DataHandler value2 = val2.GetValue<DataHandler>();
		if ((Object)(object)value == (Object)null || (Object)(object)value2 == (Object)null)
		{
			return true;
		}
		不死图腾效果123[] componentsInChildren = ((Component)((Component)value).transform.root).GetComponentsInChildren<不死图腾效果123>();
		List<不死图腾效果123> list = componentsInChildren.Where((不死图腾效果123 t) => (Object)(object)t != (Object)null && t.是否启用).ToList();
		if (list.Count == 0)
		{
			return true;
		}
		不死图腾效果123 不死图腾效果124 = list.FirstOrDefault((不死图腾效果123 t) => t.无限执行);
		if ((Object)(object)不死图腾效果124 != (Object)null)
		{
			ExecuteRevival(value2, 不死图腾效果124);
			__result = false;
			return false;
		}
		不死图腾效果123 不死图腾效果125 = list.FirstOrDefault((不死图腾效果123 t) => t.执行次数 > 0);
		if ((Object)(object)不死图腾效果125 != (Object)null)
		{
			ExecuteRevival(value2, 不死图腾效果125);
			不死图腾效果125.执行次数--;
			__result = false;
			return false;
		}
		return true;
	}

	private static void ExecuteRevival(DataHandler data, 不死图腾效果123 totem)
	{
		data.health = data.maxHealth * 0.25f;
		totem.开启回血携程 = true;
		totem.播放粒子及音效();
	}
}
public class 护盾叠加2 : MonoBehaviour
{
	private 护盾脚本[] sdf;

	public void Start()
	{
		sdf = ((Component)((Component)this).transform.root).GetComponentsInChildren<护盾脚本>();
		for (int i = 0; i < sdf.Length; i++)
		{
			sdf[i].护盾值 += 3000f;
		}
	}
}
public class 召唤脚本12121 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <延迟冰墙生成1212>d__8 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 召唤脚本12121 <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <延迟冰墙生成1212>d__8(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(2f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.冰墙生成1212(<>4__this.gameooo);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	public GameObject gameooo;

	public int 23 = 0;

	public GameObject ewsa3 = null;

	public void Start()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Expected O, but got Unknown
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		((Component)this).gameObject.GetComponent<DelayEvent>().delayedEvent.AddListener(new UnityAction(扎换阿萨));
	}

	private void 扎换阿萨()
	{
		//IL_00a3: 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_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 (23 == 0)
		{
			对象位置投射物生成133(gameooo, Random.Range(-300, 300), 90f, Random.Range(-300, 300));
		}
		if (23 == 1)
		{
			冲击波生成1112(gameooo);
		}
		if (23 == 2)
		{
			((MonoBehaviour)this).StartCoroutine(延迟冰墙生成1212());
		}
		if (23 == 3)
		{
			TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(gameooo, unit.data.targetData.mainRig.position, Quaternion.identity), ((Component)this).gameObject);
		}
		if (23 == 4)
		{
			TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(gameooo, ((Component)unit.data.targetData.unit).transform.position, Quaternion.identity), ((Component)this).gameObject);
		}
	}

	private void 对象位置投射物生成133(GameObject gameObject321, float x, float y, float z)
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_002b: 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_0035: 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_0046: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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_0051: 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)
		Unit val = unit.data.targetData.unit;
		Vector3 val2 = val.data.mainRig.position + new Vector3(x, y, z);
		Quaternion val3 = Quaternion.LookRotation(val.data.mainRig.position - val2);
		TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(gameObject321, val2, val3), ((Component)this).gameObject);
	}

	private void 冲击波生成1112(GameObject gameObject34545)
	{
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: 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_00c7: 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_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_0036: 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)
		if (unit.data.distanceToTarget <= 25f)
		{
			TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(ewsa3, unit.data.mainRig.position, Quaternion.identity), ((Component)this).gameObject);
			return;
		}
		Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position);
		GameObject val2 = Object.Instantiate<GameObject>(gameObject34545, unit.data.mainRig.position + ((Component)unit.data.mainRig).transform.forward * 2f, val);
		GameObject gameObject34546 = ((Component)val2.transform.Find("冲及波455")).gameObject;
		TeamHolder.AddTeamHolder(val2, ((Component)this).gameObject);
	}

	[IteratorStateMachine(typeof(<延迟冰墙生成1212>d__8))]
	private IEnumerator 延迟冰墙生成1212()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <延迟冰墙生成1212>d__8(0)
		{
			<>4__this = this
		};
	}

	private void 冰墙生成1212(GameObject gameObject321)
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_004f: 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_005e: 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)
		//IL_006d: 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_0087: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		float distanceToTarget = unit.data.distanceToTarget;
		int num = (int)distanceToTarget;
		float 密度间隔 = 4f;
		Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position);
		Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles;
		Quaternion val2 = Quaternion.Euler(0f, eulerAngles.y, 0f);
		GameObject val3 = Object.Instantiate<GameObject>(gameObject321, 获取地面位置34511(), val2);
		TeamHolder.AddTeamHolder(val3, ((Component)this).gameObject);
		val3.GetComponentInChildren<冰墙召唤13222>().数量 = num / 4;
		val3.GetComponentInChildren<冰墙召唤13222>().密度间隔 = 密度间隔;
		val3.GetComponentInChildren<冰墙召唤13222>().召唤时间间隔 = 0.1f;
	}

	private Vector3 获取地面位置34511(float 检测高度 = 30f)
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0018: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: 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_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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_0105: 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_010e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = unit.data.mainRig.position;
		Vector3 val = position + Vector3.up * 检测高度;
		float num = 检测高度 * 3f;
		RaycastHit[] array = Physics.RaycastAll(val, Vector3.down, num);
		Array.Sort(array, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
		RaycastHit[] array2 = array;
		for (int i = 0; i < array2.Length; i++)
		{
			RaycastHit val2 = array2[i];
			GameObject gameObject = ((Component)((RaycastHit)(ref val2)).collider).gameObject;
			GameObject gameObject2 = ((Component)gameObject.transform.root).gameObject;
			if (!((Object)(object)gameObject2.GetComponentInChildren<Rigidbody>() != (Object)null) && !((Object)(object)gameObject2.GetComponentInChildren<Unit>() != (Object)null) && !((Object)(object)gameObject.GetComponent<SurfaceBlock>() != (Object)null) && !((Object)(object)gameObject.GetComponent<FollowTransform>() != (Object)null))
			{
				return ((RaycastHit)(ref val2)).point;
			}
		}
		return ((Component)this).transform.position;
	}
}
public class SimpleBlackHole : MonoBehaviour
{
	[Header("引力设置")]
	public float attractionForce = 50f;

	public float attractionRange = 160f;

	[Header("队伍设置")]
	public Team myTeam = (Team)0;

	[Header("物理设置")]
	public ForceMode forceMode = (ForceMode)5;

	private List<Rigidbody> affectedRigidbodies = new List<Rigidbody>();

	private float checkInterval = 3f;

	private float lastCheckTime;

	private TeamHolder myTeamHolder;

	private void Start()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		myTeamHolder = ((Component)((Component)this).transform.root).gameObject.GetComponentInChildren<TeamHolder>();
		if ((Object)(object)myTeamHolder != (Object)null)
		{
			myTeam = myTeamHolder.team;
			return;
		}
		myTeamHolder = ((Component)this).gameObject.AddComponent<TeamHolder>();
		myTeamHolder.team = myTeam;
	}

	private void Update()
	{
		if (Time.time - lastCheckTime > checkInterval)
		{
			FindRigidbodiesInRange();
			lastCheckTime = Time.time;
		}
		ApplyAttraction();
	}

	private void FindRigidbodiesInRange()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		affectedRigidbodies.Clear();
		Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, attractionRange);
		Collider[] array2 = array;
		foreach (Collider val in array2)
		{
			Rigidbody attachedRigidbody = val.attachedRigidbody;
			if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)this).GetComponent<Rigidbody>() && IsEnemy(attachedRigidbody))
			{
				affectedRigidbodies.Add(attachedRigidbody);
			}
		}
	}

	private bool IsEnemy(Rigidbody rb)
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: 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_0087: Unknown result type (might be due to invalid IL or missing references)
		if (affectedRigidbodies.Contains(rb))
		{
			return false;
		}
		TeamHolder componentInChildren = ((Component)((Component)rb).transform.root).GetComponentInChildren<TeamHolder>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			return componentInChildren.team != myTeam;
		}
		Unit componentInChildren2 = ((Component)((Component)rb).transform.root).GetComponentInChildren<Unit>();
		if ((Object)(object)componentInChildren2 != (Object)null && (Object)(object)componentInChildren2.data != (Object)null)
		{
			return componentInChildren2.data.team != myTeam;
		}
		return true;
	}

	private void ApplyAttraction()
	{
		//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)
		//IL_0034: 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_003b: 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_0044: 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)
		//IL_004a: 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_0075: Unknown result type (might be due to invalid IL or missing references)
		//IL_0078: 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)
		Vector3 position = ((Component)this).transform.position;
		foreach (Rigidbody affectedRigidbody in affectedRigidbodies)
		{
			if (!((Object)(object)affectedRigidbody == (Object)null))
			{
				Vector3 val = position - affectedRigidbody.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				float num = Vector3.Distance(position, affectedRigidbody.position);
				float num2 = 2f - num / attractionRange;
				float num3 = attractionForce * num2;
				affectedRigidbody.AddForce(normalized * num3, forceMode);
			}
		}
	}
}
public class 熔炉精灵召唤脚本234 : MonoBehaviour
{
	private Unit unit;

	private bool 判断1 = true;

	private float 计时器 = 0f;

	public UnitBlueprint 召唤物123;

	public void Start()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0042: Expected O, but got Unknown
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		((Component)this).gameObject.GetComponent<DelayEvent>().delayedEvent.AddListener(new UnityAction(生成事件32));
	}

	public Vector3 获取地面位置(float 检测高度 = 30f)
	{
		//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)
		//IL_000d: 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)
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0027: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: 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_00fb: 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_0104: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((Component)this).transform.position;
		Vector3 val = position + Vector3.up * 检测高度;
		float num = 检测高度 * 3f;
		RaycastHit[] array = Physics.RaycastAll(val, Vector3.down, num);
		Array.Sort(array, (RaycastHit a, RaycastHit b) => ((RaycastHit)(ref a)).distance.CompareTo(((RaycastHit)(ref b)).distance));
		RaycastHit[] array2 = array;
		for (int i = 0; i < array2.Length; i++)
		{
			RaycastHit val2 = array2[i];
			GameObject gameObject = ((Component)((RaycastHit)(ref val2)).collider).gameObject;
			GameObject gameObject2 = ((Component)gameObject.transform.root).gameObject;
			if (!((Object)(object)gameObject2.GetComponentInChildren<Rigidbody>() != (Object)null) && !((Object)(object)gameObject2.GetComponentInChildren<Unit>() != (Object)null) && !((Object)(object)gameObject.GetComponent<SurfaceBlock>() != (Object)null) && !((Object)(object)gameObject.GetComponent<FollowTransform>() != (Object)null))
			{
				return ((RaycastHit)(ref val2)).point;
			}
		}
		return ((Component)this).transform.position;
	}

	private void 召唤开始23(Vector3 补偿位置)
	{
		//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_0087: 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_009d: 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)
		//IL_0044: 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_004a: 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)
		if ((Object)(object)unit.data.targetData?.unit == (Object)null)
		{
			Debug.LogWarning((object)"目标单位不存在,使用默认朝向");
			召唤物123.Spawn(获取地面位置() + 补偿位置, Quaternion.identity, unit.data.team, 1f, (UnitPoolInfo?)null);
		}
		else
		{
			召唤物123.Spawn(获取地面位置() + 补偿位置, 获取面向目标y轴旋转(), unit.data.team, 1f, (UnitPoolInfo?)null);
		}
	}

	private Quaternion 获取面向目标y轴旋转()
	{
		//IL_0020: Unknown result type (might be due to invalid IL or missing references)
		//IL_0035: 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)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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_0052: Unknown result type (might be due to invalid IL or missing references)
		//IL_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0062: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		Quaternion val = Quaternion.LookRotation(unit.data.targetData.unit.data.mainRig.position - unit.data.mainRig.position);
		Vector3 eulerAngles = ((Quaternion)(ref val)).eulerAngles;
		return Quaternion.Euler(0f, eulerAngles.y, 0f);
	}

	private void 生成事件32()
	{
		//IL_0001: Unknown result type (might be due to invalid IL or missing references)
		//IL_0007: Expected O, but got Unknown
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		GameObject val = new GameObject();
		val.transform.position = ((Component)unit.data.mainRig).transform.position;
		val.transform.rotation = 获取面向目标y轴旋转();
		try
		{
			召唤开始23(val.transform.right * 10f);
			召唤开始23(val.transform.right * -10f);
		}
		finally
		{
			Object.Destroy((Object)(object)val);
		}
	}
}
public class 隐身技能脚本 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <隐身saassad>d__13 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public float invisibilityDuration;

		public 隐身技能脚本 <>4__this;

		private SkinnedMeshRenderer[] <>s__1;

		private int <>s__2;

		private SkinnedMeshRenderer <renderer>5__3;

		private MeshRenderer[] <>s__4;

		private int <>s__5;

		private MeshRenderer <gh>5__6;

		private MeshRenderer[] <>s__7;

		private int <>s__8;

		private MeshRenderer <gh>5__9;

		private SkinnedMeshRenderer[] <>s__10;

		private int <>s__11;

		private SkinnedMeshRenderer <renderer>5__12;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <隐身saassad>d__13(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>s__1 = null;
			<renderer>5__3 = null;
			<>s__4 = null;
			<gh>5__6 = null;
			<>s__7 = null;
			<gh>5__9 = null;
			<>s__10 = null;
			<renderer>5__12 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>s__1 = <>4__this.全部渲染器;
				for (<>s__2 = 0; <>s__2 < <>s__1.Length; <>s__2++)
				{
					<renderer>5__3 = <>s__1[<>s__2];
					((Renderer)<renderer>5__3).enabled = false;
					<renderer>5__3 = null;
				}
				<>s__1 = null;
				<>s__4 = <>4__this.全部表面渲染器;
				for (<>s__5 = 0; <>s__5 < <>s__4.Length; <>s__5++)
				{
					<gh>5__6 = <>s__4[<>s__5];
					((Renderer)<gh>5__6).enabled = false;
					<gh>5__6 = null;
				}
				<>s__4 = null;
				<>4__this.unit.targetingPriorityMultiplier = float.NaN;
				<>4__this.是否开启 = true;
				<>2__current = (object)new WaitForSeconds(invisibilityDuration);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>s__7 = <>4__this.全部表面渲染器;
				for (<>s__8 = 0; <>s__8 < <>s__7.Length; <>s__8++)
				{
					<gh>5__9 = <>s__7[<>s__8];
					((Renderer)<gh>5__9).enabled = true;
					<gh>5__9 = null;
				}
				<>s__7 = null;
				<>s__10 = <>4__this.全部渲染器;
				for (<>s__11 = 0; <>s__11 < <>s__10.Length; <>s__11++)
				{
					<renderer>5__12 = <>s__10[<>s__11];
					((Renderer)<renderer>5__12).enabled = true;
					<renderer>5__12 = null;
				}
				<>s__10 = null;
				<>4__this.unit.targetingPriorityMultiplier = <>4__this.兵种开局优先级;
				<>4__this.是否开启 = false;
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	private bool 判断1 = true;

	private float 计时器 = 0f;

	private float cd1 = 8f;

	private SkinnedMeshRenderer[] 全部渲染器;

	private MeshRenderer[] 全部表面渲染器;

	private float 兵种开局优先级;

	public bool 是否开启 = false;

	private 护盾脚本 兵种护盾;

	public GameObject[] jibnen;

	private void Start()
	{
		//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b3: Expected O, but got Unknown
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		兵种护盾 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<护盾脚本>();
		全部渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
		全部表面渲染器 = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren<MeshRenderer>();
		兵种开局优先级 = unit.targetingPriorityMultiplier;
		((Component)this).gameObject.GetComponent<DelayEvent>().delayedEvent.AddListener(new UnityAction(开始隐身));
	}

	public void 开始隐身()
	{
		计时器 = 0f;
		技能生成(jibnen);
		((MonoBehaviour)this).StartCoroutine(隐身saassad());
	}

	public void 技能生成(GameObject[] move23)
	{
		//IL_002e: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		if (move23 == null)
		{
			return;
		}
		for (int i = 0; i < move23.Length; i++)
		{
			if (!((Object)(object)move23[i] == (Object)null))
			{
				GameObject val = Object.Instantiate<GameObject>(move23[i], ((Component)unit).transform.position, ((Component)unit).transform.rotation, ((Component)unit).transform);
				TeamHolder.AddTeamHolder(move23[i], ((Component)this).gameObject);
			}
		}
	}

	[IteratorStateMachine(typeof(<隐身saassad>d__13))]
	private IEnumerator 隐身saassad(float invisibilityDuration = 8f)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <隐身saassad>d__13(0)
		{
			<>4__this = this,
			invisibilityDuration = invisibilityDuration
		};
	}

	private void 兵种回血回盾(float 回血量 = 50f)
	{
		if (unit.data.health < unit.data.maxHealth)
		{
			DataHandler data = unit.data;
			data.health += 回血量;
		}
		else if (兵种护盾.护盾值 < 4000f)
		{
			兵种护盾.护盾值 += 回血量;
		}
		else
		{
			DataHandler data2 = unit.data;
			data2.maxHealth += 回血量;
			unit.data.health = unit.data.maxHealth;
		}
	}

	private void Update()
	{
		if (是否开启)
		{
			计时器 += Time.deltaTime;
			if ((double)计时器 > 0.1)
			{
				兵种回血回盾();
				计时器 = 0f;
			}
		}
	}
}
public class 龙卷风效果1322 : MonoBehaviour
{
	[Header("龙卷风参数")]
	public float pullForce = 40000f;

	public float upwardForce = 1500f;

	public float rotationForce = 20500f;

	public float 扰动力倍数 = 60f;

	public float maxRadius = 150f;

	public LayerMask affectedLayers = LayerMask.op_Implicit(-1);

	[Header("性能设置")]
	public float checkInterval = 0.3f;

	public ForceMode forceMode = (ForceMode)5;

	private TeamHolder 物体队伍342;

	private List<Rigidbody> affectedRigidbodies = new List<Rigidbody>();

	private float lastCheckTime;

	private Team myTeam;

	private void Start()
	{
		//IL_0050: 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_0061: Unknown result type (might be due to invalid IL or missing references)
		//IL_002f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0034: Unknown result type (might be due to invalid IL or missing references)
		物体队伍342 = ((Component)((Component)this).transform.root).GetComponentInChildren<TeamHolder>();
		if ((Object)(object)物体队伍342 != (Object)null)
		{
			myTeam = 物体队伍342.team;
			return;
		}
		物体队伍342 = ((Component)this).gameObject.AddComponent<TeamHolder>();
		myTeam = (Team)0;
		物体队伍342.team = myTeam;
	}

	private void Update()
	{
		if (Time.time - lastCheckTime > checkInterval)
		{
			FindRigidbodiesInRange();
			lastCheckTime = Time.time;
		}
		ApplyTornadoForces();
	}

	private void FindRigidbodiesInRange()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		affectedRigidbodies.Clear();
		Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, maxRadius, LayerMask.op_Implicit(affectedLayers));
		Collider[] array2 = array;
		foreach (Collider val in array2)
		{
			Rigidbody attachedRigidbody = val.attachedRigidbody;
			if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)this).GetComponent<Rigidbody>() && IsEnemy(attachedRigidbody) && !affectedRigidbodies.Contains(attachedRigidbody))
			{
				affectedRigidbodies.Add(attachedRigidbody);
			}
		}
	}

	private bool IsEnemy(Rigidbody rb)
	{
		//IL_0024: 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_0058: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		Unit componentInChildren = ((Component)((Component)rb).transform.root).GetComponentInChildren<Unit>();
		if ((Object)(object)componentInChildren != (Object)null)
		{
			return componentInChildren.data.team != myTeam;
		}
		TeamHolder componentInChildren2 = ((Component)((Component)rb).transform.root).GetComponentInChildren<TeamHolder>();
		if ((Object)(object)componentInChildren2 != (Object)null)
		{
			return componentInChildren2.team != myTeam;
		}
		return true;
	}

	private void ApplyTornadoForces()
	{
		//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)
		//IL_003a: 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)
		//IL_0041: 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_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0091: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: 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_00a4: 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_00ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c4: 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_00d2: 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_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e0: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_0107: 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)
		//IL_0116: Unknown result type (might be due to invalid IL or missing references)
		//IL_011d: 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_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0193: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: 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_0185: Unknown result type (might be due to invalid IL or missing references)
		//IL_018a: Unknown result type (might be due to invalid IL or missing references)
		//IL_018f: Unknown result type (might be due to invalid IL or missing references)
		Vector3 position = ((Component)this).transform.position;
		foreach (Rigidbody affectedRigidbody in affectedRigidbodies)
		{
			if ((Object)(object)affectedRigidbody == (Object)null)
			{
				continue;
			}
			Vector3 val = position - affectedRigidbody.position;
			float magnitude = ((Vector3)(ref val)).magnitude;
			if (magnitude < maxRadius && magnitude > 0.1f)
			{
				float num = 1f - magnitude / maxRadius;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2 = Vector3.Cross(((Vector3)(ref val)).normalized, Vector3.up);
				Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
				Vector3 zero = Vector3.zero;
				float num2 = Time.deltaTime * Time.timeScale;
				zero += normalized * pullForce * num * num2;
				zero += Vector3.up * upwardForce * num * num2;
				zero += normalized2 * rotationForce * num * num2;
				if (扰动力倍数 > 0f)
				{
					zero += new Vector3(Random.Range(-1f, 1f), Random.Range(0f, 1f), Random.Range(-1f, 1f)) * num * 扰动力倍数 * num2;
				}
				affectedRigidbody.AddForce(zero, (ForceMode)5);
			}
		}
	}

	private void FixedUpdate()
	{
		for (int num = affectedRigidbodies.Count - 1; num >= 0; num--)
		{
			if ((Object)(object)affectedRigidbodies[num] == (Object)null)
			{
				affectedRigidbodies.RemoveAt(num);
			}
		}
	}

	private void OnDrawGizmosSelected()
	{
		//IL_0001: 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)
		Gizmos.color = Color.red;
		Gizmos.DrawWireSphere(((Component)this).transform.position, maxRadius);
	}
}
public class 混乱i触底检测 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <运动学关闭开启>d__4 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public float delay;

		public 混乱i触底检测 <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <运动学关闭开启>d__4(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>4__this.SetAllKinematic(isKinematic: true);
				<>2__current = (object)new WaitForSeconds(delay);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.SetAllKinematic(isKinematic: false);
				Debug.Log((object)"运动学已关闭");
				Debug.Log((object)"开始删除技能");
				Object.Destroy((Object)(object)((Component)<>4__this).gameObject, 1f);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	private float 计时器;

	private Rigidbody[] childRigidbodies;

	private void Start()
	{
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		childRigidbodies = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentsInChildren<Rigidbody>();
		((MonoBehaviour)this).StartCoroutine(运动学关闭开启(10f));
	}

	[IteratorStateMachine(typeof(<运动学关闭开启>d__4))]
	private IEnumerator 运动学关闭开启(float delay)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <运动学关闭开启>d__4(0)
		{
			<>4__this = this,
			delay = delay
		};
	}

	private void SetAllKinematic(bool isKinematic)
	{
		Rigidbody[] array = childRigidbodies;
		foreach (Rigidbody val in array)
		{
			if ((Object)(object)val != (Object)null)
			{
				val.isKinematic = isKinematic;
			}
		}
	}

	private void Update()
	{
		//IL_004f: 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)
		计时器 += Time.deltaTime;
		if ((double)计时器 > 0.1)
		{
			unit.data.TouchGround(((Component)unit.data.targetData.unit).transform.position, ((Component)unit.data.targetData.unit).transform.position, (Rigidbody)null);
			计时器 = 0f;
		}
	}
}
public class 护盾开启关闭音效控制 : MonoBehaviour
{
	public float rotationSpeed = 30f;

	private 护盾脚本 护盾脚本12;

	private float 当前护盾值;

	private float 上一帧护盾值;

	private PlaySoundEffect 关闭音效;

	private PlaySoundEffect 开启音效;

	private bool 护盾已开启 = false;

	private void Start()
	{
		护盾脚本12 = ((Component)((Component)this).transform.root).gameObject.GetComponentInChildren<护盾脚本>();
		当前护盾值 = 护盾脚本12.护盾值;
		上一帧护盾值 = 当前护盾值;
		关闭音效 = ((Component)((Component)this).transform.Find("guanbui")).gameObject.GetComponent<PlaySoundEffect>();
		开启音效 = ((Component)((Component)this).transform.Find("kaiqi")).gameObject.GetComponent<PlaySoundEffect>();
		if (当前护盾值 > 0f && !护盾已开启)
		{
			开启音效.Go();
			护盾已开启 = true;
		}
		else if (当前护盾值 <= 0f && 护盾已开启)
		{
			关闭音效.Go();
			护盾已开启 = false;
		}
	}

	private void Update()
	{
		当前护盾值 = 护盾脚本12.护盾值;
		if (上一帧护盾值 > 0f && 当前护盾值 <= 0f && 护盾已开启)
		{
			关闭音效.Go();
			护盾已开启 = false;
		}
		else if (上一帧护盾值 <= 0f && 当前护盾值 > 0f && !护盾已开启)
		{
			开启音效.Go();
			护盾已开启 = true;
		}
		上一帧护盾值 = 当前护盾值;
	}
}
public class 实例化子物体 : MonoBehaviour
{
	[Header("子物体设置")]
	public GameObject childPrefab;

	private void Start()
	{
		//IL_0036: Unknown result type (might be due to invalid IL or missing references)
		//IL_0047: 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)
		if ((Object)(object)childPrefab != (Object)null)
		{
			GameObject val = Object.Instantiate<GameObject>(childPrefab);
			val.transform.SetParent(((Component)this).transform);
			val.transform.localPosition = Vector3.zero;
			val.transform.localRotation = Quaternion.identity;
			val.transform.localScale = Vector3.one;
		}
		else
		{
			Debug.LogWarning((object)"未指定要实例化的预制体!", (Object)(object)this);
		}
	}
}
public class 粒子系统队伍色渲染 : MonoBehaviour
{
	private Unit unit;

	public ParticleSystem targetParticleSystem;

	public Material 红队伍色 = UManager.asset1.LoadAsset<Material>("发光红234");

	public Material 蓝队伍色 = UManager.asset1.LoadAsset<Material>("发光蓝234");

	private void Start()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Invalid comparison between Unknown and I4
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		targetParticleSystem = ((Component)this).GetComponent<ParticleSystem>();
		if ((int)unit.data.team == 0)
		{
			修改渲染材质(红队伍色);
		}
		else
		{
			修改渲染材质(蓝队伍色);
		}
	}

	public void 修改渲染材质(Material newMaterial)
	{
		if ((Object)(object)targetParticleSystem == (Object)null)
		{
			Debug.LogWarning((object)"目标粒子系统未分配!");
			return;
		}
		ParticleSystemRenderer component = ((Component)targetParticleSystem).GetComponent<ParticleSystemRenderer>();
		if ((Object)(object)component == (Object)null)
		{
			Debug.LogWarning((object)"粒子系统没有渲染器组件!");
			return;
		}
		((Renderer)component).material = newMaterial;
		Debug.Log((object)("渲染材质已更改为: " + (((Object)(object)newMaterial != (Object)null) ? ((Object)newMaterial).name : "空")));
	}
}
public class 红蓝队伍粒子色 : MonoBehaviour
{
	private Unit unit;

	public ParticleSystem targetParticleSystem;

	public Material 红队伍色 = UManager.asset1.LoadAsset<Material>("发光红234");

	public Material 蓝队伍色 = UManager.asset1.LoadAsset<Material>("发光蓝234");

	public void Start()
	{
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Invalid comparison between Unknown and I4
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		targetParticleSystem = ((Component)this).GetComponent<ParticleSystem>();
		if ((int)unit.data.team == 0)
		{
			ChangeTrailMaterial(红队伍色);
		}
		else
		{
			ChangeTrailMaterial(蓝队伍色);
		}
	}

	public void ChangeTrailMaterial(Material newMaterial)
	{
		if ((Object)(object)targetParticleSystem == (Object)null)
		{
			Debug.LogWarning((object)"目标粒子系统未分配!");
			return;
		}
		ParticleSystemRenderer component = ((Component)targetParticleSystem).GetComponent<ParticleSystemRenderer>();
		if ((Object)(object)component == (Object)null)
		{
			Debug.LogWarning((object)"粒子系统没有渲染器组件!");
			return;
		}
		component.trailMaterial = newMaterial;
		Debug.Log((object)("拖尾材质已更改为: " + (((Object)(object)newMaterial != (Object)null) ? ((Object)newMaterial).name : "空")));
	}
}
public class 闪避留下残影342 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <激活残影2>d__7 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 闪避留下残影342 <>4__this;

		private GameObject <爆炸物体>5__1;

		private int <i>5__2;

		private SkinnedMeshRenderer <蒙皮渲染器>5__3;

		private GameObject <残影1>5__4;

		private MeshRenderer <残影网格渲染>5__5;

		private MeshFilter <残影网格>5__6;

		private Mesh <mesh1>5__7;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <激活残影2>d__7(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<爆炸物体>5__1 = null;
			<蒙皮渲染器>5__3 = null;
			<残影1>5__4 = null;
			<残影网格渲染>5__5 = null;
			<残影网格>5__6 = null;
			<mesh1>5__7 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Expected O, but got Unknown
			//IL_00a2: 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_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Expected O, but got Unknown
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Invalid comparison between Unknown and I4
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				if (<>4__this.所有蒙皮网格 == null)
				{
					<>4__this.所有蒙皮网格 = ((Component)((Component)<>4__this).transform.root).gameObject.GetComponentsInChildren<SkinnedMeshRenderer>();
				}
				<i>5__2 = 0;
				while (<i>5__2 < <>4__this.所有蒙皮网格.Length)
				{
					<蒙皮渲染器>5__3 = <>4__this.所有蒙皮网格[<i>5__2];
					<残影1>5__4 = new GameObject();
					<残影1>5__4.transform.position = ((Component)<蒙皮渲染器>5__3).transform.position;
					<残影1>5__4.transform.rotation = ((Component)<蒙皮渲染器>5__3).transform.rotation;
					<残影1>5__4.AddComponent<抖动后删除>();
					<残影网格渲染>5__5 = <残影1>5__4.AddComponent<MeshRenderer>();
					<残影网格>5__6 = <残影1>5__4.AddComponent<MeshFilter>();
					<mesh1>5__7 = new Mesh();
					<>4__this.所有蒙皮网格[<i>5__2].BakeMesh(<mesh1>5__7);
					<残影网格>5__6.mesh = <mesh1>5__7;
					if ((int)<>4__this.unit.data.team == 0)
					{
						((Renderer)<残影网格渲染>5__5).material = <>4__this.红色发光材质12;
					}
					else
					{
						((Renderer)<残影网格渲染>5__5).material = <>4__this.蓝色发光材质12;
					}
					<蒙皮渲染器>5__3 = null;
					<残影1>5__4 = null;
					<残影网格渲染>5__5 = null;
					<残影网格>5__6 = null;
					<mesh1>5__7 = null;
					<i>5__2++;
				}
				<爆炸物体>5__1 = Object.Instantiate<GameObject>(<>4__this.辅助爆破, <>4__this.unit.data.mainRig.position, Quaternion.identity);
				TeamHolder.AddTeamHolder(<爆炸物体>5__1, ((Component)<>4__this).gameObject);
				<爆炸物体>5__1.AddComponent<n秒后移除物体并生成爆炸>();
				<>2__current = (object)new WaitForSeconds(1.5f);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	private SkinnedMeshRenderer[] 所有蒙皮网格;

	public Material 蓝色发光材质12 = UManager.蓝色发光材质;

	public Material 红色发光材质12 = UManager.红色发光材质;

	public GameObject 辅助爆破 = UManager.asset1.LoadAsset<GameObject>("残影辅助爆炸无234");

	private void Start()
	{
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_003d: Expected O, but got Unknown
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		((Component)this).GetComponent<DelayEvent>().delayedEvent.AddListener(new UnityAction(启用携程工具));
		if ((Object)(object)蓝色发光材质12 == (Object)null)
		{
			Debug.LogWarning((object)"未找到材质!");
		}
	}

	public void 启用携程工具()
	{
		((MonoBehaviour)this).StartCoroutine(激活残影2());
	}

	[IteratorStateMachine(typeof(<激活残影2>d__7))]
	private IEnumerator 激活残影2()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <激活残影2>d__7(0)
		{
			<>4__this = this
		};
	}
}
public class n秒后移除物体并生成爆炸 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <开始删除生成>d__3 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public n秒后移除物体并生成爆炸 <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <开始删除生成>d__3(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//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)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(<>4__this.cd);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(<>4__this.exp1, ((Component)<>4__this).gameObject.transform.position, Quaternion.identity), ((Component)<>4__this).gameObject);
				Object.Destroy((Object)(object)((Component)<>4__this).gameObject);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public GameObject exp1 = UManager.asset1.LoadAsset<GameObject>("残影爆炸324");

	public float cd = 1.3f;

	public void Start()
	{
		((MonoBehaviour)this).StartCoroutine(开始删除生成());
	}

	[IteratorStateMachine(typeof(<开始删除生成>d__3))]
	private IEnumerator 开始删除生成()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <开始删除生成>d__3(0)
		{
			<>4__this = this
		};
	}
}
public class 抖动后删除 : MonoBehaviour
{
	[Header("抖动设置")]
	public float shakeDuration = 1.3f;

	public float maxShakeIntensity = 0.1f;

	private Vector3 originalPosition;

	private float shakeTimer = 0f;

	private bool isShaking = false;

	private void Start()
	{
		//IL_0008: 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)
		originalPosition = ((Component)this).transform.position;
		StartShaking();
	}

	private void Update()
	{
		if (isShaking)
		{
			ShakeEffect();
		}
	}

	public void StartShaking()
	{
		//IL_0008: 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)
		originalPosition = ((Component)this).transform.position;
		shakeTimer = 0f;
		isShaking = true;
	}

	private void ShakeEffect()
	{
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: 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)
		if (shakeTimer < shakeDuration)
		{
			shakeTimer += Time.deltaTime;
			float num = shakeTimer / shakeDuration;
			float num2 = Mathf.Lerp(0f, maxShakeIntensity, num);
			float num3 = Random.Range(0f - num2, num2);
			float num4 = Random.Range(0f - num2, num2);
			float num5 = Random.Range(0f - num2, num2);
			((Component)this).transform.position = originalPosition + new Vector3(num3, num4, num5);
		}
		else
		{
			((Component)this).transform.position = originalPosition;
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	public void StopAndDestroy()
	{
		//IL_000f: Unknown result type (might be due to invalid IL or missing references)
		isShaking = false;
		((Component)this).transform.position = originalPosition;
		Object.Destroy((Object)(object)((Component)this).gameObject);
	}
}
public class 火焰免疫 : MonoBehaviour
{
	private Unit unit;

	public void Start()
	{
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
	}

	public void Update()
	{
		if (Object.op_Implicit((Object)(object)((Component)unit).GetComponentInChildren<DamageOverTimeEffect>()))
		{
			DataHandler data = unit.data;
			data.health += 200f;
			Object.Destroy((Object)(object)((Component)((Component)unit).GetComponentInChildren<DamageOverTimeEffect>()).gameObject);
		}
	}
}
public class 转换2343 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <kiazhaidsfj>d__15 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 转换2343 <>4__this;

		private UnitBlueprint <unitBlueprint>5__1;

		private GameObject <gameObject1>5__2;

		private Rigidbody[] <allRigs>5__3;

		private Rigidbody[] <allRigs2>5__4;

		private int <num>5__5;

		private int <m>5__6;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <kiazhaidsfj>d__15(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<unitBlueprint>5__1 = null;
			<gameObject1>5__2 = null;
			<allRigs>5__3 = null;
			<allRigs2>5__4 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_010d: 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_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			<unitBlueprint>5__1 = Object.Instantiate<UnitBlueprint>(<>4__this.unit.unitBlueprint);
			<unitBlueprint>5__1.Mount = null;
			s.SetField<UnitBlueprint>(<unitBlueprint>5__1, "Riders", (object)new UnitBlueprint[0]);
			<unitBlueprint>5__1.TargetingComponent = (ITargetingComponent)(object)default(EnemyLeastWeightTargeting);
			<unitBlueprint>5__1.UnitBase = <>4__this.unitbase;
			<unitBlueprint>5__1.RightWeapon = null;
			<unitBlueprint>5__1.LeftWeapon = null;
			UnitBlueprint obj = <unitBlueprint>5__1;
			obj.movementSpeedMuiltiplier *= 1.7f;
			<unitBlueprint>5__1.objectsToSpawnAsChildren = (GameObject[])(object)new GameObject[2]
			{
				UManager.公用蠕虫咬2,
				(GameObject)SLMALoader.SDic["moves"]["Vampire_Jump"]
			};
			<gameObject1>5__2 = <unitBlueprint>5__1.Spawn(<>4__this.unit.data.mainRig.position + Vector3.up * 1000f, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0];
			<allRigs>5__3 = <>4__this.unit.data.allRigs.AllRigs;
			<allRigs2>5__4 = <gameObject1>5__2.GetComponent<Unit>().data.allRigs.AllRigs;
			((Component)<>4__this.unit).GetComponentsInChildren<Rigidbody>();
			<gameObject1>5__2.transform.localScale = ((Component)<>4__this.unit).transform.localScale;
			for (<m>5__6 = 0; <m>5__6 < <allRigs2>5__4.Length; <m>5__6 = <num>5__5 + 1)
			{
				((Component)<allRigs2>5__4[<m>5__6]).transform.localScale = ((Component)<allRigs>5__3[<m>5__6]).transform.localScale;
				((Component)<allRigs2>5__4[<m>5__6]).transform.position = ((Component)<allRigs>5__3[<m>5__6]).transform.position;
				((Component)<allRigs2>5__4[<m>5__6]).transform.rotation = ((Component)<allRigs>5__3[<m>5__6]).transform.rotation;
				<allRigs2>5__4[<m>5__6].velocity = <allRigs>5__3[<m>5__6].velocity;
				<num>5__5 = <m>5__6;
			}
			Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <召唤蠕虫巨人>d__18 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 转换2343 <>4__this;

		private GameObject <gameObject1>5__1;

		private Rigidbody[] <allRigs>5__2;

		private Rigidbody[] <allRigs2>5__3;

		private int <num>5__4;

		private int <m>5__5;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <召唤蠕虫巨人>d__18(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<gameObject1>5__1 = null;
			<allRigs>5__2 = null;
			<allRigs2>5__3 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: 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_0149: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			<gameObject1>5__1 = <>4__this.蠕虫巨人.Spawn(<>4__this.unit.data.mainRig.position + Vector3.up * 1000f, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0];
			<allRigs>5__2 = <>4__this.unit.data.allRigs.AllRigs;
			<allRigs2>5__3 = <gameObject1>5__1.GetComponent<Unit>().data.allRigs.AllRigs;
			((Component)<>4__this.unit).GetComponentsInChildren<Rigidbody>();
			<gameObject1>5__1.transform.localScale = ((Component)<>4__this.unit).transform.localScale;
			for (<m>5__5 = 0; <m>5__5 < <allRigs2>5__3.Length; <m>5__5 = <num>5__4 + 1)
			{
				((Component)<allRigs2>5__3[<m>5__5]).transform.localScale = ((Component)<allRigs>5__2[<m>5__5]).transform.localScale;
				((Component)<allRigs2>5__3[<m>5__5]).transform.position = ((Component)<allRigs>5__2[<m>5__5]).transform.position;
				((Component)<allRigs2>5__3[<m>5__5]).transform.rotation = ((Component)<allRigs>5__2[<m>5__5]).transform.rotation;
				<allRigs2>5__3[<m>5__5].velocity = <allRigs>5__2[<m>5__5].velocity;
				<num>5__4 = <m>5__5;
			}
			Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <按照血量召唤蠕虫>d__16 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 转换2343 <>4__this;

		private int <cidja>5__1;

		private Rigidbody[] <allRigs2>5__2;

		private int <i>5__3;

		private int <m>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <按照血量召唤蠕虫>d__16(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<allRigs2>5__2 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//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_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			<cidja>5__1 = (int)<>4__this.unit.data.maxHealth / 700;
			if (<cidja>5__1 < 1)
			{
				<cidja>5__1 = 0;
			}
			if (<cidja>5__1 > 6)
			{
				<cidja>5__1 = 6;
			}
			for (<i>5__3 = 0; <i>5__3 <= <cidja>5__1; <i>5__3++)
			{
				<>4__this.召唤蠕虫.Spawn(<>4__this.unit.data.mainRig.position, Quaternion.identity, <>4__this.队伍转换器(<>4__this.unit.Team), 1.3f, (UnitPoolInfo?)null);
			}
			<allRigs2>5__2 = <>4__this.unit.data.allRigs.AllRigs;
			for (<m>5__4 = 0; <m>5__4 < <allRigs2>5__2.Length; <m>5__4++)
			{
				TeamHolder.AddTeamHolder(Object.Instantiate<GameObject>(<>4__this.召唤蠕虫时生成爆炸, <allRigs2>5__2[<m>5__4].position, Quaternion.identity), ((Component)<>4__this).gameObject);
			}
			Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	private bool 判断1 = true;

	private bool 判断2 = true;

	private bool 判断3 = true;

	private float 计时器 = 0f;

	public UnitBlueprint unitSpawn;

	private Team team = (Team)1;

	private UnitBlueprint ttblueprint;

	public UnitBlueprint 蠕虫巨人;

	public GameObject unitbase;

	public GameObject 召唤蠕虫时生成爆炸;

	public UnitBlueprint 召唤蠕虫;

	public GameObject move3123;

	private static readonly List<GameObject> 骷髅 = new List<GameObject> { (GameObject)SLMALoader.SDic["bases"]["Humanoid"] };

	private static readonly List<GameObject> 巨人 = new List<GameObject> { (GameObject)SLMALoader.SDic["bases"]["IceGiant"] };

	public Team 队伍转换器(Team originalTeam)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Invalid comparison between Unknown and I4
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Invalid comparison between Unknown and I4
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: 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_0021: 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;
	}

	public void Start()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Invalid comparison between Unknown and I4
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Invalid comparison between Unknown and I4
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		unitSpawn = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>().unitBlueprint;
		if ((int)unit.Team == 0)
		{
			team = (Team)1;
		}
		if ((int)unit.Team == 1)
		{
			team = (Team)0;
		}
	}

	[IteratorStateMachine(typeof(<kiazhaidsfj>d__15))]
	public IEnumerator kiazhaidsfj()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <kiazhaidsfj>d__15(0)
		{
			<>4__this = this
		};
	}

	[IteratorStateMachine(typeof(<按照血量召唤蠕虫>d__16))]
	public IEnumerator 按照血量召唤蠕虫()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <按照血量召唤蠕虫>d__16(0)
		{
			<>4__this = this
		};
	}

	public void Update()
	{
		if (!unit.data.Dead || !判断1)
		{
			return;
		}
		计时器 += Time.deltaTime;
		if (计时器 > 1.8f && 判断2)
		{
			((Component)((Component)this).gameObject.transform.Find("penshe3")).gameObject.SetActive(true);
			判断2 = false;
		}
		if (计时器 > 3f && 判断3)
		{
			if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 巨人.Contains(unit.unitBlueprint.UnitBase))
			{
				((MonoBehaviour)this).StartCoroutine(召唤蠕虫巨人());
			}
			if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 骷髅.Contains(unit.unitBlueprint.UnitBase))
			{
				((MonoBehaviour)this).StartCoroutine(kiazhaidsfj());
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(按照血量召唤蠕虫());
			}
		}
	}

	[IteratorStateMachine(typeof(<召唤蠕虫巨人>d__18))]
	public IEnumerator 召唤蠕虫巨人()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <召唤蠕虫巨人>d__18(0)
		{
			<>4__this = this
		};
	}
}
public class 转换2343增强版 : MonoBehaviour
{
	[CompilerGenerated]
	private sealed class <召唤蠕虫人>d__11 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public 转换2343增强版 <>4__this;

		private GameObject <gameObject1>5__1;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <召唤蠕虫人>d__11(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<gameObject1>5__1 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0039: 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_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)
			if (<>1__state != 0)
			{
				return false;
			}
			<>1__state = -1;
			<gameObject1>5__1 = <>4__this.ttblueprint.Spawn(<>4__this.unit.data.mainRig.position, <>4__this.unit.data.mainRig.rotation, <>4__this.队伍转换器(<>4__this.unit.Team), 1f, (UnitPoolInfo?)null)[0];
			Object.Destroy((Object)(object)((Component)<>4__this.unit).gameObject);
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private Unit unit;

	private bool 判断1 = true;

	private bool 判断2 = true;

	private bool 判断3 = true;

	private float 计时器 = 0f;

	public UnitBlueprint unitSpawn;

	private Team team = (Team)1;

	public UnitBlueprint ttblueprint;

	public GameObject unitbase;

	public GameObject move;

	private static readonly List<GameObject> 仅人型 = new List<GameObject> { (GameObject)SLMALoader.SDic["bases"]["Humanoid"] };

	public Team 队伍转换器(Team originalTeam)
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_0003: Unknown result type (might be due to invalid IL or missing references)
		//IL_0005: Invalid comparison between Unknown and I4
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0013: Invalid comparison between Unknown and I4
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: 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_0021: 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;
	}

	[IteratorStateMachine(typeof(<召唤蠕虫人>d__11))]
	public IEnumerator 召唤蠕虫人()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <召唤蠕虫人>d__11(0)
		{
			<>4__this = this
		};
	}

	public void Start()
	{
		//IL_004c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0052: Invalid comparison between Unknown and I4
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Invalid comparison between Unknown and I4
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0076: Unknown result type (might be due to invalid IL or missing references)
		unit = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>();
		unitSpawn = ((Component)((Component)this).gameObject.transform.root).gameObject.GetComponentInChildren<Unit>().unitBlueprint;
		if ((int)unit.Team == 0)
		{
			team = (Team)1;
		}
		if ((int)unit.Team == 1)
		{
			team = (Team)0;
		}
	}

	public void Update()
	{
		//IL_010c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0121: 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 (!unit.data.Dead || !判断1)
		{
			return;
		}
		计时器 += Time.deltaTime;
		if (计时器 > 0.8f && 判断2)
		{
			((Component)((Component)this).gameObject.transform.Find("penshe3")).gameObject.SetActive(true);
			判断2 = false;
		}
		if (计时器 > 2f && 判断3)
		{
			if (Object.op_Implicit((Object)(object)unit) && Object.op_Implicit((Object)(object)unit.unitBlueprint.UnitBase) && 仅人型.Contains(unit.unitBlueprint.UnitBase))
			{
				((MonoBehaviour)this).StartCoroutine(召唤蠕虫人());
				判断3 = false;
			}
			else
			{
				ttblueprint.Spawn(unit.data.mainRig.position, unit.data.mainRig.rotation, 队伍转换器(unit.Team), 1f, (UnitPoolInfo?)null);
				Object.Destroy((Object)(object)((Component)unit).gameObject);
			}
		}
	}
}
public class ScenesManager12 : MonoBehaviour
{
	public ScenesManager12()
	{
		SceneManager.sceneLoaded += SceneLoaded;
	}

	public void SceneLoaded(Scene scene, LoadSceneMode loadSceneMode)
	{
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_001d: Expected O, but got Unknown
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Expected O, but got Unknown
		//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Expected O, but got Unknown
		//IL_013a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Expected O, but got Unknown
		//IL_017a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Expected O, but got Unknown
		if (((Scene)(ref scene)).name == "05_Sandbox_Medieval_VC")
		{
			GameObject val = new GameObject();
			((Object)val).name = "darkifgsd3";
			val.transform.position = new Vector3(-104.2145f, 62.12671f, 24.6887f);
			GameObject val2 = Object.Instantiate<GameObject>(UManager.隐藏物体3, val.transform);
			if (Object.op_Implicit((Object)(object)val2))
			{
				Debug.Log((object)"32432243");
			}
			else
			{
				Debug.LogError((object)"没有找到资源4让包32432243");
			}
		}
		if (((Scene)(ref scene)).name == "00_Lvl1_Halloween_VC")
		{
			GameObject val3 = new GameObject();
			((Object)val3).name = "ufhoefw";
			val3.transform.position = new Vector3(-13.439f, -10.027f, 4.063f);
			GameObject val4 = Object.Instantiate<GameObject>(UManager.黑骑士隐藏物体213, val3.transform);
		}
		if (((Scene)(ref scene)).name == "01_Lvl1_Tribal_VC")
		{
			GameObject val5 = new GameObject();
			((Object)val5).name = "huo423";
			GameObject val6 = Object.Instantiate<GameObject>(UManager.火元素隐藏物体, val5.transform);
		}
		if (((Scene)(ref scene)).name == "04_Sandbox_Viking_VC")
		{
			GameObject val7 = new GameObject();
			((Object)val7).name = "bing343";
			GameObject val8 = Object.Instantiate<GameObject>(UManager.冰元素隐藏物体, val7.transform);
		}
		if (((Scene)(ref scene)).name == "08_Lvl1_Pirate_VC")
		{
			GameObject val9 = new GameObject();
			((Object)val9).name = "lei3rs";
			GameObject val10 = Object.Instantiate<GameObject>(UManager.雷元素隐藏物体, val9.transform);
		}
	}
}
public class VoiceBundleDatabaseUpdater
{
	public static void AddVoiceBundles(IEnumerable<VoiceBundle> newVoiceBundles)
	{
		//IL_00ae: 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.");
	}
}
[BepInPlugin("rwdseerfd", "rwdseerfd", "1.0.0")]
internal class Loader : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <call>d__2 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public Loader <>4__this;

		private GameObject <SecretUnlockSpawner>5__1;

		private LandfallContentDatabase <landfallContentDatabase>5__2;

		private UnitBlueprint[] <array>5__3;

		private int <i>5__4;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <call>d__2(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<SecretUnlockSpawner>5__1 = null;
			<landfallContentDatabase>5__2 = null;
			<array>5__3 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Expected O, but got Unknown
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Expected O, but got Unknown
			//IL_0143: 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_005e: Expected O, but got Unknown
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)Object.FindObjectOfType<ServiceLocator>() != (Object)null));
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>2__current = (object)new WaitUntil((Func<bool>)(() => ServiceLocator.GetService<ISaveLoaderService>() != null));
				<>1__state = 2;
				return true;
			case 2:
				<>1__state = -1;
				<>2__current = (object)new WaitForSecondsRealtime(0.3f);
				<>1__state = 3;
				return true;
			case 3:
				<>1__state = -1;
				SLMALoader.GetInstance();
				<SecretUnlockSpawner>5__1 = new GameObject("SecretUnlock314sdfjwe");
				Object.DontDestroyOnLoad((Object)(object)<SecretUnlockSpawner>5__1);
				<SecretUnlockSpawner>5__1.AddComponent<ScenesManager12>();
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"隐藏兵种内容加载完毕!!");
				<landfallContentDatabase>5__2 = ContentDatabase.Instance().LandfallContentDatabase;
				UManager.Init(<landfallContentDatabase>5__2);
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"主要内容加载完毕!!");
				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)));
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"武器内容加载完毕!!");
				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)));
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"服饰部分加载完毕!!");
				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)));
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"技能部分加载完毕!!");
				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)));
				<array>5__3 = Resources.FindObjectsOfTypeAll<UnitBlueprint>();
				<i>5__4 = 0;
				while (<i>5__4 < <array>5__3.Length)
				{
					UManager.EditBlueprint(<array>5__3[<i>5__4], <landfallContentDatabase>5__2);
					<i>5__4++;
				}
				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"));
				((BaseUnityPlugin)<>4__this).Logger.LogInfo((object)"已加载模组全部内容祝您游玩愉快!!!!!");
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	public static GameObject Unlockruaa;

	private void Awake()
	{
		((BaseUnityPlugin)this).Logger.LogInfo((object)"不死图腾插件加载中...");
		Harmony.CreateAndPatchAll(typeof(TakeDamgePatch), (string)null);
		((BaseUnityPlugin)this).Logger.LogInfo((object)"不死图腾插件加载完成!");
		((BaseUnityPlugin)this).Logger.LogInfo((object)"开始加载mod内容");
		((MonoBehaviour)this).StartCoroutine("call");
	}

	[IteratorStateMachine(typeof(<call>d__2))]
	private IEnumerator call()
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <call>d__2(0)
		{
			<>4__this = this
		};
	}
}
public class MyModItems : MonoBehaviour
{
	private static Dictionary<string, Item> items;

	private static MyModItems instance { get; set; }

	public static MyModItems GetInstance()
	{
		//IL_0016: 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 static class UManager
{
	public static class 编辑器1
	{
		public static void 设置兵编分类(GameObject item, string categoryName = "蠕虫人", TagType tagType = 0)
		{
			//IL_001c: 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_0025: 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)
			CharacterItem componentInChildren = item.GetComponentInChildren<CharacterItem>();
			if (Object.op_Implicit((Object)(object)componentInChildren))
			{
				componentInChildren.tags = new List<Tag>
				{
					new Tag
					{
						tagType = tagType,
						value = categoryName
					}
				};
			}
		}

		public static Sprite 直接设置图标(AssetBundle assetBundle, string assetbundlename = "")
		{
			return assetBundle.LoadAsset<Sprite>(assetbundlename);
		}

		public static Sprite 设置图标(AssetBundle assetBundle, string assetbundlename = "")
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = assetBundle.LoadAsset<Texture2D>(assetbundlename);
			((Texture)val).filterMode = (FilterMode)1;
			return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f));
		}
	}

	public static string modname = "rwdseerfd";

	public static string modder = "FhpSlime";

	private static string com;

	public static SLMABundleMod bundleMod;

	public static GameObject 反伤反馈1;

	public static GameObject 公用蠕虫咬2;

	public static GameObject 隐藏物体3;

	public static GameObject 黑骑士隐藏物体213;

	public static GameObject 火元素隐藏物体;

	public static GameObject 冰元素隐藏物体;

	public static GameObject 雷元素隐藏物体;

	public static Sprite 元素法师3124;

	public static GameObject 绿色治疗效果;

	public static Material 蓝色发光材质;

	public static Material 红色发光材质;

	public static AssetBundle asset1;

	public static Material wewewe;

	public static string 蠕虫人 = "蠕虫人12";

	public static void SetRiders(UnitBlueprint me, UnitBlueprint[] 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)
	{
		Debug.Log((object)"Hey");
	}

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

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

ChouChou's Units.dll

Decompiled a week 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