Decompiled source of CustomEmotesAPI v2.4.3

CustomEmotesAPI.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using EmotesAPI;
using Generics.Dynamics;
using KinematicCharacterController;
using On.RoR2;
using On.RoR2.UI;
using R2API;
using R2API.Networking;
using R2API.Networking.Interfaces;
using R2API.Utils;
using Rewired;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.ConVar;
using RoR2.UI;
using TMPro;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Animations;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("CustomEmotesAPI")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CustomEmotesAPI")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7ea1c941-92dd-4435-a3ac-87b885484c2a")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
internal static class AnimationReplacements
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_Awake <>9__1_0;

		public static hook_Init <>9__6_0;

		internal void <RunAll>b__1_0(orig_Awake orig, HUD self)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Expected O, but got Unknown
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Expected O, but got Unknown
			orig.Invoke(self);
			g = Object.Instantiate<GameObject>(Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/emotewheel/emotewheel.prefab"));
			TextMeshProUGUI[] componentsInChildren = g.GetComponentsInChildren<TextMeshProUGUI>();
			foreach (TextMeshProUGUI val in componentsInChildren)
			{
				TextMeshProUGUI targetText = self.moneyText.targetText;
				((TMP_Text)val).font = ((TMP_Text)targetText).font;
				((TMP_Text)val).fontMaterial = ((TMP_Text)targetText).fontMaterial;
				((TMP_Text)val).fontSharedMaterial = ((TMP_Text)targetText).fontSharedMaterial;
			}
			g.transform.SetParent(self.mainContainer.transform);
			g.transform.localPosition = new Vector3(0f, 0f, 0f);
			EmoteWheel emoteWheel = g.AddComponent<EmoteWheel>();
			Transform[] componentsInChildren2 = g.GetComponentsInChildren<Transform>();
			foreach (Transform val2 in componentsInChildren2)
			{
				if (((Object)((Component)val2).gameObject).name.StartsWith("Emote"))
				{
					emoteWheel.gameObjects.Add(((Component)val2).gameObject);
				}
				if (((Object)((Component)val2).gameObject).name.StartsWith("MousePos"))
				{
					emoteWheel.text = ((Component)val2).gameObject;
				}
				if (((Object)((Component)val2).gameObject).name == "Center")
				{
					emoteWheel.joy = ((Component)val2).gameObject.GetComponent<Image>();
				}
				if (((Object)((Component)val2).gameObject).name == "CurrentEmote")
				{
					EmoteWheel.dontPlayButton = ((Component)val2).gameObject;
				}
			}
			if (CustomEmotesAPI.audioContainers.Count != 0)
			{
				return;
			}
			GameObject val3 = new GameObject();
			((Object)val3).name = "Audio Container Holder";
			Object.DontDestroyOnLoad((Object)(object)val3);
			foreach (string[] startEvent in BoneMapper.startEvents)
			{
				GameObject val4 = new GameObject();
				if (startEvent[0] != "")
				{
					((Object)val4).name = startEvent[0] + "_AudioContainer";
				}
				AudioContainer audioContainer = val4.AddComponent<AudioContainer>();
				val4.transform.SetParent(val3.transform);
				CustomEmotesAPI.audioContainers.Add(val4);
			}
		}

		internal void <ChangeAnims>b__6_0(orig_Init orig)
		{
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0242: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke();
			if (setup)
			{
				return;
			}
			setup = true;
			ApplyAnimationStuff(Survivors.Croco, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/acrid.prefab");
			ApplyAnimationStuff(Survivors.Mage, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/artificer.prefab");
			Survivors.Mage.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.9f;
			ApplyAnimationStuff(Survivors.Captain, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/captain.prefab");
			Survivors.Captain.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.1f;
			ApplyAnimationStuff(Survivors.Engi, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/engi.prefab");
			Survivors.Engi.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1f;
			ApplyAnimationStuff(Survivors.Loader, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/loader.prefab");
			Survivors.Loader.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.2f;
			ApplyAnimationStuff(Survivors.Merc, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/merc.prefab");
			Survivors.Merc.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.95f;
			ApplyAnimationStuff(Survivors.Toolbot, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/mult1.prefab");
			Survivors.Toolbot.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.5f;
			ApplyAnimationStuff(Survivors.Treebot, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/rex.prefab");
			ApplyAnimationStuff(Survivors.Commando, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/commandoFixed.prefab");
			Survivors.Commando.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.85f;
			ApplyAnimationStuff(Survivors.Huntress, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/huntress2022.prefab");
			Survivors.Huntress.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.9f;
			ApplyAnimationStuff(Survivors.Bandit2, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/bandit.prefab");
			ApplyAnimationStuff(SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion()), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/voidsurvivor.prefab");
			SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion()).bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.85f;
			ApplyAnimationStuff(SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerBody.prefab").WaitForCompletion()), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/railgunner.prefab");
			SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerBody.prefab").WaitForCompletion()).bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.05f;
			ApplyAnimationStuff(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Heretic/HereticBody.prefab").WaitForCompletion(), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/heretricburried.prefab", 3);
			EnemyArmatures();
			foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
			{
				switch (((Object)allSurvivorDef.bodyPrefab).name)
				{
				case "RobPaladinBody":
					if (Settings.Paladin.Value)
					{
						GameObject val4 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/animPaladin.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val4);
						val4.GetComponentInChildren<BoneMapper>().scale = 1.5f;
					}
					break;
				case "EnforcerBody":
					if (Settings.Enforcer.Value)
					{
						GameObject val = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/enforcer.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val);
						val.GetComponentInChildren<BoneMapper>().scale = 1.2f;
					}
					break;
				case "NemesisEnforcerBody":
					if (Settings.Enforcer.Value)
					{
						GameObject rigToAnimate12 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/nemforcer.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate12);
					}
					break;
				case "CHEF":
					if (Settings.Chef.Value)
					{
						GameObject rigToAnimate22 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/chef.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate22, jank: true);
					}
					break;
				case "HolomancerBody":
					if (Settings.Holomancer.Value)
					{
						GameObject rigToAnimate15 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/holomancer.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate15);
					}
					break;
				case "SettBody":
					if (Settings.Sett.Value)
					{
						GameObject rigToAnimate8 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/Sett.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate8);
					}
					break;
				case "TracerBody":
					if (Settings.Tracer.Value)
					{
						GameObject rigToAnimate2 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/imalreadytracer.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate2);
					}
					break;
				case "HenryBody":
					if (Settings.Henry.Value)
					{
						GameObject rigToAnimate20 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/henry.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate20);
					}
					break;
				case "AurelionSolBody":
					if (Settings.SolSupport.Value)
					{
						GameObject rigToAnimate17 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/solreordered4.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate17);
					}
					break;
				case "Katarina":
					if (Settings.Katarina.Value)
					{
						GameObject rigToAnimate13 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/katarina.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate13);
					}
					break;
				case "MinerBody":
					if (Settings.Miner.Value)
					{
						GameObject rigToAnimate10 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/miner.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate10, jank: true);
					}
					break;
				case "PhoenixBody":
					if (Settings.Phoenix.Value)
					{
						GameObject rigToAnimate6 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/ppwright.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate6);
					}
					break;
				case "ScoutBody":
					if (Settings.Scout.Value)
					{
						GameObject rigToAnimate4 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/scout.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate4);
					}
					break;
				case "JinxBody":
					if (Settings.Jinx.Value)
					{
						GameObject rigToAnimate23 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/jinx.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate23);
					}
					break;
				case "TF2SollyBody":
					if (Settings.Soldier.Value)
					{
						GameObject rigToAnimate21 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/soldier.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate21);
					}
					break;
				case "DragonScavengerBody":
					if (Settings.Scavenger.Value)
					{
						GameObject rigToAnimate19 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/PlayableScavenger.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate19);
					}
					break;
				case "GokuBody":
					if (Settings.Goku.Value)
					{
						GameObject rigToAnimate18 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/goku1.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate18);
					}
					break;
				case "TrunksBody":
					if (Settings.Trunks.Value)
					{
						GameObject rigToAnimate16 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/trunks.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate16);
					}
					break;
				case "VegetaBody":
					if (Settings.Vegeta.Value)
					{
						GameObject rigToAnimate14 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/vegeta.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate14);
					}
					break;
				case "NemCommandoBody":
					if (Settings.Nemmando.Value)
					{
						GameObject val3 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/nemmando9.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val3);
						val3.GetComponent<BoneMapper>().scale = 1f;
					}
					break;
				case "AmpBody":
					if (Settings.Amp.Value)
					{
						GameObject rigToAnimate11 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/amp2.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate11);
					}
					break;
				case "PathfinderBody":
					if (Settings.Pathfinder.Value)
					{
						GameObject rigToAnimate9 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/pathfinder1.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate9);
					}
					break;
				case "TF2MedicBody":
					if (Settings.TF2Medic.Value)
					{
						GameObject rigToAnimate7 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/medic3.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate7);
					}
					break;
				case "Executioner2Body":
					if (Settings.Executioner.Value)
					{
						GameObject val2 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/executioner4.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val2);
						val2.GetComponent<BoneMapper>().scale = 1f;
					}
					break;
				case "SpearmanBody":
					if (Settings.Spearman.Value)
					{
						GameObject rigToAnimate5 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/SpearManEmoteSkeleton.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate5);
					}
					break;
				case "VoidJailerSurvivor":
					if (Settings.VoidJailer.Value)
					{
						GameObject rigToAnimate3 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/voidjailer_emoteskeleton.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate3);
					}
					break;
				case "RobDriverBody":
					if (Settings.Baby.Value)
					{
						GameObject rigToAnimate = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/baby.prefab");
						CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate);
					}
					break;
				}
			}
		}
	}

	internal static GameObject g;

	internal static bool setup;

	internal static void RunAll()
	{
		//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_0026: Expected O, but got Unknown
		ChangeAnims();
		object obj = <>c.<>9__1_0;
		if (obj == null)
		{
			hook_Awake val = delegate(orig_Awake orig, HUD self)
			{
				//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c1: Expected O, but got Unknown
				//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f6: Expected O, but got Unknown
				orig.Invoke(self);
				g = Object.Instantiate<GameObject>(Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/emotewheel/emotewheel.prefab"));
				TextMeshProUGUI[] componentsInChildren = g.GetComponentsInChildren<TextMeshProUGUI>();
				foreach (TextMeshProUGUI val2 in componentsInChildren)
				{
					TextMeshProUGUI targetText = self.moneyText.targetText;
					((TMP_Text)val2).font = ((TMP_Text)targetText).font;
					((TMP_Text)val2).fontMaterial = ((TMP_Text)targetText).fontMaterial;
					((TMP_Text)val2).fontSharedMaterial = ((TMP_Text)targetText).fontSharedMaterial;
				}
				g.transform.SetParent(self.mainContainer.transform);
				g.transform.localPosition = new Vector3(0f, 0f, 0f);
				EmoteWheel emoteWheel = g.AddComponent<EmoteWheel>();
				Transform[] componentsInChildren2 = g.GetComponentsInChildren<Transform>();
				foreach (Transform val3 in componentsInChildren2)
				{
					if (((Object)((Component)val3).gameObject).name.StartsWith("Emote"))
					{
						emoteWheel.gameObjects.Add(((Component)val3).gameObject);
					}
					if (((Object)((Component)val3).gameObject).name.StartsWith("MousePos"))
					{
						emoteWheel.text = ((Component)val3).gameObject;
					}
					if (((Object)((Component)val3).gameObject).name == "Center")
					{
						emoteWheel.joy = ((Component)val3).gameObject.GetComponent<Image>();
					}
					if (((Object)((Component)val3).gameObject).name == "CurrentEmote")
					{
						EmoteWheel.dontPlayButton = ((Component)val3).gameObject;
					}
				}
				if (CustomEmotesAPI.audioContainers.Count == 0)
				{
					GameObject val4 = new GameObject();
					((Object)val4).name = "Audio Container Holder";
					Object.DontDestroyOnLoad((Object)(object)val4);
					foreach (string[] startEvent in BoneMapper.startEvents)
					{
						GameObject val5 = new GameObject();
						if (startEvent[0] != "")
						{
							((Object)val5).name = startEvent[0] + "_AudioContainer";
						}
						AudioContainer audioContainer = val5.AddComponent<AudioContainer>();
						val5.transform.SetParent(val4.transform);
						CustomEmotesAPI.audioContainers.Add(val5);
					}
				}
			};
			<>c.<>9__1_0 = val;
			obj = (object)val;
		}
		HUD.Awake += (hook_Awake)obj;
	}

	internal static void EnemyArmatures()
	{
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: 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_028c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0291: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0394: Unknown result type (might be due to invalid IL or missing references)
		//IL_0399: Unknown result type (might be due to invalid IL or missing references)
		//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_042b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0430: Unknown result type (might be due to invalid IL or missing references)
		//IL_045d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0462: Unknown result type (might be due to invalid IL or missing references)
		//IL_048f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0494: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_04d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0537: Unknown result type (might be due to invalid IL or missing references)
		//IL_053c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0558: Unknown result type (might be due to invalid IL or missing references)
		//IL_055d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0570: Unknown result type (might be due to invalid IL or missing references)
		//IL_0584: Unknown result type (might be due to invalid IL or missing references)
		//IL_0589: Unknown result type (might be due to invalid IL or missing references)
		//IL_05bb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_0620: Unknown result type (might be due to invalid IL or missing references)
		//IL_0625: Unknown result type (might be due to invalid IL or missing references)
		//IL_0652: Unknown result type (might be due to invalid IL or missing references)
		//IL_0657: Unknown result type (might be due to invalid IL or missing references)
		//IL_0684: Unknown result type (might be due to invalid IL or missing references)
		//IL_0689: Unknown result type (might be due to invalid IL or missing references)
		//IL_06fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_072c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0731: Unknown result type (might be due to invalid IL or missing references)
		//IL_0744: Unknown result type (might be due to invalid IL or missing references)
		//IL_0758: Unknown result type (might be due to invalid IL or missing references)
		//IL_075d: Unknown result type (might be due to invalid IL or missing references)
		//IL_076d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0772: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0903: Unknown result type (might be due to invalid IL or missing references)
		//IL_0908: Unknown result type (might be due to invalid IL or missing references)
		Import("RoR2/Base/Brother/BrotherBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/brother.prefab");
		Import("RoR2/Base/Brother/BrotherHurtBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/brotherhurt.prefab");
		Import("RoR2/Base/ClayBruiser/ClayBruiserBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/templar.prefab");
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Beetle/BeetleBody.prefab").WaitForCompletion();
		if (val.GetComponentInChildren<SkinnedMeshRenderer>().bones.Length == 0)
		{
			List<Transform> list = new List<Transform>();
			Transform[] componentsInChildren = val.GetComponentsInChildren<Transform>();
			foreach (Transform val2 in componentsInChildren)
			{
				if (!((Object)val2).name.Contains("Hurtbox") && !((Object)val2).name.Contains("BeetleBody") && !((Object)val2).name.Contains("Mesh") && !((Object)val2).name.Contains("mdl"))
				{
					list.Add(val2);
				}
			}
			Transform value = list[14];
			list[14] = list[11];
			list[11] = value;
			value = list[15];
			list[15] = list[12];
			list[12] = value;
			value = list[16];
			list[16] = list[13];
			list[13] = value;
			SkinnedMeshRenderer[] componentsInChildren2 = val.GetComponentsInChildren<SkinnedMeshRenderer>();
			foreach (SkinnedMeshRenderer val3 in componentsInChildren2)
			{
				val3.bones = list.ToArray();
			}
			SkinnedMeshRenderer[] componentsInChildren3 = val.GetComponentsInChildren<SkinnedMeshRenderer>();
			componentsInChildren3[0].sharedMesh = Assets.Load<Mesh>("@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/beetleMesh.mesh");
		}
		Import("RoR2/Base/Beetle/BeetleBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/beetle_emoteskeleton.prefab");
		Import("RoR2/DLC1/AcidLarva/AcidLarvaBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/AcidLarva1.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/AcidLarva/AcidLarvaBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 0.6f;
		Import("RoR2/Base/Titan/TitanGoldBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Aurelionite.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Titan/TitanGoldBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 5.7f;
		Import("RoR2/Base/Beetle/BeetleGuardBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Beetle guard.prefab");
		Import("RoR2/Base/Beetle/BeetleQueen2Body.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/beetle queen1.prefab");
		Import("RoR2/DLC1/ClayGrenadier/ClayGrenadierBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/claygrenadier.prefab");
		Import("RoR2/Base/Bison/BisonBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/bison.prefab");
		Import("RoR2/DLC1/FlyingVermin/FlyingVerminBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/flyingvermin1.prefab");
		Import("RoR2/Base/Bell/BellBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/brass contraption2.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Bell/BellBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.enableAnimatorOnDeath = false;
		Import("RoR2/Base/Vulture/VultureBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Vulture_emoteskeleton.prefab");
		Import("RoR2/DLC1/MajorAndMinorConstruct/MinorConstructBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/minorConstruct4.prefab");
		Transform transform = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/MajorAndMinorConstruct/MinorConstructBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()).transform;
		transform.localPosition += new Vector3(0f, 3f, 0f);
		Import("RoR2/DLC1/VoidJailer/VoidJailerBody.prefab", "@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/voidjailer2.prefab");
		Import("RoR2/DLC1/Vermin/VerminBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/vermin1.prefab");
		Import("RoR2/Base/LemurianBruiser/LemurianBruiserBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/elderlemurian.prefab");
		Import("RoR2/DLC1/Gup/GupBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/gup.prefab");
		Import("RoR2/DLC1/Gup/GeepBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/geep.prefab");
		Import("RoR2/DLC1/Gup/GipBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/gip.prefab");
		Import("RoR2/Base/GreaterWisp/GreaterWispBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/greaterwisp.prefab");
		Import("RoR2/Base/HermitCrab/HermitCrabBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/hermitcrab.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/HermitCrab/HermitCrabBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 1.3f;
		Import("RoR2/Base/Imp/ImpBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/imp.prefab");
		Import("RoR2/Base/Jellyfish/JellyfishBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/jellyfish.prefab");
		Import("RoR2/Base/Lemurian/LemurianBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/lemurian.prefab");
		Import("RoR2/Base/Wisp/WispBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/lesserwisp.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Wisp/WispBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 0.8f;
		Import("RoR2/Base/LunarExploder/LunarExploderBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/lunarexploder.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarExploder/LunarExploderBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 2f;
		Import("RoR2/Base/LunarGolem/LunarGolemBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/lunargolem.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarGolem/LunarGolemBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 5f;
		Import("RoR2/Base/LunarWisp/LunarWispBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/lunarwisp.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/LunarWisp/LunarWispBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 2f;
		Import("RoR2/Base/MiniMushroom/MiniMushroomBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/minimushroom.prefab");
		Import("RoR2/Base/Parent/ParentBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Parent1.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Parent/ParentBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 5f;
		Import("RoR2/Base/RoboBallBoss/RoboBallMiniBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/solusprobe.prefab");
		Import("RoR2/Base/RoboBallBoss/RoboBallBossBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/soluscontrolunit.prefab");
		Import("RoR2/Base/RoboBallBoss/SuperRoboBallBossBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/alloyworshipunit.prefab");
		Import("RoR2/Base/Golem/GolemBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/stonegolem.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Golem/GolemBody.prefab").WaitForCompletion().GetComponentInChildren<PrintController>()
			.maxPrintHeight = 15f;
		Transform transform2 = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Golem/GolemBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()).transform;
		transform2.localPosition -= new Vector3(0f, 0.8f, 0f);
		Import("RoR2/DLC1/VoidBarnacle/VoidBarnacleBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidbarnacle.prefab");
		Import("RoR2/Base/Nullifier/NullifierBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidreaver.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Nullifier/NullifierBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 4.8f;
		Import("RoR2/Base/Grandparent/GrandParentBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/grandparent.prefab");
		Import("RoR2/Base/ImpBoss/ImpBossBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/impoverlord.prefab");
		Import("RoR2/DLC1/EliteVoid/VoidInfestorBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidinfestor.prefab");
		Import("RoR2/Base/Scav/ScavBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Scavenger.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Scav/ScavBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 3.8f;
		Import("RoR2/Base/Titan/TitanBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/stonetitan.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Titan/TitanBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 5.7f;
		Import("RoR2/DLC1/VoidMegaCrab/VoidMegaCrabBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/pussydevastator.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 7f;
		Import("RoR2/DLC1/MajorAndMinorConstruct/MegaConstructBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/megaconstruct.prefab");
		Import("RoR2/Base/Vagrant/VagrantBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/vagrant.prefab");
		Import("RoR2/Base/MagmaWorm/MagmaWormBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/worm1.prefab");
		Import("RoR2/Base/ElectricWorm/ElectricWormBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/worm2.prefab");
		Import("RoR2/Base/Gravekeeper/GravekeeperBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/grovetender.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Gravekeeper/GravekeeperBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 5.9f;
		Import("RoR2/Base/ClayBoss/ClayBossBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/dunestrider.prefab");
		Transform transform3 = ((Component)Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ClayBoss/ClayBossBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()).transform;
		transform3.localPosition += new Vector3(0f, 5f, 0f);
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ClayBoss/ClayBossBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 10f;
		Import("RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase1.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidling1.prefab");
		Import("RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase2.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidling2.prefab");
		Import("RoR2/DLC1/VoidRaidCrab/MiniVoidRaidCrabBodyPhase3.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidling3.prefab");
		Import("RoR2/Base/Engi/EngiWalkerTurretBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/walkingturret.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/ClayBoss/ClayBossBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 0.9f;
		Import("RoR2/Base/Engi/EngiTurretBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/turret.prefab");
		Import("RoR2/Base/Shopkeeper/ShopkeeperBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/newt.prefab");
		Import("RoR2/Base/Drones/BackupDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/backupdrone.prefab");
		Import("RoR2/Base/Drones/Turret1Body.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/buyableturret.prefab");
		Import("RoR2/DLC1/DroneCommander/DroneCommanderBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/dronecommander.prefab");
		Import("RoR2/Base/Drones/EmergencyDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/emergency.prefab");
		Import("RoR2/Base/Drones/EquipmentDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/equipmentdrone.prefab");
		Import("RoR2/Base/Drones/FlameDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/flamedrone.prefab");
		Import("RoR2/Base/Drones/Drone1Body.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/gunnerdrone.prefab");
		Import("RoR2/Base/Drones/Drone2Body.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/healdrone.prefab");
		Import("RoR2/Base/Drones/MegaDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/megadrone.prefab");
		Import("RoR2/Base/Drones/MissileDroneBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/notenemies/missiledrone.prefab");
		Import("RoR2/Base/Nullifier/NullifierAllyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidreaverfrien.prefab");
		Import("RoR2/Base/BeetleGland/BeetleGuardAllyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/Beetle guardfrien.prefab");
		Import("RoR2/DLC1/VoidJailer/VoidJailerAllyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/voidjailer2frien.prefab");
		Import("RoR2/DLC1/VoidMegaCrab/VoidMegaCrabAllyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/pussydevastatorfrien.prefab");
		Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidMegaCrab/VoidMegaCrabAllyBody.prefab").WaitForCompletion().GetComponentInChildren<BoneMapper>()
			.scale = 7f;
		Import("RoR2/Base/RoboBallBuddy/RoboBallGreenBuddyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/solusprobefrien1.prefab");
		Import("RoR2/Base/RoboBallBuddy/RoboBallRedBuddyBody.prefab", "@CustomEmotesAPI_enemyskeletons:assets/myprioritiesarestraightnt/enemies/solusprobefrien2.prefab");
	}

	public static void DebugBones(string resource, int pos = 0)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		StringBuilder stringBuilder = new StringBuilder();
		GameObject val = Addressables.LoadAssetAsync<GameObject>((object)resource).WaitForCompletion();
		stringBuilder.Append(((object)val).ToString() + "\n");
		SkinnedMeshRenderer[] componentsInChildren = val.GetComponentsInChildren<SkinnedMeshRenderer>();
		stringBuilder.Append($"rendererererer: {componentsInChildren[pos]}\n");
		stringBuilder.Append($"bone count: {componentsInChildren[pos].bones.Length}\n");
		stringBuilder.Append($"mesh count: {componentsInChildren.Length}\n");
		stringBuilder.Append("root bone: " + ((Object)componentsInChildren[pos].rootBone).name + "\n");
		stringBuilder.Append(resource + ":\n");
		if (componentsInChildren[pos].bones.Length == 0)
		{
			stringBuilder.Append("No bones");
		}
		else
		{
			stringBuilder.Append("[");
			Transform[] bones = componentsInChildren[pos].bones;
			foreach (Transform val2 in bones)
			{
				stringBuilder.Append("'" + ((Object)val2).name + "', ");
			}
			stringBuilder.Remove(stringBuilder.Length - 2, 2);
			stringBuilder.Append("]");
		}
		stringBuilder.Append("\n\n");
		DebugClass.Log(stringBuilder.ToString());
	}

	internal static void Import(string prefab, string skeleton, bool hidemesh = true)
	{
		//IL_002c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		Assets.Load<GameObject>(skeleton).GetComponent<Animator>().runtimeAnimatorController = Object.Instantiate<GameObject>(Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/animationreplacements/commando.prefab")).GetComponent<Animator>().runtimeAnimatorController;
		ApplyAnimationStuff(Addressables.LoadAssetAsync<GameObject>((object)prefab).WaitForCompletion(), Assets.Load<GameObject>(skeleton), 0, hidemesh, jank: false, revertBonePositions: true);
	}

	internal static void ChangeAnims()
	{
		//IL_0015: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0020: Expected O, but got Unknown
		object obj = <>c.<>9__6_0;
		if (obj == null)
		{
			hook_Init val = delegate(orig_Init orig)
			{
				//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
				//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_0217: Unknown result type (might be due to invalid IL or missing references)
				//IL_021c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0242: Unknown result type (might be due to invalid IL or missing references)
				//IL_0247: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke();
				if (!setup)
				{
					setup = true;
					ApplyAnimationStuff(Survivors.Croco, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/acrid.prefab");
					ApplyAnimationStuff(Survivors.Mage, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/artificer.prefab");
					Survivors.Mage.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.9f;
					ApplyAnimationStuff(Survivors.Captain, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/captain.prefab");
					Survivors.Captain.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.1f;
					ApplyAnimationStuff(Survivors.Engi, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/engi.prefab");
					Survivors.Engi.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1f;
					ApplyAnimationStuff(Survivors.Loader, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/loader.prefab");
					Survivors.Loader.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.2f;
					ApplyAnimationStuff(Survivors.Merc, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/merc.prefab");
					Survivors.Merc.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.95f;
					ApplyAnimationStuff(Survivors.Toolbot, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/mult1.prefab");
					Survivors.Toolbot.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.5f;
					ApplyAnimationStuff(Survivors.Treebot, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/rex.prefab");
					ApplyAnimationStuff(Survivors.Commando, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/commandoFixed.prefab");
					Survivors.Commando.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.85f;
					ApplyAnimationStuff(Survivors.Huntress, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/huntress2022.prefab");
					Survivors.Huntress.bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.9f;
					ApplyAnimationStuff(Survivors.Bandit2, "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/bandit.prefab");
					ApplyAnimationStuff(SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion()), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/voidsurvivor.prefab");
					SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/VoidSurvivor/VoidSurvivorBody.prefab").WaitForCompletion()).bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 0.85f;
					ApplyAnimationStuff(SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerBody.prefab").WaitForCompletion()), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/railgunner.prefab");
					SurvivorCatalog.FindSurvivorDefFromBody(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/DLC1/Railgunner/RailgunnerBody.prefab").WaitForCompletion()).bodyPrefab.GetComponentInChildren<BoneMapper>().scale = 1.05f;
					ApplyAnimationStuff(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Heretic/HereticBody.prefab").WaitForCompletion(), "@CustomEmotesAPI_customemotespackage:assets/animationreplacements/heretricburried.prefab", 3);
					EnemyArmatures();
					foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs)
					{
						switch (((Object)allSurvivorDef.bodyPrefab).name)
						{
						case "RobPaladinBody":
							if (Settings.Paladin.Value)
							{
								GameObject val5 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/animPaladin.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val5);
								val5.GetComponentInChildren<BoneMapper>().scale = 1.5f;
							}
							break;
						case "EnforcerBody":
							if (Settings.Enforcer.Value)
							{
								GameObject val2 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/enforcer.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val2);
								val2.GetComponentInChildren<BoneMapper>().scale = 1.2f;
							}
							break;
						case "NemesisEnforcerBody":
							if (Settings.Enforcer.Value)
							{
								GameObject rigToAnimate12 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/nemforcer.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate12);
							}
							break;
						case "CHEF":
							if (Settings.Chef.Value)
							{
								GameObject rigToAnimate22 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/chef.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate22, jank: true);
							}
							break;
						case "HolomancerBody":
							if (Settings.Holomancer.Value)
							{
								GameObject rigToAnimate15 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/holomancer.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate15);
							}
							break;
						case "SettBody":
							if (Settings.Sett.Value)
							{
								GameObject rigToAnimate8 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/Sett.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate8);
							}
							break;
						case "TracerBody":
							if (Settings.Tracer.Value)
							{
								GameObject rigToAnimate2 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/imalreadytracer.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate2);
							}
							break;
						case "HenryBody":
							if (Settings.Henry.Value)
							{
								GameObject rigToAnimate20 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/henry.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate20);
							}
							break;
						case "AurelionSolBody":
							if (Settings.SolSupport.Value)
							{
								GameObject rigToAnimate17 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/solreordered4.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate17);
							}
							break;
						case "Katarina":
							if (Settings.Katarina.Value)
							{
								GameObject rigToAnimate13 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/katarina.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate13);
							}
							break;
						case "MinerBody":
							if (Settings.Miner.Value)
							{
								GameObject rigToAnimate10 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/miner.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate10, jank: true);
							}
							break;
						case "PhoenixBody":
							if (Settings.Phoenix.Value)
							{
								GameObject rigToAnimate6 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/ppwright.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate6);
							}
							break;
						case "ScoutBody":
							if (Settings.Scout.Value)
							{
								GameObject rigToAnimate4 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/scout.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate4);
							}
							break;
						case "JinxBody":
							if (Settings.Jinx.Value)
							{
								GameObject rigToAnimate23 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/jinx.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate23);
							}
							break;
						case "TF2SollyBody":
							if (Settings.Soldier.Value)
							{
								GameObject rigToAnimate21 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/soldier.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate21);
							}
							break;
						case "DragonScavengerBody":
							if (Settings.Scavenger.Value)
							{
								GameObject rigToAnimate19 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/PlayableScavenger.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate19);
							}
							break;
						case "GokuBody":
							if (Settings.Goku.Value)
							{
								GameObject rigToAnimate18 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/goku1.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate18);
							}
							break;
						case "TrunksBody":
							if (Settings.Trunks.Value)
							{
								GameObject rigToAnimate16 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/trunks.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate16);
							}
							break;
						case "VegetaBody":
							if (Settings.Vegeta.Value)
							{
								GameObject rigToAnimate14 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/vegeta.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate14);
							}
							break;
						case "NemCommandoBody":
							if (Settings.Nemmando.Value)
							{
								GameObject val4 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/nemmando9.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val4);
								val4.GetComponent<BoneMapper>().scale = 1f;
							}
							break;
						case "AmpBody":
							if (Settings.Amp.Value)
							{
								GameObject rigToAnimate11 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/amp2.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate11);
							}
							break;
						case "PathfinderBody":
							if (Settings.Pathfinder.Value)
							{
								GameObject rigToAnimate9 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/pathfinder1.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate9);
							}
							break;
						case "TF2MedicBody":
							if (Settings.TF2Medic.Value)
							{
								GameObject rigToAnimate7 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/medic3.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate7);
							}
							break;
						case "Executioner2Body":
							if (Settings.Executioner.Value)
							{
								GameObject val3 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/executioner4.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, val3);
								val3.GetComponent<BoneMapper>().scale = 1f;
							}
							break;
						case "SpearmanBody":
							if (Settings.Spearman.Value)
							{
								GameObject rigToAnimate5 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/SpearManEmoteSkeleton.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate5);
							}
							break;
						case "VoidJailerSurvivor":
							if (Settings.VoidJailer.Value)
							{
								GameObject rigToAnimate3 = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/voidjailer_emoteskeleton.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate3);
							}
							break;
						case "RobDriverBody":
							if (Settings.Baby.Value)
							{
								GameObject rigToAnimate = Assets.Load<GameObject>("@CustomEmotesAPI_fineilldoitmyself:assets/fineilldoitmyself/baby.prefab");
								CustomEmotesAPI.ImportArmature(allSurvivorDef.bodyPrefab, rigToAnimate);
							}
							break;
						}
					}
				}
			};
			<>c.<>9__6_0 = val;
			obj = (object)val;
		}
		SurvivorCatalog.Init += (hook_Init)obj;
	}

	internal static void ApplyAnimationStuff(SurvivorDef index, string resource, int pos = 0)
	{
		ApplyAnimationStuff(index.bodyPrefab, resource, pos);
	}

	internal static void ApplyAnimationStuff(GameObject bodyPrefab, string resource, int pos = 0)
	{
		GameObject animcontroller = Assets.Load<GameObject>(resource);
		ApplyAnimationStuff(bodyPrefab, animcontroller, pos);
	}

	internal static void ApplyAnimationStuff(GameObject bodyPrefab, GameObject animcontroller, int pos = 0, bool hidemeshes = true, bool jank = false, bool revertBonePositions = false)
	{
		//IL_037f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0391: Unknown result type (might be due to invalid IL or missing references)
		//IL_0111: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_030c: Unknown result type (might be due to invalid IL or missing references)
		//IL_031d: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			if (!animcontroller.GetComponentInChildren<Animator>().avatar.isHuman)
			{
				DebugClass.Log($"{animcontroller}'s avatar isn't humanoid, please fix it in unity!");
				return;
			}
		}
		catch (Exception arg)
		{
			DebugClass.Log($"Had issue checking if avatar was humanoid: {arg}");
			throw;
		}
		try
		{
			if (hidemeshes)
			{
				SkinnedMeshRenderer[] componentsInChildren = animcontroller.GetComponentsInChildren<SkinnedMeshRenderer>();
				foreach (SkinnedMeshRenderer val in componentsInChildren)
				{
					val.sharedMesh = null;
				}
				MeshFilter[] componentsInChildren2 = animcontroller.GetComponentsInChildren<MeshFilter>();
				foreach (MeshFilter val2 in componentsInChildren2)
				{
					val2.sharedMesh = null;
				}
			}
		}
		catch (Exception arg2)
		{
			DebugClass.Log($"Had trouble while hiding meshes: {arg2}");
			throw;
		}
		Transform val3 = ((!Object.op_Implicit((Object)(object)bodyPrefab.GetComponent<ModelLocator>())) ? ((Component)bodyPrefab.GetComponentInChildren<Animator>()).transform : bodyPrefab.GetComponent<ModelLocator>().modelTransform);
		try
		{
			animcontroller.transform.parent = val3;
			animcontroller.transform.localPosition = Vector3.zero;
			animcontroller.transform.localEulerAngles = Vector3.zero;
			animcontroller.transform.localScale = Vector3.one;
		}
		catch (Exception arg3)
		{
			DebugClass.Log($"Had trouble setting emote skeletons parent: {arg3}");
			throw;
		}
		SkinnedMeshRenderer val4;
		try
		{
			val4 = animcontroller.GetComponentsInChildren<SkinnedMeshRenderer>()[pos];
		}
		catch (Exception arg4)
		{
			DebugClass.Log($"Had trouble setting emote skeletons SkinnedMeshRenderer: {arg4}");
			throw;
		}
		SkinnedMeshRenderer val5;
		try
		{
			val5 = ((Component)val3).GetComponentsInChildren<SkinnedMeshRenderer>()[pos];
		}
		catch (Exception arg5)
		{
			DebugClass.Log($"Had trouble setting the original skeleton's skinned mesh renderer: {arg5}");
			throw;
		}
		try
		{
			int num = 0;
			while (true)
			{
				Transform[] bones = val4.bones;
				foreach (Transform val6 in bones)
				{
					Transform[] bones2 = val5.bones;
					foreach (Transform val7 in bones2)
					{
						if (((Object)val6).name == ((Object)val7).name)
						{
							num++;
						}
					}
				}
				if (num < 1 && pos + 1 < ((Component)val3).GetComponentsInChildren<SkinnedMeshRenderer>().Length)
				{
					pos++;
					val5 = ((Component)val3).GetComponentsInChildren<SkinnedMeshRenderer>()[pos];
					num = 0;
					continue;
				}
				break;
			}
		}
		catch (Exception arg6)
		{
			DebugClass.Log($"Had issue while checking matching bones: {arg6}");
			throw;
		}
		BoneMapper boneMapper = animcontroller.AddComponent<BoneMapper>();
		try
		{
			boneMapper.jank = jank;
			boneMapper.smr1 = val4;
			boneMapper.smr2 = val5;
			boneMapper.bodyPrefab = bodyPrefab;
			boneMapper.a1 = ((Component)val3).GetComponentInChildren<Animator>();
			boneMapper.a2 = animcontroller.GetComponentInChildren<Animator>();
		}
		catch (Exception arg7)
		{
			DebugClass.Log($"Had issue when setting up BoneMapper settings 1: {arg7}");
			throw;
		}
		try
		{
			GameObject val8 = Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/animationreplacements/bandit.prefab");
			float num2 = Vector3.Distance(val8.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)10).position, val8.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)5).position);
			float num3 = Vector3.Distance(animcontroller.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)10).position, animcontroller.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)5).position);
			boneMapper.scale = num3 / num2;
			boneMapper.h = bodyPrefab.GetComponentInChildren<HealthComponent>();
			boneMapper.model = ((Component)val3).gameObject;
		}
		catch (Exception arg8)
		{
			DebugClass.Log($"Had issue when setting up BoneMapper settings 2: {arg8}");
			GameObject val9 = Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/animationreplacements/bandit.prefab");
			boneMapper.scale = Vector3.Distance(val9.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)10).position, val9.GetComponentInChildren<Animator>().GetBoneTransform((HumanBodyBones)5).position);
			boneMapper.h = bodyPrefab.GetComponentInChildren<HealthComponent>();
			boneMapper.model = ((Component)val3).gameObject;
		}
		boneMapper.revertTransform = revertBonePositions;
	}
}
public struct JoinSpot
{
	public string name;

	public Vector3 position;

	public Vector3 rotation;

	public Vector3 scale;

	public JoinSpot(string _name, Vector3 _position, Vector3 _rotation, Vector3 _scale)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0017: Unknown result type (might be due to invalid IL or missing references)
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		name = _name;
		position = _position;
		rotation = _rotation;
		scale = _scale;
	}

	public JoinSpot(string _name, Vector3 _position)
	{
		//IL_0009: Unknown result type (might be due to invalid IL or missing references)
		//IL_000a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0010: Unknown result type (might be due to invalid IL or missing references)
		//IL_0015: 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)
		name = _name;
		position = _position;
		rotation = Vector3.zero;
		scale = Vector3.one;
	}
}
public class CustomAnimationClip : MonoBehaviour
{
	public AnimationClip[] clip;

	public AnimationClip[] secondaryClip;

	public bool looping;

	public string wwiseEvent;

	public bool syncronizeAudio;

	public List<HumanBodyBones> soloIgnoredBones;

	public List<HumanBodyBones> rootIgnoredBones;

	public bool dimAudioWhenClose;

	public bool stopOnAttack;

	public bool stopOnMove;

	public bool visibility;

	public int startPref;

	public int joinPref;

	public JoinSpot[] joinSpots;

	public bool useSafePositionReset;

	public string customName;

	public Action<BoneMapper> customPostEventCodeSync;

	public Action<BoneMapper> customPostEventCodeNoSync;

	public bool syncronizeAnimation;

	public int syncPos;

	public static List<float> syncTimer = new List<float>();

	public static List<int> syncPlayerCount = new List<int>();

	public static List<List<bool>> uniqueAnimations = new List<List<bool>>();

	public bool vulnerableEmote = false;

	internal CustomAnimationClip(AnimationClip[] _clip, bool _loop, string[] _wwiseEventName = null, string[] _wwiseStopEvent = null, HumanBodyBones[] rootBonesToIgnore = null, HumanBodyBones[] soloBonesToIgnore = null, AnimationClip[] _secondaryClip = null, bool dimWhenClose = false, bool stopWhenMove = false, bool stopWhenAttack = false, bool visible = true, bool syncAnim = false, bool syncAudio = false, int startPreference = -1, int joinPreference = -1, JoinSpot[] _joinSpots = null, bool safePositionReset = false, string customName = "NO_CUSTOM_NAME", Action<BoneMapper> _customPostEventCodeSync = null, Action<BoneMapper> _customPostEventCodeNoSync = null)
	{
		if (rootBonesToIgnore == null)
		{
			rootBonesToIgnore = (HumanBodyBones[])(object)new HumanBodyBones[0];
		}
		if (soloBonesToIgnore == null)
		{
			soloBonesToIgnore = (HumanBodyBones[])(object)new HumanBodyBones[0];
		}
		clip = _clip;
		secondaryClip = _secondaryClip;
		looping = _loop;
		dimAudioWhenClose = dimWhenClose;
		stopOnAttack = stopWhenAttack;
		stopOnMove = stopWhenMove;
		visibility = visible;
		joinPref = joinPreference;
		startPref = startPreference;
		customPostEventCodeSync = _customPostEventCodeSync;
		customPostEventCodeNoSync = _customPostEventCodeNoSync;
		string[] item;
		string[] item2;
		if (_wwiseEventName == null)
		{
			item = new string[1] { "" };
			item2 = new string[1] { "" };
		}
		else
		{
			item = _wwiseEventName;
			item2 = _wwiseStopEvent;
		}
		BoneMapper.stopEvents.Add(item2);
		BoneMapper.startEvents.Add(item);
		if (soloBonesToIgnore.Length != 0)
		{
			soloIgnoredBones = new List<HumanBodyBones>(soloBonesToIgnore);
		}
		else
		{
			soloIgnoredBones = new List<HumanBodyBones>();
		}
		if (rootBonesToIgnore.Length != 0)
		{
			rootIgnoredBones = new List<HumanBodyBones>(rootBonesToIgnore);
		}
		else
		{
			rootIgnoredBones = new List<HumanBodyBones>();
		}
		syncronizeAnimation = syncAnim;
		syncronizeAudio = syncAudio;
		syncPos = syncTimer.Count;
		syncTimer.Add(0f);
		syncPlayerCount.Add(0);
		List<bool> list = new List<bool>();
		for (int i = 0; i < _clip.Length; i++)
		{
			list.Add(item: false);
		}
		uniqueAnimations.Add(list);
		if (_joinSpots == null)
		{
			_joinSpots = new JoinSpot[0];
		}
		joinSpots = _joinSpots;
		useSafePositionReset = safePositionReset;
		this.customName = customName;
	}
}
public struct WorldProp
{
	internal GameObject prop;

	internal JoinSpot[] joinSpots;

	public WorldProp(GameObject _prop, JoinSpot[] _joinSpots)
	{
		prop = _prop;
		joinSpots = _joinSpots;
	}
}
public class AudioObject : MonoBehaviour
{
	internal int spot;

	internal int playerCount;

	internal GameObject audioObject;

	internal int activeObjectsSpot;
}
public class AudioContainer : MonoBehaviour
{
	internal List<GameObject> playingObjects = new List<GameObject>();
}
public class BoneMapper : MonoBehaviour
{
	public static List<string[]> stopEvents = new List<string[]>();

	public static List<string[]> startEvents = new List<string[]>();

	internal List<GameObject> audioObjects = new List<GameObject>();

	public SkinnedMeshRenderer smr1;

	public SkinnedMeshRenderer smr2;

	public Animator a1;

	public Animator a2;

	public HealthComponent h;

	public List<BonePair> pairs = new List<BonePair>();

	public float timer = 0f;

	public GameObject model;

	private List<string> ignore = new List<string>();

	private bool twopart = false;

	public static Dictionary<string, CustomAnimationClip> animClips = new Dictionary<string, CustomAnimationClip>();

	public CustomAnimationClip currentClip = null;

	public string currentClipName = "none";

	public string prevClipName = "none";

	public CustomAnimationClip prevClip = null;

	internal static float Current_MSX = 69f;

	internal static List<BoneMapper> allMappers = new List<BoneMapper>();

	internal static List<WorldProp> allWorldProps = new List<WorldProp>();

	public bool local = false;

	internal static bool moving = false;

	internal static bool attacking = false;

	public bool jank = false;

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

	public float scale = 1f;

	internal int desiredEvent = 0;

	public int currEvent = 0;

	public float autoWalkSpeed = 0f;

	public bool overrideMoveSpeed = false;

	public bool autoWalk = false;

	public GameObject currentEmoteSpot = null;

	public GameObject reservedEmoteSpot = null;

	public bool worldProp = false;

	public bool ragdolling = false;

	public GameObject bodyPrefab;

	public int uniqueSpot = -1;

	public bool preserveProps = false;

	public bool preserveParent = false;

	internal bool useSafePositionReset = false;

	public List<EmoteLocation> emoteLocations = new List<EmoteLocation>();

	private List<string> dontAnimateUs = new List<string>();

	public bool enableAnimatorOnDeath = true;

	public bool revertTransform = false;

	public bool oneFrameAnimatorLeeWay = false;

	public CharacterBody mapperBody;

	public bool startupFixJank = false;

	public GameObject parentGameObject;

	private bool positionLock;

	private bool rotationLock;

	private bool scaleLock;

	private float interval = 0f;

	private Vector3 ogScale = new Vector3(-69f, -69f, -69f);

	private Vector3 ogLocation = new Vector3(-69f, -69f, -69f);

	private Vector3 scaleDiff = Vector3.one;

	private float rtpcUpdateTimer = 0f;

	public void PlayAnim(string s, int pos, int eventNum)
	{
		desiredEvent = eventNum;
		PlayAnim(s, pos);
	}

	public void PlayAnim(string s, int pos)
	{
		//IL_05eb: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f1: Expected O, but got Unknown
		//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_0883: Unknown result type (might be due to invalid IL or missing references)
		//IL_028f: Unknown result type (might be due to invalid IL or missing references)
		prevClipName = currentClipName;
		if (s != "none")
		{
			if (!animClips.ContainsKey(s))
			{
				DebugClass.Log("No emote bound to the name [" + s + "]");
				return;
			}
			try
			{
				((object)animClips[s]).ToString();
			}
			catch (Exception)
			{
				CustomEmotesAPI.Changed(s, this);
				return;
			}
		}
		((Behaviour)a2).enabled = true;
		if (Object.op_Implicit((Object)(object)((Component)((Component)a2).transform.parent).GetComponent<InverseKinematics>()) && ((Object)a2).name != "loader")
		{
			((Behaviour)((Component)((Component)a2).transform.parent).GetComponent<InverseKinematics>()).enabled = false;
		}
		dontAnimateUs.Clear();
		try
		{
			((object)currentClip.clip[0]).ToString();
			try
			{
				if (currentClip.syncronizeAnimation || currentClip.syncronizeAudio)
				{
					CustomAnimationClip.syncPlayerCount[currentClip.syncPos]--;
					RemoveAudioObject();
				}
				if (stopEvents[currentClip.syncPos][currEvent] != "")
				{
					audioObjects[currentClip.syncPos].transform.localPosition = new Vector3(0f, -10000f, 0f);
					if (!currentClip.syncronizeAudio)
					{
						AkSoundEngine.PostEvent(stopEvents[currentClip.syncPos][currEvent], ((Component)this).gameObject);
					}
					if (CustomAnimationClip.syncPlayerCount[currentClip.syncPos] == 0 && currentClip.syncronizeAudio)
					{
						foreach (BoneMapper allMapper in allMappers)
						{
							if (!Object.op_Implicit((Object)(object)allMapper.audioObjects[currentClip.syncPos]))
							{
								DebugClass.Log("The audioObject was null????????");
							}
							allMapper.audioObjects[currentClip.syncPos].transform.localPosition = new Vector3(0f, -10000f, 0f);
						}
						AkSoundEngine.PostEvent(stopEvents[currentClip.syncPos][currEvent], CustomEmotesAPI.audioContainers[currentClip.syncPos]);
					}
				}
				if (uniqueSpot != -1 && CustomAnimationClip.uniqueAnimations[currentClip.syncPos][uniqueSpot])
				{
					CustomAnimationClip.uniqueAnimations[currentClip.syncPos][uniqueSpot] = false;
					uniqueSpot = -1;
				}
			}
			catch (Exception ex2)
			{
				DebugClass.Log($"had issue turning off audio before new audio played: {ex2}\n Notable items for debugging: [currentClip: {currentClip}] [currentClip.syncPos: {currentClip.syncPos}] [currEvent: {currEvent}] [stopEvents[currentClip.syncPos]: {stopEvents[currentClip.syncPos]}] [CustomEmotesAPI.audioContainers[currentClip.syncPos]: {CustomEmotesAPI.audioContainers[currentClip.syncPos]}] [uniqueSpot: {uniqueSpot}] [CustomAnimationClip.uniqueAnimations[currentClip.syncPos]: {CustomAnimationClip.uniqueAnimations[currentClip.syncPos]}]");
			}
		}
		catch (Exception)
		{
		}
		currEvent = 0;
		currentClipName = s;
		if (s != "none")
		{
			prevClip = currentClip;
			currentClip = animClips[s];
			try
			{
				((object)currentClip.clip[0]).ToString();
			}
			catch (Exception)
			{
				return;
			}
			if (pos == -2)
			{
				pos = ((CustomAnimationClip.syncPlayerCount[animClips[s].syncPos] != 0) ? animClips[s].joinPref : animClips[s].startPref);
			}
			if (pos == -2)
			{
				for (int i = 0; i < CustomAnimationClip.uniqueAnimations[currentClip.syncPos].Count; i++)
				{
					if (!CustomAnimationClip.uniqueAnimations[currentClip.syncPos][i])
					{
						pos = i;
						uniqueSpot = pos;
						CustomAnimationClip.uniqueAnimations[currentClip.syncPos][uniqueSpot] = true;
						break;
					}
				}
				if (uniqueSpot == -1)
				{
					pos = -1;
				}
			}
			if (pos == -1)
			{
				pos = Random.Range(0, currentClip.clip.Length);
			}
			LockBones();
		}
		if (s == "none")
		{
			a2.Play("none", -1, 0f);
			twopart = false;
			prevClip = currentClip;
			currentClip = null;
			NewAnimation(null);
			CustomEmotesAPI.Changed(s, this);
			return;
		}
		AnimatorOverrideController val = new AnimatorOverrideController(a2.runtimeAnimatorController);
		if (currentClip.syncronizeAnimation || currentClip.syncronizeAudio)
		{
			CustomAnimationClip.syncPlayerCount[currentClip.syncPos]++;
			AddAudioObject();
		}
		if (currentClip.syncronizeAnimation && CustomAnimationClip.syncPlayerCount[currentClip.syncPos] == 1)
		{
			CustomAnimationClip.syncTimer[currentClip.syncPos] = 0f;
		}
		if (startEvents[currentClip.syncPos][currEvent] != "")
		{
			if (CustomAnimationClip.syncPlayerCount[currentClip.syncPos] == 1 && currentClip.syncronizeAudio)
			{
				if (desiredEvent != -1)
				{
					currEvent = desiredEvent;
				}
				else
				{
					currEvent = Random.Range(0, startEvents[currentClip.syncPos].Length);
				}
				foreach (BoneMapper allMapper2 in allMappers)
				{
					allMapper2.currEvent = currEvent;
				}
				if (currentClip.customPostEventCodeSync != null)
				{
					currentClip.customPostEventCodeSync(this);
				}
				else
				{
					AkSoundEngine.PostEvent(startEvents[currentClip.syncPos][currEvent], CustomEmotesAPI.audioContainers[currentClip.syncPos]);
				}
			}
			else if (!currentClip.syncronizeAudio)
			{
				currEvent = Random.Range(0, startEvents[currentClip.syncPos].Length);
				if (currentClip.customPostEventCodeNoSync != null)
				{
					currentClip.customPostEventCodeNoSync(this);
				}
				else
				{
					AkSoundEngine.PostEvent(startEvents[currentClip.syncPos][currEvent], ((Component)this).gameObject);
				}
			}
			audioObjects[currentClip.syncPos].transform.localPosition = Vector3.zero;
		}
		SetAnimationSpeed(1f);
		if (currentClip.secondaryClip != null && currentClip.secondaryClip.Length != 0)
		{
			bool flag = true;
			if (CustomAnimationClip.syncTimer[currentClip.syncPos] > currentClip.clip[pos].length)
			{
				val["Floss"] = currentClip.secondaryClip[pos];
				a2.runtimeAnimatorController = (RuntimeAnimatorController)(object)val;
				a2.Play("Loop", -1, (CustomAnimationClip.syncTimer[currentClip.syncPos] - currentClip.clip[pos].length) % currentClip.secondaryClip[pos].length / currentClip.secondaryClip[pos].length);
			}
			else
			{
				val["Dab"] = currentClip.clip[pos];
				val["nobones"] = currentClip.secondaryClip[pos];
				a2.runtimeAnimatorController = (RuntimeAnimatorController)(object)val;
				a2.Play("PoopToLoop", -1, CustomAnimationClip.syncTimer[currentClip.syncPos] % currentClip.clip[pos].length / currentClip.clip[pos].length);
			}
		}
		else if (currentClip.looping)
		{
			val["Floss"] = currentClip.clip[pos];
			a2.runtimeAnimatorController = (RuntimeAnimatorController)(object)val;
			if (currentClip.clip[pos].length != 0f)
			{
				a2.Play("Loop", -1, CustomAnimationClip.syncTimer[currentClip.syncPos] % currentClip.clip[pos].length / currentClip.clip[pos].length);
			}
			else
			{
				a2.Play("Loop", -1, 0f);
			}
		}
		else
		{
			val["Default Dance"] = currentClip.clip[pos];
			a2.runtimeAnimatorController = (RuntimeAnimatorController)(object)val;
			a2.Play("Poop", -1, CustomAnimationClip.syncTimer[currentClip.syncPos] % currentClip.clip[pos].length / currentClip.clip[pos].length);
		}
		twopart = false;
		NewAnimation(currentClip.joinSpots);
		CustomEmotesAPI.Changed(s, this);
	}

	public void SetAnimationSpeed(float speed)
	{
		a2.speed = speed;
	}

	internal void NewAnimation(JoinSpot[] locations)
	{
		//IL_026c: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0094: Unknown result type (might be due to invalid IL or missing references)
		//IL_008f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0330: Unknown result type (might be due to invalid IL or missing references)
		//IL_034b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0350: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: 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_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a7: 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_00b6: 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_00cc: 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_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
		//IL_0205: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_0181: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b6: 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_01cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
		//IL_03c4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e3: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			try
			{
				emoteLocations.Clear();
				autoWalkSpeed = 0f;
				autoWalk = false;
				overrideMoveSpeed = false;
				if (Object.op_Implicit((Object)(object)parentGameObject) && !preserveParent)
				{
					Vector3 position = ((Component)mapperBody).gameObject.transform.position;
					position = (Vector3)(((??)TeleportHelper.FindSafeTeleportDestination(((Component)mapperBody).gameObject.transform.position, mapperBody, RoR2Application.rng)) ?? position);
					Vector3 position2 = position;
					RaycastHit val = default(RaycastHit);
					Ray val2 = default(Ray);
					((Ray)(ref val2))..ctor(position + Vector3.up * 2f, Vector3.down);
					float num = 4f;
					if (Physics.SphereCast(val2, mapperBody.radius, ref val, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask)))
					{
						position2.y = ((Ray)(ref val2)).origin.y - ((RaycastHit)(ref val)).distance;
					}
					float bodyPrefabFootOffset = Util.GetBodyPrefabFootOffset(bodyPrefab);
					position2.y += bodyPrefabFootOffset;
					if (!useSafePositionReset)
					{
						Rigidbody component = ((Component)mapperBody).gameObject.GetComponent<Rigidbody>();
						component.AddForce(new Vector3(0f, 1f, 0f), (ForceMode)2);
						Transform transform = ((Component)mapperBody).gameObject.transform;
						transform.position += new Vector3(0.1f, 2f, 0.1f);
						Transform modelBaseTransform = ((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform;
						modelBaseTransform.position += new Vector3(0f, 10f, 0f);
					}
					else
					{
						((Component)mapperBody).gameObject.transform.position = position2;
						((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.position = position2;
					}
					parentGameObject = null;
				}
			}
			catch (Exception)
			{
			}
			try
			{
				useSafePositionReset = currentClip.useSafePositionReset;
			}
			catch (Exception)
			{
				useSafePositionReset = true;
			}
			try
			{
				if (preserveParent)
				{
					preserveParent = false;
				}
				else
				{
					((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.localEulerAngles = Vector3.zero;
					if (Object.op_Implicit((Object)(object)((Component)mapperBody).GetComponent<CharacterDirection>()))
					{
						((Behaviour)((Component)mapperBody).GetComponent<CharacterDirection>()).enabled = true;
					}
					if (ogScale != new Vector3(-69f, -69f, -69f))
					{
						((Component)this).transform.parent.localScale = ogScale;
						ogScale = new Vector3(-69f, -69f, -69f);
					}
					if (ogLocation != new Vector3(-69f, -69f, -69f))
					{
						((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.localPosition = ogLocation;
						ogLocation = new Vector3(-69f, -69f, -69f);
					}
					if (Object.op_Implicit((Object)(object)((Component)mapperBody).GetComponent<Collider>()))
					{
						((Component)mapperBody).GetComponent<Collider>().enabled = true;
					}
					if (Object.op_Implicit((Object)(object)((Component)mapperBody).GetComponent<KinematicCharacterMotor>()) && !((Behaviour)((Component)mapperBody).GetComponent<KinematicCharacterMotor>()).enabled)
					{
						Vector3 position3 = ((Component)mapperBody).gameObject.transform.position;
						((Behaviour)((Component)mapperBody).GetComponent<KinematicCharacterMotor>()).enabled = true;
						((Component)mapperBody).GetComponent<KinematicCharacterMotor>().SetPosition(position3, true);
					}
				}
			}
			catch (Exception)
			{
			}
			if (preserveProps)
			{
				preserveProps = false;
			}
			else
			{
				foreach (GameObject prop in props)
				{
					if (Object.op_Implicit((Object)(object)prop))
					{
						Object.Destroy((Object)(object)prop);
					}
				}
				props.Clear();
			}
			if (locations != null)
			{
				for (int i = 0; i < locations.Length; i++)
				{
					SpawnJoinSpot(locations[i]);
				}
			}
		}
		catch (Exception arg)
		{
			DebugClass.Log($"error during new animation: {arg}");
		}
	}

	public void ScaleProps()
	{
		//IL_0067: Unknown result type (might be due to invalid IL or missing references)
		foreach (GameObject prop in props)
		{
			if (Object.op_Implicit((Object)(object)prop))
			{
				Transform parent = prop.transform.parent;
				prop.transform.SetParent((Transform)null);
				prop.transform.localScale = new Vector3(scale * 1.15f, scale * 1.15f, scale * 1.15f);
				prop.transform.SetParent(parent);
			}
		}
	}

	private void AddIgnore(DynamicBone dynbone, Transform t)
	{
		for (int i = 0; i < t.childCount; i++)
		{
			if (!dynbone.m_Exclusions.Contains(t.GetChild(i)))
			{
				ignore.Add(((Object)t.GetChild(i)).name);
				AddIgnore(dynbone, t.GetChild(i));
			}
		}
	}

	private void Start()
	{
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_0050: Expected O, but got Unknown
		//IL_00a5: 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)
		if (worldProp)
		{
			return;
		}
		mapperBody = ((Component)this).GetComponentInParent<CharacterModel>().body;
		allMappers.Add(this);
		foreach (string[] startEvent in startEvents)
		{
			GameObject val = new GameObject();
			if (startEvent[0] != "")
			{
				((Object)val).name = startEvent[0] + "_AudioObject";
			}
			val.transform.SetParent(((Component)this).transform);
			val.transform.localPosition = new Vector3(0f, -10000f, 0f);
			audioObjects.Add(val);
		}
		DynamicBone[] components = model.GetComponents<DynamicBone>();
		foreach (DynamicBone val2 in components)
		{
			try
			{
				if (!val2.m_Exclusions.Contains(val2.m_Root))
				{
					ignore.Add(((Object)val2.m_Root).name);
				}
				AddIgnore(val2, val2.m_Root);
			}
			catch (Exception)
			{
			}
		}
		if (((Object)model).name.StartsWith("mdlLoader"))
		{
			Transform val3 = model.transform;
			Transform val4 = model.transform;
			Transform[] componentsInChildren = model.GetComponentsInChildren<Transform>();
			foreach (Transform val5 in componentsInChildren)
			{
				if (((Object)val5).name == "clavicle.l")
				{
					val3 = val5;
					ignore.Add(((Object)val3).name);
				}
				if (((Object)val5).name == "clavicle.r")
				{
					val4 = val5;
					ignore.Add(((Object)val4).name);
				}
			}
			Transform[] componentsInChildren2 = ((Component)val3).GetComponentsInChildren<Transform>();
			foreach (Transform val6 in componentsInChildren2)
			{
				ignore.Add(((Object)val6).name);
			}
			Transform[] componentsInChildren3 = ((Component)val4).GetComponentsInChildren<Transform>();
			foreach (Transform val7 in componentsInChildren3)
			{
				ignore.Add(((Object)val7).name);
			}
		}
		int num = 0;
		if (true)
		{
			int num2 = 0;
			for (int m = 0; m < smr1.bones.Length; m++)
			{
				for (int n = num2; n < smr2.bones.Length; n++)
				{
					if (((Object)smr1.bones[m]).name == ((Object)smr2.bones[n]).name)
					{
						num2 = n;
						ConstraintSource val8 = default(ConstraintSource);
						((ConstraintSource)(ref val8)).sourceTransform = smr1.bones[m];
						((ConstraintSource)(ref val8)).weight = 1f;
						EmoteConstraint emoteConstraint = ((Component)smr2.bones[n]).gameObject.AddComponent<EmoteConstraint>();
						emoteConstraint.AddSource(ref smr2.bones[n], ref smr1.bones[m]);
						emoteConstraint.revertTransform = revertTransform;
						break;
					}
					if (n == num2 - 1)
					{
						break;
					}
					if (num2 > 0 && n == smr2.bones.Length - 1)
					{
						n = -1;
					}
				}
			}
		}
		if (jank)
		{
			for (int num3 = 0; num3 < smr2.bones.Length; num3++)
			{
				try
				{
					if (Object.op_Implicit((Object)(object)((Component)smr2.bones[num3]).gameObject.GetComponent<EmoteConstraint>()))
					{
						((Component)smr2.bones[num3]).gameObject.GetComponent<EmoteConstraint>().ActivateConstraints();
					}
				}
				catch (Exception arg)
				{
					DebugClass.Log($"{arg}");
				}
			}
		}
		CustomEmotesAPI.MapperCreated(this);
		if (((Object)((Component)a2).transform.parent).name == "mdlRocket" || ((Object)((Component)a2).transform.parent).name == "Bastian" || startupFixJank || ((Object)((Component)a2).transform.parent).name == "mdlAssassin")
		{
			((MonoBehaviour)this).StartCoroutine(FixRootOnSurvivors());
		}
	}

	private IEnumerator FixRootOnSurvivors()
	{
		yield return 0;
		PlayAnim("lmao", 0);
		yield return 0;
		PlayAnim("none", 0);
		((Component)((Component)smr2).transform.parent).gameObject.SetActive(false);
		((Component)((Component)smr2).transform.parent).gameObject.SetActive(true);
		if (((Object)((Component)a2).transform.parent).name == "mdlAssassin")
		{
			jank = false;
		}
	}

	public void AssignParentGameObject(GameObject youAreTheFather, bool lockPosition, bool lockRotation, bool lockScale, bool scaleAsBandit = true, bool disableCollider = true)
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_0089: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0070: Unknown result type (might be due to invalid IL or missing references)
		//IL_007b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		if (Object.op_Implicit((Object)(object)parentGameObject))
		{
			NewAnimation(null);
		}
		if (!Object.op_Implicit((Object)(object)((Component)((Component)this).transform).GetComponentInParent<CharacterModel>()))
		{
			return;
		}
		ogLocation = ((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.localPosition;
		ogScale = ((Component)this).transform.parent.localScale;
		if (scaleAsBandit)
		{
			scaleDiff = ogScale / scale;
		}
		else
		{
			scaleDiff = ogScale;
		}
		parentGameObject = youAreTheFather;
		positionLock = lockPosition;
		rotationLock = lockRotation;
		scaleLock = lockScale;
		if (Object.op_Implicit((Object)(object)((Component)mapperBody).GetComponent<Collider>()))
		{
			((Component)mapperBody).GetComponent<Collider>().enabled = !disableCollider;
		}
		if (Object.op_Implicit((Object)(object)((Component)mapperBody).GetComponent<KinematicCharacterMotor>()))
		{
			((Behaviour)((Component)mapperBody).GetComponent<KinematicCharacterMotor>()).enabled = !lockPosition;
		}
		if (disableCollider && Object.op_Implicit((Object)(object)currentEmoteSpot))
		{
			if (currentEmoteSpot.GetComponent<EmoteLocation>().validPlayers != 0)
			{
				currentEmoteSpot.GetComponent<EmoteLocation>().validPlayers--;
			}
			currentEmoteSpot.GetComponent<EmoteLocation>().SetColor();
			currentEmoteSpot = null;
		}
	}

	private void DimmingChecks()
	{
		//IL_005a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0065: Unknown result type (might be due to invalid IL or missing references)
		//IL_007f: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		float num = 20f;
		foreach (BoneMapper allMapper in allMappers)
		{
			try
			{
				if (Object.op_Implicit((Object)(object)allMapper) && ((Behaviour)allMapper.a2).enabled && allMapper.currentClip.dimAudioWhenClose && Vector3.Distance(((Component)allMapper).transform.parent.position, ((Component)this).transform.position) < num)
				{
					num = Vector3.Distance(((Component)allMapper).transform.position, ((Component)this).transform.position);
				}
			}
			catch (Exception)
			{
			}
		}
		SetRTPCInDimming(num);
	}

	private void SetRTPCInDimming(float closestDimmingSource)
	{
		//IL_005f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		if (closestDimmingSource < 20f && Settings.DimmingSpheres.Value && Settings.EmotesVolume.Value > 0f)
		{
			Current_MSX = Mathf.Lerp(Current_MSX, closestDimmingSource / 20f * CustomEmotesAPI.Actual_MSX, Time.deltaTime * 3f);
			AkSoundEngine.SetRTPCValue("Volume_MSX", Current_MSX);
		}
		else if (Current_MSX != CustomEmotesAPI.Actual_MSX)
		{
			Current_MSX = Mathf.Lerp(Current_MSX, CustomEmotesAPI.Actual_MSX, Time.deltaTime * 3f);
			if (Current_MSX + 0.01f > CustomEmotesAPI.Actual_MSX)
			{
				Current_MSX = CustomEmotesAPI.Actual_MSX;
			}
			AkSoundEngine.SetRTPCValue("Volume_MSX", Current_MSX);
		}
	}

	private void LocalFunctions()
	{
		DimmingChecks();
		try
		{
			if ((attacking && currentClip.stopOnAttack) || (moving && currentClip.stopOnMove))
			{
				CustomEmotesAPI.PlayAnimation("none");
			}
		}
		catch (Exception)
		{
		}
	}

	private void GetLocal()
	{
		try
		{
			if (!Object.op_Implicit((Object)(object)CustomEmotesAPI.localMapper))
			{
				CharacterMaster master = NetworkUser.readOnlyLocalPlayersList[0].master;
				CharacterBody val = ((master != null) ? master.GetBody() : null);
				if ((Object)(object)((Component)val).gameObject.GetComponent<ModelLocator>().modelTransform == (Object)(object)((Component)this).transform.parent)
				{
					CustomEmotesAPI.localMapper = this;
					local = true;
				}
			}
		}
		catch (Exception)
		{
		}
	}

	private void TwoPartThing()
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_042e: Unknown result type (might be due to invalid IL or missing references)
		AnimatorStateInfo currentAnimatorStateInfo = a2.GetCurrentAnimatorStateInfo(0);
		if (((AnimatorStateInfo)(ref currentAnimatorStateInfo)).IsName("none"))
		{
			if (twopart)
			{
				if (((Behaviour)a2).enabled)
				{
					if (((Object)((Component)((Component)smr2).transform.parent).gameObject).name == "mdlVoidSurvivor" || ((Object)((Component)((Component)smr2).transform.parent).gameObject).name == "mdlMage" || ((Object)((Component)((Component)smr2).transform.parent).gameObject).name == "mdlJinx" || ((Object)((Component)((Component)smr2).transform.parent).gameObject).name.StartsWith("mdlHouse") || ((Object)((Component)((Component)smr2).transform.parent).gameObject).name.StartsWith("mdlLemurian") || ((Object)((Component)((Component)smr2).transform.parent).gameObject).name.StartsWith("mdlRocket"))
					{
						((Component)((Component)smr2).transform.parent).gameObject.SetActive(false);
						((Component)((Component)smr2).transform.parent).gameObject.SetActive(true);
					}
					if (!jank)
					{
						UnlockBones();
					}
				}
				if (!ragdolling)
				{
					if (((Object)((Component)((Component)smr2).transform.parent).gameObject).name == "mdlCHEF" || ((Object)((Component)a2).transform.parent).name == "Bastian" || (jank && ((Object)((Component)a2).transform.parent).name != "mdlAssassin"))
					{
						((Behaviour)a1).enabled = true;
					}
					oneFrameAnimatorLeeWay = true;
				}
				((Behaviour)a2).enabled = false;
				if (Object.op_Implicit((Object)(object)((Component)((Component)a2).transform.parent).GetComponent<InverseKinematics>()) && ((Object)a2).name != "loader")
				{
					((Behaviour)((Component)((Component)a2).transform.parent).GetComponent<InverseKinematics>()).enabled = true;
				}
				try
				{
					currentClip.clip.ToString();
					CustomEmotesAPI.Changed("none", this);
					NewAnimation(null);
					if (currentClip.syncronizeAnimation || currentClip.syncronizeAudio)
					{
						CustomAnimationClip.syncPlayerCount[currentClip.syncPos]--;
						RemoveAudioObject();
					}
					if (stopEvents[currentClip.syncPos][currEvent] != "")
					{
						if (!currentClip.syncronizeAudio)
						{
							AkSoundEngine.PostEvent(stopEvents[currentClip.syncPos][currEvent], ((Component)this).gameObject);
						}
						audioObjects[currentClip.syncPos].transform.localPosition = new Vector3(0f, -10000f, 0f);
						if (CustomAnimationClip.syncPlayerCount[currentClip.syncPos] == 0 && currentClip.syncronizeAudio)
						{
							foreach (BoneMapper allMapper in allMappers)
							{
								allMapper.audioObjects[currentClip.syncPos].transform.localPosition = new Vector3(0f, -10000f, 0f);
							}
							AkSoundEngine.PostEvent(stopEvents[currentClip.syncPos][currEvent], CustomEmotesAPI.audioContainers[currentClip.syncPos]);
						}
					}
					prevClip = currentClip;
					currentClip = null;
					return;
				}
				catch (Exception)
				{
					return;
				}
			}
			twopart = true;
		}
		else
		{
			if (((Object)((Component)((Component)smr2).transform.parent).gameObject).name == "mdlCHEF" || ((Object)((Component)a2).transform.parent).name == "Bastian" || (jank && ((Object)((Component)a2).transform.parent).name != "mdlAssassin"))
			{
				((Behaviour)a1).enabled = false;
			}
			twopart = false;
		}
	}

	private void HealthAndAutoWalk()
	{
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0098: Unknown result type (might be due to invalid IL or missing references)
		if (autoWalkSpeed != 0f)
		{
			CharacterModel componentInParent = ((Component)((Component)this).transform).GetComponentInParent<CharacterModel>();
			if (Object.op_Implicit((Object)(object)componentInParent))
			{
				if (overrideMoveSpeed)
				{
					componentInParent.body.moveSpeed = autoWalkSpeed;
				}
				CharacterMotor component = ((Component)componentInParent.body).GetComponent<CharacterMotor>();
				CharacterDirection component2 = ((Component)componentInParent.body).GetComponent<CharacterDirection>();
				if (autoWalk && Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2))
				{
					component.moveDirection = component2.forward * autoWalkSpeed;
				}
			}
		}
		if (Object.op_Implicit((Object)(object)h) && h.health <= 0f)
		{
			UnlockBones(enableAnimatorOnDeath);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void WorldPropAndParent()
	{
		//IL_003d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0051: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_007c: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_015a: Unknown result type (might be due to invalid IL or missing references)
		//IL_017b: Unknown result type (might be due to invalid IL or missing references)
		//IL_019c: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_012b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
		if (!Object.op_Implicit((Object)(object)parentGameObject))
		{
			return;
		}
		if (positionLock)
		{
			((Component)mapperBody).gameObject.transform.position = parentGameObject.transform.position + new Vector3(0f, 1f, 0f);
			((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.position = parentGameObject.transform.position;
			CharacterMotor component = ((Component)mapperBody).GetComponent<CharacterMotor>();
			Rigidbody component2 = ((Component)mapperBody).GetComponent<Rigidbody>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.velocity = Vector3.zero;
			}
			else if (Object.op_Implicit((Object)(object)component2))
			{
				component2.velocity = Vector3.zero;
			}
		}
		if (rotationLock)
		{
			CharacterDirection component3 = ((Component)mapperBody).GetComponent<CharacterDirection>();
			if (Object.op_Implicit((Object)(object)component3))
			{
				((Behaviour)((Component)mapperBody).GetComponent<CharacterDirection>()).enabled = false;
			}
			((Component)mapperBody).GetComponent<ModelLocator>().modelBaseTransform.eulerAngles = parentGameObject.transform.eulerAngles;
		}
		if (scaleLock)
		{
			((Component)this).transform.parent.localScale = new Vector3(parentGameObject.transform.localScale.x * scaleDiff.x, parentGameObject.transform.localScale.y * scaleDiff.y, parentGameObject.transform.localScale.z * scaleDiff.z);
		}
	}

	private void Update()
	{
		if (!worldProp)
		{
			WorldPropAndParent();
			if (local)
			{
				LocalFunctions();
			}
			else
			{
				GetLocal();
			}
			TwoPartThing();
			HealthAndAutoWalk();
		}
	}

	public int SpawnJoinSpot(JoinSpot joinSpot)
	{
		props.Add(Object.Instantiate<GameObject>(Assets.Load<GameObject>("@CustomEmotesAPI_customemotespackage:assets/emotejoiner/JoinVisual.prefab")));
		props[props.Count - 1].transform.SetParent(((Component)this).transform);
		((Object)props[props.Count - 1]).name = joinSpot.name;
		EmoteLocation emoteLocation = props[props.Count - 1].AddComponent<EmoteLocation>();
		emoteLocation.joinSpot = joinSpot;
		emoteLocation.owner = this;
		emoteLocations.Add(emoteLocation);
		return props.Count - 1;
	}

	public void JoinEmoteSpot()
	{
		//IL_0130: Unknown result type (might be due to invalid IL or missing references)
		//IL_0154: Unknown result type (might be due to invalid IL or missing re