Decompiled source of MirrorAndTrueArtifacts v1.0.2

TrueArtifacts.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using EntityStates.LunarExploderMonster;
using EntityStates.VoidInfestor;
using HG;
using IL.RoR2;
using JetBrains.Annotations;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using On.EntityStates.VoidInfestor;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Utils;
using RoR2;
using RoR2.Artifacts;
using RoR2.CharacterAI;
using RoR2.ExpansionManagement;
using RoR2.Networking;
using RoR2.Projectile;
using RoR2.UI;
using TrueArtifacts.Aritfacts;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("TrueArtifacts")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+7722000add62401380a3c4ff09dcc3267a784449")]
[assembly: AssemblyProduct("TrueArtifacts")]
[assembly: AssemblyTitle("TrueArtifacts")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TrueArtifacts
{
	internal static class Assets
	{
		public static AssetBundle Bundle;

		public static PluginInfo PluginInfo;

		public static string Folder = "TrueArtifacts\\";

		internal static string assemblyDir => Path.GetDirectoryName(PluginInfo.Location);

		internal static void Init(PluginInfo info)
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			PluginInfo = info;
			if (!Directory.Exists(GetPathToFile(Folder)))
			{
				Folder = "";
			}
			if (Directory.Exists(GetPathToFile(Folder + "Languages")))
			{
				Language.SetFolders += new hook_SetFolders(SetFolders);
			}
			else
			{
				Debug.LogWarning((object)"COULD NOT FIND LANGUAGES FOLDER");
			}
			if (Directory.Exists(GetPathToFile(Folder + "AssetBundles")))
			{
				Bundle = AssetBundle.LoadFromFile(GetPathToFile(Folder + "AssetBundles", "true_artifacts"));
			}
			else
			{
				Debug.LogWarning((object)"COULD NOT FIND ASSETBUNDLES FOLDER");
			}
		}

		private static void SetFolders(orig_SetFolders orig, Language self, IEnumerable<string> newFolders)
		{
			IEnumerable<string> second = Directory.EnumerateDirectories(Path.Combine(GetPathToFile(Folder + "Languages")), self.name);
			orig.Invoke(self, newFolders.Union(second));
		}

		internal static string GetPathToFile(string folderName)
		{
			return Path.Combine(assemblyDir, folderName);
		}

		internal static string GetPathToFile(string folderName, string fileName)
		{
			return Path.Combine(assemblyDir, folderName, fileName);
		}
	}
	public class WConfig
	{
		public static ConfigEntry<bool> EnableMirrorArtifacts;

		public static ConfigEntry<bool> EnableTrueArtifacts;

		public static ConfigEntry<bool> MirrorKinDisplay;

		public static ConfigEntry<bool> MirrirSwarmsInfestor;

		public static ConfigEntry<bool> TrueDissoEliteStuff;

		public static ConfigEntry<bool> TrueEvoExtraTags;

		public static ConfigEntry<float> MirrorEnigmaChance;

		public static ConfigEntry<bool> SortAtEnd;

		public static ConfigEntry<bool> DebugPrint;

		internal static void InitConfig()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			ConfigFile val = new ConfigFile(Paths.ConfigPath + "\\Wolfo.True_Artifacts.cfg", true);
			MirrorKinDisplay = val.Bind<bool>("Mirror", "Mirror Kin Enemy Display", true, "Regular Kin does so seemed fitting to do it here too.");
			MirrorEnigmaChance = val.Bind<float>("Mirror", "Mirror Enigma Chance", 10f, "Chance to replace items and equipment with a random one.");
			SortAtEnd = val.Bind<bool>("Main", "Sort Artifacts to end of list", true, "If you don't like or mind the color mish mash");
			TrueEvoExtraTags = val.Bind<bool>("True", "True Evolution Extra Blacklist", false, "Blacklist OnKill items, which rarely come into play but may make minions and drones a detrimen. And BrotherBlacklist items such as Tougher Times and SaferSpaces");
			DebugPrint = val.Bind<bool>("Other", "Enable Debug Info", false, "If you do not need this better to leave it off");
			RiskConfig();
		}

		public static void RiskConfig()
		{
		}
	}
	public static class ArrayUtil
	{
		public static T[] Add<T>(this T[] array, params T[] items)
		{
			return (array ?? Enumerable.Empty<T>()).Concat(items).ToArray();
		}

		public static T[] Remove<T>(this T[] array, params T[] items)
		{
			return (array ?? Enumerable.Empty<T>()).Except(items).ToArray();
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("Wolfo.TrueArtifacts", "TrueArtifacts", "1.0.0")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	public class Main : BaseUnityPlugin
	{
		public static ArtifactDef Mirror_Kin = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Glass = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Swarms = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Sacrifice = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Honor = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Frailty = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Enigma = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef Mirror_Spite = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef True_Command = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef True_Dissonance = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef True_Swarms = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef True_Frailty = ScriptableObject.CreateInstance<ArtifactDef>();

		public static ArtifactDef True_Evolution = ScriptableObject.CreateInstance<ArtifactDef>();

		public void Awake()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			Assets.Init(((BaseUnityPlugin)this).Info);
			WConfig.InitConfig();
			CreateArtifacts();
			RunArtifactManager.onArtifactEnabledGlobal += new ArtifactStateChangeDelegate(Artifact_Enabled);
			RunArtifactManager.onArtifactDisabledGlobal += new ArtifactStateChangeDelegate(Artifact_Disable);
			TrueCommand.Start();
			TrueEvolution.Start();
			MirrorSacrifice.Start();
			MirrorSwarms.Start();
			MirrorEnigma.Start();
			((ResourceAvailability)(ref ArtifactCatalog.availability)).CallWhenAvailable((Action)CallLate);
			ChatMessageBase.chatMessageTypeToIndex.Add(typeof(SendMirrorKinTracker), (byte)ChatMessageBase.chatMessageIndexToType.Count);
			ChatMessageBase.chatMessageIndexToType.Add(typeof(SendMirrorKinTracker));
			ChatMessageBase.chatMessageTypeToIndex.Add(typeof(MirrorSwarms.SendMirrorSwarms), (byte)ChatMessageBase.chatMessageIndexToType.Count);
			ChatMessageBase.chatMessageIndexToType.Add(typeof(MirrorSwarms.SendMirrorSwarms));
		}

		public static void CallLate()
		{
			MirrorKin.MakeDCCSPool();
			Mirror_Kin.unlockableDef = Artifacts.Swarms.unlockableDef;
			Mirror_Kin.pickupModelPrefab = Artifacts.Swarms.pickupModelPrefab;
			Mirror_Glass.unlockableDef = Artifacts.Glass.unlockableDef;
			Mirror_Glass.pickupModelPrefab = Artifacts.Glass.pickupModelPrefab;
			Mirror_Swarms.unlockableDef = Artifacts.Swarms.unlockableDef;
			Mirror_Swarms.pickupModelPrefab = Artifacts.Swarms.pickupModelPrefab;
			Mirror_Sacrifice.unlockableDef = Artifacts.Sacrifice.unlockableDef;
			Mirror_Sacrifice.pickupModelPrefab = Artifacts.Sacrifice.pickupModelPrefab;
			Mirror_Honor.unlockableDef = Artifacts.EliteOnly.unlockableDef;
			Mirror_Honor.pickupModelPrefab = Artifacts.EliteOnly.pickupModelPrefab;
			Mirror_Frailty.unlockableDef = Artifacts.EliteOnly.unlockableDef;
			Mirror_Frailty.pickupModelPrefab = Artifacts.EliteOnly.pickupModelPrefab;
			Mirror_Enigma.unlockableDef = Artifacts.Enigma.unlockableDef;
			Mirror_Enigma.pickupModelPrefab = Artifacts.Enigma.pickupModelPrefab;
			True_Command.unlockableDef = Artifacts.Command.unlockableDef;
			True_Command.pickupModelPrefab = Artifacts.Command.pickupModelPrefab;
			True_Dissonance.unlockableDef = Artifacts.MixEnemy.unlockableDef;
			True_Dissonance.pickupModelPrefab = Artifacts.MixEnemy.pickupModelPrefab;
			True_Dissonance.unlockableDef = Artifacts.MixEnemy.unlockableDef;
			True_Dissonance.pickupModelPrefab = Artifacts.MixEnemy.pickupModelPrefab;
			True_Swarms.unlockableDef = Artifacts.Swarms.unlockableDef;
			True_Swarms.pickupModelPrefab = Artifacts.Swarms.pickupModelPrefab;
			True_Frailty.unlockableDef = Artifacts.WeakAssKnees.unlockableDef;
			True_Frailty.pickupModelPrefab = Artifacts.WeakAssKnees.pickupModelPrefab;
			True_Evolution.unlockableDef = Artifacts.MonsterTeamGainsItems.unlockableDef;
			True_Evolution.pickupModelPrefab = Artifacts.MonsterTeamGainsItems.pickupModelPrefab;
		}

		public static void CreateArtifacts()
		{
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_0357: Unknown result type (might be due to invalid IL or missing references)
			//IL_0358: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_046f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0483: 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_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_051d: Unknown result type (might be due to invalid IL or missing references)
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_063f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0640: Unknown result type (might be due to invalid IL or missing references)
			//IL_0653: Unknown result type (might be due to invalid IL or missing references)
			//IL_0654: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06db: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0775: Unknown result type (might be due to invalid IL or missing references)
			//IL_0776: Unknown result type (might be due to invalid IL or missing references)
			//IL_0789: Unknown result type (might be due to invalid IL or missing references)
			//IL_078a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0810: Unknown result type (might be due to invalid IL or missing references)
			//IL_0811: Unknown result type (might be due to invalid IL or missing references)
			//IL_0824: Unknown result type (might be due to invalid IL or missing references)
			//IL_0825: Unknown result type (might be due to invalid IL or missing references)
			string text = "";
			string text2 = "";
			string text3 = "";
			if (WConfig.SortAtEnd.Value)
			{
				text3 = "ZZTM_";
				text2 = "ZZT_";
				text = "ZZM_";
			}
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(0f, 0f, 64f, 64f);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0f, 0f);
			Texture2D val3 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Kin_On.png");
			Texture2D val4 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Kin_Off.png");
			((Texture)val3).filterMode = (FilterMode)2;
			((Texture)val4).filterMode = (FilterMode)2;
			Mirror_Kin.cachedName = text + "SingleMonsterTypeMirrorKin";
			Mirror_Kin.nameToken = "ARTIFACT_MIRROR_KIN_NAME";
			Mirror_Kin.descriptionToken = "ARTIFACT_MIRROR_KIN_DESC";
			Mirror_Kin.smallIconSelectedSprite = Sprite.Create(val3, val, val2);
			Mirror_Kin.smallIconDeselectedSprite = Sprite.Create(val4, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Kin);
			Texture2D val5 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Glass_On.png");
			Texture2D val6 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Glass_Off.png");
			((Texture)val5).filterMode = (FilterMode)2;
			((Texture)val6).filterMode = (FilterMode)2;
			Mirror_Glass.cachedName = text + "GlassMirrorGlass";
			Mirror_Glass.nameToken = "ARTIFACT_MIRROR_GLASS_NAME";
			Mirror_Glass.descriptionToken = "ARTIFACT_MIRROR_GLASS_DESC";
			Mirror_Glass.smallIconSelectedSprite = Sprite.Create(val5, val, val2);
			Mirror_Glass.smallIconDeselectedSprite = Sprite.Create(val6, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Glass);
			Texture2D val7 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Command_On.png");
			Texture2D val8 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Command_Off.png");
			((Texture)val7).filterMode = (FilterMode)2;
			((Texture)val8).filterMode = (FilterMode)2;
			True_Command.cachedName = text2 + "CommandTrueCommand";
			True_Command.nameToken = "ARTIFACT_TRUE_COMMAND_NAME";
			True_Command.descriptionToken = "ARTIFACT_TRUE_COMMAND_DESC";
			True_Command.smallIconSelectedSprite = Sprite.Create(val7, val, val2);
			True_Command.smallIconDeselectedSprite = Sprite.Create(val8, val, val2);
			ContentAddition.AddArtifactDef(True_Command);
			Texture2D val9 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Dissonance_On.png");
			Texture2D val10 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Dissonance_Off.png");
			((Texture)val9).filterMode = (FilterMode)2;
			((Texture)val10).filterMode = (FilterMode)2;
			True_Dissonance.cachedName = text2 + "MixEnemyTrueDissonance";
			True_Dissonance.nameToken = "ARTIFACT_TRUE_DISSONANCE_NAME";
			True_Dissonance.descriptionToken = "ARTIFACT_TRUE_DISSONANCE_DESC";
			True_Dissonance.smallIconSelectedSprite = Sprite.Create(val9, val, val2);
			True_Dissonance.smallIconDeselectedSprite = Sprite.Create(val10, val, val2);
			ContentAddition.AddArtifactDef(True_Dissonance);
			Texture2D val11 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Swarms_On.png");
			Texture2D val12 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Swarms_Off.png");
			((Texture)val11).filterMode = (FilterMode)2;
			((Texture)val12).filterMode = (FilterMode)2;
			True_Swarms.cachedName = text2 + "SwarmsTrueSwarms";
			True_Swarms.nameToken = "ARTIFACT_TRUE_SWARMS_NAME";
			True_Swarms.descriptionToken = "ARTIFACT_TRUE_SWARMS_DESC";
			True_Swarms.smallIconSelectedSprite = Sprite.Create(val11, val, val2);
			True_Swarms.smallIconDeselectedSprite = Sprite.Create(val12, val, val2);
			ContentAddition.AddArtifactDef(True_Swarms);
			Texture2D val13 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Frailty_On.png");
			Texture2D val14 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Frailty_Off.png");
			((Texture)val13).filterMode = (FilterMode)2;
			((Texture)val14).filterMode = (FilterMode)2;
			True_Frailty.cachedName = text2 + "WeakAssKneesTrueFrailty";
			True_Frailty.nameToken = "ARTIFACT_TRUE_FRAILTY_NAME";
			True_Frailty.descriptionToken = "ARTIFACT_TRUE_FRAILTY_DESC";
			True_Frailty.smallIconSelectedSprite = Sprite.Create(val13, val, val2);
			True_Frailty.smallIconDeselectedSprite = Sprite.Create(val14, val, val2);
			Texture2D val15 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Swarms_On.png");
			Texture2D val16 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Swarms_Off.png");
			((Texture)val15).filterMode = (FilterMode)2;
			((Texture)val16).filterMode = (FilterMode)2;
			Mirror_Swarms.cachedName = text + "SwarmsMirrorSwarms";
			Mirror_Swarms.nameToken = "ARTIFACT_MIRROR_SWARMS_NAME";
			Mirror_Swarms.descriptionToken = "ARTIFACT_MIRROR_SWARMS_DESC";
			Mirror_Swarms.smallIconSelectedSprite = Sprite.Create(val15, val, val2);
			Mirror_Swarms.smallIconDeselectedSprite = Sprite.Create(val16, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Swarms);
			Texture2D val17 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Evolution_On.png");
			Texture2D val18 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/True_Evolution_Off.png");
			((Texture)val17).filterMode = (FilterMode)2;
			((Texture)val18).filterMode = (FilterMode)2;
			True_Evolution.cachedName = text2 + "MonsterTeamGainsItemsTrueEvolution";
			True_Evolution.nameToken = "ARTIFACT_TRUE_EVOLUTION_NAME";
			True_Evolution.descriptionToken = "ARTIFACT_TRUE_EVOLUTION_DESC";
			True_Evolution.smallIconSelectedSprite = Sprite.Create(val17, val, val2);
			True_Evolution.smallIconDeselectedSprite = Sprite.Create(val18, val, val2);
			ContentAddition.AddArtifactDef(True_Evolution);
			Texture2D val19 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Sacrifice_On.png");
			Texture2D val20 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Sacrifice_Off.png");
			((Texture)val19).filterMode = (FilterMode)2;
			((Texture)val20).filterMode = (FilterMode)2;
			Mirror_Sacrifice.cachedName = text + "SacrificeMirrorSacrifice";
			Mirror_Sacrifice.nameToken = "ARTIFACT_MIRROR_SACRIFICE_NAME";
			Mirror_Sacrifice.descriptionToken = "ARTIFACT_MIRROR_SACRIFICE_DESC";
			Mirror_Sacrifice.smallIconSelectedSprite = Sprite.Create(val19, val, val2);
			Mirror_Sacrifice.smallIconDeselectedSprite = Sprite.Create(val20, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Sacrifice);
			Texture2D val21 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Honor_On.png");
			Texture2D val22 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Honor_Off.png");
			((Texture)val21).filterMode = (FilterMode)2;
			((Texture)val22).filterMode = (FilterMode)2;
			Mirror_Honor.cachedName = text + "EliteOnlyMirrorHonor";
			Mirror_Honor.nameToken = "ARTIFACT_MIRROR_HONOR_NAME";
			Mirror_Honor.descriptionToken = "ARTIFACT_MIRROR_HONOR_DESC";
			Mirror_Honor.smallIconSelectedSprite = Sprite.Create(val21, val, val2);
			Mirror_Honor.smallIconDeselectedSprite = Sprite.Create(val22, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Honor);
			Texture2D val23 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Frailty_On.png");
			Texture2D val24 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Frailty_Off.png");
			((Texture)val23).filterMode = (FilterMode)2;
			((Texture)val24).filterMode = (FilterMode)2;
			Mirror_Frailty.cachedName = text + "WeakAssKneesMirrorFrailty";
			Mirror_Frailty.nameToken = "ARTIFACT_MIRROR_FRAILTY_NAME";
			Mirror_Frailty.descriptionToken = "ARTIFACT_MIRROR_FRAILTY_DESC";
			Mirror_Frailty.smallIconSelectedSprite = Sprite.Create(val23, val, val2);
			Mirror_Frailty.smallIconDeselectedSprite = Sprite.Create(val24, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Frailty);
			Texture2D val25 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Enigma_On.png");
			Texture2D val26 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Enigma_Off.png");
			((Texture)val25).filterMode = (FilterMode)2;
			((Texture)val26).filterMode = (FilterMode)2;
			Mirror_Enigma.cachedName = text + "EnigmaMirrorEnigma";
			Mirror_Enigma.nameToken = "ARTIFACT_MIRROR_ENIGMA_NAME";
			Mirror_Enigma.descriptionToken = "ARTIFACT_MIRROR_ENIGMA_DESC";
			Mirror_Enigma.smallIconSelectedSprite = Sprite.Create(val25, val, val2);
			Mirror_Enigma.smallIconDeselectedSprite = Sprite.Create(val26, val, val2);
			ContentAddition.AddArtifactDef(Mirror_Enigma);
			Texture2D val27 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Spite_On.png");
			Texture2D val28 = Assets.Bundle.LoadAsset<Texture2D>("Assets/TrueArtifacts/Mirror_Spite_Off.png");
			((Texture)val27).filterMode = (FilterMode)2;
			((Texture)val28).filterMode = (FilterMode)2;
			Mirror_Spite.cachedName = text + "BombMirrorSpite";
			Mirror_Spite.nameToken = "ARTIFACT_MIRROR_SPITE_NAME";
			Mirror_Spite.descriptionToken = "ARTIFACT_MIRROR_SPITE_DESC";
			Mirror_Spite.smallIconSelectedSprite = Sprite.Create(val27, val, val2);
			Mirror_Spite.smallIconDeselectedSprite = Sprite.Create(val28, val, val2);
		}

		private void Artifact_Enabled([NotNull] RunArtifactManager runArtifactManager, [NotNull] ArtifactDef artifactDef)
		{
			if ((Object)(object)artifactDef == (Object)(object)True_Command)
			{
				TrueCommand.On_Artifact_Enable();
				runArtifactManager.SetArtifactEnabled(Artifacts.Command, false);
			}
			else if ((Object)(object)artifactDef == (Object)(object)True_Dissonance)
			{
				TrueDissonance.On_Artifact_Enable();
				runArtifactManager.SetArtifactEnabled(Artifacts.MixEnemy, false);
			}
			else if ((Object)(object)artifactDef == (Object)(object)True_Swarms)
			{
				TrueSwarms.On_Artifact_Enable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)Mirror_Kin)
			{
				MirrorKin.On_Artifact_Enable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)Mirror_Glass)
			{
				MirrorGlass.On_Artifact_Enable();
			}
			else if (!((Object)(object)artifactDef == (Object)(object)True_Frailty))
			{
				if ((Object)(object)artifactDef == (Object)(object)Mirror_Swarms)
				{
					MirrorSwarms.On_Artifact_Enable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)True_Evolution)
				{
					TrueEvolution.On_Artifact_Enable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Sacrifice)
				{
					MirrorSacrifice.On_Artifact_Enable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Honor)
				{
					MirrorHonor.On_Artifact_Enable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Frailty)
				{
					MirrorFrailty.On_Artifact_Enable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Enigma)
				{
					MirrorEnigma.On_Artifact_Enable();
				}
				else if (!((Object)(object)artifactDef == (Object)(object)Mirror_Spite))
				{
				}
			}
		}

		private void Artifact_Disable([NotNull] RunArtifactManager runArtifactManager, [NotNull] ArtifactDef artifactDef)
		{
			if ((Object)(object)artifactDef == (Object)(object)True_Command)
			{
				TrueCommand.On_Artifact_Disable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)True_Dissonance)
			{
				TrueDissonance.On_Artifact_Disable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)True_Swarms)
			{
				TrueSwarms.On_Artifact_Disable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)Mirror_Kin)
			{
				MirrorKin.On_Artifact_Disable();
			}
			else if ((Object)(object)artifactDef == (Object)(object)Mirror_Glass)
			{
				MirrorGlass.On_Artifact_Disable();
			}
			else if (!((Object)(object)artifactDef == (Object)(object)True_Frailty))
			{
				if ((Object)(object)artifactDef == (Object)(object)Mirror_Swarms)
				{
					MirrorSwarms.On_Artifact_Disable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)True_Evolution)
				{
					TrueEvolution.On_Artifact_Disable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Sacrifice)
				{
					MirrorSacrifice.On_Artifact_Disable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Honor)
				{
					MirrorHonor.On_Artifact_Disable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Frailty)
				{
					MirrorFrailty.On_Artifact_Disable();
				}
				else if ((Object)(object)artifactDef == (Object)(object)Mirror_Enigma)
				{
					MirrorEnigma.On_Artifact_Disable();
				}
				else if (!((Object)(object)artifactDef == (Object)(object)Mirror_Spite))
				{
				}
			}
		}
	}
}
namespace TrueArtifacts.Aritfacts
{
	public class MirrorEnigma
	{
		public static MirrorEnigmaDropTable dtAnyTier = ScriptableObject.CreateInstance<MirrorEnigmaDropTable>();

		public static void Start()
		{
			((Object)dtAnyTier).name = "dtMirrorEnigmaAnyTier";
			((PickupDropTable)dtAnyTier).canDropBeReplaced = false;
			((BasicPickupDropTable)dtAnyTier).tier1Weight = 1f;
			((BasicPickupDropTable)dtAnyTier).tier2Weight = 1f;
			((BasicPickupDropTable)dtAnyTier).tier3Weight = 1f;
			((BasicPickupDropTable)dtAnyTier).lunarItemWeight = 1.1f;
			((BasicPickupDropTable)dtAnyTier).bossWeight = 1.8f;
			((BasicPickupDropTable)dtAnyTier).voidTier1Weight = 1.9f;
			((BasicPickupDropTable)dtAnyTier).voidTier2Weight = 1.7f;
			((BasicPickupDropTable)dtAnyTier).voidTier3Weight = 1.5f;
			((BasicPickupDropTable)dtAnyTier).voidBossWeight = 1.4f;
			dtAnyTier.full_equipmentWeight = 0.5f;
			dtAnyTier.full_equipmentWeightLunar = 0.5f;
			dtAnyTier.full_equipmentWeightBoss = 0.5f;
		}

		public static void On_Artifact_Disable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			PickupDropTable.GenerateDrop -= new hook_GenerateDrop(PickupDropTable_GenerateDrop);
			PickupDropTable.GenerateUniqueDrops -= new hook_GenerateUniqueDrops(PickupDropTable_GenerateUniqueDrops);
		}

		public static void On_Artifact_Enable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			PickupDropTable.GenerateDrop += new hook_GenerateDrop(PickupDropTable_GenerateDrop);
			PickupDropTable.GenerateUniqueDrops += new hook_GenerateUniqueDrops(PickupDropTable_GenerateUniqueDrops);
		}

		public static void MatchTagsToDropTable(PickupDropTable self)
		{
			bool flag = false;
			ItemTag[] bannedItemTags = ((BasicPickupDropTable)dtAnyTier).bannedItemTags;
			ItemTag[] requiredItemTags = ((BasicPickupDropTable)dtAnyTier).requiredItemTags;
			if (self is BasicPickupDropTable)
			{
				((BasicPickupDropTable)dtAnyTier).bannedItemTags = ((BasicPickupDropTable)((self is BasicPickupDropTable) ? self : null)).bannedItemTags;
				((BasicPickupDropTable)dtAnyTier).requiredItemTags = ((BasicPickupDropTable)((self is BasicPickupDropTable) ? self : null)).requiredItemTags;
			}
			else if (self is ArenaMonsterItemDropTable)
			{
				((BasicPickupDropTable)dtAnyTier).bannedItemTags = ((ArenaMonsterItemDropTable)((self is ArenaMonsterItemDropTable) ? self : null)).bannedItemTags;
				((BasicPickupDropTable)dtAnyTier).requiredItemTags = ((ArenaMonsterItemDropTable)((self is ArenaMonsterItemDropTable) ? self : null)).requiredItemTags;
			}
			else
			{
				((BasicPickupDropTable)dtAnyTier).bannedItemTags = (ItemTag[])(object)new ItemTag[0];
				((BasicPickupDropTable)dtAnyTier).requiredItemTags = (ItemTag[])(object)new ItemTag[0];
			}
			if (requiredItemTags.Length != ((BasicPickupDropTable)dtAnyTier).requiredItemTags.Length)
			{
				flag = true;
			}
			else if (bannedItemTags.Length != ((BasicPickupDropTable)dtAnyTier).bannedItemTags.Length)
			{
				flag = true;
			}
			else if (((BasicPickupDropTable)dtAnyTier).bannedItemTags.Length != 0 || ((BasicPickupDropTable)dtAnyTier).requiredItemTags.Length != 0)
			{
				if (!requiredItemTags.SequenceEqual(((BasicPickupDropTable)dtAnyTier).requiredItemTags))
				{
					flag = true;
				}
				else if (!bannedItemTags.SequenceEqual(((BasicPickupDropTable)dtAnyTier).bannedItemTags))
				{
					flag = true;
				}
			}
			if (flag)
			{
				((PickupDropTable)dtAnyTier).Regenerate(Run.instance);
			}
		}

		public static bool Roll(PickupDropTable dt, Xoroshiro128Plus rng)
		{
			if (!dt.canDropBeReplaced)
			{
				return false;
			}
			int num = MirrorEnigmaDropTable.replacementChance;
			if (dt is BasicPickupDropTable)
			{
				if (((BasicPickupDropTable)((dt is BasicPickupDropTable) ? dt : null)).bannedItemTags.Contains((ItemTag)4))
				{
					num = MirrorEnigmaDropTable.replacementChanceMonster;
				}
				else if (((Object)dt).name.StartsWith("dtDupli"))
				{
					num = MirrorEnigmaDropTable.replacementChancePrinter;
				}
				else if (Object.op_Implicit((Object)(object)SceneInfo.instance) && SceneInfo.instance.sceneDef.baseSceneName == "bazaar")
				{
					num = MirrorEnigmaDropTable.replacementChancePrinter;
				}
			}
			return rng.RangeInt(0, 100) < num;
		}

		private static PickupIndex[] PickupDropTable_GenerateUniqueDrops(orig_GenerateUniqueDrops orig, PickupDropTable self, int maxDrops, Xoroshiro128Plus rng)
		{
			if (Roll(self, rng))
			{
				MatchTagsToDropTable(self);
				return orig.Invoke((PickupDropTable)(object)dtAnyTier, maxDrops, rng);
			}
			return orig.Invoke(self, maxDrops, rng);
		}

		private static PickupIndex PickupDropTable_GenerateDrop(orig_GenerateDrop orig, PickupDropTable self, Xoroshiro128Plus rng)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			if (Roll(self, rng))
			{
				MatchTagsToDropTable(self);
				return orig.Invoke((PickupDropTable)(object)dtAnyTier, rng);
			}
			return orig.Invoke(self, rng);
		}
	}
	public class MirrorEnigmaDropTable : BasicPickupDropTable
	{
		public float bossEquipmentWeight;

		public float full_equipmentWeight;

		public float full_equipmentWeightLunar;

		public float full_equipmentWeightBoss;

		public bool didWeights = true;

		public static int replacementChance = 10;

		public static int replacementChanceMonster = 12;

		public static int replacementChancePrinter = 5;

		public void DoWeights(Run run)
		{
			didWeights = true;
			base.tier1Weight = 10f / (float)run.availableTier1DropList.Count;
			base.tier2Weight = 10f / (float)run.availableTier2DropList.Count;
			base.tier3Weight = 10f / (float)run.availableTier3DropList.Count;
			base.lunarItemWeight = 10f / (float)run.availableLunarItemDropList.Count;
			base.bossWeight = 10f / (float)run.availableBossDropList.Count;
			base.voidTier1Weight = 10f / (float)run.availableVoidTier1DropList.Count;
			base.voidTier2Weight = 10f / (float)run.availableVoidTier2DropList.Count;
			base.voidTier3Weight = 1f / (float)run.availableVoidTier3DropList.Count;
			base.voidBossWeight = 1f / (float)run.availableVoidBossDropList.Count;
			full_equipmentWeight = 5f / (float)run.availableEquipmentDropList.Count;
			full_equipmentWeightLunar = 5f / (float)run.availableLunarEquipmentDropList.Count;
			full_equipmentWeightBoss = 5f / (float)PickupTransmutationManager.equipmentBossGroup.Length;
		}

		public override void Regenerate(Run run)
		{
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			if (base.bannedItemTags.Length == 0 && base.requiredItemTags.Length == 0)
			{
				base.equipmentWeight = full_equipmentWeight;
				base.lunarEquipmentWeight = full_equipmentWeightLunar;
				bossEquipmentWeight = full_equipmentWeightBoss;
			}
			else
			{
				base.equipmentWeight = 0f;
				base.lunarEquipmentWeight = 0f;
				bossEquipmentWeight = 0f;
			}
			((BasicPickupDropTable)this).GenerateWeightedSelection(run);
			base.selector.AddChoice(PickupCatalog.FindPickupIndex(Items.Pearl.itemIndex), base.bossWeight);
			base.selector.AddChoice(PickupCatalog.FindPickupIndex(Items.ShinyPearl.itemIndex), base.bossWeight);
			base.selector.AddChoice(PickupCatalog.FindPickupIndex(Items.TitanGoldDuringTP.itemIndex), base.bossWeight);
			if (!(bossEquipmentWeight > 0f))
			{
				return;
			}
			PickupIndex[] equipmentBossGroup = PickupTransmutationManager.equipmentBossGroup;
			for (int i = 0; i < equipmentBossGroup.Length; i++)
			{
				PickupIndex val = equipmentBossGroup[i];
				if (!run.IsEquipmentExpansionLocked(((PickupIndex)(ref val)).equipmentIndex))
				{
					base.selector.AddChoice(val, bossEquipmentWeight);
				}
			}
		}
	}
	public class MirrorFrailty
	{
		public static void On_Artifact_Disable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			JumpVolume.OnTriggerStay -= new hook_OnTriggerStay(JumpVolume_OnTriggerStay);
			SetGravity.OnEnable -= new hook_OnEnable(SetGravity_OnEnable);
			Run.baseGravity /= 2f;
			Physics.gravity = new Vector3(0f, Run.baseGravity, 0f);
		}

		public static void On_Artifact_Enable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			JumpVolume.OnTriggerStay += new hook_OnTriggerStay(JumpVolume_OnTriggerStay);
			SetGravity.OnEnable += new hook_OnEnable(SetGravity_OnEnable);
			Run.baseGravity *= 2f;
			Physics.gravity = new Vector3(0f, Run.baseGravity, 0f);
		}

		private static void JumpVolume_OnTriggerStay(orig_OnTriggerStay orig, JumpVolume self, Collider other)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, other);
			CharacterMotor component = ((Component)other).GetComponent<CharacterMotor>();
			if (Object.op_Implicit((Object)(object)component) && component.hasEffectiveAuthority && !component.doNotTriggerJumpVolumes)
			{
				Debug.Log((object)component);
				component.velocity = self.jumpVelocity * 1.4f;
			}
		}

		private static void SetGravity_OnEnable(orig_OnEnable orig, SetGravity self)
		{
			self.newGravity *= 2f;
			orig.Invoke(self);
		}
	}
	public class MirrorGlass
	{
		public static void On_Artifact_Disable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients -= new StatHookEventHandler(R2API_Stats);
			CharacterBody.RecalculateStats -= new hook_RecalculateStats(CharacterBody_RecalculateStats);
			PickupDropletController.OnCollisionEnter -= new hook_OnCollisionEnter(DoubleItems);
			PurchaseInteraction.Start -= new hook_Start(DoubleItemPrices);
		}

		public static void On_Artifact_Enable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(R2API_Stats);
			CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats);
			PickupDropletController.OnCollisionEnter += new hook_OnCollisionEnter(DoubleItems);
			PurchaseInteraction.Start += new hook_Start(DoubleItemPrices);
		}

		private static void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self)
		{
			orig.Invoke(self);
			if (self.isPlayerControlled)
			{
				self.isGlass = true;
			}
		}

		private static void R2API_Stats(CharacterBody sender, StatHookEventArgs args)
		{
			if (sender.isPlayerControlled)
			{
				args.baseCurseAdd += 1f;
			}
		}

		private static void DoubleItems(orig_OnCollisionEnter orig, PickupDropletController self, Collision collision)
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (!NetworkServer.active || !self.alive)
			{
				return;
			}
			ItemIndex itemIndex = ((PickupIndex)(ref self.pickupIndex)).pickupDef.itemIndex;
			if ((int)itemIndex != -1)
			{
				ItemDef itemDef = ItemCatalog.GetItemDef(itemIndex);
				if (((Object)itemDef).name.StartsWith("Scrap"))
				{
					orig.Invoke(self, collision);
					return;
				}
			}
			self.createPickupInfo.position = ((Component)self).transform.position;
			self.CreatePickup();
			orig.Invoke(self, collision);
		}

		private static void DoubleItemPrices(orig_Start orig, PurchaseInteraction self)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Invalid comparison between Unknown and I4
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Invalid comparison between Unknown and I4
			orig.Invoke(self);
			if ((int)self.costType == 4 || (int)self.costType == 5 || (int)self.costType == 6 || (int)self.costType == 10)
			{
				self.cost *= 2;
			}
		}
	}
	public class MirrorHonor
	{
		public static float MaxLevel = 199f;

		public static void On_Artifact_Enable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			Run.RecalculateDifficultyCoefficent += new hook_RecalculateDifficultyCoefficent(Run_RecalculateDifficultyCoefficent);
			InfiniteTowerRun.RecalculateDifficultyCoefficentInternal += new hook_RecalculateDifficultyCoefficentInternal(InfiniteTowerRun_RecalculateDifficultyCoefficentInternal);
			MaxLevel = Math.Max((Run.ambientLevelCap + 1) * 2, MaxLevel);
			if (MaxLevel < 1000f)
			{
				MaxLevel = 999f;
			}
		}

		private static void InfiniteTowerRun_RecalculateDifficultyCoefficentInternal(orig_RecalculateDifficultyCoefficentInternal orig, InfiniteTowerRun self)
		{
			orig.Invoke(self);
			((Run)self).difficultyCoefficient = ((Run)self).difficultyCoefficient * 2f;
			((Run)self).compensatedDifficultyCoefficient = ((Run)self).compensatedDifficultyCoefficient * 2f;
			((Run)self).ambientLevel = Mathf.Min((((Run)self).difficultyCoefficient - 1f) / 0.33f + 1f, 10000f);
			((Run)self).ambientLevelFloor = Mathf.FloorToInt(((Run)self).ambientLevel);
		}

		private static void Run_RecalculateDifficultyCoefficent(orig_RecalculateDifficultyCoefficent orig, Run self)
		{
			orig.Invoke(self);
			self.difficultyCoefficient *= 2f;
			self.compensatedDifficultyCoefficient *= 2f;
			float num = 0.7f + (float)self.participatingPlayerCount * 0.3f;
			self.ambientLevel = Mathf.Min((self.difficultyCoefficient - num) / 0.33f + 1f, MaxLevel);
			self.ambientLevelFloor = Mathf.FloorToInt(self.ambientLevel);
		}

		public static void On_Artifact_Disable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			Run.RecalculateDifficultyCoefficent -= new hook_RecalculateDifficultyCoefficent(Run_RecalculateDifficultyCoefficent);
			InfiniteTowerRun.RecalculateDifficultyCoefficentInternal -= new hook_RecalculateDifficultyCoefficentInternal(InfiniteTowerRun_RecalculateDifficultyCoefficentInternal);
		}
	}
	public class MirrorKin
	{
		public static DccsPool dpAllFamilies;

		public static FamilyDirectorCardCategorySelection dccsFamilyTrueDisso;

		public static void MakeDCCSPool()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Expected O, but got Unknown
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Expected O, but got Unknown
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0201: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Expected O, but got Unknown
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Expected O, but got Unknown
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0267: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Expected O, but got Unknown
			//IL_0275: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: 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_0285: Unknown result type (might be due to invalid IL or missing references)
			//IL_0293: Unknown result type (might be due to invalid IL or missing references)
			//IL_029f: Expected O, but got Unknown
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cb: 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_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f7: Expected O, but got Unknown
			//IL_02f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0304: Unknown result type (might be due to invalid IL or missing references)
			//IL_0309: 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_0323: Expected O, but got Unknown
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_0335: Unknown result type (might be due to invalid IL or missing references)
			//IL_0343: Unknown result type (might be due to invalid IL or missing references)
			//IL_034f: Expected O, but got Unknown
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0369: Unknown result type (might be due to invalid IL or missing references)
			//IL_036e: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0387: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Expected O, but got Unknown
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03af: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c2: Expected O, but got Unknown
			//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f5: Expected O, but got Unknown
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0402: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_0420: Unknown result type (might be due to invalid IL or missing references)
			//IL_0428: Expected O, but got Unknown
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Expected O, but got Unknown
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Expected O, but got Unknown
			//IL_0545: Unknown result type (might be due to invalid IL or missing references)
			//IL_054c: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0110: 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)
			//IL_011c: 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_0134: Expected O, but got Unknown
			//IL_0136: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Expected O, but got Unknown
			Debug.Log((object)"ALL FAMILY");
			ExpansionDef val = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC1/Common/DLC1.asset").WaitForCompletion();
			ExpansionDef val2 = Addressables.LoadAssetAsync<ExpansionDef>((object)"RoR2/DLC2/Common/DLC2.asset").WaitForCompletion();
			ExpansionDef[] requiredExpansions = (ExpansionDef[])(object)new ExpansionDef[1] { val };
			ExpansionDef[] requiredExpansions2 = (ExpansionDef[])(object)new ExpansionDef[1] { val2 };
			PoolEntry val3 = null;
			PoolEntry val4 = null;
			ConditionalPoolEntry val5 = null;
			ConditionalPoolEntry val6 = null;
			FamilyDirectorCardCategorySelection[] array = Object.FindObjectsOfType(typeof(FamilyDirectorCardCategorySelection)) as FamilyDirectorCardCategorySelection[];
			for (int i = 0; i < array.Length; i++)
			{
				Debug.Log((object)((Object)array[i]).name);
				switch (((Object)array[i]).name)
				{
				case "dccsClayFamily":
					val3 = new PoolEntry
					{
						dccs = (DirectorCardCategorySelection)(object)array[i],
						weight = 1f
					};
					break;
				case "dccsRoboBallFamily":
					val4 = new PoolEntry
					{
						dccs = (DirectorCardCategorySelection)(object)array[i],
						weight = 1f
					};
					break;
				case "dccsVerminFamily":
					val5 = new ConditionalPoolEntry
					{
						requiredExpansions = requiredExpansions,
						dccs = (DirectorCardCategorySelection)(object)array[i],
						weight = 1f
					};
					break;
				case "dccsWormsFamily":
					val6 = new ConditionalPoolEntry
					{
						requiredExpansions = requiredExpansions2,
						dccs = (DirectorCardCategorySelection)(object)array[i],
						weight = 1f
					};
					break;
				}
			}
			dpAllFamilies = ScriptableObject.CreateInstance<DccsPool>();
			((Object)dpAllFamilies).name = "dpAllFamilies";
			DccsPool obj = dpAllFamilies;
			Category[] array2 = new Category[1];
			Category val7 = new Category();
			val7.name = "Families";
			val7.categoryWeight = 1f;
			val7.alwaysIncluded = (PoolEntry[])(object)new PoolEntry[9]
			{
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsBeetleFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGolemFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsJellyfishFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsWispFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsLemurianFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsImpFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsParentFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsMushroomFamily.asset").WaitForCompletion(),
					weight = 1f
				},
				new PoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsLunarFamily.asset").WaitForCompletion(),
					weight = 1f
				}
			};
			val7.includedIfConditionsMet = (ConditionalPoolEntry[])(object)new ConditionalPoolEntry[4]
			{
				new ConditionalPoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/Base/Common/dccsGupFamily.asset").WaitForCompletion(),
					weight = 1f,
					requiredExpansions = requiredExpansions
				},
				new ConditionalPoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/DLC1/Common/dccsConstructFamily.asset").WaitForCompletion(),
					weight = 1f,
					requiredExpansions = requiredExpansions
				},
				new ConditionalPoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/DLC1/Common/dccsAcidLarvaFamily.asset").WaitForCompletion(),
					weight = 1f,
					requiredExpansions = requiredExpansions
				},
				new ConditionalPoolEntry
				{
					dccs = (DirectorCardCategorySelection)(object)Addressables.LoadAssetAsync<FamilyDirectorCardCategorySelection>((object)"RoR2/DLC1/Common/dccsVoidFamily.asset").WaitForCompletion(),
					weight = 1f,
					requiredExpansions = requiredExpansions
				}
			};
			val7.includedIfNoConditionsMet = (PoolEntry[])(object)new PoolEntry[0];
			array2[0] = val7;
			obj.poolCategories = (Category[])(object)array2;
			if (val3 != null)
			{
				PoolEntry[] alwaysIncluded = dpAllFamilies.poolCategories[0].alwaysIncluded;
				ConditionalPoolEntry[] includedIfConditionsMet = dpAllFamilies.poolCategories[0].includedIfConditionsMet;
				dpAllFamilies.poolCategories[0].alwaysIncluded = alwaysIncluded.Add(val3, val4);
				dpAllFamilies.poolCategories[0].includedIfConditionsMet = includedIfConditionsMet.Add(val5, val6);
			}
			ClassicStageInfo.HandleMixEnemyArtifact += new hook_HandleMixEnemyArtifact(RandomFamilyOnDissonance);
			dccsFamilyTrueDisso = ScriptableObject.CreateInstance<FamilyDirectorCardCategorySelection>();
			((Object)dccsFamilyTrueDisso).name = "dccsFamilyTrueDissonance";
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCategory("Champion", 3f);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCategory("Miniboss", 3f);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCategory("Basic Monsters", 4f);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCategory("UniqueBosses", 0.3f);
			DirectorCard val8 = new DirectorCard();
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCard(0, val8);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCard(1, val8);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCard(2, val8);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).AddCard(3, val8);
		}

		private static void RandomFamilyOnDissonance(orig_HandleMixEnemyArtifact orig, DirectorCardCategorySelection monsterCategories, Xoroshiro128Plus rng)
		{
			if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(Main.Mirror_Kin))
			{
				DirectorCardCategorySelection val = FindFamily(Dissonance: true);
				if ((Object)(object)val == (Object)null)
				{
				}
				if (val is FamilyDirectorCardCategorySelection)
				{
					((MonoBehaviour)ClassicStageInfo.instance).StartCoroutine(ClassicStageInfo.instance.BroadcastFamilySelection(((FamilyDirectorCardCategorySelection)((val is FamilyDirectorCardCategorySelection) ? val : null)).selectionChatString));
				}
				monsterCategories.CopyFrom(val);
			}
			else
			{
				orig.Invoke(monsterCategories, rng);
			}
		}

		public static void On_Artifact_Enable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			FamilyDirectorCardCategorySelection.IsAvailable += new hook_IsAvailable(AllowFamilyEventsEarlier);
			ClassicStageInfo.RebuildCards += new hook_RebuildCards(Force_Family_Event);
			if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance) && Object.op_Implicit((Object)(object)Run.instance))
			{
				ClassicStageInfo.instance.RebuildCards((DirectorCardCategorySelection)null, (DirectorCardCategorySelection)null);
			}
			EnemyInfoPanel.SetDisplayDataForViewer += new hook_SetDisplayDataForViewer(AddMirrorKinDisplay);
			EnemyInfoPanel.MarkDirty();
		}

		private static void AddMirrorKinDisplay(orig_SetDisplayDataForViewer orig, HUD hud, List<BodyIndex> bodyIndices, ItemIndex[] itemAcquisitionOrderBuffer, int itemAcquisitonOrderLength, int[] itemStacks)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Invalid comparison between Unknown and I4
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Invalid comparison between Unknown and I4
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Invalid comparison between Unknown and I4
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Invalid comparison between Unknown and I4
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance))
			{
				MirrorKinTracker component = ((Component)ClassicStageInfo.instance).GetComponent<MirrorKinTracker>();
				if (Object.op_Implicit((Object)(object)component))
				{
					if ((int)component.Enemy1 != -1)
					{
						bodyIndices.Add(component.Enemy1);
					}
					if ((int)component.Enemy2 != -1)
					{
						bodyIndices.Add(component.Enemy2);
					}
					if ((int)component.Enemy3 != -1)
					{
						bodyIndices.Add(component.Enemy3);
					}
					if ((int)component.Enemy4 != -1)
					{
						bodyIndices.Add(component.Enemy4);
					}
				}
			}
			orig.Invoke(hud, bodyIndices, itemAcquisitionOrderBuffer, itemAcquisitonOrderLength, itemStacks);
		}

		private static bool AllowFamilyEventsEarlier(orig_IsAvailable orig, FamilyDirectorCardCategorySelection self)
		{
			if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount >= 3)
			{
				return true;
			}
			return Object.op_Implicit((Object)(object)Run.instance) && self.minimumStageCompletion <= Run.instance.stageClearCount;
		}

		public static void On_Artifact_Disable()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			FamilyDirectorCardCategorySelection.IsAvailable -= new hook_IsAvailable(AllowFamilyEventsEarlier);
			ClassicStageInfo.RebuildCards -= new hook_RebuildCards(Force_Family_Event);
			if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance) && Object.op_Implicit((Object)(object)Run.instance))
			{
				ClassicStageInfo.instance.RebuildCards((DirectorCardCategorySelection)null, (DirectorCardCategorySelection)null);
			}
			EnemyInfoPanel.SetDisplayDataForViewer -= new hook_SetDisplayDataForViewer(AddMirrorKinDisplay);
			EnemyInfoPanel.MarkDirty();
		}

		public static List<DirectorCard> GenerateCandiateList(DirectorCardCategorySelection dccs)
		{
			List<DirectorCard> list = new List<DirectorCard>();
			for (int i = 0; i < dccs.categories.Length; i++)
			{
				DirectorCard[] cards = dccs.categories[i].cards;
				foreach (DirectorCard item in cards)
				{
					list.Add(item);
				}
			}
			return list;
		}

		public static List<DirectorCardCategorySelection> GenerateCandiateListDCCS(DccsPool dccsPool)
		{
			List<DirectorCardCategorySelection> list = new List<DirectorCardCategorySelection>();
			PoolEntry[] alwaysIncluded = dccsPool.poolCategories[0].alwaysIncluded;
			foreach (PoolEntry val in alwaysIncluded)
			{
				list.Add(val.dccs);
			}
			ConditionalPoolEntry[] includedIfConditionsMet = dccsPool.poolCategories[0].includedIfConditionsMet;
			foreach (ConditionalPoolEntry val2 in includedIfConditionsMet)
			{
				if (val2.requiredExpansions.Length != 0 && Run.instance.IsExpansionEnabled(val2.requiredExpansions[0]))
				{
					list.Add(((PoolEntry)val2).dccs);
				}
			}
			return list;
		}

		public static DirectorCardCategorySelection FindFamily(bool Dissonance)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Expected O, but got Unknown
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"FindFamily");
			ClassicStageInfo instance = ClassicStageInfo.instance;
			List<DirectorCard> list = null;
			Xoroshiro128Plus val = new Xoroshiro128Plus(instance.seedServer);
			if (Dissonance)
			{
				list = GenerateCandiateList(RoR2Content.mixEnemyMonsterCards);
			}
			else
			{
				if (!Object.op_Implicit((Object)(object)instance.monsterDccsPool))
				{
					return null;
				}
				DirectorCardCategorySelection val2 = instance.monsterDccsPool.GenerateWeightedSelection().Evaluate(val.nextNormalizedFloat);
				if ((Object)(object)val2 != (Object)null)
				{
					list = GenerateCandiateList(val2);
				}
			}
			int num = Random.RandomRangeInt(0, 3);
			if (num == 2 && SceneCatalog.mostRecentSceneDef.cachedName == "voidstage")
			{
				return null;
			}
			DirectorCard val3 = list[val.RangeInt(0, list.Count)];
			Debug.Log((object)("Family for " + (object)val3.spawnCard));
			List<DirectorCardCategorySelection> list2 = GenerateCandiateListDCCS(dpAllFamilies);
			for (int i = 0; i < list2.Count; i++)
			{
				DirectorCardCategorySelection val4 = list2[i];
				for (int j = 0; j < list2[i].categories.Length; j++)
				{
					Category val5 = val4.categories[j];
					DirectorCard[] cards = val5.cards;
					foreach (DirectorCard val6 in cards)
					{
						if ((Object)(object)val6.spawnCard == (Object)(object)val3.spawnCard)
						{
							if (Dissonance || val4.IsAvailable())
							{
								return val4;
							}
							Debug.Log((object)(((object)val4)?.ToString() + " is not available yet."));
							return null;
						}
					}
				}
			}
			Debug.Log((object)("Could not find matching family for " + (object)val3.spawnCard));
			if (Dissonance)
			{
				int index = val.RangeInt(0, list2.Count);
				return list2[index];
			}
			return null;
		}

		public static DirectorCardCategorySelection MakeTrueDissoFamily()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Expected O, but got Unknown
			Debug.Log((object)"Making TrueDisso Family");
			if ((Object)(object)TrueDissonance.dccsMixEnemyTRUE == (Object)null)
			{
				TrueDissonance.MakeDCCS();
			}
			Xoroshiro128Plus val = new Xoroshiro128Plus(ClassicStageInfo.instance.seedServer);
			int num = val.RangeInt(0, TrueDissonance.dccsMixEnemyTRUE.categories[0].cards.Length);
			int num2 = val.RangeInt(0, TrueDissonance.dccsMixEnemyTRUE.categories[1].cards.Length);
			int num3 = val.RangeInt(0, TrueDissonance.dccsMixEnemyTRUE.categories[2].cards.Length);
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).categories[0].cards[0] = TrueDissonance.dccsMixEnemyTRUE.categories[0].cards[num];
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).categories[1].cards[0] = TrueDissonance.dccsMixEnemyTRUE.categories[1].cards[num2];
			((DirectorCardCategorySelection)dccsFamilyTrueDisso).categories[2].cards[0] = TrueDissonance.dccsMixEnemyTRUE.categories[2].cards[num3];
			int num4 = TrueDissonance.dccsMixEnemyTRUE.FindCategoryIndexByName("UniqueBosses");
			if (num4 > -1)
			{
				int num5 = val.RangeInt(0, TrueDissonance.dccsMixEnemyTRUE.categories[num4].cards.Length);
				((DirectorCardCategorySelection)dccsFamilyTrueDisso).categories[3].cards[0] = TrueDissonance.dccsMixEnemyTRUE.categories[num4].cards[num5];
			}
			int num6 = val.RangeInt(1, 20);
			int num7 = val.RangeInt(1, 21);
			dccsFamilyTrueDisso.selectionChatString = string.Format(Language.GetString("FAMILY_DISSONANT"), Language.GetString("FAMILY_DISSONANT_" + num6), Language.GetString("FAMILY_DISSONANT_0" + num7));
			return (DirectorCardCategorySelection)(object)dccsFamilyTrueDisso;
		}

		private static void Force_Family_Event(orig_RebuildCards orig, ClassicStageInfo self, DirectorCardCategorySelection forcedMonsterCategory, DirectorCardCategorySelection forcedInteractableCategory)
		{
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Expected I4, but got Unknown
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Expected I4, but got Unknown
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Expected I4, but got Unknown
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Expected I4, but got Unknown
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			float num = -1f;
			if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(Main.True_Dissonance))
			{
				forcedMonsterCategory = MakeTrueDissoFamily();
			}
			else if (!Object.op_Implicit((Object)(object)RunArtifactManager.instance) || !RunArtifactManager.instance.IsArtifactEnabled(Artifacts.MixEnemy))
			{
				if ((Object)(object)forcedMonsterCategory == (Object)null)
				{
					try
					{
						forcedMonsterCategory = FindFamily(Dissonance: false);
					}
					catch (Exception ex)
					{
						Debug.LogException(ex);
						forcedMonsterCategory = null;
					}
				}
				if ((Object)(object)forcedMonsterCategory == (Object)null && Object.op_Implicit((Object)(object)self.monsterDccsPool) && self.monsterDccsPool.poolCategories.Length > 1)
				{
					num = self.monsterDccsPool.poolCategories[0].categoryWeight;
					self.monsterDccsPool.poolCategories[0].categoryWeight = 0f;
				}
				else
				{
					num = ClassicStageInfo.monsterFamilyChance;
					ClassicStageInfo.monsterFamilyChance = 10f;
				}
			}
			orig.Invoke(self, forcedMonsterCategory, forcedInteractableCategory);
			if (num > -1f)
			{
				if (Object.op_Implicit((Object)(object)self.monsterDccsPool) && self.monsterDccsPool.poolCategories.Length != 0)
				{
					self.monsterDccsPool.poolCategories[0].categoryWeight = num;
				}
				else
				{
					ClassicStageInfo.monsterFamilyChance = num;
				}
			}
			if (!WConfig.MirrorKinDisplay.Value || !Object.op_Implicit((Object)(object)RunArtifactManager.instance) || RunArtifactManager.instance.IsArtifactEnabled(Artifacts.singleMonsterTypeArtifactDef))
			{
				return;
			}
			SendMirrorKinTracker sendMirrorKinTracker = new SendMirrorKinTracker();
			for (int i = 0; i < 4; i++)
			{
				BodyIndex val = (BodyIndex)(-1);
				if (i < self.monsterSelection.Count)
				{
					try
					{
						val = self.monsterSelection.choices[i].value.spawnCard.prefab.GetComponent<CharacterMaster>().bodyPrefab.GetComponent<CharacterBody>().bodyIndex;
					}
					catch (Exception ex2)
					{
						Debug.LogException(ex2);
					}
				}
				switch (i)
				{
				case 0:
					sendMirrorKinTracker.Enemy1 = (int)val;
					break;
				case 1:
					sendMirrorKinTracker.Enemy2 = (int)val;
					break;
				case 2:
					sendMirrorKinTracker.Enemy3 = (int)val;
					break;
				case 3:
					sendMirrorKinTracker.Enemy4 = (int)val;
					break;
				}
			}
			Chat.SendBroadcastChat((ChatMessageBase)(object)sendMirrorKinTracker);
		}
	}
	public class MirrorKinTracker : MonoBehaviour
	{
		public BodyIndex Enemy1 = (BodyIndex)(-1);

		public BodyIndex Enemy2 = (BodyIndex)(-1);

		public BodyIndex Enemy3 = (BodyIndex)(-1);

		public BodyIndex Enemy4 = (BodyIndex)(-1);
	}
	public class SendMirrorKinTracker : ChatMessageBase
	{
		public int Enemy1 = -1;

		public int Enemy2 = -1;

		public int Enemy3 = -1;

		public int Enemy4 = -1;

		public override string ConstructChatString()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: 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)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)ClassicStageInfo.instance))
			{
				MirrorKinTracker mirrorKinTracker = ((Component)ClassicStageInfo.instance).gameObject.GetComponent<MirrorKinTracker>();
				if ((Object)(object)mirrorKinTracker == (Object)null)
				{
					mirrorKinTracker = ((Component)ClassicStageInfo.instance).gameObject.AddComponent<MirrorKinTracker>();
				}
				mirrorKinTracker.Enemy1 = (BodyIndex)Enemy1;
				mirrorKinTracker.Enemy2 = (BodyIndex)Enemy2;
				mirrorKinTracker.Enemy3 = (BodyIndex)Enemy3;
				mirrorKinTracker.Enemy4 = (BodyIndex)Enemy4;
				if (Object.op_Implicit((Object)(object)RunArtifactManager.instance) && RunArtifactManager.instance.IsArtifactEnabled(Main.True_Dissonance))
				{
					if (Object.op_Implicit((Object)(object)Run.instance) && Run.instance.stageClearCount > 9)
					{
						mirrorKinTracker.Enemy2 = (BodyIndex)Enemy1;
						mirrorKinTracker.Enemy3 = (BodyIndex)Enemy2;
						mirrorKinTracker.Enemy4 = (BodyIndex)Enemy3;
						mirrorKinTracker.Enemy1 = (BodyIndex)Enemy4;
					}
					else
					{
						mirrorKinTracker.Enemy4 = (BodyIndex)(-1);
					}
				}
			}
			EnemyInfoPanel.MarkDirty();
			return null;
		}

		public override void Serialize(NetworkWriter writer)
		{
			((ChatMessageBase)this).Serialize(writer);
			writer.Write(Enemy1);
			writer.Write(Enemy2);
			writer.Write(Enemy3);
			writer.Write(Enemy4);
		}

		public override void Deserialize(NetworkReader reader)
		{
			((ChatMessageBase)this).Deserialize(reader);
			Enemy1 = reader.ReadInt32();
			Enemy2 = reader.ReadInt32();
			Enemy3 = reader.ReadInt32();
			Enemy4 = reader.ReadInt32();
		}
	}
	public class MirrorSacrifice
	{
		public static void Start()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Barrel1/Barrel1.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineBoss/ShrineBoss.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineBoss/ShrineBossSandy Variant.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineBoss/ShrineBossSnowy Variant.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineCleanse/ShrineCleanse.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineCleanse/ShrineCleanseSandy Variant.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineCleanse/ShrineCleanseSnowy Variant.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ShrineGoldshoresAccess/ShrineGoldshoresAccess.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC2/ShrineHalcyonite.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidCamp/VoidCamp.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/CU8/LemurianEgg/LemurianEgg.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
			Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/RadarTower/RadarTower.prefab").WaitForCompletion().AddComponent<MirrorSacrificeAllowed>();
		}

		public static void On_Artifact_Enable()
		{
			if (NetworkServer.active)
			{
				SceneDirector.onGenerateInteractableCardSelection += OnGenerateInteractableCardSelection;
			}
		}

		public static void On_Artifact_Disable()
		{
			if (NetworkServer.active)
			{
				SceneDirector.onGenerateInteractableCardSelection -= OnGenerateInteractableCardSelection;
			}
		}

		private static void OnGenerateInteractableCardSelection(SceneDirector sceneDirector, DirectorCardCategorySelection dccs)
		{
			int num = dccs.FindCategoryIndexByName("Void Stuff");
			if (num > -1 && dccs.categories[num].cards.Length >= 2)
			{
				dccs.categories[num].selectionWeight *= 2f;
				if (dccs.categories[num].cards[0].selectionWeight < 10)
				{
					DirectorCard obj = dccs.categories[num].cards[0];
					obj.selectionWeight *= 3;
				}
				else if (dccs.categories[num].cards[1].selectionWeight < 10)
				{
					DirectorCard obj2 = dccs.categories[num].cards[1];
					obj2.selectionWeight *= 3;
				}
			}
			dccs.RemoveCardsThatFailFilter((Predicate<DirectorCard>)Filter);
		}

		internal static bool Filter(DirectorCard card)
		{
			SpawnCard spawnCard = card.spawnCard;
			InteractableSpawnCard val = (InteractableSpawnCard)(object)((spawnCard is InteractableSpawnCard) ? spawnCard : null);
			if (Object.op_Implicit((Object)(object)val))
			{
				if (val.skipSpawnWhenSacrificeArtifactEnabled)
				{
					return true;
				}
				if (val.skipSpawnWhenDevotionArtifactEnabled && RunArtifactManager.instance.IsArtifactEnabled(Artifacts.Devotion))
				{
					return true;
				}
				GameObject prefab = card.spawnCard.prefab;
				return Object.op_Implicit((Object)(object)prefab.GetComponent<MirrorSacrificeAllowed>());
			}
			return false;
		}
	}
	public class MirrorSacrificeAllowed : MonoBehaviour
	{
	}
	public class MirrorSwarms
	{
		public class MirrorSwarms_ServerSided : MonoBehaviour
		{
			public static List<MirrorSwarms_ServerSided> instances = new List<MirrorSwarms_ServerSided>();

			public Inventory targetInventory;

			public Inventory originInventory;

			public CharacterMaster targetMaster;

			public CharacterMaster originMaster;

			public CharacterBody targetBody;

			public static readonly Func<ItemIndex, bool> defaultItemCopyFilterDelegate = DefaultItemCopyFilter;

			public void OnEnable()
			{
				//IL_004c: Unknown result type (might be due to invalid IL or missing references)
				instances.Add(this);
				if (Object.op_Implicit((Object)(object)originMaster))
				{
					targetMaster = ((Component)this).GetComponent<CharacterMaster>();
					originMaster.networkIdentity.clientAuthorityOwner.clientOwnedObjects.Add(targetMaster.networkIdentity.netId);
					originInventory = ((Component)originMaster).GetComponent<Inventory>();
					targetInventory = ((Component)targetMaster).GetComponent<Inventory>();
					originInventory.onInventoryChanged += OriginInventory_onInventoryChanged;
					originInventory.HandleInventoryChanged();
					originMaster.onBodyStart += OriginMaster_onBodyStart;
					targetMaster.onBodyStart += TargetMaster_onBodyStart;
					OriginMaster_onBodyStart(originMaster.GetBody());
					TargetMaster_onBodyStart(targetMaster.GetBody());
				}
			}

			private void RespawnIfInfestedDeath(CharacterBody obj)
			{
				//IL_002c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0032: Invalid comparison between Unknown and I4
				Debug.Log((object)("Clone died " + (object)obj));
				if (Object.op_Implicit((Object)(object)obj) && (int)obj.teamComponent.teamIndex != 1)
				{
					CreateDoppelganger(originMaster);
				}
			}

			private void TargetMaster_onBodyStart(CharacterBody obj)
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)obj))
				{
					targetBody = obj;
					obj.teamComponent.teamIndex = (TeamIndex)1;
					originMaster.networkIdentity.clientAuthorityOwner.clientOwnedObjects.Add(obj.networkIdentity.netId);
					targetMaster.networkIdentity.m_ClientAuthorityOwner = originMaster.networkIdentity.clientAuthorityOwner;
					obj.networkIdentity.m_ClientAuthorityOwner = originMaster.networkIdentity.clientAuthorityOwner;
					((Component)obj).GetComponent<CharacterNetworkTransform>().hasEffectiveAuthority = false;
				}
			}

			private void OriginMaster_onBodyStart(CharacterBody obj)
			{
			}

			public void OnDisable()
			{
				instances.Remove(this);
				if (Object.op_Implicit((Object)(object)originInventory))
				{
					originInventory.onInventoryChanged -= OriginInventory_onInventoryChanged;
				}
				if (Object.op_Implicit((Object)(object)originMaster))
				{
					originMaster.onBodyStart -= OriginMaster_onBodyStart;
				}
				if (Object.op_Implicit((Object)(object)targetMaster))
				{
					targetMaster.onBodyStart -= TargetMaster_onBodyStart;
				}
				RespawnIfInfestedDeath(targetBody);
			}

			private void OriginInventory_onInventoryChanged()
			{
				//IL_004f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Invalid comparison between Unknown and I4
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
				originInventory.GiveItem(Items.CutHp, 1 - originInventory.GetItemCount(Items.CutHp));
				if (Object.op_Implicit((Object)(object)targetInventory))
				{
					if (Object.op_Implicit((Object)(object)targetBody) && (int)targetBody.teamComponent.teamIndex != 1)
					{
						targetInventory.RemoveItem(Items.CutHp, 1);
						targetInventory.RemoveItem(Items.AdaptiveArmor, 1);
						return;
					}
					targetInventory.itemAcquisitionOrder.Clear();
					int[] itemStacks = targetInventory.itemStacks;
					int num = 0;
					ArrayUtils.SetAll<int>(itemStacks, ref num);
					targetInventory.AddItemsFrom(originInventory.itemStacks, defaultItemCopyFilterDelegate);
					targetInventory.SetEquipmentIndex(originInventory.currentEquipmentState.equipmentIndex);
					targetInventory.GiveItem(Items.AdaptiveArmor, 1);
					targetInventory.GiveItem(Items.CutHp, 1);
					targetInventory.infusionBonus = originInventory.infusionBonus;
					targetInventory.beadAppliedDamage = originInventory.beadAppliedDamage;
					targetInventory.beadAppliedHealth = originInventory.beadAppliedHealth;
					targetInventory.beadAppliedRegen = originInventory.beadAppliedRegen;
				}
			}

			private static bool DefaultItemCopyFilter(ItemIndex itemIndex)
			{
				return true;
			}
		}

		public class MirrorSwarms_MovementController : MonoBehaviour
		{
			public static List<MirrorSwarms_MovementController> instances = new List<MirrorSwarms_MovementController>();

			public CharacterMaster originMaster;

			public CharacterMaster targetMaster;

			public CharacterBody originBody;

			public CharacterBody targetBody;

			public InputBankTest targetInput;

			public InputBankTest originInputs;

			public CharacterMotor targetMotor;

			public EquipmentSlot originEquipmentSlot;

			public HurtBox targetTarget;

			private float teleportAttemptTimer = 1f;

			public GameObject helperPrefab;

			public MirrorSwarms_IsHost originBodyIdentifier;

			public MirrorSwarms_IsClone targetBodyIdentifier;

			public void OnEnable()
			{
				if (Object.op_Implicit((Object)(object)originMaster))
				{
					instances.Add(this);
					targetMaster = ((Component)this).GetComponent<CharacterMaster>();
					if (Object.op_Implicit((Object)(object)targetMaster))
					{
						Object.Destroy((Object)(object)((Component)targetMaster).GetComponent<BaseAI>());
						targetMaster.aiComponents = (BaseAI[])(object)new BaseAI[0];
					}
					targetMaster.onBodyStart += TargetMaster_onBodyStart;
					originMaster.onBodyStart += OriginMaster_onBodyStart;
					OriginMaster_onBodyStart(originMaster.GetBody());
					TargetMaster_onBodyStart(targetMaster.GetBody());
				}
				helperPrefab = LegacyResourcesAPI.Load<GameObject>("SpawnCards/HelperPrefab");
				Debug.Log((object)("MirrorSwarms_MovementController.OnEnable " + ((object)originMaster)?.ToString() + "  " + (object)targetMaster));
			}

			private void OriginMaster_onBodyStart(CharacterBody obj)
			{
				if (Object.op_Implicit((Object)(object)obj))
				{
					Debug.Log((object)("OriginMaster_onBodyStart " + (object)obj));
					originBody = obj;
					originInputs = originBody.inputBank;
					originEquipmentSlot = originBody.equipmentSlot;
					SharedBodySetup();
				}
			}

			public void SharedBodySetup()
			{
				if (!Object.op_Implicit((Object)(object)targetBody) || !Object.op_Implicit((Object)(object)originBody))
				{
					return;
				}
				originBodyIdentifier = ((Component)originBody).gameObject.GetComponent<MirrorSwarms_IsHost>();
				targetBodyIdentifier = ((Component)targetBody).gameObject.GetComponent<MirrorSwarms_IsClone>();
				if ((Object)(object)originBodyIdentifier == (Object)null)
				{
					originBodyIdentifier = ((Component)originBody).gameObject.AddComponent<MirrorSwarms_IsHost>();
				}
				if ((Object)(object)targetBodyIdentifier == (Object)null)
				{
					targetBodyIdentifier = ((Component)targetBody).gameObject.AddComponent<MirrorSwarms_IsClone>();
				}
				originBodyIdentifier.otherBody = targetBody;
				originBodyIdentifier.otherLink = targetBodyIdentifier;
				targetBodyIdentifier.otherBody = originBody;
				targetBodyIdentifier.otherLink = originBodyIdentifier;
				VoidSurvivorController component = ((Component)targetBody).GetComponent<VoidSurvivorController>();
				if (Object.op_Implicit((Object)(object)component))
				{
					VoidSurvivorController component2 = ((Component)originBody).GetComponent<VoidSurvivorController>();
					MirrorSwarms_SyncVoidSurv mirrorSwarms_SyncVoidSurv = ((Component)targetBody).GetComponent<MirrorSwarms_SyncVoidSurv>();
					if (!Object.op_Implicit((Object)(object)mirrorSwarms_SyncVoidSurv))
					{
						mirrorSwarms_SyncVoidSurv = ((Component)targetBody).gameObject.AddComponent<MirrorSwarms_SyncVoidSurv>();
					}
					mirrorSwarms_SyncVoidSurv.originVoidSurv = component2;
				}
				ChefController component3 = ((Component)targetBody).GetComponent<ChefController>();
				if (Object.op_Implicit((Object)(object)component3))
				{
					ChefController component4 = ((Component)originBody).GetComponent<ChefController>();
					MirrorSwarms_SyncCHEF mirrorSwarms_SyncCHEF = ((Component)targetBody).GetComponent<MirrorSwarms_SyncCHEF>();
					if (!Object.op_Implicit((Object)(object)mirrorSwarms_SyncCHEF))
					{
						mirrorSwarms_SyncCHEF = ((Component)targetBody).gameObject.AddComponent<MirrorSwarms_SyncCHEF>();
					}
					mirrorSwarms_SyncCHEF.originCHEF = component4;
				}
			}

			private void TargetMaster_onBodyStart(CharacterBody obj)
			{
				if (Object.op_Implicit((Object)(object)obj))
				{
					Debug.Log((object)("TargetMaster_onBodyStart " + (object)obj));
					targetBody = obj;
					((Component)targetBody).GetComponent<NetworkIdentity>().ForceAuthority(true);
					targetInput = targetBody.inputBank;
					targetMotor = targetBody.characterMotor;
					targetBody.AddTimedBuff(Buffs.HiddenInvincibility, 5f);
					SharedBodySetup();
				}
			}

			public void FixedUpdate()
			{
				//IL_00db: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0119: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Unknown result type (might be due to invalid IL or missing references)
				//IL_0183: Unknown result type (might be due to invalid IL or missing references)
				//IL_018d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0192: Unknown result type (might be due to invalid IL or missing references)
				//IL_0202: Unknown result type (might be due to invalid IL or missing references)
				//IL_0215: Unknown result type (might be due to invalid IL or missing references)
				//IL_0225: Unknown result type (might be due to invalid IL or missing references)
				//IL_0237: Unknown result type (might be due to invalid IL or missing references)
				//IL_0239: Unknown result type (might be due to invalid IL or missing references)
				//IL_023b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0240: Unknown result type (might be due to invalid IL or missing references)
				//IL_0248: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
				//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
				//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
				//IL_0278: Unknown result type (might be due to invalid IL or missing references)
				//IL_027a: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)targetInput) || !Object.op_Implicit((Object)(object)originBody))
				{
					return;
				}
				if (Object.op_Implicit((Object)(object)originEquipmentSlot))
				{
					targetTarget = originEquipmentSlot.currentTarget.hurtBox;
					if ((Object)(object)targetTarget == (Object)null)
					{
						originEquipmentSlot.ConfigureTargetFinderForEnemies();
						targetTarget = originEquipmentSlot.targetFinder.GetResults().FirstOrDefault();
					}
				}
				if (Object.op_Implicit((Object)(object)targetTarget))
				{
					InputBankTest obj = targetInput;
					Vector3 val = ((Component)targetTarget).transform.position - targetInput.aimOrigin;
					obj.aimDirection = ((Vector3)(ref val)).normalized;
				}
				else
				{
					targetInput.aimDirection = originInputs.aimDirection;
				}
				targetInput.interact = originInputs.interact;
				targetInput.activateEquipment = originInputs.activateEquipment;
				float num = Vector3.Distance(originBody.corePosition, targetBody.corePosition);
				if (!(num > 40f))
				{
					return;
				}
				teleportAttemptTimer -= Time.fixedDeltaTime;
				if (teleportAttemptTimer <= 0f)
				{
					teleportAttemptTimer = 1f;
					Vector3 val2 = originBody.characterMotor.velocity / 10f;
					val2.y = 0f;
					float num2 = Random.Range(1f, 3f);
					float num3 = Random.Range(1f, 3f);
					if (Random.Range(0, 2) == 1)
					{
						num2 *= -1f;
					}
					if (Random.Range(0, 2) == 1)
					{
						num3 *= -1f;
					}
					Vector3 val3 = default(Vector3);
					((Vector3)(ref val3))..ctor(originBody.corePosition.x + num2, originBody.corePosition.y, originBody.corePosition.z + num3);
					val3 += val2;
					TeleportHelper.TeleportBody(targetBody, val3, false);
					GameObject teleportEffectPrefab = Run.instance.GetTeleportEffectPrefab(((Component)targetBody).gameObject);
					if (Object.op_Implicit((Object)(object)teleportEffectPrefab))
					{
						EffectManager.SimpleEffect(teleportEffectPrefab, val3, Quaternion.identity, true);
					}
					targetBody.AddTimedBuff(Buffs.IgnoreFallDamage, 3f);
					targetMotor.rootMotion = originBody.characterMotor.rootMotion;
					targetMotor.moveDirection = originBody.characterMotor.moveDirection;
					targetMotor.velocity = originBody.characterMotor.velocity;
				}
			}

			public void Update()
			{
				//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: Unknown result type (might be due to invalid IL or missing references)
				if (Object.op_Implicit((Object)(object)originInputs))
				{
					((ButtonState)(ref targetInput.skill1)).PushState(originInputs.skill1.down);
					((ButtonState)(ref targetInput.skill2)).PushState(originInputs.skill2.down);
					((ButtonState)(ref targetInput.skill4)).PushState(originInputs.skill4.down);
					if (originInputs.interact.wasDown)
					{
						targetInput.moveVector = Vector3.zeroVector;
						return;
					}
					targetInput.moveVector = originInputs.moveVector;
					((ButtonState)(ref targetInput.skill3)).PushState(originInputs.skill3.down);
					targetInput.sprint = originInputs.sprint;
					targetInput.jump = originInputs.jump;
				}
			}

			public void OnDisable()
			{
				instances.Remove(this);
				targetMaster.onBodyStart -= TargetMaster_onBodyStart;
				originMaster.onBodyStart -= OriginMaster_onBodyStart;
				if (Object.op_Implicit((Object)(object)originBodyIdentifier))
				{
					originBodyIdentifier.numberOfClones--;
				}
			}
		}

		public class MirrorSwarms_BodyLinker : MonoBehaviour
		{
			public CharacterBody thisBody;

			public CharacterBody otherBody;

			public MirrorSwarms_BodyLinker otherLink;

			public bool added;

			public int numberOfClones;

			public float preEqualizedMoveSpeed;

			public float preEqualizedAcceleration;

			public void Add(MirrorSwarms_BodyLinker link)
			{
				if (Object.op_Implicit((Object)(object)link) && !link.added)
				{
					link.added = true;
					numberOfClones++;
				}
			}

			public void OnEnable()
			{
				thisBody = ((Component)this).GetComponent<CharacterBody>();
			}

			public void OnDisable()
			{
				if (Object.op_Implicit((Object)(object)otherLink))
				{
					otherLink.numberOfClones--;
				}
			}
		}

		public class MirrorSwarms_SyncVoidSurv : MonoBehaviour
		{
			public VoidSurvivorController originVoidSurv;

			public VoidSurvivorController targetVoidSurv;

			public void OnEnable()
			{
				if (!Object.op_Implicit((Object)(object)targetVoidSurv))
				{
					targetVoidSurv = ((Component)this).GetComponent<VoidSurvivorController>();
				}
				if (Object.op_Implicit((Object)(object)targetVoidSurv))
				{
					targetVoidSurv.corruptionForFullDamage = 0f;
					targetVoidSurv.corruptionForFullHeal = 0f;
					targetVoidSurv.corruptionFractionPerSecondWhileCorrupted = 0f;
					targetVoidSurv.corruptionPerCrit = 0f;
					targetVoidSurv.corruptionPerSecondOutOfCombat = 0f;
					targetVoidSurv.corruptionPerSecondInCombat = 0f;
				}
			}

			public void FixedUpdate()
			{
				if (Object.op_Implicit((Object)(object)originVoidSurv))
				{
					targetVoidSurv._corruption = originVoidSurv.corruption;
				}
			}
		}

		public class MirrorSwarms_SyncCHEF : MonoBehaviour
		{
			public ChefController originCHEF;

			public ChefController targetCHEF;

			public void OnEnable()
			{
				if (!Object.op_Implicit((Object)(object)targetCHEF))
				{
					targetCHEF = ((Component)this).GetComponent<ChefController>();
				}
			}

			public void FixedUpdate()
			{
				if (Object.op_Implicit((Object)(object)originCHEF))
				{
					targetCHEF.localCleaverFired = originCHEF.localCleaverFired;
					targetCHEF._cleaverAway = originCHEF._cleaverAway;
					targetCHEF._recallCleaver = originCHEF._recallCleaver;
				}
			}
		}

		public class MirrorSwarms_IsClone : MirrorSwarms_BodyLinker
		{
		}

		public class MirrorSwarms_IsHost : MirrorSwarms_BodyLinker
		{
		}

		public class SendMirrorSwarms : ChatMessageBase
		{
			public GameObject originMaster;

			public GameObject targetMaster;

			public override string ConstructChatString()
			{
				Debug.Log((object)("SendMirrorSwarms | " + ((object)originMaster)?.ToString() + "  " + (object)targetMaster));
				CharacterMaster component = originMaster.GetComponent<CharacterMaster>();
				if (NetworkServer.active)
				{
					MirrorSwarms_ServerSided mirrorSwarms_ServerSided = targetMaster.AddComponent<MirrorSwarms_ServerSided>();
					mirrorSwarms_ServerSided.originMaster = component;
					mirrorSwarms_ServerSided.OnEnable();
				}
				if (Object.op_Implicit((Object)(object)component) && ((NetworkBehaviour)component.playerCharacterMasterController.networkUser).isLocalPlayer)
				{
					MirrorSwarms_MovementController mirrorSwarms_MovementController = targetMaster.AddComponent<MirrorSwarms_MovementController>();
					mirrorSwarms_MovementController.originMaster = component;
					mirrorSwarms_MovementController.OnEnable();
				}
				else
				{
					CharacterMaster component2 = originMaster.GetComponent<CharacterMaster>();
					Object.Destroy((Object)(object)targetMaster.GetComponent<BaseAI>());
					component2.aiComponents = (BaseAI[])(object)new BaseAI[0];