Decompiled source of LAMBDA v1.3.0

LAMBDA.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using ProBuilder2.Common;
using ProBuilder2.MeshOperations;
using Sodalite.Api;
using Sodalite.ModPanel;
using UnityEditor;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Arpy.LAMBDA
{
	public class BloodOathPen : MonoBehaviour
	{
		public GameObject initialDisclaimer;

		public GameObject actualOath;

		public static float timeLeft = 15f;

		public Text timeBox;

		private void Update()
		{
			if (timeLeft > 0f)
			{
				timeLeft -= Time.deltaTime;
			}
			if (timeLeft < 0f)
			{
				timeLeft = 0f;
			}
			int num = Mathf.CeilToInt(timeLeft);
			timeBox.text = num.ToString();
		}

		public void RightsRemover()
		{
			if (LAMBDAPlugin.DS.FindParsec())
			{
				initialDisclaimer.SetActive(false);
				actualOath.SetActive(true);
				timeLeft = 15f;
			}
			else
			{
				LAMBDAPlugin.DS.updateBlood(b: true);
			}
		}

		public void Signature()
		{
			if (timeLeft <= 0f)
			{
				LAMBDAPlugin.DS.updateBlood(b: true);
			}
		}
	}
}
namespace localMP
{
	public class CameraControl : MonoBehaviour
	{
		public Rigidbody CameraRigidbody;

		private Vector2 rotation = Vector2.zero;

		public float speed = 3f;

		private bool inMotion = false;

		public GameObject Projectile;

		public AudioClip firingSound;

		public Transform Muzzle;

		public AudioSource shotSound;

		public float fireRate;

		private float roundsPerSecond;

		public float muzzleVelocityBase;

		public float ProjectileSpread;

		private Vector2 centerScreen;

		private void Start()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			roundsPerSecond = 1f / (fireRate / 60f);
			centerScreen = new Vector2((float)(Screen.width / 2), (float)(Screen.height / 2));
		}

		private void Update()
		{
			//IL_0291: 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_02a1: Unknown result type (might be due to invalid IL or missing references)
			if (inMotion)
			{
				CameraRigidbody.drag = 0.1f;
			}
			else
			{
				CameraRigidbody.drag = 5f;
			}
			if (Input.GetKey((KeyCode)119))
			{
				CameraRigidbody.AddRelativeForce(0f, 0f, 5f, (ForceMode)5);
				inMotion = true;
			}
			if (Input.GetKey((KeyCode)115))
			{
				CameraRigidbody.AddRelativeForce(0f, 0f, -5f, (ForceMode)5);
				inMotion = true;
			}
			if (Input.GetKey((KeyCode)97))
			{
				CameraRigidbody.AddRelativeForce(-5f, 0f, 0f, (ForceMode)5);
				inMotion = true;
			}
			if (Input.GetKey((KeyCode)100))
			{
				CameraRigidbody.AddRelativeForce(5f, 0f, 0f, (ForceMode)5);
				inMotion = true;
			}
			if (Input.GetKey((KeyCode)32))
			{
				if (inMotion)
				{
					CameraRigidbody.AddForce(0f, 5f, 0f, (ForceMode)5);
				}
				if (!inMotion)
				{
					CameraRigidbody.AddForce(0f, 25f, 0f, (ForceMode)5);
				}
			}
			if (Input.GetKey((KeyCode)304))
			{
				if (inMotion)
				{
					CameraRigidbody.AddForce(0f, -5f, 0f, (ForceMode)5);
				}
				if (!inMotion)
				{
					CameraRigidbody.AddForce(0f, -25f, 0f, (ForceMode)5);
				}
			}
			if (!Input.GetKey((KeyCode)100) && !Input.GetKey((KeyCode)97) && !Input.GetKey((KeyCode)115) && !Input.GetKey((KeyCode)119))
			{
				inMotion = false;
			}
			if (Input.GetKeyDown((KeyCode)323))
			{
				((MonoBehaviour)this).StartCoroutine(controlledFireRate());
			}
			else if (Input.GetKeyUp((KeyCode)323))
			{
				((MonoBehaviour)this).StopCoroutine(controlledFireRate());
			}
			ref Vector2 reference = ref rotation;
			reference.y += Input.GetAxis("Horizontal");
			Cursor.lockState = (CursorLockMode)1;
			Debug.Log((object)("MouseXValue is " + Input.GetAxis("Horizontal")));
			ref Vector2 reference2 = ref rotation;
			reference2.x += 0f - Input.GetAxis("Vertical");
			((Component)this).transform.eulerAngles = Vector2.op_Implicit(rotation * speed);
		}

		private IEnumerator controlledFireRate()
		{
			while (Input.GetKey((KeyCode)323))
			{
				GameObject gameObject = Object.Instantiate<GameObject>(Projectile, Muzzle.position, Muzzle.rotation);
				gameObject.transform.Rotate(new Vector3(Random.Range(ProjectileSpread, ProjectileSpread), Random.Range(0f - ProjectileSpread, ProjectileSpread), 0f));
				BallisticProjectile component = gameObject.GetComponent<BallisticProjectile>();
				component.FlightVelocityMultiplier *= 1f;
				float muzzleVelocityBase = component.MuzzleVelocityBase;
				component.Fire(muzzleVelocityBase, gameObject.transform.forward, (FVRFireArm)null, true);
				yield return (object)new WaitForSecondsRealtime(roundsPerSecond);
			}
		}
	}
}
namespace Arpy.LAMBDA
{
	[BepInPlugin("Arpy.LAMBDA", "LAMBDA", "1.3.0")]
	[Description("Built with MeatKit")]
	public class LAMBDAPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		public static LAMBDAPlugin DS;

		public GameObject DronePrefab;

		public GameObject sosigDronePrefab;

		private GameObject spawnedDrone;

		private GameObject spawnedSosigDrone;

		public ConfigEntry<bool> CrazyMode;

		public ConfigEntry<bool> SouthPawToggle;

		public ConfigEntry<bool> MotionSicknessToggle;

		public ConfigEntry<float> Sensitivity;

		public ConfigEntry<KeyCode> DroneSpawn;

		public ConfigEntry<KeyCode> PossessionStart;

		public ConfigEntry<KeyCode> PossessionStop;

		public ConfigEntry<KeyCode> WeaponThrow;

		public ConfigEntry<KeyCode> GrenadeThrow;

		public ConfigEntry<KeyCode> Pickup;

		public ConfigEntry<KeyCode> SosigSpawn;

		public ConfigEntry<KeyCode> SosigSwapForward;

		public ConfigEntry<KeyCode> SosigSwapBack;

		private LockablePanel _modPanel = null;

		private UniversalModPanel _modPanelComponent;

		private GameObject _modPanelPrefab;

		public static bool BloodBeenGiven = false;

		public GameObject panel;

		private static bool _HasPatched = false;

		public static List<Sosig> ExistingSosigs = new List<Sosig>();

		public static SosigOutfitConfig BuddyOutfit;

		public void Awake()
		{
			//IL_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Expected O, but got Unknown
			if (!_HasPatched)
			{
				Harmony.CreateAndPatchAll(typeof(LAMBDAPlugin), (string)null);
				_HasPatched = true;
			}
			SouthPawToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Southpaw Toggle", false, "This toggle sets your sosig to be left handed again like all good sosigs (and bad humans) should be");
			MotionSicknessToggle = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Motion Sickness Fixer", false, "This toggle changes the default followpoint from the head of the sosig to the sosig's AI navigation unit thus unlocking your up and down movements from the head");
			Sensitivity = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Mouse Sensitivity", 0.6f, "This number changes the sensitivity of the mouse");
			CrazyMode = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Crazy Mode", false, "Activates Experimental features that I won't support well but are cool. Like allowing you to possess some objects and move them.");
			DroneSpawn = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Drone Spawn Button", (KeyCode)92, "Button that spawns the possession drone");
			PossessionStart = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Possession Start Button", (KeyCode)101, "Button that starts a posession");
			PossessionStop = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Possession End Button", (KeyCode)113, "Button that ends a posession");
			WeaponThrow = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Throw Weapon Button", (KeyCode)116, "Button to throw your weapon");
			GrenadeThrow = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Grenade Throw Button", (KeyCode)103, "Button to toss a grenade");
			Pickup = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Weapon Pickup Button", (KeyCode)102, "Button to pickup a weapon");
			SosigSpawn = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Sosig Spawn Button", (KeyCode)104, "Button to spawn in a friendly sosig");
			SosigSwapForward = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Sosig list Next", (KeyCode)275, "Button to swap to the next sosig");
			SosigSwapBack = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Sosig List Back", (KeyCode)276, "Button to swap to the previous sosig");
			AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(BasePath, "localMP"));
			if (Object.op_Implicit((Object)(object)val))
			{
				sosigDronePrefab = val.LoadAsset<GameObject>("SosigDroneTest");
				_modPanelPrefab = val.LoadAsset<GameObject>("PanelForAgreement");
				_modPanel = new LockablePanel();
				_modPanel.Configure += ConfigureModPanel;
			}
			DS = this;
		}

		private void Start()
		{
			SignInBlood();
		}

		public void updateBlood(bool b)
		{
			BloodBeenGiven = b;
		}

		private void Update()
		{
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: 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)
			if (BloodBeenGiven && (Object)(object)panel != (Object)null)
			{
				FVRPhysicalObject component = panel.gameObject.GetComponent<FVRPhysicalObject>();
				((FVRInteractiveObject)component).m_hand.EndInteractionIfHeld((FVRInteractiveObject)(object)component);
				((FVRInteractiveObject)component).ForceBreakInteraction();
				Object.Destroy((Object)(object)panel);
			}
			if (Input.GetKeyDown(DroneSpawn.Value) && BloodBeenGiven)
			{
				Debug.Log((object)" Blood has already been given");
				Debug.Log((object)"trying to initialize");
				Object.Destroy((Object)(object)spawnedSosigDrone);
				spawnedSosigDrone = Object.Instantiate<GameObject>(sosigDronePrefab, GM.CurrentPlayerBody.Head.position, Quaternion.identity);
			}
			else if (Input.GetKeyDown(DroneSpawn.Value) && !BloodBeenGiven)
			{
				Debug.Log((object)"You have not signed in blood");
				SignInBlood();
			}
			if ((Object)(object)panel != (Object)null)
			{
				FVRPhysicalObject component2 = panel.gameObject.GetComponent<FVRPhysicalObject>();
				if ((Object)(object)((FVRInteractiveObject)component2).m_hand == (Object)null)
				{
					GM.CurrentMovementManager.Hands[0].RetrieveObject(component2);
				}
			}
		}

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "Arpy.LAMBDA");
		}

		public bool FindParsec()
		{
			string path = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\Parsec\\lock";
			if (File.Exists(path))
			{
				try
				{
					File.Open(path, FileMode.Open, FileAccess.Write, FileShare.None).Close();
					return false;
				}
				catch (IOException)
				{
					return true;
				}
			}
			return false;
		}

		public void SignInBlood()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			LockablePanel val = new LockablePanel();
			val.Configure += ConfigureModPanel;
			SpawnModPanel();
		}

		private void SpawnModPanel()
		{
			BloodOathPen.timeLeft = 15f;
			panel = _modPanel.GetOrCreatePanel();
			GM.CurrentMovementManager.Hands[0].RetrieveObject(panel.GetComponent<FVRPhysicalObject>());
		}

		private void ConfigureModPanel(GameObject panel)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			Transform val = panel.transform.Find("OptionsCanvas_0_Main/Canvas");
			_modPanelComponent = Object.Instantiate<GameObject>(_modPanelPrefab, val.position, val.rotation, val.parent).GetComponent<UniversalModPanel>();
			Object.Destroy((Object)(object)((Component)val).gameObject);
		}

		[HarmonyPatch(typeof(Sosig), "Start")]
		[HarmonyPostfix]
		private static void Sosig_Start_Patch(Sosig __instance)
		{
			ExistingSosigs.Add(__instance);
		}

		[HarmonyPatch(typeof(Sosig), "SosigDies")]
		[HarmonyPostfix]
		private static void Sosig_Death_Patch(Sosig __instance)
		{
			ExistingSosigs.Remove(__instance);
		}

		[HarmonyPatch(typeof(Sosig), "OnDestroy")]
		[HarmonyPostfix]
		private static void Sosig_Destroy_Patch(Sosig __instance)
		{
			if (ExistingSosigs.Contains(__instance))
			{
				ExistingSosigs.Remove(__instance);
			}
		}
	}
	public class SosigDroneCameraController : MonoBehaviour
	{
		public bool IsMotionSick = false;

		public Camera droneCam;

		private float MaxFOV = 81f;

		public Rigidbody CameraRigidbody;

		private bool isControllingSosig = false;

		private Vector2 rotation = Vector2.zero;

		public float lookdirSpeed = 0.2f;

		public float speed = 3f;

		public float sensitivity = 1f;

		private float CameraSpeed = 5f;

		public float cameraSpeed = 5f;

		public float fastCameraSpeed = 10f;

		public AudioClip firingSound;

		public Transform Muzzle;

		public AudioSource shotSound;

		public Sosig ControllingSosig;

		public LayerMask mask;

		public Transform MFHolder;

		public Transform MF;

		public float MFDistance = 1f;

		private Transform actualMovePoint;

		public Transform MeleePoint;

		public Transform AimTorwardsPoint;

		public GameObject Crosshair;

		public GameObject Crosshair2;

		private float storedwalkingspeed = 0f;

		private float storedSightRange = 0f;

		private float storedHearingRange = 0f;

		public LayerMask environment;

		public LayerMask EnvironmentOnly;

		public LayerMask GunPickup;

		public float ClampRange;

		private GameObject RedSquare;

		private SosigWeapon currentGun;

		private SosigWeaponPlayerInterface currentGunInterface;

		private SosigHand currentHand;

		public List<SosigWeapon> sosigWeps;

		public float CrossHairScale = 0.25f;

		private bool semiAutoFired = false;

		public float throwVelocity = 10f;

		public float throwForce = 20f;

		public GameObject ControllingParticleSystem;

		[Header("Object Controlling Stuffs")]
		public bool isControllingObject = false;

		private FVRPhysicalObject currentObject;

		private Rigidbody CRB;

		public float objectForce = 20f;

		public float objectJump = 20f;

		private float distanceToObject = 1f;

		public float maxOBJSpeed = 10f;

		public GameObject otherAimPoint;

		[Header("UI stuff")]
		public Text playerHealth;

		public Text AmmoCounter;

		public Text GunName;

		public GameObject arrowPointer;

		public Image reloadingImage;

		private float showHealthTime;

		public Color neutral;

		public Color Friend;

		public Color Enemy;

		public LayerMask iffCheckMask;

		public Material ReticleMaterial;

		private int sosigIFF;

		[Header("Health UI")]
		public List<Image> LinkImages;

		public List<float> LinkIntegrityLastFrame;

		public List<Text> LinkTexts;

		private float MustardAmountLastFrame;

		public float healthShowTime = 4f;

		public Gradient HealthGradient;

		public Gradient HealthAlphaKey;

		[Header("Sosig Pal stuff")]
		public SosigConfigTemplate ConfigTemplate;

		private KeyCode DroneSpawn;

		private KeyCode PossessionStart;

		private KeyCode PossessionStop;

		private KeyCode WeaponThrow;

		private KeyCode GrenadeThrow;

		private KeyCode Pickup;

		private KeyCode SpawnBuddy;

		private KeyCode SosigListF;

		private KeyCode SosigListB;

		private bool isReloading = false;

		private Transform sosigBodyFollower;

		private Vector3 storedSosigAimPoint;

		private float StoredSosigHeadAngularDrag = 0.25f;

		private bool IsLeftie = false;

		private void Start()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Expected O, but got Unknown
			//IL_0193: 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_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			DroneSpawn = LAMBDAPlugin.DS.DroneSpawn.Value;
			PossessionStart = LAMBDAPlugin.DS.PossessionStart.Value;
			PossessionStop = LAMBDAPlugin.DS.PossessionStop.Value;
			WeaponThrow = LAMBDAPlugin.DS.WeaponThrow.Value;
			GrenadeThrow = LAMBDAPlugin.DS.GrenadeThrow.Value;
			Pickup = LAMBDAPlugin.DS.Pickup.Value;
			IsMotionSick = LAMBDAPlugin.DS.MotionSicknessToggle.Value;
			IsLeftie = LAMBDAPlugin.DS.SouthPawToggle.Value;
			sensitivity = LAMBDAPlugin.DS.Sensitivity.Value;
			SpawnBuddy = LAMBDAPlugin.DS.SosigSpawn.Value;
			SosigListF = LAMBDAPlugin.DS.SosigSwapForward.Value;
			SosigListB = LAMBDAPlugin.DS.SosigSwapBack.Value;
			sosigWeps = new List<SosigWeapon>();
			LinkIntegrityLastFrame = new List<float>();
			LinkIntegrityLastFrame.Add(100f);
			LinkIntegrityLastFrame.Add(100f);
			LinkIntegrityLastFrame.Add(100f);
			LinkIntegrityLastFrame.Add(100f);
			RedSquare = new GameObject("aimingStart");
			RedSquare.transform.parent = ((Component)this).transform;
			RedSquare.transform.localPosition = new Vector3(0f, 0f, 0.35f);
			MaxFOV = droneCam.fieldOfView;
			actualMovePoint = new GameObject().transform;
			storedSosigAimPoint = default(Vector3);
			((Component)MFHolder).transform.parent = null;
		}

		private void Update()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: 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_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0229: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027f: 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_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_0348: 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_0356: Unknown result type (might be due to invalid IL or missing references)
			//IL_037a: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0395: Unknown result type (might be due to invalid IL or missing references)
			//IL_039a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0439: Unknown result type (might be due to invalid IL or missing references)
			//IL_044d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0452: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0471: Unknown result type (might be due to invalid IL or missing references)
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0400: Unknown result type (might be due to invalid IL or missing references)
			//IL_040f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_041d: 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_049b: Unknown result type (might be due to invalid IL or missing references)
			//IL_050d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0513: Invalid comparison between Unknown and I4
			//IL_0688: 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_069b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0561: Invalid comparison between Unknown and I4
			//IL_06de: Unknown result type (might be due to invalid IL or missing references)
			//IL_06eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0700: Unknown result type (might be due to invalid IL or missing references)
			//IL_0705: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_06cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Unknown result type (might be due to invalid IL or missing references)
			//IL_0618: Unknown result type (might be due to invalid IL or missing references)
			//IL_061d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0631: Unknown result type (might be due to invalid IL or missing references)
			//IL_0636: 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_0674: Unknown result type (might be due to invalid IL or missing references)
			//IL_058b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0590: Unknown result type (might be due to invalid IL or missing references)
			//IL_05af: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_05de: 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_075d: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_172d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1738: Unknown result type (might be due to invalid IL or missing references)
			//IL_173d: 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_0806: Unknown result type (might be due to invalid IL or missing references)
			//IL_0837: Unknown result type (might be due to invalid IL or missing references)
			//IL_083c: Unknown result type (might be due to invalid IL or missing references)
			//IL_11af: Unknown result type (might be due to invalid IL or missing references)
			//IL_0fea: Unknown result type (might be due to invalid IL or missing references)
			//IL_11d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_11db: Unknown result type (might be due to invalid IL or missing references)
			//IL_1207: Unknown result type (might be due to invalid IL or missing references)
			//IL_120c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1047: Unknown result type (might be due to invalid IL or missing references)
			//IL_104f: Unknown result type (might be due to invalid IL or missing references)
			//IL_105a: Unknown result type (might be due to invalid IL or missing references)
			//IL_105f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1064: Unknown result type (might be due to invalid IL or missing references)
			//IL_1074: Unknown result type (might be due to invalid IL or missing references)
			//IL_107c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1081: Unknown result type (might be due to invalid IL or missing references)
			//IL_108c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1091: Unknown result type (might be due to invalid IL or missing references)
			//IL_1096: 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_1680: Unknown result type (might be due to invalid IL or missing references)
			//IL_1625: Unknown result type (might be due to invalid IL or missing references)
			//IL_162a: Unknown result type (might be due to invalid IL or missing references)
			//IL_163e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1643: Unknown result type (might be due to invalid IL or missing references)
			//IL_165e: Unknown result type (might be due to invalid IL or missing references)
			//IL_1663: Unknown result type (might be due to invalid IL or missing references)
			//IL_1677: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_10ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_10b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_10be: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_10c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_098b: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_14c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_14dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_14e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_14eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_14f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_14fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_1505: Unknown result type (might be due to invalid IL or missing references)
			//IL_10d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_10e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_10eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_10f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1524: Unknown result type (might be due to invalid IL or missing references)
			//IL_1529: Unknown result type (might be due to invalid IL or missing references)
			//IL_153d: Unknown result type (might be due to invalid IL or missing references)
			//IL_1542: Unknown result type (might be due to invalid IL or missing references)
			//IL_154b: Unknown result type (might be due to invalid IL or missing references)
			//IL_1550: Unknown result type (might be due to invalid IL or missing references)
			//IL_1555: Unknown result type (might be due to invalid IL or missing references)
			//IL_155d: Unknown result type (might be due to invalid IL or missing references)
			//IL_155f: Unknown result type (might be due to invalid IL or missing references)
			//IL_156a: Unknown result type (might be due to invalid IL or missing references)
			//IL_1105: Unknown result type (might be due to invalid IL or missing references)
			//IL_1107: Unknown result type (might be due to invalid IL or missing references)
			//IL_1112: Unknown result type (might be due to invalid IL or missing references)
			//IL_1117: Unknown result type (might be due to invalid IL or missing references)
			//IL_111c: Unknown result type (might be due to invalid IL or missing references)
			//IL_158f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1594: Unknown result type (might be due to invalid IL or missing references)
			//IL_159f: Unknown result type (might be due to invalid IL or missing references)
			//IL_114f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1157: Unknown result type (might be due to invalid IL or missing references)
			//IL_112f: Unknown result type (might be due to invalid IL or missing references)
			//IL_1131: Unknown result type (might be due to invalid IL or missing references)
			//IL_113c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1141: Unknown result type (might be due to invalid IL or missing references)
			//IL_1146: Unknown result type (might be due to invalid IL or missing references)
			//IL_15c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_15cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_15ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_15f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b38: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b42: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b47: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b4c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0be1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b65: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bfd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b7b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ca8: Invalid comparison between Unknown and I4
			//IL_0d0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d12: Invalid comparison between Unknown and I4
			//IL_0dd3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d79: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e39: Invalid comparison between Unknown and I4
			//IL_0eb4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e96: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e9c: Invalid comparison between Unknown and I4
			//IL_0f2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0f77: Unknown result type (might be due to invalid IL or missing references)
			playerHealth.text = ((int)GM.CurrentPlayerBody.Health).ToString();
			if (MF.localPosition.z != 0f && !Input.GetKey((KeyCode)119) && !Input.GetKey((KeyCode)115))
			{
				MF.localPosition = new Vector3(MF.localPosition.x, MF.localPosition.y, 0f);
			}
			if (MF.localPosition.x != 0f && !Input.GetKey((KeyCode)100) && !Input.GetKey((KeyCode)97))
			{
				MF.localPosition = new Vector3(0f, MF.localPosition.y, MF.localPosition.z);
			}
			if (Input.GetKeyDown((KeyCode)119))
			{
				MF.localPosition = new Vector3(MF.localPosition.x, MF.localPosition.y, MF.localPosition.z + MFDistance);
			}
			else if (Input.GetKeyUp((KeyCode)119))
			{
				MF.localPosition = new Vector3(MF.localPosition.x, MF.localPosition.y, MF.localPosition.z - MFDistance);
			}
			if (Input.GetKeyDown((KeyCode)115))
			{
				MF.localPosition = new Vector3(MF.localPosition.x, MF.localPosition.y, MF.localPosition.z - MFDistance);
			}
			else if (Input.GetKeyUp((KeyCode)115))
			{
				MF.localPosition = new Vector3(MF.localPosition.x, MF.localPosition.y, MF.localPosition.z + MFDistance);
			}
			if (Input.GetKeyDown((KeyCode)100))
			{
				MF.localPosition = new Vector3(MF.localPosition.x + MFDistance, MF.localPosition.y, MF.localPosition.z);
			}
			else if (Input.GetKeyUp((KeyCode)100))
			{
				MF.localPosition = new Vector3(MF.localPosition.x - MFDistance, MF.localPosition.y, MF.localPosition.z);
			}
			if (Input.GetKeyDown((KeyCode)97))
			{
				MF.localPosition = new Vector3(MF.localPosition.x - MFDistance, MF.localPosition.y, MF.localPosition.z);
			}
			else if (Input.GetKeyUp((KeyCode)97))
			{
				MF.localPosition = new Vector3(MF.localPosition.x + MFDistance, MF.localPosition.y, MF.localPosition.z);
			}
			MF.localPosition = new Vector3(MF.localPosition.x, 0f, MF.localPosition.z);
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(MF.position, Vector3.down, ref val, 50f, LayerMask.op_Implicit(EnvironmentOnly)))
			{
				actualMovePoint.position = ((RaycastHit)(ref val)).point;
			}
			if (!Input.GetKeyDown(PossessionStop) || !isControllingObject || !LAMBDAPlugin.DS.CrazyMode.Value)
			{
			}
			if (isControllingSosig && (Object)(object)ControllingSosig == (Object)null)
			{
				ReleaseSosig();
			}
			if (isControllingSosig && (int)ControllingSosig.BodyState == 3)
			{
				ReleaseSosig();
			}
			if ((Object)(object)currentObject == (Object)null && isControllingObject)
			{
				ReleaseObject();
			}
			if ((Object)(object)ControllingSosig != (Object)null && (int)ControllingSosig.BodyState != 3)
			{
				if (!IsMotionSick)
				{
					Vector3 position = default(Vector3);
					((Vector3)(ref position))..ctor(((Component)ControllingSosig.Links[0]).transform.position.x, ((Component)ControllingSosig.Links[0]).transform.position.y + 0.15f, ((Component)ControllingSosig.Links[0]).transform.position.z);
					((Component)this).transform.position = position;
				}
				else
				{
					Vector3 position2 = default(Vector3);
					((Vector3)(ref position2))..ctor(((Component)ControllingSosig.Links[1]).transform.position.x, ((Component)ControllingSosig).transform.position.y + 1.65f, ((Component)ControllingSosig.Links[1]).transform.position.z);
					((Component)this).transform.position = position2;
				}
			}
			Vector3 position3 = otherAimPoint.transform.position;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(RedSquare.transform.position, ((Component)this).transform.forward, ref val2, 1000f, LayerMask.op_Implicit(environment)))
			{
				position3 = ((RaycastHit)(ref val2)).point;
			}
			Crosshair2.transform.position = position3;
			Vector3 val3 = ((Component)this).transform.position - Crosshair2.transform.position;
			float magnitude = ((Vector3)(ref val3)).magnitude;
			Crosshair2.transform.localScale = new Vector3(magnitude, magnitude, magnitude);
			if (Input.GetKeyDown(PossessionStart))
			{
				SosigCheck();
			}
			if (Input.GetKeyDown(SosigListF))
			{
				NavigateSosigList(b: true);
			}
			if (Input.GetKeyDown(SosigListB))
			{
				NavigateSosigList(b: false);
			}
			if (isControllingSosig)
			{
				((Component)ControllingSosig.Links[0]).transform.rotation = Quaternion.RotateTowards(((Component)ControllingSosig.Links[0]).transform.rotation, ((Component)this).transform.rotation, 180f);
				if ((Object)(object)ControllingSosig == (Object)null)
				{
					ReleaseSosig();
				}
				if (arrowPointer.activeSelf)
				{
					arrowPointer.SetActive(false);
				}
				if (Input.mouseScrollDelta.y < 0f)
				{
					Camera obj = droneCam;
					obj.fieldOfView += 5f;
				}
				else if (Input.mouseScrollDelta.y > 0f)
				{
					Camera obj2 = droneCam;
					obj2.fieldOfView -= 5f;
				}
				droneCam.fieldOfView = Mathf.Clamp(droneCam.fieldOfView, 15f, MaxFOV);
				if (Input.GetKeyDown((KeyCode)256))
				{
					ControllingSosig.Vaporize(ControllingSosig.DamageFX_Vaporize, ControllingSosig.GetIFF());
				}
				if (Input.GetKeyDown((KeyCode)257))
				{
					ControllingSosig.Links[0].LinkExplodes((DamageClass)0);
				}
				if (Input.GetKeyDown((KeyCode)258))
				{
					ControllingSosig.Links[0].LinkExplodes((DamageClass)0);
					ControllingSosig.Links[1].LinkExplodes((DamageClass)0);
					ControllingSosig.Links[2].LinkExplodes((DamageClass)0);
					ControllingSosig.Links[3].LinkExplodes((DamageClass)0);
				}
				if (Input.GetKeyDown((KeyCode)259))
				{
					ControllingSosig.BreakBack(true);
				}
				if (Input.GetKeyDown(WeaponThrow))
				{
					ThrowTheCheese();
				}
				if (Input.GetKeyDown(GrenadeThrow))
				{
					NadeOut();
				}
				if (Input.GetKeyDown((KeyCode)49))
				{
					ControllingSosig.Speak_State(ControllingSosig.Speech.OnSkirmish);
				}
				if (Input.GetKeyDown((KeyCode)50))
				{
					ControllingSosig.Speak_State(ControllingSosig.Speech.OnWander);
				}
				if (Input.GetKeyDown((KeyCode)51))
				{
					ControllingSosig.Speak_State(ControllingSosig.Speech.OnInvestigate);
				}
				if (Input.GetKeyDown(Pickup))
				{
					changeWeapons();
				}
				if (((Object)(object)currentGun != (Object)null && Input.GetKeyDown((KeyCode)114) && currentGun.m_shotsLeft != currentGun.ShotsPerLoad) || ((Object)(object)currentGun != (Object)null && currentGun.m_shotsLeft == 0))
				{
					ReloadCurrentWeapon();
				}
				if ((Object)(object)currentGun != (Object)null && (Object)(object)currentGun != (Object)(object)ControllingSosig.Hand_Primary.HeldObject)
				{
					currentGun = ControllingSosig.Hand_Primary.HeldObject;
					if ((Object)(object)currentGun != (Object)null)
					{
						SosigWeaponPlayerInterface component = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
						if ((Object)(object)component != (Object)null)
						{
							currentGunInterface = component;
						}
					}
					currentHand = ControllingSosig.Hand_Primary;
				}
				Vector3 val4 = ((Component)this).transform.position + ((Component)this).transform.forward * 1000f;
				RaycastHit val5 = default(RaycastHit);
				if ((Object)(object)currentGun != (Object)null && (int)currentGun.Type == 0)
				{
					if (Physics.Raycast(currentGun.Muzzle.position, ((Component)currentGun.Muzzle).transform.forward, ref val5, 1000f, LayerMask.op_Implicit(environment)))
					{
						val4 = ((RaycastHit)(ref val5)).point;
					}
				}
				else if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val5, 1000f, LayerMask.op_Implicit(environment)))
				{
					val4 = ((RaycastHit)(ref val5)).point;
				}
				Crosshair.transform.position = ((RaycastHit)(ref val5)).point;
				if (ControllingSosig.Hand_Primary.IsHoldingObject && (Object)(object)currentGun == (Object)null)
				{
					currentGun = ControllingSosig.Hand_Primary.HeldObject;
					SosigWeaponPlayerInterface component2 = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
					if ((Object)(object)component2 != (Object)null)
					{
						currentGunInterface = component2;
					}
					currentHand = currentGun.HandHoldingThis;
				}
				if ((Object)(object)currentGun != (Object)null && (int)currentGun.Type == 1 && (Object)(object)currentHand.m_posedToward != (Object)(object)currentHand.Point_ShieldHold)
				{
					currentHand.PoseToward(currentHand.Point_ShieldHold);
				}
				if (Input.GetKey((KeyCode)323) && (Object)(object)currentGun != (Object)null && (int)currentGun.Type == 1)
				{
					currentGun.StartNewAttackAnim();
				}
				if (Input.GetKey((KeyCode)324))
				{
					if (currentHand != null && (Object)(object)currentGun != (Object)null)
					{
						currentHand.PoseToward(currentHand.Point_Aimed);
						((Component)currentGun).transform.LookAt(AimTorwardsPoint.position);
					}
				}
				else if (Input.GetKeyUp((KeyCode)324) && currentHand != null)
				{
					currentHand.PoseToward(currentHand.Point_HipFire);
				}
				if (Input.GetKey((KeyCode)304))
				{
					ControllingSosig.m_assaultSpeed = (SosigMoveSpeed)4;
					ControllingSosig.Speed_Walk = ControllingSosig.Speed_Run;
				}
				else if (ControllingSosig.Speed_Walk != storedwalkingspeed)
				{
					ControllingSosig.Speed_Walk = storedwalkingspeed;
				}
				if (Input.GetKeyDown(PossessionStop) || (int)ControllingSosig.BodyState == 3)
				{
					ReleaseSosig();
				}
				if (((Object)(object)ControllingSosig != (Object)null && Input.GetAxis("Horizontal") > 0f) || ((Object)(object)ControllingSosig != (Object)null && Input.GetAxis("Horizontal") < 0f && (int)ControllingSosig.BodyState != 3))
				{
					ControllingSosig.SetNewWeightedLookDir(lookdirSpeed, ((Component)this).transform.forward);
				}
				if (((Object)(object)ControllingSosig != (Object)null && Input.GetKey((KeyCode)119)) || Input.GetKey((KeyCode)97) || Input.GetKey((KeyCode)115) || Input.GetKey((KeyCode)100))
				{
					ControllingSosig.CommandPathTo(new List<Transform> { actualMovePoint }, 0f, new Vector2(0f, 0f), 0.2f, (SosigMoveSpeed)3, (PathLoopType)0, (List<Sosig>)null, 0f, 0f, false, 0f);
				}
				else if ((Object)(object)ControllingSosig != (Object)null)
				{
					ControllingSosig.CommandGuardPoint(((Component)ControllingSosig).transform.position, true);
				}
			}
			if (!isControllingSosig && !isControllingObject)
			{
				if (ControllingParticleSystem.activeSelf)
				{
					ControllingParticleSystem.SetActive(false);
				}
				if (!arrowPointer.activeSelf)
				{
					arrowPointer.SetActive(true);
				}
				arrowPointer.transform.LookAt(((Component)GM.CurrentPlayerBody).transform.position);
				Vector3 val6 = default(Vector3);
				((Vector3)(ref val6))..ctor(0f, 0f, 0f);
				if (Input.GetKey((KeyCode)304))
				{
					CameraSpeed = fastCameraSpeed;
				}
				else
				{
					CameraSpeed = cameraSpeed;
				}
				if (Input.GetKey((KeyCode)119))
				{
					val6 += ((Component)this).transform.forward * CameraSpeed;
				}
				if (Input.GetKey((KeyCode)115))
				{
					val6 += -((Component)this).transform.forward * CameraSpeed;
				}
				if (Input.GetKey((KeyCode)97))
				{
					val6 += -((Component)this).transform.right * CameraSpeed;
				}
				if (Input.GetKey((KeyCode)100))
				{
					val6 += ((Component)this).transform.right * CameraSpeed;
				}
				if (Input.GetKey((KeyCode)32))
				{
					val6 += Vector3.up * CameraSpeed;
				}
				if (Input.GetKey((KeyCode)306))
				{
					val6 += Vector3.down * CameraSpeed;
				}
				CameraRigidbody.velocity = val6;
				if (!Input.GetKeyDown(SpawnBuddy))
				{
				}
			}
			if (isControllingObject && LAMBDAPlugin.DS.CrazyMode.Value)
			{
				if (Input.GetKey((KeyCode)324))
				{
					((Component)currentObject).transform.LookAt(Crosshair2.transform.position);
				}
				if (arrowPointer.activeSelf)
				{
					arrowPointer.SetActive(false);
				}
				if (Input.mouseScrollDelta.y < 0f)
				{
					distanceToObject += 0.1f;
				}
				else if (Input.mouseScrollDelta.y > 0f)
				{
					distanceToObject -= 0.1f;
				}
				distanceToObject = Mathf.Clamp(distanceToObject, 0f, 100f);
				if ((Object)(object)CRB != (Object)null)
				{
					if (Input.GetKeyDown((KeyCode)323) && (Object)(object)currentObject != (Object)null)
					{
						PinnedGrenade component3 = ((Component)currentObject).GetComponent<PinnedGrenade>();
						if ((Object)(object)component3 != (Object)null && !component3.m_isPinPulled)
						{
							foreach (PinnedGrenadeRing ring in component3.m_rings)
							{
								ring.ForcePopOut();
							}
							if (!component3.IsLeverReleased())
							{
								component3.ReleaseLever();
							}
						}
						FVRFireArmRound component4 = ((Component)currentObject).GetComponent<FVRFireArmRound>();
						if ((Object)(object)component4 != (Object)null)
						{
							component4.Fire();
						}
						SosigWeapon component5 = ((Component)currentObject).GetComponent<SosigWeapon>();
						if ((Object)(object)component5 != (Object)null)
						{
							component5.FireGun(1f);
						}
						OpenBoltReceiver component6 = ((Component)currentObject).GetComponent<OpenBoltReceiver>();
						if ((Object)(object)component6 != (Object)null)
						{
							component6.Fire();
						}
						ClosedBoltWeapon component7 = ((Component)currentObject).GetComponent<ClosedBoltWeapon>();
						if ((Object)(object)component7 != (Object)null)
						{
							component7.Fire();
						}
						Handgun component8 = ((Component)currentObject).GetComponent<Handgun>();
						if ((Object)(object)component8 != (Object)null)
						{
							component8.Fire();
						}
						LeverActionFirearm component9 = ((Component)currentObject).GetComponent<LeverActionFirearm>();
						if ((Object)(object)component9 != (Object)null)
						{
							component9.Fire();
						}
						BoltActionRifle component10 = ((Component)currentObject).GetComponent<BoltActionRifle>();
						if ((Object)(object)component10 != (Object)null)
						{
							component10.Fire();
						}
						Revolver component11 = ((Component)currentObject).GetComponent<Revolver>();
						if ((Object)(object)component11 != (Object)null)
						{
							component11.Fire();
						}
						RevolvingShotgun component12 = ((Component)currentObject).GetComponent<RevolvingShotgun>();
						if ((Object)(object)component12 != (Object)null)
						{
							component12.Fire();
						}
						SingleActionRevolver component13 = ((Component)currentObject).GetComponent<SingleActionRevolver>();
						if ((Object)(object)component13 != (Object)null)
						{
							component13.Fire();
						}
						TubeFedShotgun component14 = ((Component)currentObject).GetComponent<TubeFedShotgun>();
						if ((Object)(object)component14 != (Object)null)
						{
							component14.Fire();
						}
						Flaregun component15 = ((Component)currentObject).GetComponent<Flaregun>();
						if ((Object)(object)component15 != (Object)null)
						{
							component15.Fire();
						}
					}
					if (Input.GetKey((KeyCode)119))
					{
						Vector3 val7 = Vector3.Normalize(new Vector3(((Component)this).transform.forward.x, 0f, ((Component)this).transform.forward.z));
						CRB.AddForce(val7 * objectForce, (ForceMode)2);
					}
					if (Input.GetKey((KeyCode)115))
					{
						Vector3 val8 = Vector3.Normalize(new Vector3(((Component)this).transform.forward.x, 0f, ((Component)this).transform.forward.z));
						CRB.AddForce(-val8 * objectForce, (ForceMode)2);
					}
					if (Input.GetKey((KeyCode)97))
					{
						CRB.AddForce(-((Component)this).transform.right * objectForce, (ForceMode)2);
					}
					if (Input.GetKey((KeyCode)100))
					{
						CRB.AddForce(((Component)this).transform.right * objectForce, (ForceMode)2);
					}
					if (Input.GetKeyDown((KeyCode)32))
					{
						CRB.AddForce(Vector3.up * objectJump, (ForceMode)2);
					}
				}
				if ((Object)(object)currentObject != (Object)null)
				{
					Vector3 position4 = default(Vector3);
					((Vector3)(ref position4))..ctor(((Component)currentObject).transform.position.x, ((Component)currentObject).transform.position.y + distanceToObject, ((Component)currentObject).transform.position.z);
					((Component)this).transform.position = position4;
				}
				if (Input.GetKeyDown(PossessionStop))
				{
					ReleaseObject();
				}
				if ((Object)(object)currentObject == (Object)null)
				{
					ReleaseObject();
				}
			}
			ref Vector2 reference = ref rotation;
			reference.y += Input.GetAxis("Horizontal") * sensitivity;
			Cursor.lockState = (CursorLockMode)1;
			ref Vector2 reference2 = ref rotation;
			reference2.x += (0f - Input.GetAxis("Vertical")) * sensitivity;
			rotation.x = Mathf.Clamp(rotation.x, 0f - ClampRange, ClampRange);
			((Component)this).transform.eulerAngles = Vector2.op_Implicit(rotation * speed);
		}

		private void LateUpdate()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: 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_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			((Component)MFHolder).transform.position = ((Component)this).transform.position;
			((Component)MFHolder).transform.rotation = Quaternion.LookRotation(Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up));
			UIUpdate();
			if (!Object.op_Implicit((Object)(object)ControllingSosig))
			{
				return;
			}
			if (Input.GetKey((KeyCode)323))
			{
				if (isReloading && (Object)(object)currentGun != (Object)null && currentGun.m_shotsLeft > 0)
				{
					CancelReload();
				}
				if ((Object)(object)currentGun != (Object)null && (int)currentGun.Type == 0)
				{
					if (currentGun.isFullAuto)
					{
						currentGun.FireGun(1f);
					}
					if (!currentGun.isFullAuto && !semiAutoFired)
					{
						currentGun.FireGun(1f);
						semiAutoFired = true;
					}
				}
			}
			if (Input.GetKeyUp((KeyCode)323) && semiAutoFired)
			{
				semiAutoFired = false;
			}
			ReticleMaterial.color = neutral;
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val, float.PositiveInfinity, LayerMask.op_Implicit(iffCheckMask)))
			{
				FVRPlayerHitbox component = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<FVRPlayerHitbox>();
				SosigLink componentInParent = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponentInParent<SosigLink>();
				if ((Object)(object)component != (Object)null)
				{
					IFFShow(GM.CurrentPlayerBody.GetPlayerIFF());
				}
				if ((Object)(object)componentInParent != (Object)null)
				{
					IFFShow(componentInParent.S.GetIFF());
				}
			}
		}

		public void SosigCheck()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Invalid comparison between Unknown and I4
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val, 100f, LayerMask.op_Implicit(mask)))
			{
				SosigLink component = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<SosigLink>();
				if ((Object)(object)component != (Object)null && !isControllingObject)
				{
					if ((int)component.S.BodyState != 3)
					{
						ReleaseSosig();
						ControllingSosig = component.S;
					}
					Debug.Log((object)"Attempting");
					if ((Object)(object)ControllingSosig != (Object)null)
					{
						SetupSosigCamera(ControllingSosig);
					}
				}
				else if (!Object.op_Implicit((Object)(object)ControllingSosig) && LAMBDAPlugin.DS.CrazyMode.Value)
				{
					setupObject();
				}
			}
			else
			{
				Debug.Log((object)"nope");
			}
		}

		public void SetupSosigCamera(Sosig S)
		{
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0339: Unknown result type (might be due to invalid IL or missing references)
			//IL_037e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_06df: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0704: Unknown result type (might be due to invalid IL or missing references)
			//IL_070d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0435: Unknown result type (might be due to invalid IL or missing references)
			//IL_043a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0450: Unknown result type (might be due to invalid IL or missing references)
			//IL_0455: Unknown result type (might be due to invalid IL or missing references)
			//IL_0470: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_047e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04da: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0505: Unknown result type (might be due to invalid IL or missing references)
			//IL_050a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0520: Unknown result type (might be due to invalid IL or missing references)
			//IL_0525: Unknown result type (might be due to invalid IL or missing references)
			//IL_053a: 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_0548: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Unknown result type (might be due to invalid IL or missing references)
			//IL_056f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0585: Unknown result type (might be due to invalid IL or missing references)
			//IL_058a: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0616: 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_0631: Unknown result type (might be due to invalid IL or missing references)
			//IL_0636: Unknown result type (might be due to invalid IL or missing references)
			//IL_064b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0650: Unknown result type (might be due to invalid IL or missing references)
			//IL_0659: Unknown result type (might be due to invalid IL or missing references)
			ControllingSosig = S;
			ControllingParticleSystem.SetActive(true);
			Vector3 position = default(Vector3);
			((Vector3)(ref position))..ctor(((Component)ControllingSosig.Links[0]).transform.position.x, ((Component)ControllingSosig.Links[0]).transform.position.y + 0.15f, ((Component)ControllingSosig.Links[0]).transform.position.z);
			((Component)this).transform.position = position;
			isControllingSosig = true;
			CameraRigidbody.isKinematic = true;
			S.IsAllowedToSpeak = false;
			storedwalkingspeed = S.Speed_Walk;
			storedSightRange = S.MaxSightRange;
			S.MaxSightRange = 0f;
			storedHearingRange = S.MaxHearingRange;
			S.MaxHearingRange = 0f;
			ControllingSosig.Priority.m_targetPoint = Crosshair.transform.position;
			ControllingSosig.m_randomLookTickRange = new Vector2(9999999f, 9999999f);
			if ((Object)(object)ControllingSosig.Hand_Primary.HeldObject != (Object)null)
			{
				sosigWeps.Add(ControllingSosig.Hand_Primary.HeldObject);
			}
			if ((Object)(object)ControllingSosig.Hand_Secondary.HeldObject != (Object)null)
			{
				sosigWeps.Add(ControllingSosig.Hand_Secondary.HeldObject);
			}
			for (int i = 0; i < ControllingSosig.Inventory.Slots.Count; i++)
			{
				if ((Object)(object)ControllingSosig.Inventory.Slots[i].HeldObject != (Object)null)
				{
					sosigWeps.Add(ControllingSosig.Inventory.Slots[i].HeldObject);
				}
			}
			ControllingSosig.CanPickup_Melee = false;
			ControllingSosig.CanPickup_Ranged = false;
			ControllingSosig.CanPickup_Other = false;
			ControllingSosig.m_tickDownToRandomLook = 100000f;
			if (ControllingSosig.Links[0].m_wearables.Count > 0)
			{
				foreach (SosigWearable wearable in ControllingSosig.Links[0].m_wearables)
				{
					((Component)wearable).gameObject.layer = 11;
					Transform[] componentsInChildren = ((Component)wearable).gameObject.GetComponentsInChildren<Transform>();
					for (int j = 0; j <= componentsInChildren.Length - 1; j++)
					{
						GameObject gameObject = ((Component)componentsInChildren[j]).gameObject;
						if ((Object)(object)gameObject != (Object)null)
						{
							gameObject.layer = 11;
						}
					}
				}
			}
			((Component)((Component)ControllingSosig.Links[0]).gameObject.GetComponentInChildren<MeshRenderer>()).gameObject.layer = 11;
			sosigBodyFollower = new GameObject().transform;
			sosigBodyFollower.SetParent(((Component)ControllingSosig.Links[1]).transform);
			sosigBodyFollower.localPosition = new Vector3(0f, 0.55f, 0f);
			SetupHealthMeter();
			StoredSosigHeadAngularDrag = ((Component)ControllingSosig.Links[0]).GetComponent<Rigidbody>().angularDrag;
			((Component)ControllingSosig.Links[0]).GetComponent<Rigidbody>().angularDrag = 100f;
			storedSosigAimPoint = ((Component)ControllingSosig.Hand_Primary.Point_Aimed).transform.localPosition;
			if (!IsLeftie)
			{
				foreach (SosigHand hand in ControllingSosig.Hands)
				{
					((Component)hand.Point_Aimed).transform.localPosition = new Vector3(0f - ((Component)hand.Point_Aimed).transform.localPosition.x, ((Component)hand.Point_Aimed).transform.localPosition.y + 0.17f, ((Component)hand.Point_Aimed).transform.localPosition.z);
					((Component)hand.Point_HipFire).transform.localPosition = new Vector3(0f - ((Component)hand.Point_HipFire).transform.localPosition.x, ((Component)hand.Point_HipFire).transform.localPosition.y, ((Component)hand.Point_HipFire).transform.localPosition.z);
					((Component)hand.Point_AtRest).transform.localPosition = new Vector3(0f - ((Component)hand.Point_AtRest).transform.localPosition.x, ((Component)hand.Point_AtRest).transform.localPosition.y, ((Component)hand.Point_AtRest).transform.localPosition.z);
					((Component)hand.Point_ShieldHold).transform.localPosition = new Vector3(0f - ((Component)hand.Point_ShieldHold).transform.localPosition.x, ((Component)hand.Point_ShieldHold).transform.localPosition.y, ((Component)hand.Point_ShieldHold).transform.localPosition.z);
				}
				foreach (Slot slot in ControllingSosig.Inventory.Slots)
				{
					((Component)slot.Target).transform.localPosition = new Vector3(0f - ((Component)slot.Target).transform.localPosition.x, ((Component)slot.Target).transform.localPosition.y, ((Component)slot.Target).transform.localPosition.z);
				}
			}
			else
			{
				foreach (SosigHand hand2 in ControllingSosig.Hands)
				{
					((Component)hand2.Point_Aimed).transform.localPosition = new Vector3(0f - ((Component)hand2.Point_Aimed).transform.localPosition.x, ((Component)hand2.Point_Aimed).transform.localPosition.y + 0.17f, ((Component)hand2.Point_Aimed).transform.localPosition.z);
				}
			}
			((Component)ControllingSosig.Hand_Primary.Point_Aimed).transform.SetParent(((Component)ControllingSosig.Links[0]).transform);
			sosigIFF = ControllingSosig.GetIFF();
			ControllingSosig.Priority.RecentEvents = new List<AIEvent>();
		}

		public void ReleaseSosig()
		{
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0363: Unknown result type (might be due to invalid IL or missing references)
			//IL_0378: Unknown result type (might be due to invalid IL or missing references)
			//IL_037d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0398: Unknown result type (might be due to invalid IL or missing references)
			//IL_039d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: 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_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e7: 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_02b5: 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_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_02f3: Unknown result type (might be due to invalid IL or missing references)
			CancelReload();
			droneCam.fieldOfView = MaxFOV;
			isControllingSosig = false;
			CameraRigidbody.isKinematic = false;
			currentGun = null;
			currentGunInterface = null;
			currentHand = null;
			ControllingParticleSystem.SetActive(false);
			if (!((Object)(object)ControllingSosig != (Object)null))
			{
				return;
			}
			((Component)ControllingSosig.Hand_Primary.Point_Aimed).transform.SetParent(((Component)((Component)ControllingSosig.Links[1]).transform.Find("HandRoot")).transform);
			if (!IsLeftie)
			{
				foreach (SosigHand hand in ControllingSosig.Hands)
				{
					((Component)hand.Point_Aimed).transform.localPosition = new Vector3(0f - ((Component)hand.Point_Aimed).transform.localPosition.x, ((Component)hand.Point_Aimed).transform.localPosition.y - 0.17f, ((Component)hand.Point_Aimed).transform.localPosition.z);
					((Component)hand.Point_HipFire).transform.localPosition = new Vector3(0f - ((Component)hand.Point_HipFire).transform.localPosition.x, ((Component)hand.Point_HipFire).transform.localPosition.y, ((Component)hand.Point_HipFire).transform.localPosition.z);
					((Component)hand.Point_AtRest).transform.localPosition = new Vector3(0f - ((Component)hand.Point_AtRest).transform.localPosition.x, ((Component)hand.Point_AtRest).transform.localPosition.y, ((Component)hand.Point_AtRest).transform.localPosition.z);
					((Component)hand.Point_ShieldHold).transform.localPosition = new Vector3(0f - ((Component)hand.Point_ShieldHold).transform.localPosition.x, ((Component)hand.Point_ShieldHold).transform.localPosition.y, ((Component)hand.Point_ShieldHold).transform.localPosition.z);
				}
				foreach (Slot slot in ControllingSosig.Inventory.Slots)
				{
					((Component)slot.Target).transform.localPosition = new Vector3(0f - ((Component)slot.Target).transform.localPosition.x, ((Component)slot.Target).transform.localPosition.y, ((Component)slot.Target).transform.localPosition.z);
				}
			}
			else
			{
				foreach (SosigHand hand2 in ControllingSosig.Hands)
				{
					((Component)hand2.Point_Aimed).transform.localPosition = new Vector3(((Component)hand2.Point_Aimed).transform.localPosition.x, ((Component)hand2.Point_Aimed).transform.localPosition.y - 0.17f, ((Component)hand2.Point_Aimed).transform.localPosition.z);
				}
			}
			((Component)ControllingSosig.Hand_Primary.Point_Aimed).transform.localPosition = storedSosigAimPoint;
			((Component)ControllingSosig.Links[0]).GetComponent<Rigidbody>().angularDrag = StoredSosigHeadAngularDrag;
			ControllingSosig.IsAllowedToSpeak = true;
			((Component)((Component)ControllingSosig.Links[0]).gameObject.GetComponentInChildren<MeshRenderer>()).gameObject.layer = 20;
			ControllingSosig.MaxHearingRange = storedHearingRange;
			ControllingSosig.MaxSightRange = storedSightRange;
			ControllingSosig.CanPickup_Melee = true;
			ControllingSosig.CanPickup_Ranged = true;
			ControllingSosig.CanPickup_Other = true;
			ControllingSosig.m_tickDownToRandomLook = 20f;
			sosigWeps.Clear();
			if (ControllingSosig.Links[0].m_wearables.Count > 0)
			{
				foreach (SosigWearable wearable in ControllingSosig.Links[0].m_wearables)
				{
					((Component)wearable).gameObject.layer = 0;
				}
			}
			ControllingSosig = null;
		}

		public void NadeOut()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Invalid comparison between Unknown and I4
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Invalid comparison between Unknown and I4
			if (sosigWeps == null)
			{
				return;
			}
			if ((Object)(object)currentGun != (Object)null && (int)currentGun.Type == 2)
			{
				ThrowTheCheese();
				return;
			}
			foreach (SosigWeapon sosigWep in sosigWeps)
			{
				if ((int)sosigWep.Type == 2 && (Object)(object)sosigWep != (Object)(object)currentGun)
				{
					ControllingSosig.Inventory.SwapObjectFromHandToObjectInInventory(currentGun, sosigWep);
					currentGun = sosigWep;
					SosigWeaponPlayerInterface component = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
					if ((Object)(object)component != (Object)null)
					{
						currentGunInterface = component;
					}
					ThrowTheCheese();
					break;
				}
			}
		}

		public void ThrowTheCheese()
		{
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: 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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Invalid comparison between Unknown and I4
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Invalid comparison between Unknown and I4
			if ((Object)(object)currentGun != (Object)null && sosigWeps != null && (int)currentGun.Type != 1)
			{
				foreach (SosigWeapon sosigWep in sosigWeps)
				{
					if ((int)sosigWep.Type != 1 || !((Object)(object)sosigWep != (Object)(object)currentGun))
					{
						continue;
					}
					if ((Object)(object)currentGun != (Object)null)
					{
						ControllingSosig.Inventory.SwapObjectFromHandToObjectInInventory(currentGun, sosigWep);
						currentGun = sosigWep;
						SosigWeaponPlayerInterface component = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
						if ((Object)(object)component != (Object)null)
						{
							currentGunInterface = component;
						}
					}
					else
					{
						ControllingSosig.ForceEquip(sosigWep);
						currentGun = sosigWep;
						SosigWeaponPlayerInterface component2 = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
						if ((Object)(object)component2 != (Object)null)
						{
							currentGunInterface = component2;
						}
					}
					break;
				}
			}
			if ((Object)(object)currentGun != (Object)null)
			{
				Vector3 position = Crosshair2.transform.position;
				Vector3 val = position - ((Component)currentGun).transform.position;
				Vector3 val2 = ((Vector3)(ref val)).normalized * throwForce;
				if ((Object)(object)currentGun.Pin != (Object)null)
				{
					currentGun.Pin.ForceExpelPin();
				}
				currentHand.ThrowObject(Vector3.ClampMagnitude(val2 + Random.onUnitSphere, Mathf.Max(((Vector3)(ref val2)).magnitude - 3f, 2f)) * 1f, Crosshair2.transform.position);
				sosigWeps.Remove(currentGun);
				currentGun = null;
				currentGunInterface = null;
			}
		}

		public void changeWeapons()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			SosigWeapon val = null;
			if (currentHand == null && (Object)(object)ControllingSosig != (Object)null)
			{
				currentHand = ControllingSosig.Hand_Primary;
				Debug.Log((object)"the grab fix fired");
			}
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val2, 3f, LayerMask.op_Implicit(GunPickup)))
			{
				val = ((Component)((RaycastHit)(ref val2)).collider).gameObject.GetComponentInParent<SosigWeapon>();
			}
			if ((Object)(object)currentGun != (Object)null && (Object)(object)val != (Object)null && !val.IsHeldByBot && !val.IsInBotInventory)
			{
				sosigWeps.Remove(currentGun);
				currentHand.DropHeldObject();
				currentHand.PickUp(val);
				currentGun = val;
				SosigWeaponPlayerInterface component = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
				if ((Object)(object)component != (Object)null)
				{
					currentGunInterface = component;
				}
			}
			else if ((Object)(object)currentGun == (Object)null && (Object)(object)val != (Object)null && !val.IsHeldByBot && !val.IsInBotInventory)
			{
				currentHand.PickUp(val);
				currentGun = val;
				SosigWeaponPlayerInterface component2 = ((Component)currentGun).GetComponent<SosigWeaponPlayerInterface>();
				if ((Object)(object)component2 != (Object)null)
				{
					currentGunInterface = component2;
				}
			}
		}

		public void setupObject()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)this).transform.position, ((Component)this).transform.forward, ref val, 100f, LayerMask.op_Implicit(mask)))
			{
				FVRPhysicalObject componentInParent = ((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponentInParent<FVRPhysicalObject>();
				if ((Object)(object)componentInParent != (Object)null)
				{
					isControllingObject = true;
					currentObject = componentInParent;
					CRB = ((Component)componentInParent).GetComponent<Rigidbody>();
				}
			}
		}

		public void ReleaseObject()
		{
			isControllingObject = false;
			currentObject = null;
			CRB = null;
			if (!((Object)(object)currentObject != (Object)null))
			{
			}
		}

		public void UIUpdate()
		{
			if ((Object)(object)currentGun != (Object)null)
			{
				string text = currentGun.GetShotsLeft().ToString() + "/" + currentGun.ShotsPerLoad;
				AmmoCounter.text = text;
				GunName.text = ((FVRPhysicalObject)currentGunInterface).ObjectWrapper.DisplayName;
			}
			else if ((Object)(object)currentGun == (Object)null)
			{
				string text2 = "0/0";
				AmmoCounter.text = text2;
				GunName.text = "";
			}
			if ((Object)(object)ControllingSosig != (Object)null)
			{
				sosigHealthMeterUpdate();
			}
		}

		public void ReloadCurrentWeapon()
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			if (!isReloading && (Object)(object)currentGun != (Object)null && (int)currentGun.Type == 0)
			{
				((MonoBehaviour)this).StartCoroutine("reloadingGun");
			}
		}

		private IEnumerator reloadingGun()
		{
			if ((Object)(object)currentGun != (Object)null && (int)currentGun.Type == 0)
			{
				isReloading = true;
				IEnumerator reloadMeterCoroutine = reloadMeter(currentGun.ReloadTime);
				((MonoBehaviour)this).StartCoroutine(reloadMeterCoroutine);
				yield return (object)new WaitForSeconds(currentGun.ReloadTime);
				isReloading = false;
				currentGun.m_shotsLeft = currentGun.ShotsPerLoad;
			}
			else
			{
				CancelReload();
			}
		}

		private IEnumerator reloadMeter(float ReloadTime)
		{
			((Component)reloadingImage).gameObject.SetActive(true);
			float ReloadTimeLeft = 0f;
			float multiplier = 1f / ReloadTime;
			while (ReloadTimeLeft < ReloadTime)
			{
				if ((Object)(object)currentGun != (Object)null)
				{
					ReloadTimeLeft += Time.deltaTime;
					reloadingImage.fillAmount = ReloadTimeLeft * multiplier;
					yield return null;
				}
				else
				{
					ReloadTimeLeft = ReloadTime;
					reloadingImage.fillAmount = 0f;
					yield return null;
				}
			}
			((Component)reloadingImage).gameObject.SetActive(false);
		}

		public void CancelReload()
		{
			((MonoBehaviour)this).StopCoroutine("reloadingGun");
			((MonoBehaviour)this).StopCoroutine("reloadMeter");
			((Component)reloadingImage).gameObject.SetActive(false);
		}

		public void sosigHealthMeterUpdate()
		{
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			for (int i = 0; i <= 3; i++)
			{
				if (LinkIntegrityLastFrame[i] != Mathf.Floor(ControllingSosig.Links[i].m_integrity))
				{
					LinkIntegrityLastFrame[i] = Mathf.Floor(ControllingSosig.Links[i].m_integrity);
					flag = true;
				}
			}
			if (MustardAmountLastFrame != ControllingSosig.Mustard)
			{
				flag = true;
				MustardAmountLastFrame = ControllingSosig.Mustard;
			}
			if (flag)
			{
				for (int j = 0; j <= 3; j++)
				{
					((Graphic)LinkImages[j]).color = HealthGradient.Evaluate(LinkIntegrityLastFrame[j] / 100f);
				}
				for (int k = 0; k <= 3; k++)
				{
					LinkTexts[k].text = Mathf.Floor(ControllingSosig.Links[k].m_integrity) + "%";
				}
				LinkTexts[4].text = "Mustard: " + Mathf.Floor(ControllingSosig.Mustard);
				((Graphic)LinkTexts[4]).color = HealthGradient.Evaluate(ControllingSosig.Mustard / 100f);
				showHealthTime = healthShowTime;
				((MonoBehaviour)this).StopCoroutine("ShowCurrentHealth");
				((MonoBehaviour)this).StartCoroutine("ShowCurrentHealth");
			}
		}

		public void SetupHealthMeter()
		{
			for (int i = 0; i <= 3; i++)
			{
				LinkIntegrityLastFrame[i] = ControllingSosig.Links[i].m_integrity;
			}
			MustardAmountLastFrame = ControllingSosig.Mustard;
		}

		private IEnumerator ShowCurrentHealth()
		{
			float timeSinceStart = 0f;
			while (showHealthTime > 0f)
			{
				showHealthTime -= Time.deltaTime + 0.01f;
				timeSinceStart += Time.deltaTime + 0.01f;
				if ((Object)(object)ControllingSosig != (Object)null)
				{
					for (int i = 0; i <= 3; i++)
					{
						((Graphic)LinkImages[i]).color = Color.op_Implicit(new Vector4(((Graphic)LinkImages[i]).color.r, ((Graphic)LinkImages[i]).color.g, ((Graphic)LinkImages[i]).color.b, HealthAlphaKey.Evaluate(1f / healthShowTime * timeSinceStart).a));
						((Graphic)LinkTexts[i]).color = HealthAlphaKey.Evaluate(1f / healthShowTime * timeSinceStart);
					}
					((Graphic)LinkTexts[4]).color = Color.op_Implicit(new Vector4(((Graphic)LinkTexts[4]).color.r, ((Graphic)LinkTexts[4]).color.g, ((Graphic)LinkTexts[4]).color.b, HealthAlphaKey.Evaluate(1f / healthShowTime * timeSinceStart).a));
				}
				else
				{
					for (int j = 0; j <= 3; j++)
					{
						((Graphic)LinkImages[j]).color = Color.op_Implicit(new Vector4(((Graphic)LinkImages[j]).color.r, ((Graphic)LinkImages[j]).color.g, ((Graphic)LinkImages[j]).color.b, HealthAlphaKey.Evaluate(1f).a));
						((Graphic)LinkTexts[j]).color = HealthAlphaKey.Evaluate(1f);
					}
					((Graphic)LinkTexts[4]).color = HealthAlphaKey.Evaluate(1f);
				}
				yield return (object)new WaitForSeconds(0.01f);
			}
			yield return null;
		}

		public void IFFShow(int iff)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			if (iff == sosigIFF)
			{
				ReticleMaterial.color = Friend;
			}
			else
			{
				ReticleMaterial.color = Enemy;
			}
		}

		public void NavigateSosigList(bool b)
		{
			if (b)
			{
				if (LAMBDAPlugin.ExistingSosigs.Count == 0)
				{
					return;
				}
				bool flag = false;
				if (LAMBDAPlugin.ExistingSosigs.Count > 1)
				{
					flag = true;
				}
				int index = 0;
				if (flag && isControllingSosig)
				{
					index = LAMBDAPlugin.ExistingSosigs.IndexOf(ControllingSosig) + 1;
					if (index == LAMBDAPlugin.ExistingSosigs.Count)
					{
						index = 0;
					}
					ReleaseSosig();
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index]);
				}
				else if (isControllingObject)
				{
					ReleaseObject();
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index]);
				}
				else if (!isControllingSosig)
				{
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index]);
				}
			}
			else
			{
				if (b || LAMBDAPlugin.ExistingSosigs.Count == 0)
				{
					return;
				}
				bool flag2 = false;
				if (LAMBDAPlugin.ExistingSosigs.Count > 1)
				{
					flag2 = true;
				}
				int index2 = 0;
				if (flag2 && isControllingSosig)
				{
					index2 = LAMBDAPlugin.ExistingSosigs.IndexOf(ControllingSosig) - 1;
					if (index2 < 0)
					{
						index2 = LAMBDAPlugin.ExistingSosigs.Count - 1;
					}
					ReleaseSosig();
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index2]);
				}
				else if (isControllingObject)
				{
					ReleaseObject();
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index2]);
				}
				else if (!isControllingSosig)
				{
					SetupSosigCamera(LAMBDAPlugin.ExistingSosigs[index2]);
				}
			}
		}
	}
}
public class GetDataPath : MonoBehaviour
{
	private void Start()
	{
		Debug.Log((object)Path.Combine(Application.dataPath, "Managed/"));
	}

	private void Update()
	{
	}
}
[BepInPlugin("MeatKit", "MeatKit Plugin", "1.0.0")]
[BepInProcess("h3vr.exe")]
public class MeatKitPlugin : BaseUnityPlugin
{
	private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

	internal static ManualLogSource Logger;

	private void Awake()
	{
		Logger = ((BaseUnityPlugin)this).Logger;
		LoadAssets();
	}

	private void LoadAssets()
	{
	}
}
public class ReloadScene : MonoBehaviour
{
	public static bool isReloaded = false;

	private void Start()
	{
		Debug.Log((object)"SceneHasReloadedBlehg");
		if (!isReloaded)
		{
			((MonoBehaviour)this).StartCoroutine(Restart());
		}
	}

	private void Update()
	{
		//IL_0011: Unknown result type (might be due to invalid IL or missing references)
		//IL_0016: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKeyDown((KeyCode)264))
		{
			Scene activeScene = SceneManager.GetActiveScene();
			SceneManager.LoadScene(((Scene)(ref activeScene)).name);
		}
		else if (Input.GetKeyDown((KeyCode)116))
		{
			ClearLog();
		}
	}

	private IEnumerator Restart()
	{
		yield return (object)new WaitForSeconds(0.5f);
		Scene scene = SceneManager.GetActiveScene();
		SceneManager.LoadScene(((Scene)(ref scene)).name);
		isReloaded = true;
	}

	private IEnumerator DelayedFunctions()
	{
		yield return (object)new WaitForSeconds(0.5f);
	}

	private void ClearLog()
	{
		Assembly assembly = Assembly.GetAssembly(typeof(ActiveEditorTracker));
		Type type = assembly.GetType("UnityEditorInternal.LogEntries");
		MethodInfo method = type.GetMethod("Clear");
		method.Invoke(new object(), null);
	}
}
public class ExtrudeRandomEdges : MonoBehaviour
{
	private pb_Object pb;

	private pb_Face lastExtrudedFace = null;

	public float distance = 1f;

	private void Start()
	{
		pb = pb_ShapeGenerator.PlaneGenerator(1f, 1f, 0, 0, (Axis)2, false);
		pb.SetFaceMaterial(pb.faces, pb_Constant.DefaultMaterial);
		lastExtrudedFace = pb.faces[0];
	}

	private void OnGUI()
	{
		if (GUILayout.Button("Extrude Random Edge", (GUILayoutOption[])(object)new GUILayoutOption[0]))
		{
			ExtrudeEdge();
		}
	}

	private void ExtrudeEdge()
	{
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_009b: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
		//IL_00df: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0101: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_0122: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_016c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0174: Unknown result type (might be due to invalid IL or missing references)
		pb_Face sourceFace = lastExtrudedFace;
		List<pb_WingedEdge> wingedEdges = pb_WingedEdge.GetWingedEdges(pb, false);
		IEnumerable<pb_WingedEdge> source = wingedEdges.Where((pb_WingedEdge x) => x.face == sourceFace);
		List<pb_Edge> list = (from x in source
			where x.opposite == null
			select x into y
			select y.edge.local).ToList();
		int index = Random.Range(0, list.Count);
		pb_Edge val = list[index];
		Vector3 val2 = (pb.vertices[val.x] + pb.vertices[val.y]) * 0.5f - pb_Math.Average<int>((IList<int>)sourceFace.distinctIndices, (Func<int, Vector3>)((int x) => pb.vertices[x]), (IList<int>)null);
		((Vector3)(ref val2)).Normalize();
		pb_Edge[] selectedEdges = default(pb_Edge[]);
		pbMeshOps.Extrude(pb, (pb_Edge[])(object)new pb_Edge[1] { val }, 0f, false, true, ref selectedEdges);
		lastExtrudedFace = pb.faces.Last();
		pb.SetSelectedEdges((IEnumerable<pb_Edge>)selectedEdges);
		pb_Object_Utility.TranslateVertices(pb, pb.SelectedTriangles, val2 * distance);
		pb.ToMesh();
		pb.Refresh((RefreshMask)255);
	}
}
public class HighlightNearestFace : MonoBehaviour
{
	public float travel = 50f;

	public float speed = 0.2f;

	private pb_Object target;

	private pb_Face nearest = null;

	private void Start()
	{
		//IL_0061: 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_00c0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
		target = pb_ShapeGenerator.PlaneGenerator(travel, travel, 25, 25, (Axis)2, false);
		target.SetFaceMaterial(target.faces, pb_Constant.DefaultMaterial);
		((Component)target).transform.position = new Vector3(travel * 0.5f, 0f, travel * 0.5f);
		target.ToMesh();
		target.Refresh((RefreshMask)255);
		Camera main = Camera.main;
		((Component)main).transform.position = new Vector3(25f, 40f, 0f);
		((Component)main).transform.localRotation = Quaternion.Euler(new Vector3(65f, 0f, 0f));
	}

	private void Update()
	{
		//IL_0048: Unknown result type (might be due to invalid IL or missing references)
		//IL_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_0085: Unknown result type (might be due to invalid IL or missing references)
		//IL_008a: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: Unknown result type (might be due to invalid IL or missing references)
		float num = Time.time * speed;
		Vector3 position = default(Vector3);
		((Vector3)(ref position))..ctor(Mathf.PerlinNoise(num, num) * travel, 2f, Mathf.PerlinNoise(num + 1f, num + 1f) * travel);
		((Component)this).transform.position = position;
		if ((Object)(object)target == (Object)null)
		{
			Debug.LogWarning((object)"Missing the ProBuilder Mesh target!");
			return;
		}
		Vector3 val = ((Component)target).transform.InverseTransformPoint(((Component)this).transform.position);
		if (nearest != null)
		{
			target.SetFaceColor(nearest, Color.white);
		}
		int num2 = target.faces.Length;
		float num3 = float.PositiveInfinity;
		nearest = target.faces[0];
		for (int i = 0; i < num2; i++)
		{
			float num4 = Vector3.Distance(val, FaceCenter(target, target.faces[i]));
			if (num4 < num3)
			{
				num3 = num4;
				nearest = target.faces[i];
			}
		}
		target.SetFaceColor(nearest, Color.blue);
		target.RefreshColors();
	}

	private Vector3 FaceCenter(pb_Object pb, pb_Face face)
	{
		//IL_0008: Unknown result type (might be due to invalid IL or missing references)
		//IL_000d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00be: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
		Vector3[] vertices = pb.vertices;
		Vector3 zero = Vector3.zero;
		int[] distinctIndices = face.distinctIndices;
		foreach (int num in distinctIndices)
		{
			zero.x += vertices[num].x;
			zero.y += vertices[num].y;
			zero.z += vertices[num].z;
		}
		float num2 = face.distinctIndices.Length;
		zero.x /= num2;
		zero.y /= num2;
		zero.z /= num2;
		return zero;
	}
}