Decompiled source of CeifadoraObsidiana v3.7.0

plugins/CeifadoraObsidiana.dll

Decompiled 17 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using Jotunn;
using Jotunn.Configs;
using Jotunn.Entities;
using Jotunn.Managers;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.Rendering;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: AssemblyVersion("0.0.0.0")]
[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 CeifadoraObsidiana
{
	internal static class AjusteFoice
	{
		public static ConfigEntry<bool> CfgCapa;

		public static ConfigEntry<bool> CfgSuavizar;

		public static ConfigEntry<bool> CfgDuasMaos;

		public static ConfigEntry<bool> CfgLaminaSegue;

		public static ConfigEntry<bool> CfgPuxarMao;

		public static ConfigEntry<bool> CfgMaosNaHaste;

		public static ConfigEntry<bool> CfgLaminaMixamo;

		public static ConfigEntry<bool> CfgEsqParado;

		public static ConfigEntry<float> CfgComprimento;

		public static ConfigEntry<float> CfgPegadaBaixo;

		public static ConfigEntry<float> CfgPegadaCima;

		public static ConfigEntry<float> CfgGiro;

		public static ConfigEntry<float> CfgPalma;

		public static ConfigEntry<float> CfgGiroEspecial;

		public static ConfigEntry<float> CfgAfastarGiro;

		public static ConfigEntry<float> CfgAlturaGiro;

		public static ConfigEntry<float> CfgVaoMaosGiro;

		public static ConfigEntry<float> CfgCaboGiro;

		public static ConfigEntry<float> CfgPegadaParado;

		public static ConfigEntry<float> CfgAmplitudeCeifada;

		public static ConfigEntry<float> CfgGiroCeifada;

		public static ConfigEntry<float> CfgTorcaoCeifada;

		public static ConfigEntry<float> CfgCurvarCeifada;

		public static ConfigEntry<float> CfgGiroLaminaMixamo;

		public static ConfigEntry<float> CfgGiroCostas;

		public static ConfigEntry<float> CfgInclinacaoCostas;

		public static ConfigEntry<float> CfgAfastarCostas;

		public static ConfigEntry<float> CfgAlturaCostas;

		public static ConfigEntry<float> CfgParaForaCostas;

		public static ConfigEntry<float> CfgAfastarParado;

		public static ConfigEntry<float> CfgTamanhoSuporte;

		public static ConfigEntry<float> CfgGiroSuporte;

		public static ConfigEntry<float> CfgPegadaSuporte;

		public static ConfigEntry<float> CfgSuavizarMin;

		public static ConfigEntry<float> CfgSuavizarVel;

		public static ConfigEntry<string> CfgAjusteEsq;

		public static ConfigEntry<string> CfgAjusteDir;

		public static ConfigEntry<string> CfgGiroMaoEsq;

		public static ConfigEntry<string> CfgGiroMaoDir;

		public static void Init(ConfigFile c)
		{
			CfgComprimento = c.Bind<float>("Encaixe", "Comprimento", 2f, "Tamanho da foice em metros (do cabo ate o alto da lamina).");
			CfgPegadaBaixo = c.Bind<float>("Encaixe", "PegadaMaoDeBaixo", 0.45f, "Distancia (m) do fim do cabo ate a mao de baixo. Maior = segura mais perto da lamina.");
			CfgPegadaCima = c.Bind<float>("Encaixe", "PegadaMaoDeCima", 0.95f, "Distancia (m) do fim do cabo ate a mao de cima, quando a mao esquerda solta durante o golpe.");
			CfgPegadaParado = c.Bind<float>("Encaixe", "PegadaParado", 0.35f, "Parado ou andando (uma mao, como a atgeir): distancia (m) do fim do cabo ate a mao.");
			CfgAmplitudeCeifada = c.Bind<float>("Encaixe", "AmplitudeCeifada", 1f, "Ultimo golpe (ceifada): quanto as maos se afastam do corpo nos arcos. 1 = normal.");
			CfgTorcaoCeifada = c.Bind<float>("Encaixe", "TorcaoDoTroncoNaCeifada", 70f, "Ultimo golpe (ceifada): quanto (graus) o tronco pode virar para acompanhar a foice. 0 = nao vira.");
			CfgCurvarCeifada = c.Bind<float>("Encaixe", "CurvarCorpoNaCeifada", 1f, "Ultimo golpe (ceifada): quanto o corpo se curva quando a foice desce (0 = nada, 1 = normal).");
			CfgGiroCeifada = c.Bind<float>("Encaixe", "GiroDaLaminaNaCeifada", 0f, "Ultimo golpe (ceifada): ajuste extra (graus) da lamina, se ficar virada errado. Ex.: 180.");
			CfgGiro = c.Bind<float>("Encaixe", "GiroNaHaste", 0f, "Gira a foice em volta da haste (graus) nos golpes normais. Ex.: 90, 180, -90.");
			CfgDuasMaos = c.Bind<bool>("Encaixe", "EncaixarNasDuasMaos", true, "A cada quadro a haste passa pelas duas maos.");
			CfgPuxarMao = c.Bind<bool>("Encaixe", "PuxarMaoParaHaste", true, "Durante os golpes, se a animacao soltar uma mao, ela e puxada de volta para a haste.");
			CfgMaosNaHaste = c.Bind<bool>("Encaixe", "MaosVaoAteAHaste", true, "No fim de cada quadro as maos vao ate a haste (a foice fica onde esta).");
			CfgLaminaMixamo = c.Bind<bool>("Encaixe", "LaminaAcompanhaOCorte", true, "Em todos os golpes: a lamina gira em volta da haste para ficar no plano do corte, apontando para onde ele vai.");
			CfgGiroLaminaMixamo = c.Bind<float>("Encaixe", "GiroDaLaminaNoCorte", 0f, "Ajuste extra (graus) da lamina nesses golpes, se ficar virada errado. Ex.: 180.");
			CfgCapa = c.Bind<bool>("Encaixe", "CapaSemTremer", true, "Depois de desenhar cada quadro, devolve os ossos do braco e do tronco a pose da animacao. Assim a capa (que tem fisica de pano) sempre ve a mesma pose e nao treme.");
			CfgEsqParado = c.Bind<bool>("Encaixe", "MaoEsquerdaNaHasteParado", true, "Parado ou andando: a mao esquerda tambem segura a haste (false = como a atgeir, so a direita).");
			CfgPalma = c.Bind<float>("Encaixe", "PontoDaPalma", 0.6f, "Onde a haste passa na mao direita: 0 = pulso, 1 = nos dos dedos.");
			CfgAjusteDir = c.Bind<string>("Encaixe", "AjusteMaoDireita", "-3,0,-3", "Ajuste fino do ponto da mao direita, em centimetros: para os dedos, para o polegar, para a palma. Valor positivo leva o ponto para la, e a mao vai para o lado contrario. Muda com o jogo aberto.");
			CfgAjusteEsq = c.Bind<string>("Encaixe", "AjusteMaoEsquerda", "-5,0,-3", "Ajuste fino do ponto da mao esquerda, em centimetros: para os dedos, para o polegar, para a palma. Ex.: 2,0,1");
			CfgGiroMaoDir = c.Bind<string>("Encaixe", "RotacaoMaoDireita", "0,-10,0", "Gira a mao direita para encaixar a pegada, em graus: em volta da linha dos dedos, em volta da linha do polegar, em volta da palma (torce o pulso). Ex.: 0,15,-10. A mao continua no cabo. Muda com o jogo aberto.");
			CfgGiroMaoEsq = c.Bind<string>("Encaixe", "RotacaoMaoEsquerda", "10,0,25", "Gira a mao esquerda para encaixar a pegada, em graus: em volta da linha dos dedos, em volta da linha do polegar, em volta da palma (torce o pulso). Ex.: 0,15,-10. A mao continua no cabo. Muda com o jogo aberto.");
			CfgLaminaSegue = c.Bind<bool>("Encaixe", "LaminaNaFrenteNosGiros", true, "Nos giros a foice fica para fora do corpo, nas duas maos, com a ponta da lamina indo na frente.");
			CfgGiroEspecial = c.Bind<float>("Encaixe", "GiroDaLaminaNosGiros", 0f, "Ajuste extra (graus) da lamina nos giros, se ainda ficar virada errado. Ex.: 180.");
			CfgAfastarGiro = c.Bind<float>("Encaixe", "AfastarMaosDoPeitoNosGiros", 0.52f, "Nos giros, quanto as maos ficam a frente do peito (m).");
			CfgVaoMaosGiro = c.Bind<float>("Encaixe", "DistanciaEntreMaosNosGiros", 0.32f, "Nos giros, distancia entre as duas maos na haste (m).");
			CfgCaboGiro = c.Bind<float>("Encaixe", "CaboAtrasDaMaoNosGiros", 0.1f, "Nos giros, quanto do cabo sobra atras da mao de baixo (m).");
			CfgAlturaGiro = c.Bind<float>("Encaixe", "AlturaDasMaosNosGiros", -0.1f, "Nos giros, altura das maos em relacao ao peito (m). Negativo = mais baixo.");
			CfgGiroCostas = c.Bind<float>("Encaixe", "GiroNasCostas", 0f, "Gira a foice nas costas em volta da haste (graus). 180 = lamina para o outro lado.");
			CfgSuavizar = c.Bind<bool>("Encaixe", "SuavizarGolpes", true, "Golpes normais (os 4 do combo): tira a tremida da foice com um filtro que suaviza o que e lento e segue o que e rapido.");
			CfgSuavizarMin = c.Bind<float>("Encaixe", "SuavizacaoForca", 4f, "Quanto menor, mais suave (e mais atrasada) a foice fica nas partes lentas do golpe. 2 = bem suave, 8 = quase nada. Muda com o jogo aberto.");
			CfgSuavizarVel = c.Bind<float>("Encaixe", "SuavizacaoSegueOGolpe", 3f, "Quanto o filtro se abre quando o golpe acelera. Maior = segue o golpe rapido mais de perto (menos atraso), menor = mais suave. Muda com o jogo aberto.");
			CfgTamanhoSuporte = c.Bind<float>("Encaixe", "TamanhoNoSuporte", 1f, "Suportes de parede/chao: tamanho da foice (1 = normal).");
			CfgGiroSuporte = c.Bind<float>("Encaixe", "GiroNoSuporte", 180f, "Suportes de parede/chao: gira a foice em volta da haste (graus). 180 = lamina para o outro lado.");
			CfgPegadaSuporte = c.Bind<float>("Encaixe", "PontoPresoNoSuporte", 0.9f, "Suportes de parede/chao: distancia (m) do fim do cabo ate o ponto preso no suporte. Maior = a foice anda para o lado do cabo.");
			CfgParaForaCostas = c.Bind<float>("Encaixe", "InclinarParaForaParado", 6f, "Parado: inclina a foice nas costas para fora (a parte de baixo se afasta da capa), em graus. 0 = nao inclina.");
			CfgAfastarParado = c.Bind<float>("Encaixe", "AfastarMaisParado", 0.01f, "Parado: afasta a foice mais esse tanto (m) das costas, para nao entrar na capa.");
			CfgInclinacaoCostas = c.Bind<float>("Encaixe", "InclinacaoNasCostas", 30f, "Inclinacao da foice nas costas (graus). Negativo = para o outro lado.");
			CfgAfastarCostas = c.Bind<float>("Encaixe", "AfastarDasCostas", 0.2f, "Distancia da foice ate as costas (m).");
			CfgAlturaCostas = c.Bind<float>("Encaixe", "AlturaNasCostas", -0.1f, "Sobe (+) ou desce (-) a foice nas costas (m).");
		}

		private static bool Caixa(Transform attach, out Bounds caixa)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: 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_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			caixa = default(Bounds);
			MeshFilter[] componentsInChildren = ((Component)attach).GetComponentsInChildren<MeshFilter>(true);
			foreach (MeshFilter val in componentsInChildren)
			{
				if ((Object)(object)val.sharedMesh == (Object)null || ((Object)val).name == "foice_modelo")
				{
					continue;
				}
				Bounds bounds = val.sharedMesh.bounds;
				Matrix4x4 val2 = attach.worldToLocalMatrix * ((Component)val).transform.localToWorldMatrix;
				for (int j = 0; j < 8; j++)
				{
					Vector3 val3 = ((Bounds)(ref bounds)).center + Vector3.Scale(((Bounds)(ref bounds)).extents, new Vector3((float)(((j & 1) != 0) ? 1 : (-1)), (float)(((j & 2) != 0) ? 1 : (-1)), (float)(((j & 4) != 0) ? 1 : (-1))));
					Vector3 val4 = ((Matrix4x4)(ref val2)).MultiplyPoint3x4(val3);
					if (!flag)
					{
						caixa = new Bounds(val4, Vector3.zero);
						flag = true;
					}
					else
					{
						((Bounds)(ref caixa)).Encapsulate(val4);
					}
				}
			}
			return flag;
		}

		private static bool BaseDe(GameObject arma, out Quaternion q)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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_008c: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: 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_00fc: 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_0102: 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)
			q = Quaternion.identity;
			if ((Object)(object)arma == (Object)null)
			{
				return false;
			}
			Transform val = arma.transform.Find("attach");
			Vector3 val2 = Vector3.up;
			Vector3 val3 = Vector3.forward;
			if ((Object)(object)val != (Object)null && Caixa(val, out var caixa))
			{
				Vector3 size = ((Bounds)(ref caixa)).size;
				val2 = ((size.x >= size.y && size.x >= size.z) ? Vector3.right : ((size.y >= size.z) ? Vector3.up : Vector3.forward));
				if (Mathf.Abs(Vector3.Dot(((Bounds)(ref caixa)).max, val2)) < Mathf.Abs(Vector3.Dot(((Bounds)(ref caixa)).min, val2)))
				{
					val2 = -val2;
				}
				val3 = Vector3.ProjectOnPlane(((Bounds)(ref caixa)).center, val2);
				if (((Vector3)(ref val3)).sqrMagnitude < 1E-06f)
				{
					val3 = Vector3.ProjectOnPlane(Vector3.forward, val2);
				}
				if (((Vector3)(ref val3)).sqrMagnitude < 1E-06f)
				{
					val3 = Vector3.ProjectOnPlane(Vector3.right, val2);
				}
				((Vector3)(ref val3)).Normalize();
			}
			q = Quaternion.LookRotation(val3, val2);
			return (Object)(object)val != (Object)null;
		}

		public static void Alinhar(Transform modelo, GameObject arma, bool costas)
		{
			EncaixeFoice encaixeFoice = ((Component)modelo).gameObject.AddComponent<EncaixeFoice>();
			encaixeFoice.NasCostas = costas;
			encaixeFoice.Comprimento0 = ModeloFoice.ComprimentoOriginal;
			if (costas)
			{
				encaixeFoice.Aplicar();
				CeifadoraPlugin.Detalhe("[CeifadoraObsidiana] Encaixe nas costas: preso ao peito.");
				return;
			}
			BaseDe(arma, out encaixeFoice.Base);
			GameObject prefab = PrefabManager.Instance.GetPrefab("Scythe");
			encaixeFoice.TemSuporte = BaseDe(prefab, out encaixeFoice.BaseSuporte);
			encaixeFoice.Aplicar();
			CeifadoraPlugin.Detalhe("[CeifadoraObsidiana] Encaixe na mao: base " + ((Object)arma).name + "; nos suportes: " + (encaixeFoice.TemSuporte ? "como a foice do jogo" : "foice do jogo nao achada") + ".");
		}

		public static Vector3 AjusteEsq()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return Ajuste(CfgAjusteEsq);
		}

		public static Vector3 Graus(ConfigEntry<string> cfg)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			return Ajuste(cfg) * 100f;
		}

		public static Vector3 Ajuste(ConfigEntry<string> cfg)
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			string[] p = (cfg?.Value ?? "").Split(new char[1] { ',' });
			return new Vector3(f(0), f(1), f(2));
			float f(int i)
			{
				if (i >= p.Length || !float.TryParse(p[i].Trim(), NumberStyles.Float, CultureInfo.InvariantCulture, out var result))
				{
					return 0f;
				}
				return result / 100f;
			}
		}

		public static void IKBraco(Transform a, Transform b, Transform c, Vector3 alvo, Vector3 palma, float peso)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: 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_0068: 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_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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00c7: 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_00c9: 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_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_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: 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_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: 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_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: 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_0118: 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_011c: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: 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_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0291: Unknown result type (might be due to invalid IL or missing references)
			//IL_0276: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)a == (Object)null || (Object)(object)b == (Object)null || (Object)(object)c == (Object)null || peso <= 0f)
			{
				return;
			}
			Quaternion rotation = c.rotation;
			Vector3 val = Vector3.Lerp(c.position, alvo - (palma - c.position), Mathf.Clamp01(peso));
			Vector3 position = a.position;
			Vector3 position2 = b.position;
			Vector3 position3 = c.position;
			Vector3 val2 = position2 - position;
			float magnitude = ((Vector3)(ref val2)).magnitude;
			val2 = position3 - position2;
			float magnitude2 = ((Vector3)(ref val2)).magnitude;
			if (!(magnitude < 0.0001f) && !(magnitude2 < 0.0001f))
			{
				val2 = val - position;
				float num = Mathf.Clamp(((Vector3)(ref val2)).magnitude, 0.01f, magnitude + magnitude2 - 0.002f);
				val2 = position2 - position;
				Vector3 normalized = ((Vector3)(ref val2)).normalized;
				val2 = position3 - position;
				Vector3 normalized2 = ((Vector3)(ref val2)).normalized;
				val2 = val - position;
				Vector3 normalized3 = ((Vector3)(ref val2)).normalized;
				Vector3 val3 = -normalized;
				val2 = position3 - position2;
				Vector3 normalized4 = ((Vector3)(ref val2)).normalized;
				float num2 = Mathf.Acos(Mathf.Clamp(Vector3.Dot(normalized2, normalized), -1f, 1f));
				float num3 = Mathf.Acos(Mathf.Clamp(Vector3.Dot(val3, normalized4), -1f, 1f));
				float num4 = Mathf.Acos(Mathf.Clamp(Vector3.Dot(normalized2, normalized3), -1f, 1f));
				float num5 = Mathf.Acos(Mathf.Clamp((magnitude2 * magnitude2 - magnitude * magnitude - num * num) / (-2f * magnitude * num), -1f, 1f));
				float num6 = Mathf.Acos(Mathf.Clamp((num * num - magnitude * magnitude - magnitude2 * magnitude2) / (-2f * magnitude * magnitude2), -1f, 1f));
				Vector3 val4 = Vector3.Cross(normalized2, normalized);
				if (((Vector3)(ref val4)).sqrMagnitude < 1E-08f)
				{
					val4 = Vector3.Cross(normalized2, a.forward);
				}
				((Vector3)(ref val4)).Normalize();
				b.rotation = Quaternion.AngleAxis((num6 - num3) * 57.29578f, val4) * b.rotation;
				a.rotation = Quaternion.AngleAxis((num5 - num2) * 57.29578f, val4) * a.rotation;
				Vector3 val5 = Vector3.Cross(normalized2, normalized3);
				if (((Vector3)(ref val5)).sqrMagnitude > 1E-08f)
				{
					a.rotation = Quaternion.AngleAxis(num4 * 57.29578f, ((Vector3)(ref val5)).normalized) * a.rotation;
				}
				c.rotation = rotation;
			}
		}
	}
	[DefaultExecutionOrder(500)]
	public class EncaixeFoice : MonoBehaviour
	{
		public Quaternion Base = Quaternion.identity;

		public bool NasCostas;

		public Quaternion BaseSuporte = Quaternion.identity;

		public bool TemSuporte;

		private bool _noSuporte;

		private Animator _anim;

		private Transform _r;

		private Transform _l;

		private Transform _rd;

		private Transform _r2;

		private Transform _r3;

		private Transform _ri;

		private Transform _rt;

		private Transform _l1;

		private Transform _l2;

		private Transform _l3;

		private Transform _li;

		private Transform _lt;

		private Transform _ro;

		private Transform _rc;

		private Transform _lo;

		private Transform _lc;

		private Transform _peito;

		private bool _procurou;

		private Character _dono;

		private Vector3 _radial;

		private Vector3 _radialAnt;

		private float _sinal;

		private float _pesoGiro;

		private float _lado = 1f;

		private float _pesoAtq;

		private float _pesoCeifa;

		private float _u;

		private bool _ceifando;

		private bool _temFrente;

		private bool _avancando;

		private float _pesoProp;

		private Transform _hips;

		private Transform _ul;

		private Transform _ll;

		private Transform _ft;

		private Vector3 _frenteMed;

		private Vector3 _frenteAvanco;

		private float _uAnt;

		private float _yawSuave;

		private float _leanSuave;

		private Transform _spine;

		private Transform _chest;

		private Transform _pescoco;

		private Transform _cabeca;

		private Vector3 _ladoCeifa;

		public float Comprimento0 = 1f;

		private Transform[] _mex;

		private Quaternion[] _bruto;

		private Quaternion[] _escrito;

		private static readonly WaitForEndOfFrame _fim = new WaitForEndOfFrame();

		private Quaternion _fRot;

		private Vector3 _fPos;

		private float _fW;

		private float _fV;

		private float _pesoFiltro;

		private bool _fTem;

		private Vector3 _hAnt;

		private Vector3 _eixoCorte;

		private float _pesoCorte;

		private bool _temPonta;

		private bool _logou;

		private float _pesoParado;

		private float Escala => AjusteFoice.CfgComprimento.Value / Mathf.Max(0.1f, Comprimento0);

		public void Aplicar()
		{
			//IL_0121: 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_0137: 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_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_015c: 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_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			if (AjusteFoice.CfgComprimento == null)
			{
				return;
			}
			if (NasCostas)
			{
				float num = (((Object)(object)((Component)this).transform.parent != (Object)null) ? Mathf.Abs(((Component)this).transform.parent.lossyScale.y) : 1f);
				if (num < 0.05f || num > 20f)
				{
					num = 1f;
				}
				((Component)this).transform.localScale = Vector3.one * (Escala / num);
			}
			else if (_noSuporte && TemSuporte)
			{
				((Component)this).transform.localScale = Vector3.one * Escala * AjusteFoice.CfgTamanhoSuporte.Value;
				Quaternion val = BaseSuporte * Quaternion.AngleAxis(AjusteFoice.CfgGiroSuporte.Value, Vector3.up);
				((Component)this).transform.localRotation = val;
				((Component)this).transform.localPosition = -(val * Vector3.up) * (AjusteFoice.CfgPegadaSuporte.Value * AjusteFoice.CfgTamanhoSuporte.Value);
			}
			else
			{
				((Component)this).transform.localScale = Vector3.one * Escala;
				Quaternion val2 = Base * Quaternion.AngleAxis(AjusteFoice.CfgGiro.Value, Vector3.up);
				((Component)this).transform.localRotation = val2;
				((Component)this).transform.localPosition = -(val2 * Vector3.up) * AjusteFoice.CfgPegadaParado.Value;
			}
		}

		private void Procurar()
		{
			_procurou = true;
			_noSuporte = (Object)(object)((Component)this).GetComponentInParent<ItemStand>() != (Object)null;
			_dono = ((Component)this).GetComponentInParent<Character>();
			_anim = ((Component)this).GetComponentInParent<Animator>();
			if (!((Object)(object)_anim == (Object)null) && _anim.isHuman)
			{
				_r = B((HumanBodyBones)18);
				_l = B((HumanBodyBones)17);
				_rd = B((HumanBodyBones)45);
				_r2 = B((HumanBodyBones)46);
				_r3 = B((HumanBodyBones)47);
				_ri = B((HumanBodyBones)42);
				_rt = B((HumanBodyBones)39);
				_l1 = B((HumanBodyBones)30);
				_l2 = B((HumanBodyBones)31);
				_l3 = B((HumanBodyBones)32);
				_li = B((HumanBodyBones)27);
				_lt = B((HumanBodyBones)24);
				_ro = B((HumanBodyBones)14);
				_rc = B((HumanBodyBones)16);
				_lo = B((HumanBodyBones)13);
				_lc = B((HumanBodyBones)15);
				_peito = B((HumanBodyBones)54) ?? B((HumanBodyBones)8) ?? B((HumanBodyBones)7);
				_spine = B((HumanBodyBones)7);
				_chest = B((HumanBodyBones)8);
				_pescoco = B((HumanBodyBones)9);
				_cabeca = B((HumanBodyBones)10);
				_hips = B((HumanBodyBones)0);
				_ul = B((HumanBodyBones)1);
				_ll = B((HumanBodyBones)3);
				_ft = B((HumanBodyBones)5);
			}
			Transform B(HumanBodyBones o)
			{
				//IL_0006: Unknown result type (might be due to invalid IL or missing references)
				return _anim.GetBoneTransform(o);
			}
		}

		private Vector3 PalmaDireita()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: 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_00bd: 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_00c9: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: 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_00f8: 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_00a9: 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_0124: 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_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: 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_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: 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_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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_0169: 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_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_rd == (Object)null)
			{
				return _r.position;
			}
			Vector3 val = (((Object)(object)_r2 != (Object)null && (Object)(object)_r3 != (Object)null) ? ((_rd.position + _r2.position + _r3.position + (((Object)(object)_ri != (Object)null) ? _ri.position : _rd.position)) * 0.25f) : Vector3.Lerp(_r.position, _rd.position, AjusteFoice.CfgPalma.Value));
			Vector3 val2 = AjusteFoice.Ajuste(AjusteFoice.CfgAjusteDir);
			if (val2 != Vector3.zero)
			{
				Vector3 val3 = _rd.position - _r.position;
				Vector3 normalized = ((Vector3)(ref val3)).normalized;
				Vector3 val4;
				if (!((Object)(object)_rt != (Object)null))
				{
					val4 = -_r.right;
				}
				else
				{
					val3 = Vector3.ProjectOnPlane(_rt.position - _r.position, normalized);
					val4 = ((Vector3)(ref val3)).normalized;
				}
				Vector3 val5 = val4;
				val3 = Vector3.Cross(val5, normalized);
				Vector3 normalized2 = ((Vector3)(ref val3)).normalized;
				val += normalized * val2.x + val5 * val2.y + normalized2 * val2.z;
			}
			return val;
		}

		private Vector3 PalmaEsquerda()
		{
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: 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_00d0: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: 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_0069: 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_0102: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: 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_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: 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_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: 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_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: 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_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0194: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = (((Object)(object)_l1 != (Object)null && (Object)(object)_l2 != (Object)null && (Object)(object)_l3 != (Object)null) ? ((_l1.position + _l2.position + _l3.position + (((Object)(object)_li != (Object)null) ? _li.position : _l1.position)) * 0.25f) : ((!((Object)(object)_l1 != (Object)null)) ? _l.position : Vector3.Lerp(_l.position, _l1.position, 0.85f)));
			Vector3 val2 = AjusteFoice.AjusteEsq();
			if (val2 != Vector3.zero && (Object)(object)_l1 != (Object)null)
			{
				Vector3 val3 = _l1.position - _l.position;
				Vector3 normalized = ((Vector3)(ref val3)).normalized;
				Vector3 val4;
				if (!((Object)(object)_lt != (Object)null))
				{
					val4 = _l.right;
				}
				else
				{
					val3 = Vector3.ProjectOnPlane(_lt.position - _l.position, normalized);
					val4 = ((Vector3)(ref val3)).normalized;
				}
				Vector3 val5 = val4;
				val3 = Vector3.Cross(normalized, val5);
				Vector3 normalized2 = ((Vector3)(ref val3)).normalized;
				val += normalized * val2.x + val5 * val2.y + normalized2 * val2.z;
			}
			return val;
		}

		private void LateUpdate()
		{
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_074b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0750: Unknown result type (might be due to invalid IL or missing references)
			//IL_0953: Unknown result type (might be due to invalid IL or missing references)
			//IL_0958: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0482: Unknown result type (might be due to invalid IL or missing references)
			//IL_0487: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_050c: 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_0514: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0301: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a52: 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_0a59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a61: 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_0a6d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a76: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a83: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a8e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a93: Unknown result type (might be due to invalid IL or missing references)
			//IL_0318: Unknown result type (might be due to invalid IL or missing references)
			//IL_031a: 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_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: 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_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0862: Unknown result type (might be due to invalid IL or missing references)
			//IL_0864: Unknown result type (might be due to invalid IL or missing references)
			//IL_0869: Unknown result type (might be due to invalid IL or missing references)
			//IL_086d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0872: Unknown result type (might be due to invalid IL or missing references)
			//IL_0876: Unknown result type (might be due to invalid IL or missing references)
			//IL_0878: Unknown result type (might be due to invalid IL or missing references)
			//IL_087a: Unknown result type (might be due to invalid IL or missing references)
			//IL_087f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0884: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Unknown result type (might be due to invalid IL or missing references)
			//IL_088b: Unknown result type (might be due to invalid IL or missing references)
			//IL_057a: Unknown result type (might be due to invalid IL or missing references)
			//IL_057c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0583: Unknown result type (might be due to invalid IL or missing references)
			//IL_0588: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05aa: 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)
			//IL_05b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ca: 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_05d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: 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_05f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_060e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0613: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Unknown result type (might be due to invalid IL or missing references)
			//IL_0624: Unknown result type (might be due to invalid IL or missing references)
			//IL_0629: Unknown result type (might be due to invalid IL or missing references)
			//IL_062e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0330: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a0d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a18: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a22: Unknown result type (might be due to invalid IL or missing references)
			//IL_089e: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0332: Unknown result type (might be due to invalid IL or missing references)
			//IL_0340: Unknown result type (might be due to invalid IL or missing references)
			//IL_0345: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_0349: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0381: Unknown result type (might be due to invalid IL or missing references)
			//IL_038d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0392: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Unknown result type (might be due to invalid IL or missing references)
			//IL_090e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0913: Unknown result type (might be due to invalid IL or missing references)
			//IL_0918: Unknown result type (might be due to invalid IL or missing references)
			//IL_091d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0922: Unknown result type (might be due to invalid IL or missing references)
			//IL_0925: Unknown result type (might be due to invalid IL or missing references)
			//IL_0928: Unknown result type (might be due to invalid IL or missing references)
			//IL_092d: Unknown result type (might be due to invalid IL or missing references)
			//IL_08bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_072b: Unknown result type (might be due to invalid IL or missing references)
			//IL_072d: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_068a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0682: Unknown result type (might be due to invalid IL or missing references)
			//IL_068f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_0698: Unknown result type (might be due to invalid IL or missing references)
			//IL_069d: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06da: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0702: Unknown result type (might be due to invalid IL or missing references)
			//IL_0709: Unknown result type (might be due to invalid IL or missing references)
			//IL_070e: Unknown result type (might be due to invalid IL or missing references)
			if (AjusteFoice.CfgComprimento == null)
			{
				return;
			}
			if (!_procurou)
			{
				Procurar();
			}
			Aplicar();
			if (NasCostas)
			{
				Costas();
			}
			else
			{
				if ((Object)(object)_r == (Object)null || (Object)(object)_l == (Object)null)
				{
					return;
				}
				Restaurar();
				float num = Mathf.Max(Time.deltaTime, 0.0001f);
				Character dono = _dono;
				Player val = (Player)(object)((dono is Player) ? dono : null);
				bool flag = (Object)(object)val != (Object)null && ((Character)val).InAttack() && Golpes.AtaqueAtual((Humanoid)(object)val) != null;
				bool flag2 = flag && Golpes.Secundario((Humanoid)(object)val) && !Golpes.Especial3;
				bool flag3 = flag && !flag2 && (Object)(object)val == (Object)(object)Player.m_localPlayer && Golpes.GiroAtivo;
				bool flag4 = flag3 && Golpes.Ceifada;
				bool flag5 = flag3 && Golpes.Proprio && Golpe3.TemTrilha;
				bool flag6 = ((flag3 && Golpes.Proprio && !Golpe3.Nossa) || (flag && Golpes.UmaMao)) && !(Golpe3.CfgDuasMaos?.Value ?? false);
				bool flag7 = flag2 || (flag3 && !Golpes.Ceifada && !Golpes.Proprio);
				_pesoProp = Mathf.MoveTowards(_pesoProp, flag5 ? 1f : 0f, 12f * num);
				_pesoAtq = Mathf.MoveTowards(_pesoAtq, flag ? 1f : 0f, 8f * num);
				_pesoGiro = Mathf.MoveTowards(_pesoGiro, (flag7 && AjusteFoice.CfgLaminaSegue.Value) ? 1f : 0f, 8f * num);
				_pesoCeifa = Mathf.MoveTowards(_pesoCeifa, flag4 ? 1f : 0f, 10f * num);
				bool flag8 = flag3 && Golpes.Avanco;
				float num2 = 0f;
				if ((Object)(object)_anim != (Object)null && flag)
				{
					AnimatorStateInfo val2 = (_anim.IsInTransition(0) ? _anim.GetNextAnimatorStateInfo(0) : _anim.GetCurrentAnimatorStateInfo(0));
					num2 = Mathf.Clamp01(((AnimatorStateInfo)(ref val2)).normalizedTime);
				}
				if ((Object)(object)val == (Object)(object)Player.m_localPlayer)
				{
					Medir(val, flag, flag2, flag8, num2, num);
				}
				if (!flag6 && AjusteFoice.CfgDuasMaos.Value && _pesoAtq > 0f && _pesoGiro < 1f && _pesoCeifa < 1f && _pesoProp < 1f)
				{
					Vector3 val3 = PalmaDireita();
					Vector3 val4 = PalmaEsquerda();
					Vector3 val5 = val4 - val3;
					float magnitude = ((Vector3)(ref val5)).magnitude;
					if (magnitude > 0.05f && magnitude < 0.9f)
					{
						val5 /= magnitude;
						Vector3 up = ((Component)this).transform.up;
						if (Vector3.Dot(val5, up) < 0f)
						{
							val5 = -val5;
						}
						Vector3 val6 = ((Vector3.Dot(val3, val5) <= Vector3.Dot(val4, val5)) ? val3 : val4);
						((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, Quaternion.FromToRotation(up, val5) * ((Component)this).transform.rotation, _pesoAtq);
						((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, val6 - val5 * AjusteFoice.CfgPegadaBaixo.Value, _pesoAtq);
					}
					else if (AjusteFoice.CfgPuxarMao.Value)
					{
						Vector3 alvo = ((Component)this).transform.position + ((Component)this).transform.up * (AjusteFoice.CfgPegadaCima.Value - AjusteFoice.CfgVaoMaosGiro.Value);
						AjusteFoice.IKBraco(_lo, _lc, _l, alvo, val4, _pesoAtq * (1f - _pesoGiro) * (1f - _pesoCeifa));
					}
				}
				Vector3 mao;
				if (_pesoGiro > 0f && (Object)(object)_peito != (Object)null && (Object)(object)_ro != (Object)null && (Object)(object)_lo != (Object)null)
				{
					Vector3 up2 = ((Component)_dono).transform.up;
					Vector3 position = _peito.position;
					Vector3 val7 = Vector3.ProjectOnPlane(Vector3.Cross(_ro.position - _lo.position, up2), up2);
					val7 = ((((Vector3)(ref val7)).sqrMagnitude > 0.0001f) ? ((Vector3)(ref val7)).normalized : ((Component)_dono).transform.forward);
					if (((Vector3)(ref _radial)).sqrMagnitude < 0.5f)
					{
						_radial = val7;
						_radialAnt = val7;
					}
					float num3 = Vector3.Dot(val7 - _radialAnt, Vector3.Cross(up2, _radialAnt)) / num;
					_sinal = Mathf.Lerp(_sinal, num3, 1f - Mathf.Exp(-6f * num));
					if (_sinal > 1f)
					{
						_lado = 1f;
					}
					else if (_sinal < -1f)
					{
						_lado = -1f;
					}
					_radialAnt = val7;
					mao = Vector3.Slerp(_radial, val7, 1f - Mathf.Exp(-20f * num));
					_radial = ((Vector3)(ref mao)).normalized;
					Vector3 val8 = Vector3.Cross(up2, _radial) * _lado;
					mao = _radial - val8 * 0.25f - up2 * 0.1f;
					Vector3 normalized = ((Vector3)(ref mao)).normalized;
					Vector3 val9 = position + _radial * AjusteFoice.CfgAfastarGiro.Value + up2 * AjusteFoice.CfgAlturaGiro.Value;
					if (flag8)
					{
						float num4 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.6f, 0.8f, num2));
						if (num4 > 0f)
						{
							Vector3 val10 = ((((Vector3)(ref _frenteAvanco)).sqrMagnitude > 0.5f) ? _frenteAvanco : ((Component)_dono).transform.forward);
							mao = val10 * 0.85f - up2 * 0.5f;
							Vector3 normalized2 = ((Vector3)(ref mao)).normalized;
							mao = Vector3.Slerp(normalized, normalized2, num4);
							normalized = ((Vector3)(ref mao)).normalized;
							val8 = Vector3.Slerp(val8, -up2, num4);
							val9 = Vector3.Lerp(val9, position + val10 * 0.3f - up2 * 0.2f, num4);
						}
					}
					bool esquerdaLeva = !flag2 && Golpes.PesoGiro(_anim) > 0.5f;
					Segurar(normalized, val8, val9, esquerdaLeva, _pesoGiro, AjusteFoice.CfgGiroEspecial.Value);
				}
				else
				{
					_radial = Vector3.zero;
					_sinal = 0f;
					_lado = 1f;
				}
				if (_pesoCeifa > 0f && (Object)(object)_peito != (Object)null && (Object)(object)_anim != (Object)null)
				{
					AnimatorStateInfo val11 = (_anim.IsInTransition(0) ? _anim.GetNextAnimatorStateInfo(0) : _anim.GetCurrentAnimatorStateInfo(0));
					float num5 = Mathf.Clamp01(((AnimatorStateInfo)(ref val11)).normalizedTime);
					if (!_ceifando)
					{
						_ceifando = true;
						_u = 0f;
					}
					if (flag4)
					{
						_u = Mathf.Max(_u, num5);
					}
					Transform transform = ((Component)_dono).transform;
					Ceifa.Amostra(_u, out var mao2, out var haste);
					Ceifa.Amostra(Mathf.Min(1f, _u + 0.03f), out mao, out var haste2);
					Ceifa.Amostra(Mathf.Max(0f, _u - 0.03f), out mao, out var haste3);
					mao = transform.TransformDirection(haste);
					Vector3 normalized3 = ((Vector3)(ref mao)).normalized;
					Vector3 val12 = Vector3.ProjectOnPlane(transform.TransformDirection(haste2 - haste3), normalized3);
					if (((Vector3)(ref val12)).sqrMagnitude > 1E-05f)
					{
						_ladoCeifa = ((Vector3)(ref val12)).normalized;
					}
					else if (((Vector3)(ref _ladoCeifa)).sqrMagnitude < 0.5f)
					{
						mao = Vector3.ProjectOnPlane(transform.right, normalized3);
						_ladoCeifa = ((Vector3)(ref mao)).normalized;
					}
					float value = AjusteFoice.CfgAmplitudeCeifada.Value;
					Torcer(normalized3, mao2, _pesoCeifa, num);
					Vector3 maoBaixo = _peito.position + transform.TransformDirection(Vector3.Scale(mao2, new Vector3(value, 1f, value)));
					Segurar(normalized3, _ladoCeifa, maoBaixo, esquerdaLeva: false, _pesoCeifa, AjusteFoice.CfgGiroCeifada.Value);
				}
				else if (!flag4)
				{
					_ceifando = false;
					_ladoCeifa = Vector3.zero;
					_yawSuave = 0f;
					_leanSuave = 0f;
				}
				if (_pesoProp > 0f && (Object)(object)_hips != (Object)null && (Object)(object)_anim != (Object)null)
				{
					Transform transform2 = ((Component)_dono).transform;
					float num6 = 1f;
					if ((Object)(object)_ul != (Object)null && (Object)(object)_ll != (Object)null && (Object)(object)_ft != (Object)null)
					{
						mao = _ul.position - _ll.position;
						float magnitude2 = ((Vector3)(ref mao)).magnitude;
						mao = _ll.position - _ft.position;
						num6 = (magnitude2 + ((Vector3)(ref mao)).magnitude) / Mathf.Max(0.1f, Golpe3.Perna);
					}
					Golpe3.Amostra(num2, out var g, out var h, out var l);
					Vector3 haste4 = transform2.rotation * h;
					Vector3 maoBaixo2 = _hips.position + transform2.rotation * (g * num6);
					Segurar(haste4, transform2.rotation * l, maoBaixo2, esquerdaLeva: false, _pesoProp, AjusteFoice.CfgGiroCeifada.Value);
				}
				if (AjusteFoice.CfgLaminaMixamo.Value)
				{
					LaminaNoCorte(num, flag);
				}
				else
				{
					_temPonta = false;
				}
				Filtrar(num, flag && !flag2 && !flag7 && _pesoCeifa <= 0f);
				if (AjusteFoice.CfgMaosNaHaste.Value)
				{
					Agarrar(flag && !flag6, flag6);
				}
				Gravar();
			}
		}

		private void Medir(Player p, bool atacando, bool especial, bool avanco, float u, float dt)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: 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_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: 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)
			if ((Object)(object)_ro == (Object)null || (Object)(object)_lo == (Object)null)
			{
				return;
			}
			Vector3 up = ((Component)_dono).transform.up;
			Vector3 val = Vector3.ProjectOnPlane(Vector3.Cross(_ro.position - _lo.position, up), up);
			if (((Vector3)(ref val)).sqrMagnitude < 0.0001f)
			{
				return;
			}
			((Vector3)(ref val)).Normalize();
			float num = (_temFrente ? Vector3.SignedAngle(_frenteMed, val, up) : 0f);
			_frenteMed = val;
			_temFrente = true;
			if (Mathf.Abs(num) > 60f)
			{
				num = 0f;
			}
			if (atacando && especial && Golpes.PesoGiro(_anim) < 0.5f)
			{
				Golpes.AcumAtgeir = Mathf.Clamp(Golpes.AcumAtgeir + num, -2000f, 2000f);
			}
			if (atacando && !especial && Golpes.Nivel(Golpes.AtaqueAtual((Humanoid)(object)p)) == 1 && u > 0.45f)
			{
				Golpes.AcumGolpe2 += num;
			}
			if (avanco && u > 0.1f && u < 0.7f)
			{
				Golpes.AcumAtgeir = Mathf.Clamp(Golpes.AcumAtgeir + (Golpes.EspelharAvanco ? (0f - num) : num), -2000f, 2000f);
			}
			if (avanco)
			{
				if (!_avancando)
				{
					_avancando = true;
					_uAnt = u;
					_frenteAvanco = ((Component)_dono).transform.forward;
				}
				float num2 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.1f, 0.75f, _uAnt));
				float num3 = Mathf.SmoothStep(0f, 1f, Mathf.InverseLerp(0.1f, 0.75f, u));
				if (u > _uAnt)
				{
					Golpes.AvancoPendente += _frenteAvanco * (Golpes.CfgDistAvanco.Value * (num3 - num2));
				}
				_uAnt = Mathf.Max(_uAnt, u);
			}
			else
			{
				_avancando = false;
				_frenteAvanco = Vector3.zero;
			}
		}

		private void Restaurar()
		{
			//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_0123: 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_01aa: 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_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_00fa: 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_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			if (_mex == null)
			{
				_mex = ((IEnumerable<Transform>)(object)new Transform[9] { _ro, _rc, _r, _lo, _lc, _l, _spine, _chest, _peito }).Where((Transform t) => (Object)(object)t != (Object)null).Distinct().ToArray();
				_bruto = (Quaternion[])(object)new Quaternion[_mex.Length];
				_escrito = (Quaternion[])(object)new Quaternion[_mex.Length];
				for (int num = 0; num < _mex.Length; num++)
				{
					_bruto[num] = _mex[num].localRotation;
					_escrito[num] = new Quaternion(9f, 9f, 9f, 9f);
				}
			}
			for (int num2 = 0; num2 < _mex.Length; num2++)
			{
				Quaternion localRotation = _mex[num2].localRotation;
				if (localRotation.x == _escrito[num2].x && localRotation.y == _escrito[num2].y && localRotation.z == _escrito[num2].z && localRotation.w == _escrito[num2].w)
				{
					_mex[num2].localRotation = _bruto[num2];
				}
				else
				{
					_bruto[num2] = localRotation;
				}
			}
		}

		private void Gravar()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			if (_mex != null)
			{
				for (int i = 0; i < _mex.Length; i++)
				{
					_escrito[i] = _mex[i].localRotation;
				}
			}
		}

		private void OnEnable()
		{
			((MonoBehaviour)this).StartCoroutine(FimDoQuadro());
		}

		private IEnumerator FimDoQuadro()
		{
			while (true)
			{
				yield return _fim;
				if (_mex == null || !AjusteFoice.CfgCapa.Value)
				{
					continue;
				}
				for (int i = 0; i < _mex.Length; i++)
				{
					if (!((Object)(object)_mex[i] == (Object)null))
					{
						Quaternion localRotation = _mex[i].localRotation;
						if (localRotation.x == _escrito[i].x && localRotation.y == _escrito[i].y && localRotation.z == _escrito[i].z && localRotation.w == _escrito[i].w)
						{
							_mex[i].localRotation = _bruto[i];
						}
					}
				}
			}
		}

		private void Filtrar(float dt, bool ligar)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0154: 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_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)_dono == (Object)null))
			{
				Transform transform = ((Component)_dono).transform;
				Quaternion val = Quaternion.Inverse(transform.rotation) * ((Component)this).transform.rotation;
				Vector3 val2 = transform.InverseTransformPoint(((Component)this).transform.position);
				bool flag = ligar && AjusteFoice.CfgSuavizar.Value;
				_pesoFiltro = Mathf.MoveTowards(_pesoFiltro, flag ? 1f : 0f, 6f * dt);
				if (!_fTem || _pesoFiltro <= 0f)
				{
					_fRot = val;
					_fPos = val2;
					_fW = 0f;
					_fV = 0f;
					_fTem = true;
					return;
				}
				float value = AjusteFoice.CfgSuavizarVel.Value;
				_fW = Mathf.Lerp(_fW, Quaternion.Angle(_fRot, val) / dt, Alfa(8f));
				float fV = _fV;
				Vector3 val3 = val2 - _fPos;
				_fV = Mathf.Lerp(fV, ((Vector3)(ref val3)).magnitude / dt, Alfa(8f));
				float value2 = AjusteFoice.CfgSuavizarMin.Value;
				_fRot = Quaternion.Slerp(_fRot, val, Alfa(value2 + 0.015f * value * _fW));
				_fPos = Vector3.Lerp(_fPos, val2, Alfa(value2 + 3f * value * _fV));
				((Component)this).transform.rotation = transform.rotation * Quaternion.Slerp(val, _fRot, _pesoFiltro);
				((Component)this).transform.position = transform.TransformPoint(Vector3.Lerp(val2, _fPos, _pesoFiltro));
			}
			float Alfa(float fc)
			{
				float num = 1f / ((float)Math.PI * 2f * Mathf.Max(0.1f, fc));
				return 1f / (1f + num / dt);
			}
		}

		private static void GirarMao(Transform mao, Transform dedo, Transform polegar, Vector3 g)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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)
			//IL_005d: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_008a: 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_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)mao == (Object)null) && !((Object)(object)dedo == (Object)null) && !(g == Vector3.zero))
			{
				Vector3 val = dedo.position - mao.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2;
				if (!((Object)(object)polegar != (Object)null))
				{
					val2 = mao.right;
				}
				else
				{
					val = Vector3.ProjectOnPlane(polegar.position - mao.position, normalized);
					val2 = ((Vector3)(ref val)).normalized;
				}
				Vector3 val3 = val2;
				val = Vector3.Cross(normalized, val3);
				Vector3 normalized2 = ((Vector3)(ref val)).normalized;
				Quaternion val4 = Quaternion.AngleAxis(g.x, normalized) * Quaternion.AngleAxis(g.y, val3) * Quaternion.AngleAxis(g.z, normalized2);
				mao.rotation = val4 * mao.rotation;
			}
		}

		private void Agarrar(bool atacando, bool soDireita = false)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: 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_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			Vector3 pos;
			Quaternion rot;
			float comp;
			if (!((Object)(object)_ro == (Object)null) && !((Object)(object)_lo == (Object)null))
			{
				pos = ((Component)this).transform.position;
				rot = ((Component)this).transform.rotation;
				GirarMao(_r, _rd, _rt, AjusteFoice.Graus(AjusteFoice.CfgGiroMaoDir));
				if (!soDireita)
				{
					GirarMao(_l, _l1, _lt, AjusteFoice.Graus(AjusteFoice.CfgGiroMaoEsq));
				}
				comp = AjusteFoice.CfgComprimento.Value;
				Vector3 palma = PalmaDireita();
				Vector3 alvo = Ponto(palma);
				AjusteFoice.IKBraco(_ro, _rc, _r, alvo, palma, 1f);
				if (soDireita)
				{
					((Component)this).transform.SetPositionAndRotation(pos, rot);
					return;
				}
				Vector3 val = PalmaEsquerda();
				Vector3 val2 = Ponto(val);
				Vector3 val3 = val2 - val;
				float magnitude = ((Vector3)(ref val3)).magnitude;
				float peso = ((atacando || AjusteFoice.CfgEsqParado.Value) ? Mathf.Clamp01((0.6f - magnitude) / 0.2f) : Mathf.Clamp01((0.3f - magnitude) / 0.1f));
				AjusteFoice.IKBraco(_lo, _lc, _l, val2, val, peso);
				((Component)this).transform.SetPositionAndRotation(pos, rot);
			}
			Vector3 Ponto(Vector3 val4)
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0007: Unknown result type (might be due to invalid IL or missing references)
				//IL_000d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0012: Unknown result type (might be due to invalid IL or missing references)
				//IL_0017: 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_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_0049: 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)
				float num = Mathf.Clamp(Vector3.Dot(val4 - pos, rot * Vector3.up), 0.05f, comp * 0.7f);
				return pos + rot * Vector3.up * num;
			}
		}

		private void LaminaNoCorte(float dt, bool atacando)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00cd: 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_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: 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_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01df: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			Vector3 up = ((Component)this).transform.up;
			if (!_temPonta)
			{
				_temPonta = true;
				_hAnt = up;
				_eixoCorte = Vector3.zero;
				_pesoCorte = 0f;
				return;
			}
			Vector3 val = Vector3.Cross(_hAnt, up);
			float num = Mathf.Asin(Mathf.Clamp(((Vector3)(ref val)).magnitude, 0f, 1f)) * 57.29578f / dt;
			_hAnt = up;
			if (atacando && num > 80f)
			{
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				if (((Vector3)(ref _eixoCorte)).sqrMagnitude < 0.5f || (Vector3.Dot(normalized, _eixoCorte) < 0f && num > 250f))
				{
					_eixoCorte = normalized;
				}
				else
				{
					Vector3 val2 = Vector3.Slerp(_eixoCorte, (Vector3.Dot(normalized, _eixoCorte) < 0f) ? _eixoCorte : normalized, 1f - Mathf.Exp(-10f * dt));
					_eixoCorte = ((Vector3)(ref val2)).normalized;
				}
			}
			float num2 = (atacando ? Mathf.Clamp01((num - 80f) / 160f) : 0f);
			_pesoCorte = Mathf.MoveTowards(_pesoCorte, num2, ((num2 > _pesoCorte) ? 10f : 3f) * dt);
			if (((Vector3)(ref _eixoCorte)).sqrMagnitude < 0.5f || _pesoCorte <= 0.01f)
			{
				return;
			}
			Vector3 val3 = Vector3.Cross(_eixoCorte, up);
			if (!(((Vector3)(ref val3)).sqrMagnitude < 0.0001f))
			{
				val3 = Quaternion.AngleAxis(AjusteFoice.CfgGiroLaminaMixamo.Value, up) * ((Vector3)(ref val3)).normalized;
				Vector3 val4 = Vector3.ProjectOnPlane(((Component)this).transform.forward, up);
				if (!(((Vector3)(ref val4)).sqrMagnitude < 0.0001f))
				{
					Vector3 position = ((Component)this).transform.position;
					Quaternion val5 = Quaternion.FromToRotation(((Vector3)(ref val4)).normalized, val3);
					((Component)this).transform.rotation = Quaternion.Slerp(Quaternion.identity, val5, _pesoCorte) * ((Component)this).transform.rotation;
					((Component)this).transform.position = position;
				}
			}
		}

		private void Torcer(Vector3 haste, Vector3 maoLocal, float peso, float dt)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: 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_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missi