M2.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;

[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 JerryComponent
{
	public class M1Bite : MonoBehaviour
	{
		public ClosedBoltWeapon Garand;

		public FVRViveHand HandToBite;

		public bool boltopened = false;

		public bool readytobite = false;

		public bool bite = false;

		public Transform boltstuckpos;

		public Transform handbitepos;

		public int chance;

		public GameObject Ouch;

		public bool Stucked = false;

		public bool bited = false;

		public float cd = 1.5f;

		public AudioEvent boltclose;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: 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_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: 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_017d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_039b: Unknown result type (might be due to invalid IL or missing references)
			//IL_046a: Unknown result type (might be due to invalid IL or missing references)
			//IL_047a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0401: Unknown result type (might be due to invalid IL or missing references)
			//IL_0406: Unknown result type (might be due to invalid IL or missing references)
			//IL_0424: Unknown result type (might be due to invalid IL or missing references)
			//IL_0429: Unknown result type (might be due to invalid IL or missing references)
			//IL_0442: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: 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_0544: Unknown result type (might be due to invalid IL or missing references)
			//IL_0554: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0503: Unknown result type (might be due to invalid IL or missing references)
			//IL_0508: Unknown result type (might be due to invalid IL or missing references)
			//IL_0521: Unknown result type (might be due to invalid IL or missing references)
			//IL_0526: Unknown result type (might be due to invalid IL or missing references)
			//IL_052f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0572: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)HandToBite == (Object)null)
			{
			}
			if (bite)
			{
				if (!Stucked)
				{
					Object.Instantiate<GameObject>(Ouch, ((Component)this).gameObject.transform.position, ((Component)this).gameObject.transform.rotation);
					Stucked = true;
				}
				cd -= Time.deltaTime;
				if (cd > 0f)
				{
					HandToBite.Display_Controller.transform.position = handbitepos.position;
					((Component)Garand.Bolt).gameObject.transform.localPosition = new Vector3(((Component)Garand.Bolt).gameObject.transform.localPosition.x, ((Component)Garand.Bolt).gameObject.transform.localPosition.y, ((Component)boltstuckpos).transform.localPosition.z);
				}
				else if (cd <= 0f)
				{
					SM.PlayCoreSound((FVRPooledAudioType)41, boltclose, ((Component)this).gameObject.transform.position);
					((Component)Garand.Bolt).gameObject.transform.localPosition = new Vector3(((Component)Garand.Bolt).gameObject.transform.localPosition.x, ((Component)Garand.Bolt).gameObject.transform.localPosition.y, ((Component)Garand.Bolt.Point_Bolt_Forward).transform.localPosition.z);
					cd = 1.5f;
					bite = false;
					bited = false;
					Stucked = false;
					readytobite = true;
					Garand.Bolt.Speed_Forward = 4f;
					HandToBite.Display_Controller.transform.localPosition = new Vector3(0f, 0f, 0f);
				}
			}
			if ((Object)(object)((FVRFireArm)Garand).Magazine == (Object)null && (int)Garand.Bolt.CurPos != 0)
			{
				boltopened = true;
			}
			else if ((Object)(object)((FVRFireArm)Garand).Magazine != (Object)null && (int)Garand.Bolt.CurPos == 0)
			{
				boltopened = false;
				Garand.Bolt.Speed_Forward = 4f;
			}
			if (!boltopened || !((Object)(object)((FVRFireArm)Garand).Magazine != (Object)null))
			{
				return;
			}
			if (readytobite)
			{
				chance = 0;
				chance = Random.Range(0, 10);
				readytobite = false;
			}
			if ((Object)(object)HandToBite != (Object)null && chance > 8)
			{
				Garand.Bolt.Speed_Forward = 2f;
				if (!bited)
				{
					bite = true;
					bited = true;
				}
			}
			else if ((Object)(object)HandToBite == (Object)null || chance < 9)
			{
				if (Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, ((Component)this).gameObject.transform.position) <= 0.1f)
				{
					HandToBite = GM.CurrentMovementManager.Hands[0];
					Garand.Bolt.Speed_Forward = 0f;
					((Component)Garand.Bolt).gameObject.transform.localPosition = new Vector3(((Component)Garand.Bolt).gameObject.transform.localPosition.x, ((Component)Garand.Bolt).gameObject.transform.localPosition.y, Garand.Bolt.Point_Bolt_LockPoint.localPosition.z);
				}
				else if (Vector3.Distance(GM.CurrentMovementManager.RightHand.position, ((Component)this).gameObject.transform.position) <= 0.1f)
				{
					HandToBite = GM.CurrentMovementManager.Hands[1];
					Garand.Bolt.Speed_Forward = 0f;
					((Component)Garand.Bolt).gameObject.transform.localPosition = new Vector3(((Component)Garand.Bolt).gameObject.transform.localPosition.x, ((Component)Garand.Bolt).gameObject.transform.localPosition.y, Garand.Bolt.Point_Bolt_LockPoint.localPosition.z);
				}
				if (Vector3.Distance(GM.CurrentMovementManager.LeftHand.position, ((Component)this).gameObject.transform.position) > 0.1f && Vector3.Distance(GM.CurrentMovementManager.RightHand.position, ((Component)this).gameObject.transform.position) > 0.1f)
				{
					Garand.Bolt.Speed_Forward = 4f;
					bite = false;
					readytobite = true;
				}
			}
		}
	}
	public class TacShotGunReload : MonoBehaviour
	{
		public TubeFedShotgun Gun;

		public FVRFireArmChamber realChamber;

		public FVRFireArmChamber lsChamber;

		public GameObject barrelSW;

		public GameObject handguardSW;

		public GameObject barrelL;

		public GameObject barrelS;

		public GameObject handGF;

		public GameObject handGA;

		public bool isGrabL = false;

		public bool isGrabR = false;

		public Transform slapDir;

		public Vector3 velLinearWorldL;

		public Vector3 velLinearWorldR;

		public Transform lsChamberEjectPos;

		public GameObject carrier;

		public FVRFireArmRound readyR;

		public Transform ejectpos;

		public AudioEvent grab;

		public GameObject release;

		public Collider col;

		private void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)readyR == (Object)null && (Object)(object)((Component)other).gameObject.GetComponent<FVRFireArmRound>() != (Object)null)
			{
				readyR = ((Component)other).gameObject.GetComponent<FVRFireArmRound>();
			}
		}

		private void FixedUpdate()
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: 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_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)readyR != (Object)null)
			{
				carrier.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
				if (readyR.IsChambered || Vector3.Distance(((Component)readyR).gameObject.transform.position, ((Component)this).gameObject.transform.position) >= 0.075f)
				{
					readyR = null;
				}
			}
			if ((Object)(object)readyR == (Object)null)
			{
				carrier.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (barrelSW.transform.localEulerAngles.x < 45f)
			{
				barrelL.SetActive(true);
				barrelS.SetActive(false);
			}
			if (barrelSW.transform.localEulerAngles.x > 45f)
			{
				barrelL.SetActive(false);
				barrelS.SetActive(true);
			}
			if (handguardSW.transform.localEulerAngles.x < 45f)
			{
				handGF.SetActive(true);
				handGA.SetActive(false);
			}
			if (handguardSW.transform.localEulerAngles.x > 45f)
			{
				handGF.SetActive(false);
				handGA.SetActive(true);
			}
		}

		private void Update()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_044a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0559: Unknown result type (might be due to invalid IL or missing references)
			//IL_0564: Unknown result type (might be due to invalid IL or missing references)
			//IL_048e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0493: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0336: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_071a: Unknown result type (might be due to invalid IL or missing references)
			//IL_071f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0724: Unknown result type (might be due to invalid IL or missing references)
			//IL_0740: Unknown result type (might be due to invalid IL or missing references)
			//IL_075a: Unknown result type (might be due to invalid IL or missing references)
			//IL_060c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0617: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0407: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0679: Unknown result type (might be due to invalid IL or missing references)
			//IL_0693: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: 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_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)GM.CurrentMovementManager != (Object)null))
			{
				return;
			}
			velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld;
			velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld;
			if (realChamber.IsFull)
			{
				release.SetActive(true);
				col.enabled = false;
			}
			if (Gun.Bolt.m_isBoltLocked && realChamber.IsAccessible && lsChamber.IsFull)
			{
				if (!isGrabL && !isGrabR && (Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && Vector3.Distance(((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position, slapDir.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapDir.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.25f)
				{
					SM.PlayCoreSound((FVRPooledAudioType)41, grab, ((Component)lsChamber).gameObject.transform.position);
					isGrabL = true;
					isGrabR = false;
					col.enabled = true;
				}
				if (!isGrabL && !isGrabR && (Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && Vector3.Distance(((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position, slapDir.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapDir.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.25f)
				{
					SM.PlayCoreSound((FVRPooledAudioType)41, grab, ((Component)lsChamber).gameObject.transform.position);
					isGrabL = false;
					isGrabR = true;
					col.enabled = true;
				}
			}
			if (isGrabL && lsChamber.IsFull)
			{
				if (Vector3.Distance(((Component)realChamber).gameObject.transform.position, ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position) <= 0.5f)
				{
					if (Vector3.Distance(((Component)lsChamber).gameObject.transform.position, ejectpos.position) > 0.02f)
					{
						GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(false);
						release.SetActive(false);
						((Component)lsChamber).gameObject.transform.position = ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position;
						((Component)lsChamber).gameObject.transform.eulerAngles = ((Component)realChamber).gameObject.transform.eulerAngles;
					}
					else if (Vector3.Distance(((Component)lsChamber).gameObject.transform.position, ejectpos.position) <= 0.02f)
					{
						GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true);
						FVRFireArmRound round = lsChamber.m_round;
						lsChamber.SetRound((FVRFireArmRound)null, false);
						round.Chamber(realChamber, true);
						((Component)lsChamber).gameObject.transform.localPosition = Vector3.zero;
						((Component)lsChamber).gameObject.transform.localEulerAngles = Vector3.zero;
						isGrabL = false;
					}
				}
				else if (Vector3.Distance(((Component)realChamber).gameObject.transform.position, ((Component)GM.CurrentMovementManager.Hands[0]).gameObject.transform.position) > 0.5f)
				{
					GM.CurrentMovementManager.Hands[0].Display_Controller.SetActive(true);
					release.SetActive(true);
					lsChamber.EjectRound(lsChamberEjectPos.position, Vector3.zero, Vector3.zero, false);
					((Component)lsChamber).gameObject.transform.localPosition = Vector3.zero;
					((Component)lsChamber).gameObject.transform.localEulerAngles = Vector3.zero;
					col.enabled = false;
					isGrabL = false;
				}
			}
			if (!isGrabR || !lsChamber.IsFull)
			{
				return;
			}
			if (Vector3.Distance(((Component)realChamber).gameObject.transform.position, ((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position) <= 0.5f)
			{
				if (Vector3.Distance(((Component)lsChamber).gameObject.transform.position, ejectpos.position) > 0.02f)
				{
					GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(false);
					release.SetActive(false);
					((Component)lsChamber).gameObject.transform.position = ((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position;
					((Component)lsChamber).gameObject.transform.eulerAngles = ((Component)realChamber).gameObject.transform.eulerAngles;
				}
				else if (Vector3.Distance(((Component)lsChamber).gameObject.transform.position, ejectpos.position) <= 0.02f)
				{
					GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(true);
					FVRFireArmRound round2 = lsChamber.m_round;
					lsChamber.SetRound((FVRFireArmRound)null, false);
					round2.Chamber(realChamber, true);
					((Component)lsChamber).gameObject.transform.localPosition = Vector3.zero;
					((Component)lsChamber).gameObject.transform.localEulerAngles = Vector3.zero;
					isGrabR = false;
				}
			}
			else if (Vector3.Distance(((Component)realChamber).gameObject.transform.position, ((Component)GM.CurrentMovementManager.Hands[1]).gameObject.transform.position) > 0.5f)
			{
				GM.CurrentMovementManager.Hands[1].Display_Controller.SetActive(true);
				release.SetActive(true);
				lsChamber.EjectRound(lsChamberEjectPos.position, Vector3.zero, Vector3.zero, false);
				((Component)lsChamber).gameObject.transform.localPosition = Vector3.zero;
				((Component)lsChamber).gameObject.transform.localEulerAngles = Vector3.zero;
				col.enabled = false;
				isGrabR = false;
			}
		}
	}
}
namespace JerryAr.M2
{
	[BepInPlugin("JerryAr.M2", "M2", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class M2Plugin : 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()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "JerryAr.M2");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.M2", "", "", "m2tg", "");
		}
	}
}
namespace JerryComponent
{
	public class ForeSightEnableandDisable : MonoBehaviour
	{
		public FVRFireArmAttachment MainObj;

		public GameObject fakeoptic;

		public GameObject realoptic;

		private void Start()
		{
		}

		private void Update()
		{
			if ((Object)(object)MainObj.curMount != (Object)null)
			{
				if (MainObj.curMount.AttachmentsList.Count >= 2)
				{
					fakeoptic.SetActive(true);
					realoptic.SetActive(false);
				}
				else if (MainObj.curMount.AttachmentsList.Count <= 1)
				{
					fakeoptic.SetActive(false);
					realoptic.SetActive(true);
				}
			}
			else if ((Object)(object)MainObj.curMount == (Object)null)
			{
				fakeoptic.SetActive(false);
				realoptic.SetActive(true);
			}
		}
	}
	public class RossMKIV : MonoBehaviour
	{
		public SRG Gun;

		public FVRFireArmAttachmentMount Mount;

		public int FireMode;

		public GameObject Slide;

		public Transform fore;

		public Transform rear;

		public int burst = 5;

		public float cd = 0.05f;

		public AR15HandleSightFlipper Eject;

		public GameObject hide;

		public bool startburst = false;

		public AudioEvent click;

		public FVRViveHand curhand;

		public GameObject followhand;

		public bool startFollow = false;

		private void Start()
		{
			Gun.HasTrigger = false;
		}

		private void Update()
		{
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0430: Unknown result type (might be due to invalid IL or missing references)
			//IL_0444: Unknown result type (might be due to invalid IL or missing references)
			//IL_0449: Unknown result type (might be due to invalid IL or missing references)
			//IL_0458: Unknown result type (might be due to invalid IL or missing references)
			//IL_045d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_047f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_0499: 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_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0539: Unknown result type (might be due to invalid IL or missing references)
			//IL_053e: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_050f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_060b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0610: Unknown result type (might be due to invalid IL or missing references)
			//IL_0569: Unknown result type (might be due to invalid IL or missing references)
			//IL_056e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0582: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_0596: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: 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_0711: Unknown result type (might be due to invalid IL or missing references)
			//IL_0716: Unknown result type (might be due to invalid IL or missing references)
			//IL_0725: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0743: Unknown result type (might be due to invalid IL or missing references)
			//IL_0748: Unknown result type (might be due to invalid IL or missing references)
			//IL_0757: Unknown result type (might be due to invalid IL or missing references)
			//IL_075c: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_07a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ae: 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_07c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_07db: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f5: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)curhand == (Object)null)
			{
			}
			if ((Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null)
			{
				curhand = ((FVRInteractiveObject)Gun).m_hand.OtherHand;
				if (startFollow && (Object)(object)curhand != (Object)null)
				{
					followhand.transform.position = ((Component)curhand).transform.position;
					Slide.transform.localPosition = new Vector3(Slide.transform.localPosition.x, Slide.transform.localPosition.y, followhand.transform.localPosition.z);
				}
				else if (!startFollow || (Object)(object)curhand == (Object)null)
				{
					followhand.transform.localPosition = new Vector3(0f, 0f, 0f);
				}
				if (Mount.HasAttachmentsOnIt())
				{
					if ((Object)(object)((Component)Mount.AttachmentsList[0]).gameObject.GetComponent<RossMKIVBattery>() == (Object)null)
					{
						FireMode = 0;
					}
					else if ((Object)(object)((Component)Mount.AttachmentsList[0]).gameObject.GetComponent<RossMKIVBattery>() != (Object)null)
					{
						FireMode = ((Component)Mount.AttachmentsList[0]).gameObject.GetComponent<RossMKIVBattery>().Mode;
					}
				}
				else if (!Mount.HasAttachmentsOnIt())
				{
					FireMode = 0;
					Eject.m_isLargeAperture = true;
				}
				if (FireMode == 0)
				{
					Gun.HasTrigger = false;
					burst = 5;
					Gun.LerpSpeed = 0f;
					Gun.MaxChargeTime = 999f;
					cd = 0.05f;
				}
				if (FireMode == 1)
				{
					Gun.HasTrigger = true;
					Gun.MaxChargeTime = 1f;
					burst = 5;
					Gun.LerpSpeed = 1f;
					cd = 0.05f;
				}
				if (FireMode == 2)
				{
					Gun.HasTrigger = true;
					Gun.LerpSpeed = 1.5f;
					Gun.MaxChargeTime = 2f;
					if (!Gun.m_canFire)
					{
						startburst = true;
					}
					if (startburst)
					{
						cd -= Time.deltaTime;
						if (burst > 0 && cd <= 0f)
						{
							Gun.Fire();
							burst--;
							cd = 0.05f;
							Gun.LerpSpeed = 15f;
							Gun.MaxChargeTime = 0.5f;
						}
						if (burst <= 0)
						{
							cd = 0.05f;
							startburst = false;
						}
					}
					else if (!startburst)
					{
						burst = 5;
						cd = 0.05f;
						Gun.LerpSpeed = 1.5f;
						Gun.MaxChargeTime = 2f;
					}
				}
				if (FireMode == 3)
				{
					Gun.LerpSpeed = 10f;
					Gun.HasTrigger = true;
					Gun.MaxChargeTime = 0.025f;
					burst = 5;
					cd = 0.05f;
				}
				Slide.transform.localPosition = new Vector3(Slide.transform.localPosition.x, Slide.transform.localPosition.y, Mathf.Clamp(Slide.transform.localPosition.z, rear.localPosition.z, fore.localPosition.z));
				if (((Component)Eject).transform.localEulerAngles.x > 45f)
				{
					Slide.transform.localPosition = new Vector3(Slide.transform.localPosition.x, Slide.transform.localPosition.y, Slide.transform.localPosition.z + 0.5f * Time.deltaTime);
				}
				if (Slide.transform.localPosition.z <= rear.localPosition.z + 0.01f)
				{
					Slide.transform.localPosition = new Vector3(Slide.transform.localPosition.x, Slide.transform.localPosition.y, rear.localPosition.z);
					if (startFollow)
					{
						curhand.m_currentInteractable.ForceBreakInteraction();
						SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position);
						startFollow = false;
					}
				}
				if (Slide.transform.localPosition.z >= fore.localPosition.z - 0.01f)
				{
					if (Mount.HasAttachmentsOnIt() && (Object)(object)curhand != (Object)null && ((Object)(object)curhand.m_currentInteractable == (Object)null || (Object)(object)curhand.m_currentInteractable != (Object)(object)Mount.AttachmentsList[0]))
					{
						Mount.AttachmentsList[0].DetachFromMount();
						SM.PlayCoreSound((FVRPooledAudioType)41, click, ((Component)this).transform.position);
						Eject.m_isLargeAperture = true;
					}
					if (!hide.activeInHierarchy && (Object)(object)curhand.m_currentInteractable != (Object)null && Eject.m_isLargeAperture)
					{
						startFollow = true;
					}
				}
				else if (Slide.transform.localPosition.z < fore.localPosition.z && Slide.transform.localPosition.z > rear.localPosition.z && (Object)(object)curhand != (Object)null && (Object)(object)curhand.m_currentInteractable == (Object)null)
				{
					Slide.transform.localPosition = new Vector3(Slide.transform.localPosition.x, Slide.transform.localPosition.y, Slide.transform.localPosition.z + 0.5f * Time.deltaTime);
				}
			}
			else if ((Object)(object)((FVRInteractiveObject)Gun).m_hand == (Object)null)
			{
				curhand = null;
			}
		}
	}
	public class RossMKIVBattery : MonoBehaviour
	{
		public int Mode;
	}
	public class SRGSight : MonoBehaviour
	{
		public FVRFireArmAttachment MainObj;

		public SRG gun;

		public GameObject ind1;

		public GameObject ind2;

		public GameObject ind3;

		public GameObject ind4;

		private void Start()
		{
		}

		private void Update()
		{
			if ((Object)(object)MainObj.curMount == (Object)null)
			{
				ind1.SetActive(false);
				ind2.SetActive(false);
				ind3.SetActive(false);
				ind4.SetActive(false);
			}
			else
			{
				if (!((Object)(object)MainObj.curMount != (Object)null))
				{
					return;
				}
				if ((Object)(object)((Component)MainObj.curMount.MyObject).gameObject.GetComponent<SRG>() != (Object)null)
				{
					gun = ((Component)MainObj.curMount.MyObject).gameObject.GetComponent<SRG>();
					if ((Object)(object)gun != (Object)null)
					{
						if (gun.UI_Arrows[0].activeInHierarchy)
						{
							ind1.SetActive(true);
						}
						else if (!gun.UI_Arrows[0].activeInHierarchy)
						{
							ind1.SetActive(false);
						}
						if (gun.UI_Arrows[1].activeInHierarchy)
						{
							ind2.SetActive(true);
						}
						else if (!gun.UI_Arrows[1].activeInHierarchy)
						{
							ind2.SetActive(false);
						}
						if (gun.UI_Arrows[2].activeInHierarchy)
						{
							ind3.SetActive(true);
						}
						else if (!gun.UI_Arrows[2].activeInHierarchy)
						{
							ind3.SetActive(false);
						}
						if (gun.UI_Arrows[3].activeInHierarchy)
						{
							ind4.SetActive(true);
						}
						else if (!gun.UI_Arrows[3].activeInHierarchy)
						{
							ind4.SetActive(false);
						}
					}
					else if ((Object)(object)gun == (Object)null)
					{
						ind1.SetActive(false);
						ind2.SetActive(false);
						ind3.SetActive(false);
						ind4.SetActive(false);
					}
				}
				else if ((Object)(object)((Component)MainObj.curMount.MyObject).gameObject.GetComponent<SRG>() == (Object)null)
				{
					ind1.SetActive(false);
					ind2.SetActive(false);
					ind3.SetActive(false);
					ind4.SetActive(false);
				}
			}
		}
	}
	public class GunStrap : MonoBehaviour
	{
		public FVRFireArm Gun;

		public FVRPhysicalObject mainObj;

		public GameObject hoster;

		public GameObject wagend;

		public Vector3 refVel;

		public Collider col;

		public void OnTriggerEnter(Collider other)
		{
			if ((Object)(object)Gun == (Object)null && (Object)(object)mainObj.m_quickbeltSlot != (Object)null && (Object)(object)((Component)other).gameObject.GetComponent<FVRFireArm>() != (Object)null && (Object)(object)((FVRPhysicalObject)((Component)other).gameObject.GetComponent<FVRFireArm>()).m_quickbeltSlot == (Object)null)
			{
				Gun = ((Component)other).gameObject.GetComponent<FVRFireArm>();
				col.enabled = false;
			}
		}

		private void Update()
		{
			//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0417: Unknown result type (might be due to invalid IL or missing references)
			//IL_042c: Unknown result type (might be due to invalid IL or missing references)
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0351: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: 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_0092: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_0299: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: 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_0154: Unknown result type (might be due to invalid IL or missing references)
			//IL_017d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)Gun != (Object)null)
			{
				if ((Object)(object)mainObj.m_quickbeltSlot != (Object)null)
				{
					if (!((FVRInteractiveObject)Gun).m_isHeld && (Object)(object)((Component)Gun).gameObject.transform.parent == (Object)null)
					{
						((FVRPhysicalObject)Gun).QBSlotType = (QuickbeltSlotType)2;
						hoster.transform.position = Vector3.SmoothDamp(hoster.transform.position, wagend.gameObject.transform.position, ref refVel, 0.05f);
						hoster.transform.eulerAngles = wagend.transform.eulerAngles;
						if ((Object)(object)((Component)Gun).gameObject.GetComponent<Rigidbody>() != (Object)null)
						{
							((Component)Gun).gameObject.GetComponent<Rigidbody>().useGravity = false;
							((Component)Gun).gameObject.GetComponent<Rigidbody>().isKinematic = true;
						}
						((Component)Gun).gameObject.transform.SetParent(hoster.transform);
						((Component)Gun).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
						((Component)Gun).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					}
					else if ((Object)(object)((Component)Gun).gameObject.transform.parent != (Object)null)
					{
						((FVRPhysicalObject)Gun).QBSlotType = (QuickbeltSlotType)2;
						((Component)Gun).gameObject.transform.SetParent((Transform)null);
						hoster.transform.position = Vector3.SmoothDamp(hoster.transform.position, ((Component)((FVRInteractiveObject)Gun).QBPoseOverride).transform.position, ref refVel, 0.05f);
						hoster.transform.eulerAngles = wagend.transform.eulerAngles;
					}
					else if (((FVRInteractiveObject)Gun).m_isHeld)
					{
						((FVRPhysicalObject)Gun).QBSlotType = (QuickbeltSlotType)2;
						((Component)Gun).gameObject.transform.SetParent((Transform)null);
						hoster.transform.position = Vector3.SmoothDamp(hoster.transform.position, ((Component)((FVRInteractiveObject)Gun).QBPoseOverride).transform.position, ref refVel, 0.05f);
						hoster.transform.eulerAngles = ((Component)((FVRInteractiveObject)Gun).QBPoseOverride).transform.eulerAngles;
					}
				}
				else if ((Object)(object)mainObj.m_quickbeltSlot == (Object)null)
				{
					hoster.transform.eulerAngles = wagend.transform.eulerAngles;
					hoster.transform.position = Vector3.SmoothDamp(hoster.transform.position, wagend.gameObject.transform.position, ref refVel, 0.05f);
					((Component)Gun).gameObject.transform.SetParent((Transform)null);
					if ((Object)(object)((Component)Gun).gameObject.GetComponent<Rigidbody>() != (Object)null)
					{
						((Component)Gun).gameObject.GetComponent<Rigidbody>().useGravity = true;
						((Component)Gun).gameObject.GetComponent<Rigidbody>().isKinematic = false;
					}
					((FVRPhysicalObject)Gun).QBSlotType = (QuickbeltSlotType)0;
					Gun = null;
				}
			}
			if ((Object)(object)Gun == (Object)null)
			{
				hoster.transform.eulerAngles = wagend.transform.eulerAngles;
				hoster.transform.position = Vector3.SmoothDamp(hoster.transform.position, wagend.gameObject.transform.position, ref refVel, 0.05f);
				col.enabled = true;
			}
		}
	}
	public class LookTo : MonoBehaviour
	{
		public GameObject thisobj;

		public GameObject nextobj;

		public float y;

		private void Start()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			y = thisobj.transform.localEulerAngles.y;
		}

		private void Update()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			AxisLookAt(thisobj.transform, nextobj.transform.position, Vector3.up);
		}

		private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, tr_self.localEulerAngles.z);
		}
	}
	public class IsFloating : MonoBehaviour
	{
		public FVRPhysicalObject floatObj;

		public Rigidbody floatObjRB;

		public Transform floatDir;

		public float ForceF;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			if (floatObj.IsInWater)
			{
				floatObjRB.AddForce(floatDir.forward * Time.deltaTime * ForceF, (ForceMode)0);
			}
			else if (floatObj.IsInWater)
			{
			}
		}
	}
	public class OceanRise : MonoBehaviour
	{
		public GameObject ocean;

		public float curvel;

		public GameObject curOcean;

		private void Start()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			curOcean = Object.Instantiate<GameObject>(ocean, new Vector3(((Component)this).gameObject.transform.position.x, -10f, ((Component)this).gameObject.transform.position.z), new Quaternion(0f, 0f, 0f, 0f), (Transform)null);
		}

		private void Update()
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)curOcean != (Object)null)
			{
				curOcean.transform.position = new Vector3(((Component)this).gameObject.transform.position.x, Mathf.SmoothDamp(curOcean.transform.position.y, 75f, ref curvel, 1f), ((Component)this).gameObject.transform.position.z);
			}
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)curOcean);
		}
	}
	public class OceanSeaSick : MonoBehaviour
	{
		public Rigidbody sea;

		public Material mat;

		public GameObject lifering;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)((Component)other).gameObject.GetComponent<SosigLink>() != (Object)null && ((Object)((Component)other).gameObject).name == "Sosig_Torso")
			{
				((Component)other).gameObject.GetComponent<SosigLink>().S.SetCurrentOrder((SosigOrder)5);
				((Component)other).gameObject.GetComponent<SosigLink>().S.SetBodyState((SosigBodyState)2);
				((Component)((Component)other).gameObject.GetComponent<SosigLink>().S).gameObject.transform.position = new Vector3(((Component)((Component)other).gameObject.GetComponent<SosigLink>().S).gameObject.transform.position.x, ((Component)((Component)other).gameObject.GetComponent<SosigLink>().S).gameObject.transform.position.y + 50f, ((Component)((Component)other).gameObject.GetComponent<SosigLink>().S).gameObject.transform.position.z);
				((Behaviour)((Component)other).gameObject.GetComponent<SosigLink>().S.Agent).enabled = false;
				((Behaviour)((Component)other).gameObject.GetComponent<SosigLink>().S).enabled = false;
				((Component)other).gameObject.GetComponent<Rigidbody>().drag = 50f;
				((Component)other).gameObject.GetComponent<Rigidbody>().mass = 250f;
				GameObject val = Object.Instantiate<GameObject>(lifering, ((Component)other).gameObject.transform);
				val.GetComponent<IsFloating>().floatObj = ((Component)other).gameObject.GetComponent<FVRPhysicalObject>();
				val.GetComponent<IsFloating>().floatObjRB = ((Component)other).gameObject.GetComponent<Rigidbody>();
				val.GetComponent<IsFloating>().ForceF = 200000f;
			}
		}

		private void Update()
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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)
			Material obj = mat;
			Vector3 velocity = sea.velocity;
			obj.SetVector("_BumpSpeed", new Vector4(((Vector3)(ref velocity)).magnitude, 0f, 0f, 1f));
			mat.SetVector("_BumpRotation", new Vector4(sea.rotation.y, 0f, 0f, 0f));
		}
	}
	public class ParentP : MonoBehaviour
	{
		public GameObject p;

		public bool playerset = false;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)GM.CurrentMovementManager != (Object)null)
			{
				((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(p.transform);
				if (!playerset)
				{
					((Component)GM.CurrentMovementManager).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
					playerset = true;
				}
				if (((Component)GM.CurrentMovementManager).gameObject.transform.localPosition.y < -10f)
				{
					playerset = false;
				}
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)GM.CurrentMovementManager != (Object)null)
			{
				((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null);
			}
		}
	}
	public class SnapToPointRigidbody : MonoBehaviour
	{
		public Transform snapTo;

		[NonSerialized]
		private Rigidbody body;

		public float snapTime = 2f;

		[NonSerialized]
		private float dropTimer;

		public void Start()
		{
			body = ((Component)this).GetComponent<Rigidbody>();
		}

		public void FixedUpdate()
		{
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			dropTimer += Time.deltaTime / (snapTime / 2f);
			body.isKinematic = dropTimer > 1f;
			if (dropTimer > 1f)
			{
				((Component)this).transform.position = snapTo.position;
				((Component)this).transform.rotation = snapTo.rotation;
				return;
			}
			float num = Mathf.Pow(35f, dropTimer);
			body.velocity = Vector3.Lerp(body.velocity, Vector3.zero, Time.fixedDeltaTime * 4f);
			if (body.useGravity)
			{
				body.AddForce(-Physics.gravity);
			}
			((Component)this).transform.position = Vector3.Lerp(((Component)this).transform.position, snapTo.position, Time.fixedDeltaTime * num * 3f);
			((Component)this).transform.rotation = Quaternion.Slerp(((Component)this).transform.rotation, snapTo.rotation, Time.fixedDeltaTime * num * 2f);
		}
	}
	public class VesselControl : MonoBehaviour
	{
		public GameObject muzzleexp;

		public FVRInteractiveObject SightControl;

		public Transform com;

		public HingeJoint HL;

		public HingeJoint HR;

		public HingeJoint RUHJ;

		public GameObject eng1;

		public GameObject eng2;

		public JointSpring JL;

		public JointSpring JR;

		public JointSpring RUJS;

		public SosigLink Entity;

		public GameObject sightX;

		public GameObject sightY;

		public GameObject FCY;

		public GameObject FCX;

		public float FCspeedX;

		public float FCspeedY;

		public float AKspeedY;

		public float AKspeedX;

		public float RBU1speedY;

		public float RBU1speedX;

		public float RBU2speedY;

		public float RBU2speedX;

		public GameObject AKturret;

		public GameObject AKcannon;

		public GameObject muzzleL;

		public GameObject muzzleR;

		public GameObject RBUturret1;

		public GameObject RBUturret2;

		public GameObject RBUlauncher1;

		public GameObject RBUlauncher2;

		public GameObject[] RBUMuzzleL;

		public GameObject[] RBUMuzzleR;

		public OpenBoltReceiver AKL;

		public OpenBoltReceiver AKR;

		public float duration = 5f;

		public float AKreload = 0.1f;

		public bool isLeft = true;

		public bool AKready = true;

		public Derringer RBUL;

		public Derringer RBUR;

		public FVRFireArmChamber[] RBUchamberL;

		public FVRFireArmChamber[] RBUchamberR;

		public int curchamberL = 0;

		public int curchamberR = 0;

		public float timebetweenL = 0.25f;

		public float timebetweenR = 0.25f;

		public float reloadRBU1 = 0f;

		public float reloadRBU2 = 0f;

		public bool RBU1ready = false;

		public bool RBU2ready = false;

		public float EngageRange = 15f;

		public float EngageAngle = 45f;

		public LayerMask LatchingMask;

		public LayerMask BlockingMask;

		public Transform FireArm;

		public int Gear = 0;

		public GameObject Rudder;

		public Rigidbody mainobj;

		public float Speed = 0f;

		public GameObject TL;

		public GameObject TR;

		public ConstantForce EL;

		public ConstantForce ER;

		public Rigidbody Wheel;

		public float LastW;

		public float CureW;

		public float PL = 0f;

		public float PR = 0f;

		public float sideL = 0f;

		public float sideR = 0f;

		public Vector3 rudderSp;

		public float PrecisionAngle = 5f;

		private void Start()
		{
		}

		public void RBU1Fire()
		{
			Debug.Log((object)"Aye ye Sir.");
			RBU1ready = true;
		}

		public void RBU2Fire()
		{
			Debug.Log((object)"Aye ye Sir.");
			RBU2ready = true;
		}

		public void AKFire()
		{
			Debug.Log((object)"Aye ye Sir.");
			AKready = true;
		}

		public void AIM()
		{
			Debug.Log((object)"Aye ye Sir.");
			FindTarget();
		}

		private void Update()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0198: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0264: Unknown result type (might be due to invalid IL or missing references)
			//IL_0269: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0323: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_038f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0394: Unknown result type (might be due to invalid IL or missing references)
			//IL_0341: Unknown result type (might be due to invalid IL or missing references)
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: 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_03b2: 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_0374: 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_041e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0423: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_048f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			//IL_051e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0500: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0541: Unknown result type (might be due to invalid IL or missing references)
			//IL_0546: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_0575: Unknown result type (might be due to invalid IL or missing references)
			//IL_059d: Unknown result type (might be due to invalid IL or missing references)
			//IL_05fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0603: Unknown result type (might be due to invalid IL or missing references)
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0713: Unknown result type (might be due to invalid IL or missing references)
			//IL_0718: Unknown result type (might be due to invalid IL or missing references)
			//IL_072c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0731: Unknown result type (might be due to invalid IL or missing references)
			//IL_0754: Unknown result type (might be due to invalid IL or missing references)
			//IL_0779: Unknown result type (might be due to invalid IL or missing references)
			//IL_077e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0792: Unknown result type (might be due to invalid IL or missing references)
			//IL_0797: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07da: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0816: Unknown result type (might be due to invalid IL or missing references)
			//IL_0621: Unknown result type (might be due to invalid IL or missing references)
			//IL_0626: 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_0655: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_066e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_0882: Unknown result type (might be due to invalid IL or missing references)
			//IL_0887: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0900: Unknown result type (might be due to invalid IL or missing references)
			//IL_090e: Unknown result type (might be due to invalid IL or missing references)
			//IL_092e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0933: Unknown result type (might be due to invalid IL or missing references)
			//IL_094c: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a2d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dfe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e03: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e1f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e29: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e60: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b91: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ff5: Unknown result type (might be due to invalid IL or missing references)
			//IL_1015: Unknown result type (might be due to invalid IL or missing references)
			//IL_102a: Unknown result type (might be due to invalid IL or missing references)
			//IL_102f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cfe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d15: Unknown result type (might be due to invalid IL or missing references)
			//IL_106c: Unknown result type (might be due to invalid IL or missing references)
			//IL_1071: Unknown result type (might be due to invalid IL or missing references)
			//IL_10a9: 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_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_11bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_11e7: Unknown result type (might be due to invalid IL or missing references)
			mainobj.centerOfMass = com.localPosition;
			if (FCY.transform.localEulerAngles.y > 135f && FCY.transform.localEulerAngles.y < 180f)
			{
				AKturret.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(AKturret.transform.localEulerAngles.y, 0f, ref AKspeedY, 1f, 0f));
			}
			else if (FCY.transform.localEulerAngles.y < 225f && FCY.transform.localEulerAngles.y > 180f)
			{
				AKturret.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(AKturret.transform.localEulerAngles.y, 0f, ref AKspeedY, 1f, 0f));
			}
			else if ((FCY.transform.localEulerAngles.y >= 225f && FCY.transform.localEulerAngles.y <= 360f) || (FCY.transform.localEulerAngles.y <= 135f && FCY.transform.localEulerAngles.y >= 0f))
			{
				AKturret.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(AKturret.transform.localEulerAngles.y, FCY.transform.localEulerAngles.y, ref AKspeedY, 1f), 0f);
			}
			if (AKcannon.transform.localEulerAngles.x >= 90f && AKcannon.transform.localEulerAngles.x < 180f)
			{
				AKcannon.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			}
			else if (AKcannon.transform.localEulerAngles.x <= 0f && AKcannon.transform.localEulerAngles.x > 180f)
			{
				AKcannon.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (RBUlauncher1.transform.localEulerAngles.x > 90f && RBUlauncher1.transform.localEulerAngles.x < 180f)
			{
				RBUlauncher1.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			}
			else if (RBUlauncher1.transform.localEulerAngles.x < 270f && RBUlauncher1.transform.localEulerAngles.x > 180f)
			{
				RBUlauncher1.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
			}
			if (RBUlauncher2.transform.localEulerAngles.x > 90f && RBUlauncher2.transform.localEulerAngles.x < 180f)
			{
				RBUlauncher2.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
			}
			else if (RBUlauncher2.transform.localEulerAngles.x < 270f && RBUlauncher2.transform.localEulerAngles.x > 180f)
			{
				RBUlauncher2.transform.localEulerAngles = new Vector3(270f, 0f, 0f);
			}
			if ((AKturret.transform.localEulerAngles.y > 135f && AKturret.transform.localEulerAngles.y < 180f) || (AKturret.transform.localEulerAngles.y < 225f && AKturret.transform.localEulerAngles.y > 180f))
			{
				AKcannon.transform.localEulerAngles = new Vector3(Mathf.SmoothDamp(AKcannon.transform.localEulerAngles.x, 0f, ref AKspeedX, 0.25f), 0f, 0f);
			}
			else if ((AKturret.transform.localEulerAngles.y >= 225f && AKturret.transform.localEulerAngles.y <= 360f) || (AKturret.transform.localEulerAngles.y <= 135f && AKturret.transform.localEulerAngles.y >= 0f))
			{
				AKcannon.transform.localEulerAngles = new Vector3(Mathf.SmoothDamp(AKcannon.transform.localEulerAngles.x, FCX.transform.localEulerAngles.x, ref AKspeedX, 0.25f), 0f, 0f);
			}
			RBUturret1.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(RBUturret1.transform.localEulerAngles.y, FCY.transform.localEulerAngles.y, ref RBU1speedY, 1f), 0f);
			RBUlauncher1.transform.localEulerAngles = new Vector3(Mathf.SmoothDamp(RBUlauncher1.transform.localEulerAngles.x, FCX.transform.localEulerAngles.x, ref RBU1speedX, 0.5f), 0f, 0f);
			RBUturret2.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(RBUturret2.transform.localEulerAngles.y, FCY.transform.localEulerAngles.y, ref RBU2speedY, 1f), 0f);
			RBUlauncher2.transform.localEulerAngles = new Vector3(Mathf.SmoothDamp(RBUlauncher1.transform.localEulerAngles.x, FCX.transform.localEulerAngles.x, ref RBU2speedX, 0.5f), 0f, 0f);
			if ((Object)(object)SightControl.m_hand != (Object)null)
			{
				if (!SightControl.m_hand.Input.TriggerPressed)
				{
					AKL.EngageSeer();
					AKR.EngageSeer();
					sightX.transform.eulerAngles = new Vector3(((Component)GM.CurrentPlayerBody.Head).transform.eulerAngles.x, 0f, 0f);
					sightY.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentPlayerBody.Head).transform.eulerAngles.y, 0f);
					FCY.transform.localEulerAngles = new Vector3(0f, sightY.transform.localEulerAngles.y, 0f);
					FCX.transform.localEulerAngles = new Vector3(sightX.transform.localEulerAngles.x + 90f, 0f, 0f);
					if ((Object)(object)Entity != (Object)null)
					{
						Entity = null;
					}
				}
				else if (SightControl.m_hand.Input.TriggerPressed)
				{
					duration -= Time.deltaTime;
					if (duration <= 0f)
					{
						AKL.ReleaseSeer();
						AKR.ReleaseSeer();
						((FVRFireArm)AKL).FireMuzzleSmoke();
						((FVRFireArm)AKR).FireMuzzleSmoke();
						Object.Instantiate<GameObject>(muzzleexp, ((FVRFireArm)AKL).MuzzlePos.position, ((FVRFireArm)AKL).MuzzlePos.rotation);
						Object.Instantiate<GameObject>(muzzleexp, ((FVRFireArm)AKR).MuzzlePos.position, ((FVRFireArm)AKR).MuzzlePos.rotation);
						duration = 0.5f;
					}
					RBU1ready = true;
					RBU2ready = true;
				}
			}
			else if ((Object)(object)SightControl.m_hand == (Object)null)
			{
				AKL.EngageSeer();
				AKR.EngageSeer();
			}
			duration -= Time.deltaTime;
			if (duration < 0f)
			{
				duration = 0f;
			}
			else if (duration > 5f)
			{
				duration = 5f;
			}
			if (reloadRBU1 < 0f)
			{
				reloadRBU1 = 0f;
			}
			if (reloadRBU2 < 0f)
			{
				reloadRBU2 = 0f;
			}
			if (RBU1ready)
			{
				if (reloadRBU1 <= 0f)
				{
					timebetweenL -= Time.deltaTime;
					if (curchamberL < RBUchamberL.Length && timebetweenL <= 0f)
					{
						RBUchamberL[curchamberL].Autochamber((FireArmRoundClass)15);
						Object.Instantiate<GameObject>(muzzleexp, ((Component)RBUchamberL[curchamberL]).transform.position, ((Component)RBUchamberL[curchamberL]).transform.rotation);
						((FVRFireArm)RBUL).Fire(RBUchamberL[curchamberL], ((Component)RBUchamberL[curchamberL]).transform, true, 1f, -1f);
						timebetweenL = 0.25f;
						curchamberL++;
					}
					else if (curchamberL >= RBUchamberL.Length)
					{
						RBU1ready = false;
						curchamberL = 0;
						reloadRBU1 = 15f;
					}
				}
				else if (reloadRBU1 > 0f)
				{
					RBU1ready = false;
				}
			}
			reloadRBU1 -= Time.deltaTime;
			if (!RBU1ready)
			{
				timebetweenL = 0f;
			}
			if (RBU2ready)
			{
				if (reloadRBU2 <= 0f)
				{
					timebetweenR -= Time.deltaTime;
					if (curchamberR < RBUchamberR.Length && timebetweenR <= 0f)
					{
						RBUchamberR[curchamberR].Autochamber((FireArmRoundClass)15);
						Object.Instantiate<GameObject>(muzzleexp, ((Component)RBUchamberR[curchamberR]).transform.position, ((Component)RBUchamberR[curchamberR]).transform.rotation);
						((FVRFireArm)RBUR).Fire(RBUchamberR[curchamberR], ((Component)RBUchamberR[curchamberR]).transform, true, 1f, -1f);
						timebetweenR = 0.25f;
						curchamberR++;
					}
					else if (curchamberR >= RBUchamberR.Length)
					{
						RBU2ready = false;
						reloadRBU2 = 15f;
						curchamberR = 0;
					}
				}
				else if (reloadRBU2 > 0f)
				{
					RBU2ready = false;
				}
			}
			reloadRBU2 -= Time.deltaTime;
			if (!RBU2ready)
			{
				timebetweenR = 0f;
			}
			rudderSp = ((Component)Wheel).transform.InverseTransformVector(Wheel.angularVelocity);
			Speed = ((Component)mainobj).transform.InverseTransformVector(mainobj.velocity).z;
			HL.spring = JL;
			HR.spring = JR;
			RUHJ.spring = RUJS;
			if (rudderSp.z >= 0.005f || rudderSp.z <= -0.005f)
			{
				ref JointSpring jL = ref JL;
				jL.targetPosition += rudderSp.z * 250f * Time.deltaTime;
				ref JointSpring jR = ref JR;
				jR.targetPosition += rudderSp.z * 250f * Time.deltaTime;
				RUJS.targetPosition = (JL.targetPosition + JR.targetPosition) / -2f;
			}
			JL.spring = 1000f;
			JR.spring = 1000f;
			RUJS.spring = 1000f;
			JL.damper = 10f;
			JR.damper = 10f;
			RUJS.damper = 10f;
			JL.targetPosition = Mathf.Clamp(JL.targetPosition, -15f, 15f);
			JR.targetPosition = Mathf.Clamp(JR.targetPosition, -15f, 15f);
			RUJS.targetPosition = Mathf.Clamp(RUJS.targetPosition, -30f, 30f);
			EL.relativeForce = new Vector3(0f, 0f, PL);
			ER.relativeForce = new Vector3(0f, 0f, PR);
			if (TL.transform.localEulerAngles.x < 30f)
			{
				PL -= 5000f * Time.deltaTime;
			}
			else if (TL.transform.localEulerAngles.x > 60f)
			{
				PL += 5000f * Time.deltaTime;
			}
			if (TR.transform.localEulerAngles.x < 30f)
			{
				PR -= 5000f * Time.deltaTime;
			}
			else if (TR.transform.localEulerAngles.x > 60f)
			{
				PR += 5000f * Time.deltaTime;
			}
			if (PL > 50000f)
			{
				PL = 50000f;
			}
			else if (PL < -5000f)
			{
				PL = -5000f;
			}
			if (PR > 50000f)
			{
				PR = 50000f;
			}
			else if (PR < -5000f)
			{
				PR = -5000f;
			}
			eng1.transform.localScale = new Vector3(1f, PL / 50000f, 1f);
			eng2.transform.localScale = new Vector3(1f, PR / 50000f, 1f);
		}

		private SosigLink FindTarget()
		{
			//IL_002b: 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_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Invalid comparison between Unknown and I4
			//IL_0114: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: 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)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			float num = EngageRange * Mathf.Tan(0.5f * EngageAngle * ((float)Math.PI / 180f));
			Collider[] array = Physics.OverlapCapsule(((Component)FireArm).transform.position, ((Component)FireArm).transform.position + ((Component)FireArm).transform.forward * EngageRange, num, LayerMask.op_Implicit(LatchingMask));
			List<Rigidbody> list = new List<Rigidbody>();
			for (int i = 0; i < array.Length; i++)
			{
				if ((Object)(object)array[i].attachedRigidbody != (Object)null && !list.Contains(array[i].attachedRigidbody))
				{
					list.Add(array[i].attachedRigidbody);
				}
			}
			SosigLink result = null;
			float num2 = EngageAngle;
			for (int j = 0; j < list.Count; j++)
			{
				SosigLink component = ((Component)list[j]).GetComponent<SosigLink>();
				if ((Object)(object)component != (Object)null && (int)component.S.BodyState != 3)
				{
					Vector3 val = ((Component)list[j]).transform.position - ((Component)FireArm).transform.position;
					float num3 = Vector3.Angle(val, ((Component)FireArm).transform.forward);
					Sosig s = component.S;
					SosigLink val2 = ((!(num3 <= PrecisionAngle)) ? s.Links[1] : s.Links[0]);
					if (num3 < num2 && !Physics.Linecast(((Component)FireArm).transform.position, ((Component)val2).transform.position, LayerMask.op_Implicit(BlockingMask), (QueryTriggerInteraction)1))
					{
						result = val2;
						num2 = num3;
					}
				}
			}
			return result;
		}

		private void XAxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, 0f, 0f);
		}

		private void YAxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: 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_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(0f, tr_self.localEulerAngles.y, 0f);
		}

		private void OnDestroy()
		{
		}
	}
}