MG3.dll

Decompiled 6 months 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 H3VRUtils.MonoScripts.VisualModifiers;
using HarmonyLib;
using OtherLoader;
using TheNext;
using UnityEditor;
using UnityEngine;
using Valve.VR;

[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 EnableIfDisabled : MonoBehaviour
	{
		public FVRFireArmRound Bullet;

		public GameObject Obj;

		public GameObject Renderer;

		private void Start()
		{
		}

		private void Update()
		{
			if (Bullet.IsSpent)
			{
				Obj.SetActive(true);
			}
			if (Bullet.IsChambered)
			{
				Renderer.SetActive(true);
			}
			if (!Bullet.IsChambered)
			{
				Renderer.SetActive(false);
			}
		}
	}
	public class Syringe : FVRFireArmAttachment
	{
		public enum CartridgeState
		{
			Whole,
			BitOpen,
			Jammed
		}

		public List<Renderer> Rends;

		public CartridgeState CState;

		public int numPowderChunksLeft = 20;

		public AudioEvent AudEvent_Bite;

		public AudioEvent AudEvent_Tap;

		public Transform PowderSpawnPoint;

		public GameObject PowderPrefab;

		public GameObject BitPart;

		public AudioEvent AudEvent_Spit;

		public GameObject Splode;

		[NonSerialized]
		public bool m_isDestroyed;

		[NonSerialized]
		public float m_tickDownToSpit = 0.2f;

		[NonSerialized]
		public bool m_tickingDownToSpit;

		[NonSerialized]
		public float timeSinceSpawn = 1f;

		public PowerupType put;

		public PowerUpIntensity pui;

		public PowerUpDuration pud;

		public AudioEvent AudEvent_DIng;

		public FVRPhysicalObject PenObject;

		public bool isAlreadyInHeadRange = false;

		public bool isUsed = false;

		public KillAfter ka;

		public void SetRenderer(CartridgeState s)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Invalid comparison between Unknown and I4
			for (int i = 0; i < Rends.Count; i++)
			{
				if ((int)s == i)
				{
					Rends[i].enabled = true;
				}
				else
				{
					Rends[i].enabled = false;
				}
			}
		}

		public override void Awake()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).Awake();
			SetRenderer(CState);
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: 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_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_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArmAttachment)this).UpdateInteraction(hand);
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
			}
			if ((int)CState == 0)
			{
				Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
				if (Vector3.Distance(((Component)this).transform.position, val) < 0.15f)
				{
					SM.PlayGenericSound(AudEvent_Bite, ((Component)this).transform.position);
					CState = (CartridgeState)1;
					SetRenderer(CState);
					m_tickingDownToSpit = true;
					m_tickDownToSpit = Random.Range(0.3f, 0.6f);
				}
			}
		}

		public override void FVRUpdate()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Invalid comparison between Unknown and I4
			//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_012f: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00c9: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: 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_0187: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).FVRUpdate();
			if (timeSinceSpawn < 1f)
			{
				timeSinceSpawn += Time.deltaTime;
			}
			if (m_tickingDownToSpit)
			{
				m_tickDownToSpit -= Time.deltaTime;
				if (m_tickDownToSpit <= 0f)
				{
					m_tickingDownToSpit = false;
					Vector3 val = ((Component)GM.CurrentPlayerBody.Head).transform.position + ((Component)GM.CurrentPlayerBody.Head).transform.up * -0.2f;
					SM.PlayGenericSound(AudEvent_Spit, val);
					GameObject val2 = Object.Instantiate<GameObject>(BitPart, val, Random.rotation);
					Rigidbody component = val2.GetComponent<Rigidbody>();
					component.velocity = GM.CurrentPlayerBody.Head.forward * Random.Range(2f, 4f) + Random.onUnitSphere;
					component.angularVelocity = Random.onUnitSphere * Random.Range(1f, 5f);
				}
			}
			if ((int)CState == 1)
			{
				float num = Vector3.Angle(-((Component)this).transform.forward, Vector3.up);
				if (num > 120f && numPowderChunksLeft > 0 && timeSinceSpawn > 0.04f)
				{
					numPowderChunksLeft--;
					timeSinceSpawn = 0f;
					Object.Instantiate<GameObject>(PowderPrefab, PowderSpawnPoint.position, Random.rotation);
				}
			}
		}

		private void Update()
		{
			//IL_0007: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Invalid comparison between Unknown and I4
			float num = Vector3.Distance(((Component)this).transform.position, ((Component)GM.CurrentPlayerBody.Head).transform.position + Vector3.up * -0.1f);
			if ((double)num >= 0.19)
			{
				isAlreadyInHeadRange = false;
			}
			if ((double)num < 0.15)
			{
				if (!isAlreadyInHeadRange && (int)CState == 1 && !isUsed)
				{
					PowerUp(((FVRInteractiveObject)PenObject).m_hand);
					Console.Write("Yummy");
					isUsed = true;
				}
				isAlreadyInHeadRange = true;
			}
		}

		public void PowerUp(FVRViveHand hand)
		{
			//IL_000f: 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)
			//IL_0030: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_DIng, ((Component)this).transform.position);
			GM.CurrentSceneSettings.OnPowerupUse(put);
			GM.CurrentPlayerBody.ActivatePower(put, pui, pud, false, false, -1f);
			((Behaviour)ka).enabled = true;
		}
	}
	public class BuletSearcher : MonoBehaviour
	{
		private BallisticProjectile boolet;

		public GameObject booletcam;

		private GameObject bullet;

		private bool spawned = false;

		private GameObject bc;

		private RaycastHit hit;

		private Ray ray;

		public LayerMask mask;

		private float timeb = 1f;

		private void Awake()
		{
		}

		private void Start()
		{
		}

		private void Update()
		{
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			timeb += Time.deltaTime;
			boolet = Object.FindObjectOfType<BallisticProjectile>();
			if ((Object)(object)boolet != (Object)null)
			{
				bullet = ((Component)boolet).gameObject;
			}
			if ((Object)(object)boolet == (Object)null)
			{
			}
			if ((Object)(object)bullet != (Object)null && !spawned)
			{
				if (timeb >= 1f)
				{
					ray = new Ray(bullet.transform.position, bullet.transform.forward);
					if (Physics.Raycast(ray, ref hit, 2000f, LayerMask.op_Implicit(mask)) && ((Object)((Component)((RaycastHit)(ref hit)).collider).gameObject).name == "Geo_Head")
					{
						Time.timeScale = Mathf.Clamp(0.0001f, 0.0001f, 1f);
						Time.fixedDeltaTime = Time.timeScale / SteamVR.instance.hmd_DisplayFrequency;
						bc = Object.Instantiate<GameObject>(booletcam, bullet.transform.localPosition, Quaternion.identity);
						bc.transform.parent = bullet.transform;
						bc.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
						timeb = 0f;
					}
				}
				if (!(timeb < 1f))
				{
				}
			}
			if (spawned)
			{
			}
			if ((Object)(object)bc == (Object)null)
			{
				spawned = false;
			}
			if ((Object)(object)bc != (Object)null)
			{
				spawned = true;
			}
		}
	}
	public class Lookat : MonoBehaviour
	{
		public GameObject mark;

		public Transform nearestAI;

		public SosigLink[] currentAI = null;

		public GameObject lookAtObj;

		public LAPD2019Laser laser;

		public Transform player;

		private void OnTriggerEnter(Collider other)
		{
			currentAI = ((Component)other).gameObject.GetComponents<SosigLink>();
		}

		private void Update()
		{
			//IL_004f: 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_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_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			if (currentAI == null || (Object)(object)nearestAI == (Object)null)
			{
				laser.TurnOff();
				mark.SetActive(false);
				mark.transform.localPosition = new Vector3(0f, 0f, 0f);
				lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if ((Object)(object)nearestAI != (Object)null)
			{
				laser.TurnOn();
				mark.SetActive(true);
				mark.transform.position = ((Component)nearestAI).transform.position;
				AxisLookAt(lookAtObj.transform, nearestAI.position, Vector3.forward);
			}
			AxisLookAt(mark.transform, lookAtObj.transform.position, Vector3.forward);
			if (currentAI != null)
			{
				nearestAI = GetNearestGameObject(player, currentAI);
			}
		}

		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_0074: 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, 0f);
		}

		public Transform GetNearestGameObject(Transform player, SosigLink[] objects)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			Transform val = null;
			if (objects == null || (Object)(object)val == (Object)null)
			{
			}
			if (objects.Length > 0)
			{
				val = ((Component)objects[0]).transform;
				float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position);
				for (int i = 1; i < objects.Length; i++)
				{
					float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position);
					if (num > num2)
					{
						num = num2;
						val = ((Component)objects[i]).transform;
					}
				}
			}
			return val;
		}
	}
	public class Slotarea : MonoBehaviour
	{
		public GameObject parent;

		public void OnTriggerStay(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: 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_0093: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if (!((Object)(object)component != (Object)null) || !((Object)(object)gameObject != (Object)(object)parent) || (int)component.QBSlotType != 0 || ((FVRInteractiveObject)component).m_isHeld || !((Object)(object)component.m_quickbeltSlot == (Object)null))
			{
				return;
			}
			float num = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.LeftHand).transform.position);
			float num2 = Vector3.Distance(((Component)component).transform.position, ((Component)GM.CurrentPlayerBody.RightHand).transform.position);
			if (num < 0.25f || num2 < 0.25f)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					gameObject.transform.SetParent(parent.transform);
					component2.useGravity = false;
					component2.isKinematic = true;
				}
			}
		}

		public void OnTriggerExit(Collider other)
		{
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			GameObject gameObject = ((Component)other).gameObject;
			FVRPhysicalObject component = gameObject.GetComponent<FVRPhysicalObject>();
			if ((Object)(object)component != (Object)null && (Object)(object)gameObject != (Object)(object)parent && (int)component.QBSlotType == 0 && ((FVRInteractiveObject)component).m_isHeld && (Object)(object)component.m_quickbeltSlot == (Object)null)
			{
				Rigidbody component2 = gameObject.GetComponent<Rigidbody>();
				if ((Object)(object)component2 != (Object)null)
				{
					gameObject.transform.SetParent(parent.transform);
					component2.useGravity = true;
					component2.isKinematic = false;
				}
			}
		}

		private void Update()
		{
		}
	}
}
[ExecuteInEditMode]
[RequireComponent(typeof(Camera))]
public class DeferredNightVisionEffect : MonoBehaviour
{
	[SerializeField]
	[Tooltip("The main color of the NV effect")]
	public Color m_NVColor = new Color(0f, 1f, 0.1724138f, 0f);

	[SerializeField]
	[Tooltip("The color that the NV effect will 'bleach' towards (white = default)")]
	public Color m_TargetBleachColor = new Color(1f, 1f, 1f, 0f);

	[Range(0f, 0.1f)]
	[Tooltip("How much base lighting does the NV effect pick up")]
	public float m_baseLightingContribution = 0.025f;

	[Range(0f, 128f)]
	[Tooltip("The higher this value, the more bright areas will get 'bleached out'")]
	public float m_LightSensitivityMultiplier = 100f;

	private Material m_Material;

	private Shader m_Shader;

	[Tooltip("Do we want to apply a vignette to the edges of the screen?")]
	public bool useVignetting = true;

	public Shader NightVisionShader => m_Shader;

	private void DestroyMaterial(Material mat)
	{
		if (Object.op_Implicit((Object)(object)mat))
		{
			Object.DestroyImmediate((Object)(object)mat);
			mat = null;
		}
	}

	private void CreateMaterials()
	{
		if ((Object)(object)m_Shader == (Object)null)
		{
			m_Shader = Shader.Find("Custom/DeferredNightVisionShader");
		}
		if ((Object)(object)m_Material == (Object)null && (Object)(object)m_Shader != (Object)null && m_Shader.isSupported)
		{
			m_Material = CreateMaterial(m_Shader);
		}
	}

	private Material CreateMaterial(Shader shader)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001a: Expected O, but got Unknown
		if (!Object.op_Implicit((Object)(object)shader))
		{
			return null;
		}
		Material val = new Material(shader);
		((Object)val).hideFlags = (HideFlags)61;
		return val;
	}

	private void OnDisable()
	{
		DestroyMaterial(m_Material);
		m_Material = null;
		m_Shader = null;
	}

	[ContextMenu("UpdateShaderValues")]
	public void UpdateShaderValues()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0028: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: Unknown result type (might be due to invalid IL or missing references)
		if (!((Object)(object)m_Material == (Object)null))
		{
			m_Material.SetVector("_NVColor", Color.op_Implicit(m_NVColor));
			m_Material.SetVector("_TargetWhiteColor", Color.op_Implicit(m_TargetBleachColor));
			m_Material.SetFloat("_BaseLightingContribution", m_baseLightingContribution);
			m_Material.SetFloat("_LightSensitivityMultiplier", m_LightSensitivityMultiplier);
			m_Material.shaderKeywords = null;
			if (useVignetting)
			{
				Shader.EnableKeyword("USE_VIGNETTE");
			}
			else
			{
				Shader.DisableKeyword("USE_VIGNETTE");
			}
		}
	}

	private void OnEnable()
	{
		CreateMaterials();
		UpdateShaderValues();
	}

	public void ReloadShaders()
	{
		OnDisable();
	}

	private void OnRenderImage(RenderTexture source, RenderTexture destination)
	{
		UpdateShaderValues();
		CreateMaterials();
		Graphics.Blit((Texture)(object)source, destination, m_Material);
	}
}
namespace JerryComponent
{
	public class guitarreset : MonoBehaviour
	{
		public AudioSource song;

		public GameObject rot;

		private bool is45 = false;

		private void Start()
		{
		}

		private void over45()
		{
			if (is45)
			{
				song.Stop();
			}
			is45 = false;
		}

		private void under45()
		{
			if (!is45)
			{
				song.Play();
				song.Pause();
			}
			is45 = true;
		}

		private void Update()
		{
			//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_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)
			if (rot.transform.localEulerAngles.x > 45f)
			{
				over45();
			}
			if (rot.transform.localEulerAngles.x < 45f)
			{
				under45();
			}
		}
	}
	public class guitarscript : MonoBehaviour
	{
		public GameObject reset;

		public AudioSource song;

		public GameObject resetvolume;

		private bool slaponce;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider other)
		{
			slaponce = true;
		}

		private void Update()
		{
			//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_00b4: 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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_010d: 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_0091: 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_013c: 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)
			//IL_0185: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01fb: Unknown result type (might be due to invalid IL or missing references)
			if (reset.transform.localEulerAngles.x > 15f)
			{
				resetvolume.SetActive(true);
				resetvolume.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				if (resetvolume.transform.localEulerAngles.x > 25f)
				{
					resetvolume.transform.localEulerAngles = new Vector3(25f, 0f, 0f);
					resetvolume.SetActive(false);
				}
			}
			if (reset.transform.localEulerAngles.x < 15f)
			{
				resetvolume.SetActive(false);
				resetvolume.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (reset.transform.localEulerAngles.x < 25f)
			{
				song.UnPause();
			}
			if (reset.transform.localEulerAngles.x > 25f)
			{
				reset.transform.localEulerAngles = new Vector3(25f, 0f, 0f);
			}
			if (reset.transform.localEulerAngles.x >= 25f)
			{
				song.Pause();
			}
			song.volume = 1f - resetvolume.transform.localEulerAngles.x * 0.04f;
			if (slaponce)
			{
				reset.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				slaponce = false;
			}
		}
	}
	public class guitarslap : MonoBehaviour
	{
		public GameObject slide;

		public AudioSource asa1;

		public AudioSource asa2;

		private void Start()
		{
		}

		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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			asa1.pitch = slide.transform.localPosition.z;
			asa2.pitch = slide.transform.localPosition.z;
		}
	}
	public class guitarslap2 : MonoBehaviour
	{
		public int start = 0;

		public SphereCollider cols;

		public int[] notes1;

		public int[] notes2;

		public int[] notes3;

		public int[] notes4;

		public AudioEvent[] clips;

		public GameObject foregrip;

		public GameObject hold1;

		public GameObject hold2;

		public GameObject hold3;

		public GameObject hold4;

		public Transform pos;

		private void Start()
		{
		}

		private void OnTriggerEnter(Collider col)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_021e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: 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_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0326: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_0302: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0386: Unknown result type (might be due to invalid IL or missing references)
			col = (Collider)(object)cols;
			if (hold1.transform.localEulerAngles.x < 45f && hold2.transform.localEulerAngles.x < 45f && hold3.transform.localEulerAngles.x < 45f && hold4.transform.localEulerAngles.x < 45f)
			{
				SM.PlayGenericSound(clips[0], pos.localPosition);
				start = 0;
			}
			if ((hold1.transform.localEulerAngles.x > 45f && notes1[start] == 0) || (hold2.transform.localEulerAngles.x > 45f && notes2[start] == 0) || (hold3.transform.localEulerAngles.x > 45f && notes3[start] == 0) || (hold4.transform.localEulerAngles.x > 45f && notes4[start] == 0))
			{
				start = 0;
			}
			if (hold1.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes1[start]);
				SM.PlayGenericSound(clips[notes1[start]], pos.localPosition);
				start++;
			}
			if (hold2.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes2[start]);
				SM.PlayGenericSound(clips[notes2[start]], pos.localPosition);
				start++;
			}
			if (hold3.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes3[start]);
				SM.PlayGenericSound(clips[notes3[start]], pos.localPosition);
				start++;
			}
			if (hold4.transform.localEulerAngles.x > 45f)
			{
				foregrip.transform.localPosition = new Vector3(0f, 0f, (float)notes4[start]);
				SM.PlayGenericSound(clips[notes4[start]], pos.localPosition);
				start++;
			}
		}

		private void FixedUpdate()
		{
		}

		private void Update()
		{
		}
	}
	public class LebelHandle : MonoBehaviour
	{
		public Mac11_Stock fakeboltt;

		public BoltActionRifle_Handle realbolt;

		public GameObject rot;

		public GameObject fakebolt;

		public FVRAlternateGrip foregrip;

		private GameObject _player = null;

		private FVRViveHand leftHand = null;

		private FVRViveHand rightHand = null;

		public bool istransfterd = true;

		private void Awake()
		{
			_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).gameObject;
		}

		private void Start()
		{
			leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
			rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
		}

		private void BoltTransfer()
		{
			if (!istransfterd)
			{
				((FVRInteractiveObject)fakeboltt).EndInteraction(rightHand);
				rightHand.ForceSetInteractable((FVRInteractiveObject)(object)realbolt);
				((FVRInteractiveObject)realbolt).BeginInteraction(rightHand);
				istransfterd = true;
			}
			if (!istransfterd)
			{
			}
		}

		private void Update()
		{
			if (!fakebolt.activeInHierarchy)
			{
				BoltTransfer();
			}
			if (fakebolt.activeInHierarchy)
			{
				istransfterd = false;
			}
			if (!((Object)(object)_player == (Object)null) && !((Object)(object)leftHand == (Object)null) && !((Object)(object)rightHand == (Object)null))
			{
			}
		}
	}
	public class DshapeGrip : MonoBehaviour
	{
		public ClosedBoltWeapon gun;

		public GameObject trigL;

		public GameObject trigR;

		public GameObject magrel;

		private void Start()
		{
		}

		private void Update()
		{
			//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_002e: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			if (trigL.transform.localEulerAngles.x > 45f || trigR.transform.localEulerAngles.x > 45f)
			{
				gun.Fire();
			}
			if (magrel.transform.localEulerAngles.x > 45f && (Object)(object)((FVRFireArm)gun).Magazine != (Object)null)
			{
				((FVRFireArm)gun).EjectMag(false);
			}
		}
	}
	public class FireRopeOB : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public GameObject trigger;

		private void Start()
		{
		}

		private void Update()
		{
			//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_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)
			if (trigger.transform.localPosition.z >= 0.1f)
			{
				gun.Fire();
			}
			else if (!(trigger.transform.localPosition.z < 0.1f))
			{
			}
		}
	}
	public class KeepMeAlive : MonoBehaviour
	{
		public Rigidbody rb;

		private void Start()
		{
		}

		private void Update()
		{
			rb.isKinematic = false;
		}
	}
	public class MountedMG : MonoBehaviour
	{
		public GameObject elev;

		public GameObject hori;

		public GameObject XGEO;

		public GameObject YGEO;

		public WaggleJoint X;

		public WaggleJoint Y;

		public Rigidbody j1;

		public Rigidbody j2;

		public Rigidbody j3;

		public GameObject trig;

		public ClosedBoltWeapon gun;

		private void Start()
		{
		}

		private void Update()
		{
			//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_003c: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0203: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: 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_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: 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_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_031b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0320: 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_0259: Unknown result type (might be due to invalid IL or missing references)
			//IL_0384: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_034e: 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_0410: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Unknown result type (might be due to invalid IL or missing references)
			//IL_04a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0433: Unknown result type (might be due to invalid IL or missing references)
			//IL_0438: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0528: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_04bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_057e: Unknown result type (might be due to invalid IL or missing references)
			if (trig.transform.localPosition.x > 1f)
			{
				gun.Fire();
			}
			if (trig.transform.localPosition.x < 1f)
			{
			}
			j1.isKinematic = false;
			j2.isKinematic = false;
			j3.isKinematic = false;
			if (elev.transform.localPosition.y < 0.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (elev.transform.localPosition.y > 0.5f && elev.transform.localPosition.y < 1.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(15f, 0f, 0f);
				X.angleLimitLeft = 0f;
				X.angleLimitRight = 30f;
			}
			if (elev.transform.localPosition.y > 1.5f && elev.transform.localPosition.y < 2.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (elev.transform.localPosition.y > 2.5f && elev.transform.localPosition.y < 3.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(345f, 0f, 0f);
				X.angleLimitLeft = 30f;
				X.angleLimitRight = 0f;
			}
			if (elev.transform.localPosition.y > 3.5f && elev.transform.localPosition.y < 4.5f)
			{
				XGEO.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				X.angleLimitLeft = 15f;
				X.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y < 0.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y > 0.5f && hori.transform.localPosition.y < 1.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(15f, 90f, 0f);
				Y.angleLimitLeft = 0f;
				Y.angleLimitRight = 30f;
			}
			if (hori.transform.localPosition.y > 1.5f && hori.transform.localPosition.y < 2.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
			if (hori.transform.localPosition.y > 2.5f && hori.transform.localPosition.y < 3.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(345f, 90f, 0f);
				Y.angleLimitLeft = 30f;
				Y.angleLimitRight = 0f;
			}
			if (hori.transform.localPosition.y > 3.5f && hori.transform.localPosition.y < 4.5f)
			{
				YGEO.transform.localEulerAngles = new Vector3(0f, 90f, 0f);
				Y.angleLimitLeft = 15f;
				Y.angleLimitRight = 15f;
			}
		}
	}
	public class Tripod : MonoBehaviour
	{
		public GameObject hinge;

		public GameObject trigger;

		public GameObject sliderot;

		public string gunname;

		public string gunnamebackup;

		public Transform slidemonut;

		public OpenBoltReceiver gun;

		private void Start()
		{
		}

		private void OnTriggerStay(Collider other)
		{
			//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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			if (hinge.transform.localEulerAngles.x > 45f)
			{
				if (!(((Object)((Component)other).gameObject).name == gunname) && !(((Object)((Component)other).gameObject).name == gunnamebackup))
				{
					return;
				}
				((Component)other).gameObject.transform.SetParent(slidemonut);
				((Component)other).gameObject.transform.localPosition = new Vector3(0f, 0f, 0f);
				((Component)other).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				gun = ((Component)other).gameObject.GetComponent<OpenBoltReceiver>();
				Rigidbody component = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component.isKinematic = true;
				component.useGravity = false;
				if ((Object)(object)gun != (Object)null)
				{
					if (trigger.transform.localEulerAngles.x > 45f)
					{
						gun.ReleaseSeer();
						gun.Fire();
					}
					else if (trigger.transform.localEulerAngles.x < 45f)
					{
						gun.EngageSeer();
					}
					if (gun.Chamber.IsFull)
					{
						sliderot.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
					}
					else if (!gun.Chamber.IsFull)
					{
						sliderot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
					}
				}
			}
			else if (((Object)((Component)other).gameObject).name == gunname || ((Object)((Component)other).gameObject).name == gunnamebackup)
			{
				Rigidbody component2 = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component2.isKinematic = false;
				component2.useGravity = true;
				((Component)other).gameObject.transform.SetParent((Transform)null);
				gun = null;
			}
		}

		private void OnTriggerExit(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == gunname || ((Object)((Component)other).gameObject).name == gunnamebackup)
			{
				Rigidbody component = ((Component)other).gameObject.GetComponent<Rigidbody>();
				component.isKinematic = false;
				component.useGravity = true;
				((Component)other).gameObject.transform.SetParent((Transform)null);
				gun = null;
			}
		}

		private void Update()
		{
			if (!((Object)(object)gun == (Object)null))
			{
			}
		}
	}
	public class barrelc : MonoBehaviour
	{
		public FVRFireArmAttachmentMount mount;

		public GameObject plate;

		private void Start()
		{
		}

		private void Update()
		{
			//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)
			if (plate.transform.localEulerAngles.y < 45f)
			{
				if (mount.HasAttachmentsOnIt())
				{
					((Component)mount.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
			}
			else if (mount.HasAttachmentsOnIt())
			{
				((Component)mount.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
			}
		}
	}
	public class gunpodtrigger : MonoBehaviour
	{
		public FVRInteractiveObject obj;

		public GameObject trigger;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_00a4: 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_004d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)obj.m_hand != (Object)null)
			{
				if (obj.m_hand.Input.TriggerPressed)
				{
					trigger.transform.localEulerAngles = new Vector3(90f, 0f, 0f);
				}
				else
				{
					trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				}
			}
			else
			{
				trigger.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class barrelchange : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public FVRFireArmAttachmentMount mount;

		private void Start()
		{
		}

		private void Update()
		{
			if (mount.HasAttachmentsOnIt())
			{
				if (!(((Object)((Component)mount.AttachmentsList[0]).gameObject).name == "MG3Barrel(Clone)"))
				{
					gun.m_fireSelectorMode = 0;
				}
			}
			else
			{
				gun.m_fireSelectorMode = 0;
			}
		}
	}
	public class BarrelLatch : MonoBehaviour
	{
		public Collider boltgrab;

		public GameObject knob;

		public GameObject bolt;

		public GameObject grab;

		public GameObject barrel;

		public float speed = 0f;

		public float speed_multi = 0.001f;

		public float fore = 0.2344f;

		public float rear = 0f;

		public WaggleJoint dustcover;

		public bool islocked = true;

		public GameObject audioopen;

		public GameObject audioclose;

		public GameObject audioflipopen;

		public GameObject audioflipclose;

		private void Start()
		{
		}

		private void Update()
		{
			//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_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: 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_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_0051: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0279: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_031c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0321: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: 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)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			if (barrel.transform.localPosition.z > 0.2f && bolt.transform.localPosition.z > 0.2f && dustcover.hingeGraphic.localRotation.x >= 20f)
			{
				dustcover.angleLimitLeft = 115f;
				dustcover.angleLimitRight = -115f;
				audioflipclose.SetActive(true);
				audioflipopen.SetActive(false);
			}
			if (barrel.transform.localPosition.z <= 0.2f || bolt.transform.localPosition.z <= 0.2f)
			{
				dustcover.angleLimitLeft = 100f;
				dustcover.angleLimitRight = 0f;
				audioflipclose.SetActive(false);
				audioflipopen.SetActive(true);
			}
			if (grab.transform.localEulerAngles.x < 45f && !islocked)
			{
				if (barrel.transform.localPosition.z < fore)
				{
					boltgrab.enabled = false;
					audioopen.SetActive(false);
					speed += speed_multi;
					if (speed > 1f)
					{
						speed = 1f;
					}
					barrel.transform.localPosition = Vector3.MoveTowards(barrel.transform.localPosition, new Vector3(0f, 0f, fore), speed);
				}
				if (barrel.transform.localPosition.z >= fore)
				{
					barrel.transform.localPosition = new Vector3(0f, 0f, fore);
					speed = 0f;
					audioopen.SetActive(true);
					boltgrab.enabled = true;
				}
			}
			if (grab.transform.localPosition.x > 45f && barrel.transform.localPosition.z < 0.01f && knob.transform.localEulerAngles.x < 45f)
			{
				barrel.transform.localPosition = new Vector3(0f, 0f, rear);
				islocked = true;
				audioclose.SetActive(true);
			}
			if (knob.transform.localEulerAngles.x > 45f)
			{
				islocked = false;
				audioclose.SetActive(false);
			}
		}
	}
}
namespace JerryAr.MG3
{
	[BepInPlugin("JerryAr.MG3", "MG3", "1.1.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class MG3Plugin : 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.MG3");
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.MG3", "", "", "mg3", "");
		}
	}
}
namespace JerryComponent
{
	public class AutoGrabMagWell : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public MagFold fold;

		private void Awake()
		{
		}

		private void Start()
		{
		}

		private void Update()
		{
			//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_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if (gun.Magazine.IsBeltBox && GM.CurrentMovementManager.Hands[1].Input.IsGrabbing && rot.transform.localEulerAngles.y < 45f)
				{
					if ((Object)(object)GM.CurrentMovementManager.Hands[1].CurrentInteractable == (Object)null)
					{
						GM.CurrentMovementManager.Hands[1].ForceSetInteractable((FVRInteractiveObject)(object)fold);
						((FVRInteractiveObject)fold).BeginInteraction(GM.CurrentMovementManager.Hands[1]);
					}
				}
				else if (gun.Magazine.IsBeltBox && !GM.CurrentMovementManager.Hands[1].Input.IsGrabbing && rot.transform.localEulerAngles.y < 45f)
				{
					gun.EjectMag(false);
				}
				else if (gun.Magazine.IsBeltBox && rot.transform.localEulerAngles.y != 45f)
				{
				}
			}
			else if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
			}
		}
	}
	public class BeltAppear : MonoBehaviour
	{
		public FVRFireArmTopCover cover;

		public FVRFoldingStockXAxis lifter;

		public BoxCollider col;

		public OpenBoltReceiver gun;

		public FVRObject[] beltempt;

		public Transform beltpos;

		public GameObject follower;

		public int followerX = 0;

		public int beltL = 20;

		public float a = 45f;

		private void Start()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			follower.transform.localPosition = new Vector3(0f, 0f, 0f);
			followerX = 0;
		}

		private void OnPKMShotFired(FVRFireArm fireArm)
		{
			if ((Object)(object)fireArm == (Object)(object)gun)
			{
				followerX++;
				if (followerX >= beltL)
				{
					Object.Instantiate<GameObject>(((AnvilAsset)beltempt[beltL]).GetGameObject(), beltpos);
					followerX = 0;
				}
			}
		}

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnPKMShotFired);
		}

		private void Update()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: 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_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0131: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			follower.transform.localPosition = new Vector3((float)followerX, 0f, 0f);
			if (!((FVRFireArm)gun).HasBelt && ((Component)cover).transform.localEulerAngles.x >= 45f)
			{
				((Collider)col).enabled = true;
			}
			if (((FVRFireArm)gun).HasBelt || ((Component)cover).transform.localEulerAngles.x < 45f)
			{
				((Collider)col).enabled = false;
			}
			if (((Component)lifter).transform.localEulerAngles.x <= 22.5f && followerX != 0)
			{
				Object.Instantiate<GameObject>(((AnvilAsset)beltempt[followerX]).GetGameObject(), beltpos);
				followerX = 0;
			}
			if (((Component)lifter).transform.localEulerAngles.x < 45f)
			{
				a = ((Component)lifter).transform.localEulerAngles.x;
				((Component)lifter).transform.localEulerAngles = new Vector3(a + 5f, 0f, 0f);
			}
			if (((Component)lifter).transform.localEulerAngles.x == 45f)
			{
				a = 45f;
			}
			if (((Component)lifter).transform.localEulerAngles.x > 45f)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(45f, 0f, 0f);
			}
		}

		private void OnDestroy()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnPKMShotFired);
		}
	}
	public class BeltAppear2 : MonoBehaviour
	{
		public FVRFireArmTopCover cover;

		public FVRFoldingStockXAxis lifter;

		public BoxCollider col;

		public OpenBoltReceiver gun;

		public float a = 45f;

		private void Start()
		{
		}

		private void Awake()
		{
		}

		private void Update()
		{
			//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_005c: 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_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: 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_015c: Unknown result type (might be due to invalid IL or missing references)
			if (!((FVRFireArm)gun).HasBelt && ((Component)cover).transform.localEulerAngles.x >= 45f)
			{
				((Collider)col).enabled = true;
			}
			if (((FVRFireArm)gun).HasBelt || ((Component)cover).transform.localEulerAngles.x < 45f)
			{
				((Collider)col).enabled = false;
			}
			if (((Component)lifter).transform.localEulerAngles.x < 45f)
			{
				a = ((Component)lifter).transform.localEulerAngles.x;
				((Component)lifter).transform.localEulerAngles = new Vector3(a + 5f, 0f, 0f);
			}
			if (((Component)lifter).transform.localEulerAngles.x == 45f)
			{
				a = 45f;
			}
			if (((Component)lifter).transform.localEulerAngles.x > 45f)
			{
				((Component)lifter).transform.localEulerAngles = new Vector3(45f, 0f, 0f);
			}
		}
	}
	public class BeltChange : MonoBehaviour
	{
		public OpenBoltReceiver gun2;

		public FVRFirearmBeltDisplayData data1;

		public FVRFirearmBeltDisplayData data2;

		public GameObject rot;

		public Transform _Magpos;

		public Transform _Boxpos;

		private void Start()
		{
		}

		private void Update()
		{
			//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_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)
			if (rot.transform.localEulerAngles.x < 45f)
			{
				((FVRFireArm)gun2).BeltDD = data1;
			}
			if (rot.transform.localEulerAngles.x >= 45f)
			{
				((FVRFireArm)gun2).BeltDD = data2;
			}
			((FVRFireArm)gun2).BeltBoxMountPos = _Boxpos;
			((FVRFireArm)gun2).MagazineMountPos = _Magpos;
		}
	}
	public class BeltGrab : MonoBehaviour
	{
		public FVRFireArm gun;

		public GameObject grabpos;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_00dc: 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_0073: 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)
			if ((Object)(object)gun.Magazine != (Object)null && gun.Magazine.IsBeltBox)
			{
				if ((Object)(object)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).m_hand != (Object)null)
				{
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride).transform.position = grabpos.transform.position;
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride_Touch).transform.position = grabpos.transform.position;
				}
				else
				{
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride).transform.localPosition = new Vector3(0f, 0f, 0f);
					((Component)((FVRInteractiveObject)gun.Magazine.BeltGrabTrigger).PoseOverride_Touch).transform.localPosition = new Vector3(0f, 0f, 0f);
				}
			}
		}
	}
	public class Control_Enable : MonoBehaviour
	{
		public GameObject objToRead;

		public GameObject objToAffect;

		private void Start()
		{
		}

		private void Update()
		{
			if (objToRead.activeInHierarchy)
			{
				objToAffect.SetActive(true);
			}
			else
			{
				objToAffect.SetActive(false);
			}
		}
	}
	public class Control_Enable_Rev : MonoBehaviour
	{
		public GameObject objToRead;

		public GameObject objToAffect;

		private void Start()
		{
		}

		private void Update()
		{
			if (objToRead.activeInHierarchy)
			{
				objToAffect.SetActive(false);
			}
			else
			{
				objToAffect.SetActive(true);
			}
		}
	}
	public class DoveTail : MonoBehaviour
	{
		public GameObject topcoverRot;

		public Collider topCover;

		public GameObject dovetail;

		public WaggleJoint wag;

		public GameObject switchToRelease;

		public GameObject barrel;

		public GameObject grip;

		public GameObject stock;

		public GameObject lockpiece;

		private void Start()
		{
		}

		private void Update()
		{
			//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_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_01a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			if (barrel.activeInHierarchy && grip.activeInHierarchy && stock.activeInHierarchy)
			{
				dovetail.SetActive(true);
				if (switchToRelease.transform.localEulerAngles.x > 45f)
				{
					topCover.enabled = true;
					if (topcoverRot.transform.localEulerAngles.x < 2f)
					{
						wag.angleLimitLeft = 32f;
						wag.angleLimitRight = 0f;
					}
					else if (topcoverRot.transform.localEulerAngles.x > 2f)
					{
						wag.angleLimitLeft = 10f;
						wag.angleLimitRight = 0f;
					}
				}
				else
				{
					if (!(switchToRelease.transform.localEulerAngles.x < 45f))
					{
						return;
					}
					topCover.enabled = false;
					if (topcoverRot.transform.localEulerAngles.x < 2f)
					{
						if (lockpiece.transform.localEulerAngles.x > 45f)
						{
							wag.angleLimitLeft = 32f;
							wag.angleLimitRight = 0f;
						}
						else if (lockpiece.transform.localEulerAngles.x < 45f)
						{
							wag.angleLimitLeft = 32f;
							wag.angleLimitRight = -32f;
						}
					}
					else if (topcoverRot.transform.localEulerAngles.x > 2f)
					{
						wag.angleLimitLeft = 10f;
						wag.angleLimitRight = 0f;
					}
				}
			}
			else
			{
				wag.angleLimitLeft = 32f;
				wag.angleLimitRight = -32f;
				dovetail.SetActive(false);
				topCover.enabled = true;
			}
		}
	}
	public class MagFold : FVRInteractiveObject
	{
		public enum StockPos
		{
			Closed,
			Mid,
			Open
		}

		public Transform Root;

		public Transform Stock;

		public float rotAngle;

		public float MinRot;

		public float MaxRot;

		public StockPos m_curPos;

		public StockPos m_lastPos;

		public bool isMinClosed = true;

		public FVRFireArm FireArm;

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_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_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: 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_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: 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_01bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Invalid comparison between Unknown and I4
			//IL_0173: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: 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_01cd: Invalid comparison between Unknown and I4
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			Vector3 val = ((HandInput)(ref hand.Input)).Pos - Root.position;
			Vector3 val2 = Vector3.ProjectOnPlane(val, Root.up);
			val = ((Vector3)(ref val2)).normalized;
			Vector3 val3 = -((Component)Root).transform.forward;
			rotAngle = Mathf.Atan2(Vector3.Dot(Root.up, Vector3.Cross(val3, val)), Vector3.Dot(val3, val)) * 57.29578f;
			if (Mathf.Abs(rotAngle - MinRot) < 5f)
			{
				rotAngle = MinRot;
			}
			if (Mathf.Abs(rotAngle - MaxRot) < 5f)
			{
				rotAngle = MaxRot;
			}
			if (!(rotAngle >= MinRot) || !(rotAngle <= MaxRot))
			{
				return;
			}
			Stock.localEulerAngles = new Vector3(0f, rotAngle, 0f);
			float num = Mathf.InverseLerp(MinRot, MaxRot, rotAngle);
			if (isMinClosed)
			{
				if (num < 0.02f)
				{
					m_curPos = (StockPos)0;
				}
				else if (num > 0.9f)
				{
					m_curPos = (StockPos)2;
				}
				else
				{
					m_curPos = (StockPos)1;
				}
			}
			else if (num < 0.1f)
			{
				m_curPos = (StockPos)2;
			}
			else if (num > 0.98f)
			{
				m_curPos = (StockPos)0;
			}
			else
			{
				m_curPos = (StockPos)1;
			}
			if ((int)m_curPos == 2 && (int)m_lastPos != 2)
			{
				FireArm.PlayAudioEvent((FirearmAudioEventType)30, 1f);
			}
			if ((int)m_curPos == 0 && (int)m_lastPos != 0)
			{
				FireArm.PlayAudioEvent((FirearmAudioEventType)31, 1f);
			}
			m_lastPos = m_curPos;
		}
	}
	public class MagMani : MonoBehaviour
	{
		public OpenBoltReceiver gun;

		public GameObject magmount;

		public GameObject well;

		public Collider col;

		public Collider col2;

		private void Start()
		{
		}

		private void Update()
		{
			//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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				if ((float)((FVRFireArm)gun).Magazine.m_numRounds == 0f)
				{
					col.enabled = true;
					if (magmount.transform.localEulerAngles.z < 5f)
					{
						((FVRFireArm)gun).EjectMag(true);
					}
					else if (!(magmount.transform.localEulerAngles.z >= 5f))
					{
					}
				}
				else if ((float)((FVRFireArm)gun).Magazine.m_numRounds > 0f && magmount.transform.localEulerAngles.z == 45f)
				{
					col.enabled = false;
				}
			}
			else if (!Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine) && magmount.transform.localEulerAngles.z < 5f)
			{
				well.transform.localEulerAngles = new Vector3(0f, 0f, 20f);
				((Component)this).transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			else if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine) && magmount.transform.localEulerAngles.z < 5f)
			{
				well.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			if (Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				col2.enabled = false;
			}
			if (!Object.op_Implicit((Object)(object)((FVRFireArm)gun).Magazine))
			{
				col2.enabled = true;
			}
		}
	}
}
public class MagPosChange : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}
}
namespace JerryComponent
{
	public class MagRotate : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public FVRFoldingStockYAxis fold;

		private GameObject _player = null;

		private FVRViveHand leftHand = null;

		private FVRViveHand rightHand = null;

		public bool leftGrab;

		public bool rightGrab;

		private void Awake()
		{
			_player = ((Component)Object.FindObjectOfType<FVRPlayerBody>()).gameObject;
		}

		private void Start()
		{
			leftHand = ((Component)_player.transform.Find("Controller (left)")).GetComponent<FVRViveHand>();
			rightHand = ((Component)_player.transform.Find("Controller (right)")).GetComponent<FVRViveHand>();
		}

		private void Update()
		{
			//IL_021b: 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_00bf: 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_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cb: 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_0196: 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)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if (rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					if ((Object)(object)rightHand.CurrentInteractable != (Object)null)
					{
						rightGrab = false;
					}
					else
					{
						rightHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
						((FVRInteractiveObject)fold).BeginInteraction(rightHand);
						rightGrab = true;
					}
				}
				if (leftHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					if ((Object)(object)leftHand.CurrentInteractable != (Object)null)
					{
						leftGrab = false;
						return;
					}
					leftHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
					((FVRInteractiveObject)fold).BeginInteraction(leftHand);
					leftGrab = true;
				}
				else if (!rightHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					gun.EjectMag(false);
				}
				else if (!leftHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
				{
					gun.EjectMag(false);
				}
				else if (rot.transform.localEulerAngles.y != 30f)
				{
				}
			}
			else if (!Object.op_Implicit((Object)(object)gun.Magazine))
			{
				rot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class MagRotate2 : MonoBehaviour
	{
		public GameObject rot;

		public FVRFireArm gun;

		public MagFold fold;

		private void Awake()
		{
		}

		private void Start()
		{
		}

		private void Update()
		{
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)gun.Magazine))
			{
				if ((Object)(object)((FVRInteractiveObject)gun).m_hand != (Object)null)
				{
					if (((FVRInteractiveObject)gun).m_hand.OtherHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
					{
						if (!((Object)(object)((FVRInteractiveObject)gun).m_hand.OtherHand.CurrentInteractable != (Object)null))
						{
							((FVRInteractiveObject)gun).m_hand.OtherHand.ForceSetInteractable((FVRInteractiveObject)(object)fold);
							((FVRInteractiveObject)fold).BeginInteraction(((FVRInteractiveObject)gun).m_hand.OtherHand);
						}
					}
					else if (!((FVRInteractiveObject)gun).m_hand.OtherHand.Input.IsGrabbing && rot.transform.localEulerAngles.y < 30f)
					{
						gun.EjectMag(false);
					}
					else if (rot.transform.localEulerAngles.y >= 30f && (Object)(object)((FVRInteractiveObject)gun).m_hand.OtherHand.m_currentInteractable == (Object)(object)fold)
					{
						fold.MinRot = 30f;
						fold.MaxRot = 30f;
					}
				}
				else if ((Object)(object)((FVRInteractiveObject)gun).m_hand == (Object)null && rot.transform.localEulerAngles.y < 30f)
				{
					gun.EjectMag(false);
				}
			}
			else if (!Object.op_Implicit((Object)(object)gun.Magazine))
			{
				fold.MinRot = 0f;
				fold.MaxRot = 30f;
				rot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}
	}
	public class Assem : FVRPhysicalObject, IFVRDamageable
	{
		public Transform Tip;

		public Vector2 TipRange;

		[NonSerialized]
		public bool m_isSpraying;

		[NonSerialized]
		public bool m_wasSpraying;

		[NonSerialized]
		public bool m_isIgnited;

		[NonSerialized]
		public bool m_wasIgnited;

		public LayerMask LM_sprayCast;

		[NonSerialized]
		public RaycastHit m_hit;

		public string Filltag;

		public float SprayDistance;

		public float SprayAngle;

		public AudioEvent AudEvent_Head;

		public AudioEvent AudEvent_Tail;

		public AudioSource AudSource_Loop;

		public AudioClip AudClip_Spray;

		public AudioClip AudClip_Fire;

		public Transform Muzzle;

		public ParticleSystem PSystem_Spray;

		public GameObject Proj_Fire;

		public GameObject IgnitorTrigger;

		public AudioEvent AudEvent_Rattle;

		public float RattleRadius;

		public float RattleHeight;

		[NonSerialized]
		public Vector3 m_rattlePos = Vector3.zero;

		[NonSerialized]
		public Vector3 m_rattleLastPos = Vector3.zero;

		[NonSerialized]
		public Vector3 m_rattleVel = Vector3.zero;

		[NonSerialized]
		public bool m_israttleSide;

		[NonSerialized]
		public bool m_wasrattleSide;

		public Transform ballviz;

		[NonSerialized]
		public bool m_hasExploed;

		public GameObject Splode;

		[NonSerialized]
		public float m_timeTilCast = 0.03f;

		public void Damage(Damage d)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Invalid comparison between Unknown and I4
			if ((int)d.Class == 1 || (d.Dam_Thermal > 0f && m_isSpraying))
			{
				Explode();
			}
		}

		public void Explode()
		{
			//IL_0025: 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)
			if (!m_hasExploed)
			{
				m_hasExploed = true;
				Object.Instantiate<GameObject>(Splode, ((Component)this).transform.position, ((Component)this).transform.rotation);
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}

		public void RattleUpdate()
		{
			//IL_0033: 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_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0133: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0255: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_021f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0234: Unknown result type (might be due to invalid IL or missing references)
			//IL_0243: Unknown result type (might be due to invalid IL or missing references)
			m_wasrattleSide = m_israttleSide;
			if (m_wasrattleSide)
			{
				m_rattleVel = ((FVRPhysicalObject)this).RootRigidbody.velocity;
			}
			else
			{
				m_rattleVel -= ((FVRPhysicalObject)this).RootRigidbody.GetPointVelocity(((Component)this).transform.TransformPoint(m_rattlePos)) * Time.deltaTime;
			}
			m_rattleVel += Vector3.up * -0.5f * Time.deltaTime;
			Vector3 val = ((Component)this).transform.InverseTransformDirection(m_rattleVel);
			m_rattlePos += val * Time.deltaTime;
			float num = m_rattlePos.y;
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(m_rattlePos.x, m_rattlePos.z);
			m_israttleSide = false;
			float magnitude = ((Vector2)(ref val2)).magnitude;
			if (magnitude > RattleRadius)
			{
				float num2 = RattleRadius - magnitude;
				val2 = Vector2.op_Implicit(Vector3.ClampMagnitude(Vector2.op_Implicit(val2), RattleRadius));
				num += num2 * Mathf.Sign(num);
				val = Vector3.ProjectOnPlane(val, new Vector3(val2.x, 0f, val2.y));
				m_israttleSide = true;
			}
			if (Mathf.Abs(num) > RattleHeight)
			{
				num = RattleHeight * Mathf.Sign(num);
				val.y = 0f;
				m_israttleSide = true;
			}
			m_rattlePos = new Vector3(val2.x, num, val2.y);
			m_rattleVel = ((Component)this).transform.TransformDirection(val);
			ballviz.localPosition = m_rattlePos;
			if (m_israttleSide && !m_wasrattleSide)
			{
				float num3 = Mathf.Clamp(4f * (Vector3.Distance(m_rattlePos, m_rattleLastPos) / RattleRadius), 0f, 1f);
				SM.PlayCoreSoundOverrides((FVRPooledAudioType)40, AudEvent_Rattle, ballviz.position, new Vector2(num3 * 0.4f, num3 * 0.4f), new Vector2(1f, 1f));
			}
			m_rattleLastPos = m_rattlePos;
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			m_isSpraying = false;
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				((FVRPhysicalObject)this).SetAnimatedComponent(Tip, Mathf.Lerp(TipRange.x, TipRange.y, hand.Input.TriggerFloat), (InterpStyle)0, (Axis)1);
				if (hand.Input.TriggerFloat > 0.8f)
				{
					m_isSpraying = true;
				}
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).EndInteraction(hand);
			((FVRPhysicalObject)this).SetAnimatedComponent(Tip, TipRange.x, (InterpStyle)0, (Axis)1);
			m_isSpraying = false;
		}

		public void Ignite()
		{
			if (m_isSpraying)
			{
				m_isIgnited = true;
			}
		}

		public override void FVRUpdate()
		{
			//IL_0043: 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_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_0147: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: 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_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0259: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).FVRUpdate();
			RattleUpdate();
			if (m_isSpraying)
			{
				m_timeTilCast -= Time.deltaTime;
				if (m_isIgnited)
				{
					GameObject val = Object.Instantiate<GameObject>(Proj_Fire, Muzzle.position, Muzzle.rotation);
					val.transform.Rotate(new Vector3(Random.Range(0f - SprayAngle, SprayAngle), Random.Range(0f - SprayAngle, SprayAngle), 0f));
					BallisticProjectile component = val.GetComponent<BallisticProjectile>();
					component.Fire(component.MuzzleVelocityBase, val.transform.forward, (FVRFireArm)null, true);
				}
				else
				{
					PSystem_Spray.Emit(10);
					if (m_timeTilCast < 0f)
					{
						m_timeTilCast = 0.03f;
						Vector3 forward = Muzzle.forward;
						forward = Quaternion.AngleAxis(Random.Range((0f - SprayAngle) * 3f, SprayAngle * 3f), Muzzle.up) * forward;
						forward = Quaternion.AngleAxis(Random.Range((0f - SprayAngle) * 3f, SprayAngle * 3f), Muzzle.right) * forward;
						if (Physics.Raycast(Muzzle.position, Muzzle.forward, ref m_hit, SprayDistance, LayerMask.op_Implicit(LM_sprayCast), (QueryTriggerInteraction)1) && ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.CompareTag(Filltag))
						{
							maufunctions component2 = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<maufunctions>();
							component2.wetness += 25f;
						}
					}
				}
			}
			if (m_isSpraying && !m_wasSpraying)
			{
				SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Head, Muzzle.position);
				AudSource_Loop.clip = AudClip_Spray;
				AudSource_Loop.Play();
			}
			else if (m_wasSpraying && !m_isSpraying)
			{
				SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Tail, Muzzle.position);
				AudSource_Loop.Stop();
			}
			if (m_isSpraying && !m_isIgnited)
			{
				if (!IgnitorTrigger.activeSelf)
				{
					IgnitorTrigger.SetActive(true);
				}
			}
			else if (IgnitorTrigger.activeSelf)
			{
				IgnitorTrigger.SetActive(false);
			}
			if (!m_isSpraying)
			{
				m_isIgnited = false;
			}
			if (m_isIgnited && !m_wasIgnited)
			{
				AudSource_Loop.clip = AudClip_Fire;
				AudSource_Loop.Play();
			}
			m_wasSpraying = m_isSpraying;
			m_wasIgnited = m_isIgnited;
		}
	}
	public class DisableInterfaceAndcolliders : MonoBehaviour
	{
		public bool locked = true;

		public Handgun gun;

		public GameObject triggerguradrot;

		public GameObject safetyrot;

		public FVRFireArmAttachmentMount maglatch;

		public FVRFireArmAttachmentMount barrel;

		public FVRFireArmAttachmentMount spring;

		public FVRFireArmAttachmentMount slide;

		public FVRFireArmAttachmentMount trigger;

		public FVRFireArmAttachmentMount triggerguard;

		public FVRFireArmAttachmentMount safety;

		public FVRFireArmAttachmentMount lever;

		public FVRFireArmAttachmentMount hammer;

		public FVRFireArmAttachmentMount hammerstop;

		public FVRFireArmAttachmentMount sliderelease;

		public Collider safetycol;

		public Collider springcol;

		public Collider slidecol;

		public Collider SlideGrab;

		public GameObject slidepiece;

		public ManipulateObject springmani;

		private void Start()
		{
		}

		private void Update()
		{
			//IL_024c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0573: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: 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_0504: Unknown result type (might be due to invalid IL or missing references)
			//IL_0509: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a26: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afd: Unknown result type (might be due to invalid IL or missing references)
			if (slide.HasAttachmentsOnIt())
			{
				((Behaviour)springmani).enabled = true;
				if (spring.HasAttachmentsOnIt())
				{
					((Component)spring.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (barrel.HasAttachmentsOnIt())
				{
					((Component)barrel.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (trigger.HasAttachmentsOnIt())
				{
					((Component)trigger.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (triggerguard.HasAttachmentsOnIt())
				{
					((Component)triggerguard.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (lever.HasAttachmentsOnIt())
				{
					((Component)lever.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
					if (((FVRPhysicalObject)lever.AttachmentsList[0]).AttachmentMounts[0].HasAttachmentsOnIt())
					{
						((Component)((FVRPhysicalObject)lever.AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
					}
				}
				if (hammer.HasAttachmentsOnIt())
				{
					((Component)hammer.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (hammerstop.HasAttachmentsOnIt())
				{
					((Component)hammerstop.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
				if (sliderelease.HasAttachmentsOnIt())
				{
					((Component)sliderelease.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
			}
			else if (!slide.HasAttachmentsOnIt())
			{
				((Behaviour)springmani).enabled = false;
				((Component)spring).gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
				if (spring.HasAttachmentsOnIt())
				{
					((Component)spring.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
					if (barrel.HasAttachmentsOnIt())
					{
						((Component)barrel.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
					}
				}
				else if (!spring.HasAttachmentsOnIt() && barrel.HasAttachmentsOnIt())
				{
					((Component)barrel.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				if (trigger.HasAttachmentsOnIt())
				{
					((Component)trigger.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				if (triggerguard.HasAttachmentsOnIt())
				{
					((Component)triggerguard.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				if (lever.HasAttachmentsOnIt())
				{
					((Component)lever.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
					if (((FVRPhysicalObject)lever.AttachmentsList[0]).AttachmentMounts[0].HasAttachmentsOnIt())
					{
						((Component)((FVRPhysicalObject)lever.AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
					}
				}
				if (hammer.HasAttachmentsOnIt())
				{
					((Component)hammer.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				if (hammerstop.HasAttachmentsOnIt())
				{
					((Component)hammerstop.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				if (sliderelease.HasAttachmentsOnIt())
				{
					((Component)sliderelease.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
			}
			if (safety.HasAttachmentsOnIt())
			{
				if (slide.HasAttachmentsOnIt())
				{
					((Component)slide.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
			}
			else if (!safety.HasAttachmentsOnIt() && slide.HasAttachmentsOnIt())
			{
				if (triggerguradrot.transform.localEulerAngles.x > 10f)
				{
					((Component)slide.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
				else
				{
					((Component)slide.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
			}
			if (triggerguradrot.transform.localEulerAngles.x < 10f)
			{
				SlideGrab.enabled = true;
				if (safety.HasAttachmentsOnIt())
				{
					((Component)safety.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
				}
			}
			else if (triggerguradrot.transform.localEulerAngles.x > 10f)
			{
				SlideGrab.enabled = false;
				if (safety.HasAttachmentsOnIt())
				{
					((Component)safety.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
			}
			if (!maglatch.HasAttachmentsOnIt())
			{
				((FVRFireArm)gun).EjectMag(false);
			}
			else if (!maglatch.HasAttachmentsOnIt())
			{
			}
			if (barrel.HasAttachmentsOnIt())
			{
				springcol.enabled = true;
			}
			else if (!barrel.HasAttachmentsOnIt())
			{
				springcol.enabled = false;
			}
			if (barrel.HasAttachmentsOnIt() && spring.HasAttachmentsOnIt() && lever.HasAttachmentsOnIt() && hammer.HasAttachmentsOnIt() && hammerstop.HasAttachmentsOnIt() && sliderelease.HasAttachmentsOnIt())
			{
				if (lever.HasAttachmentsOnIt())
				{
					slidecol.enabled = true;
				}
				else
				{
					slidecol.enabled = false;
				}
			}
			else if (!barrel.HasAttachmentsOnIt() || !spring.HasAttachmentsOnIt() || !lever.HasAttachmentsOnIt() || !hammer.HasAttachmentsOnIt() || !hammerstop.HasAttachmentsOnIt() || !sliderelease.HasAttachmentsOnIt())
			{
				slidecol.enabled = false;
			}
			if (slide.HasAttachmentsOnIt())
			{
				safetycol.enabled = true;
			}
			else if (!slide.HasAttachmentsOnIt())
			{
				safetycol.enabled = false;
			}
			if (maglatch.HasAttachmentsOnIt())
			{
				if (((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentMounts[0].HasAttachmentsOnIt())
				{
					((Component)maglatch.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
					if (((FVRPhysicalObject)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0]).AttachmentMounts[0].HasAttachmentsOnIt())
					{
						((Component)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
						if (((FVRPhysicalObject)((FVRPhysicalObject)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0]).AttachmentsList[0]).AttachmentMounts[0].HasAttachmentsOnIt())
						{
							((Component)((FVRPhysicalObject)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(false);
						}
						else
						{
							((Component)((FVRPhysicalObject)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
						}
					}
					else
					{
						((Component)((FVRPhysicalObject)maglatch.AttachmentsList[0]).AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
					}
				}
				else
				{
					((Component)maglatch.AttachmentsList[0].AttachmentInterface).gameObject.SetActive(true);
				}
			}
			if (!slide.HasAttachmentsOnIt() || !trigger.HasAttachmentsOnIt() || !triggerguard.HasAttachmentsOnIt() || !safety.HasAttachmentsOnIt())
			{
				locked = true;
				gun.m_isSafetyEngaged = true;
				slidepiece.transform.localPosition = new Vector3(0f, 0.0266f, 0.001f);
				SlideGrab.enabled = false;
				safetyrot.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
			else if (slide.HasAttachmentsOnIt() && trigger.HasAttachmentsOnIt() && triggerguard.HasAttachmentsOnIt() && safety.HasAttachmentsOnIt() && locked)
			{
				gun.m_isSafetyEngaged = false;
				safetyrot.transform.localEulerAngles = new Vector3(30f, 0f, 0f);
				slidepiece.transform.localPosition = new Vector3(0f, 0.0266f, 0.0394f);
				locked = false;
			}
		}
	}
	public class brush : MonoBehaviour
	{
		public Transform holder;

		public maufunctions mauf;

		public float cd = 0.5f;

		public GameObject particle;

		public AudioEvent sweep;

		public void OnTriggerStay(Collider col)
		{
			//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_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			if (((Object)((Component)col).gameObject).name == "BarrelBrush(Clone)")
			{
				cd -= Time.deltaTime;
				if (cd < 0f)
				{
					cd = 0.5f;
					mauf.malfB += Random.Range(0.1f, 0.25f);
					Object.Instantiate<GameObject>(particle, ((Component)this).transform.position, ((Component)this).transform.rotation);
					SM.PlayGenericSound(sweep, ((Component)this).transform.position);
				}
				((Component)col).gameObject.transform.SetParent(holder);
				((Component)col).gameObject.transform.localPosition = new Vector3(0f, 0f, ((Component)col).gameObject.transform.localPosition.z);
				((Component)col).gameObject.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
			}
		}

		public void OnTriggerExit(Collider col)
		{
			if (((Object)((Component)col).gameObject).name == "BarrelBrush(Clone)")
			{
				cd = 0.5f;
				((Component)col).gameObject.transform.SetParent((Transform)null);
			}
		}

		private void Start()
		{
		}

		private void Update()
		{
		}
	}
	public class maufunctions : MonoBehaviour
	{
		public Handgun gun;

		public DisableInterfaceAndcolliders diac;

		public float malf;

		public float malfB;

		public Material mat1;

		public Material mat2;

		public Materi