Decompiled source of EnemiesReturns v0.1.13

plugins/Risky_Sleeps-EnemiesReturns/EnemiesReturns.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.Cryptography;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using EnemiesReturns.EditorHelpers;
using EnemiesReturns.Enemies.Colossus;
using EnemiesReturns.Enemies.Spitter;
using EnemiesReturns.Items.ColossalKnurl;
using EnemiesReturns.Junk.ModdedEntityStates.Colossus.HeadLaser;
using EnemiesReturns.Junk.ModdedEntityStates.Spitter;
using EnemiesReturns.ModdedEntityStates;
using EnemiesReturns.ModdedEntityStates.Colossus;
using EnemiesReturns.ModdedEntityStates.Colossus.Death;
using EnemiesReturns.ModdedEntityStates.Colossus.HeadLaserBarrage;
using EnemiesReturns.ModdedEntityStates.Colossus.RockClap;
using EnemiesReturns.ModdedEntityStates.Colossus.Stomp;
using EnemiesReturns.ModdedEntityStates.Spitter;
using EnemiesReturns.PrefabAPICompat;
using EnemiesReturns.Projectiles;
using EntityStates;
using EntityStates.AI.Walker;
using HG;
using HG.Reflection;
using KinematicCharacterController;
using On.RoR2;
using R2API;
using Rewired.Utils.Classes.Utility;
using RoR2;
using RoR2.Audio;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Mecanim;
using RoR2.Navigation;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using ThreeEyedGames;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.Rendering;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: OptIn]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("EnemiesReturns")]
[assembly: AssemblyTitle("EnemiesReturns")]
[assembly: AssemblyCompany("EnemiesReturns")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace EnemiesReturns
{
	public class ContentProvider : IContentPackProvider
	{
		[StructLayout(LayoutKind.Sequential, Size = 1)]
		public struct MonsterCategories
		{
			public const string Champions = "Champions";

			public const string Minibosses = "Minibosses";

			public const string BasicMonsters = "Basic Monsters";

			public const string Special = "Special";
		}

		private readonly ContentPack _contentPack = new ContentPack();

		public const string AssetBundleName = "EnemiesReturns";

		public const string AssetBundleFolder = "AssetBundles";

		public const string SoundbankFolder = "Soundbanks";

		public const string SoundsSoundBankFileName = "EnemiesReturnsSounds";

		public static Dictionary<string, string> ShaderLookup = new Dictionary<string, string>
		{
			{ "stubbedror2/base/shaders/hgstandard", "RoR2/Base/Shaders/HGStandard.shader" },
			{ "stubbedror2/base/shaders/hgsnowtopped", "RoR2/Base/Shaders/HGSnowTopped.shader" },
			{ "stubbedror2/base/shaders/hgtriplanarterrainblend", "RoR2/Base/Shaders/HGTriplanarTerrainBlend.shader" },
			{ "stubbedror2/base/shaders/hgintersectioncloudremap", "RoR2/Base/Shaders/HGIntersectionCloudRemap.shader" },
			{ "stubbedror2/base/shaders/hgcloudremap", "RoR2/Base/Shaders/HGCloudRemap.shader" },
			{ "stubbedror2/base/shaders/hgdistortion", "RoR2/Base/Shaders/HGDistortion.shader" },
			{ "stubbedcalm water/calmwater - dx11 - doublesided", "Calm Water/CalmWater - DX11 - DoubleSided.shader" },
			{ "stubbedcalm water/calmwater - dx11", "Calm Water/CalmWater - DX11.shader" },
			{ "stubbednature/speedtree", "RoR2/Base/Shaders/SpeedTreeCustom.shader" },
			{ "stubbeddecalicious/decaliciousdeferreddecal", "Decalicious/DecaliciousDeferredDecal.shader" }
		};

		public static List<Material> MaterialCache = new List<Material>();

		public string identifier => "com.Viliger.EnemiesReturns.ContentProvider";

		public IEnumerator FinalizeAsync(FinalizeAsyncArgs args)
		{
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args)
		{
			ContentPack.Copy(_contentPack, args.output);
			args.ReportProgress(1f);
			yield break;
		}

		public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args)
		{
			Stopwatch totalStopwatch = new Stopwatch();
			((StopwatchBase)totalStopwatch).Start();
			_contentPack.identifier = identifier;
			Stopwatch val = new Stopwatch();
			((StopwatchBase)val).Start();
			LoadSoundBanks(Path.Combine(Path.GetDirectoryName(typeof(ContentProvider).Assembly.Location), "Soundbanks"));
			((StopwatchBase)val).Stop();
			Log.Info("Soundbanks loaded in " + ((StopwatchBase)val).elapsedSeconds);
			string path = Path.Combine(Path.GetDirectoryName(typeof(ContentProvider).Assembly.Location), "AssetBundles");
			AssetBundle assetbundle = null;
			yield return LoadAssetBundle(Path.Combine(path, "EnemiesReturns"), args.progressReceiver, delegate(AssetBundle resultAssetBundle)
			{
				assetbundle = resultAssetBundle;
			});
			Dictionary<string, Material> skinsLookup = new Dictionary<string, Material>();
			yield return LoadAllAssetsAsync<Material>(assetbundle, args.progressReceiver, (Action<Material[]>)delegate(Material[] assets)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//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)
				Stopwatch val16 = new Stopwatch();
				((StopwatchBase)val16).Start();
				if (assets != null)
				{
					Material[] array = assets;
					foreach (Material val17 in array)
					{
						skinsLookup.Add(((Object)val17).name, val17);
						if (((Object)val17.shader).name.StartsWith("Stubbed"))
						{
							Shader val18 = Addressables.LoadAssetAsync<Shader>((object)ShaderLookup[((Object)val17.shader).name.ToLower()]).WaitForCompletion();
							((Object)val17.shader).name.ToLower();
							if (Object.op_Implicit((Object)(object)val18))
							{
								val17.shader = val18;
								MaterialCache.Add(val17);
							}
							else
							{
								Log.Warning("Couldn't find replacement shader for " + ((Object)val17.shader).name.ToLower());
							}
						}
					}
				}
				((StopwatchBase)val16).Stop();
				Log.Info("Materials swapped in " + ((StopwatchBase)val16).elapsedSeconds);
			});
			Dictionary<string, Sprite> iconLookup = new Dictionary<string, Sprite>();
			yield return LoadAllAssetsAsync<Sprite>(assetbundle, args.progressReceiver, (Action<Sprite[]>)delegate(Sprite[] assets)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				Stopwatch val15 = new Stopwatch();
				((StopwatchBase)val15).Start();
				iconLookup = assets.ToDictionary((Sprite item) => ((Object)item).name, (Sprite item) => item);
				((StopwatchBase)val15).Stop();
				Log.Info("Icons loaded in " + ((StopwatchBase)val15).elapsedSeconds);
			});
			yield return LoadAllAssetsAsync<GameObject>(assetbundle, args.progressReceiver, (Action<GameObject[]>)delegate(GameObject[] assets)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//IL_0073: Unknown result type (might be due to invalid IL or missing references)
				//IL_007d: Expected O, but got Unknown
				//IL_027b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0280: Unknown result type (might be due to invalid IL or missing references)
				//IL_028b: Unknown result type (might be due to invalid IL or missing references)
				//IL_029b: Unknown result type (might be due to invalid IL or missing references)
				//IL_029d: Unknown result type (might be due to invalid IL or missing references)
				//IL_02a2: 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_02bb: Expected O, but got Unknown
				//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f2: 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_0317: Unknown result type (might be due to invalid IL or missing references)
				//IL_031c: Unknown result type (might be due to invalid IL or missing references)
				//IL_033c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0341: Unknown result type (might be due to invalid IL or missing references)
				//IL_0361: Unknown result type (might be due to invalid IL or missing references)
				//IL_0366: Unknown result type (might be due to invalid IL or missing references)
				//IL_0386: Unknown result type (might be due to invalid IL or missing references)
				//IL_038b: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
				//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
				//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
				//IL_041a: Unknown result type (might be due to invalid IL or missing references)
				//IL_041f: Unknown result type (might be due to invalid IL or missing references)
				//IL_043f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0444: Unknown result type (might be due to invalid IL or missing references)
				//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_0489: Unknown result type (might be due to invalid IL or missing references)
				//IL_048e: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_04b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_04db: Unknown result type (might be due to invalid IL or missing references)
				//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_04eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
				//IL_0502: Unknown result type (might be due to invalid IL or missing references)
				//IL_0509: Unknown result type (might be due to invalid IL or missing references)
				//IL_051b: Expected O, but got Unknown
				//IL_052d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0532: Unknown result type (might be due to invalid IL or missing references)
				//IL_0552: Unknown result type (might be due to invalid IL or missing references)
				//IL_0557: Unknown result type (might be due to invalid IL or missing references)
				//IL_0577: Unknown result type (might be due to invalid IL or missing references)
				//IL_057c: Unknown result type (might be due to invalid IL or missing references)
				//IL_059c: 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_05c1: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
				//IL_05ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_05f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_060e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0610: Unknown result type (might be due to invalid IL or missing references)
				//IL_0615: Unknown result type (might be due to invalid IL or missing references)
				//IL_061c: Unknown result type (might be due to invalid IL or missing references)
				//IL_062e: Expected O, but got Unknown
				//IL_0640: Unknown result type (might be due to invalid IL or missing references)
				//IL_0645: Unknown result type (might be due to invalid IL or missing references)
				//IL_066d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0672: Unknown result type (might be due to invalid IL or missing references)
				//IL_067d: Unknown result type (might be due to invalid IL or missing references)
				//IL_068d: Unknown result type (might be due to invalid IL or missing references)
				//IL_068f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0694: Unknown result type (might be due to invalid IL or missing references)
				//IL_069b: Unknown result type (might be due to invalid IL or missing references)
				//IL_06ad: Expected O, but got Unknown
				//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
				//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_06e9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0709: Unknown result type (might be due to invalid IL or missing references)
				//IL_070e: Unknown result type (might be due to invalid IL or missing references)
				//IL_072e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0733: Unknown result type (might be due to invalid IL or missing references)
				//IL_0753: Unknown result type (might be due to invalid IL or missing references)
				//IL_0758: Unknown result type (might be due to invalid IL or missing references)
				//IL_0778: Unknown result type (might be due to invalid IL or missing references)
				//IL_077d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0872: Unknown result type (might be due to invalid IL or missing references)
				//IL_0890: Unknown result type (might be due to invalid IL or missing references)
				//IL_0892: Unknown result type (might be due to invalid IL or missing references)
				//IL_092c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0936: Expected O, but got Unknown
				//IL_095c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0966: Expected O, but got Unknown
				//IL_097a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0984: Expected O, but got Unknown
				//IL_09ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_09f9: Expected O, but got Unknown
				//IL_0d29: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d2e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d39: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d49: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d50: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d57: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d69: Expected O, but got Unknown
				//IL_0d7b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0d80: Unknown result type (might be due to invalid IL or missing references)
				//IL_0da8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dad: Unknown result type (might be due to invalid IL or missing references)
				//IL_0db8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dc8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dca: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dcf: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dd6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0de8: Expected O, but got Unknown
				//IL_0dfa: Unknown result type (might be due to invalid IL or missing references)
				//IL_0dff: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e1f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e24: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e44: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e49: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e69: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e6e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e8e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0e93: Unknown result type (might be due to invalid IL or missing references)
				//IL_0eb3: Unknown result type (might be due to invalid IL or missing references)
				//IL_0eb8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ee0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ee5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ef0: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f00: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f02: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f07: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f0e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f20: Expected O, but got Unknown
				//IL_0f32: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f37: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f57: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f5c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f7c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0f81: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fa1: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fa6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fc6: Unknown result type (might be due to invalid IL or missing references)
				//IL_0fcb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0feb: Unknown result type (might be due to invalid IL or missing references)
				//IL_0ff0: Unknown result type (might be due to invalid IL or missing references)
				//IL_1010: Unknown result type (might be due to invalid IL or missing references)
				//IL_1015: Unknown result type (might be due to invalid IL or missing references)
				//IL_1035: Unknown result type (might be due to invalid IL or missing references)
				//IL_103a: Unknown result type (might be due to invalid IL or missing references)
				//IL_105a: Unknown result type (might be due to invalid IL or missing references)
				//IL_105f: Unknown result type (might be due to invalid IL or missing references)
				//IL_107f: Unknown result type (might be due to invalid IL or missing references)
				//IL_1084: Unknown result type (might be due to invalid IL or missing references)
				//IL_10a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_10a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_10c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_10ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_10ee: Unknown result type (might be due to invalid IL or missing references)
				//IL_10f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_1113: Unknown result type (might be due to invalid IL or missing references)
				//IL_1118: Unknown result type (might be due to invalid IL or missing references)
				//IL_1138: Unknown result type (might be due to invalid IL or missing references)
				//IL_113d: Unknown result type (might be due to invalid IL or missing references)
				//IL_1165: Unknown result type (might be due to invalid IL or missing references)
				//IL_116a: Unknown result type (might be due to invalid IL or missing references)
				//IL_1175: Unknown result type (might be due to invalid IL or missing references)
				//IL_1185: Unknown result type (might be due to invalid IL or missing references)
				//IL_1187: Unknown result type (might be due to invalid IL or missing references)
				//IL_118c: Unknown result type (might be due to invalid IL or missing references)
				//IL_1193: Unknown result type (might be due to invalid IL or missing references)
				//IL_11be: Unknown result type (might be due to invalid IL or missing references)
				//IL_11c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_11ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_11de: Unknown result type (might be due to invalid IL or missing references)
				//IL_11e0: Unknown result type (might be due to invalid IL or missing references)
				//IL_11e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_11ec: Unknown result type (might be due to invalid IL or missing references)
				//IL_11fe: Expected O, but got Unknown
				//IL_1210: Unknown result type (might be due to invalid IL or missing references)
				//IL_1215: Unknown result type (might be due to invalid IL or missing references)
				//IL_1235: Unknown result type (might be due to invalid IL or missing references)
				//IL_123a: Unknown result type (might be due to invalid IL or missing references)
				//IL_125a: Unknown result type (might be due to invalid IL or missing references)
				//IL_125f: Unknown result type (might be due to invalid IL or missing references)
				//IL_127f: Unknown result type (might be due to invalid IL or missing references)
				//IL_1284: Unknown result type (might be due to invalid IL or missing references)
				//IL_12a4: Unknown result type (might be due to invalid IL or missing references)
				//IL_12a9: Unknown result type (might be due to invalid IL or missing references)
				//IL_12c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_12ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_12f6: Unknown result type (might be due to invalid IL or missing references)
				//IL_12fb: Unknown result type (might be due to invalid IL or missing references)
				//IL_1306: Unknown result type (might be due to invalid IL or missing references)
				//IL_1316: Unknown result type (might be due to invalid IL or missing references)
				//IL_1318: Unknown result type (might be due to invalid IL or missing references)
				//IL_131d: Unknown result type (might be due to invalid IL or missing references)
				//IL_1324: Unknown result type (might be due to invalid IL or missing references)
				//IL_1336: Expected O, but got Unknown
				//IL_1348: Unknown result type (might be due to invalid IL or missing references)
				//IL_134d: Unknown result type (might be due to invalid IL or missing references)
				//IL_136d: Unknown result type (might be due to invalid IL or missing references)
				//IL_1372: Unknown result type (might be due to invalid IL or missing references)
				//IL_1392: Unknown result type (might be due to invalid IL or missing references)
				//IL_1397: Unknown result type (might be due to invalid IL or missing references)
				//IL_13b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_13bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_13dc: Unknown result type (might be due to invalid IL or missing references)
				//IL_13e1: Unknown result type (might be due to invalid IL or missing references)
				//IL_1401: Unknown result type (might be due to invalid IL or missing references)
				//IL_1406: Unknown result type (might be due to invalid IL or missing references)
				//IL_1426: Unknown result type (might be due to invalid IL or missing references)
				//IL_142b: Unknown result type (might be due to invalid IL or missing references)
				//IL_144b: Unknown result type (might be due to invalid IL or missing references)
				//IL_1450: Unknown result type (might be due to invalid IL or missing references)
				//IL_1470: Unknown result type (might be due to invalid IL or missing references)
				//IL_1475: Unknown result type (might be due to invalid IL or missing references)
				Stopwatch val2 = new Stopwatch();
				((StopwatchBase)val2).Start();
				List<GameObject> list = new List<GameObject>();
				List<GameObject> list2 = new List<GameObject>();
				List<Type> list3 = new List<Type>();
				List<SkillFamily> list4 = new List<SkillFamily>();
				List<SkillDef> list5 = new List<SkillDef>();
				List<EffectDef> list6 = new List<EffectDef>();
				List<GameObject> list7 = new List<GameObject>();
				List<UnlockableDef> list8 = new List<UnlockableDef>();
				List<ItemDef> list9 = new List<ItemDef>();
				list3.Add(typeof(BaseEmoteState));
				SpitterFactory spitterFactory = new SpitterFactory();
				list6.Add(new EffectDef(Bite.biteEffectPrefab = spitterFactory.CreateBiteEffect()));
				GameObject val3 = spitterFactory.CreatedChargedSpitSmallDoTZone();
				GameObject val4 = spitterFactory.CreateChargedSpitDoTZone();
				GameObject val5 = spitterFactory.CreateChargedSpitSplitProjectile(val3);
				list7.Add(FireChargedSpit.projectilePrefab = spitterFactory.CreateChargedSpitProjectile(val4, val5));
				list7.Add(val3);
				list7.Add(val4);
				list7.Add(val5);
				NormalSpit.normalSpitProjectile = spitterFactory.CreateNormalSpitProjectile();
				list7.Add(NormalSpit.normalSpitProjectile);
				UnlockableDef val6 = Utils.CreateUnlockableDef("Logs.SpitterBody.0", "ENEMIES_RETURNS_UNLOCKABLE_LOG_SPITTER");
				list8.Add(val6);
				SpitterFactory.Skills.NormalSpit = spitterFactory.CreateNormalSpitSkill();
				SpitterFactory.Skills.Bite = spitterFactory.CreateBiteSkill();
				SpitterFactory.Skills.ChargedSpit = spitterFactory.CreateChargedSpitSkill();
				list5.Add(SpitterFactory.Skills.NormalSpit);
				list5.Add(SpitterFactory.Skills.Bite);
				list5.Add(SpitterFactory.Skills.ChargedSpit);
				SpitterFactory.SkillFamilies.Primary = Utils.CreateSkillFamily("SpitterPrimaryFamily", SpitterFactory.Skills.NormalSpit);
				SpitterFactory.SkillFamilies.Secondary = Utils.CreateSkillFamily("SpitterSecondaryFamily", SpitterFactory.Skills.Bite);
				SpitterFactory.SkillFamilies.Special = Utils.CreateSkillFamily("SpitterSpecialFamily", SpitterFactory.Skills.ChargedSpit);
				list4.Add(SpitterFactory.SkillFamilies.Primary);
				list4.Add(SpitterFactory.SkillFamilies.Secondary);
				list4.Add(SpitterFactory.SkillFamilies.Special);
				GameObject val7 = assets.First((GameObject body) => ((Object)body).name == "SpitterBody");
				SpitterFactory.SpitterBody = spitterFactory.CreateSpitterBody(val7, iconLookup["texSpitterIcon"], val6, skinsLookup);
				list.Add(SpitterFactory.SpitterBody);
				GameObject val8 = assets.First((GameObject master) => ((Object)master).name == "SpitterMaster");
				SpitterFactory.SpitterMaster = spitterFactory.CreateSpitterMaster(val8, val7);
				list2.Add(SpitterFactory.SpitterMaster);
				SpitterFactory.SpawnCards.cscSpitterDefault = spitterFactory.CreateCard("cscSpitterDefault", val8, SpitterFactory.SkinDefs.Default, val7);
				DirectorCard card = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)SpitterFactory.SpawnCards.cscSpitterDefault,
					selectionWeight = EnemiesReturnsConfiguration.Spitter.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Spitter.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/foggyswamp/dccsFoggySwampMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/foggyswamp/dccsFoggySwampMonstersDLC.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsFoggySwampMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsFoggySwampMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/arena/dccsArenaMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/arena/dccsArenaMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/artifactworld/dccsArtifactWorldMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/artifactworld/dccsArtifactWorldMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld01/dccsArtifactWorld01Monsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld01/dccsArtifactWorld01Monsters_DLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld02/dccsArtifactWorld02Monsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld02/dccsArtifactWorld02Monsters_DLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld03/dccsArtifactWorld03Monsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/artifactworld03/dccsArtifactWorld03MonstersDLC1.asset").WaitForCompletion());
				SpitterFactory.SpawnCards.cscSpitterLakes = spitterFactory.CreateCard("cscSpitterLakes", val8, SpitterFactory.SkinDefs.Lakes, val7);
				DirectorCard card2 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)SpitterFactory.SpawnCards.cscSpitterLakes,
					selectionWeight = EnemiesReturnsConfiguration.Spitter.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Spitter.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card2, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakes/dccsLakesMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card2, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakes/dccsLakesMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card2, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakes/dccsLakesMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card2, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/lakes/dccsLakesMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card2, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/CU8/lakes/dccsLakesMonsters.asset").WaitForCompletion());
				SpitterFactory.SpawnCards.cscSpitterSulfur = spitterFactory.CreateCard("cscSpitterSulfur", val8, SpitterFactory.SkinDefs.Sulfur, val7);
				DirectorCard card3 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)SpitterFactory.SpawnCards.cscSpitterSulfur,
					selectionWeight = EnemiesReturnsConfiguration.Spitter.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Spitter.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card3, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/sulfurpools/dccsSulfurPoolsMonstersDLC1.asset").WaitForCompletion());
				SpitterFactory.SpawnCards.cscSpitterDepths = spitterFactory.CreateCard("cscSpitterDepths", val8, SpitterFactory.SkinDefs.Depths, val7);
				DirectorCard card4 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)SpitterFactory.SpawnCards.cscSpitterDepths,
					selectionWeight = EnemiesReturnsConfiguration.Spitter.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Spitter.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/dampcave/dccsDampCaveMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/dampcave/dccsDampCaveMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsDampCaveMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsDampCaveMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itdampcave/dccsITDampCaveMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card4, "Minibosses", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itdampcave/dccsITDampCaveMonstersDLC2.asset").WaitForCompletion());
				list3.Add(typeof(Bite));
				list3.Add(typeof(EnemiesReturns.ModdedEntityStates.Spitter.SpawnState));
				list3.Add(typeof(NormalSpit));
				list3.Add(typeof(ChargeChargedSpit));
				list3.Add(typeof(FireChargedSpit));
				list3.Add(typeof(DeathDance));
				list3.Add(typeof(SpitterMain));
				list3.Add(typeof(DeathDancePlayer));
				ColossalKnurlFactory colossalKnurlFactory = new ColossalKnurlFactory();
				ColossalKnurlFactory.itemDef = colossalKnurlFactory.CreateItem(assets.First((GameObject item) => ((Object)item).name == "PickupColossalCurl"), iconLookup["texColossalKnurlIcon"]);
				list9.Add(ColossalKnurlFactory.itemDef);
				ExplicitPickupDropTable val9 = ScriptableObject.CreateInstance<ExplicitPickupDropTable>();
				val9.pickupEntries = (PickupDefEntry[])(object)new PickupDefEntry[1]
				{
					new PickupDefEntry
					{
						pickupWeight = 1f,
						pickupDef = (Object)(object)ColossalKnurlFactory.itemDef
					}
				};
				GameObject prefab = assets.First((GameObject item) => ((Object)item).name == "ColossalKnurlFistProjectileGhost");
				prefab = colossalKnurlFactory.CreateFistGhostPrefab(prefab);
				GameObject fistPrefab = assets.First((GameObject item) => ((Object)item).name == "ColossalKnurlFistProjectile");
				ColossalKnurlFactory.projectilePrefab = colossalKnurlFactory.CreateFistProjectile(fistPrefab, prefab);
				list7.Add(ColossalKnurlFactory.projectilePrefab);
				ColossusFactory colossusFactory = new ColossusFactory();
				list6.Add(new EffectDef(StompBase.stompEffectPrefab = colossusFactory.CreateStompEffect()));
				list7.Add(StompBase.projectilePrefab = colossusFactory.CreateStompProjectile());
				GameObject val10 = colossusFactory.CreateDeathFallEffect();
				list6.Add(new EffectDef(val10));
				BaseDeath.fallEffect = val10;
				GameObject val11 = colossusFactory.CreateDeath2Effect();
				list6.Add(new EffectDef(val11));
				Death2.deathEffect = val11;
				RockClapEnd.clapEffect = colossusFactory.CreateClapEffect();
				list7.Add(RockClapEnd.projectilePrefab = colossusFactory.CreateFlyingRockProjectile(FloatingRocksController.flyingRockPrefab = colossusFactory.CreateFlyingRocksGhost()));
				list7.Add(HeadLaserBarrageAttack.projectilePrefab = colossusFactory.CreateLaserBarrageProjectile());
				list6.Add(new EffectDef(EnemiesReturns.ModdedEntityStates.Colossus.SpawnState.burrowPrefab = colossusFactory.CreateSpawnEffect()));
				UnlockableDef val12 = Utils.CreateUnlockableDef("Logs.ColossusBody.0", "ENEMIES_RETURNS_UNLOCKABLE_LOG_COLOSSUS");
				list8.Add(val12);
				HeadLaserAttack.beamPrefab = colossusFactory.CreateLaserEffect();
				ColossusFactory.Skills.Stomp = colossusFactory.CreateStompSkill();
				ColossusFactory.Skills.StoneClap = colossusFactory.CreateStoneClapSkill();
				ColossusFactory.Skills.LaserBarrage = colossusFactory.CreateLaserBarrageSkill();
				ColossusFactory.Skills.HeadLaser = colossusFactory.CreateHeadLaserSkill();
				list5.Add(ColossusFactory.Skills.Stomp);
				list5.Add(ColossusFactory.Skills.StoneClap);
				list5.Add(ColossusFactory.Skills.LaserBarrage);
				list5.Add(ColossusFactory.Skills.HeadLaser);
				ColossusFactory.SkillFamilies.Primary = Utils.CreateSkillFamily("ColossusPrimaryFamily", ColossusFactory.Skills.Stomp);
				ColossusFactory.SkillFamilies.Secondary = Utils.CreateSkillFamily("ColossusSecondaryFamily", ColossusFactory.Skills.StoneClap);
				ColossusFactory.SkillFamilies.Utility = Utils.CreateSkillFamily("ColossusUtilityFamily", ColossusFactory.Skills.LaserBarrage);
				ColossusFactory.SkillFamilies.Special = Utils.CreateSkillFamily("ColossusSpecialFamily", ColossusFactory.Skills.HeadLaser);
				list4.Add(ColossusFactory.SkillFamilies.Primary);
				list4.Add(ColossusFactory.SkillFamilies.Secondary);
				list4.Add(ColossusFactory.SkillFamilies.Utility);
				list4.Add(ColossusFactory.SkillFamilies.Special);
				GameObject val13 = assets.First((GameObject body) => ((Object)body).name == "ColossusBody");
				ColossusFactory.ColossusBody = colossusFactory.CreateColossusBody(val13, iconLookup["texColossusIcon"], val12, skinsLookup, val9);
				list.Add(ColossusFactory.ColossusBody);
				GameObject val14 = assets.First((GameObject master) => ((Object)master).name == "ColossusMaster");
				ColossusFactory.ColossusMaster = colossusFactory.CreateColossusMaster(val14, val13);
				list2.Add(ColossusFactory.ColossusMaster);
				list3.Add(typeof(ColossusMain));
				list3.Add(typeof(EnemiesReturns.ModdedEntityStates.Colossus.SpawnState));
				list3.Add(typeof(DancePlayer));
				list3.Add(typeof(InitialDeathState));
				list3.Add(typeof(BaseDeath));
				list3.Add(typeof(DeathFallBase));
				list3.Add(typeof(Death1));
				list3.Add(typeof(Death2));
				list3.Add(typeof(DeathBoner));
				list3.Add(typeof(RockClapEnd));
				list3.Add(typeof(RockClapStart));
				list3.Add(typeof(StompEnter));
				list3.Add(typeof(StompBase));
				list3.Add(typeof(StompL));
				list3.Add(typeof(StompR));
				list3.Add(typeof(HeadLaserBarrageStart));
				list3.Add(typeof(HeadLaserBarrageAttack));
				list3.Add(typeof(HeadLaserBarrageEnd));
				list3.Add(typeof(HeadLaserStart));
				list3.Add(typeof(HeadLaserAttack));
				list3.Add(typeof(HeadLaserEnd));
				ColossusFactory.SpawnCards.cscColossusDefault = colossusFactory.CreateCard("cscColossusDefault", val14, ColossusFactory.SkinDefs.Default, val13);
				DirectorCard card5 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusDefault,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card5, "Champions", (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGolemFamily.asset").WaitForCompletion());
				ColossusFactory.SpawnCards.cscColossusSkyMeadow = colossusFactory.CreateCard("cscColossusSkyMeadow", val14, ColossusFactory.SkinDefs.SkyMeadow, val13);
				DirectorCard card6 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusSkyMeadow,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/skymeadow/dccsSkyMeadowMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/skymeadow/dccsSkyMeadowMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsSkyMeadowMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsSkyMeadowMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itskymeadow/dccsITSkyMeadowMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card6, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itskymeadow/dccsITSkyMeadowMonstersDLC2.asset").WaitForCompletion());
				ColossusFactory.SpawnCards.cscColossusGrassy = colossusFactory.CreateCard("cscColossusGrassy", val14, ColossusFactory.SkinDefs.Grassy, val13);
				DirectorCard card7 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusGrassy,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card7, "Champions", (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGolemFamilyNature").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/golemplains/dccsGolemplainsMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/golemplains/dccsGolemplainsMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsGolemplainsMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsGolemplainsMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/arena/dccsArenaMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/arena/dccsArenaMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/dampcave/dccsDampCaveMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/dampcave/dccsDampCaveMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsDampCaveMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsDampCaveMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itgolemplains/dccsITGolemplainsMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itgolemplains/dccsITGolemplainsMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itdampcave/dccsITDampCaveMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card7, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itdampcave/dccsITDampCaveMonstersDLC2.asset").WaitForCompletion());
				ColossusFactory.SpawnCards.cscColossusCastle = colossusFactory.CreateCard("cscColossusCastle", val14, ColossusFactory.SkinDefs.Castle, val13);
				new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusCastle,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				ColossusFactory.SpawnCards.cscColossusSandy = colossusFactory.CreateCard("cscColossusSandy", val14, ColossusFactory.SkinDefs.Sandy, val13);
				DirectorCard card8 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusSandy,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card8, "Champions", (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGolemFamilySandy.asset").WaitForCompletion());
				AddMonsterToCardCategory(card8, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/goolake/dccsGooLakeMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card8, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/goolake/dccsGooLakeMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card8, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsGooLakeMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card8, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsGooLakeMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card8, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itgoolake/dccsITGooLakeMonsters.asset").WaitForCompletion());
				ColossusFactory.SpawnCards.cscColossusSnowy = colossusFactory.CreateCard("cscColossusSnowy", val14, ColossusFactory.SkinDefs.Snowy, val13);
				DirectorCard card9 = new DirectorCard
				{
					spawnCard = (SpawnCard)(object)ColossusFactory.SpawnCards.cscColossusSnowy,
					selectionWeight = EnemiesReturnsConfiguration.Colossus.SelectionWeight.Value,
					spawnDistance = (MonsterSpawnDistance)0,
					preventOverhead = true,
					minimumStageCompletions = EnemiesReturnsConfiguration.Colossus.MinimumStageCompletion.Value
				};
				AddMonsterToCardCategory(card9, "Champions", (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGolemFamilySnowy.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/snowyforest/dccsSnowyForestMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsSnowyForestMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/frozenwall/dccsFrozenWallMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/Base/frozenwall/dccsFrozenWallMonstersDLC1.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsFrozenWallMonstersDLC2.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC2/dccsFrozenWallMonstersDLC2Only.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itfrozenwall/dccsITFrozenWallMonsters.asset").WaitForCompletion());
				AddMonsterToCardCategory(card9, "Champions", Addressables.LoadAssetAsync<DirectorCardCategorySelection>((object)"RoR2/DLC1/itfrozenwall/dccsITFrozenWallMonstersDLC2.asset").WaitForCompletion());
				_contentPack.bodyPrefabs.Add(list.ToArray());
				_contentPack.masterPrefabs.Add(list2.ToArray());
				_contentPack.skillDefs.Add(list5.ToArray());
				_contentPack.skillFamilies.Add(list4.ToArray());
				_contentPack.entityStateTypes.Add(list3.ToArray());
				_contentPack.effectDefs.Add(list6.ToArray());
				_contentPack.projectilePrefabs.Add(list7.ToArray());
				_contentPack.unlockableDefs.Add(list8.ToArray());
				_contentPack.itemDefs.Add(list9.ToArray());
				((StopwatchBase)val2).Stop();
				Log.Info("Characters created in " + ((StopwatchBase)val2).elapsedSeconds);
			});
			yield return LoadAllAssetsAsync<AnimationCurveDef>(assetbundle, args.progressReceiver, (Action<AnimationCurveDef[]>)delegate(AnimationCurveDef[] assets)
			{
				HeadLaserBarrageAttack.intencityGraph = assets.First((AnimationCurveDef acd) => ((Object)acd).name == "LaserBarrageLightIntencity").curve;
			});
			((StopwatchBase)totalStopwatch).Stop();
			Log.Info("Total loading time: " + ((StopwatchBase)totalStopwatch).elapsedSeconds);
		}

		private void AddMonsterToCardCategory(DirectorCard card, string categoryName, DirectorCardCategorySelection stageCard)
		{
			int num = Utils.FindCategoryIndexByName(stageCard, categoryName);
			if (num >= 0)
			{
				stageCard.AddCard(num, card);
			}
		}

		private IEnumerator LoadAssetBundle(string assetBundleFullPath, IProgress<float> progress, Action<AssetBundle> onAssetBundleLoaded)
		{
			Stopwatch stopwatch = new Stopwatch();
			((StopwatchBase)stopwatch).Start();
			AssetBundleCreateRequest assetBundleCreateRequest = AssetBundle.LoadFromFileAsync(assetBundleFullPath);
			while (!((AsyncOperation)assetBundleCreateRequest).isDone)
			{
				progress.Report(((AsyncOperation)assetBundleCreateRequest).progress);
				yield return null;
			}
			onAssetBundleLoaded(assetBundleCreateRequest.assetBundle);
			((StopwatchBase)stopwatch).Stop();
			Log.Info("Asset bundle " + assetBundleFullPath + " loaded in " + ((StopwatchBase)stopwatch).elapsedSeconds);
		}

		private static IEnumerator LoadAllAssetsAsync<T>(AssetBundle assetBundle, IProgress<float> progress, Action<T[]> onAssetsLoaded) where T : Object
		{
			AssetBundleRequest sceneDefsRequest = assetBundle.LoadAllAssetsAsync<T>();
			while (!((AsyncOperation)sceneDefsRequest).isDone)
			{
				progress.Report(((AsyncOperation)sceneDefsRequest).progress);
				yield return null;
			}
			onAssetsLoaded(sceneDefsRequest.allAssets.Cast<T>().ToArray());
		}

		private static void LoadSoundBanks(string soundbanksFolderPath)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Invalid comparison between Unknown and I4
			//IL_002d: 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_004e: 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_0051: Invalid comparison between Unknown and I4
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			AKRESULT val = AkSoundEngine.AddBasePath(soundbanksFolderPath);
			if ((int)val == 1)
			{
				Log.Info("Added bank base path : " + soundbanksFolderPath);
			}
			else
			{
				Log.Error("Error adding base path : " + soundbanksFolderPath + " " + $"Error code : {val}");
			}
			uint num = default(uint);
			val = AkSoundEngine.LoadBank("EnemiesReturnsSounds", ref num);
			if ((int)val == 1)
			{
				Log.Info("Added bank : EnemiesReturnsSounds");
			}
			else
			{
				Log.Error("Error loading bank : EnemiesReturnsSounds " + $"Error code : {val}");
			}
		}
	}
	public static class EnemiesReturnsConfiguration
	{
		[StructLayout(LayoutKind.Sequential, Size = 1)]
		public struct Spitter
		{
			public static ConfigEntry<int> DirectorCost;

			public static ConfigEntry<int> SelectionWeight;

			public static ConfigEntry<int> MinimumStageCompletion;

			public static ConfigEntry<float> BaseMaxHealth;

			public static ConfigEntry<float> BaseMoveSpeed;

			public static ConfigEntry<float> BaseJumpPower;

			public static ConfigEntry<float> BaseDamage;

			public static ConfigEntry<float> BaseArmor;

			public static ConfigEntry<float> LevelMaxHealth;

			public static ConfigEntry<float> LevelDamage;

			public static ConfigEntry<float> LevelArmor;

			public static ConfigEntry<float> BiteCooldown;

			public static ConfigEntry<float> BiteDamageModifier;

			public static ConfigEntry<float> BiteDamageForce;

			public static ConfigEntry<float> BiteRadius;

			public static ConfigEntry<float> ChargedProjectileCooldown;

			public static ConfigEntry<float> ChargedProjectileDamage;

			public static ConfigEntry<float> ChargedProjectileForce;

			public static ConfigEntry<float> ChargedProjectileLargeDoTZoneDamage;

			public static ConfigEntry<float> ChargedProjectileLargeDoTZoneScale;

			public static ConfigEntry<float> ChargedProjectileFlyTime;

			public static ConfigEntry<float> ChargedProjectileSmallDoTZoneDamage;

			public static ConfigEntry<float> ChargedProjectileSmallDoTZoneScale;

			public static ConfigEntry<KeyCode> EmoteKey;
		}

		[StructLayout(LayoutKind.Sequential, Size = 1)]
		public struct Colossus
		{
			public static ConfigEntry<int> DirectorCost;

			public static ConfigEntry<int> SelectionWeight;

			public static ConfigEntry<int> MinimumStageCompletion;

			public static ConfigEntry<float> BaseMaxHealth;

			public static ConfigEntry<float> BaseMoveSpeed;

			public static ConfigEntry<float> BaseJumpPower;

			public static ConfigEntry<float> BaseDamage;

			public static ConfigEntry<float> BaseArmor;

			public static ConfigEntry<float> LevelMaxHealth;

			public static ConfigEntry<float> LevelDamage;

			public static ConfigEntry<float> LevelArmor;

			public static ConfigEntry<bool> DestroyModelOnDeath;

			public static ConfigEntry<float> FootstepShockwaveDistance;

			public static ConfigEntry<float> FootstepShockwaveForce;

			public static ConfigEntry<float> StompCooldown;

			public static ConfigEntry<float> StompOverlapAttackDamage;

			public static ConfigEntry<float> StompOverlapAttackForce;

			public static ConfigEntry<float> StompProjectileDamage;

			public static ConfigEntry<float> StompProjectileForce;

			public static ConfigEntry<float> StompProjectileSpeed;

			public static ConfigEntry<int> StompProjectileCount;

			public static ConfigEntry<float> StompProjectileScale;

			public static ConfigEntry<float> StompProjectileLifetime;

			public static ConfigEntry<float> RockClapCooldown;

			public static ConfigEntry<float> RockClapProjectileDamage;

			public static ConfigEntry<float> RockClapProjectileForce;

			public static ConfigEntry<float> RockClapProjectileSpeed;

			public static ConfigEntry<float> RockClapProjectileSpeedDelta;

			public static ConfigEntry<float> RockClapProjectileBlastRadius;

			public static ConfigEntry<float> RockClapProjectileDistanceFraction;

			public static ConfigEntry<float> RockClapProjectileDistanceFractionDelta;

			public static ConfigEntry<float> RockClapProjectileSpawnDistance;

			public static ConfigEntry<int> RockClapProjectileCount;

			public static ConfigEntry<float> RockClapDamage;

			public static ConfigEntry<float> RockClapForce;

			public static ConfigEntry<float> RockClapRadius;

			public static ConfigEntry<float> RockClapHomingSpeed;

			public static ConfigEntry<float> RockClapHomingRange;

			public static ConfigEntry<float> LaserBarrageCooldown;

			public static ConfigEntry<float> LaserBarrageDuration;

			public static ConfigEntry<float> LaserBarrageFrequency;

			public static ConfigEntry<float> LaserBarrageDamage;

			public static ConfigEntry<float> LaserBarrageProjectileSpeed;

			public static ConfigEntry<float> LaserBarrageForce;

			public static ConfigEntry<float> LaserBarrageSpread;

			public static ConfigEntry<float> LaserBarrageHeadPitch;

			public static ConfigEntry<int> LaserBarrageProjectileCount;

			public static ConfigEntry<float> LaserBarrageExplosionRadius;

			public static ConfigEntry<float> LaserBarrageExplosionDamage;

			public static ConfigEntry<float> LaserBarrageExplosionDelay;

			public static ConfigEntry<float> KnurlDamage;

			public static ConfigEntry<float> KnurlDamagePerStack;

			public static ConfigEntry<float> KnurlProcChance;

			public static ConfigEntry<float> KnurlProcCoefficient;

			public static ConfigEntry<float> KnurlForce;

			public static ConfigEntry<KeyCode> EmoteKey;
		}

		public static ConfigEntry<float> DebugWalkSpeedValue;

		public static ConfigEntry<float> testconfig;

		public static void PopulateConfig(ConfigFile config)
		{
			DebugWalkSpeedValue = config.Bind<float>("Debug", "walkSpeed value", 1f, "Value speed for walkSpeed animation. For debugging.");
			testconfig = config.Bind<float>("test", "test", 5f, "test");
			Spitter.SelectionWeight = config.Bind<int>("Spitter Director", "Selection Weight", 1, "Selection weight of Spitter.");
			Spitter.MinimumStageCompletion = config.Bind<int>("Spitter Director", "Minimum Stage Completion", 0, "Minimum stages players need to complete before monster starts spawning.");
			Spitter.DirectorCost = config.Bind<int>("Spitter Director", "Director Cost", 30, "Director cost of Spitter.");
			Spitter.BaseMaxHealth = config.Bind<float>("Spitter Character Stats", "Base Max Health", 300f, "Spitter's base health.");
			Spitter.BaseMoveSpeed = config.Bind<float>("Spitter Character Stats", "Base Movement Speed", 7f, "Spitter's base movement speed.");
			Spitter.BaseJumpPower = config.Bind<float>("Spitter Character Stats", "Base Jump Power", 20f, "Spitter's base jump power.");
			Spitter.BaseDamage = config.Bind<float>("Spitter Character Stats", "Base Damage", 20f, "Spitter's base damage.");
			Spitter.BaseArmor = config.Bind<float>("Spitter Character Stats", "Base Armor", 0f, "Spitter's base armor.");
			Spitter.LevelMaxHealth = config.Bind<float>("Spitter Character Stats", "Health per Level", 90f, "Spitter's health increase per level.");
			Spitter.LevelDamage = config.Bind<float>("Spitter Character Stats", "Damage per Level", 4f, "Spitter's damage increase per level.");
			Spitter.LevelArmor = config.Bind<float>("Spitter Character Stats", "Armor per Level", 0f, "Spitter's armor increase per level.");
			Spitter.BiteCooldown = config.Bind<float>("Spitter Bite", "Bite Cooldown", 2f, "Spitter's Bite cooldown.");
			Spitter.BiteDamageModifier = config.Bind<float>("Spitter Bite", "Bite Damage", 1.5f, "Spitter's Bite damage.");
			Spitter.BiteDamageForce = config.Bind<float>("Spitter Bite", "Bite Force", 200f, "Spitter's Bite force, by default equal to that of Lemurian.");
			Spitter.BiteRadius = config.Bind<float>("Spitter Bite", "Bite Radius", 0f, "Spitter's Bite radius.");
			Spitter.ChargedProjectileCooldown = config.Bind<float>("Spitter Charged Spit", "Charged Spit Cooldown", 6f, "Charged Spit Cooldown");
			Spitter.ChargedProjectileDamage = config.Bind<float>("Spitter Charged Spit", "Charged Spit Damage", 1.6f, "Spitter's Charged projectile damage.");
			Spitter.ChargedProjectileForce = config.Bind<float>("Spitter Charged Spit", "Charged Spit Force", 0f, "Spitter's Charged projectile force.");
			Spitter.ChargedProjectileFlyTime = config.Bind<float>("Spitter Charged Spit", "Charged Spit Fly Time", 0.75f, "Spitter's Charged Projectile fly time. The higher the value the bigger the arc and the slower the projectile will be. Don't set it too low otherwise projectile will fly pass targes and puddles will be somewhere in the back.");
			Spitter.ChargedProjectileLargeDoTZoneDamage = config.Bind<float>("Spitter Charged Spit", "Charged Spit Large DoT Zone Damage", 0.15f, "Spitter's Charged Large DoT zone damage off projectile's damage.");
			Spitter.ChargedProjectileLargeDoTZoneScale = config.Bind<float>("Spitter Charged Spit", "Charged Spit Large DoT Zone Size Scale", 0.55f, "Spitter's Charged Large DoT Zone size scale off Mini Mushrim's DoT zone (since it was used as basis). Also controls projectile's blast radius.");
			Spitter.ChargedProjectileSmallDoTZoneDamage = config.Bind<float>("Spitter Charged Spit", "Charged Spit Small DoT Zone Damage", 0.15f, "Spitter's Charged Large DoT zone damage off projectile's damage.");
			Spitter.ChargedProjectileSmallDoTZoneScale = config.Bind<float>("Spitter Charged Spit", "Charged Spit Small DoT Zone Scale", 0.3f, "Spitter's Charged Large DoT Zone scale off Mini Mushrim's DoT zone (since it was used as basis). Also controls projectile's blast radius.");
			Spitter.EmoteKey = config.Bind<KeyCode>("Emotes", "Dance Emote", (KeyCode)49, "Key used to Dance.");
			Colossus.SelectionWeight = config.Bind<int>("Colossus Director", "Selection Weight", 1, "Selection weight of Colossus.");
			Colossus.MinimumStageCompletion = config.Bind<int>("Colossus Director", "Minimum Stage Completion", 0, "Minimum stages players need to complete before monster starts spawning.");
			Colossus.DirectorCost = config.Bind<int>("Colossus Director", "Director Cost", 1000, "Director cost of Colossus.");
			Colossus.BaseMaxHealth = config.Bind<float>("Colossus Character Stats", "Base Max Health", 7000f, "Colossus' base health.");
			Colossus.BaseMoveSpeed = config.Bind<float>("Colossus Character Stats", "Base Movement Speed", 8f, "Colossus' base movement speed.");
			Colossus.BaseJumpPower = config.Bind<float>("Colossus Character Stats", "Base Jump Power", 10f, "Colossus' base jump power.");
			Colossus.BaseDamage = config.Bind<float>("Colossus Character Stats", "Base Damage", 40f, "Colossus' base damage.");
			Colossus.BaseArmor = config.Bind<float>("Colossus Character Stats", "Base Armor", 35f, "Colossus' base armor.");
			Colossus.LevelMaxHealth = config.Bind<float>("Colossus Character Stats", "Health per Level", 2100f, "Colossus' health increase per level.");
			Colossus.LevelDamage = config.Bind<float>("Colossus Character Stats", "Damage per Level", 8f, "Colossus' damage increase per level.");
			Colossus.LevelArmor = config.Bind<float>("Colossus Character Stats", "Armor per Level", 0f, "Colossus' armor increase per level.");
			Colossus.DestroyModelOnDeath = config.Bind<bool>("Colossus Model", "Destroy Model On Death", false, "Destroys model 5 seconds after Colossus' death. Use to remove a giant slab from the battlefield that might block stuff.");
			Colossus.FootstepShockwaveDistance = config.Bind<float>("Colossus Footstep Shockwave", "Shockwave Distance", 9f, "Colossus's footstep shockwave distance.");
			Colossus.FootstepShockwaveForce = config.Bind<float>("Colossus Footstep Shockwave", "Shockwave Force", 1800f, "Colossus's footstep shockwave force.");
			Colossus.StompCooldown = config.Bind<float>("Colossus Stomp", "Stomp Cooldown", 10f, "Colossus' Stomp cooldown.");
			Colossus.StompOverlapAttackDamage = config.Bind<float>("Colossus Stomp", "Stomp Overlap Damage", 2.5f, "Colossus' Stomp Overlap (aka stomp itself) damage.");
			Colossus.StompOverlapAttackForce = config.Bind<float>("Colossus Stomp", "Stomp Overlap Force", 6000f, "Colossus' Stomp Overlap (aka stomp itself) force.");
			Colossus.StompProjectileDamage = config.Bind<float>("Colossus Stomp", "Stomp Projectile Damage", 1.5f, "Colossus' Stomp Projectile damage.");
			Colossus.StompProjectileForce = config.Bind<float>("Colossus Stomp", "Stomp Projectile Force", -2500f, "Colossus' Stomp Projectile force. Default number is negative, that means it pulls towards Colossus.");
			Colossus.StompProjectileSpeed = config.Bind<float>("Colossus Stomp", "Stomp Projectile Speed", 60f, "Colossus' Stomp Projectile speed.");
			Colossus.StompProjectileCount = config.Bind<int>("Colossus Stomp", "Stomp Projectile Count", 16, "Colossus' Stomp Projectile count.");
			Colossus.StompProjectileScale = config.Bind<float>("Colossus Stomp", "Stomp Projectile Scale", 2f, "Colossus' Stomp Projectile scale.");
			Colossus.StompProjectileLifetime = config.Bind<float>("Colossus Stomp", "Stomp Projectile Lifetime", 2f, "Colossus' Stomp Projectile lifetime.");
			Colossus.RockClapCooldown = config.Bind<float>("Colossus Rock Clap", "Rock Clap Cooldown", 15f, "Colossus' Rock Clap cooldown.");
			Colossus.RockClapProjectileDamage = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Damage", 1.25f, "Colossus' Rock Clap projectile damage.");
			Colossus.RockClapProjectileForce = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Force", 3000f, "Colossus' Rock Clap projectile force.");
			Colossus.RockClapProjectileSpeed = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Speed", 50f, "Colossus' Rock Clap projectile speed.");
			Colossus.RockClapProjectileSpeedDelta = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Speed Delta", 5f, "Colossus' Rock Clap projectile speed delta (speed = Random(speed - delta, speed + delta)).");
			Colossus.RockClapProjectileBlastRadius = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Blast Radius", 5f, "Colossus' Rock Clap projectile blast radius.");
			Colossus.RockClapProjectileDistanceFraction = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Distance Fraction", 0.8f, "Basically determines angle at which rocks fly upwards. Uses colossus' position and rock initial position and takes a distance between them at this fraction.");
			Colossus.RockClapProjectileDistanceFractionDelta = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Distance Fraction Delta", 0.1f, "Projectile distance delta. See Projectile distance for explanation and see Speed delta for the formula.");
			Colossus.RockClapProjectileSpawnDistance = config.Bind<float>("Colossus Rock Clap", "Rock Clap Projectile Spawn Distance", 15f, "Colossus' Rock Clap projectile distance from body. Basically controls how far rocks spawn from the center of the body.");
			Colossus.RockClapProjectileCount = config.Bind<int>("Colossus Rock Clap", "Rock Clap Projectile Count", 20, "Colossus' Rock Clap projectile count.");
			Colossus.RockClapDamage = config.Bind<float>("Colossus Rock Clap", "Rock Clap Damage", 2.5f, "Colossus' Rock Clap damage.");
			Colossus.RockClapForce = config.Bind<float>("Colossus Rock Clap", "Rock Clap Force", 6000f, "Colossus' Rock Clap force.");
			Colossus.RockClapRadius = config.Bind<float>("Colossus Rock Clap", "Rock Clap Radius", 16f, "Colossus' Rock Clap radius.");
			Colossus.RockClapHomingSpeed = config.Bind<float>("Colossus Rock Clap", "Rock Clap Homing Speed", 15f, "Colossus' Rock Clap homing speed. Rocks home onto target by x and z axis (basically parallel to the ground, without homing up or down).");
			Colossus.RockClapHomingRange = config.Bind<float>("Colossus Rock Clap", "Rock Clap Homing Range", 100f, "Colossus' Rock Clap homing range. How far rocks look for a targer.");
			Colossus.LaserBarrageCooldown = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Cooldown", 45f, "Colossus' Laser Barrage cooldown.");
			Colossus.LaserBarrageDamage = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Damage", 0.5f, "Colossus' Laser Barrage damage.");
			Colossus.LaserBarrageDuration = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Duration", 5f, "Colossus' Laser Barrage duration.");
			Colossus.LaserBarrageProjectileSpeed = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Projectile Speed", 50f, "Colossus' Laser Barrage projectile speed.");
			Colossus.LaserBarrageFrequency = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Fire Frequency", 0.2f, "Colossus' Laser Barrage fire frequency.");
			Colossus.LaserBarrageSpread = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Spread", 0.15f, "Colossus' Laser Barrage spread. The lower the value, more tight each cluster of shots will be.");
			Colossus.LaserBarrageHeadPitch = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Head Pitch", 0.05f, "Colossus' Laser Barrage head pitch. 1 is all the way up, 0 is all the way down.");
			Colossus.LaserBarrageForce = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Force", 0f, "Colossus' Laser Barrage force.");
			Colossus.LaserBarrageProjectileCount = config.Bind<int>("Colossus Laser Barrage", "Laser Barrage Projectiles per Shot", 8, "Colossus' Laser Barrage projectiles per shot count.");
			Colossus.LaserBarrageExplosionRadius = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Explosion Radius", 10f, "Colossus' Laser Barrage explosion radius.");
			Colossus.LaserBarrageExplosionDamage = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Explosion Damage", 1.25f, "Colossus' Laser Barrage explosion damage, fraction of projectile damage.");
			Colossus.LaserBarrageExplosionDelay = config.Bind<float>("Colossus Laser Barrage", "Laser Barrage Explosion Delay", 0.5f, "Colossus' Laser Barrage explosion delay after hitting the ground.");
			Colossus.KnurlDamage = config.Bind<float>("Colossal Fist", "Colossal Fist Damage", 5f, "Colossal Fist' damage");
			Colossus.KnurlDamagePerStack = config.Bind<float>("Colossal Fist", "Colossal Fist Damage Per Stack", 5f, "Colossal Fist' damage per stack");
			Colossus.KnurlProcCoefficient = config.Bind<float>("Colossal Fist", "Colossal Fist Proc Coefficient", 0f, "Colossal Fist proc coefficient.");
			Colossus.KnurlProcChance = config.Bind<float>("Colossal Fist", "Colossal Fist Proc Chance", 8f, "Colossal Fist proc chance.");
			Colossus.KnurlForce = config.Bind<float>("Colossal Fist", "Colossal Fist Force", 0f, "Colossal Fist force.");
			Colossus.EmoteKey = config.Bind<KeyCode>("Emotes", "Dance Emote", (KeyCode)49, "Key used to Dance.");
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Viliger.EnemiesReturns", "EnemiesReturns", "0.1.13")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class EnemiesReturnsPlugin : BaseUnityPlugin
	{
		public const string Author = "Viliger";

		public const string ModName = "EnemiesReturns";

		public const string Version = "0.1.13";

		public const string GUID = "com.Viliger.EnemiesReturns";

		private void Awake()
		{
			//IL_004a: 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_005b: Expected O, but got Unknown
			ConfigEntry<bool> obj = ((BaseUnityPlugin)this).Config.Bind<bool>("Config", "Use Config File", false, "Use config file for storring config. Due to mod being currently unfinished and unbalanced, we deploy rapid changes to values. So this way we can still have configs, but without the issue of people having those values saved.");
			Log.Init(((BaseUnityPlugin)this).Logger);
			if (obj.Value)
			{
				EnemiesReturnsConfiguration.PopulateConfig(((BaseUnityPlugin)this).Config);
			}
			else
			{
				EnemiesReturnsConfiguration.PopulateConfig(new ConfigFile(Path.Combine(Paths.ConfigPath, "Config"), false)
				{
					SaveOnConfigSet = false
				});
			}
			Hooks();
		}

		private void Hooks()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders);
			Language.collectLanguageRootFolders += CollectLanguageRootFolders;
			Language.onCurrentLanguageChanged += Language.Language_onCurrentLanguageChanged;
			GlobalEventManager.onServerDamageDealt += GlobalEventManager_onServerDamageDealt;
			ColossalKnurlFactory.Hooks();
		}

		private void GlobalEventManager_onServerDamageDealt(DamageReport obj)
		{
			DamageInfo damageInfo = obj.damageInfo;
			GameObject gameObject = ((Component)obj.victim).gameObject;
			CharacterBody val = default(CharacterBody);
			if (Object.op_Implicit((Object)(object)damageInfo.attacker) && damageInfo.attacker.TryGetComponent<CharacterBody>(ref val) && Object.op_Implicit((Object)(object)val.master))
			{
				ColossalKnurlFactory.OnHitEnemy(damageInfo, val, gameObject);
			}
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCSpawnTitans(ConCommandArgs args)
		{
			//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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_007c: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: 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_00ca: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody cachedBody = LocalUserManager.readOnlyLocalUsersList[0].cachedBody;
			SpawnMonster(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Titan/cscTitanBlackBeach.asset").WaitForCompletion(), cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Titan/cscTitanDampCave.asset").WaitForCompletion(), cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Titan/cscTitanGolemPlains.asset").WaitForCompletion(), cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Titan/cscTitanGooLake.asset").WaitForCompletion(), cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(Addressables.LoadAssetAsync<CharacterSpawnCard>((object)"RoR2/Base/Titan/cscTitanGold.asset").WaitForCompletion(), cachedBody.modelLocator.modelBaseTransform.position);
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCSpawnSpitters(ConCommandArgs args)
		{
			//IL_0021: 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_0055: 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)
			CharacterBody cachedBody = LocalUserManager.readOnlyLocalUsersList[0].cachedBody;
			SpawnMonster(SpitterFactory.SpawnCards.cscSpitterDefault, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(SpitterFactory.SpawnCards.cscSpitterLakes, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(SpitterFactory.SpawnCards.cscSpitterDepths, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(SpitterFactory.SpawnCards.cscSpitterLakes, cachedBody.modelLocator.modelBaseTransform.position);
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCSpawnColossi(ConCommandArgs args)
		{
			//IL_0021: 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_0055: 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_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			CharacterBody cachedBody = LocalUserManager.readOnlyLocalUsersList[0].cachedBody;
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusDefault, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusGrassy, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusSnowy, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusSandy, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusSkyMeadow, cachedBody.modelLocator.modelBaseTransform.position);
			SpawnMonster(ColossusFactory.SpawnCards.cscColossusCastle, cachedBody.modelLocator.modelBaseTransform.position);
		}

		private static void SpawnMonster(CharacterSpawnCard card, Vector3 position)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//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)
			//IL_001e: Expected O, but got Unknown
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Expected O, but got Unknown
			DirectorSpawnRequest val = new DirectorSpawnRequest((SpawnCard)(object)card, new DirectorPlacementRule
			{
				placementMode = (PlacementMode)3,
				position = position
			}, RoR2Application.rng);
			val.teamIndexOverride = (TeamIndex)2;
			val.ignoreTeamMemberLimit = true;
			DirectorCore.instance.TrySpawnObject(val);
		}

		[ConCommand(/*Could not decode attribute arguments.*/)]
		private static void CCBodyGeneratePortraits(ConCommandArgs args)
		{
			((MonoBehaviour)RoR2Application.instance).StartCoroutine(GeneratePortraits(((ConCommandArgs)(ref args)).TryGetArgBool(0).GetValueOrDefault()));
		}

		private static IEnumerator GeneratePortraits(bool forceRegeneration)
		{
			Debug.Log((object)"Starting portrait generation.");
			ModelPanel modelPanel = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/UI/IconGenerator")).GetComponentInChildren<ModelPanel>();
			modelPanel.renderSettings = new RenderSettingsState
			{
				ambientIntensity = 1f,
				ambientLight = Color.white,
				ambientMode = (AmbientMode)3,
				ambientGroundColor = Color.white
			};
			yield return (object)new WaitForEndOfFrame();
			yield return GeneratePortrait(modelPanel, SpitterFactory.SpitterBody);
			yield return GeneratePortrait(modelPanel, ColossusFactory.ColossusBody);
			yield return GeneratePortrait(modelPanel, Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Lemurian/LemurianBody.prefab").WaitForCompletion());
			Object.Destroy((Object)(object)((Component)((Component)modelPanel).transform.root).gameObject);
			Debug.Log((object)"Portrait generation complete.");
		}

		private static IEnumerator GeneratePortrait(ModelPanel modelPanel, GameObject gameObject)
		{
			if (!Object.op_Implicit((Object)(object)gameObject.GetComponent<CharacterBody>()))
			{
				yield break;
			}
			float num = 1f;
			try
			{
				Debug.LogFormat("Generating portrait for {0}", new object[1] { ((Object)gameObject).name });
				ModelPanel obj = modelPanel;
				ModelLocator component = gameObject.GetComponent<ModelLocator>();
				obj.modelPrefab = ((component != null) ? ((Component)component.modelTransform).gameObject : null);
				modelPanel.SetAnglesForCharacterThumbnail(true);
				GameObject modelPrefab = modelPanel.modelPrefab;
				PrintController val;
				if ((val = ((modelPrefab != null) ? modelPrefab.GetComponentInChildren<PrintController>() : null)) != null)
				{
					num = Mathf.Max(num, val.printTime + 1f);
				}
				GameObject modelPrefab2 = modelPanel.modelPrefab;
				TemporaryOverlay val2;
				if ((val2 = ((modelPrefab2 != null) ? modelPrefab2.GetComponentInChildren<TemporaryOverlay>() : null)) != null)
				{
					num = Mathf.Max(num, val2.duration + 1f);
				}
			}
			catch (Exception ex)
			{
				Debug.Log((object)ex);
			}
			RoR2Application.onLateUpdate += UpdateCamera;
			yield return (object)new WaitForSeconds(num);
			modelPanel.SetAnglesForCharacterThumbnail(true);
			yield return (object)new WaitForEndOfFrame();
			yield return (object)new WaitForEndOfFrame();
			try
			{
				Texture2D val3 = new Texture2D(((Texture)modelPanel.renderTexture).width, ((Texture)modelPanel.renderTexture).height, (TextureFormat)5, false, false);
				RenderTexture active = RenderTexture.active;
				RenderTexture.active = modelPanel.renderTexture;
				val3.ReadPixels(new Rect(0f, 0f, (float)((Texture)modelPanel.renderTexture).width, (float)((Texture)modelPanel.renderTexture).height), 0, 0, false);
				RenderTexture.active = active;
				byte[] array = ImageConversion.EncodeToPNG(val3);
				FileStream fileStream = new FileStream("Assets/RoR2/GeneratedPortraits/" + ((Object)gameObject).name + ".png", FileMode.Create, FileAccess.Write);
				fileStream.Write(array, 0, array.Length);
				fileStream.Close();
			}
			catch (Exception ex2)
			{
				Debug.Log((object)ex2);
			}
			RoR2Application.onLateUpdate -= UpdateCamera;
			yield return (object)new WaitForEndOfFrame();
			void UpdateCamera()
			{
				modelPanel.SetAnglesForCharacterThumbnail(true);
			}
		}

		private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider)
		{
			addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentProvider());
		}

		private void CollectLanguageRootFolders(List<string> folders)
		{
			folders.Add(Path.Combine(Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location), "Language"));
		}
	}
	public class Language
	{
		public const string LanguageFolder = "Language";

		public static event Action<Language, List<KeyValuePair<string, string>>> onCurrentLangaugeChanged;

		public static void Language_onCurrentLanguageChanged()
		{
			Language currentLanguage = Language.currentLanguage;
			string text = Path.Combine(Path.GetDirectoryName(typeof(EnemiesReturnsPlugin).Assembly.Location), "Language", Language.currentLanguageName);
			if (Directory.Exists(text))
			{
				List<KeyValuePair<string, string>> list = new List<KeyValuePair<string, string>>();
				Language.LoadAllTokensFromFolder(text, list);
				Language.onCurrentLangaugeChanged?.Invoke(currentLanguage, list);
			}
		}
	}
	internal static class Log
	{
		private static ManualLogSource _logSource;

		internal static void Init(ManualLogSource logSource)
		{
			_logSource = logSource;
		}

		internal static void Debug(object data)
		{
			_logSource.LogDebug(data);
		}

		internal static void Error(object data)
		{
			_logSource.LogError(data);
		}

		internal static void Fatal(object data)
		{
			_logSource.LogFatal(data);
		}

		internal static void Info(object data)
		{
			_logSource.LogInfo(data);
		}

		internal static void Message(object data)
		{
			_logSource.LogMessage(data);
		}

		internal static void Warning(object data)
		{
			_logSource.LogWarning(data);
		}
	}
	public static class MissingAnimationParameters
	{
		public static readonly int aimYawCycle = Animator.StringToHash("aimYawCycle");

		public static readonly int aimPitchCycle = Animator.StringToHash("aimPitchCycle");
	}
	public static class Utils
	{
		public class RenderInfo
		{
			public Material material;

			public SkinnedMeshRenderer renderer;

			public bool ignoreOverlays;
		}

		public static SkinDef CreateSkinDef(string name, GameObject model, RenderInfo[] renderInfo, SkinDef baseSkin = null, GameObject[] gameObjectActivations = null)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			SkinDef val = Object.Instantiate<SkinDef>(Addressables.LoadAssetAsync<SkinDef>((object)"RoR2/Base/Beetle/skinBeetleDefault.asset").WaitForCompletion());
			((Object)val).name = name;
			val.baseSkins = Array.Empty<SkinDef>();
			val.icon = null;
			val.nameToken = "";
			val.unlockableDef = null;
			val.rootObject = null;
			val.rendererInfos = Array.Empty<RendererInfo>();
			val.gameObjectActivations = Array.Empty<GameObjectActivation>();
			val.meshReplacements = Array.Empty<MeshReplacement>();
			val.projectileGhostReplacements = Array.Empty<ProjectileGhostReplacement>();
			val.minionSkinReplacements = Array.Empty<MinionSkinReplacement>();
			val.runtimeSkin = null;
			val.skinIndex = (SkinIndex)(-1);
			if (Object.op_Implicit((Object)(object)baseSkin))
			{
				val.baseSkins = (SkinDef[])(object)new SkinDef[1] { baseSkin };
			}
			val.rootObject = model;
			val.rendererInfos = Array.ConvertAll(renderInfo, delegate(RenderInfo item)
			{
				//IL_0002: 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_003f: Unknown result type (might be due to invalid IL or missing references)
				RendererInfo result2 = default(RendererInfo);
				result2.renderer = (Renderer)(object)item.renderer;
				result2.defaultMaterial = item.material;
				result2.defaultShadowCastingMode = (ShadowCastingMode)1;
				result2.ignoreOverlays = item.ignoreOverlays;
				result2.hideOnDeath = false;
				return result2;
			});
			if (gameObjectActivations != null)
			{
				val.gameObjectActivations = Array.ConvertAll(gameObjectActivations, delegate(GameObject item)
				{
					//IL_0002: 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)
					GameObjectActivation result = default(GameObjectActivation);
					result.gameObject = item;
					result.shouldActivate = true;
					return result;
				});
			}
			val.Bake();
			return val;
		}

		public static SkillFamily CreateSkillFamily(string name, params SkillDef[] skills)
		{
			SkillFamily obj = ScriptableObject.CreateInstance<SkillFamily>();
			((Object)obj).name = name;
			obj.variants = Array.ConvertAll(skills, delegate(SkillDef item)
			{
				//IL_0002: 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)
				//IL_002c: Expected O, but got Unknown
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				Variant result = default(Variant);
				result.skillDef = item;
				result.unlockableDef = null;
				((Variant)(ref result)).viewableNode = new Node(item.skillNameToken, false, (Node)null);
				return result;
			});
			obj.defaultVariantIndex = 0u;
			return obj;
		}

		public static UnlockableDef CreateUnlockableDef(string name, string nameToken)
		{
			UnlockableDef obj = ScriptableObject.CreateInstance<UnlockableDef>();
			((Object)obj).name = name;
			obj.cachedName = name;
			obj.nameToken = nameToken;
			return obj;
		}

		public static int FindCategoryIndexByName(DirectorCardCategorySelection dcs, string categoryName)
		{
			if ((Object)(object)dcs == (Object)null)
			{
				return -1;
			}
			for (int i = 0; i < dcs.categories.Length; i++)
			{
				if (string.CompareOrdinal(dcs.categories[i].name, categoryName) == 0)
				{
					return i;
				}
			}
			return -1;
		}
	}
}
namespace EnemiesReturns.Projectiles
{
	public class ProjectileEnableHomingAfterTargetAquired : MonoBehaviour
	{
		public bool changeSpeedAfterTargetFound;

		public float newSpeed;

		private ProjectileSimple projectileSimple;

		private ProjectileSphereTargetFinder sphereTargetFinder;

		private void Start()
		{
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			if (!NetworkServer.active)
			{
				((Behaviour)this).enabled = false;
				return;
			}
			projectileSimple = ((Component)this).GetComponent<ProjectileSimple>();
			sphereTargetFinder = ((Component)this).GetComponent<ProjectileSphereTargetFinder>();
			if (Object.op_Implicit((Object)(object)sphereTargetFinder))
			{
				if (sphereTargetFinder.onNewTargetFound == null)
				{
					sphereTargetFinder.onNewTargetFound = new UnityEvent();
				}
				sphereTargetFinder.onNewTargetFound.AddListener(new UnityAction(OnTargetFoundChangeSpeed));
			}
		}

		private void OnTargetFoundChangeSpeed()
		{
			if (Object.op_Implicit((Object)(object)projectileSimple))
			{
				projectileSimple.updateAfterFiring = true;
				if (changeSpeedAfterTargetFound)
				{
					projectileSimple.desiredForwardSpeed = newSpeed;
				}
			}
		}
	}
	[RequireComponent(typeof(ProjectileController))]
	public class ProjectileImpactExplosionWithChildrenArray : MonoBehaviour, IProjectileImpactBehavior
	{
		protected ProjectileController projectileController;

		protected ProjectileDamage projectileDamage;

		protected bool alive = true;

		[Header("Main Properties")]
		public FalloffModel falloffModel = (FalloffModel)1;

		public float blastRadius;

		[Tooltip("The percentage of the damage, proc coefficient, and force of the initial projectile. Ranges from 0-1")]
		public float blastDamageCoefficient;

		public float blastProcCoefficient = 1f;

		public AttackerFiltering blastAttackerFiltering;

		public Vector3 bonusBlastForce;

		public bool canRejectForce = true;

		public HealthComponent projectileHealthComponent;

		public GameObject explosionEffect;

		[Tooltip("Does this projectile release children on death?")]
		[Header("Child Properties")]
		public bool fireChildren;

		public GameObject childrenProjectilePrefab;

		public int childrenCount;

		[Tooltip("What percentage of our damage does the children get?")]
		public float childrenDamageCoefficient;

		public float childredMinRollDegrees;

		public float childrenRangeRollDegrees;

		public float childrenMinPitchDegrees;

		public float childrenRangePitchDegrees;

		[Tooltip("If true, applies a DoT given the following properties")]
		[Header("DoT Properties")]
		public bool applyDot;

		public DotIndex dotIndex = (DotIndex)(-1);

		[Tooltip("Duration in seconds of the DoT.  Unused if calculateTotalDamage is true.")]
		public float dotDuration;

		[Tooltip("Multiplier on the per-tick damage")]
		public float dotDamageMultiplier = 1f;

		[Tooltip("If true, we cap the numer of DoT stacks for this attacker.")]
		public bool applyMaxStacksFromAttacker;

		[Tooltip("The maximum number of stacks that we can apply for this attacker")]
		public uint maxStacksFromAttacker = uint.MaxValue;

		[Tooltip("If true, we disregard the duration and instead specify the total damage.")]
		public bool calculateTotalDamage;

		[Tooltip("totalDamage = totalDamageMultiplier * attacker's damage")]
		public float totalDamageMultiplier;

		private Vector3 impactNormal = Vector3.up;

		public bool fireDoTZone;

		public GameObject dotZoneProjectilePrefab;

		public float dotZoneDamageCoefficient;

		public float dotZoneMinRollDegrees;

		public float dotZoneRangeRollDegrees;

		public float dotZoneMinPitchDegrees;

		public float dotZoneRangePitchDegrees;

		[Header("Impact & Lifetime Properties")]
		public GameObject impactEffect;

		public NetworkSoundEventDef lifetimeExpiredSound;

		public float offsetForLifetimeExpiredSound;

		public bool destroyOnEnemy = true;

		public bool destroyOnWorld;

		public bool impactOnWorld = true;

		public bool timerAfterImpact;

		public float lifetime;

		public float lifetimeAfterImpact;

		public float lifetimeRandomOffset;

		private float stopwatch;

		private float stopwatchAfterImpact;

		private bool hasImpact;

		private bool hasPlayedLifetimeExpiredSound;

		public TransformSpace transformSpace;

		protected void Awake()
		{
			projectileController = ((Component)this).GetComponent<ProjectileController>();
			projectileDamage = ((Component)this).GetComponent<ProjectileDamage>();
			lifetime += Random.Range(0f, lifetimeRandomOffset);
		}

		public void FixedUpdate()
		{
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			stopwatch += Time.fixedDeltaTime;
			if (!NetworkServer.active && !projectileController.isPrediction)
			{
				return;
			}
			if (timerAfterImpact && hasImpact)
			{
				stopwatchAfterImpact += Time.fixedDeltaTime;
			}
			bool num = stopwatch >= lifetime;
			bool flag = timerAfterImpact && stopwatchAfterImpact > lifetimeAfterImpact;
			bool flag2 = Object.op_Implicit((Object)(object)projectileHealthComponent) && !projectileHealthComponent.alive;
			if (num || flag || flag2)
			{
				alive = false;
			}
			if (alive && !hasPlayedLifetimeExpiredSound)
			{
				bool flag3 = stopwatch > lifetime - offsetForLifetimeExpiredSound;
				if (timerAfterImpact)
				{
					flag3 |= stopwatchAfterImpact > lifetimeAfterImpact - offsetForLifetimeExpiredSound;
				}
				if (flag3)
				{
					hasPlayedLifetimeExpiredSound = true;
					if (NetworkServer.active && Object.op_Implicit((Object)(object)lifetimeExpiredSound))
					{
						PointSoundManager.EmitSoundServer(lifetimeExpiredSound.index, ((Component)this).transform.position);
					}
				}
			}
			if (!alive)
			{
				explosionEffect = impactEffect ?? explosionEffect;
				Detonate();
			}
		}

		public void Detonate()
		{
			if (NetworkServer.active)
			{
				DetonateServer();
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		protected void DetonateServer()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0058: 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_00e1: 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_0103: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: 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_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_017d: 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)
			if (Object.op_Implicit((Object)(object)explosionEffect))
			{
				EffectManager.SpawnEffect(explosionEffect, new EffectData
				{
					origin = ((Component)this).transform.position,
					scale = blastRadius
				}, true);
			}
			if (Object.op_Implicit((Object)(object)projectileDamage))
			{
				BlastAttack val = new BlastAttack();
				val.position = ((Component)this).transform.position;
				val.baseDamage = projectileDamage.damage * blastDamageCoefficient;
				val.baseForce = projectileDamage.force * blastDamageCoefficient;
				val.radius = blastRadius;
				val.attacker = (Object.op_Implicit((Object)(object)projectileController.owner) ? projectileController.owner.gameObject : null);
				val.inflictor = ((Component)this).gameObject;
				val.teamIndex = projectileController.teamFilter.teamIndex;
				val.crit = projectileDamage.crit;
				val.procChainMask = projectileController.procChainMask;
				val.procCoefficient = projectileController.procCoefficient * blastProcCoefficient;
				val.bonusForce = bonusBlastForce;
				val.falloffModel = falloffModel;
				val.damageColorIndex = projectileDamage.damageColorIndex;
				val.damageType = projectileDamage.damageType;
				val.attackerFiltering = blastAttackerFiltering;
				val.canRejectForce = canRejectForce;
				Result result = val.Fire();
				OnBlastAttackResult(val, result);
			}
			if (fireChildren)
			{
				FireChild();
			}
			if (fireDoTZone)
			{
				FireDoTZone();
			}
		}

		protected Quaternion GetRandomChildRollPitch()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			Quaternion val = Quaternion.AngleAxis(childredMinRollDegrees + Random.Range(0f, childrenRangeRollDegrees), Vector3.forward);
			Quaternion val2 = Quaternion.AngleAxis(childrenMinPitchDegrees + Random.Range(0f, childrenRangePitchDegrees), Vector3.left);
			return val * val2;
		}

		protected virtual Quaternion GetRandomDirectionForChild()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references