Decompiled source of Mimic v0.8.1

Mimic.dll

Decompiled 5 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Photon.Pun;
using REPOLib.Modules;
using REPOLib.Objects.Sdk;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.Audio;
using UnityEngine.Events;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("Mimic")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Mimic")]
[assembly: AssemblyTitle("Mimic")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Mimic
{
	internal static class ExplosionsHilfe
	{
		private static MethodInfo spawn;

		private static bool gemeldet;

		internal static void Effekt(ParticleScriptExplosion e, Vector3 pos, float groesse, float kraft, float wackeln)
		{
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)e == (Object)null)
			{
				return;
			}
			try
			{
				if (spawn == null)
				{
					spawn = (from m in typeof(ParticleScriptExplosion).GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)
						where m.Name == "Spawn"
						orderby m.GetParameters().Length descending
						select m).FirstOrDefault();
				}
				if (spawn == null)
				{
					Plugin.Log.LogWarning((object)"Explosion: keine Spawn-Methode gefunden.");
					return;
				}
				ParameterInfo[] parameters = spawn.GetParameters();
				if (!gemeldet)
				{
					gemeldet = true;
					Plugin.Log.LogInfo((object)("Explosion-Spawn im Spiel: (" + string.Join(", ", parameters.Select((ParameterInfo p) => p.ParameterType.Name + " " + p.Name)) + ")"));
				}
				object[] array = new object[parameters.Length];
				bool flag = false;
				for (int num = 0; num < parameters.Length; num++)
				{
					ParameterInfo parameterInfo = parameters[num];
					string text = parameterInfo.Name.ToLowerInvariant();
					Type parameterType = parameterInfo.ParameterType;
					object obj;
					if (!(parameterType == typeof(Vector3)) || flag)
					{
						obj = ((parameterType == typeof(float) && text.Contains("size")) ? ((object)groesse) : ((parameterType == typeof(float) && text.Contains("force")) ? ((object)kraft) : ((parameterType == typeof(float) && text.Contains("shake")) ? ((object)wackeln) : ((parameterType == typeof(int) && text.Contains("damage")) ? ((object)0) : ((parameterType == typeof(bool) && text.Contains("onlyparticle")) ? ((object)true) : ((parameterType == typeof(bool) && text.Contains("disablesound")) ? ((object)false) : ((!parameterInfo.HasDefaultValue) ? (parameterType.IsValueType ? Activator.CreateInstance(parameterType) : null) : parameterInfo.DefaultValue)))))));
					}
					else
					{
						obj = pos;
						flag = true;
					}
					array[num] = obj;
				}
				spawn.Invoke(e, array);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("Explosion-Effekt fehlgeschlagen: " + (ex.InnerException ?? ex).Message));
			}
		}

		internal static bool Boden(Vector3 von, Transform ignorieren, out float y)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			y = 0f;
			RaycastHit[] array = Physics.RaycastAll(von + Vector3.up * 0.8f, Vector3.down, 4f, -1, (QueryTriggerInteraction)1);
			float num = float.MaxValue;
			bool result = false;
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val = array2[i];
				if (!((Object)(object)((RaycastHit)(ref val)).collider == (Object)null))
				{
					Rigidbody attachedRigidbody = ((RaycastHit)(ref val)).collider.attachedRigidbody;
					if ((!((Object)(object)attachedRigidbody != (Object)null) || attachedRigidbody.isKinematic) && !((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<PlayerAvatar>() != (Object)null) && !((Object)(object)((Component)((RaycastHit)(ref val)).collider).GetComponentInParent<PlayerTumble>() != (Object)null) && (!((Object)(object)ignorieren != (Object)null) || !((Component)((RaycastHit)(ref val)).collider).transform.IsChildOf(ignorieren)) && ((RaycastHit)(ref val)).distance < num)
					{
						num = ((RaycastHit)(ref val)).distance;
						y = ((RaycastHit)(ref val)).point.y;
						result = true;
					}
				}
			}
			return result;
		}
	}
	public class MimicAussehen : MonoBehaviour
	{
		internal Animator animator;

		internal SpielerAnimation spieler;

		internal static float GehTempo = 2.4f;

		internal static float RennTempo = 4.6f;

		private static float tempoGemessen = -1f;

		private static float tempoLog;

		private Vector3 basisSkala = Vector3.one;

		private float messZeit = -1f;

		private Vector3 gemessen;

		private Vector3 weltTempo;

		private Vector3? umschauPunkt;

		private float umschauBis;

		internal Transform kiefer;

		internal Quaternion kieferStart;

		internal Transform messer;

		internal AudioSource stimme;

		internal AudioMixerGroup mixer;

		private AudioSource verwandlungsTon;

		internal float tempo;

		private Vector3 letztePos;

		private float stichZeit = -10f;

		private readonly float[] pegel = new float[256];

		private Transform hand;

		private Vector3 messerRuhePos = new Vector3(0.05f, -0.02f, 0.12f);

		private List<AnimatorControllerParameter> parameter = new List<AnimatorControllerParameter>();

		private Transform rumpf;

		private Transform kopf;

		private Vector3 rumpfStart;

		private Vector3 kopfStart;

		private Transform fleischUnten;

		private Transform fleischOben;

		private readonly List<Material> augen = new List<Material>();

		private readonly List<Color> augenStart = new List<Color>();

		private float verwandlung;

		private float verwandlungZiel;

		private float verwandlungTempo = 0.1f;

		internal float gluehen;

		private EnemyRigidbody gegnerRb;

		private Quaternion ruheDrehung = Quaternion.identity;

		private bool inLuft;

		private Vector3 ruheUp = Vector3.up;

		private bool ruheUpDa;

		private const float SpaltRumpf = 0.42f;

		private const float SpaltKopf = 0.5f;

		private Transform koerperZiel;

		private Vector3 versatz;

		private Renderer[] alleRenderer = (Renderer[])(object)new Renderer[0];

		private bool zuletztSichtbar = true;

		private float schrittPhase;

		private float haltung;

		internal bool angriffsHaltung;

		private Transform arm;

		private readonly List<Material> hautMat = new List<Material>();

		private readonly List<Color> hautStart = new List<Color>();

		private readonly List<int> hautFeld = new List<int>();

		private readonly List<Transform> beulen = new List<Transform>();

		private Quaternion armBasis;

		private Quaternion armGeschrieben;

		private Quaternion kopfBasis;

		private Quaternion kopfGeschrieben;

		private Transform armL;

		private Quaternion armRuhe;

		private Quaternion armLRuhe;

		private bool armRuheDa;

		private bool armLRuheDa;

		private readonly List<Transform> beine = new List<Transform>();

		private readonly List<Quaternion> beinRuhe = new List<Quaternion>();

		private readonly List<float> beinSeite = new List<float>();

		private bool animatorGeht;

		private readonly List<Transform> augenT = new List<Transform>();

		private readonly List<Quaternion> augenRuhe = new List<Quaternion>();

		private float blickGier;

		private float blickNick;

		private float bodenHoehe = float.NaN;

		private Transform gegnerWurzel;

		private bool armInit;

		private bool kopfInit;

		private static int teilNr;

		private Transform maulWurzel;

		private readonly List<Transform> zaehneUnten = new List<Transform>();

		private readonly List<Transform> zaehneOben = new List<Transform>();

		private readonly List<Transform> zunge = new List<Transform>();

		private Transform zungenSpitze;

		private bool maulAuf;

		private Vector3 mundUnten;

		private Vector3 mundOben;

		private bool mundDa;

		private Vector3 zungenZiel;

		private float zungenStart = -10f;

		private const int ZahnAnzahl = 9;

		private const int ZungenTeile = 14;

		internal Vector3? BlickZiel;

		private float gierWinkel = float.NaN;

		private bool nachdrehen;

		private float drehAb = -1f;

		private float drehVersatz;

		private float drehTempo;

		private Vector3 gierLetztePos;

		private static readonly string[] FremdNamen = new string[22]
		{
			"Kevin", "xXShadowXx", "Lukas_09", "BigMike", "Nudelholz", "Tobi", "derJonas", "Kartoffelkönig", "Fabi", "Pixelpanda",
			"Leon2010", "MrBean", "Schnitzel", "Basti", "NightFox", "Gamer_Paul", "Mia", "Kroete", "ZockerMax", "LeLe",
			"Jannik", "ChillBro"
		};

		private static readonly string[] HalloweenWorte = new string[9] { "pumpkin", "halloween", "jack", "lantern", "kürbis", "kuerbis", "spooky", "witch", "ghost" };

		internal Material lebenMat;

		internal Gradient lebenFarbe;

		internal float lebenStart = 1f;

		internal bool fehlerAn;

		private float naechsterFehler = -1f;

		private float augenBlitzBis = -1f;

		private float kopfZuckenBis = -1f;

		private float kopfZuckWinkel;

		private static int sichtMaskeModell = -1;

		private PlayerAvatar blickSpieler;

		private float blickPruefen;

		internal Vector3 Augen
		{
			get
			{
				//IL_0034: Unknown result type (might be due to invalid IL or missing references)
				//IL_0039: Unknown result type (might be due to invalid IL or missing references)
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				//IL_0023: Unknown result type (might be due to invalid IL or missing references)
				//IL_0028: Unknown result type (might be due to invalid IL or missing references)
				if (!((Object)(object)kopf != (Object)null))
				{
					return ((Component)this).transform.position + Vector3.up * 1.3f;
				}
				return kopf.position + Vector3.up * 0.12f;
			}
		}

		internal void Ducken(bool an)
		{
			if (spieler != null)
			{
				spieler.ducken = an;
			}
		}

		internal void Kriechen(bool an)
		{
			if (spieler != null)
			{
				spieler.kriechen = an;
			}
		}

		internal void Greifen(bool an)
		{
			if (spieler != null)
			{
				spieler.greifen = an;
			}
		}

		internal void Springen()
		{
			spieler?.Springen();
		}

		private static Quaternion Basis(Transform t, ref bool init, ref Quaternion basis, Quaternion geschrieben)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			if (!init || t.localRotation != geschrieben)
			{
				basis = t.localRotation;
				init = true;
			}
			return basis;
		}

		internal static MimicAussehen Erstellen(PlayerAvatar vorbild, Transform koerper, float bodenY, Vector3 mitte, int fremdSeed = -1)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a63: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a68: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a73: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cbf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0278: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d11: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d13: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ddc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e92: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ef3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f21: Unknown result type (might be due to invalid IL or missing references)
			//IL_118c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1114: Unknown result type (might be due to invalid IL or missing references)
			//IL_1119: Unknown result type (might be due to invalid IL or missing references)
			//IL_1059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0615: Unknown result type (might be due to invalid IL or missing references)
			//IL_061a: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_070f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0714: Unknown result type (might be due to invalid IL or missing references)
			//IL_078e: Unknown result type (might be due to invalid IL or missing references)
			PlayerAvatarVisuals playerAvatarVisuals = vorbild.playerAvatarVisuals;
			if ((Object)(object)playerAvatarVisuals == (Object)null)
			{
				Plugin.Log.LogWarning((object)"[Mimic] Spieler hat kein sichtbares Modell.");
				return null;
			}
			GameObject val = new GameObject("MimicKopieHalter");
			val.SetActive(false);
			GameObject val2 = Object.Instantiate<GameObject>(((Component)playerAvatarVisuals).gameObject, val.transform);
			((Object)val2).name = "MimicAussehen";
			if (!val2.activeSelf)
			{
				val2.SetActive(true);
			}
			try
			{
				HalloweenWeg(val2.transform, playerAvatarVisuals);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("[Mimic] Halloween-Kosmetik entfernen: " + ex.Message));
			}
			if (fremdSeed >= 0)
			{
				try
				{
					Verkleiden(val2.transform, playerAvatarVisuals, fremdSeed);
				}
				catch (Exception ex2)
				{
					Plugin.Log.LogWarning((object)("[Mimic] Fremder Charakter fehlgeschlagen (nimmt Spieleraussehen): " + ex2));
				}
			}
			Transform[] componentsInChildren2;
			try
			{
				SemiIconMaker[] componentsInChildren = val2.GetComponentsInChildren<SemiIconMaker>(true);
				foreach (SemiIconMaker val3 in componentsInChildren)
				{
					if ((Object)(object)val3 != (Object)null)
					{
						Object.DestroyImmediate((Object)(object)((Component)val3).gameObject);
					}
				}
				componentsInChildren2 = val2.GetComponentsInChildren<Transform>(true);
				foreach (Transform val4 in componentsInChildren2)
				{
					if ((Object)(object)val4 != (Object)null && (Object)(object)val4 != (Object)(object)val2.transform && (((Object)val4).name == "Grabber" || ((Object)val4).name.StartsWith("Grabber Aim") || ((Object)val4).name.StartsWith("Flashlight")))
					{
						((Component)val4).gameObject.SetActive(false);
					}
				}
			}
			catch (Exception ex3)
			{
				Plugin.Log.LogWarning((object)("[Mimic] Aufräumen der Kopie: " + ex3.Message));
			}
			string text = null;
			PlayerAvatarTalkAnimation playerAvatarTalkAnimation = playerAvatarVisuals.playerAvatarTalkAnimation;
			if ((Object)(object)playerAvatarTalkAnimation != (Object)null && (Object)(object)playerAvatarTalkAnimation.objectToRotate != (Object)null)
			{
				text = Pfad(((Component)playerAvatarVisuals).transform, playerAvatarTalkAnimation.objectToRotate.transform);
			}
			string text2 = (((Object)(object)playerAvatarVisuals.bodyTopUpTransform != (Object)null) ? Pfad(((Component)playerAvatarVisuals).transform, playerAvatarVisuals.bodyTopUpTransform) : null);
			string text3 = (((Object)(object)playerAvatarVisuals.headUpTransform != (Object)null) ? Pfad(((Component)playerAvatarVisuals).transform, playerAvatarVisuals.headUpTransform) : null);
			PlayerAvatarRightArm playerAvatarRightArm = playerAvatarVisuals.playerAvatarRightArm;
			string text4 = (((Object)(object)playerAvatarRightArm != (Object)null && (Object)(object)playerAvatarRightArm.rightArmTransform != (Object)null) ? Pfad(((Component)playerAvatarVisuals).transform, playerAvatarRightArm.rightArmTransform) : null);
			Vector3 val5 = (((Object)(object)playerAvatarRightArm != (Object)null) ? playerAvatarRightArm.basePose : Vector3.zero);
			PlayerAvatarLeftArm val6 = ((Component)playerAvatarVisuals).GetComponentInChildren<PlayerAvatarLeftArm>(true) ?? ((Component)vorbild).GetComponentInChildren<PlayerAvatarLeftArm>(true);
			string text5 = (((Object)(object)val6 != (Object)null && (Object)(object)val6.leftArmTransform != (Object)null) ? Pfad(((Component)playerAvatarVisuals).transform, val6.leftArmTransform) : null);
			Vector3 val7 = (((Object)(object)val6 != (Object)null) ? val6.basePose : Vector3.zero);
			List<string> list = new List<string>();
			PlayerEyes playerEyes = playerAvatarVisuals.playerEyes;
			if ((Object)(object)playerEyes != (Object)null)
			{
				componentsInChildren2 = (Transform[])(object)new Transform[4] { playerEyes.eyeLeft, playerEyes.eyeRight, playerEyes.pupilLeft, playerEyes.pupilRight };
				foreach (Transform val8 in componentsInChildren2)
				{
					if ((Object)(object)val8 != (Object)null)
					{
						string text6 = Pfad(((Component)playerAvatarVisuals).transform, val8);
						if (text6 != null)
						{
							list.Add(text6);
						}
					}
				}
			}
			for (int j = 0; j < 4; j++)
			{
				MonoBehaviour[] componentsInChildren3 = val2.GetComponentsInChildren<MonoBehaviour>(true);
				foreach (MonoBehaviour val9 in componentsInChildren3)
				{
					if ((Object)(object)val9 != (Object)null)
					{
						Object.DestroyImmediate((Object)(object)val9);
					}
				}
				Behaviour[] componentsInChildren4 = val2.GetComponentsInChildren<Behaviour>(true);
				foreach (Behaviour val10 in componentsInChildren4)
				{
					if (val10 is AudioLowPassFilter || val10 is AudioHighPassFilter || val10 is AudioReverbFilter || val10 is AudioEchoFilter || val10 is AudioDistortionFilter || val10 is AudioChorusFilter)
					{
						Object.DestroyImmediate((Object)(object)val10);
					}
				}
			}
			Joint[] componentsInChildren5 = val2.GetComponentsInChildren<Joint>(true);
			for (int i = 0; i < componentsInChildren5.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren5[i]);
			}
			Rigidbody[] componentsInChildren6 = val2.GetComponentsInChildren<Rigidbody>(true);
			for (int i = 0; i < componentsInChildren6.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren6[i]);
			}
			Collider[] componentsInChildren7 = val2.GetComponentsInChildren<Collider>(true);
			for (int i = 0; i < componentsInChildren7.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren7[i]);
			}
			AudioSource[] componentsInChildren8 = val2.GetComponentsInChildren<AudioSource>(true);
			for (int i = 0; i < componentsInChildren8.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren8[i]);
			}
			int num = 0;
			Light[] componentsInChildren9 = val2.GetComponentsInChildren<Light>(true);
			for (int i = 0; i < componentsInChildren9.Length; i++)
			{
				Object.DestroyImmediate((Object)(object)componentsInChildren9[i]);
				num++;
			}
			ParticleSystem[] componentsInChildren10 = val2.GetComponentsInChildren<ParticleSystem>(true);
			for (int i = 0; i < componentsInChildren10.Length; i++)
			{
				((Component)componentsInChildren10[i]).gameObject.SetActive(false);
			}
			Plugin.Log.LogInfo((object)$"[Mimic] Kopie aufgeräumt: {num} Lichter entfernt.");
			int layer = ((Component)koerper).gameObject.layer;
			componentsInChildren2 = val2.GetComponentsInChildren<Transform>(true);
			for (int i = 0; i < componentsInChildren2.Length; i++)
			{
				((Component)componentsInChildren2[i]).gameObject.layer = layer;
			}
			Renderer[] componentsInChildren11 = val2.GetComponentsInChildren<Renderer>(true);
			foreach (Renderer obj in componentsInChildren11)
			{
				obj.sharedMaterials = ((IEnumerable<Material>)obj.sharedMaterials).Select((Func<Material, Material>)((Material m) => ((Object)(object)m != (Object)null) ? new Material(m) : ((Material)null))).ToArray();
				obj.shadowCastingMode = (ShadowCastingMode)1;
				obj.enabled = true;
			}
			MimicAussehen mimicAussehen = val2.AddComponent<MimicAussehen>();
			mimicAussehen.animator = val2.GetComponentInChildren<Animator>(true);
			if ((Object)(object)mimicAussehen.animator != (Object)null)
			{
				mimicAussehen.animator.applyRootMotion = false;
			}
			if (text != null)
			{
				mimicAussehen.kiefer = val2.transform.Find(text);
				if (Object.op_Implicit((Object)(object)mimicAussehen.kiefer))
				{
					mimicAussehen.kieferStart = mimicAussehen.kiefer.localRotation;
				}
			}
			mimicAussehen.rumpf = ((text2 != null) ? val2.transform.Find(text2) : null);
			mimicAussehen.kopf = ((text3 != null) ? val2.transform.Find(text3) : null);
			if ((Object)(object)mimicAussehen.rumpf == (Object)null)
			{
				mimicAussehen.rumpf = ((IEnumerable<Transform>)val2.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform val17) => ((Object)val17).name.ToLowerInvariant().Contains("body top") || ((Object)val17).name.ToLowerInvariant().Contains("bodytop")));
			}
			if ((Object)(object)mimicAussehen.kopf == (Object)null)
			{
				mimicAussehen.kopf = ((IEnumerable<Transform>)val2.GetComponentsInChildren<Transform>(true)).FirstOrDefault((Func<Transform, bool>)((Transform val17) => ((Object)val17).name.ToLowerInvariant().Contains("head")));
			}
			if (Object.op_Implicit((Object)(object)mimicAussehen.rumpf))
			{
				mimicAussehen.rumpfStart = mimicAussehen.rumpf.localPosition;
			}
			if (Object.op_Implicit((Object)(object)mimicAussehen.kopf))
			{
				mimicAussehen.kopfStart = mimicAussehen.kopf.localPosition;
			}
			componentsInChildren11 = val2.GetComponentsInChildren<Renderer>(true);
			for (int i = 0; i < componentsInChildren11.Length; i++)
			{
				Material[] sharedMaterials = componentsInChildren11[i].sharedMaterials;
				foreach (Material val11 in sharedMaterials)
				{
					if ((Object)(object)val11 != (Object)null && ((Object)val11).name.ToLowerInvariant().Contains("eye") && val11.HasProperty("_EmissionColor"))
					{
						mimicAussehen.augen.Add(val11);
						mimicAussehen.augenStart.Add(val11.GetColor("_EmissionColor"));
					}
				}
			}
			try
			{
				componentsInChildren11 = val2.GetComponentsInChildren<Renderer>(true);
				foreach (Renderer val12 in componentsInChildren11)
				{
					if (((Object)((Component)val12).gameObject).name.ToLowerInvariant() == "mesh_health" && (Object)(object)val12.sharedMaterial != (Object)null && val12.sharedMaterial.HasProperty("_OffsetX"))
					{
						mimicAussehen.lebenMat = val12.sharedMaterial;
						break;
					}
				}
				PlayerHealth val13 = (((Object)(object)vorbild != (Object)null) ? vorbild.playerHealth : null);
				if ((Object)(object)val13 != (Object)null)
				{
					mimicAussehen.lebenFarbe = val13.healthMaterialColor;
					mimicAussehen.lebenStart = ((val13.maxHealth > 0) ? Mathf.Clamp01((float)val13.health / (float)val13.maxHealth) : 1f);
				}
				if ((Object)(object)vorbild != (Object)null && vorbild.isDisabled)
				{
					mimicAussehen.lebenStart = 1f;
				}
				mimicAussehen.Lebensanzeige(1f);
			}
			catch (Exception ex4)
			{
				Plugin.Log.LogWarning((object)("[Mimic] Lebensanzeige: " + ex4.Message));
			}
			if (Plugin.DebugLog.Value)
			{
				Plugin.Log.LogInfo((object)string.Format("[Mimic] Verwandlung: Rumpf {0}, Kopf {1}, Augen-Materialien {2}", Object.op_Implicit((Object)(object)mimicAussehen.rumpf) ? ((Object)mimicAussehen.rumpf).name : "–", Object.op_Implicit((Object)(object)mimicAussehen.kopf) ? ((Object)mimicAussehen.kopf).name : "–", mimicAussehen.augen.Count));
			}
			mimicAussehen.hand = (from val17 in val2.GetComponentsInChildren<Transform>(true).Where(delegate(Transform val17)
				{
					string text8 = ((Object)val17).name.ToLowerInvariant();
					return (text8.Contains("hand") || text8.Contains("arm")) && (text8.Contains("right") || text8.EndsWith("_r") || text8.EndsWith(".r") || text8.Contains(" r") || text8.EndsWith("r"));
				})
				orderby ((Object)val17).name.ToLowerInvariant().Contains("hand") descending
				select val17).FirstOrDefault();
			if (Plugin.DebugLog.Value)
			{
				Plugin.Log.LogInfo((object)("[Mimic] Kiefer: " + (Object.op_Implicit((Object)(object)mimicAussehen.kiefer) ? ((Object)mimicAussehen.kiefer).name : "–") + ", Hand: " + (Object.op_Implicit((Object)(object)mimicAussehen.hand) ? ((Object)mimicAussehen.hand).name : "– (Messer an der Brust)")));
			}
			val2.transform.SetParent((Transform)null, false);
			val2.transform.localScale = ((Component)playerAvatarVisuals).transform.lossyScale;
			mimicAussehen.basisSkala = val2.transform.localScale;
			mimicAussehen.koerperZiel = koerper;
			mimicAussehen.versatz = new Vector3(mitte.x, bodenY, mitte.z);
			((Component)mimicAussehen).transform.SetPositionAndRotation(koerper.TransformPoint(mimicAussehen.versatz), Quaternion.Euler(0f, koerper.eulerAngles.y, 0f));
			Object.Destroy((Object)(object)val);
			if ((Object)(object)mimicAussehen.animator != (Object)null)
			{
				((Behaviour)mimicAussehen.animator).enabled = true;
				mimicAussehen.animator.cullingMode = (AnimatorCullingMode)0;
				mimicAussehen.animator.speed = 1f;
				mimicAussehen.animator.Rebind();
				mimicAussehen.parameter = mimicAussehen.animator.parameters.ToList();
				mimicAussehen.animatorGeht = mimicAussehen.parameter.Any(delegate(AnimatorControllerParameter p)
				{
					string text8 = p.name.ToLowerInvariant();
					return text8.Contains("mov") || text8.Contains("walk") || text8.Contains("speed");
				});
				try
				{
					mimicAussehen.spieler = new SpielerAnimation(playerAvatarVisuals, val2.transform, mimicAussehen.animator, playerAvatarRightArm, val6);
					Plugin.Log.LogInfo((object)("[Mimic] Spieler-Animation (Nachbau PlayerAvatarVisuals): " + (mimicAussehen.spieler.Bereit ? "aktiv" : "NICHT aktiv") + ((mimicAussehen.spieler.Fehlt.Length > 0) ? (", fehlt: " + mimicAussehen.spieler.Fehlt) : "")));
					if (!mimicAussehen.spieler.Bereit)
					{
						mimicAussehen.spieler = null;
					}
				}
				catch (Exception ex5)
				{
					Plugin.Log.LogWarning((object)("[Mimic] Spieler-Animation fehlgeschlagen: " + ex5));
					mimicAussehen.spieler = null;
				}
				if (Plugin.DebugLog.Value)
				{
					Plugin.Log.LogInfo((object)("[Mimic] Animator: Controller " + (((Object)(object)mimicAussehen.animator.runtimeAnimatorController != (Object)null) ? ((Object)mimicAussehen.animator.runtimeAnimatorController).name : "keiner") + ", Parameter: " + string.Join(", ", mimicAussehen.parameter.Select((AnimatorControllerParameter p) => $"{p.name}({p.type})"))));
				}
			}
			Transform val14 = ((text4 != null) ? val2.transform.Find(text4) : null);
			if ((Object)(object)val14 != (Object)null)
			{
				mimicAussehen.armRuhe = ((val5 != Vector3.zero) ? Quaternion.Euler(val5) : val14.localRotation);
				mimicAussehen.armRuheDa = true;
				val14.localRotation = mimicAussehen.armRuhe;
			}
			mimicAussehen.armL = ((text5 != null) ? val2.transform.Find(text5) : null);
			if ((Object)(object)mimicAussehen.armL != (Object)null)
			{
				mimicAussehen.armLRuhe = ((val7 != Vector3.zero) ? Quaternion.Euler(val7) : mimicAussehen.armL.localRotation);
				mimicAussehen.armLRuheDa = true;
				mimicAussehen.armL.localRotation = mimicAussehen.armLRuhe;
			}
			componentsInChildren2 = val2.GetComponentsInChildren<Transform>(true);
			foreach (Transform val15 in componentsInChildren2)
			{
				string text7 = ((Object)val15).name.ToLowerInvariant();
				if (text7.Contains("leg") && !text7.Contains("twist") && (!((Object)(object)val15.parent != (Object)null) || !((Object)val15.parent).name.ToLowerInvariant().Contains("leg")))
				{
					float x = val2.transform.InverseTransformPoint(val15.position).x;
					mimicAussehen.beine.Add(val15);
					mimicAussehen.beinRuhe.Add(val15.localRotation);
					mimicAussehen.beinSeite.Add((x < 0f) ? (-1f) : 1f);
				}
			}
			foreach (string item in list)
			{
				Transform t = val2.transform.Find(item);
				if ((Object)(object)t != (Object)null && !mimicAussehen.augenT.Any((Transform a) => t.IsChildOf(a)))
				{
					mimicAussehen.augenT.Add(t);
					mimicAussehen.augenRuhe.Add(t.localRotation);
				}
			}
			if (Plugin.DebugLog.Value)
			{
				Plugin.Log.LogInfo((object)string.Format("[Mimic] Arm R: {0} Ruhe {1}, Arm L: {2} Ruhe {3}, Beine: {4}, Augen: {5}, Animator bewegt Beine: {6}", Object.op_Implicit((Object)(object)val14) ? ((Object)val14).name : "–", val5, Object.op_Implicit((Object)(object)mimicAussehen.armL) ? ((Object)mimicAussehen.armL).name : "–", val7, string.Join(", ", mimicAussehen.beine.Select((Transform b) => ((Object)b).name)), string.Join(", ", mimicAussehen.augenT.Select((Transform a) => ((Object)a).name)), mimicAussehen.animatorGeht));
				Plugin.Log.LogInfo((object)("[Mimic] Aufbau Spielermodell:\n" + Baum(val2.transform, 0)));
			}
			componentsInChildren11 = val2.GetComponentsInChildren<Renderer>(true);
			for (int i = 0; i < componentsInChildren11.Length; i++)
			{
				Material[] sharedMaterials = componentsInChildren11[i].sharedMaterials;
				foreach (Material val16 in sharedMaterials)
				{
					if ((Object)(object)val16 != (Object)null && !mimicAussehen.augen.Contains(val16) && (Object)(object)val16 != (Object)(object)mimicAussehen.lebenMat)
					{
						int num3 = FarbFeld(val16);
						if (num3 != 0)
						{
							mimicAussehen.hautMat.Add(val16);
							mimicAussehen.hautFeld.Add(num3);
							mimicAussehen.hautStart.Add(val16.GetColor(num3));
						}
					}
				}
			}
			if ((Object)(object)val14 != (Object)null)
			{
				mimicAussehen.arm = val14;
			}
			else if ((Object)(object)mimicAussehen.hand != (Object)null)
			{
				mimicAussehen.arm = ((((Object)mimicAussehen.hand).name.ToLowerInvariant().Contains("hand") && (Object)(object)mimicAussehen.hand.parent != (Object)null) ? mimicAussehen.hand.parent : mimicAussehen.hand);
			}
			if ((Object)(object)mimicAussehen.arm != (Object)null && !mimicAussehen.armRuheDa)
			{
				mimicAussehen.armRuhe = mimicAussehen.arm.localRotation;
				mimicAussehen.armRuheDa = true;
			}
			mimicAussehen.MesserBauen(koerper);
			mimicAussehen.fleischUnten = mimicAussehen.FleischBauen("FleischUnten");
			mimicAussehen.fleischOben = mimicAussehen.FleischBauen("FleischOben");
			mimicAussehen.MaulBauen();
			mimicAussehen.BeulenBauen();
			mimicAussehen.alleRenderer = val2.GetComponentsInChildren<Renderer>(true);
			if (Plugin.DebugLog.Value)
			{
				Plugin.Log.LogInfo((object)string.Format("[Mimic] Modell frei folgend, Maßstab {0}, Arm: {1}, Hautmaterialien {2}", val2.transform.localScale, Object.op_Implicit((Object)(object)mimicAussehen.arm) ? ((Object)mimicAussehen.arm).name : "–", mimicAussehen.hautMat.Count));
			}
			return mimicAussehen;
		}

		private static string Baum(Transform t, int tiefe)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Expected O, but got Unknown
			StringBuilder stringBuilder = new StringBuilder();
			stringBuilder.Append(new string(' ', tiefe * 2)).Append(((Object)t).name).Append('\n');
			if (tiefe < 16)
			{
				foreach (Transform item in t)
				{
					Transform t2 = item;
					stringBuilder.Append(Baum(t2, tiefe + 1));
				}
			}
			return stringBuilder.ToString();
		}

		private static int FarbFeld(Material m)
		{
			string[] array = new string[3] { "_AlbedoColor", "_BaseColor", "_Color" };
			foreach (string text in array)
			{
				if (m.HasProperty(text))
				{
					return Shader.PropertyToID(text);
				}
			}
			return 0;
		}

		internal static string Pfad(Transform wurzel, Transform t)
		{
			List<string> list = new List<string>();
			while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)wurzel)
			{
				list.Insert(0, ((Object)t).name);
				t = t.parent;
			}
			if (!((Object)(object)t == (Object)(object)wurzel))
			{
				return null;
			}
			return string.Join("/", list);
		}

		private void MesserBauen(Transform koerper)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: 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_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = new GameObject("Messer").transform;
			Transform val = (((Object)(object)hand != (Object)null) ? hand : ((Component)this).transform);
			transform.SetParent(val, false);
			if ((Object)(object)hand == (Object)null)
			{
				messerRuhePos = new Vector3(0.28f, 0.9f, 0.25f);
			}
			transform.localPosition = messerRuhePos;
			Vector3 lossyScale = val.lossyScale;
			transform.localScale = new Vector3(1f / Mathf.Max(0.001f, lossyScale.x), 1f / Mathf.Max(0.001f, lossyScale.y), 1f / Mathf.Max(0.001f, lossyScale.z));
			Teil((PrimitiveType)2, transform, new Vector3(0f, 0f, 0f), new Vector3(0.035f, 0.06f, 0.035f), new Color(0.2f, 0.12f, 0.06f), Quaternion.Euler(90f, 0f, 0f));
			Teil((PrimitiveType)3, transform, new Vector3(0f, 0f, 0.065f), new Vector3(0.08f, 0.015f, 0.015f), new Color(0.3f, 0.3f, 0.32f), Quaternion.identity);
			Teil((PrimitiveType)3, transform, new Vector3(0f, 0f, 0.19f), new Vector3(0.035f, 0.006f, 0.22f), new Color(0.82f, 0.84f, 0.88f), Quaternion.identity);
			messer = transform;
			((Component)messer).gameObject.SetActive(false);
		}

		private GameObject Teil(PrimitiveType typ, Transform p, Vector3 pos, Vector3 skala, Color farbe, Quaternion rot)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.CreatePrimitive(typ);
			Object.DestroyImmediate((Object)(object)val.GetComponent<Collider>());
			val.layer = ((Component)this).gameObject.layer;
			val.transform.SetParent(p, false);
			val.transform.localPosition = pos;
			val.transform.localScale = skala;
			val.transform.localRotation = rot;
			Renderer componentInChildren = ((Component)this).GetComponentInChildren<Renderer>(true);
			Material val2 = ((componentInChildren != null) ? componentInChildren.sharedMaterial : null);
			Material val3 = (((Object)(object)val2 != (Object)null) ? new Material(val2) : new Material(Shader.Find("Standard")));
			string[] texturePropertyNames;
			try
			{
				texturePropertyNames = val3.GetTexturePropertyNames();
				foreach (string text in texturePropertyNames)
				{
					string text2 = text.ToLowerInvariant();
					if (!text2.Contains("normal") && !text2.Contains("bump") && !((Object)(object)val3.GetTexture(text) == (Object)null))
					{
						val3.SetTexture(text, (Texture)(object)(text2.Contains("emis") ? Texture2D.blackTexture : Texture2D.whiteTexture));
					}
				}
			}
			catch
			{
			}
			texturePropertyNames = new string[5] { "_Color", "_BaseColor", "_AlbedoColor", "_MainColor", "_Tint" };
			foreach (string text3 in texturePropertyNames)
			{
				if (val3.HasProperty(text3))
				{
					val3.SetColor(text3, farbe);
				}
			}
			if (val3.HasProperty("_EmissionColor"))
			{
				val3.SetColor("_EmissionColor", Color.black);
			}
			if (val3.HasProperty("_FresnelColor"))
			{
				val3.SetColor("_FresnelColor", farbe * 0.3f);
			}
			((Object)val3).name = "Mimic Teil " + teilNr++;
			val.GetComponent<Renderer>().sharedMaterial = val3;
			return val;
		}

		internal void MesserZiehen(bool an)
		{
			if (Object.op_Implicit((Object)(object)messer))
			{
				((Component)messer).gameObject.SetActive(an && !Plugin.TongueAttack.Value);
			}
			maulAuf = an;
		}

		private void MaulBauen()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			maulWurzel = new GameObject("MimicMaul").transform;
			maulWurzel.SetParent(((Component)this).transform, false);
			Color farbe = default(Color);
			((Color)(ref farbe))..ctor(0.93f, 0.9f, 0.78f);
			for (int i = 0; i < 9; i++)
			{
				zaehneUnten.Add(Teil((PrimitiveType)0, maulWurzel, Vector3.zero, Vector3.one * 0.01f, farbe, Quaternion.identity).transform);
				zaehneOben.Add(Teil((PrimitiveType)0, maulWurzel, Vector3.zero, Vector3.one * 0.01f, farbe, Quaternion.identity).transform);
			}
			Color farbe2 = default(Color);
			((Color)(ref farbe2))..ctor(0.78f, 0.16f, 0.24f);
			for (int j = 0; j < 14; j++)
			{
				zunge.Add(Teil((PrimitiveType)1, maulWurzel, Vector3.zero, Vector3.one * 0.01f, farbe2, Quaternion.identity).transform);
			}
			zungenSpitze = Teil((PrimitiveType)0, maulWurzel, Vector3.zero, Vector3.one * 0.01f, new Color(0.95f, 0.92f, 0.85f), Quaternion.identity).transform;
			foreach (Transform item in maulWurzel)
			{
				((Component)item).gameObject.SetActive(false);
			}
		}

		internal void Zunge(Vector3 ziel)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			zungenZiel = ziel;
			zungenStart = Time.time;
			stichZeit = Time.time;
		}

		private void MaulAnwenden(float v)
		{
			//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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: 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_0079: 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_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0272: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_029a: Unknown result type (might be due to invalid IL or missing references)
			//IL_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0404: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_040b: Unknown result type (might be due to invalid IL or missing references)
			//IL_043d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_045c: Unknown result type (might be due to invalid IL or missing references)
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: 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_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0501: Unknown result type (might be due to invalid IL or missing references)
			//IL_0506: Unknown result type (might be due to invalid IL or missing references)
			//IL_050b: Unknown result type (might be due to invalid IL or missing references)
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0516: Unknown result type (might be due to invalid IL or missing references)
			//IL_053b: Unknown result type (might be due to invalid IL or missing references)
			//IL_053d: Unknown result type (might be due to invalid IL or missing references)
			//IL_053f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05da: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_0562: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)maulWurzel == (Object)null)
			{
				return;
			}
			Vector3 lossyScale = ((Component)this).transform.lossyScale;
			maulWurzel.localScale = new Vector3(1f / Mathf.Max(0.001f, lossyScale.x), 1f / Mathf.Max(0.001f, lossyScale.y), 1f / Mathf.Max(0.001f, lossyScale.z));
			maulWurzel.position = ((Component)this).transform.position;
			maulWurzel.rotation = ((Component)this).transform.rotation;
			float num = Mathf.Max(0.3f, lossyScale.y);
			float num2 = (mundDa ? Mathf.Clamp01((v - 0.25f) / 0.5f) : 0f);
			Vector3 up = ((Component)this).transform.up;
			Vector3 forward = ((Component)this).transform.forward;
			Vector3 right = ((Component)this).transform.right;
			float num3 = 0.17f * num;
			for (int i = 0; i < 9; i++)
			{
				bool flag = num2 > 0.01f;
				if (((Component)zaehneUnten[i]).gameObject.activeSelf != flag)
				{
					((Component)zaehneUnten[i]).gameObject.SetActive(flag);
					((Component)zaehneOben[i]).gameObject.SetActive(flag);
				}
				if (flag)
				{
					float num4 = Mathf.Lerp(-150f, 150f, (float)i / 8f) * (MathF.PI / 180f);
					Vector3 val = (forward * Mathf.Cos(num4) + right * Mathf.Sin(num4)) * num3;
					float num5 = (0.09f + 0.05f * Mathf.Abs(Mathf.Sin((float)i * 2.3f))) * num * num2;
					zaehneUnten[i].position = mundUnten + val + up * num5 * 0.45f;
					zaehneUnten[i].rotation = Quaternion.LookRotation(forward, up);
					zaehneUnten[i].localScale = new Vector3(0.035f * num * num2, num5, 0.035f * num * num2);
					zaehneOben[i].position = mundOben + val * 0.95f - up * num5 * 0.45f;
					zaehneOben[i].rotation = Quaternion.LookRotation(forward, up);
					zaehneOben[i].localScale = new Vector3(0.035f * num * num2, num5, 0.035f * num * num2);
				}
			}
			float num6 = Time.time - zungenStart;
			float num7 = ((num6 < 0.12f) ? (num6 / 0.12f) : ((num6 < 0.26f) ? 1f : ((num6 < 0.56f) ? (1f - (num6 - 0.26f) / 0.3f) : 0f)));
			num7 = 1f - (1f - num7) * (1f - num7);
			bool flag2 = num7 > 0.01f && mundDa;
			if (((Component)zungenSpitze).gameObject.activeSelf != flag2)
			{
				((Component)zungenSpitze).gameObject.SetActive(flag2);
				foreach (Transform item in zunge)
				{
					((Component)item).gameObject.SetActive(flag2);
				}
			}
			if (flag2)
			{
				Vector3 val2 = (mundUnten + mundOben) * 0.5f + forward * num3 * 0.6f;
				Vector3 val3 = zungenZiel - val2;
				float num8 = Mathf.Clamp(((Vector3)(ref val3)).magnitude + 0.25f, 0.5f, 3.4f);
				Vector3 val4 = ((((Vector3)(ref val3)).sqrMagnitude > 0.001f) ? ((Vector3)(ref val3)).normalized : forward);
				Vector3 val5 = Vector3.Cross(val4, up);
				Vector3 normalized = ((Vector3)(ref val5)).normalized;
				float num9 = num8 * num7;
				Vector3 val6 = val2;
				for (int j = 0; j < 14; j++)
				{
					float num10 = ((float)j + 1f) / 14f;
					float num11 = Mathf.Sin(num10 * 9f - Time.time * 30f) * 0.05f * (1f - num7 * 0.7f) * Mathf.Sin(num10 * MathF.PI);
					Vector3 val7 = val2 + val4 * num9 * num10 + normalized * num11 + up * Mathf.Sin(num10 * MathF.PI) * 0.06f * (1f - num7);
					Vector3 val8 = val7 - val6;
					float num12 = Mathf.Lerp(0.085f, 0.045f, num10) * num;
					Transform obj = zunge[j];
					obj.position = (val7 + val6) * 0.5f;
					obj.rotation = ((((Vector3)(ref val8)).sqrMagnitude > 1E-06f) ? Quaternion.FromToRotation(Vector3.up, ((Vector3)(ref val8)).normalized) : Quaternion.identity);
					obj.localScale = new Vector3(num12, Mathf.Max(0.01f, ((Vector3)(ref val8)).magnitude * 0.6f + num12 * 0.3f), num12);
					val6 = val7;
				}
				zungenSpitze.position = val6 + val4 * 0.08f * num;
				zungenSpitze.rotation = Quaternion.LookRotation(val4, up);
				zungenSpitze.localScale = new Vector3(0.05f, 0.05f, 0.24f) * num;
			}
		}

		internal void Verwandeln(bool an, float dauer)
		{
			bool neu = an && verwandlungZiel < 0.5f;
			verwandlungZiel = (an ? 1f : 0f);
			verwandlungTempo = 1f / Mathf.Max(0.3f, dauer);
			try
			{
				VerwandlungsGeraeusch(an, neu, dauer);
			}
			catch (Exception ex)
			{
				Plugin.Log.LogWarning((object)("[Mimic] Verwandlungsgeräusch: " + ex.Message));
			}
		}

		private void VerwandlungsGeraeusch(bool an, bool neu, float dauer)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			if (!an)
			{
				if ((Object)(object)verwandlungsTon != (Object)null && verwandlungsTon.isPlaying)
				{
					((MonoBehaviour)this).StartCoroutine(TonAusblenden(verwandlungsTon, 1.2f));
				}
			}
			else if (neu)
			{
				if ((Object)(object)verwandlungsTon == (Object)null)
				{
					GameObject val = new GameObject("MimicVerwandlungTon");
					val.transform.SetParent(((Component)this).transform, false);
					val.transform.localPosition = Vector3.up * 1f;
					verwandlungsTon = val.AddComponent<AudioSource>();
					verwandlungsTon.playOnAwake = false;
					verwandlungsTon.spatialBlend = 1f;
					verwandlungsTon.dopplerLevel = 0f;
					verwandlungsTon.rolloffMode = (AudioRolloffMode)1;
					verwandlungsTon.minDistance = 3f;
					verwandlungsTon.maxDistance = 30f;
					verwandlungsTon.outputAudioMixerGroup = mixer;
				}
				verwandlungsTon.Stop();
				verwandlungsTon.volume = Mathf.Clamp01(Plugin.MorphSoundVolume.Value);
				verwandlungsTon.clip = VerwandlungsKlang.Holen(dauer);
				verwandlungsTon.Play();
			}
		}

		private static IEnumerator TonAusblenden(AudioSource a, float zeit)
		{
			float v0 = a.volume;
			for (float t = 0f; t < zeit; t += Time.deltaTime)
			{
				if (!((Object)(object)a != (Object)null))
				{
					break;
				}
				a.volume = v0 * (1f - t / zeit);
				yield return null;
			}
			if ((Object)(object)a != (Object)null)
			{
				a.Stop();
				a.volume = v0;
			}
		}

		private Transform FleischBauen(string name)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: 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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			Transform transform = new GameObject(name).transform;
			transform.SetParent(((Component)this).transform, false);
			Random random = new Random(name.Length * 31 + 7);
			Vector3 pos = default(Vector3);
			Vector3 skala = default(Vector3);
			for (int i = 0; i < 6; i++)
			{
				PrimitiveType typ = (PrimitiveType)(i % 2 == 0);
				float num = (float)random.NextDouble() * 360f;
				((Vector3)(ref pos))..ctor(Mathf.Cos(num * (MathF.PI / 180f)) * 0.35f, (float)random.NextDouble() * 1.6f - 0.8f, Mathf.Sin(num * (MathF.PI / 180f)) * 0.35f);
				((Vector3)(ref skala))..ctor(0.7f + (float)random.NextDouble() * 0.5f, 0.8f + (float)random.NextDouble() * 0.6f, 0.7f + (float)random.NextDouble() * 0.5f);
				Color farbe = Color.Lerp(new Color(0.42f, 0.04f, 0.05f), new Color(0.72f, 0.2f, 0.22f), (float)random.NextDouble());
				Teil(typ, transform, pos, skala, farbe, Quaternion.Euler(0f, num, (float)random.NextDouble() * 30f - 15f));
			}
			Teil((PrimitiveType)2, transform, Vector3.zero, new Vector3(0.9f, 1f, 0.9f), new Color(0.35f, 0.03f, 0.04f), Quaternion.identity);
			Renderer[] componentsInChildren = ((Component)transform).GetComponentsInChildren<Renderer>(true);
			for (int j = 0; j < componentsInChildren.Length; j++)
			{
				Material sharedMaterial = componentsInChildren[j].sharedMaterial;
				if (sharedMaterial.HasProperty("_Glossiness"))
				{
					sharedMaterial.SetFloat("_Glossiness", 0.85f);
				}
				if (sharedMaterial.HasProperty("_Smoothness"))
				{
					sharedMaterial.SetFloat("_Smoothness", 0.85f);
				}
			}
			((Component)transform).gameObject.SetActive(false);
			return transform;
		}

		private void AugenBewegen()
		{
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: 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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			//IL_022c: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: 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)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			if (augenT.Count == 0)
			{
				return;
			}
			Vector3? val = null;
			float num = 12f;
			PlayerAvatar val2 = blickSpieler;
			if ((Object)(object)val2 != (Object)null && !val2.isDisabled)
			{
				Vector3 val3 = (((Object)(object)val2.PlayerVisionTarget != (Object)null && (Object)(object)val2.PlayerVisionTarget.VisionTransform != (Object)null) ? val2.PlayerVisionTarget.VisionTransform.position : (((Component)val2).transform.position + Vector3.up * 1.3f));
				float num2 = Vector3.Distance(val3, augenT[0].position);
				if (num2 < num)
				{
					Vector3 forward = ((Component)this).transform.forward;
					Vector3 val4 = val3 - ((Component)this).transform.position;
					if (Vector3.Dot(forward, ((Vector3)(ref val4)).normalized) > -0.35f)
					{
						num = num2;
						val = val3;
					}
				}
			}
			float num3 = 0f;
			float num4 = 0f;
			if (val.HasValue)
			{
				Vector3 val5 = ((Component)this).transform.InverseTransformDirection(val.Value - augenT[0].position);
				num3 = Mathf.Clamp(Mathf.Atan2(val5.x, val5.z) * 57.29578f, -65f, 65f);
				float y = val5.y;
				Vector2 val6 = new Vector2(val5.x, val5.z);
				num4 = Mathf.Clamp((0f - Mathf.Atan2(y, ((Vector2)(ref val6)).magnitude)) * 57.29578f, -30f, 30f);
			}
			blickGier = Mathf.Lerp(blickGier, num3, Time.deltaTime * 10f);
			blickNick = Mathf.Lerp(blickNick, num4, Time.deltaTime * 10f);
			for (int i = 0; i < augenT.Count; i++)
			{
				if (!((Object)(object)augenT[i] == (Object)null))
				{
					augenT[i].localRotation = augenRuhe[i];
					augenT[i].rotation = Quaternion.AngleAxis(blickGier, ((Component)this).transform.up) * Quaternion.AngleAxis(blickNick, ((Component)this).transform.right) * augenT[i].rotation;
				}
			}
		}

		private void BeulenBauen()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: 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_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			Random random = new Random(4711);
			Transform[] array = (Transform[])(object)new Transform[5] { rumpf, kopf, rumpf, kopf, rumpf };
			foreach (Transform val in array)
			{
				if (!((Object)(object)val == (Object)null))
				{
					Transform transform = new GameObject("Beule").transform;
					transform.SetParent(val, false);
					Vector3 lossyScale = val.lossyScale;
					transform.localScale = new Vector3(1f / Mathf.Max(0.001f, lossyScale.x), 1f / Mathf.Max(0.001f, lossyScale.y), 1f / Mathf.Max(0.001f, lossyScale.z));
					float num = (float)random.NextDouble() * MathF.PI * 2f;
					transform.position = val.position + (((Component)this).transform.right * Mathf.Cos(num) + ((Component)this).transform.forward * Mathf.Sin(num)) * 0.22f + ((Component)this).transform.up * ((float)random.NextDouble() * 0.2f - 0.05f);
					Teil((PrimitiveType)0, transform, Vector3.zero, Vector3.one * 0.16f, new Color(0.55f, 0.05f, 0.06f), Quaternion.identity);
					Teil((PrimitiveType)0, transform, new Vector3(0.06f, 0.04f, 0.02f), Vector3.one * 0.1f, new Color(0.7f, 0.15f, 0.16f), Quaternion.identity);
					((Component)transform).gameObject.SetActive(false);
					beulen.Add(transform);
				}
			}
		}

		private float Blickrichtung(Vector3 jetzt)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			if (float.IsNaN(gierWinkel))
			{
				gierWinkel = koerperZiel.eulerAngles.y;
				gierLetztePos = jetzt;
			}
			Vector3 val = weltTempo;
			float num = Mathf.Max(Time.deltaTime, 0.0001f);
			float num2 = gierWinkel;
			Quaternion val2;
			if (((Vector3)(ref val)).magnitude > 0.35f)
			{
				val2 = Quaternion.LookRotation(val);
				num2 = ((Quaternion)(ref val2)).eulerAngles.y;
				nachdrehen = false;
				drehAb = -1f;
			}
			else if (BlickZiel.HasValue)
			{
				Vector3 val3 = BlickZiel.Value - jetzt;
				val3.y = 0f;
				if (((Vector3)(ref val3)).sqrMagnitude > 0.04f)
				{
					val2 = Quaternion.LookRotation(val3);
					float y = ((Quaternion)(ref val2)).eulerAngles.y;
					float num3 = Mathf.Abs(Mathf.DeltaAngle(gierWinkel, y));
					if (!nachdrehen)
					{
						if (num3 > 70f)
						{
							if (drehAb < 0f)
							{
								drehAb = Time.time + Random.Range(0.35f, 1.2f);
							}
							if (Time.time >= drehAb)
							{
								nachdrehen = true;
								drehVersatz = Random.Range(-15f, 15f);
							}
						}
						else
						{
							drehAb = -1f;
						}
					}
					if (nachdrehen)
					{
						num2 = y + drehVersatz;
						if (Mathf.Abs(Mathf.DeltaAngle(gierWinkel, num2)) < 5f)
						{
							nachdrehen = false;
							drehAb = -1f;
						}
					}
				}
			}
			else
			{
				nachdrehen = false;
				drehAb = -1f;
			}
			gierLetztePos = jetzt;
			if (((Vector3)(ref val)).magnitude > 0.35f)
			{
				gierWinkel = Mathf.MoveTowardsAngle(gierWinkel, num2, 300f * num);
				drehTempo = 0f;
			}
			else
			{
				gierWinkel = Mathf.SmoothDampAngle(gierWinkel, num2, ref drehTempo, 0.22f, 220f, num);
			}
			return gierWinkel;
		}

		private void LateUpdate()
		{
			//IL_027f: Unknown result type (might be due to invalid IL or missing references)
			//IL_029e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: 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_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0338: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0216: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: 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)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_044b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: 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_04d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04df: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0477: Unknown result type (might be due to invalid IL or missing references)
			//IL_0479: Unknown result type (might be due to invalid IL or missing references)
			//IL_0489: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_058d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: 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_05ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0602: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0612: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_07bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07da: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_06be: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c3: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)koerperZiel == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
				return;
			}
			bool activeInHierarchy = ((Component)koerperZiel).gameObject.activeInHierarchy;
			if (activeInHierarchy != zuletztSichtbar)
			{
				Renderer[] array = alleRenderer;
				foreach (Renderer val in array)
				{
					if (Object.op_Implicit((Object)(object)val))
					{
						val.enabled = activeInHierarchy;
					}
				}
				zuletztSichtbar = activeInHierarchy;
			}
			float num = Mathf.Clamp01(tempo / 2.2f);
			schrittPhase += Time.deltaTime * (5f + tempo * 2.4f) * ((num > 0.05f) ? 1f : 0f);
			haltung = Mathf.MoveTowards(haltung, angriffsHaltung ? 1f : 0f, Time.deltaTime * 2.5f);
			float num2 = Mathf.Abs(Mathf.Sin(schrittPhase)) * 0.07f * num;
			float num3 = Mathf.Sin(schrittPhase) * 5f * num + Mathf.Sin(Time.time * 1.3f) * 1.2f;
			float num4 = 6f * num + 16f * haltung;
			Quaternion val2 = Quaternion.Euler(0f, Blickrichtung(koerperZiel.position), 0f);
			Vector3 val3 = koerperZiel.TransformPoint(versatz);
			if ((Object)(object)gegnerWurzel == (Object)null)
			{
				EnemyParent componentInParent = ((Component)koerperZiel).GetComponentInParent<EnemyParent>();
				gegnerWurzel = (((Object)(object)componentInParent != (Object)null) ? ((Component)componentInParent).transform : koerperZiel);
			}
			if ((Object)(object)gegnerRb == (Object)null)
			{
				gegnerRb = ((Component)koerperZiel).GetComponentInParent<EnemyRigidbody>() ?? ((Component)koerperZiel).GetComponentInChildren<EnemyRigidbody>();
			}
			float y;
			bool flag = ExplosionsHilfe.Boden(koerperZiel.position, gegnerWurzel, out y);
			if (!ruheUpDa)
			{
				ruheUpDa = true;
				ruheUp = koerperZiel.up;
			}
			bool flag2 = false;
			try
			{
				flag2 = (Object)(object)gegnerRb != (Object)null && (gegnerRb.grabbed || ((Object)(object)gegnerRb.physGrabObject != (Object)null && gegnerRb.physGrabObject.playerGrabbing.Count > 0));
			}
			catch
			{
			}
			float num5 = (flag ? (val3.y - y) : 0f);
			bool flag3 = flag2 || num5 > 0.45f || Vector3.Angle(koerperZiel.up, ruheUp) > 35f;
			if (!flag3)
			{
				ruheDrehung = koerperZiel.rotation;
			}
			if (flag3 != inLuft)
			{
				inLuft = flag3;
				if (!inLuft)
				{
					bodenHoehe = (flag ? y : bodenHoehe);
				}
			}
			if (inLuft)
			{
				bodenHoehe = float.NaN;
				Quaternion val4 = koerperZiel.rotation * Quaternion.Inverse(ruheDrehung);
				((Component)this).transform.SetPositionAndRotation(val3, val4 * val2);
				if (spieler != null)
				{
					spieler.Arme(Time.deltaTime, !((Object)(object)messer != (Object)null) || !((Component)messer).gameObject.activeSelf);
				}
				VerwandlungAnwenden();
				return;
			}
			if (flag)
			{
				bodenHoehe = (float.IsNaN(bodenHoehe) ? y : Mathf.MoveTowards(bodenHoehe, y, Time.deltaTime * 3f));
			}
			if (!float.IsNaN(bodenHoehe))
			{
				val3.y = bodenHoehe;
			}
			float num6 = Mathf.Clamp01((Time.time - stichZeit) / 0.55f);
			float num7 = ((num6 < 1f) ? Mathf.Sin(Mathf.Clamp01((num6 - 0.3f) / 0.4f) * MathF.PI) : 0f);
			num4 += 24f * num7;
			val3 += val2 * Vector3.forward * 0.3f * num7;
			if (spieler != null)
			{
				float num8 = 16f * haltung + 24f * num7;
				((Component)this).transform.SetPositionAndRotation(val3 + Vector3.up * spieler.SprungHoehe, spieler.Koerper(((Quaternion)(ref val2)).eulerAngles.y, Time.deltaTime) * Quaternion.Euler(num8, 0f, 0f));
			}
			else
			{
				((Component)this).transform.SetPositionAndRotation(val3 + Vector3.up * num2, val2 * Quaternion.Euler(num4, 0f, num3));
			}
			float num9 = Mathf.Sin(schrittPhase) * 22f * num;
			if (spieler != null)
			{
				spieler.Arme(Time.deltaTime, !((Object)(object)messer != (Object)null) || !((Component)messer).gameObject.activeSelf);
			}
			else if ((Object)(object)arm != (Object)null && armRuheDa && (!((Object)(object)messer != (Object)null) || !((Component)messer).gameObject.activeSelf))
			{
				arm.localRotation = armRuhe;
				arm.rotation = Quaternion.AngleAxis(0f - num9, ((Component)this).transform.right) * arm.rotation;
			}
			if (spieler == null && (Object)(object)armL != (Object)null && armLRuheDa)
			{
				armL.localRotation = armLRuhe;
				armL.rotation = Quaternion.AngleAxis(num9, ((Component)this).transform.right) * armL.rotation;
			}
			if (spieler == null && !animatorGeht)
			{
				for (int j = 0; j < beine.Count; j++)
				{
					if (!((Object)(object)beine[j] == (Object)null))
					{
						beine[j].localRotation = beinRuhe[j];
						beine[j].rotation = Quaternion.AngleAxis(Mathf.Sin(schrittPhase) * 30f * num * beinSeite[j], ((Component)this).transform.right) * beine[j].rotation;
					}
				}
			}
			AugenBewegen();
			if ((Object)(object)arm != (Object)null && (Object)(object)messer != (Object)null && ((Component)messer).gameObject.activeSelf)
			{
				float num10 = -75f + Mathf.Sin(Time.time * 6f) * 6f;
				if (num6 < 1f)
				{
					num10 = ((num6 < 0.3f) ? Mathf.Lerp(-75f, -160f, num6 / 0.3f) : ((!(num6 < 0.55f)) ? Mathf.Lerp(-25f, -75f, (num6 - 0.55f) / 0.45f) : Mathf.Lerp(-160f, -25f, (num6 - 0.3f) / 0.25f)));
				}
				arm.localRotation = armRuhe;
				arm.rotation = Quaternion.AngleAxis(num10, ((Component)this).transform.right) * arm.rotation;
			}
			VerwandlungAnwenden();
		}

		private void VerwandlungAnwenden()
		{
			//IL_00b6: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_028e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: Unknown result type (might be due to invalid IL or missing references)
			//IL_0296: Unknown result type (might be due to invalid IL or missing references)
			//IL_0298: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: 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_0311: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_040c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_038e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0393: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_043f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0511: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c3: Unknown result type (might be due to invalid IL or missing references)
			verwandlung = Mathf.MoveTowards(verwandlung, verwandlungZiel, verwandlungTempo * Time.deltaTime);
			float num = verwandlung * verwandlung * (3f - 2f * verwandlung);
			float num2 = ((num > 0.01f) ? (Mathf.PerlinNoise(Time.time * 9f, 0.3f) - 0.5f) : 0f);
			float num3 = Mathf.Clamp01(gluehen);
			float num4 = ((num3 > 0.001f) ? (0.5f + 0.5f * Mathf.Sin(Time.time * (10f + 30f * num3))) : 0f);
			((Component)this).transform.localScale = basisSkala * (1f + 0.3f * num + num2 * 0.04f * num + num3 * (0.12f + 0.06f * num4));
			Vector3 up = ((Component)this).transform.up;
			Vector3 unten = Vector3.zero;
			Vector3 oben = Vector3.zero;
			Vector3 unten2 = Vector3.zero;
			Vector3 oben2 = Vector3.zero;
			if ((Object)(object)rumpf != (Object)null)
			{
				unten = rumpf.parent.TransformPoint(rumpfStart);
				rumpf.localPosition = rumpfStart + rumpf.parent.InverseTransformVector(up * (0.42f * num + num2 * 0.06f * num));
				oben = rumpf.position;
			}
			float num5 = Time.time - zungenStart;
			float num6 = (((!maulAuf && !(num5 < 0.7f)) || !Plugin.TongueAttack.Value) ? 0f : ((num5 < 0.7f) ? (0.12f + 0.18f * Mathf.Sin(Mathf.Clamp01(num5 / 0.7f) * MathF.PI)) : 0.12f));
			if ((Object)(object)kopf != (Object)null)
			{
				unten2 = kopf.parent.TransformPoint(kopfStart);
				kopf.localPosition = kopfStart + kopf.parent.InverseTransformVector(up * (0.5f * num + num6 * num - num2 * 0.07f * num));
				oben2 = kopf.position;
			}
			mundDa = (Object)(object)kopf != (Object)null && Plugin.TongueAttack.Value;
			if (mundDa)
			{
				mundUnten = unten2;
				mundOben = oben2;
			}
			if ((Object)(object)kopf != (Object)null)
			{
				kopf.localRotation = Basis(kopf, ref kopfInit, ref kopfBasis, kopfGeschrieben);
				if (num > 0.01f)
				{
					kopf.rotation = Quaternion.AngleAxis(30f * num * Mathf.Sin(Time.time * 2.1f) + num2 * 45f * num, ((Component)this).transform.forward) * kopf.rotation;
				}
				if (Time.time < kopfZuckenBis)
				{
					kopf.rotation = Quaternion.AngleAxis(kopfZuckWinkel * Mathf.Sin((kopfZuckenBis - Time.time) / 0.18f * MathF.PI), ((Component)this).transform.forward) * kopf.rotation;
				}
				kopfGeschrieben = kopf.localRotation;
			}
			Strang(fleischUnten, (Object)(object)rumpf != (Object)null, unten, oben, 0.62f, num);
			Strang(fleischOben, (Object)(object)kopf != (Object)null, unten2, oben2, 0.48f, num);
			for (int i = 0; i < hautMat.Count; i++)
			{
				Color val = Color.Lerp(hautStart[i], new Color(0.45f, 0.02f, 0.03f), 0.8f * num);
				if (num3 > 0.001f)
				{
					val = Color.Lerp(val, new Color(1f, 0.93f, 0.85f), num4 * num3 * 0.85f);
				}
				hautMat[i].SetColor(hautFeld[i], val);
			}
			for (int j = 0; j < beulen.Count; j++)
			{
				Transform val2 = beulen[j];
				bool flag = num > 0.05f;
				if (((Component)val2).gameObject.activeSelf != flag)
				{
					((Component)val2).gameObject.SetActive(flag);
				}
				if (flag)
				{
					Vector3 lossyScale = val2.parent.lossyScale;
					float num7 = 1.6f * num * (1f + Mathf.Sin(Time.time * (3f + (float)j)) * 0.18f) * (0.8f + (float)j * 0.15f);
					val2.localScale = new Vector3(num7 / Mathf.Max(0.001f, lossyScale.x), num7 / Mathf.Max(0.001f, lossyScale.y), num7 / Mathf.Max(0.001f, lossyScale.z));
				}
			}
			float num8 = ((Time.time < augenBlitzBis) ? 1f : 0f);
			for (int k = 0; k < augen.Count; k++)
			{
				augen[k].SetColor("_EmissionColor", Color.Lerp(augenStart[k], new Color(3f, 0.05f, 0.02f), Mathf.Max(num, num8)));
			}
			MaulAnwenden(num);
		}

		private void Strang(Transform t, bool da, Vector3 unten, Vector3 oben, float dicke, float v)
		{
			//IL_003d: 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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)t == (Object)null)
			{
				return;
			}
			bool flag = da && v > 0.02f;
			if (((Component)t).gameObject.activeSelf != flag)
			{
				((Component)t).gameObject.SetActive(flag);
			}
			if (flag)
			{
				float num = Mathf.Max(0.01f, Vector3.Distance(unten, oben));
				t.position = (unten + oben) / 2f;
				Vector3 up = Vector3.up;
				Vector3 val = oben - unten;
				Vector3 val2;
				if (!(((Vector3)(ref val)).sqrMagnitude > 0.0001f))
				{
					val2 = ((Component)this).transform.up;
				}
				else
				{
					val = oben - unten;
					val2 = ((Vector3)(ref val)).normalized;
				}
				t.rotation = Quaternion.FromToRotation(up, val2);
				float num2 = 1f + Mathf.Sin(Time.time * 5f) * 0.08f;
				Vector3 lossyScale = ((Component)this).transform.lossyScale;
				t.localScale = new Vector3(dicke * num2 * Mathf.Lerp(0.6f, 1f, v) / lossyScale.x, (num * 0.5f + 0.06f) / lossyScale.y, dicke * num2 * Mathf.Lerp(0.6f, 1f, v) / lossyScale.z);
			}
		}

		internal void Stich()
		{
			stichZeit = Time.time;
		}

		private static void TempoMessen()
		{
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			if (Time.time - tempoGemessen < 0.1f)
			{
				return;
			}
			tempoGemessen = Time.time;
			try
			{
				foreach (PlayerAvatar item in SemiFunc.PlayerGetList())
				{
					if ((Object)(object)item == (Object)null || item.isDisabled || !item.isMoving || !item.isGrounded || item.isCrouching || item.isTumbling || item.isSliding)
					{
						continue;
					}
					Vector3 rbVelocityRaw = item.rbVelocityRaw;
					rbVelocityRaw.y = 0f;
					float magnitude = ((Vector3)(ref rbVelocityRaw)).magnitude;
					if (!(magnitude < 0.8f) && !(magnitude > 12f))
					{
						if (item.isSprinting)
						{
							RennTempo = Mathf.Lerp(RennTempo, magnitude, 0.05f);
						}
						else
						{
							GehTempo = Mathf.Lerp(GehTempo, magnitude, 0.05f);
						}
					}
				}
			}
			catch
			{
			}
			if (Plugin.DebugLog.Value && Time.time - tempoLog > 30f)
			{
				tempoLog = Time.time;
				Plugin.Log.LogInfo((object)$"[Mimic] Gemessenes Spielertempo: gehen {GehTempo:0.00} m/s, rennen {RennTempo:0.00} m/s");
			}
		}

		internal static string FremdName(int seed)
		{
			return FremdNamen[new Random(seed).Next(FremdNamen.Length)];
		}

		private static bool IstHalloween(Cosmetic c)
		{
			string n = (((Object)((Component)c).gameObject).name + " " + (((Object)(object)c.cosmeticAsset != (Object)null) ? (c.cosmeticAsset.assetName + " " + ((Object)c.cosmeticAsset).name) : "")).ToLowerInvariant();
			return HalloweenWorte.Any((string w) => n.Contains(w));
		}

		private static void KosmetikWeg(Transform kopie, PlayerAvatarVisuals quelle, Cosmetic c)
		{
			if ((Object)(object)c == (Object)null)
			{
				return;
			}
			if (c.meshParents != null)
			{
				foreach (Transform meshParent in c.meshParents)
				{
					if ((Object)(object)meshParent != (Object)null)
					{
						Object.DestroyImmediate((Object)(object)((Component)meshParent).gameObject);
					}
				}
			}
			PlayerCosmetics playerCosmetics = quelle.playerCosmetics;
			if ((Object)(object)playerCosmetics != (Object)null && playerCosmetics.cosmeticParents != null)
			{
				CosmeticParent val = playerCosmetics.cosmeticParents.Find((CosmeticParent x) => x.cosmeticType == c.type);
				if (val != null && val.baseMeshes != null)
				{
					foreach (Transform baseMesh in val.baseMeshes)
					{
						string text = Pfad(((Component)quelle).transform, baseMesh);
						Transform val2 = ((text != null) ? kopie.Find(text) : null);
						if (Object.op_Implicit((Object)(object)val2))
						{
							((Component)val2).gameObject.SetActive(true);
						}
					}
				}
			}
			Object.DestroyImmediate((Object)(object)((Component)c).gameObject);
		}

		private static bool AktivBis(Transform t, Transform wurzel)
		{
			while ((Object)(object)t != (Object)null && (Object)(object)t != (Object)(object)wurzel)
			{
				if (!((Component)t).gameObject.activeSelf)
				{
					return false;
				}
				t = t.parent;
			}
			return true;
		}

		private static void HalloweenWeg(Transform kopie, PlayerAvatarVisuals quelle)
		{
			List<string> list = new List<string>();
			GameEventObjectSwap[] componentsInChildren = ((Component)kopie).GetComponentsInChildren<GameEventObjectSwap>(true);
			foreach (GameEventObjectSwap val in componentsInChildren)
			{
				if ((Object)(object)val == (Object)null || val.eventSwaps == null)
				{
					continue;
				}
				EventSwapConfig[] eventSwaps = val.eventSwaps;
				foreach (EventSwapConfig val2 in eventSwaps)
				{
					if (val2 == null)
					{
						continue;
					}
					GameObject[] objectsToActivate;
					if (val2.objectsToActivate != null)
					{
						objectsToActivate = val2.objectsToActiva