Decompiled source of B100 Portable Hellbomb v1.0.1

B100_Portable_Hellbomb.dll

Decompiled a week ago
using System;
using System.Collections;
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 DigitalRuby.LightningBolt;
using FistVR;
using H3VRUtils;
using HarmonyLib;
using OpenScripts2;
using OtherLoader;
using UnityEngine;
using UnityEngine.Rendering;
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 ShermanJumbo
{
	public class BallisticProjectileKillIfBelowSpeed : MonoBehaviour
	{
		public BallisticProjectile Projectile;

		public float KillIfVelBelowThisMagnitude = 20f;

		private void Update()
		{
			//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)
			if (((Vector3)(ref Projectile.m_velocity)).magnitude <= KillIfVelBelowThisMagnitude)
			{
				Projectile.m_velocity = Vector3.zero;
			}
		}
	}
}
public class BreakActionMainHandFireSelector : MonoBehaviour
{
	public BreakActionWeapon Weapon;

	public Transform SelectorSwitch;

	public Vector3 PosSingleFire;

	public Vector3 PosMultiFire;

	private void Update()
	{
		//IL_0074: 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)
		FVRViveHand hand = ((FVRInteractiveObject)Weapon).m_hand;
		if (!((Object)(object)hand == (Object)null) && ((hand.IsInStreamlinedMode && hand.Input.AXButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f)))
		{
			SwapFiremodes();
		}
	}

	public void SwapFiremodes()
	{
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)15, 1f);
		if (Weapon.FireAllBarrels)
		{
			Weapon.FireAllBarrels = false;
			SelectorSwitch.localPosition = PosSingleFire;
		}
		else if (!Weapon.FireAllBarrels)
		{
			Weapon.FireAllBarrels = true;
			SelectorSwitch.localPosition = PosMultiFire;
		}
	}
}
namespace ShermanJumbo
{
	public class CannonballSecondaryRenderer : MonoBehaviour
	{
		public Renderer Rend;

		public CannonBall Cannonball;

		private void Update()
		{
			if (Cannonball.TurnsOffRends && !Cannonball.hasTurnedOffRends)
			{
				Rend.enabled = false;
			}
		}
	}
	public class ChainLightning : MonoBehaviour
	{
		[Header("Chain Lightning Settings")]
		public int CurrentJumps = 0;

		public int MaxJumps;

		public float[] DamageForEachJump;

		public float EnemyRestruckDelay;

		public LayerMask ObstructionMask;

		public bool HasFoundTarget;

		public float NoHitLightningMaxRange;

		[Header("References")]
		public GameObject ChainLightningPrefab;

		public GameObject LightningBoltPrefab;

		public GameObject ImpactPrefab;

		public GameObject DamagePrefab;

		public Collider TriggerCollider;

		public AudioEvent HitSound;

		[Header("Debug")]
		public bool EnableDebugLogs = false;

		[HideInInspector]
		public Transform StartTransform;

		private SosigLink LinkToTarget;

		public HashSet<Sosig> SosigsHitThisChain = new HashSet<Sosig>();

		private void Awake()
		{
			StartTransform = ((Component)this).transform;
		}

		private void OnTriggerEnter(Collider other)
		{
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Invalid comparison between Unknown and I4
			//IL_0127: 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_012c: 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_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: 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_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0222: Unknown result type (might be due to invalid IL or missing references)
			//IL_0239: Unknown result type (might be due to invalid IL or missing references)
			//IL_023e: Unknown result type (might be due to invalid IL or missing references)
			Log("ChainLightning triggered with: " + ((Object)other).name);
			if (CurrentJumps >= MaxJumps)
			{
				Log("Max jumps reached.");
				KillMe();
				return;
			}
			Sosig componentInParent = ((Component)other).GetComponentInParent<Sosig>();
			if ((Object)(object)componentInParent == (Object)null)
			{
				Log("No Sosig found in parent hierarchy.");
				return;
			}
			if (SosigsHitThisChain.Contains(componentInParent))
			{
				Log("Sosig already hit. Skipping.");
				return;
			}
			SosigsHitThisChain.Add(componentInParent);
			SosigLink val = null;
			foreach (SosigLink link in componentInParent.Links)
			{
				if ((int)link.BodyPart == 1)
				{
					val = link;
					break;
				}
			}
			if ((Object)(object)val == (Object)null)
			{
				Log("No torso link found on Sosig.");
				return;
			}
			Vector3 val2 = ((!((Object)(object)StartTransform != (Object)null)) ? ((Component)this).transform.position : StartTransform.position);
			Vector3 val3 = ((Component)val).transform.position - val2;
			float magnitude = ((Vector3)(ref val3)).magnitude;
			RaycastHit val4 = default(RaycastHit);
			if (Physics.Raycast(val2, ((Vector3)(ref val3)).normalized, ref val4, magnitude, LayerMask.op_Implicit(ObstructionMask)))
			{
				Log("Obstruction detected between origin and torso.");
				return;
			}
			HasFoundTarget = true;
			Log("Spawning damaging prefab...");
			GameObject val5 = Object.Instantiate<GameObject>(DamagePrefab, ((Component)val).transform.position, Quaternion.identity);
			GrenadeExplosion component = val5.GetComponent<GrenadeExplosion>();
			component.MaxDam = DamageForEachJump[CurrentJumps];
			Log("Damage set to " + component.MaxDam);
			SpawnLightning(val2, ((Component)val).transform.position);
			SM.PlayCoreSound((FVRPooledAudioType)0, HitSound, ((Component)val).transform.position);
			Object.Instantiate<GameObject>(ImpactPrefab, ((Component)val).transform.position, Quaternion.identity);
			GameObject val6 = Object.Instantiate<GameObject>(ChainLightningPrefab, ((Component)val).transform.position, Quaternion.identity);
			ChainLightning component2 = val6.GetComponent<ChainLightning>();
			component2.CurrentJumps = CurrentJumps + 1;
			component2.StartTransform = ((Component)val).transform;
			component2.EnableDebugLogs = EnableDebugLogs;
			component2.SosigsHitThisChain = SosigsHitThisChain;
			KillMe();
		}

		private void SpawnLightning(Vector3 start, Vector3 end)
		{
			//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_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_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)
			GameObject val = Object.Instantiate<GameObject>(LightningBoltPrefab, start, Quaternion.identity);
			LightningBoltScript component = val.GetComponent<LightningBoltScript>();
			component.StartPosition = start;
			component.EndPosition = end;
		}

		public void KillMe()
		{
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void TryToSpawnFallbackLightning()
		{
			//IL_003f: 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_0044: 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_005c: 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_0072: 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_007d: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: 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_00e9: 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_00a0: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: 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 (!HasFoundTarget && CurrentJumps == 0)
			{
				Vector3 val = ((!((Object)(object)StartTransform != (Object)null)) ? ((Component)this).transform.position : StartTransform.position);
				Vector3 val2 = ((!((Object)(object)StartTransform != (Object)null)) ? ((Component)this).transform.forward : StartTransform.forward);
				RaycastHit val3 = default(RaycastHit);
				Vector3 val4;
				if (Physics.Raycast(val, val2, ref val3, NoHitLightningMaxRange, LayerMask.op_Implicit(ObstructionMask)))
				{
					val4 = ((RaycastHit)(ref val3)).point;
					Log("Fallback lightning hit environment at: " + val4);
					Object.Instantiate<GameObject>(ImpactPrefab, val4, Quaternion.LookRotation(((RaycastHit)(ref val3)).normal));
				}
				else
				{
					val4 = val + val2 * NoHitLightningMaxRange;
					Log("Fallback lightning reached max range: " + val4);
				}
				SpawnLightning(val, val4);
				KillMe();
			}
		}

		private void Log(string msg)
		{
			if (EnableDebugLogs)
			{
				Debug.Log((object)("[ChainLightning] " + msg));
			}
		}
	}
	public class ChainLightningHit : MonoBehaviour
	{
		public float killDelay = 0.1f;

		private void Start()
		{
			Object.Destroy((Object)(object)this, killDelay);
		}
	}
	public class ChamberDependentParticlesAndSounds : MonoBehaviour
	{
		public FVRFireArmChamber ChamberToRead;

		public ParticleSystem ParticlesToEnable;

		public AudioSource SoundsToEnable;

		private void Update()
		{
			if (ChamberToRead.IsFull)
			{
				if (!ParticlesToEnable.isPlaying)
				{
					ParticlesToEnable.Play();
				}
				if (!SoundsToEnable.isPlaying)
				{
					SoundsToEnable.Play();
				}
			}
			else
			{
				ParticlesToEnable.Stop();
				SoundsToEnable.Stop();
			}
		}
	}
	public class ClosedBoltBeltFedDualFeedFix : MonoBehaviour
	{
		public ClosedBoltWeapon Weapon;

		public ClosedBoltMagEjectionTrigger MagGrabTrigger;

		public Vector3 TriggerPosForBeltBox;

		public Vector3 ScaleForBeltBoxTrigger;

		private Vector3 TriggerPosForMag;

		private Vector3 ScaleForMagTrigger;

		private void Start()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//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)
			TriggerPosForMag = ((FVRInteractiveObject)MagGrabTrigger).Transform.localPosition;
			ScaleForMagTrigger = ((FVRInteractiveObject)MagGrabTrigger).Transform.localScale;
		}

		private void Update()
		{
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			FVRFireArmMagazine magazine = ((FVRFireArm)Weapon).Magazine;
			ClosedBoltMagEjectionTrigger magGrabTrigger = MagGrabTrigger;
			if ((Object)(object)magazine == (Object)null)
			{
				return;
			}
			if (!magazine.IsBeltBox)
			{
				((Component)magGrabTrigger).gameObject.SetActive(true);
				((FVRInteractiveObject)magGrabTrigger).Transform.localPosition = TriggerPosForMag;
				((FVRInteractiveObject)magGrabTrigger).Transform.localScale = ScaleForMagTrigger;
			}
			if (magazine.IsBeltBox)
			{
				if (!((FVRFireArm)Weapon).ConnectedToBox)
				{
					((Component)magGrabTrigger).gameObject.SetActive(true);
					((FVRInteractiveObject)magGrabTrigger).Transform.localPosition = TriggerPosForBeltBox;
					((FVRInteractiveObject)magGrabTrigger).Transform.localScale = ScaleForBeltBoxTrigger;
				}
				else
				{
					((Component)MagGrabTrigger).gameObject.SetActive(false);
				}
			}
		}
	}
	public class ClosedBoltPokeToChamberRound : FVRInteractiveObject
	{
		public ClosedBoltWeapon Weapon;

		public FVRFireArmChamber Chamber;

		public override void Poke(FVRViveHand hand)
		{
			if (((Object)(object)((FVRInteractiveObject)Weapon).m_hand == (Object)null || (Object)(object)hand != (Object)(object)((FVRInteractiveObject)Weapon).m_hand) && !Chamber.IsFull)
			{
				Weapon.Bolt.ImpartFiringImpulse();
			}
		}
	}
	public class Commando : FVRFireArm
	{
		[Header("Commando")]
		public FVRFireArmChamber[] CommandoChambers;

		public Transform[] CommandoMuzzles;

		public int CurrentChamber = 0;

		public bool AlsoPlaysSecondFireSound = true;

		public AudioEvent SecondFireSound;

		public Transform SecondFireSoundPosition;

		public bool DeletesCartridgeOnFire = true;

		public bool DestroyWhenEmpty = false;

		public float KillDelay = 30f;

		public bool IsEmpty = false;

		public GameObject[] EnableIfCorrespondingChamberIsSpent;

		public GameObject[] DisableIfCorrespondingChamberIsSpent;

		public Transform Trigger;

		public float Trigger_ForwardValue;

		public float Trigger_RearwardValue;

		public Axis TriggerAxis;

		public InterpStyle TriggerInterpStyle = (InterpStyle)1;

		private float m_triggerFloat;

		public override void Awake()
		{
			((FVRFireArm)this).Awake();
			FVRFireArmChamber[] commandoChambers = CommandoChambers;
			foreach (FVRFireArmChamber item in commandoChambers)
			{
				base.FChambers.Add(item);
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			m_triggerFloat = hand.Input.TriggerFloat;
			if ((Object)(object)Trigger != (Object)null)
			{
				((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), TriggerInterpStyle, TriggerAxis);
			}
			if (!((FVRPhysicalObject)this).IsAltHeld && hand.Input.TriggerDown && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && CurrentChamber <= CommandoChambers.Length - 1)
			{
				Fire(CurrentChamber);
			}
			IsEmpty = true;
			FVRFireArmChamber[] commandoChambers = CommandoChambers;
			foreach (FVRFireArmChamber val in commandoChambers)
			{
				if (val.IsFull && !val.IsSpent)
				{
					IsEmpty = false;
					break;
				}
			}
			if (IsEmpty && DestroyWhenEmpty)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject, KillDelay);
			}
		}

		public override Transform GetMuzzle()
		{
			return CommandoMuzzles[CurrentChamber];
		}

		public void Fire(int CurrentChamber)
		{
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			if (CommandoChambers[CurrentChamber].IsFull && !CommandoChambers[CurrentChamber].IsSpent)
			{
				CommandoChambers[CurrentChamber].Fire();
				((FVRFireArm)this).Fire(CommandoChambers[CurrentChamber], ((FVRFireArm)this).GetMuzzle(), 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(CommandoChambers[CurrentChamber].GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f);
				if (AlsoPlaysSecondFireSound)
				{
					SM.PlayCoreSound((FVRPooledAudioType)0, SecondFireSound, ((Component)SecondFireSoundPosition).transform.position);
				}
				if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo)
				{
					CommandoChambers[CurrentChamber].IsSpent = false;
					CommandoChambers[CurrentChamber].UpdateProxyDisplay();
				}
				else if (DeletesCartridgeOnFire)
				{
					CommandoChambers[CurrentChamber].SetRound((FVRFireArmRound)null, false);
				}
				if ((Object)(object)EnableIfCorrespondingChamberIsSpent[CurrentChamber] != (Object)null)
				{
					EnableIfCorrespondingChamberIsSpent[CurrentChamber].SetActive(true);
				}
				if ((Object)(object)DisableIfCorrespondingChamberIsSpent[CurrentChamber] != (Object)null)
				{
					DisableIfCorrespondingChamberIsSpent[CurrentChamber].SetActive(false);
				}
				this.CurrentChamber++;
				if (CurrentChamber == CommandoChambers.Length)
				{
					CurrentChamber = 0;
				}
			}
		}

		public override List<FireArmRoundClass> GetChamberRoundList()
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			if (CommandoChambers[0].IsFull && !CommandoChambers[0].IsSpent)
			{
				List<FireArmRoundClass> list = new List<FireArmRoundClass>();
				list.Add(CommandoChambers[0].GetRound().RoundClass);
				return list;
			}
			return null;
		}

		public override void SetLoadedChambers(List<FireArmRoundClass> rounds)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			FVRFireArmChamber[] commandoChambers = CommandoChambers;
			foreach (FVRFireArmChamber val in commandoChambers)
			{
				if (rounds.Count > 0)
				{
					val.Autochamber(rounds[0]);
				}
			}
		}
	}
	public class DisableIfCurrentMagIsBeltBox : MonoBehaviour
	{
		public FVRFireArm Firearm;

		public GameObject GameObjectToDisable;

		private void Update()
		{
			GameObjectToDisable.SetActive(true);
		}
	}
}
namespace Cityrobo
{
	public class FirearmEjectAndDeleteMagOnEmpty : MonoBehaviour
	{
		public FVRFireArm Firearm;

		public bool DeleteMagazineEntirely = false;

		public void Update()
		{
			if ((Object)(object)Firearm.Magazine != (Object)null && !Firearm.Magazine.HasARound())
			{
				FVRFireArmMagazine magazine = Firearm.Magazine;
				Firearm.EjectMag(false);
				if (DeleteMagazineEntirely)
				{
					Object.Destroy((Object)(object)((Component)magazine).gameObject);
				}
			}
		}
	}
}
namespace ShermanJumbo
{
	public class FirearmSpinnyBarrels : MonoBehaviour
	{
		public FVRFireArm Gun;

		public GameObject SpinningBarrels;

		public float SpinRate;

		public dirType DirectionOfSpin;

		public float DecelerationRate = 0.5f;

		public float TriggerDeadzone = 0.01f;

		private float currentSpinSpeed = 0f;

		private bool TriggerPulled = false;

		public AudioSource SpinnySounds;

		public float SpinnySoundsVolume = 0.4f;

		private void Awake()
		{
			SpinnySounds.volume = 0f;
		}

		private void Update()
		{
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: 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_013d: Expected I4, but got Unknown
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)SpinnySounds != (Object)null)
			{
				SpinnySounds.volume = currentSpinSpeed / SpinRate * SpinnySoundsVolume;
			}
			if ((Object)(object)Gun != (Object)null && (Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null)
			{
				float triggerFloat = ((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat;
				if (triggerFloat >= TriggerDeadzone)
				{
					if (!TriggerPulled)
					{
						TriggerPulled = true;
					}
					currentSpinSpeed = SpinRate;
				}
				else if (TriggerPulled)
				{
					TriggerPulled = false;
				}
			}
			if (!TriggerPulled && currentSpinSpeed > 0f)
			{
				currentSpinSpeed -= DecelerationRate * Time.deltaTime;
				if (currentSpinSpeed < 0f)
				{
					currentSpinSpeed = 0f;
				}
			}
			if (currentSpinSpeed > 0f && (Object)(object)SpinningBarrels != (Object)null)
			{
				Vector3 zero = Vector3.zero;
				int num = (int)DirectionOfSpin;
				if (num >= 0 && num <= 2)
				{
					((Vector3)(ref zero))[num] = currentSpinSpeed * Time.deltaTime;
					SpinningBarrels.transform.Rotate(zero);
				}
				else
				{
					Debug.LogWarning((object)"Invalid DirectionOfSpin value!");
				}
			}
		}
	}
	public class GrenadeParticlesIfArmed : MonoBehaviour
	{
		public PinnedGrenade Grenade;

		public ParticleSystem[] Particles;

		public AudioSource ArmedSounds;

		public bool ReleaseLeverOnPinPull = true;

		private bool m_hasReleasedLever = false;

		private bool m_hasArmed = false;

		private bool m_hasExploded = false;

		private void Start()
		{
			StopParticles();
			ArmedSounds.Stop();
		}

		private void Update()
		{
			if ((Object)(object)Grenade == (Object)null || Particles == null || (Object)(object)ArmedSounds == (Object)null)
			{
				return;
			}
			bool isPinPulled = Grenade.m_isPinPulled;
			bool isLeverReleased = Grenade.m_isLeverReleased;
			bool hasSploded = Grenade.m_hasSploded;
			if (ReleaseLeverOnPinPull && isPinPulled && !m_hasReleasedLever)
			{
				m_hasReleasedLever = true;
				Grenade.ReleaseLever();
			}
			if (isLeverReleased && !m_hasArmed)
			{
				m_hasArmed = true;
				PlayParticles();
				if (!ArmedSounds.isPlaying)
				{
					ArmedSounds.Play();
				}
			}
			if (hasSploded && !m_hasExploded)
			{
				m_hasExploded = true;
				StopParticles();
				if (ArmedSounds.isPlaying)
				{
					ArmedSounds.Stop();
				}
			}
		}

		private void PlayParticles()
		{
			if (Particles == null)
			{
				return;
			}
			ParticleSystem[] particles = Particles;
			foreach (ParticleSystem val in particles)
			{
				if ((Object)(object)val != (Object)null && !val.isPlaying)
				{
					val.Play();
				}
			}
		}

		private void StopParticles()
		{
			if (Particles == null)
			{
				return;
			}
			ParticleSystem[] particles = Particles;
			foreach (ParticleSystem val in particles)
			{
				if ((Object)(object)val != (Object)null && val.isPlaying)
				{
					val.Stop();
				}
			}
		}
	}
}
[ExecuteInEditMode]
public class HolographicSight : MonoBehaviour
{
	public Transform VirtualQuad;

	public float Scale = 1f;

	public bool SizeCompensation = true;

	private MaterialPropertyBlock m_block;

	private void OnEnable()
	{
		//IL_0002: Unknown result type (might be due to invalid IL or missing references)
		//IL_000c: Expected O, but got Unknown
		m_block = new MaterialPropertyBlock();
		((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block);
	}

	private void OnWillRenderObject()
	{
		//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_001c: 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_0029: Unknown result type (might be due to invalid IL or missing references)
		Vector3 val = ((Component)this).transform.InverseTransformPoint(((Component)VirtualQuad).transform.position);
		m_block.SetVector("_Offset", Vector4.op_Implicit(val));
		m_block.SetFloat("_Scale", Scale);
		m_block.SetFloat("_SizeCompensation", (!SizeCompensation) ? 0f : 1f);
		((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block);
	}
}
namespace ShermanJumbo
{
	public class LAPDLaserAsAttachment : MonoBehaviour
	{
		public LAPD2019Laser Laser;

		private void Awake()
		{
			Laser.m_isOn = true;
		}
	}
}
namespace DigitalRuby.LightningBolt
{
	public enum LightningBoltAnimationMode
	{
		None,
		Random,
		Loop,
		PingPong
	}
	[RequireComponent(typeof(LineRenderer))]
	public class LightningBoltScript : MonoBehaviour
	{
		[Tooltip("The game object where the lightning will emit from. If null, StartPosition is used.")]
		public GameObject StartObject;

		[Tooltip("The start position where the lightning will emit from. This is in world space if StartObject is null, otherwise this is offset from StartObject position.")]
		public Vector3 StartPosition;

		[Tooltip("The game object where the lightning will end at. If null, EndPosition is used.")]
		public GameObject EndObject;

		[Tooltip("The end position where the lightning will end at. This is in world space if EndObject is null, otherwise this is offset from EndObject position.")]
		public Vector3 EndPosition;

		[Range(0f, 8f)]
		[Tooltip("How manu generations? Higher numbers create more line segments.")]
		public int Generations = 6;

		[Range(0.01f, 1f)]
		[Tooltip("How long each bolt should last before creating a new bolt. In ManualMode, the bolt will simply disappear after this amount of seconds.")]
		public float Duration = 0.05f;

		private float timer;

		[Range(0f, 1f)]
		[Tooltip("How chaotic should the lightning be? (0-1)")]
		public float ChaosFactor = 0.15f;

		[Tooltip("In manual mode, the trigger method must be called to create a bolt")]
		public bool ManualMode;

		[Range(1f, 64f)]
		[Tooltip("The number of rows in the texture. Used for animation.")]
		public int Rows = 1;

		[Range(1f, 64f)]
		[Tooltip("The number of columns in the texture. Used for animation.")]
		public int Columns = 1;

		[Tooltip("The animation mode for the lightning")]
		public LightningBoltAnimationMode AnimationMode = LightningBoltAnimationMode.PingPong;

		[NonSerialized]
		[HideInInspector]
		public Random RandomGenerator = new Random();

		private LineRenderer lineRenderer;

		private List<KeyValuePair<Vector3, Vector3>> segments = new List<KeyValuePair<Vector3, Vector3>>();

		private int startIndex;

		private Vector2 size;

		private Vector2[] offsets;

		private int animationOffsetIndex;

		private int animationPingPongDirection = 1;

		private bool orthographic;

		private void GetPerpendicularVector(ref Vector3 directionNormalized, out Vector3 side)
		{
			//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_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//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)
			if (directionNormalized == Vector3.zero)
			{
				side = Vector3.right;
				return;
			}
			float x = directionNormalized.x;
			float y = directionNormalized.y;
			float z = directionNormalized.z;
			float num = Mathf.Abs(x);
			float num2 = Mathf.Abs(y);
			float num3 = Mathf.Abs(z);
			float num4;
			float num5;
			float num6;
			if (num >= num2 && num2 >= num3)
			{
				num4 = 1f;
				num5 = 1f;
				num6 = (0f - (y * num4 + z * num5)) / x;
			}
			else if (num2 >= num3)
			{
				num6 = 1f;
				num5 = 1f;
				num4 = (0f - (x * num6 + z * num5)) / y;
			}
			else
			{
				num6 = 1f;
				num4 = 1f;
				num5 = (0f - (x * num6 + y * num4)) / z;
			}
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num6, num4, num5);
			side = ((Vector3)(ref val)).normalized;
		}

		private void GenerateLightningBolt(Vector3 start, Vector3 end, int generation, int totalGenerations, float offsetAmount)
		{
			//IL_004c: 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_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00e1: 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_00e3: 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_00f2: 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_0104: 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_010a: 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_0113: 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_0127: Unknown result type (might be due to invalid IL or missing references)
			if (generation < 0 || generation > 8)
			{
				return;
			}
			if (orthographic)
			{
				start.z = (end.z = Mathf.Min(start.z, end.z));
			}
			segments.Add(new KeyValuePair<Vector3, Vector3>(start, end));
			if (generation == 0)
			{
				return;
			}
			if (offsetAmount <= 0f)
			{
				Vector3 val = end - start;
				offsetAmount = ((Vector3)(ref val)).magnitude * ChaosFactor;
			}
			while (generation-- > 0)
			{
				int num = startIndex;
				startIndex = segments.Count;
				for (int i = num; i < startIndex; i++)
				{
					start = segments[i].Key;
					end = segments[i].Value;
					Vector3 val2 = (start + end) * 0.5f;
					RandomVector(ref start, ref end, offsetAmount, out var result);
					val2 += result;
					segments.Add(new KeyValuePair<Vector3, Vector3>(start, val2));
					segments.Add(new KeyValuePair<Vector3, Vector3>(val2, end));
				}
				offsetAmount *= 0.5f;
			}
		}

		public void RandomVector(ref Vector3 start, ref Vector3 end, float offsetAmount, out Vector3 result)
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: 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_00cd: 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)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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)
			if (orthographic)
			{
				Vector3 val = end - start;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(0f - normalized.y, normalized.x, normalized.z);
				float num = (float)RandomGenerator.NextDouble() * offsetAmount * 2f - offsetAmount;
				result = val2 * num;
			}
			else
			{
				Vector3 val3 = end - start;
				Vector3 directionNormalized = ((Vector3)(ref val3)).normalized;
				GetPerpendicularVector(ref directionNormalized, out var side);
				float num2 = ((float)RandomGenerator.NextDouble() + 0.1f) * offsetAmount;
				float num3 = (float)RandomGenerator.NextDouble() * 360f;
				result = Quaternion.AngleAxis(num3, directionNormalized) * side * num2;
			}
		}

		private void SelectOffsetFromAnimationMode()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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)
			if (AnimationMode == LightningBoltAnimationMode.None)
			{
				((Renderer)lineRenderer).material.mainTextureOffset = offsets[0];
				return;
			}
			int num;
			if (AnimationMode == LightningBoltAnimationMode.PingPong)
			{
				num = animationOffsetIndex;
				animationOffsetIndex += animationPingPongDirection;
				if (animationOffsetIndex >= offsets.Length)
				{
					animationOffsetIndex = offsets.Length - 2;
					animationPingPongDirection = -1;
				}
				else if (animationOffsetIndex < 0)
				{
					animationOffsetIndex = 1;
					animationPingPongDirection = 1;
				}
			}
			else if (AnimationMode == LightningBoltAnimationMode.Loop)
			{
				num = animationOffsetIndex++;
				if (animationOffsetIndex >= offsets.Length)
				{
					animationOffsetIndex = 0;
				}
			}
			else
			{
				num = RandomGenerator.Next(0, offsets.Length);
			}
			if (num >= 0 && num < offsets.Length)
			{
				((Renderer)lineRenderer).material.mainTextureOffset = offsets[num];
			}
			else
			{
				((Renderer)lineRenderer).material.mainTextureOffset = offsets[0];
			}
		}

		private void UpdateLineRenderer()
		{
			//IL_0050: 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)
			int num = segments.Count - startIndex + 1;
			lineRenderer.positionCount = num;
			if (num >= 1)
			{
				int num2 = 0;
				lineRenderer.SetPosition(num2++, segments[startIndex].Key);
				for (int i = startIndex; i < segments.Count; i++)
				{
					lineRenderer.SetPosition(num2++, segments[i].Value);
				}
				segments.Clear();
				SelectOffsetFromAnimationMode();
			}
		}

		private void Start()
		{
			orthographic = (Object)(object)Camera.main != (Object)null && Camera.main.orthographic;
			lineRenderer = ((Component)this).GetComponent<LineRenderer>();
			lineRenderer.positionCount = 0;
			UpdateFromMaterialChange();
		}

		private void Update()
		{
			orthographic = (Object)(object)Camera.main != (Object)null && Camera.main.orthographic;
			if (timer <= 0f)
			{
				if (ManualMode)
				{
					timer = Duration;
					lineRenderer.positionCount = 0;
				}
				else
				{
					Trigger();
				}
			}
			timer -= Time.deltaTime;
		}

		public void Trigger()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_0036: 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_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_0096: 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_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			timer = Duration + Mathf.Min(0f, timer);
			Vector3 start = ((!((Object)(object)StartObject == (Object)null)) ? (StartObject.transform.position + StartPosition) : StartPosition);
			Vector3 end = ((!((Object)(object)EndObject == (Object)null)) ? (EndObject.transform.position + EndPosition) : EndPosition);
			startIndex = 0;
			GenerateLightningBolt(start, end, Generations, Generations, 0f);
			UpdateLineRenderer();
		}

		public void UpdateFromMaterialChange()
		{
			//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_0032: 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)
			size = new Vector2(1f / (float)Columns, 1f / (float)Rows);
			((Renderer)lineRenderer).material.mainTextureScale = size;
			offsets = (Vector2[])(object)new Vector2[Rows * Columns];
			for (int i = 0; i < Rows; i++)
			{
				for (int j = 0; j < Columns; j++)
				{
					ref Vector2 reference = ref offsets[j + i * Columns];
					reference = new Vector2((float)j / (float)Columns, (float)i / (float)Rows);
				}
			}
		}
	}
}
namespace ShermanJumbo
{
	public class MagazineDeleteIfEmpty : MonoBehaviour
	{
		public FVRFireArmMagazine Magazine;

		private void Update()
		{
			if (!((Object)(object)Magazine.FireArm == (Object)null) && !Magazine.HasARound())
			{
				FVRFireArmMagazine magazine = Magazine;
				Magazine.FireArm.EjectMag(false);
				Object.Destroy((Object)(object)((Component)magazine).gameObject);
			}
		}
	}
}
namespace MeatKit
{
	public class HideInNormalInspectorAttribute : PropertyAttribute
	{
	}
}
namespace ShermanJumbo.B100_Portable_Hellbomb
{
	[BepInPlugin("ShermanJumbo.B100_Portable_Hellbomb", "B100_Portable_Hellbomb", "1.0.1")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class B100_Portable_HellbombPlugin : 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(), "ShermanJumbo.B100_Portable_Hellbomb");
			OtherLoader.RegisterDirectLoad(BasePath, "ShermanJumbo.B100_Portable_Hellbomb", "", "", "shermanjumbo_b100portablehellbomb", "");
		}
	}
}
namespace ShermanJumbo
{
	public class OpenBoltFakeChamberDisplay : MonoBehaviour
	{
		public OpenBoltReceiver Gun;

		public OpenBoltReceiverBolt Bolt;

		public GameObject DisplayRound;

		private void Update()
		{
			//IL_0032: 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_0048: Invalid comparison between Unknown and I4
			if ((Object)(object)((FVRFireArm)Gun).Magazine != (Object)null && ((FVRFireArm)Gun).Magazine.HasARound() && (int)Bolt.CurPos != 0 && (int)Bolt.CurPos != 1)
			{
				DisplayRound.SetActive(true);
			}
			else
			{
				DisplayRound.SetActive(false);
			}
		}
	}
	public class DoubleBarrelClosedBoltWeaponBolt : FVRInteractiveObject
	{
		public enum BoltPos
		{
			Forward,
			ForwardToMid,
			Locked,
			LockedToRear,
			Rear
		}

		[Header("Bolt")]
		public DoubleBarreledClosedBoltWeapon Weapon;

		public float Speed_Forward;

		public float Speed_Rearward;

		public float Speed_Held;

		public float SpringStiffness = 5f;

		public BoltPos CurPos;

		public BoltPos LastPos;

		public Transform Point_Bolt_Forward;

		public Transform Point_Bolt_LockPoint;

		public Transform Point_Bolt_Rear;

		public Transform Point_Bolt_SafetyLock;

		public bool HasLastRoundBoltHoldOpen = true;

		public bool UsesAKSafetyLock;

		public bool DoesClipHoldBoltOpen = true;

		private float m_curBoltSpeed;

		private float m_boltZ_current;

		private float m_boltZ_heldTarget;

		private float m_boltZ_forward;

		private float m_boltZ_lock;

		private float m_boltZ_rear;

		private float m_boltZ_safetylock;

		private bool m_isBoltLocked;

		private bool m_isHandleHeld;

		private float m_handleLerp;

		public bool HasBoltCatchReleaseButton;

		private bool m_isBoltCatchHeldOnHandle;

		private bool m_isReleaseCatchHeldOnHandle;

		[Header("Reciprocating Barrel")]
		public bool HasReciprocatingBarrel;

		public Transform Barrel;

		public Vector3 BarrelForward;

		public Vector3 BarrelRearward;

		private bool m_isBarrelReciprocating;

		[Header("Hammer")]
		public bool HasHammer;

		public Transform Hammer;

		public Vector3 HammerForward;

		public Vector3 HammerRearward;

		[Header("Rotating Bit")]
		public bool HasRotatingPart;

		public Transform RotatingPart;

		public Vector3 RotatingPartNeutralEulers;

		public Vector3 RotatingPartLeftEulers;

		public Vector3 RotatingPartRightEulers;

		[Header("Z Rot Part")]
		public bool HasZRotPart;

		public Transform ZRotPiece;

		public AnimationCurve ZRotCurve;

		public Vector2 ZAngles;

		public bool ZRotPieceDips;

		public float DipMagnitude;

		public bool ZRotPieceLags;

		public float LagMagnitude;

		[Header("Z Scale Part")]
		public bool HasZScalePart;

		public Transform ZScalePiece;

		public AnimationCurve ZScaleCurve;

		public override void Awake()
		{
			//IL_000e: 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_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_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_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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).Awake();
			m_boltZ_current = ((Component)this).transform.localPosition.z;
			m_boltZ_forward = Point_Bolt_Forward.localPosition.z;
			m_boltZ_lock = Point_Bolt_LockPoint.localPosition.z;
			m_boltZ_rear = Point_Bolt_Rear.localPosition.z;
			if (UsesAKSafetyLock)
			{
				m_boltZ_safetylock = Point_Bolt_SafetyLock.localPosition.z;
			}
		}

		public float GetBoltLerpBetweenLockAndFore()
		{
			return Mathf.InverseLerp(m_boltZ_lock, m_boltZ_forward, m_boltZ_current);
		}

		public float GetBoltLerpBetweenRearAndFore()
		{
			return Mathf.InverseLerp(m_boltZ_rear, m_boltZ_forward, m_boltZ_current);
		}

		public void LockBolt()
		{
			if (!m_isBoltLocked)
			{
				m_isBoltLocked = true;
			}
		}

		public void ReleaseBolt()
		{
			if (m_isBoltLocked)
			{
				if (!((FVRInteractiveObject)this).IsHeld)
				{
					((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)8, 1f);
				}
				m_isBoltLocked = false;
			}
		}

		public void SnapToRear()
		{
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			CurPos = BoltPos.Rear;
			m_boltZ_current = m_boltZ_rear;
			((Component)this).transform.localPosition = Point_Bolt_Rear.localPosition;
		}

		public bool IsBoltLocked()
		{
			return m_isBoltLocked;
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//IL_001a: 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_0034: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_0106: 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_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			if (HasRotatingPart)
			{
				Vector3 val = ((Component)this).transform.position - base.m_hand.PalmTransform.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				if (Vector3.Dot(normalized, ((Component)this).transform.right) > 0f)
				{
					RotatingPart.localEulerAngles = RotatingPartLeftEulers;
				}
				else
				{
					RotatingPart.localEulerAngles = RotatingPartRightEulers;
				}
			}
			if (hand.IsInStreamlinedMode)
			{
				if (hand.Input.AXButtonDown && HasBoltCatchReleaseButton)
				{
					m_isBoltCatchHeldOnHandle = true;
					((FVRInteractiveObject)this).ForceBreakInteraction();
				}
				else if (hand.Input.BYButtonDown && HasBoltCatchReleaseButton)
				{
					m_isReleaseCatchHeldOnHandle = true;
					((FVRInteractiveObject)this).ForceBreakInteraction();
				}
			}
			else if (hand.Input.TouchpadDown)
			{
				if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) < 45f && HasBoltCatchReleaseButton)
				{
					m_isBoltCatchHeldOnHandle = true;
					((FVRInteractiveObject)this).ForceBreakInteraction();
				}
				else if (Vector2.Angle(hand.Input.TouchpadAxes, Vector2.up) < 45f && HasBoltCatchReleaseButton)
				{
					m_isReleaseCatchHeldOnHandle = true;
					((FVRInteractiveObject)this).ForceBreakInteraction();
				}
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			if (HasRotatingPart)
			{
				RotatingPart.localEulerAngles = RotatingPartNeutralEulers;
			}
			if (!m_isBoltLocked)
			{
				m_curBoltSpeed = Speed_Forward;
			}
			if (CurPos > BoltPos.Forward)
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)8, 1f);
			}
			if (m_isBoltCatchHeldOnHandle)
			{
				m_isBoltCatchHeldOnHandle = false;
				if (CurPos >= BoltPos.Locked)
				{
					LockBolt();
				}
			}
			if (m_isReleaseCatchHeldOnHandle)
			{
				m_isReleaseCatchHeldOnHandle = false;
				ReleaseBolt();
			}
			((FVRInteractiveObject)this).EndInteraction(hand);
		}

		public void UpdateHandleHeldState(bool state, float lerp)
		{
			m_isHandleHeld = state;
			if (state)
			{
				m_handleLerp = lerp;
			}
		}

		public void ImpartFiringImpulse()
		{
			m_curBoltSpeed = Speed_Rearward;
			if (CurPos == BoltPos.Forward)
			{
				m_isBarrelReciprocating = true;
			}
		}

		public bool IsBoltForwardOfSafetyLock()
		{
			return m_boltZ_current > m_boltZ_safetylock;
		}

		public void UpdateBolt()
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: 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_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_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_0274: 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_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_032c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: 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_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0467: Unknown result type (might be due to invalid IL or missing references)
			//IL_046e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0441: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0352: Unknown result type (might be due to invalid IL or missing references)
			//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (((FVRInteractiveObject)this).IsHeld || m_isHandleHeld)
			{
				flag = true;
			}
			if (((FVRInteractiveObject)this).IsHeld)
			{
				Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Bolt_Forward.position, Point_Bolt_Rear.position, ((HandInput)(ref base.m_hand.Input)).Pos);
				m_boltZ_heldTarget = ((Component)Weapon).transform.InverseTransformPoint(closestValidPoint).z;
			}
			else if (m_isHandleHeld)
			{
				m_boltZ_heldTarget = Mathf.Lerp(m_boltZ_forward, m_boltZ_rear, m_handleLerp);
			}
			Vector2 val = default(Vector2);
			((Vector2)(ref val))..ctor(m_boltZ_rear, m_boltZ_forward);
			if (m_boltZ_current <= m_boltZ_lock && m_isBoltLocked)
			{
				((Vector2)(ref val))..ctor(m_boltZ_rear, m_boltZ_lock);
			}
			if (UsesAKSafetyLock && Weapon.IsWeaponOnSafe() && m_boltZ_current <= m_boltZ_safetylock)
			{
				((Vector2)(ref val))..ctor(m_boltZ_safetylock, m_boltZ_forward);
			}
			if (DoesClipHoldBoltOpen && (Object)(object)((FVRFireArm)Weapon).Clip != (Object)null)
			{
				((Vector2)(ref val))..ctor(m_boltZ_rear, m_boltZ_lock);
			}
			if (flag)
			{
				m_curBoltSpeed = 0f;
			}
			else if ((CurPos < BoltPos.LockedToRear && m_curBoltSpeed >= 0f) || LastPos >= BoltPos.Rear)
			{
				m_curBoltSpeed = Mathf.MoveTowards(m_curBoltSpeed, Speed_Forward, Time.deltaTime * SpringStiffness);
			}
			float boltZ_current = m_boltZ_current;
			float boltZ_current2 = m_boltZ_current;
			if (flag)
			{
				boltZ_current2 = m_boltZ_heldTarget;
				boltZ_current = Mathf.MoveTowards(m_boltZ_current, boltZ_current2, Speed_Held * Time.deltaTime);
			}
			else
			{
				boltZ_current = m_boltZ_current + m_curBoltSpeed * Time.deltaTime;
			}
			boltZ_current = Mathf.Clamp(boltZ_current, val.x, val.y);
			if (Mathf.Abs(boltZ_current - m_boltZ_current) > Mathf.Epsilon)
			{
				m_boltZ_current = boltZ_current;
				((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current);
				if (HasReciprocatingBarrel && m_isBarrelReciprocating)
				{
					float num = 1f - GetBoltLerpBetweenLockAndFore();
					Barrel.localPosition = Vector3.Lerp(BarrelForward, BarrelRearward, num);
				}
				if (HasZRotPart)
				{
					float num2 = 1f - GetBoltLerpBetweenLockAndFore();
					float num3 = ZRotCurve.Evaluate(num2);
					ZRotPiece.localEulerAngles = new Vector3(0f, 0f, Mathf.Lerp(ZAngles.x, ZAngles.y, num3));
					if (ZRotPieceDips || ZRotPieceLags)
					{
						Vector3 zero = Vector3.zero;
						if (ZRotPieceDips)
						{
							zero.y = Mathf.Lerp(0f, 0f - DipMagnitude, num2);
						}
						if (ZRotPieceLags)
						{
							float num4 = Mathf.Abs(m_boltZ_forward - m_boltZ_current);
							zero.z = Mathf.Clamp(num4, 0f, LagMagnitude);
						}
						ZRotPiece.localPosition = zero;
					}
				}
				if (HasZScalePart)
				{
					float num5 = 1f - GetBoltLerpBetweenLockAndFore();
					float num6 = ZScaleCurve.Evaluate(num5);
					ZScalePiece.localScale = new Vector3(1f, 1f, num6);
				}
			}
			else
			{
				m_curBoltSpeed = 0f;
			}
			if (HasHammer)
			{
				if (Weapon.IsHammerCocked)
				{
					Hammer.localEulerAngles = HammerRearward;
				}
				else
				{
					float boltLerpBetweenLockAndFore = GetBoltLerpBetweenLockAndFore();
					Hammer.localEulerAngles = Vector3.Lerp(HammerRearward, HammerForward, boltLerpBetweenLockAndFore);
				}
			}
			BoltPos curPos = CurPos;
			curPos = ((!(Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.001f)) ? ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.001f) ? BoltPos.Locked : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.001f) ? BoltPos.Rear : ((m_boltZ_current > m_boltZ_lock) ? BoltPos.ForwardToMid : BoltPos.LockedToRear))) : BoltPos.Forward);
			int curPos2 = (int)CurPos;
			CurPos = curPos;
			if (CurPos >= BoltPos.ForwardToMid)
			{
				((FVRFireArm)Weapon).IsBreachOpenForGasOut = true;
			}
			else
			{
				((FVRFireArm)Weapon).IsBreachOpenForGasOut = false;
			}
			if (CurPos == BoltPos.Rear && LastPos != BoltPos.Rear)
			{
				BoltEvent_SmackRear();
			}
			if (CurPos == BoltPos.Locked && LastPos != BoltPos.Locked)
			{
				BoltEvent_BoltCaught();
			}
			if (CurPos >= BoltPos.Locked && LastPos < BoltPos.Locked)
			{
				BoltEvent_EjectRound();
			}
			if (CurPos < BoltPos.Locked && LastPos > BoltPos.ForwardToMid)
			{
				BoltEvent_ExtractRoundFromMag();
			}
			if (CurPos == BoltPos.Forward && LastPos != 0)
			{
				BoltEvent_ArriveAtFore();
			}
			if (CurPos >= BoltPos.Locked && ((HasLastRoundBoltHoldOpen && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound() && !Weapon.Chamber.IsFull) || Weapon.IsBoltCatchButtonHeld))
			{
				LockBolt();
			}
			LastPos = CurPos;
		}

		private void BoltEvent_ArriveAtFore()
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			Weapon.ChamberRound();
			if (HasReciprocatingBarrel && m_isBarrelReciprocating)
			{
				m_isBarrelReciprocating = false;
				Barrel.localPosition = BarrelForward;
			}
			if (((FVRInteractiveObject)this).IsHeld)
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)2, 1f);
			}
			else
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)0, 1f);
			}
		}

		private void BoltEvent_EjectRound()
		{
			Weapon.EjectExtractedRound();
			bool playPrefireSound = false;
			if (((FVRInteractiveObject)this).IsHeld || m_isHandleHeld)
			{
				playPrefireSound = true;
			}
			Weapon.CockHammer(playPrefireSound);
		}

		private void BoltEvent_ExtractRoundFromMag()
		{
			Weapon.BeginChamberingRound();
		}

		private void BoltEvent_BoltCaught()
		{
			if (m_isBoltLocked)
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)4, 1f);
			}
		}

		private void BoltEvent_SmackRear()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Invalid comparison between Unknown and I4
			if ((((FVRInteractiveObject)this).IsHeld || m_isHandleHeld) && (!Weapon.BoltLocksWhenNoMagazineFound || (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null))
			{
				ReleaseBolt();
			}
			if (Weapon.EjectsMagazineOnEmpty && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && !((FVRFireArm)Weapon).Magazine.HasARound())
			{
				((FVRFireArm)Weapon).EjectMag(false);
			}
			if (Weapon.BoltLocksWhenNoMagazineFound && (Object)(object)((FVRFireArm)Weapon).Magazine == (Object)null)
			{
				LockBolt();
			}
			if (((FVRInteractiveObject)this).IsHeld || ((((Object)(object)Weapon.Handle != (Object)null && ((FVRInteractiveObject)Weapon.Handle).IsHeld) || ((Object)(object)Weapon.ForeHandle != (Object)null && (int)Weapon.ForeHandle.Mode == 1 && ((FVRInteractiveObject)Weapon.ForeHandle).IsHeld)) && ((FVRFireArm)Weapon).AudioClipSet.BoltSlideBackHeld.Clips.Count > 0))
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)3, 1f);
			}
			else
			{
				((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)1, 1f);
			}
		}
	}
	public class DoubleBarreledClosedBoltWeapon : FVRFireArm
	{
		public enum FireSelectorModeType
		{
			Safe,
			Single,
			Burst,
			FullAuto,
			SuperFastBurst
		}

		public class FireSelectorMode
		{
			public float SelectorPosition;

			public FireSelectorModeType ModeType;

			public int BurstAmount = 3;

			public bool ARStyleBurst;

			public float EngagementDelay;
		}

		[Header("ClosedBoltWeapon Config")]
		public bool HasFireSelectorButton = true;

		public bool HasMagReleaseButton = true;

		public bool HasBoltReleaseButton = true;

		public bool HasBoltCatchButton = true;

		public bool HasHandle = true;

		public bool HasForeHandle;

		public bool HasWrap;

		[Header("Component Connections")]
		public DoubleBarrelClosedBoltWeaponBolt Bolt;

		public ClosedBoltHandle Handle;

		public ClosedBoltForeHandle ForeHandle;

		public ClosedBoltCarrierWrap CarrierWrap;

		public FVRFireArmChamber Chamber;

		public Transform Trigger;

		public Transform FireSelectorSwitch;

		public Transform FireSelectorSwitch2;

		[Header("Round Positions")]
		public Transform RoundPos_Ejecting;

		public Transform RoundPos_Ejection;

		public Transform RoundPos_MagazinePos;

		private FVRFirearmMovingProxyRound m_proxy;

		public Vector3 EjectionSpeed = new Vector3(4f, 2.5f, -1.2f);

		public Vector3 EjectionSpin = new Vector3(20f, 180f, 30f);

		public bool UsesDelinker;

		public ParticleSystem DelinkerSystem;

		[Header("Trigger Config")]
		public bool HasTrigger;

		public float TriggerFiringThreshold = 0.8f;

		public float TriggerResetThreshold = 0.4f;

		public float TriggerDualStageThreshold = 0.95f;

		public float Trigger_ForwardValue;

		public float Trigger_RearwardValue;

		public Axis TriggerAxis;

		public InterpStyle TriggerInterpStyle = (InterpStyle)1;

		public bool UsesDualStageFullAuto;

		private float m_triggerFloat;

		private bool m_hasTriggerReset;

		private int m_CamBurst;

		private bool m_isHammerCocked;

		private float m_engagementDelay;

		private int m_fireSelectorMode;

		[Header("Fire Selector Config")]
		public InterpStyle FireSelector_InterpStyle = (InterpStyle)1;

		public Axis FireSelector_Axis;

		public FireSelectorMode[] FireSelector_Modes;

		[Header("Secondary Fire Selector Config")]
		public InterpStyle FireSelector_InterpStyle2 = (InterpStyle)1;

		public Axis FireSelector_Axis2;

		public FireSelectorMode[] FireSelector_Modes2;

		[Header("Magazine Release Button")]
		public Transform MagazineReleaseButton;

		public InterpStyle MagReleaseInterp;

		public Vector3 MagReleaseUnpressed;

		public Vector3 MagReleasePressed;

		private bool WasMagReleaseHeldDown;

		[Header("Bolt Release Button")]
		public bool HasBoltReleaseVisual;

		public Transform BoltCatch;

		public InterpStyle BoltCatchInterp;

		public Vector3 BoltCatch_Caught;

		public Vector3 BoltCatch_Released;

		private bool wasBoltCaught;

		[Header("SpecialFeatures")]
		public bool EjectsMagazineOnEmpty;

		public bool BoltLocksWhenNoMagazineFound;

		public bool BoltDropsWhenMagazineInserted;

		public bool BoltDropsWhenEmptyMagazineEjected;

		public bool DoesClipEntryRequireBoltBack = true;

		public bool UsesMagMountTransformOverride;

		public Transform MagMountTransformOverride;

		public bool ReciprocatesOnShot = true;

		[Header("StickySystem")]
		public bool UsesStickyDetonation;

		public AudioEvent StickyDetonateSound;

		public Transform StickyTrigger;

		public Vector2 StickyRotRange = new Vector2(0f, 20f);

		private float m_stickyChargeUp;

		public float StickyChargeUpSpeed = 1f;

		public AudioSource m_chargeSound;

		public Renderer StickyScreen;

		public float StickyMaxMultBonus = 1.3f;

		public float StickyForceMult = 1f;

		[HideInInspector]
		public bool IsMagReleaseButtonHeld;

		[HideInInspector]
		public bool IsBoltReleaseButtonHeld;

		[HideInInspector]
		public bool IsBoltCatchButtonHeld;

		private float m_timeSinceFiredShot = 1f;

		private bool m_hasStickTriggerDown;

		private List<MF2_StickyBomb> m_primedBombs = new List<MF2_StickyBomb>();

		[Header("Double Barrel Config")]
		public FVRFireArmChamber Chamber2;

		public Transform SecondMuzzle;

		[Header("Round 2 Positions")]
		public Transform RoundPos_Ejecting2;

		public Transform RoundPos_Ejection2;

		public Transform RoundPos_MagazinePos2;

		private FVRFirearmMovingProxyRound m_proxy2;

		public Vector3 EjectionSpeed2 = new Vector3(4f, 2.5f, -1.2f);

		public Vector3 EjectionSpin2 = new Vector3(20f, 180f, 30f);

		public bool IsHammerCocked => m_isHammerCocked;

		public int FireSelectorModeIndex => m_fireSelectorMode;

		public void NukeShadows()
		{
			m_proxy.NukeShadowCasting();
			((Renderer)Chamber.ProxyRenderer).shadowCastingMode = (ShadowCastingMode)0;
			m_proxy2.NukeShadowCasting();
			((Renderer)Chamber2.ProxyRenderer).shadowCastingMode = (ShadowCastingMode)0;
		}

		public bool HasExtractedRound()
		{
			return m_proxy.IsFull;
		}

		public override void Awake()
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Expected O, but got Unknown
			((FVRFireArm)this).Awake();
			base.FChambers.Add(Chamber);
			base.FChambers.Add(Chamber2);
			m_CamBurst = 0;
			ResetCamBurst();
			GameObject val = new GameObject("m_proxyRound");
			m_proxy = val.AddComponent<FVRFirearmMovingProxyRound>();
			m_proxy.Init(((Component)this).transform);
			GameObject val2 = new GameObject("m_proxyRound2");
			m_proxy2 = val2.AddComponent<FVRFirearmMovingProxyRound>();
			m_proxy2.Init(((Component)this).transform);
		}

		public void SecondaryFireSelectorClicked()
		{
			((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f);
		}

		public void CockHammer(bool playPrefireSound = false)
		{
			if (!m_isHammerCocked)
			{
				m_isHammerCocked = true;
				if (playPrefireSound)
				{
					((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f);
				}
			}
		}

		public void DropHammer()
		{
			if (m_isHammerCocked)
			{
				m_isHammerCocked = false;
				((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f);
				Fire();
			}
		}

		public bool IsWeaponOnSafe()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Invalid comparison between Unknown and I4
			return FireSelector_Modes.Length != 0 && (int)FireSelector_Modes[m_fireSelectorMode].ModeType == 0;
		}

		public void ResetCamBurst()
		{
			FireSelectorMode val = FireSelector_Modes[m_fireSelectorMode];
			m_CamBurst = val.BurstAmount;
			m_engagementDelay = 0f;
		}

		protected virtual void ToggleFireSelector()
		{
			//IL_005d: 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_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			if (FireSelector_Modes.Length > 1)
			{
				if (Bolt.UsesAKSafetyLock && !Bolt.IsBoltForwardOfSafetyLock())
				{
					int num = m_fireSelectorMode + 1;
					if (num >= FireSelector_Modes.Length)
					{
						num -= FireSelector_Modes.Length;
					}
					if ((int)FireSelector_Modes[num].ModeType == 0)
					{
						return;
					}
				}
				m_fireSelectorMode++;
				if (m_fireSelectorMode >= FireSelector_Modes.Length)
				{
					m_fireSelectorMode -= FireSelector_Modes.Length;
				}
				FireSelectorMode val = FireSelector_Modes[m_fireSelectorMode];
				if (m_triggerFloat < 0.1f)
				{
					m_CamBurst = val.BurstAmount;
					m_engagementDelay = 0f;
				}
				((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f);
				if ((Object)(object)FireSelectorSwitch != (Object)null)
				{
					((FVRPhysicalObject)this).SetAnimatedComponent(FireSelectorSwitch, val.SelectorPosition, FireSelector_InterpStyle, FireSelector_Axis);
				}
				if ((Object)(object)FireSelectorSwitch2 != (Object)null)
				{
					FireSelectorMode val2 = FireSelector_Modes2[m_fireSelectorMode];
					((FVRPhysicalObject)this).SetAnimatedComponent(FireSelectorSwitch2, val2.SelectorPosition, FireSelector_InterpStyle2, FireSelector_Axis2);
				}
				if (HasWrap)
				{
					CarrierWrap.OnFireModeChanged();
				}
			}
			ResetCamBurst();
		}

		public void EjectExtractedRound()
		{
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: 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_0064: 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_0079: 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_0094: 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_00af: 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_00bf: 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)
			//IL_00df: 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_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018a: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ca: 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)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			if (Chamber.IsFull)
			{
				Chamber.EjectRound(RoundPos_Ejection.position, ((Component)this).transform.right * EjectionSpeed.x + ((Component)this).transform.up * EjectionSpeed.y + ((Component)this).transform.forward * EjectionSpeed.z, ((Component)this).transform.right * EjectionSpin.x + ((Component)this).transform.up * EjectionSpin.y + ((Component)this).transform.forward * EjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false);
			}
			if (Chamber2.IsFull)
			{
				Chamber2.EjectRound(RoundPos_Ejection2.position, ((Component)this).transform.right * EjectionSpeed2.x + ((Component)this).transform.up * EjectionSpeed2.y + ((Component)this).transform.forward * EjectionSpeed2.z, ((Component)this).transform.right * EjectionSpin2.x + ((Component)this).transform.up * EjectionSpin2.y + ((Component)this).transform.forward * EjectionSpin2.z, RoundPos_Ejection2.position, RoundPos_Ejection2.rotation, false);
			}
		}

		public void BeginChamberingRound()
		{
			bool flag = false;
			GameObject fromPrefabReference = null;
			bool flag2 = false;
			GameObject fromPrefabReference2 = null;
			if (base.HasBelt && !m_proxy.IsFull && base.BeltDD.HasARound())
			{
				flag = true;
				fromPrefabReference = base.BeltDD.RemoveRound(false);
			}
			if (!m_proxy.IsFull && (Object)(object)base.Magazine != (Object)null && !base.Magazine.IsBeltBox && base.Magazine.HasARound())
			{
				flag = true;
				fromPrefabReference = base.Magazine.RemoveRound(false);
			}
			if (flag)
			{
				if (flag)
				{
					m_proxy.SetFromPrefabReference(fromPrefabReference);
				}
				if (!m_proxy2.IsFull && (Object)(object)base.Magazine != (Object)null && !base.Magazine.IsBeltBox && base.Magazine.HasARound())
				{
					flag2 = true;
					fromPrefabReference2 = base.Magazine.RemoveRound(false);
				}
				if (flag2 && flag2)
				{
					m_proxy2.SetFromPrefabReference(fromPrefabReference2);
				}
			}
		}

		public bool ChamberRound()
		{
			if (m_proxy.IsFull && !Chamber.IsFull)
			{
				Chamber.SetRound(m_proxy.Round, false);
				m_proxy.ClearProxy();
			}
			if (m_proxy2.IsFull && !Chamber2.IsFull)
			{
				Chamber2.SetRound(m_proxy2.Round, false);
				m_proxy2.ClearProxy();
				return true;
			}
			return false;
		}

		public override Transform GetMagMountingTransform()
		{
			if (UsesMagMountTransformOverride)
			{
				return MagMountTransformOverride;
			}
			return ((FVRFireArm)this).GetMagMountingTransform();
		}

		public override void FVRFixedUpdate()
		{
			//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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: 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_008a: 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)
			((FVRFireArm)this).FVRFixedUpdate();
			if (UsesStickyDetonation && m_stickyChargeUp > 0f)
			{
				Rigidbody rootRigidbody = ((FVRPhysicalObject)this).RootRigidbody;
				rootRigidbody.velocity += Random.onUnitSphere * 0.2f * m_stickyChargeUp * StickyForceMult;
				Rigidbody rootRigidbody2 = ((FVRPhysicalObject)this).RootRigidbody;
				rootRigidbody2.angularVelocity += Random.onUnitSphere * 1f * m_stickyChargeUp * StickyForceMult;
			}
		}

		public bool Fire()
		{
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Invalid comparison between Unknown and I4
			//IL_01f0: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			if (!Chamber.Fire())
			{
				return false;
			}
			m_timeSinceFiredShot = 0f;
			float num = 1f;
			if (UsesStickyDetonation)
			{
				num = 1f + Mathf.Lerp(0f, StickyMaxMultBonus, m_stickyChargeUp);
			}
			((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), true, num, -1f);
			if (Chamber2.Fire())
			{
				((FVRFireArm)this).Fire(Chamber2, SecondMuzzle, false, num, -1f);
			}
			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);
			bool flag4 = false;
			FireSelectorMode val = FireSelector_Modes[m_fireSelectorMode];
			if ((int)val.ModeType == 4)
			{
				for (int i = 0; i < val.BurstAmount - 1; i++)
				{
					if (base.Magazine.HasARound())
					{
						base.Magazine.RemoveRound();
						((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), false, 1f, -1f);
						flag4 = true;
						((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f);
					}
				}
			}
			((FVRFireArm)this).FireMuzzleSmoke();
			if (UsesDelinker && base.HasBelt)
			{
				DelinkerSystem.Emit(1);
			}
			if (base.HasBelt)
			{
				base.BeltDD.PopEjectFlaps();
				base.BeltDD.AddJitter();
			}
			if (flag4)
			{
				((FVRFireArm)this).PlayAudioGunShot(false, Chamber.GetRound().TailClass, Chamber.GetRound().TailClassSuppressed, GM.CurrentPlayerBody.GetCurrentSoundEnvironment());
			}
			else
			{
				((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f);
			}
			if (ReciprocatesOnShot && (!HasForeHandle || (int)ForeHandle.Mode == 0))
			{
				Bolt.ImpartFiringImpulse();
			}
			return true;
		}

		public override void FVRUpdate()
		{
			((FVRFireArm)this).FVRUpdate();
			UpdateComponents();
			if (m_engagementDelay > 0f)
			{
				m_engagementDelay -= Time.deltaTime;
			}
			if (HasHandle)
			{
				Handle.UpdateHandle();
				Bolt.UpdateHandleHeldState(Handle.ShouldControlBolt(), 1f - Handle.GetBoltLerpBetweenLockAndFore());
			}
			if (HasWrap)
			{
				CarrierWrap.UpdateWrap();
			}
			Bolt.UpdateBolt();
			if (base.UsesClips && DoesClipEntryRequireBoltBack)
			{
				if (Bolt.CurPos >= DoubleBarrelClosedBoltWeaponBolt.BoltPos.Locked)
				{
					if (!base.ClipTrigger.activeSelf)
					{
						base.ClipTrigger.SetActive(true);
					}
				}
				else if (base.ClipTrigger.activeSelf)
				{
					base.ClipTrigger.SetActive(false);
				}
			}
			UpdateDisplayRoundPositions();
			if (m_timeSinceFiredShot < 1f)
			{
				m_timeSinceFiredShot += Time.deltaTime;
			}
		}

		public override void LoadMag(FVRFireArmMagazine mag)
		{
			((FVRFireArm)this).LoadMag(mag);
			if ((BoltLocksWhenNoMagazineFound || (BoltDropsWhenMagazineInserted && mag.HasARound())) && (Object)(object)mag != (Object)null && Bolt.IsBoltLocked())
			{
				Bolt.ReleaseBolt();
			}
		}

		public override void EjectMag(bool PhysicalRelease = false)
		{
			bool flag = false;
			if ((Object)(object)base.Magazine != (Object)null && !base.Magazine.HasARound())
			{
				flag = true;
			}
			((FVRFireArm)this).EjectMag(PhysicalRelease);
			if (Bolt.IsBoltLocked() && flag && BoltDropsWhenEmptyMagazineEjected)
			{
				Bolt.ReleaseBolt();
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			UpdateInputAndAnimate(hand);
		}

		private void UpdateInputAndAnimate(FVRViveHand hand)
		{
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0414: Unknown result type (might be due to invalid IL or missing references)
			//IL_0415: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: 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_0445: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0325: Unknown result type (might be due to invalid IL or missing references)
			//IL_0474: Unknown result type (might be due to invalid IL or missing references)
			//IL_0475: Unknown result type (might be due to invalid IL or missing references)
			//IL_062d: Unknown result type (might be due to invalid IL or missing references)
			//IL_062f: Invalid comparison between Unknown and I4
			//IL_063f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0641: Invalid comparison between Unknown and I4
			//IL_0662: Unknown result type (might be due to invalid IL or missing references)
			//IL_0664: Invalid comparison between Unknown and I4
			IsBoltReleaseButtonHeld = false;
			IsBoltCatchButtonHeld = false;
			IsMagReleaseButtonHeld = false;
			if (((FVRPhysicalObject)this).IsAltHeld)
			{
				return;
			}
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && m_engagementDelay <= 0f)
			{
				m_triggerFloat = hand.Input.TriggerFloat;
			}
			else
			{
				m_triggerFloat = 0f;
			}
			if (!m_hasTriggerReset && m_triggerFloat <= TriggerResetThreshold)
			{
				m_hasTriggerReset = true;
				if (FireSelector_Modes.Length > 0)
				{
					if (FireSelector_Modes[m_fireSelectorMode].ARStyleBurst && m_CamBurst <= 0)
					{
						m_CamBurst = FireSelector_Modes[m_fireSelectorMode].BurstAmount;
					}
					else if (!FireSelector_Modes[m_fireSelectorMode].ARStyleBurst)
					{
						m_CamBurst = FireSelector_Modes[m_fireSelectorMode].BurstAmount;
					}
					m_engagementDelay = FireSelector_Modes[m_fireSelectorMode].EngagementDelay;
				}
				((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)16, 1f);
			}
			if (hand.IsInStreamlinedMode)
			{
				if (hand.Input.BYButtonDown)
				{
					if (Bolt.IsBoltLocked() && HasBoltReleaseButton)
					{
						Bolt.ReleaseBolt();
					}
					else
					{
						ToggleFireSelector();
					}
					if (UsesStickyDetonation)
					{
						Detonate();
					}
				}
				if (hand.Input.AXButtonDown && HasMagReleaseButton && (!EjectsMagazineOnEmpty || (Bolt.CurPos >= DoubleBarrelClosedBoltWeaponBolt.BoltPos.Locked && ((FVRInteractiveObject)Bolt).IsHeld && !m_proxy.IsFull)))
				{
					ReleaseMag();
				}
				if (hand.Input.AXButtonPressed && HasMagReleaseButton)
				{
					IsMagReleaseButtonHeld = true;
				}
				if (UsesStickyDetonation)
				{
					if (hand.Input.BYButtonDown)
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(StickyTrigger, StickyRotRange.y, (InterpStyle)1, (Axis)0);
					}
					else if (hand.Input.BYButtonUp)
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(StickyTrigger, StickyRotRange.x, (InterpStyle)1, (Axis)0);
					}
				}
			}
			else
			{
				Vector2 touchpadAxes = hand.Input.TouchpadAxes;
				if (hand.Input.TouchpadDown)
				{
					if (UsesStickyDetonation)
					{
						Detonate();
					}
					if (((Vector2)(ref touchpadAxes)).magnitude > 0.2f)
					{
						if (Vector2.Angle(touchpadAxes, Vector2.left) <= 45f)
						{
							ToggleFireSelector();
						}
						else if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)
						{
							if (HasBoltReleaseButton)
							{
								Bolt.ReleaseBolt();
							}
						}
						else if (Vector2.Angle(touchpadAxes, Vector2.down) <= 45f && HasMagReleaseButton && (!EjectsMagazineOnEmpty || (Bolt.CurPos >= DoubleBarrelClosedBoltWeaponBolt.BoltPos.Locked && ((FVRInteractiveObject)Bolt).IsHeld && !m_proxy.IsFull)))
						{
							ReleaseMag();
						}
					}
				}
				if (UsesStickyDetonation)
				{
					if (hand.Input.TouchpadDown)
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(StickyTrigger, StickyRotRange.y, (InterpStyle)1, (Axis)0);
					}
					else if (hand.Input.TouchpadUp)
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(StickyTrigger, StickyRotRange.x, (InterpStyle)1, (Axis)0);
					}
				}
				if (hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f)
				{
					if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)
					{
						if (HasBoltReleaseButton)
						{
							IsBoltReleaseButtonHeld = true;
						}
					}
					else if (Vector2.Angle(touchpadAxes, Vector2.right) <= 45f)
					{
						if (HasBoltCatchButton)
						{
							IsBoltCatchButtonHeld = true;
						}
					}
					else if (Vector2.Angle(touchpadAxes, Vector2.down) <= 45f && HasMagReleaseButton)
					{
						IsMagReleaseButtonHeld = true;
					}
				}
			}
			FireSelectorModeType modeType = FireSelector_Modes[m_fireSelectorMode].ModeType;
			if ((int)modeType == 0 || !((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				return;
			}
			if (UsesStickyDetonation)
			{
				if (Bolt.CurPos != 0 || !Chamber.IsFull || Chamber.IsSpent)
				{
					return;
				}
				if (hand.Input.TriggerPressed && m_hasTriggerReset)
				{
					m_hasStickTriggerDown = true;
					m_stickyChargeUp += Time.deltaTime * 0.25f * StickyChargeUpSpeed;
					m_stickyChargeUp = Mathf.Clamp(m_stickyChargeUp, 0f, 1f);
					if (m_stickyChargeUp > 0.05f && !m_chargeSound.isPlaying)
					{
						m_chargeSound.Play();
					}
				}
				else
				{
					if (m_chargeSound.isPlaying)
					{
						m_chargeSound.Stop();
					}
					m_stickyChargeUp = 0f;
				}
				if (m_hasStickTriggerDown && (hand.Input.TriggerUp || m_stickyChargeUp >= 1f))
				{
					m_hasStickTriggerDown = false;
					DropHammer();
					EndStickyCharge();
				}
			}
			else if (m_triggerFloat >= TriggerFiringThreshold && Bolt.CurPos == DoubleBarrelClosedBoltWeaponBolt.BoltPos.Forward && (m_hasTriggerReset || ((int)modeType == 3 && !UsesDualStageFullAuto) || ((int)modeType == 3 && UsesDualStageFullAuto && m_triggerFloat > TriggerDualStageThreshold) || ((int)modeType == 2 && m_CamBurst > 0)))
			{
				DropHammer();
				m_hasTriggerReset = false;
				if (m_CamBurst > 0)
				{
					m_CamBurst--;
				}
			}
		}

		public override void EndInteraction(FVRViveHand hand)
		{
			if (UsesStickyDetonation)
			{
				EndStickyCharge();
			}
			((FVRFireArm)this).EndInteraction(hand);
		}

		private void EndStickyCharge()
		{
			m_chargeSound.Stop();
			m_stickyChargeUp = 0f;
		}

		private void UpdateComponents()
		{
			//IL_002c: 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_0199: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: 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_0104: Unknown result type (might be due to invalid IL or missing references)
			if (HasTrigger)
			{
				((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), TriggerInterpStyle, TriggerAxis);
			}
			if (HasMagReleaseButton && (Object)(object)MagazineReleaseButton != (Object)null)
			{
				float num = 0f;
				if (IsMagReleaseButtonHeld)
				{
					num = 1f;
				}
				Vector3 val = Vector3.Lerp(MagReleaseUnpressed, MagReleasePressed, num);
				if (WasMagReleaseHeldDown != IsMagReleaseButtonHeld)
				{
					WasMagReleaseHeldDown = IsMagReleaseButtonHeld;
					((FVRPhysicalObject)this).SetAnimatedComponent(MagazineReleaseButton, val, MagReleaseInterp);
				}
			}
			if (HasBoltReleaseVisual)
			{
				bool flag = false;
				if (Bolt.IsBoltLocked())
				{
					flag = true;
				}
				if (wasBoltCaught != flag)
				{
					wasBoltCaught = flag;
					if (flag)
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(BoltCatch, BoltCatch_Caught, BoltCatchInterp);
					}
					else
					{
						((FVRPhysicalObject)this).SetAnimatedComponent(BoltCatch, BoltCatch_Released, BoltCatchInterp);
					}
				}
			}
			if (UsesStickyDetonation)
			{
				float num2 = Mathf.Clamp((float)m_primedBombs.Count / 8f, 0f, 1f);
				float num3 = Mathf.Lerp(0.56f, 0.23f, num2);
				float num4 = Mathf.Lerp(5f, 15f, num2);
				StickyScreen.material.SetTextureOffset("_IncandescenceMap", new Vector2(0f, num3));
			}
		}

		private void UpdateDisplayRoundPositions()
		{
			//IL_002f: 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_0045: 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_0070: 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_00a3: 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_00b9: 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)
			//IL_00e4: 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_0117: 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_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			float boltLerpBetweenLockAndFore = Bolt.GetBoltLerpBetweenLockAndFore();
			if (Chamber.IsFull)
			{
				Chamber.ProxyRound.position = Vector3.Lerp(RoundPos_Ejecting.position, ((Component)Chamber).transform.position, boltLerpBetweenLockAndFore);
				Chamber.ProxyRound.rotation = Quaternion.Slerp(RoundPos_Ejecting.rotation, ((Component)Chamber).transform.rotation, boltLerpBetweenLockAndFore);
			}
			if (m_proxy.IsFull)
			{
				m_proxy.ProxyRound.position = Vector3.Lerp(RoundPos_MagazinePos.position, ((Component)Chamber).transform.position, boltLerpBetweenLockAndFore);
				m_proxy.ProxyRound.rotation = Quaternion.Slerp(RoundPos_MagazinePos.rotation, ((Component)Chamber).transform.rotation, boltLerpBetweenLockAndFore);
			}
			if (Chamber2.IsFull)
			{
				Chamber2.ProxyRound.position = Vector3.Lerp(RoundPos_Ejecting2.position, ((Component)Chamber2).transform.position, boltLerpBetweenLockAndFore);
				Chamber2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_Ejecting2.rotation, ((Component)Chamber2).transform.rotation, boltLerpBetweenLockAndFore);
			}
			if (m_proxy2.IsFull)
			{
				m_proxy2.ProxyRound.position = Vector3.Lerp(RoundPos_MagazinePos2.position, ((Component)Chamber2).transform.position, boltLerpBetweenLockAndFore);
				m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_MagazinePos2.rotation, ((Component)Chamber2).transform.rotation, boltLerpBetweenLockAndFore);
			}
		}

		public void ReleaseMag()
		{
			if ((Object)(object)base.Magazine != (Object)null)
			{
				((FVRFireArm)this).EjectMag(false);
			}
		}

		public void RegisterStickyBomb(MF2_StickyBomb sb)
		{
			if ((Object)(object)sb != (Object)null)
			{
				m_primedBombs.Add(sb);
			}
		}

		public void Detonate()
		{
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (m_primedBombs.Count > 0)
			{
				for (int num = m_primedBombs.Count - 1; num >= 0; num--)
				{
					if ((Object)(object)m_primedBombs[num] != (Object)null && m_primedBombs[num].m_hasStuck && !m_primedBombs[num].m_hasExploded)
					{
						flag = true;
						m_primedBombs[num].Detonate();
						m_primedBombs.RemoveAt(num);
					}
				}
			}
			if (flag)
			{
				SM.PlayCoreSound((FVRPooledAudioType)10, StickyDetonateSound, ((Component)this).transform.position);
			}
		}

		public override List<FireArmRoundClass> GetChamberRoundList()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			if (Chamber.IsFull && !Chamber.IsSpent)
			{
				List<FireArmRoundClass> list = new List<FireArmRoundClass>();
				list.Add(Chamber.GetRound().RoundClass);
				return list;
			}
			return null;
		}

		public override void SetLoadedChambers(List<FireArmRoundClass> rounds)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			if (rounds.Count > 0)
			{
				Chamber.Autochamber(rounds[0]);
			}
		}

		public override void ConfigureFromFlagDic(Dictionary<string, string> f)
		{
			//IL_00a8: 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_00e7: 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)
			string empty = string.Empty;
			string empty2 = string.Empty;
			empty = "HammerState";
			if (f.ContainsKey(empty))
			{
				empty2 = f[empty];
				if (empty2 == "Cocked")
				{
					m_isHammerCocked = true;
				}
			}
			if (FireSelector_Modes.Length > 1)
			{
				empty = "FireSelectorState";
				if (f.ContainsKey(empty))
				{
					empty2 = f[empty];
					int.TryParse(empty2, out m_fireSelectorMode);
				}
				if ((Object)(object)FireSelectorSwitch != (Object)null)
				{
					FireSelectorMode val = FireSelector_Modes[m_fireSelectorMode];
					((FVRPhysicalObject)this).SetAnimatedComponent(FireSelectorSwitch, val.SelectorPosition, FireSelector_InterpStyle, FireSelector_Axis);
				}
				if ((Object)(object)FireSelectorSwitch2 != (Object)null)
				{
					FireSelectorMode val2 = FireSelector_Modes2[m_fireSelectorMode];
					((FVRPhysicalObject)this).SetAnimatedComponent(FireSelectorSwitch2, val2.SelectorPosition, FireSelector_InterpStyle2, FireSelector_Axis2);
				}
			}
			((FVRFireArm)this).ConfigureFromFlagDic(f);
		}

		public override Dictionary<string, string> GetFlagDic()
		{
			Dictionary<string, string> flagDic = ((FVRFireArm)this).GetFlagDic();
			string key = "HammerState";
			string value = "Uncocked";
			if (m_isHammerCocked)
			{
				value = "Cocked";
			}
			flagDic.Add(key, value);
			if (FireSelector_Modes.Length > 1)
			{
				key = "FireSelectorState";
				value = m_fireSelectorMode.ToString();
				flagDic.Add(key, value);
			}
			return flagDic;
		}
	}
	public class GR8RecoillessRifle : FVRFireArm
	{
		public FVRFireArmChamber Chamber;

		public GR8ShellInsertEject ShellInsertEject;

		public GR8TailLatch TailLatch;

		private float m_curZ;

		private float m_tarZ;

		public float ZThreshold = 0.01f;

		public Transform Trigger;

		public float TriggerFiringThreshold = 0.8f;

		public float TriggerResetThreshold = 0.4f;

		public float Trigger_ForwardValue;

		public float Trigger_RearwardValue;

		private float m_triggerFloat;

		private float m_lastTriggerFloat;

		private bool m_hasTriggerReset;

		public AudioEvent AudEvent_BackSound;

		public Transform COM;

		public override void Awake()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			((FVRFireArm)this).Awake();
			base.FChambers.Add(Chamber);
			((FVRPhysicalObject)this).RootRigidbody.centerOfMass = COM.localPosition;
		}

		public void FixCOM()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			((FVRPhysicalObject)this).RootRigidbody.centerOfMass = COM.localPosition;
		}

		public override void FVRUpdate()
		{
			((FVRFireArm)this).FVRUpdate();
			if (TailLatch.LState == GR8TailLatch.CGLatchState.Open)
			{
				Chamber.IsAccessible = true;
			}
			else
			{
				Chamber.IsAccessible = false;
			}
			if (Mathf.Abs(m_triggerFloat - m_lastTriggerFloat) > 0.0001f)
			{
				m_lastTriggerFloat = m_triggerFloat;
				((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), (InterpStyle)1, (Axis)0);
			}
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			((FVRPhysicalObject)this).UpdateInteraction(hand);
			if (((FVRPhysicalObject)this).IsAltHeld)
			{
				m_triggerFloat = 0f;
				return;
			}
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
			{
				m_triggerFloat = hand.Input.TriggerFloat;
			}
			else
			{
				m_triggerFloat = 0f;
			}
			if (!m_hasTriggerReset && m_triggerFloat <= TriggerResetThreshold)
			{
				m_hasTriggerReset = true;
				((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)16, 1f);
			}
			if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && m_triggerFloat >= TriggerFiringThreshold && TailLatch.LState == GR8TailLatch.CGLatchState.Closed && m_hasTriggerReset)
			{
				m_hasTriggerReset = false;
				TryToFire();
			}
		}

		private void TryToFire()
		{
			//IL_0034: 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)
			((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f);
			if (Chamber.Fire())
			{
				((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f);
				((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), true, 1f, -1f);
				((FVRFireArm)this).FireMuzzleSmoke();
				SM.PlayCoreSound((FVRPooledAudioType)5, AudEvent_BackSound, ((Component)TailLatch).transform.position);
				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);
			}
		}
	}
	public class GR8ShellInsertEject : FVRInteractiveObject
	{
		public enum ChamberSlideState
		{
			In,
			Middle,
			Out
		}

		public GR8RecoillessRifle CG;

		public AudioEvent AudEvent_ShellInStart;

		public AudioEvent AudEvent_ShellIn;

		public AudioEvent AudEvent_ShellOutStart;

		public AudioEvent AudEvent_ShellOut;

		public Transform ChamberPoint_Back;

		public Transform ChamberPoint_Forward;

		public Collider Col;

		public ChamberSlideState CSState = ChamberSlideState.Out;

		private float m_curZ;

		private float m_tarZ;

		public float ZThreshold = 0.02f;

		private float m_timeHeld;

		public override void Awake()
		{
			//IL_000e: 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)
			((FVRInteractiveObject)this).Awake();
			m_curZ = ChamberPoint_Back.localPosition.z;
			m_tarZ = m_curZ;
		}

		public override bool IsInteractable()
		{
			return CG.Chamber.IsFull && CG.TailLatch.LState == GR8TailLatch.CGLatchState.Open;
		}

		public override void UpdateInteraction(FVRViveHand hand)
		{
			//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_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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			((FVRInteractiveObject)this).UpdateInteraction(hand);
			float tarZ = Mathf.Clamp(((Component)CG).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z, ChamberPoint_Back.localPosition.z, ChamberPoint_Forward.localPosition.z);
			m_tarZ = tarZ;
		}

		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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: 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 referen