Decompiled source of Regulus Weapons Pack v1.0.0

Regulus_Weapons_Pack.dll

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

[assembly: Debuggable(DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace Earwig_Scripts
{
	public class EWG_Simple_Rangefinder : MonoBehaviour
	{
		public Text Range_Text;

		public Transform Laser_Pointer;

		public LayerMask LM_Laser_Pointer;

		private RaycastHit m_hit;

		public bool Uses_Scope;

		public PIPScope Scope;

		public float Max_Range;

		private void Update()
		{
			if (Uses_Scope)
			{
				if (((Behaviour)Scope).enabled)
				{
					UpdateText(GetRange());
					((Component)Range_Text).gameObject.SetActive(true);
				}
				else
				{
					((Component)Range_Text).gameObject.SetActive(false);
				}
			}
			else
			{
				UpdateText(GetRange());
			}
		}

		public float GetRange()
		{
			//IL_001e: 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_0036: Unknown result type (might be due to invalid IL or missing references)
			float scopeMaxDrawRange = GM.CurrentSceneSettings.ScopeMaxDrawRange;
			scopeMaxDrawRange = Mathf.Min(scopeMaxDrawRange, 9999f);
			if (Physics.Raycast(Laser_Pointer.position, Laser_Pointer.forward, ref m_hit, scopeMaxDrawRange, LayerMask.op_Implicit(LM_Laser_Pointer)))
			{
				return ((RaycastHit)(ref m_hit)).distance;
			}
			return scopeMaxDrawRange;
		}

		private void UpdateText(float rangeNum)
		{
			rangeNum = Mathf.Min(rangeNum, Max_Range);
			string text = ((!(rangeNum < 100f)) ? rangeNum.ToString("f0") : rangeNum.ToString("f1"));
			Range_Text.text = text;
		}
	}
	public class GroundFire : MonoBehaviour
	{
		public GameObject GroundFirePrefab;

		public int Amount_To_Spawn;

		public int Max_Tries;

		public float Range;

		public LayerMask LM;

		private RaycastHit m_hit;

		private int m_spawned;

		private void Start()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: 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)
			m_spawned = 0;
			for (int i = 0; i < Max_Tries; i++)
			{
				if (m_spawned >= Amount_To_Spawn)
				{
					break;
				}
				Vector3 val = -Vector3.up;
				if (i > 0)
				{
					val = Random.onUnitSphere;
					if (val.y > 0f)
					{
						val.y = 0f - val.y;
					}
				}
				if (Physics.Raycast(((Component)this).transform.position + Vector3.up, val, ref m_hit, Range, LayerMask.op_Implicit(LM), (QueryTriggerInteraction)1))
				{
					Object.Instantiate<GameObject>(GroundFirePrefab, ((RaycastHit)(ref m_hit)).point, Quaternion.LookRotation(Vector3.up));
					m_spawned++;
				}
			}
		}
	}
	public class Left_Right_Switcher : MonoBehaviour
	{
		public enum Axis
		{
			X,
			Y,
			Z
		}

		public GameObject Left_Object;

		public GameObject Right_Object;

		public Transform Switch_Object;

		public Axis Mirror_Axis;

		public bool Is_Left;

		public PIPScopeController pipscope;

		public ReflexSightController reflex;

		public LaserLightAttachment laser;

		public void Switch_Sides()
		{
			if (Is_Left)
			{
				Is_Left = false;
				Left_Object.SetActive(false);
				Right_Object.SetActive(true);
				Mirror(Mirror_Axis);
				UpdateComponents();
			}
			else
			{
				Is_Left = true;
				Left_Object.SetActive(true);
				Right_Object.SetActive(false);
				Mirror(Mirror_Axis);
				UpdateComponents();
			}
		}

		private void Mirror(Axis a)
		{
			//IL_0026: 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_003a: 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_004d: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			switch (a)
			{
			case Axis.X:
				Switch_Object.localPosition = new Vector3(0f - Switch_Object.localPosition.x, Switch_Object.localPosition.y, Switch_Object.localPosition.z);
				break;
			case Axis.Y:
				Switch_Object.localPosition = new Vector3(Switch_Object.localPosition.x, 0f - Switch_Object.localPosition.y, Switch_Object.localPosition.z);
				break;
			case Axis.Z:
				Switch_Object.localPosition = new Vector3(Switch_Object.localPosition.x, Switch_Object.localPosition.y, 0f - Switch_Object.localPosition.z);
				break;
			}
		}

		private void UpdateComponents()
		{
			if ((Object)(object)pipscope != (Object)null)
			{
				pipscope.UpdateScopeParams();
			}
			if ((Object)(object)reflex != (Object)null)
			{
				reflex.Zero();
			}
			if ((Object)(object)laser != (Object)null)
			{
				laser.UpdateParams();
			}
		}
	}
	public class Left_Right_Trigger : FVRInteractiveObject
	{
		public Left_Right_Switcher Switch;

		public AudioEvent Switch_Sound;

		public override void SimpleInteraction(FVRViveHand hand)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).SimpleInteraction(hand);
			Switch.Switch_Sides();
			SM.PlayGenericSound(Switch_Sound, ((Component)this).transform.position);
		}
	}
	public class Revolving_Shotgun_Caseless_Fixed_Trigger : RevolvingShotgunTrigger
	{
		public override void BeginInteraction(FVRViveHand hand)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Invalid comparison between Unknown and I4
			if ((Object)(object)base.Shotgun != (Object)null && (int)base.TType == 1)
			{
				for (int i = 0; i < base.Shotgun.Chambers.Length; i++)
				{
					if ((Object)(object)base.Shotgun.Chambers[i].GetRound() != (Object)null && base.Shotgun.Chambers[i].IsSpent && base.Shotgun.Chambers[i].GetRound().IsCaseless)
					{
						base.Shotgun.Chambers[i].Unload();
					}
				}
			}
			((RevolvingShotgunTrigger)this).BeginInteraction(hand);
		}
	}
}
namespace earwig256.Regulus_Weapons_Pack
{
	[BepInPlugin("earwig256.Regulus_Weapons_Pack", "Regulus_Weapons_Pack", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class Regulus_Weapons_PackPlugin : 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(), "earwig256.Regulus_Weapons_Pack");
			OtherLoader.RegisterDirectLoad(BasePath, "earwig256.Regulus_Weapons_Pack", "", "", "regulus base pack,regulus attachments,regulus snipers,regulus ordinance,regulus tools", "");
		}
	}
	public class Regulus_C4_Activator : MonoBehaviour
	{
		public C4 C4_Object;

		public GameObject Indicator_On;

		public GameObject Indicator_Off;

		public AudioEvent Arm_Sound;

		private bool m_armed;

		public void Start()
		{
			m_armed = false;
		}

		public void Update()
		{
			//IL_00e8: 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)
			if (((FVRInteractiveObject)C4_Object).IsHeld)
			{
				if (((FVRInteractiveObject)C4_Object).m_hand.IsInStreamlinedMode)
				{
					if (((FVRInteractiveObject)C4_Object).m_hand.Input.AXButtonDown || ((FVRInteractiveObject)C4_Object).m_hand.Input.BYButtonDown)
					{
						C4_Object.SetArmed(!m_armed);
						m_armed = !m_armed;
						SM.PlayGenericSound(Arm_Sound, ((Component)this).transform.position);
					}
				}
				else if (((FVRInteractiveObject)C4_Object).m_hand.Input.TouchpadDown)
				{
					C4_Object.SetArmed(!m_armed);
					m_armed = !m_armed;
					SM.PlayGenericSound(Arm_Sound, ((Component)this).transform.position);
				}
			}
			if (m_armed && !Indicator_On.activeSelf)
			{
				Indicator_On.SetActive(true);
				Indicator_Off.SetActive(false);
			}
			else if (!m_armed && !Indicator_Off.activeSelf)
			{
				Indicator_On.SetActive(false);
				Indicator_Off.SetActive(true);
			}
		}
	}
	public class Regulus_Cloak_Attachment : MonoBehaviour
	{
		public enum CloakState
		{
			Uncloaked,
			Cloaking,
			Cloaked
		}

		public FVRFireArm fireArm;

		public float Max_Cloak;

		public float Regen_Multiplier;

		public float Cloak_Delay;

		public float Firing_Delay;

		public Renderer Cloak_Display;

		public CloakState State;

		public AudioEvent Cloak_Activate;

		public AudioEvent Cloak_Deactivate;

		private float m_cloakEnergy;

		private bool m_fired;

		private float m_fireCountdown;

		private bool m_triggerHeld;

		private float m_cloakDelay;

		public void Awake()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Expected O, but got Unknown
			m_cloakEnergy = Max_Cloak;
			m_fired = false;
			m_triggerHeld = false;
			m_cloakDelay = Cloak_Delay;
			m_fireCountdown = 0f;
			Cloak_Display.material.SetFloat("_EmissionWeight", 0.7f);
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnFire);
		}

		public 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(OnFire);
		}

		public void Update()
		{
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)fireArm != (Object)null && (Object)(object)((FVRPhysicalObject)fireArm).AltGrip != (Object)null && ((FVRInteractiveObject)((FVRPhysicalObject)fireArm).AltGrip).IsHeld && ((FVRInteractiveObject)((FVRPhysicalObject)fireArm).AltGrip).m_hand.Input.TriggerPressed)
			{
				m_triggerHeld = true;
			}
			else if ((Object)(object)fireArm != (Object)null && fireArm.IsTwoHandStabilized())
			{
				m_triggerHeld = true;
			}
			else
			{
				m_triggerHeld = false;
			}
			if (m_fired)
			{
				m_fireCountdown -= Time.deltaTime;
				if (m_fireCountdown <= 0f)
				{
					m_fired = false;
					Cloak_Display.material.SetFloat("_EmissionWeight", 0.7f);
				}
			}
			switch (State)
			{
			case CloakState.Uncloaked:
				if (m_cloakEnergy < Max_Cloak && !m_fired)
				{
					m_cloakEnergy += Time.deltaTime * Regen_Multiplier;
					m_cloakEnergy = Mathf.Clamp(m_cloakEnergy, 0f, Max_Cloak);
					UpdateCloakDisplay();
				}
				if (m_triggerHeld && !m_fired)
				{
					State = CloakState.Cloaking;
					SM.PlayGenericSound(Cloak_Activate, ((Component)this).transform.position);
					m_cloakDelay = Cloak_Delay;
				}
				break;
			case CloakState.Cloaking:
				m_cloakDelay -= Time.deltaTime;
				if (m_cloakDelay <= 0f)
				{
					Cloak_Display.material.SetFloat("_EmissionWeight", 1f);
					State = CloakState.Cloaked;
				}
				break;
			case CloakState.Cloaked:
				if (!m_triggerHeld)
				{
					State = CloakState.Uncloaked;
					Cloak_Display.material.SetFloat("_EmissionWeight", 0.7f);
					SM.PlayGenericSound(Cloak_Deactivate, ((Component)this).transform.position);
					break;
				}
				GM.CurrentPlayerBody.ActivatePower((PowerupType)4, (PowerUpIntensity)0, (PowerUpDuration)3, false, false, 1.05f);
				m_cloakEnergy -= Time.deltaTime;
				if (m_cloakEnergy <= 0f)
				{
					State = CloakState.Uncloaked;
					Cloak_Display.material.SetFloat("_EmissionWeight", 0.4f);
					SM.PlayGenericSound(Cloak_Deactivate, ((Component)this).transform.position);
					m_cloakEnergy = Mathf.Clamp(Firing_Delay * Regen_Multiplier, 0f, Max_Cloak);
					m_fired = true;
					m_fireCountdown = Firing_Delay;
				}
				UpdateCloakDisplay();
				break;
			}
		}

		public void UpdateCloakDisplay()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp(m_cloakEnergy / Max_Cloak, 0f, 1f);
			num = 0f - num;
			num += 0.5f;
			Cloak_Display.material.SetTextureOffset("_MainTex", new Vector2(num, 0f));
		}

		public void OnFire(FVRFireArm fa)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)fireArm != (Object)null && (Object)(object)fa == (Object)(object)fireArm)
			{
				m_fired = true;
				Cloak_Display.material.SetFloat("_EmissionWeight", 0.4f);
				m_fireCountdown = Firing_Delay;
				if (State == CloakState.Cloaked || State == CloakState.Cloaking)
				{
					State = CloakState.Uncloaked;
					SM.PlayGenericSound(Cloak_Deactivate, ((Component)this).transform.position);
				}
			}
		}
	}
	public class Regulus_Cloak_Attachment_Interface : FVRFireArmAttachmentInterface
	{
		public Regulus_Cloak_Attachment Cloaker;

		public override void Awake()
		{
			((FVRFireArmAttachmentInterface)this).Awake();
			if ((Object)(object)base.Attachment != (Object)null && base.Attachment.curMount.Parent is FVRFireArm)
			{
				ref FVRFireArm fireArm = ref Cloaker.fireArm;
				FVRPhysicalObject parent = base.Attachment.curMount.Parent;
				fireArm = (FVRFireArm)(object)((parent is FVRFireArm) ? parent : null);
			}
		}

		public override void OnAttach()
		{
			((FVRFireArmAttachmentInterface)this).OnAttach();
			if (base.Attachment.curMount.Parent is FVRFireArm)
			{
				ref FVRFireArm fireArm = ref Cloaker.fireArm;
				FVRPhysicalObject parent = base.Attachment.curMount.Parent;
				fireArm = (FVRFireArm)(object)((parent is FVRFireArm) ? parent : null);
			}
			else
			{
				Cloaker.fireArm = null;
			}
		}

		public override void OnDetach()
		{
			((FVRFireArmAttachmentInterface)this).OnDetach();
			Cloaker.fireArm = null;
		}
	}
	public class Regulus_Dart_Display : MonoBehaviour
	{
		public Transform Display;

		public float Min_Scale;

		public float Min_Scale_Distance;

		private float m_Scale;

		private float m_Lerp;

		private void LateUpdate()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			//IL_004d: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: 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)
			Display.position = GM.CurrentPlayerBody.Head.position;
			Display.LookAt(((Component)this).transform.position);
			Transform display = Display;
			display.position += Display.forward * 2f;
			m_Lerp = Mathf.InverseLerp(0f, Min_Scale_Distance, Vector3.Distance(((Component)this).transform.position, Display.position));
			m_Scale = Mathf.Lerp(1f, Min_Scale, m_Lerp);
			Display.localScale = new Vector3(m_Scale, m_Scale, m_Scale);
		}
	}
	public class Regulus_Dart_Scan : MonoBehaviour
	{
		public float Scan_Radius = 30f;

		public float Scan_Delay = 5f;

		public int Number_of_Scans = 3;

		public LayerMask LM_Collide;

		public GameObject Prefab;

		private float m_ScanTime;

		private void Start()
		{
			Scan();
			m_ScanTime = Scan_Delay;
			Number_of_Scans--;
		}

		private void Update()
		{
			if (Number_of_Scans > 0)
			{
				m_ScanTime -= Time.deltaTime;
				if (m_ScanTime <= 0f)
				{
					m_ScanTime = Scan_Delay;
					Scan();
					Number_of_Scans--;
				}
			}
		}

		private void Scan()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Invalid comparison between Unknown and I4
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, Scan_Radius, LayerMask.op_Implicit(LM_Collide), (QueryTriggerInteraction)1);
			HashSet<Sosig> hashSet = new HashSet<Sosig>();
			for (int i = 0; i < array.Length; i++)
			{
				if (!((Object)(object)array[i].attachedRigidbody == (Object)null))
				{
					SosigLink component = ((Component)array[i].attachedRigidbody).gameObject.GetComponent<SosigLink>();
					if ((Object)(object)component != (Object)null)
					{
						hashSet.Add(component.S);
					}
				}
			}
			foreach (Sosig item in hashSet)
			{
				if ((int)item.BodyState != 3)
				{
					Object.Instantiate<GameObject>(Prefab, item.CoreTarget.position, Quaternion.LookRotation(new Vector3(0f, 0f, 1f)));
				}
			}
		}
	}
	public class Regulus_Dart_Stick : MonoBehaviour
	{
		public bool Is_PowerUp;

		public bool Has_Stick_Enable;

		public GameObject Enable_On_Stick;

		public GameObject Coll;

		public PowerupType PType;

		public PowerUpIntensity PIntensity;

		public PowerUpDuration PDuration;

		public bool PIsPuke;

		public bool PIsInverted;

		private bool m_isStuck;

		public void Start()
		{
			m_isStuck = false;
		}

		public void OnCollisionEnter(Collision col)
		{
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			if (m_isStuck)
			{
				return;
			}
			if ((Object)(object)col.collider.attachedRigidbody != (Object)null)
			{
				m_isStuck = true;
				((Component)this).gameObject.transform.SetParent(((Component)col.collider).gameObject.transform);
				if (Is_PowerUp)
				{
					SosigLink component = ((Component)col.collider.attachedRigidbody).gameObject.GetComponent<SosigLink>();
					if ((Object)(object)component != (Object)null)
					{
						component.S.ActivatePower(PType, PIntensity, PDuration, PIsPuke, PIsInverted);
					}
				}
				if (Has_Stick_Enable)
				{
					Enable_On_Stick.SetActive(true);
				}
				Object.Destroy((Object)(object)((Component)this).GetComponent<Rigidbody>());
			}
			else
			{
				m_isStuck = true;
				((Component)this).GetComponent<Rigidbody>().isKinematic = true;
			}
			if ((Object)(object)Coll != (Object)null)
			{
				Coll.SetActive(false);
			}
		}
	}
	public class Regulus_Deployable_Launcher : FVRFireArm
	{
		public FVRFireArmChamber Chamber;

		[Header("Trigger Config")]
		public Transform Trigger;

		public float TriggerFiringThreshold = 0.8f;

		public float TriggerResetThreshold = 0.4f;

		public Vector2 Trigger_Positions;

		public InterpStyle Trigger_InterpStyle;

		public Axis Trigger_Axis;

		[Header("Launcher Config")]
		public float Cooldown = 60f;

		public Renderer Cooldown_Display;

		public GameObject Display_Ready;

		public GameObject Display_Charging;

		public AudioEvent Charge_Ready;

		private float m_cooldown;

		private bool m_recharging;

		private bool m_triggerReset;

		private float m_triggerFloat;

		private float m_prevTrigger;

		public override void Awake()
		{
			((FVRFireArm)this).Awake();
			base.FChambers.Add(Chamber);
			m_cooldown = Cooldown - 1f;
			m_triggerReset = true;
			m_recharging = true;
			UpdateDisplay();
		}

		public override void FVRUpdate()
		{
			((FVRFireArm)this).FVRUpdate();
			if (m_recharging)
			{
				m_cooldown += Time.deltaTime;
				UpdateDisplay();
				if (m_cooldown >= Cooldown)
				{
					m_cooldown = Cooldown;
					m_recharging = false;
					LoadRoundIntoChamber(playSound: true);
				}
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			m_prevTrigger = m_triggerFloat;
			if (((FVRInteractiveObject)this).IsHeld)
			{
				if (!((FVRPhysicalObject)this).IsAltHeld && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
				{
					m_triggerFloat = hand.Input.TriggerFloat;
				}
				else
				{
					m_triggerFloat = 0f;
				}
				if (hand.IsInStreamlinedMode)
				{
					if (!m_recharging && (hand.Input.AXButtonDown || hand.Input.BYButtonDown))
					{
						LoadRoundIntoChamber(playSound: true);
					}
				}
				else if (!m_recharging && hand.Input.TouchpadDown)
				{
					LoadRoundIntoChamber(playSound: true);
				}
				if (m_triggerReset)
				{
					if (m_triggerFloat >= TriggerFiringThreshold && Shoot())
					{
					}
				}
				else if (m_triggerFloat < TriggerResetThreshold)
				{
					m_triggerReset = true;
				}
			}
			else
			{
				m_triggerFloat = 0f;
				m_triggerReset = true;
			}
			if (m_triggerFloat != m_prevTrigger)
			{
				((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_Positions.x, Trigger_Positions.y, m_triggerFloat), Trigger_InterpStyle, Trigger_Axis);
			}
		}

		public void LoadRoundIntoChamber(bool playSound)
		{
			//IL_0036: 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)
			if ((Object)(object)base.Magazine != (Object)null && base.Magazine.HasARound())
			{
				Chamber.Autochamber(base.Magazine.LoadedRounds[0].LR_Class);
				Display_Ready.SetActive(true);
				Display_Charging.SetActive(false);
				if (playSound)
				{
					SM.PlayGenericSound(Charge_Ready, ((Component)this).transform.position);
				}
			}
			else
			{
				m_cooldown -= 1f;
				m_recharging = true;
			}
		}

		public void UpdateDisplay()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp(m_cooldown / Cooldown, 0f, 1f);
			num = 0f - num;
			num += 0.5f;
			Cooldown_Display.material.SetTextureOffset("_MainTex", new Vector2(0f, num));
		}

		public bool Shoot()
		{
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			if (!Chamber.Fire())
			{
				return false;
			}
			((FVRFireArm)this).Fire(Chamber, base.CurrentMuzzle, true, 1f, -1f);
			((FVRFireArm)this).FireMuzzleSmoke();
			bool flag = ((FVRFireArm)this).IsTwoHandStabilized();
			bool flag2 = (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null;
			bool flag3 = ((FVRFireArm)this).IsShoulderStabilized();
			((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f);
			((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f);
			Display_Charging.SetActive(true);
			Display_Ready.SetActive(false);
			m_recharging = true;
			m_cooldown = 0f;
			return true;
		}
	}
	public class Regulus_Hand_Jet : FVRPhysicalObject
	{
		[Header("Trigger Config")]
		public Transform Trigger;

		public Axis Trigger_Axis;

		public InterpStyle Trigger_Interpstyle;

		public Vector2 Trigger_Positions;

		public float Trigger_Threshold;

		[Header("Hand Jet Config")]
		public AudioSource Audio_Jet;

		public float Jet_Force;

		public Transform Jet_Vector;

		public float Max_Fuel;

		public float Fuel_Recovery_Rate;

		public float Fuel_Threshold;

		public Transform Fuel_Display;

		public Renderer Fuel_Display_Renderer;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Color_Display;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Color_Refueling;

		public ParticleSystem Jet_Effect_1;

		public ParticleSystem Jet_Effect_2;

		private float m_triggerFloat;

		private TransformVelocity jetMover;

		private bool m_isRegistered;

		private bool m_isThrusting;

		private float m_fuel;

		private bool m_refueling;

		private float m_prevFuel;

		public override void Start()
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_003d: 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_0058: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).Start();
			jetMover = new TransformVelocity(TransformVel);
			m_fuel = Max_Fuel;
			m_refueling = false;
			Fuel_Display_Renderer.material.SetColor("_EmissionColor", Color_Display);
			Fuel_Display.localScale = new Vector3(Fuel_Display.localScale.x, 1f, Fuel_Display.localScale.z);
		}

		public override void OnDestroy()
		{
			((FVRPhysicalObject)this).OnDestroy();
			if (jetMover != null)
			{
				GM.CurrentMovementManager.DeregisterSmoothLocoRestrictor(jetMover);
			}
			jetMover = null;
		}

		public override void FVRUpdate()
		{
			//IL_0138: 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)
			//IL_01ed: 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)
			//IL_020d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			m_prevFuel = m_fuel;
			if (m_triggerFloat > Trigger_Threshold && m_fuel > 0f && !m_refueling)
			{
				m_isThrusting = true;
				m_fuel -= Time.deltaTime;
				if (!Audio_Jet.isPlaying)
				{
					Audio_Jet.Play();
				}
				if (!Jet_Effect_1.isPlaying)
				{
					Jet_Effect_1.Play();
				}
				if (!Jet_Effect_2.isPlaying)
				{
					Jet_Effect_2.Play();
				}
			}
			else
			{
				m_isThrusting = false;
				if (Audio_Jet.isPlaying)
				{
					Audio_Jet.Stop();
				}
				if (Jet_Effect_1.isPlaying)
				{
					Jet_Effect_1.Stop();
				}
				if (Jet_Effect_2.isPlaying)
				{
					Jet_Effect_2.Stop();
				}
				if (m_fuel <= 0f)
				{
					m_refueling = true;
					Fuel_Display_Renderer.material.SetColor("_EmissionColor", Color_Refueling);
				}
				if (m_fuel < Max_Fuel)
				{
					m_fuel += Fuel_Recovery_Rate * Time.deltaTime;
					if (m_fuel > Max_Fuel)
					{
						m_fuel = Max_Fuel;
					}
				}
				if (m_refueling && m_fuel > Fuel_Threshold)
				{
					m_refueling = false;
					Fuel_Display_Renderer.material.SetColor("_EmissionColor", Color_Display);
				}
			}
			if (m_fuel != m_prevFuel)
			{
				Fuel_Display.localScale = new Vector3(Fuel_Display.localScale.x, m_fuel / Max_Fuel, Fuel_Display.localScale.z);
			}
		}

		public override void FVRFixedUpdate()
		{
			((FVRPhysicalObject)this).FVRFixedUpdate();
			if (m_isThrusting)
			{
				if (!m_isRegistered)
				{
					m_isRegistered = true;
					GM.CurrentMovementManager.RegisterSmoothLocoAdder(jetMover);
				}
			}
			else if (m_isRegistered)
			{
				m_isRegistered = false;
				GM.CurrentMovementManager.DeregisterSmoothLocoAdder(jetMover);
			}
		}

		public void TransformVel(ref Vector3 vel, ref bool isGrounded, ref bool didChange)
		{
			//IL_001d: 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_0039: Expected I4, but got Unknown
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			if (m_isThrusting)
			{
				float num = 5f;
				GravityMode playerGravityMode = GM.Options.SimulationOptions.PlayerGravityMode;
				switch ((int)playerGravityMode)
				{
				case 0:
					num = 9.81f;
					break;
				case 1:
					num = 5f;
					break;
				case 2:
					num = 1.62f;
					break;
				case 3:
					num = 0.001f;
					break;
				}
				float num2 = Vector3.Dot(Jet_Vector.forward, Vector3.up);
				num2 = ((!(num2 > 0f)) ? 0f : (num2 * num));
				GM.CurrentMovementManager.DelayGround(0.1f);
				vel = Jet_Force * Jet_Vector.forward + num2 * Vector3.up;
				didChange = true;
			}
			else
			{
				didChange = false;
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_005d: 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)
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				float triggerFloat = hand.Input.TriggerFloat;
				if (m_triggerFloat != triggerFloat)
				{
					m_triggerFloat = triggerFloat;
					((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_Positions.x, Trigger_Positions.y, m_triggerFloat), Trigger_Interpstyle, Trigger_Axis);
				}
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			//IL_003c: 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)
			((FVRPhysicalObject)this).EndInteraction(hand);
			m_triggerFloat = 0f;
			((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_Positions.x, Trigger_Positions.y, m_triggerFloat), Trigger_Interpstyle, Trigger_Axis);
		}
	}
	public class Regulus_Hedgehog : RevolvingShotgun
	{
		public float Auto_Delay;

		private float m_autoDelay;

		public override void Awake()
		{
			((RevolvingShotgun)this).Awake();
			m_autoDelay = 0f;
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			((RevolvingShotgun)this).UpdateInteraction(hand);
			if (m_autoDelay > 0f)
			{
				m_autoDelay -= Time.deltaTime;
			}
			if ((int)base.FireSelector_Modes[base.m_fireSelectorMode].ModeType == 2 && base.m_isHammerLocked && m_autoDelay <= 0f)
			{
				base.m_hasTriggerCycled = false;
				m_autoDelay = Auto_Delay;
			}
		}
	}
	public class Regulus_Launched_Deployable : MonoBehaviour
	{
		public GameObject ToSpawn;

		public float Tick_Time = 1f;

		public float LifeTime = 30f;

		public float Rotate_Speed = 30f;

		public Renderer LifeTime_Display;

		public Transform Rotator;

		public bool Uses_Rotator;

		public bool Uses_Pulse;

		private float m_tick;

		private float m_lifeDown;

		public void Awake()
		{
			if (Uses_Pulse)
			{
				Pulse();
			}
			m_tick = Tick_Time;
			m_lifeDown = LifeTime;
		}

		public void Update()
		{
			//IL_00d7: 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_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)
			m_lifeDown -= Time.deltaTime;
			if (Uses_Pulse)
			{
				m_tick -= Time.deltaTime;
				if (m_tick <= 0f)
				{
					m_tick = Tick_Time;
					Pulse();
				}
			}
			if (Uses_Rotator)
			{
				Rotator.localEulerAngles += new Vector3(0f, 0f, Rotate_Speed * Time.deltaTime);
			}
			float num = Mathf.Clamp(m_lifeDown / LifeTime, 0f, 1f);
			num = 0f - num;
			num += 0.5f;
			LifeTime_Display.material.SetTextureOffset("_MainTex", new Vector2(0f, num));
		}

		public void Pulse()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			Object.Instantiate<GameObject>(ToSpawn, ((Component)this).transform.position, ((Component)this).transform.rotation);
		}
	}
	public class Regulus_Max_Pack : FVRPhysicalObject
	{
		private bool m_active;

		private float m_powerupTick;

		public override void Awake()
		{
			((FVRPhysicalObject)this).Awake();
			if ((Object)(object)base.m_quickbeltSlot != (Object)null)
			{
				m_active = true;
				m_powerupTick = 0f;
			}
			else
			{
				m_active = false;
			}
		}

		public override void FVRUpdate()
		{
			((FVRPhysicalObject)this).FVRUpdate();
			if (m_active)
			{
				m_powerupTick -= Time.deltaTime;
				if (m_powerupTick <= 0f)
				{
					m_powerupTick = 1f;
					GM.CurrentPlayerBody.ActivatePower((PowerupType)6, (PowerUpIntensity)0, (PowerUpDuration)3, false, false, -1f);
				}
			}
			else if ((Object)(object)base.m_quickbeltSlot != (Object)null && !((FVRInteractiveObject)this).IsHeld)
			{
				m_active = true;
				m_powerupTick = 0f;
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).BeginInteraction(hand);
			m_active = false;
		}
	}
	public class Regulus_Prox_Mine : FVRPhysicalObject, IFVRDamageable
	{
		public float Arming_Delay;

		public float Ping_Time;

		public float Ping_Radius;

		public List<GameObject> SpawnOnDestroy;

		public LayerMask LM_proxy;

		public LayerMask LM_blockers;

		public GameObject Indicator_On;

		public GameObject Indicator_Off;

		public AudioEvent Arm_Sound;

		private bool m_armed;

		private bool m_detonated;

		private float m_armingDelay;

		private float m_pingTimer;

		private float m_stickDelay;

		private Collider[] m_Colliders;

		private int m_IFF;

		public override void Awake()
		{
			((FVRPhysicalObject)this).Awake();
			m_armed = false;
			m_detonated = false;
			m_armingDelay = Arming_Delay;
			m_pingTimer = Ping_Time;
			m_stickDelay = 0f;
		}

		public override void FVRUpdate()
		{
			((FVRPhysicalObject)this).FVRUpdate();
			if (m_armed)
			{
				if (m_armingDelay > 0f)
				{
					m_armingDelay -= Time.deltaTime;
				}
				else if (m_pingTimer > 0f)
				{
					m_pingTimer -= Time.deltaTime;
				}
				else
				{
					m_pingTimer = Ping_Time;
					Ping();
				}
			}
			if (m_stickDelay > 0f)
			{
				m_stickDelay -= Time.deltaTime;
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			if (hand.IsInStreamlinedMode)
			{
				if (hand.Input.AXButtonDown || hand.Input.BYButtonDown)
				{
					ToggleArmed();
				}
			}
			else if (hand.Input.TouchpadDown)
			{
				ToggleArmed();
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).BeginInteraction(hand);
			((FVRPhysicalObject)this).RootRigidbody.isKinematic = false;
			m_stickDelay = 0.5f;
		}

		public void Explode()
		{
			//IL_0033: 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)
			if (m_detonated)
			{
				return;
			}
			m_detonated = true;
			for (int i = 0; i < SpawnOnDestroy.Count; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(SpawnOnDestroy[i], ((Component)this).transform.position, ((Component)this).transform.rotation);
				Explosion component = ((Component)this).gameObject.GetComponent<Explosion>();
				if ((Object)(object)component != (Object)null)
				{
					component.IFF = m_IFF;
				}
				ExplosionSound component2 = val.GetComponent<ExplosionSound>();
				if ((Object)(object)component2 != (Object)null)
				{
					component2.IFF = m_IFF;
				}
				GrenadeExplosion component3 = val.GetComponent<GrenadeExplosion>();
				if ((Object)(object)component3 != (Object)null)
				{
					component3.IFF = m_IFF;
				}
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void ToggleArmed()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			m_armed = !m_armed;
			SM.PlayGenericSound(Arm_Sound, ((Component)this).transform.position);
			if (m_armed)
			{
				Indicator_On.SetActive(true);
				Indicator_Off.SetActive(false);
				m_IFF = GM.CurrentPlayerBody.GetPlayerIFF();
				m_armingDelay = Arming_Delay;
			}
			else
			{
				Indicator_On.SetActive(false);
				Indicator_Off.SetActive(true);
			}
		}

		public void Ping()
		{
			//IL_002a: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Invalid comparison between Unknown and I4
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_0131: Unknown result type (might be due to invalid IL or missing references)
			if (((FVRInteractiveObject)this).IsHeld || (Object)(object)base.m_quickbeltSlot != (Object)null)
			{
				return;
			}
			m_Colliders = Physics.OverlapSphere(((Component)this).transform.position, Ping_Radius, LayerMask.op_Implicit(LM_proxy));
			RaycastHit val2 = default(RaycastHit);
			for (int i = 0; i < m_Colliders.Length; i++)
			{
				if ((Object)(object)m_Colliders[i].attachedRigidbody != (Object)null && (Object)(object)((Component)m_Colliders[i].attachedRigidbody).gameObject.GetComponent<SosigLink>() != (Object)null && (int)((Component)m_Colliders[i].attachedRigidbody).gameObject.GetComponent<SosigLink>().S.BodyState != 3 && (m_IFF < 0 || !((Component)m_Colliders[i].attachedRigidbody).gameObject.GetComponent<SosigLink>().S.Priority.IsFriend(m_IFF)))
				{
					Vector3 val = ((Component)m_Colliders[i]).transform.position - ((Component)this).transform.position;
					if (!Physics.Raycast(((Component)this).transform.position, ((Vector3)(ref val)).normalized, ref val2, ((Vector3)(ref val)).magnitude, LayerMask.op_Implicit(LM_blockers)))
					{
						Explode();
						break;
					}
				}
			}
		}

		public void Damage(Damage d)
		{
			if (m_armed && !(m_armingDelay > 0f) && !((Object)(object)base.m_quickbeltSlot != (Object)null) && (d.Dam_TotalKinetic > 200f || d.Dam_EMP > 1f))
			{
				Explode();
			}
		}

		public override void OnCollisionEnter(Collision col)
		{
			((FVRPhysicalObject)this).OnCollisionEnter(col);
			if (m_armed && ((FVRInteractiveObject)this).IsHeld && !((Object)(object)col.collider.attachedRigidbody != (Object)null) && !((FVRPhysicalObject)this).RootRigidbody.isKinematic && !(m_stickDelay > 0f))
			{
				((FVRInteractiveObject)this).ForceBreakInteraction();
				((FVRPhysicalObject)this).RootRigidbody.isKinematic = true;
			}
		}
	}
	public class Regulus_Shield_Foregrip : MonoBehaviour
	{
		public float Trigger_Threshold;

		public float Shield_Health;

		public float Shield_Regen;

		public float Shield_Recharge_Threshold;

		public GameObject Shield;

		public GameObject Interface;

		public Renderer Shield_Renderer;

		public int Material_Index;

		public Material[] Mats;

		public Renderer Indicator;

		public AudioEvent Shield_Change;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Indicator_Available;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Indicator_Recharging;

		private bool m_recharing;

		private float m_shield;

		public void Awake()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			m_shield = Shield_Health;
			m_recharing = false;
			Indicator.material.SetColor("_EmissionColor", Indicator_Available);
			Shield_Renderer.material = Mats[Material_Index];
		}

		public void Update()
		{
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			float shield = m_shield;
			if (!Shield.activeSelf)
			{
				if (m_shield < Shield_Health)
				{
					m_shield += Shield_Regen * Time.deltaTime;
					if (m_shield > Shield_Health)
					{
						m_shield = Shield_Health;
					}
				}
				if (m_recharing && m_shield > Shield_Recharge_Threshold)
				{
					m_recharing = false;
					Indicator.material.SetColor("_EmissionColor", Indicator_Available);
				}
			}
			else if (!Interface.activeSelf)
			{
				Shield.SetActive(false);
			}
			if (shield != m_shield)
			{
				UpdateIndicator();
			}
		}

		public void ProcessInput(FVRViveHand hand, FVRInteractiveObject o)
		{
			//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)
			if (hand.IsInStreamlinedMode)
			{
				if (hand.Input.BYButtonDown)
				{
					CycleColor();
				}
			}
			else if (hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.25f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) <= 45f)
			{
				CycleColor();
			}
			if (m_recharing)
			{
				return;
			}
			if (hand.Input.TriggerFloat > Trigger_Threshold)
			{
				if (!Shield.activeSelf)
				{
					Shield.SetActive(true);
				}
			}
			else if (Shield.activeSelf)
			{
				Shield.SetActive(false);
			}
		}

		public void UpdateIndicator()
		{
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Clamp(m_shield / Shield_Health, 0f, 1f);
			num = 0f - num;
			num += 0.5f;
			Indicator.material.SetTextureOffset("_MainTex", new Vector2(0f, num));
		}

		public void CycleColor()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			Material_Index++;
			SM.PlayGenericSound(Shield_Change, ((Component)this).transform.position);
			if (Material_Index >= Mats.Length)
			{
				Material_Index = 0;
			}
			Shield_Renderer.material = Mats[Material_Index];
		}

		public void ProcessDamage(Damage d)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			float num = d.Dam_TotalEnergetic + d.Dam_TotalKinetic;
			m_shield -= num;
			if (m_shield <= 0f)
			{
				m_recharing = true;
				m_shield = 0f;
				if (Shield.activeSelf)
				{
					Shield.SetActive(false);
				}
				Indicator.material.SetColor("_EmissionColor", Indicator_Recharging);
			}
			UpdateIndicator();
		}
	}
	public class Regulus_Shield_Foregrip_Damagable : MonoBehaviour, IFVRDamageable
	{
		public Regulus_Shield_Foregrip Foregrip;

		public void Damage(Damage d)
		{
			if ((Object)(object)Foregrip != (Object)null)
			{
				Foregrip.ProcessDamage(d);
			}
		}
	}
	public class Regulus_Shield_Foregrip_Interface : AttachableForegrip
	{
		public Regulus_Shield_Foregrip Fore;

		public override void UpdateInteraction(FVRViveHand hand)
		{
			Fore.ProcessInput(hand, (FVRInteractiveObject)(object)this);
			((FVRFireArmAttachmentInterface)this).UpdateInteraction(hand);
		}

		public override void PassHandInput(FVRViveHand hand, FVRInteractiveObject o)
		{
			Fore.ProcessInput(hand, o);
			((AttachableForegrip)this).PassHandInput(hand, o);
		}
	}
	public class Regulus_Spotter_Scope : MonoBehaviour
	{
		public FVRInteractiveObject Scope;

		public GameObject Ready_Indicator;

		public Transform Pointer;

		public LayerMask LM_Pointer;

		public bool Uses_Trigger;

		public float Trigger_Treshold;

		public float Cooldown;

		public float Max_Range;

		public PowerUpDuration Spot_Duration;

		public AudioEvent Success_Sound;

		public AudioEvent Failure_Sound;

		public GameObject Spot_Prefab;

		private RaycastHit m_hit;

		private float m_cooldown;

		private bool m_active;

		public void Start()
		{
			m_cooldown = Cooldown;
			m_active = true;
		}

		public void Update()
		{
			//IL_0028: 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)
			if (Scope.IsHeld && m_active)
			{
				HandInput input = Scope.m_hand.Input;
				if (Uses_Trigger)
				{
					if (Scope.m_hasTriggeredUpSinceBegin && input.TriggerFloat > Trigger_Treshold)
					{
						AttemptSpot();
					}
				}
				else if (!Scope.m_hand.IsInStreamlinedMode)
				{
					if (input.TouchpadPressed)
					{
						AttemptSpot();
					}
				}
				else if (input.AXButtonPressed || input.BYButtonPressed)
				{
					AttemptSpot();
				}
			}
			if (!m_active)
			{
				m_cooldown -= Time.deltaTime;
				if (m_cooldown <= 0f)
				{
					m_active = true;
					Ready_Indicator.SetActive(true);
				}
			}
		}

		private void AttemptSpot()
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Invalid comparison between Unknown and I4
			//IL_00c5: 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_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			m_cooldown = Cooldown;
			m_active = false;
			Ready_Indicator.SetActive(false);
			if (Physics.Raycast(Pointer.position, Pointer.forward, ref m_hit, Mathf.Min(Max_Range, GM.CurrentSceneSettings.ScopeMaxDrawRange), LayerMask.op_Implicit(LM_Pointer)) && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null)
			{
				SosigLink component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<SosigLink>();
				if ((Object)(object)component != (Object)null && (int)component.S.BodyState != 3)
				{
					component.S.ActivatePower((PowerupType)4, (PowerUpIntensity)0, Spot_Duration, false, true);
					SM.PlayGenericSound(Success_Sound, ((Component)Scope).transform.position);
					if ((Object)(object)component.S.Links[0] != (Object)null)
					{
						GameObject val = Object.Instantiate<GameObject>(Spot_Prefab, ((Component)component.S.Links[0]).transform.position, ((Component)component.S.Links[0]).transform.rotation);
						val.transform.SetParent(((Component)component.S.Links[0]).transform);
					}
					return;
				}
			}
			SM.PlayGenericSound(Failure_Sound, ((Component)Scope).transform.position);
		}
	}
	public class Regulus_Sticky : PinnedGrenade
	{
		private bool is_Stuck;

		private FixedJoint the_Joint;

		public override void Awake()
		{
			((PinnedGrenade)this).Awake();
			is_Stuck = false;
		}

		public override void OnCollisionEnter(Collision col)
		{
			((PinnedGrenade)this).OnCollisionEnter(col);
			if (!base.m_isFused || is_Stuck)
			{
				return;
			}
			if ((Object)(object)col.collider.attachedRigidbody != (Object)null)
			{
				if ((Object)(object)((Component)col.collider.attachedRigidbody).gameObject.GetComponent<KillAfter>() == (Object)null && (Object)(object)((Component)col.collider.attachedRigidbody).gameObject.GetComponent<Slingshot>() == (Object)null)
				{
					is_Stuck = true;
					((FVRInteractiveObject)this).ForceBreakInteraction();
					the_Joint = ((Component)this).gameObject.AddComponent<FixedJoint>();
					((Joint)the_Joint).connectedBody = col.collider.attachedRigidbody;
					((Joint)the_Joint).enableCollision = false;
				}
			}
			else
			{
				is_Stuck = true;
				((FVRInteractiveObject)this).ForceBreakInteraction();
				((FVRPhysicalObject)this).RootRigidbody.isKinematic = true;
			}
		}

		public override void BeginInteraction(FVRViveHand hand)
		{
			((PinnedGrenade)this).BeginInteraction(hand);
			if (is_Stuck)
			{
				((FVRPhysicalObject)this).RootRigidbody.isKinematic = false;
				if ((Object)(object)the_Joint != (Object)null)
				{
					Object.Destroy((Object)(object)the_Joint);
				}
				is_Stuck = false;
			}
		}
	}
	public class Regulus_Syringe : FVRPhysicalObject
	{
		[Header("Powerup Stuff")]
		public PowerupType Powerup_Type;

		public PowerUpIntensity Powerup_Intensity;

		public PowerUpDuration Powerup_Duration;

		public float Duration_Override = -1f;

		public bool is_Puke;

		public bool is_Inverted;

		public bool Is_Health_Powerup;

		[Header("Syringe Config")]
		public AudioEvent Powerup_Sound;

		public float Recharge_Delay;

		public Vector2 Button_Positions;

		public Transform Button;

		public Transform Indicator;

		public Transform[] Openy_Bits;

		public Vector2 Openy_Rots;

		public Renderer Indicator_Renderer;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Color_Display;

		[ColorUsage(true, true, 0f, 8f, 0.125f, 3f)]
		public Color Color_Recharging;

		public GameObject Syringe_Trigger;

		private bool m_Active;

		private float m_RechargeAmt;

		private bool m_buttonPressed;

		public override void Start()
		{
			//IL_001f: 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)
			//IL_004d: 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_005a: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).Start();
			m_Active = true;
			Indicator_Renderer.material.SetColor("_EmissionColor", Color_Display);
			Indicator.localScale = new Vector3(Indicator.localScale.x, 1f, Indicator.localScale.z);
		}

		public override void FVRUpdate()
		{
			//IL_0031: 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_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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_00cd: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).FVRUpdate();
			if (!m_Active)
			{
				m_RechargeAmt += Time.deltaTime;
				Indicator.localScale = new Vector3(Indicator.localScale.x, m_RechargeAmt / Recharge_Delay, Indicator.localScale.z);
				if (m_RechargeAmt >= Recharge_Delay)
				{
					m_Active = true;
					Indicator.localScale = new Vector3(Indicator.localScale.x, 1f, Indicator.localScale.z);
					Indicator_Renderer.material.SetColor("_EmissionColor", Color_Display);
				}
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b5: 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_0168: 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_0058: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_02df: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: 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_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: 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_0217: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			if (!((FVRInteractiveObject)this).IsHeld)
			{
				return;
			}
			if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode)
			{
				if (!((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed)
				{
					return;
				}
				if (!m_buttonPressed)
				{
					Button.localPosition = new Vector3(Button.localPosition.x, Button_Positions.y, Button.localPosition.z);
					for (int i = 0; i < Openy_Bits.Length; i++)
					{
						Openy_Bits[i].localEulerAngles = new Vector3(Openy_Bits[i].localEulerAngles.x, Openy_Bits[i].localEulerAngles.y, Openy_Rots.y);
					}
					m_buttonPressed = true;
				}
				if (!Syringe_Trigger.activeSelf && m_Active)
				{
					Syringe_Trigger.SetActive(true);
				}
			}
			else if (((FVRInteractiveObject)this).m_hand.Input.TouchpadPressed && ((Vector2)(ref ((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes)).magnitude > 0.1f)
			{
				if (!(Vector2.Angle(((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes, Vector2.up) <= 45f))
				{
					return;
				}
				if (!m_buttonPressed)
				{
					Button.localPosition = new Vector3(Button.localPosition.x, Button_Positions.y, Button.localPosition.z);
					for (int j = 0; j < Openy_Bits.Length; j++)
					{
						Openy_Bits[j].localEulerAngles = new Vector3(Openy_Bits[j].localEulerAngles.x, Openy_Bits[j].localEulerAngles.y, Openy_Rots.y);
					}
					m_buttonPressed = true;
				}
				if (!Syringe_Trigger.activeSelf && m_Active)
				{
					Syringe_Trigger.SetActive(true);
				}
			}
			else if (m_buttonPressed)
			{
				Button.localPosition = new Vector3(Button.localPosition.x, Button_Positions.x, Button.localPosition.z);
				for (int k = 0; k < Openy_Bits.Length; k++)
				{
					Openy_Bits[k].localEulerAngles = new Vector3(Openy_Bits[k].localEulerAngles.x, Openy_Bits[k].localEulerAngles.y, Openy_Rots.x);
				}
				if (Syringe_Trigger.activeSelf)
				{
					Syringe_Trigger.SetActive(false);
				}
				m_buttonPressed = false;
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			//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_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: 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_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).EndInteraction(hand);
			Button.localPosition = new Vector3(Button.localPosition.x, Button_Positions.x, Button.localPosition.z);
			for (int i = 0; i < Openy_Bits.Length; i++)
			{
				Openy_Bits[i].localEulerAngles = new Vector3(Openy_Bits[i].localEulerAngles.x, Openy_Bits[i].localEulerAngles.y, Openy_Rots.x);
			}
			if (Syringe_Trigger.activeSelf)
			{
				Syringe_Trigger.SetActive(false);
			}
			m_buttonPressed = false;
		}

		public void Power_UP()
		{
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: 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_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_0248: 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_0031: 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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: 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_0127: 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_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_018e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0107: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			if (Is_Health_Powerup)
			{
				float playerHealth = GM.CurrentPlayerBody.GetPlayerHealth();
				if (playerHealth < 0.5f)
				{
					GM.CurrentPlayerBody.ActivatePower(Powerup_Type, (PowerUpIntensity)0, Powerup_Duration, is_Puke, is_Inverted, -1f);
					m_RechargeAmt = 0f;
					Indicator.localScale = new Vector3(Indicator.localScale.x, 0f, Indicator.localScale.z);
				}
				else if (playerHealth < 0.75f)
				{
					GM.CurrentPlayerBody.ActivatePower(Powerup_Type, (PowerUpIntensity)1, Powerup_Duration, is_Puke, is_Inverted, -1f);
					m_RechargeAmt = Recharge_Delay * 0.5f;
					Indicator.localScale = new Vector3(Indicator.localScale.x, 0.5f, Indicator.localScale.z);
				}
				else
				{
					GM.CurrentPlayerBody.ActivatePower(Powerup_Type, (PowerUpIntensity)2, Powerup_Duration, is_Puke, is_Inverted, -1f);
					m_RechargeAmt = Recharge_Delay * 0.75f;
					Indicator.localScale = new Vector3(Indicator.localScale.x, 0.75f, Indicator.localScale.z);
				}
			}
			else
			{
				GM.CurrentPlayerBody.ActivatePower(Powerup_Type, Powerup_Intensity, Powerup_Duration, is_Puke, is_Inverted, Duration_Override);
				m_RechargeAmt = 0f;
				Indicator.localScale = new Vector3(Indicator.localScale.x, 0f, Indicator.localScale.z);
			}
			SM.PlayCoreSound((FVRPooledAudioType)10, Powerup_Sound, ((Component)this).transform.position);
			m_Active = false;
			Indicator_Renderer.material.SetColor("_EmissionColor", Color_Recharging);
			if (Syringe_Trigger.activeSelf)
			{
				Syringe_Trigger.SetActive(false);
			}
		}
	}
	public class Regulus_Syringe_Trigger : FVRInteractiveObject
	{
		public Regulus_Syringe Syringe;

		public override void Poke(FVRViveHand hand)
		{
			if ((Object)(object)hand != (Object)(object)((FVRInteractiveObject)Syringe).m_hand)
			{
				Syringe.Power_UP();
			}
		}
	}
}