Decompiled source of ArmWeaponsPack v1.0.0

ArmWeaponsPack.dll

Decompiled 5 hours ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using Il2Cpp;
using Il2CppHurricaneVR.Framework.Core.Grabbers;
using Il2CppHurricaneVR.Framework.Shared;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppSystem;
using Il2CppSystem.Reflection;
using MahitoMod;
using MelonLoader;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: MelonInfo(typeof(Core), "MahitoMod", "10.14.0", "YourName", null)]
[assembly: MelonGame("Kubunautilus", "BrutalistickVR")]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("WeaponHand")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("WeaponHand")]
[assembly: AssemblyTitle("WeaponHand")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace MahitoMod;

public class Core : MelonMod
{
	private enum WeaponType
	{
		None,
		Blade,
		Chainsaw,
		Hammer,
		Claws,
		AssassinBlade,
		Crowbar
	}

	private enum DeployState
	{
		Deploying,
		Deployed,
		Retracting
	}

	private class HandState
	{
		public HVRHandGrabber hand;

		public bool wasSecondary;

		public bool wasTrigger;

		public bool wasStick;

		public bool isLeftHand;

		public WeaponType selectedType = WeaponType.Blade;

		public WeaponType currentType = WeaponType.None;

		public GameObject weaponInstance;

		public Rigidbody weaponRb;

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

		public List<Rigidbody> clawRbs = new List<Rigidbody>();

		public List<Collider> weaponColliders = new List<Collider>();

		public Vector3 currentPos;

		public Quaternion currentRot;

		public DeployState deployState;

		public float deployProgress;

		public ChainsawManager chainsawManager;

		public AudioSource idleAudio;

		public AudioSource revvedAudio;

		public AudioClip startSoundClip;

		public AudioClip stopSoundClip;

		public ConfigurableJoint crowbarJoint;

		public bool IsActive => (Object)(object)weaponInstance != (Object)null || clawInstances.Count > 0;

		public bool IsRetracting => deployState == DeployState.Retracting;

		public void ClearWeapon()
		{
			weaponInstance = null;
			weaponRb = null;
			clawInstances.Clear();
			clawRbs.Clear();
			weaponColliders.Clear();
			currentType = WeaponType.None;
			deployProgress = 0f;
			deployState = DeployState.Deployed;
			chainsawManager = null;
			idleAudio = null;
			revvedAudio = null;
			startSoundClip = null;
			stopSoundClip = null;
			wasTrigger = false;
			crowbarJoint = null;
		}
	}

	public static HVRHexaBodyInputs playerInputs;

	private HandState leftHand = new HandState();

	private HandState rightHand = new HandState();

	private GameObject katanaPrefab;

	private GameObject chainsawPrefab;

	private GameObject hammerPrefab;

	private GameObject zweihanderPrefab;

	private GameObject crowbarPrefab;

	private float searchTimer = 0f;

	private const float SEARCH_INTERVAL = 2f;

	private const float BLADE_LERP_SPEED = 50f;

	private const float BLADE_MAX_SPEED = 50f;

	private const float BLADE_MAX_ANGULAR_SPEED = 3600f;

	private const float BLADE_DEPLOY_DISTANCE = 0.5f;

	private const float BLADE_DEPLOY_DURATION = 0.1f;

	private const float HANDLE_CUT_THRESHOLD = 0.4f;

	private static readonly Vector3 GRIP_OFFSET = new Vector3(0f, -0.05f, -0.6f);

	private static readonly Quaternion GRIP_ROT_RIGHT = Quaternion.Euler(90f, 0f, 0f);

	private static readonly Quaternion GRIP_ROT_LEFT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 180f, 0f);

	private const float CHAINSAW_LERP_SPEED = 84f;

	private const float CHAINSAW_MAX_SPEED = 84f;

	private const float CHAINSAW_MAX_ANGULAR_SPEED = 5400f;

	private const float CHAINSAW_DEPLOY_DISTANCE = 0.4f;

	private const float CHAINSAW_DEPLOY_DURATION = 0.15f;

	private static readonly Vector3 CHAINSAW_OFFSET_RIGHT = new Vector3(0f, 0.06f, -0.03f);

	private static readonly Vector3 CHAINSAW_OFFSET_LEFT = new Vector3(0f, -0.14f, -0.03f);

	private static readonly Quaternion CHAINSAW_ROT_RIGHT = Quaternion.Euler(0f, 180f, 90f);

	private static readonly Quaternion CHAINSAW_ROT_LEFT = Quaternion.Euler(0f, 180f, -90f);

	private const float CHAINSAW_IDLE_VOLUME = 1f;

	private const float CHAINSAW_REVVED_VOLUME = 0.5f;

	private const float CHAINSAW_START_VOLUME = 1f;

	private const float CHAINSAW_STOP_VOLUME = 1f;

	private const float HAMMER_LERP_SPEED = 250f;

	private const float HAMMER_MAX_SPEED = 250f;

	private const float HAMMER_MAX_ANGULAR_SPEED = 7200f;

	private const float HAMMER_DEPLOY_DISTANCE = 0.3f;

	private const float HAMMER_DEPLOY_DURATION = 0.25f;

	private const float HAMMER_HANDLE_CUT_THRESHOLD = 0.87f;

	private static readonly Vector3 HAMMER_OFFSET_RIGHT = new Vector3(0.03f, -0.04f, -0.77f);

	private static readonly Vector3 HAMMER_OFFSET_LEFT = new Vector3(-0.03f, -0.04f, -0.77f);

	private static readonly Quaternion HAMMER_ROT_RIGHT = Quaternion.Euler(90f, 0f, 0f);

	private static readonly Quaternion HAMMER_ROT_LEFT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 180f, 0f);

	private const float CLAW_LERP_SPEED = 200f;

	private const float CLAW_MAX_SPEED = 200f;

	private const float CLAW_MAX_ANGULAR_SPEED = 10000f;

	private const float CLAW_DEPLOY_DISTANCE = 0.35f;

	private const float CLAW_DEPLOY_DURATION = 0.12f;

	private const float CLAW_SCALE = 0.6f;

	private const float CLAW_SPACING = 0.035f;

	private const float CLAW_HANDLE_CUT_THRESHOLD = 0.35f;

	private const float CLAW_MASS = 1.5f;

	private const float CLAW_DRAG = 0f;

	private const float CLAW_ANGULAR_DRAG = 0f;

	private static readonly Vector3 CLAW_BASE_OFFSET = new Vector3(0.03f, -0.04f, -0.24f);

	private static readonly Vector3 CLAW_OFFSET_LEFT = new Vector3(0f, -0.035f, 0f);

	private static readonly Vector3 CLAW_OFFSET_CENTER = new Vector3(0f, 0f, 0f);

	private static readonly Vector3 CLAW_OFFSET_RIGHT = new Vector3(0f, 0.035f, 0f);

	private static readonly Quaternion CLAW_ROT_RIGHT = Quaternion.Euler(90f, 0f, 0f);

	private static readonly Quaternion CLAW_ROT_LEFT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 180f, 0f);

	private const float ASSASSIN_LERP_SPEED = 400f;

	private const float ASSASSIN_MAX_SPEED = 400f;

	private const float ASSASSIN_MAX_ANGULAR_SPEED = 10000f;

	private const float ASSASSIN_DEPLOY_DISTANCE = 0.35f;

	private const float ASSASSIN_DEPLOY_DURATION = 0.12f;

	private const float ASSASSIN_SCALE = 1f;

	private const float ASSASSIN_CUT_THRESHOLD = 0.8f;

	private const int ASSASSIN_CUT_AXIS = 1;

	private const bool ASSASSIN_CUT_REMOVE_BELOW = true;

	private const float ASSASSIN_MASS = 3f;

	private static readonly Vector3 ASSASSIN_OFFSET = new Vector3(0f, -0.04f, -1.2f);

	private static readonly Quaternion ASSASSIN_ROT_RIGHT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 90f, 0f);

	private static readonly Quaternion ASSASSIN_ROT_LEFT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 270f, 0f);

	private const float CROWBAR_SCALE = 1f;

	private const float CROWBAR_MASS = 1.75f;

	private const float CROWBAR_JOINT_POS_SPRING = 8000f;

	private const float CROWBAR_JOINT_POS_DAMPER = 120f;

	private const float CROWBAR_JOINT_POS_MAX_FORCE = 20000f;

	private const float CROWBAR_JOINT_LINEAR_LIMIT = 0.06f;

	private const float CROWBAR_JOINT_ANG_SPRING = 5000f;

	private const float CROWBAR_JOINT_ANG_DAMPER = 80f;

	private const float CROWBAR_JOINT_ANG_MAX_FORCE = 15000f;

	private static readonly Vector3 CROWBAR_OFFSET = new Vector3(0f, -0.02f, 0.19f);

	private static readonly Quaternion CROWBAR_ROT_RIGHT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, -90f, 0f);

	private static readonly Quaternion CROWBAR_ROT_LEFT = Quaternion.Euler(90f, 0f, 0f) * Quaternion.Euler(0f, 90f, 0f);

	private const float CROWBAR_DEPLOY_DISTANCE = 0.55f;

	private const float CROWBAR_DEPLOY_DURATION = 0.1f;

	private const float CROWBAR_LERP_SPEED = 120f;

	private const float CROWBAR_MAX_SPEED = 120f;

	private const float CROWBAR_MAX_ANGULAR_SPEED = 5000f;

	public override void OnInitializeMelon()
	{
		((MelonBase)this).LoggerInstance.Msg("MahitoMod v10.14.0 — Crowbar Hook с анимацией деплоя.");
		((MelonBase)this).LoggerInstance.Msg("Стик = выбор режима, B = достать/убрать.");
		((MelonBase)this).LoggerInstance.Msg("Режимы: Blade, Chainsaw, Hammer, Claws, AssassinBlade, Crowbar");
	}

	public override void OnSceneWasLoaded(int buildIndex, string sceneName)
	{
		DestroyWeapon(leftHand);
		DestroyWeapon(rightHand);
		playerInputs = null;
		katanaPrefab = null;
		chainsawPrefab = null;
		hammerPrefab = null;
		zweihanderPrefab = null;
		crowbarPrefab = null;
		searchTimer = 1f;
		leftHand = new HandState
		{
			isLeftHand = true,
			selectedType = WeaponType.Blade
		};
		rightHand = new HandState
		{
			isLeftHand = false,
			selectedType = WeaponType.Blade
		};
		if (!(sceneName == "MainMenuScene"))
		{
			GameObject val = GameObject.Find("Hexa4Rig26.10.23");
			if (!((Object)(object)val == (Object)null))
			{
				playerInputs = val.GetComponentInChildren<HVRHexaBodyInputs>();
				HandState handState = leftHand;
				Transform obj = val.transform.Find("Physics LeftHand");
				handState.hand = ((obj != null) ? ((Component)obj).GetComponent<HVRHandGrabber>() : null);
				HandState handState2 = rightHand;
				Transform obj2 = val.transform.Find("Physics RightHand");
				handState2.hand = ((obj2 != null) ? ((Component)obj2).GetComponent<HVRHandGrabber>() : null);
			}
		}
	}

	public override void OnUpdate()
	{
		if ((Object)(object)playerInputs == (Object)null)
		{
			return;
		}
		searchTimer -= Time.deltaTime;
		if (searchTimer <= 0f)
		{
			searchTimer = 2f;
			if ((Object)(object)katanaPrefab == (Object)null)
			{
				FindKatanaPrefab();
			}
			if ((Object)(object)chainsawPrefab == (Object)null)
			{
				FindChainsawPrefab();
			}
			if ((Object)(object)hammerPrefab == (Object)null)
			{
				FindHammerPrefab();
			}
			if ((Object)(object)zweihanderPrefab == (Object)null)
			{
				FindZweihanderPrefab();
			}
			if ((Object)(object)crowbarPrefab == (Object)null)
			{
				FindCrowbarPrefab();
			}
		}
		HVRController leftController = playerInputs.LeftController;
		HVRController rightController = playerInputs.RightController;
		if (!((Object)(object)leftController == (Object)null) && !((Object)(object)rightController == (Object)null))
		{
			ProcessHand(leftHand, leftController);
			ProcessHand(rightHand, rightController);
		}
	}

	public override void OnFixedUpdate()
	{
		if (leftHand.IsActive)
		{
			UpdateWeaponPosition(leftHand);
		}
		if (rightHand.IsActive)
		{
			UpdateWeaponPosition(rightHand);
		}
	}

	private void ProcessHand(HandState hs, HVRController ctrl)
	{
		//IL_0019: Unknown result type (might be due to invalid IL or missing references)
		//IL_0025: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)hs.hand == (Object)null)
		{
			return;
		}
		bool active = ctrl.TriggerButtonState.Active;
		bool active2 = ctrl.SecondaryButtonState.Active;
		bool active3 = ctrl.JoystickButtonState.Active;
		bool flag = active2 && !hs.wasSecondary;
		bool flag2 = active3 && !hs.wasStick;
		hs.wasSecondary = active2;
		hs.wasStick = active3;
		if (hs.currentType == WeaponType.Chainsaw && (Object)(object)hs.chainsawManager != (Object)null && hs.IsActive && !hs.IsRetracting)
		{
			bool flag3 = active && !hs.wasTrigger;
			bool flag4 = !active && hs.wasTrigger;
			hs.wasTrigger = active;
			if (flag3)
			{
				try
				{
					hs.chainsawManager.isRevved = true;
				}
				catch
				{
				}
				if ((Object)(object)hs.revvedAudio != (Object)null)
				{
					if (!hs.revvedAudio.isPlaying)
					{
						try
						{
							hs.revvedAudio.Play();
						}
						catch
						{
						}
					}
					hs.revvedAudio.volume = 0.5f;
				}
				if ((Object)(object)hs.idleAudio != (Object)null)
				{
					hs.idleAudio.volume = 0f;
				}
			}
			else if (flag4)
			{
				try
				{
					hs.chainsawManager.isRevved = false;
				}
				catch
				{
				}
				if ((Object)(object)hs.idleAudio != (Object)null)
				{
					if (!hs.idleAudio.isPlaying)
					{
						try
						{
							hs.idleAudio.Play();
						}
						catch
						{
						}
					}
					hs.idleAudio.volume = 1f;
				}
				if ((Object)(object)hs.revvedAudio != (Object)null)
				{
					hs.revvedAudio.volume = 0f;
				}
			}
		}
		if (flag2)
		{
			int selectedType = (int)(hs.selectedType + 1) % 7;
			hs.selectedType = (WeaponType)selectedType;
			string value = (hs.isLeftHand ? "Левая" : "Правая");
			((MelonBase)this).LoggerInstance.Msg($"[Mahito] {value} рука: режим → {hs.selectedType}");
		}
		if (!flag || ((HVRGrabberBase)hs.hand).IsGrabbing || hs.IsRetracting)
		{
			return;
		}
		if (hs.IsActive)
		{
			hs.deployState = DeployState.Retracting;
			((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": убираем оружие...");
			return;
		}
		switch (hs.selectedType)
		{
		case WeaponType.Blade:
			SpawnBlade(hs);
			break;
		case WeaponType.Chainsaw:
			SpawnChainsaw(hs);
			break;
		case WeaponType.Hammer:
			SpawnHammer(hs);
			break;
		case WeaponType.Claws:
			SpawnClaws(hs);
			break;
		case WeaponType.AssassinBlade:
			SpawnAssassinBlade(hs);
			break;
		case WeaponType.Crowbar:
			SpawnCrowbar(hs);
			break;
		case WeaponType.None:
			break;
		}
	}

	private bool IsCuttingPart(Transform t)
	{
		Transform val = t;
		int num = 0;
		while ((Object)(object)val != (Object)null && num < 20)
		{
			string text = ((Object)val).name.ToLower();
			if (text == "bar" || text.Contains("chainsawchain"))
			{
				return true;
			}
			val = val.parent;
			num++;
		}
		return false;
	}

	private void FindKatanaPrefab()
	{
		//IL_0088: Unknown result type (might be due to invalid IL or missing references)
		//IL_008d: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
			if (val == null)
			{
				return;
			}
			GameObject val2 = null;
			GameObject val3 = null;
			foreach (GameObject item in val)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string name = ((Object)item).name;
				if (!name.StartsWith("Katana3") || name.Contains("SpawnableItemInfo"))
				{
					continue;
				}
				string value = "";
				try
				{
					Scene scene = item.scene;
					value = ((Scene)(ref scene)).name ?? "";
				}
				catch
				{
				}
				SharpWeaponManager component = item.GetComponent<SharpWeaponManager>();
				if ((Object)(object)component == (Object)null)
				{
					continue;
				}
				Rigidbody component2 = item.GetComponent<Rigidbody>();
				if (!((Object)(object)component2 == (Object)null))
				{
					if (string.IsNullOrEmpty(value))
					{
						val2 = item;
						break;
					}
					if ((Object)(object)val3 == (Object)null && !IsChildOfShopStand(item.transform))
					{
						val3 = item;
					}
				}
			}
			if ((Object)(object)val2 != (Object)null)
			{
				katanaPrefab = val2;
			}
			else if ((Object)(object)val3 != (Object)null)
			{
				katanaPrefab = val3;
			}
		}
		catch
		{
		}
	}

	private void FindChainsawPrefab()
	{
		//IL_007f: 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)
		try
		{
			Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
			if (val == null)
			{
				return;
			}
			GameObject val2 = null;
			GameObject val3 = null;
			foreach (GameObject item in val)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string name = ((Object)item).name;
				if (name != "Chainsaw" && name != "Chainsaw(Clone)")
				{
					continue;
				}
				string value = "";
				try
				{
					Scene scene = item.scene;
					value = ((Scene)(ref scene)).name ?? "";
				}
				catch
				{
				}
				string text = (((Object)(object)item.transform.parent != (Object)null) ? ((Object)item.transform.parent).name : "ROOT");
				string text2 = (((Object)(object)item.transform.root != (Object)null) ? ((Object)item.transform.root).name : "?");
				ChainsawManager component = item.GetComponent<ChainsawManager>();
				if (!((Object)(object)component == (Object)null) && !IsChildOfShopStand(item.transform) && !text.Contains("Variant") && !text.Contains("itemTab"))
				{
					if (string.IsNullOrEmpty(value) && text == "ROOT")
					{
						val2 = item;
						break;
					}
					if ((Object)(object)val3 == (Object)null && text == "ROOT" && text2 == name)
					{
						val3 = item;
					}
				}
			}
			if ((Object)(object)val2 != (Object)null)
			{
				chainsawPrefab = val2;
			}
			else if ((Object)(object)val3 != (Object)null)
			{
				chainsawPrefab = val3;
			}
		}
		catch
		{
		}
	}

	private void FindHammerPrefab()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
			if (val == null)
			{
				return;
			}
			foreach (GameObject item in val)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string name = ((Object)item).name;
				if (name != "Warhammer")
				{
					continue;
				}
				string value = "";
				try
				{
					Scene scene = item.scene;
					value = ((Scene)(ref scene)).name ?? "";
				}
				catch
				{
				}
				string text = (((Object)(object)item.transform.parent != (Object)null) ? ((Object)item.transform.parent).name : "ROOT");
				BluntForceManager component = item.GetComponent<BluntForceManager>();
				if (!((Object)(object)component == (Object)null))
				{
					Rigidbody component2 = item.GetComponent<Rigidbody>();
					if (!((Object)(object)component2 == (Object)null) && string.IsNullOrEmpty(value) && text == "ROOT")
					{
						hammerPrefab = item;
						break;
					}
				}
			}
		}
		catch
		{
		}
	}

	private void FindZweihanderPrefab()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
			if (val == null)
			{
				return;
			}
			foreach (GameObject item in val)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string name = ((Object)item).name;
				if (name != "Zweihander")
				{
					continue;
				}
				string value = "";
				try
				{
					Scene scene = item.scene;
					value = ((Scene)(ref scene)).name ?? "";
				}
				catch
				{
				}
				string text = (((Object)(object)item.transform.parent != (Object)null) ? ((Object)item.transform.parent).name : "ROOT");
				if (!IsChildOfShopStand(item.transform) && string.IsNullOrEmpty(value) && text == "ROOT")
				{
					Rigidbody component = item.GetComponent<Rigidbody>();
					if ((Object)(object)component != (Object)null)
					{
						zweihanderPrefab = item;
						break;
					}
				}
			}
		}
		catch
		{
		}
	}

	private void FindCrowbarPrefab()
	{
		//IL_0064: Unknown result type (might be due to invalid IL or missing references)
		//IL_0069: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			Il2CppArrayBase<GameObject> val = Resources.FindObjectsOfTypeAll<GameObject>();
			if (val == null)
			{
				return;
			}
			foreach (GameObject item in val)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string name = ((Object)item).name;
				if (name != "Crowbar")
				{
					continue;
				}
				string value = "";
				try
				{
					Scene scene = item.scene;
					value = ((Scene)(ref scene)).name ?? "";
				}
				catch
				{
				}
				string text = (((Object)(object)item.transform.parent != (Object)null) ? ((Object)item.transform.parent).name : "ROOT");
				if (!IsChildOfShopStand(item.transform) && string.IsNullOrEmpty(value) && text == "ROOT")
				{
					Rigidbody component = item.GetComponent<Rigidbody>();
					if ((Object)(object)component != (Object)null)
					{
						crowbarPrefab = item;
						break;
					}
				}
			}
		}
		catch
		{
		}
	}

	private bool IsChildOfShopStand(Transform t)
	{
		Transform val = t;
		int num = 0;
		while ((Object)(object)val != (Object)null && num < 20)
		{
			string name = ((Object)val).name;
			if (name.Contains("ShopStand") || name.Contains("WallSocket") || name.Contains("WeaponWall") || name.Contains("MeleeWall") || name.Contains("itemTab") || name.Contains("modItemTab"))
			{
				return true;
			}
			val = val.parent;
			num++;
		}
		return false;
	}

	private void SpawnBlade(HandState hs)
	{
		//IL_0086: 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_01e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0203: Unknown result type (might be due to invalid IL or missing references)
		//IL_0208: Unknown result type (might be due to invalid IL or missing references)
		//IL_020c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0213: Unknown result type (might be due to invalid IL or missing references)
		//IL_0222: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_023d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_0249: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0262: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0269: Unknown result type (might be due to invalid IL or missing references)
		//IL_026d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0272: Unknown result type (might be due to invalid IL or missing references)
		//IL_0274: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: 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_028f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0298: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)katanaPrefab == (Object)null)
		{
			FindKatanaPrefab();
			if ((Object)(object)katanaPrefab == (Object)null)
			{
				return;
			}
		}
		GameObject val = Object.Instantiate<GameObject>(katanaPrefab);
		((Object)val).name = "MahitoBlade_" + (hs.isLeftHand ? "L" : "R");
		val.transform.SetParent((Transform)null);
		val.transform.localScale = new Vector3(1f, 1f, 1f);
		DestroyComponentByName(val, "HVRTagSocketable");
		DestroyComponentByName(val, "HVRStringSocketable");
		DisableComponentByName(val, "HVRGrabbable");
		DisableComponentByName(val, "HVRGrabbableImpactHaptics");
		CutMeshAtThreshold(val, 0.4f);
		DisableHandleColliders(val);
		Rigidbody val2 = val.GetComponent<Rigidbody>();
		if ((Object)(object)val2 == (Object)null)
		{
			val2 = val.AddComponent<Rigidbody>();
		}
		val2.isKinematic = true;
		val2.useGravity = false;
		val2.detectCollisions = true;
		val2.interpolation = (RigidbodyInterpolation)1;
		val2.mass = 1.5f;
		val2.collisionDetectionMode = (CollisionDetectionMode)3;
		hs.weaponRb = val2;
		hs.weaponColliders.Clear();
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
		if (array != null)
		{
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				if ((Object)(object)val3 != (Object)null && val3.enabled)
				{
					hs.weaponColliders.Add(val3);
				}
			}
		}
		SharpWeaponManager component = val.GetComponent<SharpWeaponManager>();
		if ((Object)(object)component != (Object)null)
		{
			((Behaviour)component).enabled = true;
		}
		DisableCollisionWithPlayer(hs);
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val4 = (hs.isLeftHand ? GRIP_ROT_LEFT : GRIP_ROT_RIGHT);
		Vector3 val5 = -transform.forward * 0.5f;
		Vector3 val6 = transform.position + transform.right * GRIP_OFFSET.x + transform.up * GRIP_OFFSET.y + transform.forward * GRIP_OFFSET.z + val5;
		Quaternion val7 = transform.rotation * val4;
		val.transform.position = val6;
		val.transform.rotation = val7;
		hs.currentPos = val6;
		hs.currentRot = val7;
		val.SetActive(true);
		hs.weaponInstance = val;
		hs.currentType = WeaponType.Blade;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": катана появляется.");
	}

	private void SpawnChainsaw(HandState hs)
	{
		//IL_048d: Unknown result type (might be due to invalid IL or missing references)
		//IL_05ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_05e6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_05f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_0603: 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_0608: Unknown result type (might be due to invalid IL or missing references)
		//IL_060c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0611: Unknown result type (might be due to invalid IL or missing references)
		//IL_061b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0620: Unknown result type (might be due to invalid IL or missing references)
		//IL_0624: Unknown result type (might be due to invalid IL or missing references)
		//IL_062b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0630: Unknown result type (might be due to invalid IL or missing references)
		//IL_0637: Unknown result type (might be due to invalid IL or missing references)
		//IL_063c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0643: Unknown result type (might be due to invalid IL or missing references)
		//IL_0648: Unknown result type (might be due to invalid IL or missing references)
		//IL_064f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0654: Unknown result type (might be due to invalid IL or missing references)
		//IL_065b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0660: Unknown result type (might be due to invalid IL or missing references)
		//IL_0667: Unknown result type (might be due to invalid IL or missing references)
		//IL_066c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0671: Unknown result type (might be due to invalid IL or missing references)
		//IL_0675: Unknown result type (might be due to invalid IL or missing references)
		//IL_067a: Unknown result type (might be due to invalid IL or missing references)
		//IL_067c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0681: Unknown result type (might be due to invalid IL or missing references)
		//IL_0689: Unknown result type (might be due to invalid IL or missing references)
		//IL_068b: Unknown result type (might be due to invalid IL or missing references)
		//IL_068d: Unknown result type (might be due to invalid IL or missing references)
		//IL_069e: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ad: 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_06b8: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ba: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)chainsawPrefab == (Object)null)
		{
			FindChainsawPrefab();
			if ((Object)(object)chainsawPrefab == (Object)null)
			{
				return;
			}
		}
		GameObject val;
		try
		{
			val = Object.Instantiate<GameObject>(chainsawPrefab);
		}
		catch
		{
			return;
		}
		((Object)val).name = "MahitoChainsaw_" + (hs.isLeftHand ? "L" : "R");
		val.transform.SetParent((Transform)null);
		val.transform.localScale = new Vector3(1f, 1f, 1f);
		DestroyComponentByName(val, "HVRTagSocketable");
		DestroyComponentByName(val, "HVRStringSocketable");
		DisableComponentByName(val, "HVRGrabbable");
		DisableComponentByName(val, "HVRGrabbableImpactHaptics");
		DisableComponentByName(val, "StabilizerGrabbable");
		DisableComponentByName(val, "ImpactObjectRigidbody");
		DisableComponentByName(val, "ImpactCollisionTrigger3D");
		DisableComponentByName(val, "ImpactSlideAndRollTrigger3D");
		ChainsawManager component = val.GetComponent<ChainsawManager>();
		if ((Object)(object)component == (Object)null)
		{
			Object.Destroy((Object)(object)val);
			return;
		}
		try
		{
			ParticleSystem smokeParticleSystem = component.smokeParticleSystem;
			if ((Object)(object)smokeParticleSystem != (Object)null)
			{
				smokeParticleSystem.Stop(true, (ParticleSystemStopBehavior)0);
				((Component)smokeParticleSystem).gameObject.SetActive(false);
			}
		}
		catch
		{
		}
		Il2CppArrayBase<ParticleSystem> componentsInChildren = val.GetComponentsInChildren<ParticleSystem>(true);
		if (componentsInChildren != null)
		{
			foreach (ParticleSystem item in componentsInChildren)
			{
				if ((Object)(object)item != (Object)null && ((Object)((Component)item).gameObject).name.ToLower().Contains("smoke"))
				{
					try
					{
						item.Stop(true, (ParticleSystemStopBehavior)0);
						((Component)item).gameObject.SetActive(false);
					}
					catch
					{
					}
				}
			}
		}
		hs.chainsawManager = component;
		try
		{
			component.StartChainsaw();
		}
		catch
		{
			try
			{
				component.isRunning = true;
			}
			catch
			{
			}
		}
		Rigidbody val2 = val.GetComponent<Rigidbody>();
		if ((Object)(object)val2 == (Object)null)
		{
			val2 = val.AddComponent<Rigidbody>();
		}
		val2.isKinematic = true;
		val2.useGravity = false;
		val2.detectCollisions = true;
		val2.interpolation = (RigidbodyInterpolation)1;
		val2.mass = 1.5f;
		val2.collisionDetectionMode = (CollisionDetectionMode)3;
		hs.weaponRb = val2;
		hs.startSoundClip = component.chainsawStartSound;
		hs.stopSoundClip = component.chainsawStopSound;
		AudioClip chainsawIdle = component.chainsawIdle;
		AudioClip chainsawRevved = component.chainsawRevved;
		Il2CppArrayBase<AudioSource> components = val.GetComponents<AudioSource>();
		if (components != null)
		{
			foreach (AudioSource item2 in components)
			{
				if ((Object)(object)item2 != (Object)null)
				{
					try
					{
						item2.Stop();
					}
					catch
					{
					}
					try
					{
						((Behaviour)item2).enabled = false;
					}
					catch
					{
					}
				}
			}
		}
		if ((Object)(object)chainsawIdle != (Object)null)
		{
			hs.idleAudio = val.AddComponent<AudioSource>();
			hs.idleAudio.clip = chainsawIdle;
			hs.idleAudio.loop = true;
			hs.idleAudio.playOnAwake = false;
			hs.idleAudio.spatialBlend = 0.8f;
			hs.idleAudio.minDistance = 0.3f;
			hs.idleAudio.maxDistance = 20f;
			hs.idleAudio.rolloffMode = (AudioRolloffMode)1;
			hs.idleAudio.volume = 1f;
			hs.idleAudio.pitch = 1f;
			try
			{
				hs.idleAudio.Play();
			}
			catch
			{
			}
		}
		if ((Object)(object)chainsawRevved != (Object)null)
		{
			hs.revvedAudio = val.AddComponent<AudioSource>();
			hs.revvedAudio.clip = chainsawRevved;
			hs.revvedAudio.loop = true;
			hs.revvedAudio.playOnAwake = false;
			hs.revvedAudio.spatialBlend = 0.8f;
			hs.revvedAudio.minDistance = 0.3f;
			hs.revvedAudio.maxDistance = 20f;
			hs.revvedAudio.rolloffMode = (AudioRolloffMode)1;
			hs.revvedAudio.volume = 0f;
			hs.revvedAudio.pitch = 1f;
		}
		if ((Object)(object)hs.startSoundClip != (Object)null)
		{
			try
			{
				AudioSource.PlayClipAtPoint(hs.startSoundClip, val.transform.position, 1f);
			}
			catch
			{
			}
		}
		hs.weaponColliders.Clear();
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
		if (array != null)
		{
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				if ((Object)(object)val3 == (Object)null)
				{
					continue;
				}
				if (IsCuttingPart(((Component)val3).transform))
				{
					if (val3.enabled)
					{
						hs.weaponColliders.Add(val3);
					}
				}
				else
				{
					try
					{
						val3.enabled = false;
					}
					catch
					{
					}
				}
			}
		}
		Il2CppArrayBase<MeshRenderer> componentsInChildren2 = val.GetComponentsInChildren<MeshRenderer>(true);
		if (componentsInChildren2 != null)
		{
			foreach (MeshRenderer item3 in componentsInChildren2)
			{
				if ((Object)(object)item3 != (Object)null && !IsCuttingPart(((Component)item3).transform))
				{
					try
					{
						((Renderer)item3).enabled = false;
					}
					catch
					{
					}
				}
			}
		}
		DisableCollisionWithPlayer(hs);
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val4 = (hs.isLeftHand ? CHAINSAW_ROT_LEFT : CHAINSAW_ROT_RIGHT);
		Vector3 val5 = (hs.isLeftHand ? CHAINSAW_OFFSET_LEFT : CHAINSAW_OFFSET_RIGHT);
		Vector3 val6 = -transform.forward * 0.4f;
		Vector3 val7 = transform.position + transform.right * val5.x + transform.up * val5.y + transform.forward * val5.z;
		Quaternion val8 = transform.rotation * val4;
		val.transform.position = val7 + val6;
		val.transform.rotation = val8;
		hs.currentPos = val.transform.position;
		hs.currentRot = val8;
		val.SetActive(true);
		hs.weaponInstance = val;
		hs.currentType = WeaponType.Chainsaw;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": бензопила появляется.");
	}

	private void SpawnHammer(HandState hs)
	{
		//IL_0092: 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_0211: Unknown result type (might be due to invalid IL or missing references)
		//IL_021d: Unknown result type (might be due to invalid IL or missing references)
		//IL_022e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0227: Unknown result type (might be due to invalid IL or missing references)
		//IL_0233: Unknown result type (might be due to invalid IL or missing references)
		//IL_0236: 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_0245: Unknown result type (might be due to invalid IL or missing references)
		//IL_024a: Unknown result type (might be due to invalid IL or missing references)
		//IL_024d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0258: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_026f: Unknown result type (might be due to invalid IL or missing references)
		//IL_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)
		//IL_028d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0292: Unknown result type (might be due to invalid IL or missing references)
		//IL_0297: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029f: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02df: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)hammerPrefab == (Object)null)
		{
			FindHammerPrefab();
			if ((Object)(object)hammerPrefab == (Object)null)
			{
				return;
			}
		}
		GameObject val;
		try
		{
			val = Object.Instantiate<GameObject>(hammerPrefab);
		}
		catch
		{
			return;
		}
		((Object)val).name = "MahitoHammer_" + (hs.isLeftHand ? "L" : "R");
		val.transform.SetParent((Transform)null);
		val.transform.localScale = new Vector3(1f, 1f, 1f);
		DestroyComponentByName(val, "HVRTagSocketable");
		DestroyComponentByName(val, "HVRStringSocketable");
		DisableComponentByName(val, "HVRGrabbable");
		DisableComponentByName(val, "HVRGrabbableImpactHaptics");
		DisableComponentByName(val, "ImpactSlideAndRollTrigger3D");
		CutHammerHandleMesh(val);
		Rigidbody val2 = val.GetComponent<Rigidbody>();
		if ((Object)(object)val2 == (Object)null)
		{
			val2 = val.AddComponent<Rigidbody>();
		}
		val2.isKinematic = true;
		val2.useGravity = false;
		val2.detectCollisions = true;
		val2.interpolation = (RigidbodyInterpolation)1;
		val2.mass = 15f;
		val2.collisionDetectionMode = (CollisionDetectionMode)3;
		hs.weaponRb = val2;
		hs.weaponColliders.Clear();
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
		if (array != null)
		{
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				if ((Object)(object)val3 == (Object)null)
				{
					continue;
				}
				if (((Object)((Component)val3).gameObject).name.ToLower().Contains("handle"))
				{
					try
					{
						val3.enabled = false;
					}
					catch
					{
					}
				}
				else if (val3.enabled)
				{
					hs.weaponColliders.Add(val3);
				}
			}
		}
		DisableCollisionWithPlayer(hs);
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val4 = (hs.isLeftHand ? HAMMER_ROT_LEFT : HAMMER_ROT_RIGHT);
		Vector3 val5 = (hs.isLeftHand ? HAMMER_OFFSET_LEFT : HAMMER_OFFSET_RIGHT);
		Vector3 val6 = -transform.forward * 0.3f;
		Vector3 val7 = transform.position + transform.right * val5.x + transform.up * val5.y + transform.forward * val5.z;
		Quaternion val8 = transform.rotation * val4;
		val.transform.position = val7 + val6;
		val.transform.rotation = val8;
		hs.currentPos = val.transform.position;
		hs.currentRot = val8;
		val.SetActive(true);
		hs.weaponInstance = val;
		hs.currentType = WeaponType.Hammer;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": молот появляется.");
	}

	private void SpawnClaws(HandState hs)
	{
		//IL_004c: 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_0051: 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_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0072: Unknown result type (might be due to invalid IL or missing references)
		//IL_0077: Unknown result type (might be due to invalid IL or missing references)
		//IL_0125: 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_02ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b2: 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_02be: 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_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_0306: Unknown result type (might be due to invalid IL or missing references)
		//IL_030b: 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_0323: Unknown result type (might be due to invalid IL or missing references)
		//IL_0328: Unknown result type (might be due to invalid IL or missing references)
		//IL_032e: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_034a: Unknown result type (might be due to invalid IL or missing references)
		//IL_034d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_035c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0361: Unknown result type (might be due to invalid IL or missing references)
		//IL_0363: Unknown result type (might be due to invalid IL or missing references)
		//IL_0365: Unknown result type (might be due to invalid IL or missing references)
		//IL_0367: Unknown result type (might be due to invalid IL or missing references)
		//IL_036c: Unknown result type (might be due to invalid IL or missing references)
		//IL_036f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0374: Unknown result type (might be due to invalid IL or missing references)
		//IL_0375: 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_0383: 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_03dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_03de: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)katanaPrefab == (Object)null)
		{
			FindKatanaPrefab();
			if ((Object)(object)katanaPrefab == (Object)null)
			{
				return;
			}
		}
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val = (hs.isLeftHand ? CLAW_ROT_LEFT : CLAW_ROT_RIGHT);
		Vector3[] array = (Vector3[])(object)new Vector3[3] { CLAW_OFFSET_LEFT, CLAW_OFFSET_CENTER, CLAW_OFFSET_RIGHT };
		hs.clawInstances.Clear();
		hs.clawRbs.Clear();
		hs.weaponColliders.Clear();
		for (int i = 0; i < 3; i++)
		{
			GameObject val2 = Object.Instantiate<GameObject>(katanaPrefab);
			((Object)val2).name = $"MahitoClaw{i}_{(hs.isLeftHand ? "L" : "R")}";
			val2.transform.SetParent((Transform)null);
			val2.transform.localScale = Vector3.one * 0.6f;
			DestroyComponentByName(val2, "HVRTagSocketable");
			DestroyComponentByName(val2, "HVRStringSocketable");
			DisableComponentByName(val2, "HVRGrabbable");
			DisableComponentByName(val2, "HVRGrabbableImpactHaptics");
			CutMeshAtThreshold(val2, 0.35f);
			DisableHandleColliders(val2);
			Rigidbody val3 = val2.GetComponent<Rigidbody>();
			if ((Object)(object)val3 == (Object)null)
			{
				val3 = val2.AddComponent<Rigidbody>();
			}
			val3.isKinematic = true;
			val3.useGravity = false;
			val3.detectCollisions = true;
			val3.interpolation = (RigidbodyInterpolation)1;
			val3.mass = 1.5f;
			val3.drag = 0f;
			val3.angularDrag = 0f;
			val3.collisionDetectionMode = (CollisionDetectionMode)3;
			Collider[] array2 = Il2CppArrayBase<Collider>.op_Implicit(val2.GetComponentsInChildren<Collider>(true));
			if (array2 != null)
			{
				Collider[] array3 = array2;
				foreach (Collider val4 in array3)
				{
					if ((Object)(object)val4 != (Object)null && val4.enabled)
					{
						hs.weaponColliders.Add(val4);
					}
				}
			}
			SharpWeaponManager component = val2.GetComponent<SharpWeaponManager>();
			if ((Object)(object)component != (Object)null)
			{
				((Behaviour)component).enabled = true;
			}
			float num = (hs.isLeftHand ? (0f - CLAW_BASE_OFFSET.x) : CLAW_BASE_OFFSET.x);
			float y = CLAW_BASE_OFFSET.y;
			Vector3 val5 = transform.position + transform.right * num + transform.up * y + transform.forward * CLAW_BASE_OFFSET.z;
			Vector3 val6 = val5 + transform.right * array[i].x + transform.up * array[i].y + transform.forward * array[i].z;
			Vector3 val7 = -transform.forward * 0.35f;
			Vector3 val8 = val6 + val7;
			Quaternion val9 = transform.rotation * val;
			val2.transform.position = val8;
			val2.transform.rotation = val9;
			val2.SetActive(true);
			hs.clawInstances.Add(val2);
			hs.clawRbs.Add(val3);
			if (i == 0)
			{
				hs.weaponInstance = val2;
				hs.weaponRb = val3;
				hs.currentPos = val8;
				hs.currentRot = val9;
			}
		}
		DisableCollisionWithPlayer(hs);
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		hs.currentType = WeaponType.Claws;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg($"[Mahito] {(hs.isLeftHand ? "Левая" : "Правая")}: когти росомахи (3 лезвия, scale={0.6f}).");
	}

	private void SpawnAssassinBlade(HandState hs)
	{
		//IL_004e: 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_0053: 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_00d1: 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_00f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0242: Unknown result type (might be due to invalid IL or missing references)
		//IL_0248: Unknown result type (might be due to invalid IL or missing references)
		//IL_024e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0253: Unknown result type (might be due to invalid IL or missing references)
		//IL_0259: Unknown result type (might be due to invalid IL or missing references)
		//IL_025f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_026a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0279: Unknown result type (might be due to invalid IL or missing references)
		//IL_027e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0283: 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)
		//IL_028b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0295: Unknown result type (might be due to invalid IL or missing references)
		//IL_029a: Unknown result type (might be due to invalid IL or missing references)
		//IL_029c: Unknown result type (might be due to invalid IL or missing references)
		//IL_029e: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
		//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)zweihanderPrefab == (Object)null)
		{
			FindZweihanderPrefab();
			if ((Object)(object)zweihanderPrefab == (Object)null)
			{
				return;
			}
		}
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val = (hs.isLeftHand ? ASSASSIN_ROT_LEFT : ASSASSIN_ROT_RIGHT);
		float num = (hs.isLeftHand ? (0f - ASSASSIN_OFFSET.x) : ASSASSIN_OFFSET.x);
		float y = ASSASSIN_OFFSET.y;
		GameObject val2 = Object.Instantiate<GameObject>(zweihanderPrefab);
		((Object)val2).name = "MahitoAssassinBlade_" + (hs.isLeftHand ? "L" : "R");
		val2.transform.SetParent((Transform)null);
		val2.transform.localScale = Vector3.one * 1f;
		val2.transform.position = Vector3.zero;
		val2.transform.rotation = Quaternion.identity;
		DestroyComponentByName(val2, "HVRTagSocketable");
		DestroyComponentByName(val2, "HVRStringSocketable");
		DisableComponentByName(val2, "HVRGrabbable");
		DisableComponentByName(val2, "HVRGrabbableImpactHaptics");
		int cutAxis;
		float cutValue = CutAssassinBladeFromHandleToTip(val2, out cutAxis);
		DisableAssassinHiddenParts(val2, cutValue, cutAxis, removeBelow: true);
		Rigidbody val3 = val2.GetComponent<Rigidbody>();
		if ((Object)(object)val3 == (Object)null)
		{
			val3 = val2.AddComponent<Rigidbody>();
		}
		val3.isKinematic = true;
		val3.useGravity = false;
		val3.detectCollisions = true;
		val3.interpolation = (RigidbodyInterpolation)1;
		val3.mass = 3f;
		val3.collisionDetectionMode = (CollisionDetectionMode)3;
		hs.weaponRb = val3;
		hs.weaponColliders.Clear();
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val2.GetComponentsInChildren<Collider>(true));
		if (array != null)
		{
			Collider[] array2 = array;
			foreach (Collider val4 in array2)
			{
				if ((Object)(object)val4 != (Object)null && val4.enabled)
				{
					hs.weaponColliders.Add(val4);
				}
			}
		}
		SharpWeaponManager component = val2.GetComponent<SharpWeaponManager>();
		if ((Object)(object)component != (Object)null)
		{
			((Behaviour)component).enabled = true;
		}
		Vector3 val5 = transform.position + transform.right * num + transform.up * y + transform.forward * ASSASSIN_OFFSET.z;
		Vector3 val6 = -transform.forward * 0.35f;
		Vector3 val7 = val5 + val6;
		Quaternion val8 = transform.rotation * val;
		val2.transform.position = val7;
		val2.transform.rotation = val8;
		val2.SetActive(true);
		hs.weaponInstance = val2;
		hs.weaponRb = val3;
		hs.currentPos = val7;
		hs.currentRot = val8;
		hs.currentType = WeaponType.AssassinBlade;
		DisableCollisionWithPlayer(hs);
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": клинок ассасина появляется.");
	}

	private void SpawnCrowbar(HandState hs)
	{
		//IL_004e: 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_0053: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: 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_007b: 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_0086: 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_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_00a6: 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_00ba: 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_00c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: 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_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_00f5: 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_03a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_03af: 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_0145: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)crowbarPrefab == (Object)null)
		{
			FindCrowbarPrefab();
			if ((Object)(object)crowbarPrefab == (Object)null)
			{
				return;
			}
		}
		Transform transform = ((Component)hs.hand).transform;
		Quaternion val = (hs.isLeftHand ? CROWBAR_ROT_LEFT : CROWBAR_ROT_RIGHT);
		float num = (hs.isLeftHand ? (0f - CROWBAR_OFFSET.x) : CROWBAR_OFFSET.x);
		Vector3 val2 = transform.position + transform.right * num + transform.up * CROWBAR_OFFSET.y + transform.forward * CROWBAR_OFFSET.z;
		Quaternion val3 = transform.rotation * val;
		Vector3 val4 = -transform.forward * 0.55f;
		Vector3 val5 = val2 + val4;
		GameObject val6 = Object.Instantiate<GameObject>(crowbarPrefab, val5, val3);
		((Object)val6).name = "MahitoCrowbar_" + (hs.isLeftHand ? "L" : "R");
		val6.transform.SetParent((Transform)null);
		val6.transform.localScale = Vector3.one * 1f;
		DestroyComponentByName(val6, "HVRTagSocketable");
		DestroyComponentByName(val6, "HVRStringSocketable");
		DestroyComponentByName(val6, "HVRGrabbable");
		DisableComponentByName(val6, "HVRGrabbableImpactHaptics");
		DisableComponentByName(val6, "ImpactObjectRigidbody");
		DisableComponentByName(val6, "ImpactCollisionTrigger3D");
		DisableComponentByName(val6, "ImpactSlideAndRollTrigger3D");
		Transform val7 = val6.transform.Find("GrabPoints");
		if ((Object)(object)val7 != (Object)null)
		{
			try
			{
				Object.Destroy((Object)(object)((Component)val7).gameObject);
			}
			catch
			{
			}
		}
		DestroyComponentByNameRecursive(val6, "HVRGrabbableChild");
		DestroyComponentByNameRecursive(val6, "HVRGrabPoints");
		DestroyComponentByNameRecursive(val6, "HVRHandPoser");
		DestroyComponentByNameRecursive(val6, "HVRPosableGrabPoint");
		Transform val8 = val6.transform.Find("Plane");
		if ((Object)(object)val8 != (Object)null)
		{
			Renderer component = ((Component)val8).GetComponent<Renderer>();
			if ((Object)(object)component != (Object)null)
			{
				component.enabled = false;
			}
		}
		Rigidbody val9 = val6.GetComponent<Rigidbody>();
		if ((Object)(object)val9 == (Object)null)
		{
			val9 = val6.AddComponent<Rigidbody>();
		}
		val9.isKinematic = true;
		val9.useGravity = false;
		val9.mass = 1.75f;
		val9.detectCollisions = true;
		val9.interpolation = (RigidbodyInterpolation)1;
		val9.collisionDetectionMode = (CollisionDetectionMode)2;
		val9.velocity = Vector3.zero;
		val9.angularVelocity = Vector3.zero;
		hs.weaponRb = val9;
		hs.weaponColliders.Clear();
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val6.GetComponentsInChildren<Collider>(true));
		if (array != null)
		{
			Collider[] array2 = array;
			foreach (Collider val10 in array2)
			{
				if ((Object)(object)val10 != (Object)null && val10.enabled)
				{
					hs.weaponColliders.Add(val10);
				}
			}
		}
		SharpWeaponManager component2 = val6.GetComponent<SharpWeaponManager>();
		if ((Object)(object)component2 != (Object)null)
		{
			((Behaviour)component2).enabled = true;
		}
		BluntForceManager component3 = val6.GetComponent<BluntForceManager>();
		if ((Object)(object)component3 != (Object)null)
		{
			((Behaviour)component3).enabled = true;
		}
		hs.crowbarJoint = null;
		DisableCollisionWithPlayer(hs);
		hs.weaponInstance = val6;
		hs.currentPos = val5;
		hs.currentRot = val3;
		hs.currentType = WeaponType.Crowbar;
		hs.deployState = DeployState.Deploying;
		hs.deployProgress = 0f;
		hs.wasTrigger = false;
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": Crowbar Hook выезжает из руки.");
	}

	private void CreateCrowbarJoint(HandState hs, Vector3 attachWorldPos)
	{
		//IL_0084: 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_0092: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e5: 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_010f: 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_0167: Unknown result type (might be due to invalid IL or missing references)
		//IL_0171: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: 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_01c6: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)hs.weaponInstance == (Object)null) && !((Object)(object)hs.hand == (Object)null))
		{
			Transform transform = ((Component)hs.hand).transform;
			Rigidbody component = ((Component)transform).GetComponent<Rigidbody>();
			if ((Object)(object)component == (Object)null)
			{
				((MelonBase)this).LoggerInstance.Msg("[Mahito] Crowbar: Rigidbody руки не найден!");
				return;
			}
			ConfigurableJoint val = hs.weaponInstance.AddComponent<ConfigurableJoint>();
			((Joint)val).connectedBody = component;
			((Joint)val).anchor = new Vector3(0f, -0.25f, 0f);
			((Joint)val).connectedAnchor = transform.InverseTransformPoint(attachWorldPos);
			val.xMotion = (ConfigurableJointMotion)1;
			val.yMotion = (ConfigurableJointMotion)1;
			val.zMotion = (ConfigurableJointMotion)1;
			SoftJointLimit linearLimit = default(SoftJointLimit);
			((SoftJointLimit)(ref linearLimit)).limit = 0.06f;
			((SoftJointLimit)(ref linearLimit)).bounciness = 0f;
			((SoftJointLimit)(ref linearLimit)).contactDistance = 0.005f;
			val.linearLimit = linearLimit;
			SoftJointLimitSpring linearLimitSpring = default(SoftJointLimitSpring);
			((SoftJointLimitSpring)(ref linearLimitSpring)).spring = 8000f;
			((SoftJointLimitSpring)(ref linearLimitSpring)).damper = 120f;
			val.linearLimitSpring = linearLimitSpring;
			val.angularXMotion = (ConfigurableJointMotion)2;
			val.angularYMotion = (ConfigurableJointMotion)2;
			val.angularZMotion = (ConfigurableJointMotion)2;
			val.rotationDriveMode = (RotationDriveMode)1;
			JointDrive slerpDrive = default(JointDrive);
			((JointDrive)(ref slerpDrive)).positionSpring = 5000f;
			((JointDrive)(ref slerpDrive)).positionDamper = 80f;
			((JointDrive)(ref slerpDrive)).maximumForce = 15000f;
			val.slerpDrive = slerpDrive;
			JointDrive val2 = default(JointDrive);
			((JointDrive)(ref val2)).positionSpring = 8000f;
			((JointDrive)(ref val2)).positionDamper = 120f;
			((JointDrive)(ref val2)).maximumForce = 20000f;
			val.xDrive = val2;
			val.yDrive = val2;
			val.zDrive = val2;
			val.targetPosition = Vector3.zero;
			val.targetRotation = Quaternion.identity;
			((Joint)val).breakForce = float.PositiveInfinity;
			((Joint)val).breakTorque = float.PositiveInfinity;
			hs.crowbarJoint = val;
		}
	}

	private void UpdateWeaponPosition(HandState hs)
	{
		//IL_040d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0412: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f1: Unknown result type (might be due to invalid IL or missing references)
		//IL_04f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0530: Unknown result type (might be due to invalid IL or missing references)
		//IL_0535: Unknown result type (might be due to invalid IL or missing references)
		//IL_0423: Unknown result type (might be due to invalid IL or missing references)
		//IL_041c: Unknown result type (might be due to invalid IL or missing references)
		//IL_045e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0457: Unknown result type (might be due to invalid IL or missing references)
		//IL_04af: Unknown result type (might be due to invalid IL or missing references)
		//IL_04a8: 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_0500: Unknown result type (might be due to invalid IL or missing references)
		//IL_0546: Unknown result type (might be due to invalid IL or missing references)
		//IL_053f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0428: Unknown result type (might be due to invalid IL or missing references)
		//IL_0463: Unknown result type (might be due to invalid IL or missing references)
		//IL_04b4: 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_054b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0127: Unknown result type (might be due to invalid IL or missing references)
		//IL_0120: Unknown result type (might be due to invalid IL or missing references)
		//IL_0474: Unknown result type (might be due to invalid IL or missing references)
		//IL_046d: Unknown result type (might be due to invalid IL or missing references)
		//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_04be: 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_0479: Unknown result type (might be due to invalid IL or missing references)
		//IL_04ca: 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_0158: Unknown result type (might be due to invalid IL or missing references)
		//IL_015f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0164: Unknown result type (might be due to invalid IL or missing references)
		//IL_016b: 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_0186: Unknown result type (might be due to invalid IL or missing references)
		//IL_0195: Unknown result type (might be due to invalid IL or missing references)
		//IL_019a: Unknown result type (might be due to invalid IL or missing references)
		//IL_019f: 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_01a8: 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_01af: Unknown result type (might be due to invalid IL or missing references)
		//IL_08e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_0639: Unknown result type (might be due to invalid IL or missing references)
		//IL_063e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0645: Unknown result type (might be due to invalid IL or missing references)
		//IL_064a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0651: Unknown result type (might be due to invalid IL or missing references)
		//IL_0656: Unknown result type (might be due to invalid IL or missing references)
		//IL_065f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0664: Unknown result type (might be due to invalid IL or missing references)
		//IL_0666: Unknown result type (might be due to invalid IL or missing references)
		//IL_066b: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ba: 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_02c1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
		//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
		//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_02dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
		//IL_02e9: 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_01f5: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
		//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
		//IL_0209: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0246: Unknown result type (might be due to invalid IL or missing references)
		//IL_0257: Unknown result type (might be due to invalid IL or missing references)
		//IL_0264: Unknown result type (might be due to invalid IL or missing references)
		//IL_0333: Unknown result type (might be due to invalid IL or missing references)
		//IL_0335: Unknown result type (might be due to invalid IL or missing references)
		//IL_033b: 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_034a: Unknown result type (might be due to invalid IL or missing references)
		//IL_034f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0352: Unknown result type (might be due to invalid IL or missing references)
		//IL_0357: Unknown result type (might be due to invalid IL or missing references)
		//IL_0309: Unknown result type (might be due to invalid IL or missing references)
		//IL_030e: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_031b: Unknown result type (might be due to invalid IL or missing references)
		//IL_031f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0326: Unknown result type (might be due to invalid IL or missing references)
		//IL_032b: 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_0388: Unknown result type (might be due to invalid IL or missing references)
		//IL_038a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0396: Unknown result type (might be due to invalid IL or missing references)
		//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
		//IL_0377: Unknown result type (might be due to invalid IL or missing references)
		//IL_037c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0380: Unknown result type (might be due to invalid IL or missing references)
		//IL_0385: Unknown result type (might be due to invalid IL or missing references)
		//IL_0917: Unknown result type (might be due to invalid IL or missing references)
		//IL_091e: 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_092a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0931: Unknown result type (might be due to invalid IL or missing references)
		//IL_0936: Unknown result type (might be due to invalid IL or missing references)
		//IL_093d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0942: Unknown result type (might be due to invalid IL or missing references)
		//IL_0949: Unknown result type (might be due to invalid IL or missing references)
		//IL_094e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0955: Unknown result type (might be due to invalid IL or missing references)
		//IL_095a: Unknown result type (might be due to invalid IL or missing references)
		//IL_095f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0963: Unknown result type (might be due to invalid IL or missing references)
		//IL_0968: Unknown result type (might be due to invalid IL or missing references)
		//IL_096a: Unknown result type (might be due to invalid IL or missing references)
		//IL_096f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0973: Unknown result type (might be due to invalid IL or missing references)
		//IL_0978: Unknown result type (might be due to invalid IL or missing references)
		//IL_0988: Unknown result type (might be due to invalid IL or missing references)
		//IL_098d: Unknown result type (might be due to invalid IL or missing references)
		//IL_098f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0991: Unknown result type (might be due to invalid IL or missing references)
		//IL_0993: Unknown result type (might be due to invalid IL or missing references)
		//IL_0998: Unknown result type (might be due to invalid IL or missing references)
		//IL_099b: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_09a5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ad: Unknown result type (might be due to invalid IL or missing references)
		//IL_09b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09f7: 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_09ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a04: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a09: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a0e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a11: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a16: Unknown result type (might be due to invalid IL or missing references)
		//IL_09cd: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d2: Unknown result type (might be due to invalid IL or missing references)
		//IL_09d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_09da: Unknown result type (might be due to invalid IL or missing references)
		//IL_09df: Unknown result type (might be due to invalid IL or missing references)
		//IL_09e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ea: Unknown result type (might be due to invalid IL or missing references)
		//IL_09ef: 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_0a42: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a44: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a50: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a62: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a31: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0a3f: Unknown result type (might be due to invalid IL or missing references)
		//IL_06ea: 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_06f8: 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_0704: Unknown result type (might be due to invalid IL or missing references)
		//IL_070b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0710: Unknown result type (might be due to invalid IL or missing references)
		//IL_0717: Unknown result type (might be due to invalid IL or missing references)
		//IL_0726: 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_0730: Unknown result type (might be due to invalid IL or missing references)
		//IL_0732: Unknown result type (might be due to invalid IL or missing references)
		//IL_0736: Unknown result type (might be due to invalid IL or missing references)
		//IL_0749: Unknown result type (might be due to invalid IL or missing references)
		//IL_074e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0755: Unknown result type (might be due to invalid IL or missing references)
		//IL_0768: Unknown result type (might be due to invalid IL or missing references)
		//IL_076d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0774: Unknown result type (might be due to invalid IL or missing references)
		//IL_0787: Unknown result type (might be due to invalid IL or missing references)
		//IL_078c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0791: Unknown result type (might be due to invalid IL or missing references)
		//IL_0795: Unknown result type (might be due to invalid IL or missing references)
		//IL_079a: Unknown result type (might be due to invalid IL or missing references)
		//IL_07aa: Unknown result type (might be due to invalid IL or missing references)
		//IL_07af: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_07d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e1: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0833: Unknown result type (might be due to invalid IL or missing references)
		//IL_0838: Unknown result type (might be due to invalid IL or missing references)
		//IL_083d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0842: Unknown result type (might be due to invalid IL or missing references)
		//IL_0856: Unknown result type (might be due to invalid IL or missing references)
		//IL_085b: Unknown result type (might be due to invalid IL or missing references)
		//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
		//IL_0801: Unknown result type (might be due to invalid IL or missing references)
		//IL_0803: Unknown result type (might be due to invalid IL or missing references)
		//IL_0805: Unknown result type (might be due to invalid IL or missing references)
		//IL_080a: Unknown result type (might be due to invalid IL or missing references)
		//IL_080e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0815: Unknown result type (might be due to invalid IL or missing references)
		//IL_081a: Unknown result type (might be due to invalid IL or missing references)
		//IL_081f: Unknown result type (might be due to invalid IL or missing references)
		//IL_08a4: Unknown result type (might be due to invalid IL or missing references)
		//IL_08b9: Unknown result type (might be due to invalid IL or missing references)
		//IL_0887: Unknown result type (might be due to invalid IL or missing references)
		//IL_088c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0890: Unknown result type (might be due to invalid IL or missing references)
		//IL_0895: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)hs.hand == (Object)null)
		{
			DestroyWeapon(hs);
			return;
		}
		if (hs.currentType == WeaponType.Claws && hs.clawInstances.Count == 0)
		{
			DestroyWeapon(hs);
			return;
		}
		if (hs.currentType != WeaponType.Claws && hs.currentType != WeaponType.Crowbar && ((Object)(object)hs.weaponInstance == (Object)null || (Object)(object)hs.weaponRb == (Object)null))
		{
			DestroyWeapon(hs);
			return;
		}
		if (hs.currentType == WeaponType.Crowbar && (Object)(object)hs.weaponInstance == (Object)null)
		{
			DestroyWeapon(hs);
			return;
		}
		Vector3 val7;
		if (hs.currentType == WeaponType.Crowbar)
		{
			if (hs.deployState == DeployState.Retracting)
			{
				DestroyWeapon(hs);
			}
			else
			{
				if (hs.deployState != DeployState.Deploying)
				{
					return;
				}
				float fixedDeltaTime = Time.fixedDeltaTime;
				Transform transform = ((Component)hs.hand).transform;
				Quaternion val = (hs.isLeftHand ? CROWBAR_ROT_LEFT : CROWBAR_ROT_RIGHT);
				float num = (hs.isLeftHand ? (0f - CROWBAR_OFFSET.x) : CROWBAR_OFFSET.x);
				Vector3 val2 = transform.position + transform.right * num + transform.up * CROWBAR_OFFSET.y + transform.forward * CROWBAR_OFFSET.z;
				Quaternion val3 = transform.rotation * val;
				hs.deployProgress += fixedDeltaTime / 0.1f;
				if (hs.deployProgress >= 1f)
				{
					hs.deployProgress = 1f;
					hs.deployState = DeployState.Deployed;
					hs.currentPos = val2;
					hs.currentRot = val3;
					hs.weaponRb.MovePosition(hs.currentPos);
					hs.weaponRb.MoveRotation(hs.currentRot);
					hs.weaponRb.isKinematic = false;
					hs.weaponRb.useGravity = true;
					hs.weaponRb.velocity = Vector3.zero;
					hs.weaponRb.angularVelocity = Vector3.zero;
					CreateCrowbarJoint(hs, val2);
					((MelonBase)this).LoggerInstance.Msg("[Mahito] Crowbar зафиксирован.");
					return;
				}
				float deployProgress = hs.deployProgress;
				float num2 = deployProgress * deployProgress * (3f - 2f * deployProgress);
				Vector3 val4 = -transform.forward * (0.55f * (1f - num2));
				Vector3 val5 = val2 + val4;
				Vector3 val6 = Vector3.Lerp(hs.currentPos, val5, 120f * fixedDeltaTime);
				float num3 = Vector3.Distance(hs.currentPos, val6);
				float num4 = 120f * fixedDeltaTime;
				if (num3 > num4)
				{
					Vector3 currentPos = hs.currentPos;
					val7 = val6 - hs.currentPos;
					val6 = currentPos + ((Vector3)(ref val7)).normalized * num4;
				}
				hs.currentPos = val6;
				Quaternion val8 = Quaternion.Slerp(hs.currentRot, val3, 120f * fixedDeltaTime);
				float num5 = Quaternion.Angle(hs.currentRot, val8);
				float num6 = 5000f * fixedDeltaTime;
				if (num5 > num6)
				{
					val8 = Quaternion.RotateTowards(hs.currentRot, val8, num6);
				}
				hs.currentRot = val8;
				hs.weaponRb.MovePosition(hs.currentPos);
				hs.weaponRb.MoveRotation(hs.currentRot);
			}
			return;
		}
		float fixedDeltaTime2 = Time.fixedDeltaTime;
		float num7;
		float num8;
		float num9;
		float num10;
		float num11;
		Vector3 val9;
		Quaternion val10;
		switch (hs.currentType)
		{
		default:
			return;
		case WeaponType.Blade:
			num7 = 50f;
			num8 = 50f;
			num9 = 3600f;
			num10 = 0.5f;
			num11 = 0.1f;
			val9 = GRIP_OFFSET;
			val10 = (hs.isLeftHand ? GRIP_ROT_LEFT : GRIP_ROT_RIGHT);
			break;
		case WeaponType.Chainsaw:
			num7 = 84f;
			num8 = 84f;
			num9 = 5400f;
			num10 = 0.4f;
			num11 = 0.15f;
			val9 = (hs.isLeftHand ? CHAINSAW_OFFSET_LEFT : CHAINSAW_OFFSET_RIGHT);
			val10 = (hs.isLeftHand ? CHAINSAW_ROT_LEFT : CHAINSAW_ROT_RIGHT);
			break;
		case WeaponType.Hammer:
			num7 = 250f;
			num8 = 250f;
			num9 = 7200f;
			num10 = 0.3f;
			num11 = 0.25f;
			val9 = (hs.isLeftHand ? HAMMER_OFFSET_LEFT : HAMMER_OFFSET_RIGHT);
			val10 = (hs.isLeftHand ? HAMMER_ROT_LEFT : HAMMER_ROT_RIGHT);
			break;
		case WeaponType.Claws:
			num7 = 200f;
			num8 = 200f;
			num9 = 10000f;
			num10 = 0.35f;
			num11 = 0.12f;
			val9 = CLAW_BASE_OFFSET;
			val10 = (hs.isLeftHand ? CLAW_ROT_LEFT : CLAW_ROT_RIGHT);
			break;
		case WeaponType.AssassinBlade:
			num7 = 400f;
			num8 = 400f;
			num9 = 10000f;
			num10 = 0.35f;
			num11 = 0.12f;
			val9 = ASSASSIN_OFFSET;
			val10 = (hs.isLeftHand ? ASSASSIN_ROT_LEFT : ASSASSIN_ROT_RIGHT);
			break;
		}
		Transform transform2 = ((Component)hs.hand).transform;
		if (hs.deployState == DeployState.Deploying)
		{
			hs.deployProgress += fixedDeltaTime2 / num11;
			if (hs.deployProgress >= 1f)
			{
				hs.deployProgress = 1f;
				hs.deployState = DeployState.Deployed;
			}
		}
		else if (hs.deployState == DeployState.Retracting)
		{
			hs.deployProgress -= fixedDeltaTime2 / num11;
			if (hs.deployProgress <= 0f)
			{
				hs.deployProgress = 0f;
				DestroyWeapon(hs);
				return;
			}
		}
		float deployProgress2 = hs.deployProgress;
		float num12 = deployProgress2 * deployProgress2 * (3f - 2f * deployProgress2);
		if (hs.currentType == WeaponType.Claws)
		{
			Vector3[] array = (Vector3[])(object)new Vector3[3] { CLAW_OFFSET_LEFT, CLAW_OFFSET_CENTER, CLAW_OFFSET_RIGHT };
			Quaternion val11 = transform2.rotation * val10;
			float num13 = (hs.isLeftHand ? (0f - CLAW_BASE_OFFSET.x) : CLAW_BASE_OFFSET.x);
			float y = CLAW_BASE_OFFSET.y;
			for (int i = 0; i < hs.clawInstances.Count; i++)
			{
				if (i < hs.clawRbs.Count && !((Object)(object)hs.clawInstances[i] == (Object)null) && !((Object)(object)hs.clawRbs[i] == (Object)null))
				{
					Vector3 val12 = transform2.position + transform2.right * num13 + transform2.up * y + transform2.forward * CLAW_BASE_OFFSET.z;
					Vector3 val13 = val12 + transform2.right * array[i].x + transform2.up * array[i].y + transform2.forward * array[i].z;
					Vector3 val14 = -transform2.forward * (num10 * (1f - num12));
					Vector3 val15 = val13 + val14;
					Vector3 position = hs.clawInstances[i].transform.position;
					Vector3 val16 = Vector3.Lerp(position, val15, num7 * fixedDeltaTime2);
					float num14 = Vector3.Distance(position, val16);
					float num15 = num8 * fixedDeltaTime2;
					if (num14 > num15)
					{
						val7 = val16 - position;
						val16 = position + ((Vector3)(ref val7)).normalized * num15;
					}
					Quaternion val17 = Quaternion.Slerp(hs.clawInstances[i].transform.rotation, val11, num7 * fixedDeltaTime2);
					float num16 = Quaternion.Angle(hs.clawInstances[i].transform.rotation, val17);
					float num17 = num9 * fixedDeltaTime2;
					if (num16 > num17)
					{
						val17 = Quaternion.RotateTowards(hs.clawInstances[i].transform.rotation, val17, num17);
					}
					hs.clawRbs[i].MovePosition(val16);
					hs.clawRbs[i].MoveRotation(val17);
				}
			}
		}
		else
		{
			float num18 = val9.x;
			if (hs.currentType == WeaponType.AssassinBlade && hs.isLeftHand)
			{
				num18 = 0f - ASSASSIN_OFFSET.x;
			}
			Vector3 val18 = transform2.position + transform2.right * num18 + transform2.up * val9.y + transform2.forward * val9.z;
			Quaternion val19 = transform2.rotation * val10;
			Vector3 val20 = -transform2.forward * (num10 * (1f - num12));
			Vector3 val21 = val18 + val20;
			Vector3 val22 = Vector3.Lerp(hs.currentPos, val21, num7 * fixedDeltaTime2);
			float num19 = Vector3.Distance(hs.currentPos, val22);
			float num20 = num8 * fixedDeltaTime2;
			if (num19 > num20)
			{
				Vector3 currentPos2 = hs.currentPos;
				val7 = val22 - hs.currentPos;
				val22 = currentPos2 + ((Vector3)(ref val7)).normalized * num20;
			}
			hs.currentPos = val22;
			Quaternion val23 = Quaternion.Slerp(hs.currentRot, val19, num7 * fixedDeltaTime2);
			float num21 = Quaternion.Angle(hs.currentRot, val23);
			float num22 = num9 * fixedDeltaTime2;
			if (num21 > num22)
			{
				val23 = Quaternion.RotateTowards(hs.currentRot, val23, num22);
			}
			hs.currentRot = val23;
			hs.weaponRb.MovePosition(hs.currentPos);
			hs.weaponRb.MoveRotation(hs.currentRot);
		}
	}

	private void DestroyWeapon(HandState hs)
	{
		//IL_0045: Unknown result type (might be due to invalid IL or missing references)
		if (hs.currentType == WeaponType.Chainsaw)
		{
			if ((Object)(object)hs.stopSoundClip != (Object)null && (Object)(object)hs.weaponInstance != (Object)null)
			{
				try
				{
					AudioSource.PlayClipAtPoint(hs.stopSoundClip, hs.weaponInstance.transform.position, 1f);
				}
				catch
				{
				}
			}
			if ((Object)(object)hs.idleAudio != (Object)null)
			{
				try
				{
					hs.idleAudio.Stop();
				}
				catch
				{
				}
			}
			if ((Object)(object)hs.revvedAudio != (Object)null)
			{
				try
				{
					hs.revvedAudio.Stop();
				}
				catch
				{
				}
			}
			if ((Object)(object)hs.chainsawManager != (Object)null)
			{
				try
				{
					hs.chainsawManager.StopChainsaw();
					hs.chainsawManager.isRevved = false;
				}
				catch
				{
				}
			}
		}
		if ((Object)(object)hs.crowbarJoint != (Object)null)
		{
			try
			{
				Object.Destroy((Object)(object)hs.crowbarJoint);
			}
			catch
			{
			}
			hs.crowbarJoint = null;
		}
		if ((Object)(object)hs.weaponRb != (Object)null && hs.currentType == WeaponType.Crowbar)
		{
			try
			{
				hs.weaponRb.isKinematic = true;
			}
			catch
			{
			}
		}
		if (hs.weaponColliders.Count > 0)
		{
			GameObject val = GameObject.Find("Hexa4Rig26.10.23");
			if ((Object)(object)val != (Object)null)
			{
				Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
				if (array != null)
				{
					foreach (Collider weaponCollider in hs.weaponColliders)
					{
						if ((Object)(object)weaponCollider == (Object)null)
						{
							continue;
						}
						Collider[] array2 = array;
						foreach (Collider val2 in array2)
						{
							if (!((Object)(object)val2 == (Object)null))
							{
								try
								{
									Physics.IgnoreCollision(weaponCollider, val2, false);
								}
								catch
								{
								}
							}
						}
					}
				}
			}
		}
		if ((Object)(object)hs.weaponInstance != (Object)null && hs.currentType != WeaponType.Claws)
		{
			Object.Destroy((Object)(object)hs.weaponInstance);
		}
		if (hs.currentType == WeaponType.Claws)
		{
			for (int j = 0; j < hs.clawInstances.Count; j++)
			{
				if ((Object)(object)hs.clawInstances[j] != (Object)null)
				{
					Object.Destroy((Object)(object)hs.clawInstances[j]);
				}
			}
		}
		hs.ClearWeapon();
		((MelonBase)this).LoggerInstance.Msg("[Mahito] " + (hs.isLeftHand ? "Левая" : "Правая") + ": оружие убрано.");
	}

	private void DestroyComponentByName(GameObject obj, string componentName)
	{
		try
		{
			Il2CppArrayBase<Component> components = obj.GetComponents<Component>();
			if (components == null)
			{
				return;
			}
			foreach (Component item in components)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string text = "";
				try
				{
					Type il2CppType = ((Object)item).GetIl2CppType();
					text = ((il2CppType != null) ? ((MemberInfo)il2CppType).Name : null) ?? ((object)item).GetType().Name;
				}
				catch
				{
				}
				if (text == componentName)
				{
					try
					{
						Object.Destroy((Object)(object)item);
					}
					catch
					{
					}
				}
			}
		}
		catch
		{
		}
	}

	private void DestroyComponentByNameRecursive(GameObject obj, string componentName)
	{
		try
		{
			Il2CppArrayBase<Component> components = obj.GetComponents<Component>();
			if (components != null)
			{
				foreach (Component item in components)
				{
					if ((Object)(object)item == (Object)null)
					{
						continue;
					}
					string text = "";
					try
					{
						Type il2CppType = ((Object)item).GetIl2CppType();
						text = ((il2CppType != null) ? ((MemberInfo)il2CppType).Name : null) ?? ((object)item).GetType().Name;
					}
					catch
					{
					}
					if (text == componentName)
					{
						try
						{
							Object.Destroy((Object)(object)item);
						}
						catch
						{
						}
					}
				}
			}
			for (int i = 0; i < obj.transform.childCount; i++)
			{
				DestroyComponentByNameRecursive(((Component)obj.transform.GetChild(i)).gameObject, componentName);
			}
		}
		catch
		{
		}
	}

	private void DisableComponentByName(GameObject obj, string componentName)
	{
		try
		{
			Il2CppArrayBase<Component> components = obj.GetComponents<Component>();
			if (components == null)
			{
				return;
			}
			foreach (Component item in components)
			{
				if ((Object)(object)item == (Object)null)
				{
					continue;
				}
				string text = "";
				try
				{
					Type il2CppType = ((Object)item).GetIl2CppType();
					text = ((il2CppType != null) ? ((MemberInfo)il2CppType).Name : null) ?? ((object)item).GetType().Name;
				}
				catch
				{
				}
				if (!(text == componentName))
				{
					continue;
				}
				try
				{
					PropertyInfo property = ((object)item).GetType().GetProperty("enabled");
					if (property != null && property.CanWrite)
					{
						property.SetValue(item, false);
					}
				}
				catch
				{
				}
			}
		}
		catch
		{
		}
	}

	private void DisableCollisionWithPlayer(HandState hs)
	{
		if (hs.weaponColliders.Count == 0)
		{
			return;
		}
		GameObject val = GameObject.Find("Hexa4Rig26.10.23");
		if ((Object)(object)val == (Object)null)
		{
			return;
		}
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
		if (array == null)
		{
			return;
		}
		foreach (Collider weaponCollider in hs.weaponColliders)
		{
			if ((Object)(object)weaponCollider == (Object)null)
			{
				continue;
			}
			Collider[] array2 = array;
			foreach (Collider val2 in array2)
			{
				if (!((Object)(object)val2 == (Object)null))
				{
					try
					{
						Physics.IgnoreCollision(weaponCollider, val2, true);
					}
					catch
					{
					}
				}
			}
		}
	}

	private void DisableCollisionWithPlayerExceptHand(HandState hs)
	{
		if (hs.weaponColliders.Count == 0)
		{
			return;
		}
		GameObject val = GameObject.Find("Hexa4Rig26.10.23");
		if ((Object)(object)val == (Object)null)
		{
			return;
		}
		Collider[] array = Il2CppArrayBase<Collider>.op_Implicit(val.GetComponentsInChildren<Collider>(true));
		if (array == null)
		{
			return;
		}
		Transform val2 = (((Object)(object)hs.hand != (Object)null) ? ((Component)hs.hand).transform : null);
		foreach (Collider weaponCollider in hs.weaponColliders)
		{
			if ((Object)(object)weaponCollider == (Object)null)
			{
				continue;
			}
			Collider[] array2 = array;
			foreach (Collider val3 in array2)
			{
				if (!((Object)(object)val3 == (Object)null) && (!((Object)(object)val2 != (Object)null) || !((Component)val3).transform.IsChildOf(val2)))
				{
					try
					{
						Physics.IgnoreCollision(weaponCollider, val3, true);
					}
					catch
					{
					}
				}
			}
		}
	}

	private void CutHammerHandleMesh(GameObject hammerInstance)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_00a9: 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_00ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			MeshFilter val = hammerInstance.GetComponent<MeshFilter>();
			if ((Object)(object)val == (Object)null)
			{
				val = hammerInstance.GetComponentInChildren<MeshFilter>();
			}
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Mesh mesh = val.mesh;
			if ((Object)(object)mesh == (Object)null)
			{
				return;
			}
			Il2CppStructArray<Vector3> vertices = mesh.vertices;
			Vector3[] array = (Vector3[])(object)new Vector3[((Il2CppArrayBase<Vector3>)(object)vertices).Length];
			for (int i = 0; i < ((Il2CppArrayBase<Vector3>)(object)vertices).Length; i++)
			{
				array[i] = ((Il2CppArrayBase<Vector3>)(object)vertices)[i];
			}
			float num = float.MaxValue;
			float num2 = float.MinValue;
			Vector3[] array2 = array;
			foreach (Vector3 val2 in array2)
			{
				if (val2.y < num)
				{
					num = val2.y;
				}
				if (val2.y > num2)
				{
					num2 = val2.y;
				}
			}
			float num3 = num2 - num;
			float num4 = num + num3 * 0.87f;
			int subMeshCount = mesh.subMeshCount;
			for (int k = 0; k < subMeshCount; k++)
			{
				Il2CppStructArray<int> triangles = mesh.GetTriangles(k);
				List<int> list = new List<int>();
				for (int l = 0; l < ((Il2CppArrayBase<int>)(object)triangles).Length; l++)
				{
					list.Add(((Il2CppArrayBase<int>)(object)triangles)[l]);
				}
				List<int> list2 = new List<int>();
				for (int m = 0; m < list.Count; m += 3)
				{
					int num5 = list[m];
					int num6 = list[m + 1];
					int num7 = list[m + 2];
					if (!(array[num5].y < num4) || !(array[num6].y < num4) || !(array[num7].y < num4))
					{
						list2.Add(num5);
						list2.Add(num6);
						list2.Add(num7);
					}
				}
				Il2CppStructArray<int> val3 = new Il2CppStructArray<int>((long)list2.Count);
				for (int n = 0; n < list2.Count; n++)
				{
					((Il2CppArrayBase<int>)(object)val3)[n] = list2[n];
				}
				mesh.SetTriangles(val3, k);
			}
			mesh.RecalculateNormals();
			mesh.RecalculateBounds();
		}
		catch
		{
		}
	}

	private void CutMeshAtThreshold(GameObject instance, float threshold)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		try
		{
			MeshFilter val = instance.GetComponent<MeshFilter>();
			if ((Object)(object)val == (Object)null)
			{
				val = instance.GetComponentInChildren<MeshFilter>();
			}
			if ((Object)(object)val == (Object)null)
			{
				return;
			}
			Mesh mesh = val.mesh;
			if ((Object)(object)mesh == (Object)null)
			{
				return;
			}
			Il2CppStructArray<Vector3> vertices = mesh.vertices;
			Vector3[] array = (Vector3[])(object)new Vector3[((Il2CppArrayBase<Vector3>)(object)vertices).Length];
			for (int i = 0; i < ((Il2CppArrayBase<Vector3>)(object)vertices).Length; i++)
			{
				array[i] = ((Il2CppArrayBase<Vector3>)(object)vertices)[i];
			}
			int subMeshCount = mesh.subMeshCount;
			for (int j = 0; j < subMeshCount; j++)
			{
				Il2CppStructArray<int> triangles = mesh.GetTriangles(j);
				List<int> list = new List<int>();
				for (int k = 0; k < ((Il2CppArrayBase<int>)(object)triangles).Length; k++)
				{
					list.Add(((Il2CppArrayBase<int>)(object)triangles)[k]);
				}
				List<int> list2 = new List<int>();
				for (int l = 0; l < list.Count; l += 3)
				{
					int num = list[l];
					int num2 = list[l + 1];
					int num3 = list[l + 2];
					if (!(array[num].y < threshold) || !(array[num2].y < threshold) || !(array[num3].y < threshold))
					{
						list2.Add(num);
						list2.Add(num2);
						list2.Add(num3);
					}
				}
				Il2CppStructArray<int> val2 = new Il2CppStructArray<int>((long)list2.Count);
				for (int m = 0; m < list2.Count; m++)
				{