Decompiled source of Ross MKIV v1.2.0

Ross_MKIV.dll

Decompiled 2 months ago
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 OtherLoader;
using UnityEngine;

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace JerryAr.Ross_MKIV
{
	[BepInPlugin("JerryAr.Ross_MKIV", "Ross_MKIV", "1.2.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class Ross_MKIVPlugin : 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()
		{
			OtherLoader.RegisterDirectLoad(BasePath, "JerryAr.Ross_MKIV", "", "", "rossmkiv", "");
		}
	}
}
namespace JerryComponent
{
	public class ForeSightEnableandDisable : MonoBehaviour
	{
		public FVRFireArmAttachment MainObj;

		public GameObject fakeoptic;

		public GameObject realoptic;

		private void Start()
		{
		}

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

		public FVRFireArmAttachmentMount Mount;

		public int FireMode;

		public GameObject Slide;

		public Transform fore;

		public Transform rear;

		public int burst = 5;

		public float cd = 0.05f;

		public AR15HandleSightFlipper Eject;

		public GameObject hide;

		public bool startburst = false;

		public AudioEvent click;

		public FVRViveHand curhand;

		public GameObject followhand;

		public bool startFollow = false;

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

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

		public SRG gun;

		public GameObject ind1;

		public GameObject ind2;

		public GameObject ind3;

		public GameObject ind4;

		private void Start()
		{
		}

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