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 ModularWorkshop; using MuzzleScripts; using OpenScripts2; using OtherLoader; using ShermanJumbo; using UnityEngine; using UnityEngine.Audio; 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 AdvancedFireSelector : MonoBehaviour { [Serializable] public class AdvancedFiremode { public FireSelectorModeType Firemode; public string DisplayText; public int SuperBurstAmount = 7; public bool ChangesBoltSpeed = false; public Vector3 ForwardRearwardStiffness; public bool BlastJumpOnFire = false; public float BlastJumpAmnt = 0.25f; } public OpenBoltReceiver Gun; private int CurrentFiremode = 0; public Text TextObject; public AdvancedFiremode[] Firemodes; private void Start() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); TextObject.text = Firemodes[0].DisplayText; Gun.SuperBurstAmount = Firemodes[0].SuperBurstAmount; Gun.FireSelector_Modes[0].ModeType = Firemodes[0].Firemode; if (Firemodes[0].ChangesBoltSpeed) { Gun.Bolt.BoltSpeed_Forward = Firemodes[0].ForwardRearwardStiffness.x; Gun.Bolt.BoltSpeed_Rearward = Firemodes[0].ForwardRearwardStiffness.y; Gun.Bolt.BoltSpringStiffness = Firemodes[0].ForwardRearwardStiffness.z; } } private void ShotFired(FVRFireArm firearm) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)firearm == (Object)(object)Gun && Firemodes[CurrentFiremode].BlastJumpOnFire) { GM.CurrentMovementManager.Blast(-((Component)((FVRFireArm)Gun).GetMuzzle()).transform.forward, Firemodes[CurrentFiremode].BlastJumpAmnt, true); } } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } 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)Gun).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.left) <= 45f))) { SwapFiremodes(); } } public void SwapFiremodes() { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) CurrentFiremode++; if (CurrentFiremode > Firemodes.Length - 1) { CurrentFiremode = 0; } ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)15, 1f); TextObject.text = Firemodes[CurrentFiremode].DisplayText; Gun.FireSelector_Modes[0].ModeType = Firemodes[CurrentFiremode].Firemode; Gun.SuperBurstAmount = Firemodes[CurrentFiremode].SuperBurstAmount; if (Firemodes[CurrentFiremode].ChangesBoltSpeed) { Gun.Bolt.BoltSpeed_Forward = Firemodes[CurrentFiremode].ForwardRearwardStiffness.x; Gun.Bolt.BoltSpeed_Rearward = Firemodes[CurrentFiremode].ForwardRearwardStiffness.y; Gun.Bolt.BoltSpringStiffness = Firemodes[CurrentFiremode].ForwardRearwardStiffness.z; } } } } namespace Alloy { public static class EnumExtension { public static bool HasFlag(this Enum keys, Enum flag) { int num = Convert.ToInt32(keys); int num2 = Convert.ToInt32(flag); return (num & num2) == num2; } } } namespace ShermanJumbo { public class AnimationPlayOnFire : MonoBehaviour { public FVRFireArm FireArm; public Animator Animator; public string FiringAnimationNode = "GunFire"; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)FireArm) { Animator.Play(FiringAnimationNode); } } } public class BallisticProjLightningBolt : MonoBehaviour { public GameObject TransformToMove; private Vector3 SpawnLocation; 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) SpawnLocation = ((Component)this).gameObject.transform.position; } private void Update() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) TransformToMove.transform.position = SpawnLocation; } } 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 BeckerShotgun : FVRFireArm { [Header("Becker Parts")] public Transform Trigger; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public Axis TriggerAxis; public InterpStyle TriggerInterpStyle = (InterpStyle)1; private float m_triggerFloat; public Transform Safety; public float SafetyOn; public bool IsSafetyOn = true; public bool HammerCocked = false; public Transform Cylinder; private float currentAngle; private float targetAngle; public float WindingRate; public AudioEvent WindingSound; private bool IsWinding = false; public float UnwindingRate; public AudioEvent UnwindingSound; private bool IsUnwinding = false; public FVRFireArmChamber[] Chambers; public FVRFireArmChamber FiringChamber; public FVRFireArmChamber ExposedChamber; public Transform EjectionPosition; public Vector3 EjectionVelocity; public Vector3 EjectionSpin; public int WindingStage; public BeckerShotgunBarrel Barrel; public override void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).Awake(); if ((Object)(object)Cylinder != (Object)null) { currentAngle = Cylinder.localEulerAngles.z; } } public override void FVRUpdate() { //IL_004c: 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) ((FVRFireArm)this).FVRUpdate(); if (IsWinding) { currentAngle = Mathf.MoveTowardsAngle(currentAngle, targetAngle, WindingRate * Time.deltaTime); Cylinder.localRotation = Quaternion.Euler(0f, 0f, currentAngle); if (Mathf.Abs(Mathf.DeltaAngle(currentAngle, targetAngle)) < 0.1f) { IsWinding = false; WindingStage++; FiringChamber = Chambers[WindingStage]; ExposedChamber = Chambers[WindingStage + 1]; } } if (IsUnwinding) { currentAngle = Mathf.MoveTowardsAngle(currentAngle, targetAngle, UnwindingRate * Time.deltaTime); Cylinder.localRotation = Quaternion.Euler(0f, 0f, currentAngle); if (Mathf.Abs(Mathf.DeltaAngle(currentAngle, targetAngle)) < 0.1f) { IsUnwinding = false; WindingStage--; FiringChamber = Chambers[WindingStage]; ExposedChamber = Chambers[WindingStage + 1]; } } } public void WindCylinder() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!IsWinding && WindingStage <= 5) { float num = 60f; targetAngle = currentAngle + num; IsWinding = true; SM.PlayGenericSound(WindingSound, ((Component)this).transform.position); } } public void UnwindCylinder() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!IsUnwinding && WindingStage != 0) { float num = 60f; targetAngle = currentAngle - num; IsUnwinding = true; SM.PlayGenericSound(UnwindingSound, ((Component)this).transform.position); } } public void Fire() { //IL_0098: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); if (FiringChamber.IsFull && !FiringChamber.IsSpent) { FiringChamber.Fire(); ((FVRFireArm)this).Fire(FiringChamber, ((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(FiringChamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { FiringChamber.IsSpent = false; FiringChamber.UpdateProxyDisplay(); } EjectExposedChamber(); Barrel.RecockBarrel(); } else { UnwindCylinder(); } } 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) //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) ((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) { if (!Barrel.IsLocked || IsSafetyOn) { return; } Barrel.ReleaseBarrel(); } if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f)) { SwapFiremodes(); } } public void SwapFiremodes() { //IL_0058: 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) IsSafetyOn = !IsSafetyOn; if (IsSafetyOn) { Safety.localEulerAngles = new Vector3(SafetyOn, 0f, 0f); } else { Safety.localEulerAngles = new Vector3(0f, 0f, 0f); } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)14, 1f); } public void EjectExposedChamber() { //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) if (ExposedChamber.IsFull) { ExposedChamber.EjectRound(EjectionPosition.position, ((Component)this).transform.right * EjectionVelocity.x + ((Component)this).transform.up * EjectionVelocity.y + ((Component)this).transform.forward * EjectionVelocity.z, ((Component)this).transform.right * EjectionSpin.x + ((Component)this).transform.up * EjectionSpin.y + ((Component)this).transform.forward * EjectionSpin.z, EjectionPosition.position, EjectionPosition.rotation, false); } } } public class BeckerShotgunBarrel : FVRInteractiveObject { public enum BarrelPos { Forward, Middle, Rear } [Header("Becker Barrel Params")] public BeckerShotgun Becker; public Transform ForwardPoint; public Transform RearwardPoint; public float ForwardSpeed = 1f; private float OGForwardSpeed; private float m_boltZ_forward; private float m_boltZ_rear; private float m_currentHandleZ; public BarrelPos CurPos; public BarrelPos LastPos; public bool IsLocked = false; public bool IsSlidingForward = false; 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) ((FVRInteractiveObject)this).Awake(); m_boltZ_forward = ForwardPoint.localPosition.z; m_boltZ_rear = RearwardPoint.localPosition.z; m_currentHandleZ = ((Component)this).transform.localPosition.z; OGForwardSpeed = ForwardSpeed; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(ForwardPoint.position, RearwardPoint.position, ((HandInput)(ref base.m_hand.Input)).Pos); ((Component)this).transform.position = closestValidPoint; m_currentHandleZ = ((Component)this).transform.localPosition.z; } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRUpdate() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (!((FVRInteractiveObject)this).IsHeld && Mathf.Abs(m_currentHandleZ - m_boltZ_forward) > 0.001f) { m_currentHandleZ = Mathf.MoveTowards(m_currentHandleZ, m_boltZ_forward, Time.deltaTime * ForwardSpeed); ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_currentHandleZ); } if (Mathf.Abs(m_currentHandleZ - m_boltZ_forward) < 0.005f) { CurPos = BarrelPos.Forward; } else if (Mathf.Abs(m_currentHandleZ - m_boltZ_rear) < 0.005f) { CurPos = BarrelPos.Rear; } else { CurPos = BarrelPos.Middle; } if (CurPos == BarrelPos.Forward && LastPos != 0) { if ((Object)(object)Becker != (Object)null) { ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)0, 1f); if (IsSlidingForward) { IsSlidingForward = false; Becker.Fire(); } } } else if (CurPos == BarrelPos.Rear && LastPos != BarrelPos.Rear) { ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)3, 1f); ForwardSpeed = 0f; IsLocked = true; } LastPos = CurPos; } public void ReleaseBarrel() { if (IsLocked) { IsLocked = false; IsSlidingForward = true; ForwardSpeed = OGForwardSpeed; } } public void RecockBarrel() { //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_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) m_currentHandleZ = m_boltZ_rear; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_currentHandleZ); CurPos = BarrelPos.Rear; LastPos = BarrelPos.Rear; IsLocked = true; ForwardSpeed = 0f; IsSlidingForward = false; if ((Object)(object)Becker != (Object)null) { ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)3, 1f); } Becker.UnwindCylinder(); } public override bool IsInteractable() { return !IsLocked; } } } public class BeckerShotgunCylinderTrigger : FVRInteractiveObject { public BeckerShotgun Becker; public float RotationMagnitude = 5f; private bool hasTriggered = false; public AudioEvent RotateSound; public override void UpdateInteraction(FVRViveHand hand) { //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_0084: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); if (!((Object)(object)Becker == (Object)null)) { float z = ((Component)this).transform.InverseTransformDirection(hand.Input.VelAngularWorld).z; if (z > RotationMagnitude && !hasTriggered && Becker.WindingStage < 5) { hasTriggered = true; Becker.WindCylinder(); SM.PlayGenericSound(RotateSound, ((Component)this).transform.position); } else if (z < 1f) { hasTriggered = false; } } } } public class BeckerShotgunEjectorRod : FVRInteractiveObject { public enum EjectorPos { Forward, Middle, Rear } [Header("Becker Rod Params")] public BeckerShotgun Becker; public Transform ForwardPoint; public Transform RearwardPoint; public float ForwardSpeed = 1f; private float m_boltZ_forward; private float m_boltZ_rear; private float m_currentHandleZ; public EjectorPos CurPos; public EjectorPos LastPos; 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) ((FVRInteractiveObject)this).Awake(); m_boltZ_forward = ForwardPoint.localPosition.z; m_boltZ_rear = RearwardPoint.localPosition.z; m_currentHandleZ = ((Component)this).transform.localPosition.z; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(ForwardPoint.position, RearwardPoint.position, ((HandInput)(ref base.m_hand.Input)).Pos); ((Component)this).transform.position = closestValidPoint; m_currentHandleZ = ((Component)this).transform.localPosition.z; } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRUpdate() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_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_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0242: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0257: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (!((FVRInteractiveObject)this).IsHeld && Mathf.Abs(m_currentHandleZ - m_boltZ_forward) > 0.001f) { m_currentHandleZ = Mathf.MoveTowards(m_currentHandleZ, m_boltZ_forward, Time.deltaTime * ForwardSpeed); ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_currentHandleZ); } if (Mathf.Abs(m_currentHandleZ - m_boltZ_forward) < 0.005f) { CurPos = EjectorPos.Forward; } else if (Mathf.Abs(m_currentHandleZ - m_boltZ_rear) < 0.005f) { CurPos = EjectorPos.Rear; } else { CurPos = EjectorPos.Middle; } if (CurPos == EjectorPos.Forward && LastPos != 0) { if ((Object)(object)Becker != (Object)null) { ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)11, 1f); } } else if (CurPos == EjectorPos.Rear && LastPos != EjectorPos.Rear) { if (Becker.ExposedChamber.IsFull) { Becker.ExposedChamber.EjectRound(Becker.EjectionPosition.position, ((Component)this).transform.right * Becker.EjectionVelocity.x + ((Component)this).transform.up * Becker.EjectionVelocity.y + ((Component)this).transform.forward * Becker.EjectionVelocity.z, ((Component)this).transform.right * Becker.EjectionSpin.x + ((Component)this).transform.up * Becker.EjectionSpin.y + ((Component)this).transform.forward * Becker.EjectionSpin.z, Becker.EjectionPosition.position, Becker.EjectionPosition.rotation, false); ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)29, 1f); } ((FVRFireArm)Becker).PlayAudioEvent((FirearmAudioEventType)10, 1f); } LastPos = CurPos; } } namespace ShermanJumbo { public class BoltActionRifleFireSecondChamber : MonoBehaviour { public FVRFireArm Gun; public FVRFireArmChamber Chamber; public Transform MuzzlePoint; private bool isSecondaryFiring = false; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { //IL_009c: 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) if (!isSecondaryFiring && (Object)(object)firearm == (Object)(object)Gun && Chamber.IsFull) { isSecondaryFiring = true; Chamber.Fire(); Gun.Fire(Chamber, MuzzlePoint, true, 1f, -1f); Gun.FireMuzzleSmoke(); bool flag = Gun.IsTwoHandStabilized(); bool flag2 = Gun.IsForegripStabilized(); bool flag3 = Gun.IsShoulderStabilized(); FVRSoundEnvironment currentSoundEnvironment = GM.CurrentPlayerBody.GetCurrentSoundEnvironment(); Gun.PlayAudioEvent((FirearmAudioEventType)101, 1f); Chamber.SetRound((FVRFireArmRound)null, false); isSecondaryFiring = false; } } } public class BreakActionMainHandFireSelector : MonoBehaviour { public BreakActionWeapon Weapon; public Transform SelectorSwitch; public Vector3 PosSingleFire; public GameObject ShowOnSingle; public Vector3 PosMultiFire; public GameObject ShowOnMulti; public bool IsRot = false; public Vector3 RotEngaged; public bool SwapsTrigger = false; public Transform SecondTrigger; public float SecondTriggerPulledAngle = 20f; private Transform OriginalTrigger; private float OriginalTriggerPulled; private void Awake() { OriginalTrigger = Weapon.Triggers[0]; OriginalTriggerPulled = Weapon.TriggerPulled; } 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)15, 1f); if (Weapon.FireAllBarrels) { Weapon.FireAllBarrels = false; if ((Object)(object)ShowOnSingle != (Object)null) { ShowOnSingle.SetActive(true); } if ((Object)(object)ShowOnMulti != (Object)null) { ShowOnMulti.SetActive(false); } if (!IsRot) { SelectorSwitch.localPosition = PosSingleFire; } if (IsRot) { SelectorSwitch.localEulerAngles = Vector3.zero; } if (SwapsTrigger) { Weapon.Triggers[0] = OriginalTrigger; Weapon.TriggerPulled = OriginalTriggerPulled; } } else if (!Weapon.FireAllBarrels) { Weapon.FireAllBarrels = true; if ((Object)(object)ShowOnSingle != (Object)null) { ShowOnSingle.SetActive(false); } if ((Object)(object)ShowOnMulti != (Object)null) { ShowOnMulti.SetActive(true); } if (!IsRot) { SelectorSwitch.localPosition = PosMultiFire; } if (IsRot) { SelectorSwitch.localEulerAngles = RotEngaged; } if (SwapsTrigger) { Weapon.Triggers[0] = SecondTrigger; Weapon.TriggerPulled = SecondTriggerPulledAngle; } } } } public class BreakActionPullableLatch : FVRInteractiveObject { public enum BoltHandlePos { Forward, Middle, Rear } [Header("ChargingHandle")] public bool EjectsOnOpen = true; public bool HasLatchButton = true; public BreakActionWeapon Weapon; public bool IsCartridgeEjector = true; public Transform Point_Fore; public Transform Point_Rear; public float ForwardSpeed = 1f; private float m_boltZ_forward; private float m_boltZ_rear; private float m_currentHandleZ; public BoltHandlePos CurPos; public BoltHandlePos LastPos; [Header("Rotating Bit")] public bool HasRotatingPart; public Transform RotatingPart; public Vector3 RotatingPartNeutralEulers; public Vector3 RotatingPartLeftEulers; public Vector3 RotatingPartRightEulers; 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) ((FVRInteractiveObject)this).Awake(); m_boltZ_forward = Point_Fore.localPosition.z; m_boltZ_rear = Point_Rear.localPosition.z; m_currentHandleZ = ((Component)this).transform.localPosition.z; Weapon.SetEjectOnOpen(EjectsOnOpen); Weapon.SetHasLatchButton(HasLatchButton); } public override void UpdateInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Fore.position, Point_Rear.position, ((HandInput)(ref base.m_hand.Input)).Pos); ((Component)this).transform.position = closestValidPoint; m_currentHandleZ = ((Component)this).transform.localPosition.z; float num = Mathf.InverseLerp(m_boltZ_forward, m_boltZ_rear, m_currentHandleZ); 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; } } } 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; } ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRUpdate() { //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Invalid comparison between Unknown and I4 //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (!((FVRInteractiveObject)this).IsHeld && Mathf.Abs(m_currentHandleZ - m_boltZ_forward) > 0.001f) { m_currentHandleZ = Mathf.MoveTowards(m_currentHandleZ, m_boltZ_forward, Time.deltaTime * ForwardSpeed); ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_currentHandleZ); } if (Mathf.Abs(m_currentHandleZ - m_boltZ_forward) < 0.005f) { CurPos = (BoltHandlePos)0; } else if (Mathf.Abs(m_currentHandleZ - m_boltZ_rear) < 0.005f) { CurPos = (BoltHandlePos)2; } else { CurPos = (BoltHandlePos)1; } if ((int)CurPos == 0 && (int)LastPos != 0) { if (IsCartridgeEjector && (Object)(object)Weapon != (Object)null) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)11, 1f); } if (!IsCartridgeEjector && (Object)(object)Weapon != (Object)null) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)31, 1f); } } else if ((int)CurPos == 2 && (int)LastPos != 2) { if (IsCartridgeEjector && (Object)(object)Weapon != (Object)null) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)10, 1f); } if (!IsCartridgeEjector && (Object)(object)Weapon != (Object)null) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)30, 1f); } if (IsCartridgeEjector && !Weapon.IsLatched) { Weapon.PopOutRound(Weapon.Barrels[0].Chamber); } } if (!IsCartridgeEjector) { if ((int)CurPos == 0) { Weapon.SetIsExternallyUnlatched(false); } else { Weapon.SetIsExternallyUnlatched(true); } } LastPos = CurPos; } } public class BreakActionSpeedloaderInsertTrigger : MonoBehaviour { public BreakActionWeapon Weapon; } public class BreakActionSpeedloaderTrigger : MonoBehaviour { public FVRFireArmMagazine Loader; private void OnTriggerEnter(Collider collider) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: 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_010d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Loader != (Object)null) || !((Object)(object)Loader.FireArm == (Object)null) || !((Object)(object)((FVRPhysicalObject)Loader).QuickbeltSlot == (Object)null) || !((Object)(object)((Component)collider).gameObject.GetComponent() != (Object)null)) { return; } BreakActionSpeedloaderInsertTrigger component = ((Component)collider).gameObject.GetComponent(); BreakActionWeapon weapon = component.Weapon; if (((FVRFireArm)weapon).RoundType != Loader.RoundType || weapon.m_isLatched) { return; } for (int i = 0; i < weapon.Barrels.Length; i++) { if (Loader.HasARound() && !weapon.Barrels[i].Chamber.IsFull) { FVRLoadedRound val = Loader.RemoveRound(0); Transform transform = Loader.DisplayBullets[Mathf.Clamp(0, Loader.DisplayBullets.Length - 1, i)].transform; weapon.Barrels[i].Chamber.Autochamber(val.LR_Class, transform.position, transform.rotation); ((FVRFireArm)weapon).PlayAudioEvent((FirearmAudioEventType)20, 1f); } } } } public class BreakActionToggleChokeForend : MonoBehaviour { public BreakActionWeapon Gun; public FVRAlternateGrip Grip; public float ChokeMod = 0.5f; private bool IsActive = false; public GameObject ActiveIndicator; public GameObject InactiveIndicator; public FVRFireArmChamber[] Chambers; public float BaseSpread; public AudioEvent ChokeEnableClip; public AudioEvent ChokeDisableClip; 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)Grip).m_hand; if ((Object)(object)hand == (Object)null) { return; } if ((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)) { SwapState(); } if (IsActive) { FVRFireArmChamber[] chambers = Chambers; foreach (FVRFireArmChamber val in chambers) { FVRFireArmRound round = val.m_round; if ((Object)(object)round != (Object)null && round.ProjectileSpread == BaseSpread) { round.ProjectileSpread = BaseSpread * ChokeMod; } } } if (IsActive) { return; } FVRFireArmChamber[] chambers2 = Chambers; foreach (FVRFireArmChamber val2 in chambers2) { FVRFireArmRound round2 = val2.m_round; if ((Object)(object)round2 != (Object)null && round2.ProjectileSpread != BaseSpread) { round2.ProjectileSpread = BaseSpread; } } } private void SwapState() { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) IsActive = !IsActive; if (IsActive) { ActiveIndicator.SetActive(true); InactiveIndicator.SetActive(false); ((FVRFireArm)Gun).PlayAudioAsHandling(ChokeEnableClip, ((Component)this).transform.position); } if (!IsActive) { ActiveIndicator.SetActive(false); InactiveIndicator.SetActive(true); ((FVRFireArm)Gun).PlayAudioAsHandling(ChokeDisableClip, ((Component)this).transform.position); } } } public class CSGCapTrigger : FVRInteractiveObject { public CappedStickyGrenade Grenade; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); if (!Grenade.m_isArmed) { Grenade.Arm(); } } } public class CSGDestroyNotifier : MonoBehaviour { public delegate void DestroyedAction(); public event DestroyedAction OnDestroyed; private void OnDestroy() { if (this.OnDestroyed != null) { this.OnDestroyed(); } } } public class CannonScrew : FVRInteractiveObject { private Vector3 lastHandRight = Vector3.zero; private float m_curRot; [Header("Gun Link")] public Transform ObjectToRotate; public bool IsXAxisRot = false; public bool IsYAxisRot = false; public Vector2 MinMaxAngles; [Header("Screw Motion")] public bool DoesScrewMove = true; public Vector2 ScrewMinMaxRot; public Transform TopPoint; public Transform BottomPoint; public override void Awake() { //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).Awake(); float num = Mathf.Lerp(TopPoint.localPosition.y, BottomPoint.localPosition.y, ((Component)this).transform.localPosition.y); m_curRot = Mathf.InverseLerp(ScrewMinMaxRot.y, ScrewMinMaxRot.x, num); } public override void BeginInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); lastHandRight = Vector3.ProjectOnPlane(hand.Input.FilteredRight, ((Component)this).transform.up); } public override void UpdateInteraction(FVRViveHand hand) { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_0109: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0147: 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_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_0186: 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_01bb: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); if (!((FVRInteractiveObject)this).IsHeld) { return; } Vector3 val = Vector3.ProjectOnPlane(hand.Input.FilteredRight, ((Component)this).transform.up); Vector3 val2 = Vector3.ProjectOnPlane(lastHandRight, ((Component)this).transform.up); float num = Mathf.Atan2(Vector3.Dot(((Component)this).transform.up, Vector3.Cross(val, val2)), Vector3.Dot(val, val2)) * 57.29578f; m_curRot -= num; m_curRot = Mathf.Clamp(m_curRot, ScrewMinMaxRot.x, ScrewMinMaxRot.y); Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; localEulerAngles.y = m_curRot; ((Component)this).transform.localEulerAngles = localEulerAngles; float num2 = Mathf.InverseLerp(ScrewMinMaxRot.x, ScrewMinMaxRot.y, m_curRot); if (DoesScrewMove) { Vector3 localPosition = ((Component)this).transform.localPosition; localPosition.y = Mathf.Lerp(BottomPoint.localPosition.y, TopPoint.localPosition.y, num2); ((Component)this).transform.localPosition = localPosition; } float num3 = Mathf.Lerp(MinMaxAngles.x, MinMaxAngles.y, num2); if ((Object)(object)ObjectToRotate != (Object)null) { Vector3 localEulerAngles2 = ObjectToRotate.localEulerAngles; if (IsXAxisRot) { localEulerAngles2.x = num3; } if (IsYAxisRot) { localEulerAngles2.y = num3; } ObjectToRotate.localEulerAngles = localEulerAngles2; } lastHandRight = val; } } public class CannonScrewHorizontal : FVRInteractiveObject { private Vector3 lastHandRight; private float m_wheelRot; private float m_traverseRot; [Header("Gun Traverse")] public Transform ObjectToRotate; public float TraverseMultiplier = 0.5f; public bool ClampTraverse = false; public Vector2 TraverseLimits = new Vector2(-45f, 45f); public override void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).Awake(); lastHandRight = Vector3.zero; } public override void BeginInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); lastHandRight = Vector3.ProjectOnPlane(hand.Input.FilteredRight, ((Component)this).transform.right); } public override void UpdateInteraction(FVRViveHand hand) { //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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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_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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_016d: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); if (((FVRInteractiveObject)this).IsHeld) { Vector3 val = Vector3.ProjectOnPlane(hand.Input.FilteredRight, ((Component)this).transform.right); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.ProjectOnPlane(lastHandRight, ((Component)this).transform.right); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; float num = Mathf.Atan2(Vector3.Dot(((Component)this).transform.right, Vector3.Cross(normalized2, normalized)), Vector3.Dot(normalized2, normalized)) * 57.29578f; num = Mathf.Clamp(num, -15f, 15f); m_wheelRot += num; m_wheelRot = Mathf.Repeat(m_wheelRot, 360f); Vector3 localEulerAngles = ((Component)this).transform.localEulerAngles; localEulerAngles.x = m_wheelRot; ((Component)this).transform.localEulerAngles = localEulerAngles; float num2 = num * TraverseMultiplier; m_traverseRot += num2; if (ClampTraverse) { m_traverseRot = Mathf.Clamp(m_traverseRot, TraverseLimits.x, TraverseLimits.y); } if ((Object)(object)ObjectToRotate != (Object)null) { Vector3 localEulerAngles2 = ObjectToRotate.localEulerAngles; localEulerAngles2.y = m_traverseRot; ObjectToRotate.localEulerAngles = localEulerAngles2; } lastHandRight = normalized; } } } public class CannonballParticles : MonoBehaviour { public ParticleSystem PFX; public CannonBall Cannonball; private void Update() { if (!Cannonball.m_isMoving && PFX.isPlaying) { PFX.Stop(); } } } public class CannonballSecondaryRenderer : MonoBehaviour { public Renderer Rend; public CannonBall Cannonball; private void Update() { if (Cannonball.TurnsOffRends && !Cannonball.hasTurnedOffRends) { Rend.enabled = false; } } } public class CappedStickyGrenade : FVRPhysicalObject { [Serializable] public class CSGDetonationStage { public bool HasFired = false; public float FireWhenFuseHits = 0f; public GameObject[] PrefabToSpawn; } [Header("Grenade Settings")] public Rigidbody grenadeRigidbody; public bool m_isArmed = false; public float FuseTime = 0f; public List SpawnOnSplode; public AudioEvent ArmedSound; public int IFF; private float m_fuseTime = 0f; private bool m_hasSploded = false; public bool UsesStagedDetonation = false; public CSGDetonationStage[] DetonationStages; [Header("Cap Settings")] public bool UsesCapSystem = false; public GameObject DummyCap; public GameObject CapPrefab; public Transform CapPrefabSpawnPos; [Header("Sticky Grenade Settings")] public bool isStickyGrenade = true; public Collider stickyCollider; public float stickingDistance = 0.1f; public LayerMask stickyLayers; public float embeddingDistance = 0.02f; public bool playStickSoundForRigidbodiesOnly = true; public AudioEvent stickSounds; public float minimumStickVelocity = 2f; public float regrabActivationDelay = 0.5f; public float massWhileStuck = 10f; private bool wasHeld = false; private bool armChecked = false; private bool shouldCheckVelocity = false; private bool hasReleasedLever = false; private bool isSticking = false; private bool canStick = false; private float timeSinceRelease = 0f; private GameObject parentObject; private Vector3 savedPosition; private Quaternion savedRotation; private Vector3 savedScale; private FVRInteractiveObject interactiveObject; private bool isCookingCoroutineRunning = false; [Header("Extra Settings")] public bool UsesArmedPfx = false; public ParticleSystem[] Pfx; public float ActivateParticlesWhenFuseHits = 3f; private bool HasActivatedParticles = false; public bool PlaysAnimationOnArm = false; public Animator Animator; public string ArmingAnimationNode = "animation"; public bool PlaysSoundWhileArmed = false; public AudioSource ArmedSounds; public float ActivateSoundsWhenFuseHits = 0f; private bool HasPlayedArmedSounds = false; private void Start() { interactiveObject = ((Component)this).GetComponent(); if (UsesArmedPfx) { ParticleSystem[] pfx = Pfx; foreach (ParticleSystem val in pfx) { if (val.isPlaying) { val.Stop(); } } } if (PlaysSoundWhileArmed && ArmedSounds.isPlaying) { ArmedSounds.Stop(); } } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); IFF = GM.CurrentPlayerBody.GetPlayerIFF(); } public override void FVRUpdate() { //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_045e: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (!armChecked && m_isArmed) { armChecked = true; shouldCheckVelocity = true; if (isStickyGrenade) { EnableStickyCollider(); } } if (!wasHeld && ((FVRInteractiveObject)this).IsHeld) { timeSinceRelease = 0f; if (m_isArmed) { EnableStickyCollider(); } shouldCheckVelocity = m_isArmed; wasHeld = true; canStick = true; isSticking = false; FixedJoint component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; Debug.Log((object)"FixedJoint grenade unstuck upon being picked up."); } else if ((Object)(object)((Component)this).transform.parent != (Object)null && ((Object)((Component)((Component)this).transform.parent).gameObject).name == "DummyParent") { GameObject gameObject = ((Component)((Component)this).transform.parent).gameObject; ((Component)this).transform.SetParent((Transform)null, true); Object.Destroy((Object)(object)gameObject); grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; Debug.Log((object)"Static-stuck grenade unstuck upon being picked up."); } if (isStickyGrenade) { DisableStickyColliderTemporarily(); } } if (wasHeld && !((FVRInteractiveObject)this).IsHeld) { isSticking = false; wasHeld = false; } if (m_isArmed || !((FVRInteractiveObject)this).IsHeld) { DisableMeleeDamage((FVRPhysicalObject)(object)this); } else { EnableMeleeDamage((FVRPhysicalObject)(object)this); } if (!m_isArmed) { return; } m_fuseTime -= Time.deltaTime; if (m_fuseTime < ActivateParticlesWhenFuseHits && !HasActivatedParticles) { HasActivatedParticles = true; ParticleSystem[] pfx = Pfx; foreach (ParticleSystem val in pfx) { val.Play(); } } if (m_fuseTime < ActivateSoundsWhenFuseHits && !HasPlayedArmedSounds) { HasPlayedArmedSounds = true; ArmedSounds.Play(); } if (m_fuseTime <= 0.05f) { if (!m_hasSploded) { m_hasSploded = true; ParticleSystem[] pfx2 = Pfx; foreach (ParticleSystem val2 in pfx2) { if (val2.isPlaying) { val2.Stop(); } } for (int k = 0; k < SpawnOnSplode.Count; k++) { GameObject val3 = Object.Instantiate(SpawnOnSplode[k], ((Component)this).transform.position, Quaternion.identity); Explosion component2 = val3.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } ExplosionSound component3 = val3.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.IFF = IFF; } GrenadeExplosion component4 = val3.GetComponent(); if ((Object)(object)component4 != (Object)null) { component4.IFF = IFF; } } } else { if (((FVRInteractiveObject)this).IsHeld) { FVRViveHand hand = ((FVRInteractiveObject)this).m_hand; ((FVRInteractiveObject)this).m_hand.ForceSetInteractable((FVRInteractiveObject)null); ((FVRInteractiveObject)this).EndInteraction(hand); } Object.Destroy((Object)(object)((Component)this).gameObject); } } if (!UsesStagedDetonation) { return; } CSGDetonationStage[] detonationStages = DetonationStages; foreach (CSGDetonationStage cSGDetonationStage in detonationStages) { if (!cSGDetonationStage.HasFired && m_fuseTime <= cSGDetonationStage.FireWhenFuseHits) { cSGDetonationStage.HasFired = true; GameObject[] prefabToSpawn = cSGDetonationStage.PrefabToSpawn; foreach (GameObject val4 in prefabToSpawn) { Object.Instantiate(val4, ((Component)this).transform.position, ((Component)this).transform.rotation); } } } } public override void FVRFixedUpdate() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRFixedUpdate(); if (shouldCheckVelocity && ((FVRInteractiveObject)this).IsHeld) { Vector3 velocity = grenadeRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude >= minimumStickVelocity) { canStick = true; } else { canStick = false; } } } private void DisableMeleeDamage(FVRPhysicalObject physicalObject) { if (physicalObject.MP != null && physicalObject.MP.IsMeleeWeapon) { physicalObject.MP.IsMeleeWeapon = false; } } private void EnableMeleeDamage(FVRPhysicalObject physicalObject) { if (physicalObject.MP != null && !physicalObject.MP.IsMeleeWeapon) { physicalObject.MP.IsMeleeWeapon = true; } } private void OnCollisionEnter(Collision collision) { //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) if (!m_isArmed || isSticking || !isStickyGrenade || !((Object)(object)stickyCollider != (Object)null) || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null) { return; } ContactPoint[] contacts = collision.contacts; for (int i = 0; i < contacts.Length; i++) { ContactPoint contact = contacts[i]; if (!((Object)(object)((ContactPoint)(ref contact)).thisCollider == (Object)(object)stickyCollider)) { continue; } if ((LayerMask.op_Implicit(stickyLayers) & (1 << collision.gameObject.layer)) == 0 || !IsContactPointWithinStickingDistance(((ContactPoint)(ref contact)).point)) { break; } isSticking = true; StickToSurface(collision, contact); PlayStickingSound(collision); parentObject = collision.gameObject; if ((Object)(object)parentObject != (Object)null) { CSGDestroyNotifier cSGDestroyNotifier = parentObject.GetComponent(); if ((Object)(object)cSGDestroyNotifier == (Object)null) { cSGDestroyNotifier = parentObject.AddComponent(); } cSGDestroyNotifier.OnDestroyed += OnDestroyUnstickGrenade; } break; } } private bool IsContactPointWithinStickingDistance(Vector3 contactPoint) { //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_000d: 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_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = stickyCollider.ClosestPoint(contactPoint); float num = Vector3.Distance(contactPoint, val); return num < stickingDistance; } private void StickToSurface(Collision collision, ContactPoint contact) { //IL_0048: 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_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_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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) //IL_0088: 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_014f: Expected O, but got Unknown //IL_0158: 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_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: 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_022e: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)stickyCollider == (Object)null) { return; } if ((Object)(object)interactiveObject != (Object)null && interactiveObject.IsHeld) { interactiveObject.ForceBreakInteraction(); } savedPosition = ((Component)this).transform.position; savedRotation = ((Component)this).transform.rotation; Vector3 lossyScale = ((Component)this).transform.lossyScale; Rigidbody rigidbody = collision.rigidbody; Vector3 val = ((ContactPoint)(ref contact)).normal * embeddingDistance; if ((Object)(object)rigidbody != (Object)null) { ((Component)this).transform.position = ((ContactPoint)(ref contact)).point + val; FixedJoint component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } FixedJoint val2 = ((Component)this).gameObject.AddComponent(); ((Joint)val2).connectedBody = rigidbody; ((Joint)val2).breakForce = float.MaxValue; ((Joint)val2).breakTorque = float.MaxValue; grenadeRigidbody.useGravity = false; grenadeRigidbody.isKinematic = false; grenadeRigidbody.constraints = (RigidbodyConstraints)0; grenadeRigidbody.mass = massWhileStuck; SetCollidersToLayer(stickyCollider, "NoCol"); } else { GameObject val3 = new GameObject("DummyParent"); val3.transform.position = ((ContactPoint)(ref contact)).point; val3.transform.rotation = collision.transform.rotation; grenadeRigidbody.isKinematic = true; val3.transform.SetParent(collision.transform, true); ((Component)this).transform.SetParent(val3.transform, false); ((Component)this).transform.localScale = new Vector3(lossyScale.x / ((Component)this).transform.lossyScale.x, lossyScale.y / ((Component)this).transform.lossyScale.y, lossyScale.z / ((Component)this).transform.lossyScale.z); ((Component)this).transform.position = ((ContactPoint)(ref contact)).point + val; ((Component)this).transform.rotation = savedRotation; } } private void EnableStickyCollider() { if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = true; } } private void DisableStickyColliderTemporarily() { if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = false; } ((MonoBehaviour)this).StartCoroutine(ReenableStickyColliderAfterDelay()); } private IEnumerator ReenableStickyColliderAfterDelay() { yield return (object)new WaitForSeconds(regrabActivationDelay); EnableStickyCollider(); } private void PlayStickingSound(Collision collision) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) if ((playStickSoundForRigidbodiesOnly && (Object)(object)collision.rigidbody != (Object)null) || !playStickSoundForRigidbodiesOnly) { SM.PlayCoreSound((FVRPooledAudioType)10, stickSounds, ((Component)this).transform.position); } } private void OnDestroyUnstickGrenade() { if ((Object)(object)this == (Object)null) { return; } if ((Object)(object)parentObject != (Object)null) { CSGDestroyNotifier component = parentObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.OnDestroyed -= OnDestroyUnstickGrenade; } parentObject = null; } FixedJoint component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); } else if ((Object)(object)((Component)this).transform.parent != (Object)null) { ((Component)this).transform.SetParent((Transform)null); } if ((Object)(object)grenadeRigidbody != (Object)null) { grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; } isSticking = false; if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = false; } canStick = false; } private void SetCollidersToLayer(Collider collider, string layer) { ((Component)collider).gameObject.layer = LayerMask.NameToLayer(layer); } private void OnDestroy() { if ((Object)(object)parentObject != (Object)null) { CSGDestroyNotifier component = parentObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.OnDestroyed -= OnDestroyUnstickGrenade; } } } public void Arm() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (!m_isArmed) { m_isArmed = true; m_fuseTime = FuseTime; SM.PlayCoreSound((FVRPooledAudioType)10, ArmedSound, ((Component)this).transform.position); if (PlaysAnimationOnArm) { Animator.Play(ArmingAnimationNode); } if (UsesCapSystem) { DummyCap.SetActive(false); Object.Instantiate(CapPrefab, CapPrefabSpawnPos.position, CapPrefabSpawnPos.rotation); } } } } public class ChainsawLodgeIntoEnemies : MonoBehaviour { public Chainsaw Saw; public Vector3 LodgeReqOffIdleRev; private void Update() { if (Saw.m_isRunning) { if ((Object)(object)((FVRInteractiveObject)Saw).m_hand != (Object)null && ((FVRInteractiveObject)Saw).m_hand.Input.TriggerFloat >= 0.1f) { ((FVRPhysicalObject)Saw).MP.LodgeVelocityRequirement = LodgeReqOffIdleRev.z; } else { ((FVRPhysicalObject)Saw).MP.LodgeVelocityRequirement = LodgeReqOffIdleRev.y; } } else { ((FVRPhysicalObject)Saw).MP.LodgeVelocityRequirement = LodgeReqOffIdleRev.x; } } } public class ChainsawMovementItem : MonoBehaviour { public FVRAlternateGrip Grip; public Chainsaw Saw; public Transform Vector; public float JumpMagnitude = 1f; private bool IsInMoveMode = false; private void Start() { } private void Update() { //IL_00c4: 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) FVRViveHand hand = ((FVRInteractiveObject)Grip).m_hand; if (!((Object)(object)hand == (Object)null) && ((hand.IsInStreamlinedMode && hand.Input.AXButtonPressed) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadPressed && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.down) <= 45f)) && (Object)(object)Saw.SawAudio.clip == (Object)(object)Saw.AudClip_Hitting) { GM.CurrentMovementManager.Blast(((Component)Vector).transform.forward, JumpMagnitude, false); } } } 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 ChamberShellInsertEject : FVRInteractiveObject { public enum ChamberSlideState { In, Middle, Out } public FVRFireArmChamber Chamber; public bool IsCaseless = false; 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 ChamberSlideState CSState = (ChamberSlideState)2; private float m_curZ; private float m_tarZ; public float ZThreshold = 0.02f; private float m_timeHeld; private BreakActionWeapon BOWeapon; private bool BOWeaponHingeOpen = false; public void OnDestroy() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((FVRInteractiveObject)this).OnDestroy(); GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)firearm == (Object)(object)Chamber.Firearm && IsCaseless) { ((Component)Chamber).transform.localPosition = new Vector3(((Component)Chamber).transform.localPosition.x, ((Component)Chamber).transform.localPosition.y, ChamberPoint_Back.localPosition.z); m_curZ = ChamberPoint_Back.localPosition.z; m_tarZ = m_curZ; CSState = (ChamberSlideState)2; } } 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown ((FVRInteractiveObject)this).Awake(); m_curZ = ChamberPoint_Back.localPosition.z; m_tarZ = m_curZ; GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); ref BreakActionWeapon bOWeapon = ref BOWeapon; FVRFireArm firearm = Chamber.Firearm; bOWeapon = (BreakActionWeapon)(object)((firearm is BreakActionWeapon) ? firearm : null); } public override bool IsInteractable() { return Chamber.IsFull && (BOWeaponHingeOpen || (Object)(object)BOWeapon == (Object)null); } public override void UpdateInteraction(FVRViveHand hand) { //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_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); float tarZ = Mathf.Clamp(((Component)Chamber.Firearm).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 references) ((FVRInteractiveObject)this).EndInteraction(hand); float num = Mathf.Abs(m_curZ - ChamberPoint_Back.localPosition.z); float num2 = Mathf.Abs(m_curZ - ChamberPoint_Forward.localPosition.z); if (num < ZThreshold * 2f) { m_tarZ = ChamberPoint_Back.localPosition.z; } else if (num2 < ZThreshold * 2f) { m_tarZ = ChamberPoint_Forward.localPosition.z; } } public override void BeginInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).BeginInteraction(hand); m_timeHeld = 0f; } public override void FVRUpdate() { //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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_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_0132: Invalid comparison between Unknown and I4 //IL_01ce: 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_013a: Invalid comparison between Unknown and I4 //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Invalid comparison between Unknown and I4 //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Invalid comparison between Unknown and I4 //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: 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) //IL_0241: Invalid comparison between Unknown and I4 //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); m_timeHeld += Time.deltaTime; if (!(Mathf.Abs(m_curZ - m_tarZ) > 0.001f)) { return; } m_curZ = Mathf.MoveTowards(m_curZ, m_tarZ, Time.deltaTime * 1f); ((Component)Chamber).transform.localPosition = new Vector3(((Component)Chamber).transform.localPosition.x, ((Component)Chamber).transform.localPosition.y, m_curZ); float num = Mathf.Abs(m_curZ - ChamberPoint_Back.localPosition.z); float num2 = Mathf.Abs(m_curZ - ChamberPoint_Forward.localPosition.z); ChamberSlideState cSState = CSState; if (num < ZThreshold) { CSState = (ChamberSlideState)2; } else if (num2 < ZThreshold) { CSState = (ChamberSlideState)0; } else { CSState = (ChamberSlideState)1; } if ((int)CSState == 2 && (int)cSState != 2) { SM.PlayGenericSound(AudEvent_ShellOut, ((Component)this).transform.position); if (m_timeHeld > 0.2f) { FVRFireArmRound val = Chamber.EjectRound(((Component)ChamberPoint_Back).transform.position, ChamberPoint_Back.forward * 0.1f, Vector3.zero, false); if (((FVRInteractiveObject)this).IsHeld) { FVRViveHand hand = base.m_hand; hand.ForceSetInteractable((FVRInteractiveObject)(object)val); ((FVRInteractiveObject)val).BeginInteraction(hand); } } } else if ((int)CSState == 0 && (int)cSState != 0) { SM.PlayGenericSound(AudEvent_ShellIn, ((Component)this).transform.position); ((FVRInteractiveObject)this).ForceBreakInteraction(); } else if ((int)CSState == 1 && (int)cSState == 0) { SM.PlayGenericSound(AudEvent_ShellOutStart, ((Component)this).transform.position); } else if ((int)CSState == 1 && (int)cSState == 2) { SM.PlayGenericSound(AudEvent_ShellInStart, ((Component)this).transform.position); } if ((Object)(object)BOWeapon != (Object)null) { if (!BOWeapon.m_isLatched) { BOWeaponHingeOpen = true; } else { BOWeaponHingeOpen = false; } } } } 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 ClosedBoltFiremodeLauncher : MonoBehaviour { public ClosedBoltWeapon Gun; public FVRFireArmChamber Chamber; public Transform MuzzlePoint; public ParticleSystem PSys; public AudioEvent FireSound; public void Update() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) if (Gun.IsWeaponOnSafe() && Chamber.IsFull && (Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null && Gun.m_triggerFloat >= Gun.TriggerFiringThreshold) { Chamber.Fire(); ((FVRFireArm)Gun).Fire(Chamber, MuzzlePoint, true, 1f, -1f); PSys.Emit(1); bool flag = ((FVRFireArm)Gun).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)Gun).IsForegripStabilized(); bool flag3 = ((FVRFireArm)Gun).IsShoulderStabilized(); ((FVRFireArm)Gun).PlayAudioAsHandling(FireSound, MuzzlePoint.localPosition); Chamber.SetRound((FVRFireArmRound)null, false); } } } public class ClosedBoltMagReleaseSelector : MonoBehaviour { public ClosedBoltWeapon Gun; public Vector3 MagReleaseUnpress_Safe; public Vector3 MagReleaseUnpress_NotSafe; private void Update() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((int)Gun.FireSelector_Modes[Gun.m_fireSelectorMode].ModeType == 0) { Gun.MagReleaseUnpressed = MagReleaseUnpress_Safe; } else { Gun.MagReleaseUnpressed = MagReleaseUnpress_NotSafe; } } } 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 ClosedBoltPullcord : FVRInteractiveObject { public ClosedBoltWeapon Gun; public Transform BasePoint; [Header("Pull Settings")] public float MaxPullDistance = 1.2f; public float PullThreshold = 0.08f; public float MinPullDistance = 0.3f; public AudioEvent RipSound; private float m_lastLength = 0f; private bool m_hasFiredThisPull = false; public AudioSource IdleSource; public ParticleSystem EngineSmoke; private bool Jiggling = false; public void Start() { if (IdleSource.isPlaying) { IdleSource.Stop(); } if (EngineSmoke.isPlaying) { EngineSmoke.Stop(); } } public void Update() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) bool flag = true; if (!Gun.Chamber.IsFull && (int)Gun.Bolt.CurPos == 0) { flag = false; } if (flag) { if (!IdleSource.isPlaying) { IdleSource.Play(); } if (!EngineSmoke.isPlaying) { EngineSmoke.Play(); } Jiggling = true; } else { EngineSmoke.Stop(); IdleSource.Stop(); Jiggling = false; } } public override void BeginInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); Vector3 val = ((HandInput)(ref hand.Input)).Pos - BasePoint.position; m_lastLength = Mathf.Clamp(((Vector3)(ref val)).magnitude, 0f, MaxPullDistance); m_hasFiredThisPull = false; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 val = ((HandInput)(ref hand.Input)).Pos - BasePoint.position; float num = Mathf.Clamp(((Vector3)(ref val)).magnitude, 0f, MaxPullDistance); Vector3 position = BasePoint.position + ((Vector3)(ref val)).normalized * num; ((Component)this).transform.position = position; ((Component)this).transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up); float num2 = num - m_lastLength; if (!m_hasFiredThisPull && num > MinPullDistance && num2 > PullThreshold) { TryCycleBolt(); m_hasFiredThisPull = true; } m_lastLength = num; } public override void FVRFixedUpdate() { //IL_0025: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRFixedUpdate(); if (Jiggling) { float num = 0.2f; Rigidbody rootRigidbody = ((FVRPhysicalObject)Gun).RootRigidbody; rootRigidbody.velocity += Random.onUnitSphere * num; Rigidbody rootRigidbody2 = ((FVRPhysicalObject)Gun).RootRigidbody; rootRigidbody2.angularVelocity += Random.onUnitSphere * num; } } public override void EndInteraction(FVRViveHand hand) { //IL_0026: 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) ((FVRInteractiveObject)this).EndInteraction(hand); m_hasFiredThisPull = false; m_lastLength = 0f; ((Component)this).transform.position = BasePoint.position; ((Component)this).transform.rotation = BasePoint.rotation; } private void TryCycleBolt() { //IL_0038: 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) if (!((Object)(object)Gun == (Object)null) && !((Object)(object)Gun.Bolt == (Object)null) && (int)Gun.Bolt.CurPos == 0) { Gun.Bolt.ImpartFiringImpulse(); if (RipSound != null) { ((FVRFireArm)Gun).PlayAudioAsHandling(RipSound, ((Component)this).transform.position); } } } } public class ClosedBoltRingTrigger : MonoBehaviour { public ClosedBoltWeapon Gun; public Transform RingTrigger; public Vector2 TriggerPulledUnpulled; private bool IsResettingFromCock = false; private bool ResettingFromFire = false; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)Gun) { ResettingFromFire = true; } } private void Update() { //IL_00ed: 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_01c1: 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) if (!((Object)(object)Gun == (Object)null) && !((Object)(object)((FVRInteractiveObject)Gun).m_hand == (Object)null) && !((FVRPhysicalObject)Gun).IsAltHeld) { float num = Mathf.Lerp(TriggerPulledUnpulled.y, TriggerPulledUnpulled.x, ((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat); bool flag = ((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat > Gun.TriggerFiringThreshold; if (ResettingFromFire && Gun.m_hasTriggerReset) { ResettingFromFire = false; } if ((!Gun.m_isHammerCocked || IsResettingFromCock) && !ResettingFromFire) { RingTrigger.localEulerAngles = new Vector3(num, 0f, 0f); } if (((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat <= 0.1f) { RingTrigger.localEulerAngles = new Vector3(0f, 0f, 0f); } if (!Gun.m_isHammerCocked && !IsResettingFromCock && flag && !ResettingFromFire) { Gun.Bolt.SnapToRear(); IsResettingFromCock = true; Gun.FireSelector_Modes[0].ModeType = (FireSelectorModeType)0; } if (IsResettingFromCock && Gun.m_hasTriggerReset) { IsResettingFromCock = false; Gun.FireSelector_Modes[0].ModeType = (FireSelectorModeType)1; } } } } public class ClosedBoltSimpleClickSafety : FVRInteractiveObject { public ClosedBoltWeapon Gun; public bool IsSafetyOn = true; public Vector2 SafetyOnSafetyOff; public Transform Safety; public override void SimpleInteraction(FVRViveHand hand) { //IL_007d: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); IsSafetyOn = !IsSafetyOn; if (IsSafetyOn) { Safety.localEulerAngles = new Vector3(SafetyOnSafetyOff.x, 0f, 0f); Gun.FireSelector_Modes[0].ModeType = (FireSelectorModeType)0; } else { Safety.localEulerAngles = new Vector3(SafetyOnSafetyOff.y, 0f, 0f); Gun.FireSelector_Modes[0].ModeType = (FireSelectorModeType)1; } ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)15, 1f); } } public class Commando : FVRFireArm { [Serializable] public class CommandoMovingPart { public MovableObjectPart ObjectPart; public E_State DesiredState; } [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 bool UseEnableDisablePerChamberSystem = true; public GameObject[] EnableIfCorrespondingChamberIsSpent; public GameObject[] DisableIfCorrespondingChamberIsSpent; public bool CanFire = true; public Transform Trigger; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public Axis TriggerAxis; public InterpStyle TriggerInterpStyle = (InterpStyle)1; private float m_triggerFloat; [Header("Moving Parts Stuff")] public bool UsesMovingPartSystem = false; public bool AllMovingPartsReady = false; public CommandoMovingPart[] MovingParts; 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) { if (!CanFire) { return; } Fire(); } 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() { //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!CommandoChambers[CurrentChamber].IsFull || CommandoChambers[CurrentChamber].IsSpent) { return; } if (UsesMovingPartSystem) { AllMovingPartsReady = true; CommandoMovingPart[] movingParts = MovingParts; foreach (CommandoMovingPart commandoMovingPart in movingParts) { if (commandoMovingPart.ObjectPart.State != commandoMovingPart.DesiredState) { AllMovingPartsReady = false; } } if (!AllMovingPartsReady) { return; } } FVRFireArmChamber val = CommandoChambers[CurrentChamber]; val.Fire(); ((FVRFireArm)this).Fire(val, ((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(val.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if (AlsoPlaysSecondFireSound) { SM.PlayCoreSound((FVRPooledAudioType)0, SecondFireSound, ((Component)SecondFireSoundPosition).transform.position); } if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { val.IsSpent = false; val.UpdateProxyDisplay(); } else if (DeletesCartridgeOnFire) { val.SetRound((FVRFireArmRound)null, false); } if (UseEnableDisablePerChamberSystem) { EnableIfCorrespondingChamberIsSpent[CurrentChamber].SetActive(true); DisableIfCorrespondingChamberIsSpent[CurrentChamber].SetActive(false); } CurrentChamber++; if (CurrentChamber >= CommandoChambers.Length) { CurrentChamber = 0; } } public override List GetChamberRoundList() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (CommandoChambers[0].IsFull && !CommandoChambers[0].IsSpent) { List list = new List(); list.Add(CommandoChambers[0].GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List 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 CommandoSpeedloaderInsertTrigger : MonoBehaviour { public Commando Weapon; public SimpleHinge Hinge; } public class CommandoSpeedloaderTrigger : MonoBehaviour { public FVRFireArmMagazine Loader; private void OnTriggerEnter(Collider collider) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Invalid comparison between Unknown and I4 //IL_00fb: 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_0109: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Loader != (Object)null) || !((Object)(object)Loader.FireArm == (Object)null) || !((Object)(object)((FVRPhysicalObject)Loader).QuickbeltSlot == (Object)null) || !((Object)(object)((Component)collider).gameObject.GetComponent() != (Object)null)) { return; } CommandoSpeedloaderInsertTrigger component = ((Component)collider).gameObject.GetComponent(); Commando weapon = component.Weapon; if (((FVRFireArm)weapon).RoundType != Loader.RoundType || (int)component.Hinge.m_hingeState != 2) { return; } for (int i = 0; i < weapon.CommandoChambers.Length; i++) { if (Loader.HasARound() && !weapon.CommandoChambers[i].IsFull) { FVRLoadedRound val = Loader.RemoveRound(0); Transform transform = Loader.DisplayBullets[Mathf.Clamp(0, Loader.DisplayBullets.Length - 1, i)].transform; weapon.CommandoChambers[i].Autochamber(val.LR_Class, transform.position, transform.rotation); ((FVRFireArm)weapon).PlayAudioEvent((FirearmAudioEventType)20, 1f); } } } } public class DemonadeBouncySounds : MonoBehaviour, IFVRDamageable { private bool m_hasExploded; public Vector2 FuseTimeRange = new Vector2(2.3f, 2.3f); public float m_fuseTime = 2.3f; public bool ExplodesOnContact = true; public string ExplodeOnContactLayerName; public List SpawnOnExplode; public int IFF; public AudioEvent BouncySound; public bool ReduceFuseOnBounce = false; public float FuseReduction = 1f; private int BounceCount = 0; private void Start() { m_fuseTime = Random.Range(FuseTimeRange.x, FuseTimeRange.y); } private void Update() { m_fuseTime -= Time.deltaTime; if (m_fuseTime <= 0f) { Explode(); } } public void Damage(Damage d) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)d.Class != 2) { Explode(); } } public void Explode() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (m_hasExploded) { return; } m_hasExploded = true; for (int i = 0; i < SpawnOnExplode.Count; i++) { GameObject val = Object.Instantiate(SpawnOnExplode[i], ((Component)this).transform.position, Random.rotation); Explosion component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.IFF = IFF; } ExplosionSound component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } } Object.Destroy((Object)(object)((Component)this).gameObject); } private void OnCollisionEnter(Collision collision) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!ExplodesOnContact) { return; } if ((Object)(object)((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody == (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, BouncySound, ((Component)this).transform.position); if (ReduceFuseOnBounce) { m_fuseTime -= FuseReduction; BounceCount++; } } else { string text = LayerMask.LayerToName(((Component)((ContactPoint)(ref collision.contacts[0])).otherCollider).gameObject.layer); if (ExplodeOnContactLayerName == text) { Explode(); } } } } public class DemonadeProximityDetonate : MonoBehaviour { public MF2_Demonade Demonade; public DemonadeBouncySounds DemonadeBouncy; public float ActivationDelay = 1f; private float m_timetoDelay = 0f; private bool isArmed = false; private void Update() { if (m_timetoDelay < ActivationDelay) { m_timetoDelay += Time.deltaTime; } if (m_timetoDelay >= ActivationDelay) { isArmed = true; } } private void OnTriggerEnter(Collider other) { if (isArmed) { string text = LayerMask.LayerToName(((Component)other).gameObject.layer); if ((Object)(object)Demonade != (Object)null && Demonade.ExplodeOnContactLayerName == text) { Demonade.Explode(); } if ((Object)(object)DemonadeBouncy != (Object)null && DemonadeBouncy.ExplodeOnContactLayerName == text) { DemonadeBouncy.Explode(); } } } } public class DisableIfCurrentMagIsBeltBox : MonoBehaviour { public FVRFireArm Firearm; public GameObject GameObjectToDisable; private void Update() { GameObjectToDisable.SetActive(true); } } public class DoubleBarrelClosedBoltWeaponBoltRelease : FVRInteractiveObject { public DoubleBarreledClosedBoltWeapon Weapon; public override void Poke(FVRViveHand hand) { if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand == (Object)null || (Object)(object)hand != (Object)(object)((FVRInteractiveObject)Weapon).m_hand) { Weapon.Bolt.ReleaseBolt(); } } } public class DoubleBarrelClosedBoltWeaponChargingHandle : FVRInteractiveObject { public enum HandlePos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Bolt Handle")] public DoubleBarreledClosedBoltWeapon Weapon; public float Speed_Forward; public float Speed_Held; public float SpringStiffness = 100f; public HandlePos CurPos; public HandlePos LastPos; public Transform Point_Forward; public Transform Point_LockPoint; public Transform Point_Rear; public Transform Point_SafetyRotLimit; private float m_curSpeed; private float m_posZ_current; private float m_posZ_heldTarget; private float m_posZ_forward; private float m_posZ_lock; private float m_posZ_rear; private float m_posZ_safetyrotLimit; [Header("Safety Catch Config")] public bool UsesRotation = true; public float Rot_Standard; public float Rot_Safe; public float Rot_SlipDistance; public bool IsSlappable; public Transform SlapPoint; public float SlapDistance = 0.1f; private bool m_hasRotCatch; private float m_currentRot; [Header("Rotating Bit")] public bool HasRotatingPart; public Transform RotatingPart; public Vector3 RotatingPartNeutralEulers; public Vector3 RotatingPartLeftEulers; public Vector3 RotatingPartRightEulers; public bool StaysRotatedWhenBack; public bool UsesSoundOnGrab; private bool m_isHandleHeld; private float m_HandleLerp; private bool m_isAtLockAngle; 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_008f: 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) ((FVRInteractiveObject)this).Awake(); m_posZ_current = ((Component)this).transform.localPosition.z; m_posZ_forward = Point_Forward.localPosition.z; m_posZ_lock = Point_LockPoint.localPosition.z; m_posZ_rear = Point_Rear.localPosition.z; if ((Object)(object)Point_SafetyRotLimit != (Object)null && UsesRotation) { m_posZ_safetyrotLimit = Point_SafetyRotLimit.localPosition.z; m_hasRotCatch = true; m_currentRot = Rot_Standard; } } public float GetBoltLerpBetweenLockAndFore() { return Mathf.InverseLerp(m_posZ_lock, m_posZ_forward, m_posZ_current); } public float GetBoltLerpBetweenRearAndFore() { return Mathf.InverseLerp(m_posZ_rear, m_posZ_forward, m_posZ_current); } public bool ShouldControlBolt() { if (!UsesRotation) { return ((FVRInteractiveObject)this).IsHeld; } return ((FVRInteractiveObject)this).IsHeld || m_isAtLockAngle; } public override void BeginInteraction(FVRViveHand hand) { if (UsesSoundOnGrab) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)9, 1f); } ((FVRInteractiveObject)this).BeginInteraction(hand); } 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) ((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; } } } public override void EndInteraction(FVRViveHand hand) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (HasRotatingPart && !StaysRotatedWhenBack) { RotatingPart.localEulerAngles = RotatingPartNeutralEulers; } if (!Weapon.Bolt.IsBoltLocked()) { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)8, 1f); } ((FVRInteractiveObject)this).EndInteraction(hand); } public void UpdateHandle() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Invalid comparison between Unknown and I4 //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0218: 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_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: 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) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00f5: 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_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0482: Unknown result type (might be due to invalid IL or missing references) //IL_0491: Unknown result type (might be due to invalid IL or missing references) //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Expected I4, but got Unknown //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_0574: Expected I4, but got Unknown //IL_0574: Unknown result type (might be due to invalid IL or missing references) //IL_057a: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Invalid comparison between Unknown and I4 //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_054f: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Unknown result type (might be due to invalid IL or missing references) //IL_05bb: Invalid comparison between Unknown and I4 //IL_05a9: Unknown result type (might be due to invalid IL or missing references) //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Invalid comparison between Unknown and I4 //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c7: Invalid comparison between Unknown and I4 //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) //IL_05ed: Invalid comparison between Unknown and I4 //IL_05da: Unknown result type (might be due to invalid IL or missing references) //IL_05e0: Invalid comparison between Unknown and I4 //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Invalid comparison between Unknown and I4 //IL_05f3: Unknown result type (might be due to invalid IL or missing references) //IL_05f9: Invalid comparison between Unknown and I4 //IL_0623: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Invalid comparison between Unknown and I4 bool flag = false; if (((FVRInteractiveObject)this).IsHeld) { flag = true; } if (flag) { Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Forward.position, Point_Rear.position, ((HandInput)(ref base.m_hand.Input)).Pos); m_posZ_heldTarget = ((Component)Weapon).transform.InverseTransformPoint(closestValidPoint).z; } Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(m_posZ_rear, m_posZ_forward); if (m_hasRotCatch) { float num = m_currentRot; if (!((FVRInteractiveObject)this).IsHeld && IsSlappable && ((FVRInteractiveObject)Weapon).IsHeld && m_isAtLockAngle) { FVRViveHand otherHand = ((FVRInteractiveObject)Weapon).m_hand.OtherHand; float num2 = Vector3.Distance(SlapPoint.position, ((HandInput)(ref otherHand.Input)).Pos); float num3 = Vector3.Dot(SlapPoint.forward, ((Vector3)(ref otherHand.Input.VelLinearWorld)).normalized); if (num2 < SlapDistance && num3 > 0.3f) { float magnitude = ((Vector3)(ref otherHand.Input.VelLinearWorld)).magnitude; if (magnitude > 1f) { num = Rot_Standard; Weapon.Bolt.ReleaseBolt(); ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)13, 1f); if (HasRotatingPart) { RotatingPart.localEulerAngles = RotatingPartNeutralEulers; } } } } float num4 = Mathf.InverseLerp(Mathf.Min(Rot_Standard, Rot_Safe), Mathf.Max(Rot_Standard, Rot_Safe), num); if (!((FVRInteractiveObject)this).IsHeld) { num = ((!(num4 <= 0.5f)) ? Mathf.Max(Rot_Standard, Rot_Safe) : Mathf.Min(Rot_Standard, Rot_Safe)); } else if (m_posZ_current < m_posZ_safetyrotLimit) { Vector3 val2 = ((HandInput)(ref base.m_hand.Input)).Pos - ((Component)this).transform.position; Vector3 val3 = Vector3.ProjectOnPlane(val2, ((Component)this).transform.forward); val2 = ((Vector3)(ref val3)).normalized; Vector3 up = ((Component)Weapon).transform.up; num = Mathf.Atan2(Vector3.Dot(((Component)this).transform.forward, Vector3.Cross(up, val2)), Vector3.Dot(up, val2)) * 57.29578f; num = Mathf.Clamp(num, Mathf.Min(Rot_Standard, Rot_Safe), Mathf.Max(Rot_Standard, Rot_Safe)); } if (Mathf.Abs(num - Rot_Safe) < Rot_SlipDistance) { ((Vector2)(ref val))..ctor(m_posZ_rear, m_posZ_lock); m_isAtLockAngle = true; } else if (Mathf.Abs(num - Rot_Standard) < Rot_SlipDistance) { m_isAtLockAngle = false; } else { ((Vector2)(ref val))..ctor(m_posZ_rear, m_posZ_safetyrotLimit); m_isAtLockAngle = true; } if (Mathf.Abs(num - m_currentRot) > 0.1f) { ((Component)this).transform.localEulerAngles = new Vector3(0f, 0f, num); } m_currentRot = num; } if (flag) { m_curSpeed = 0f; } else if (m_curSpeed >= 0f || (int)CurPos > 0) { m_curSpeed = Mathf.MoveTowards(m_curSpeed, Speed_Forward, Time.deltaTime * SpringStiffness); } float posZ_current = m_posZ_current; float posZ_current2 = m_posZ_current; if (flag) { posZ_current2 = m_posZ_heldTarget; posZ_current = Mathf.MoveTowards(m_posZ_current, posZ_current2, Speed_Held * Time.deltaTime); } else { posZ_current = m_posZ_current + m_curSpeed * Time.deltaTime; } posZ_current = Mathf.Clamp(posZ_current, val.x, val.y); if (Mathf.Abs(posZ_current - m_posZ_current) > Mathf.Epsilon) { m_posZ_current = posZ_current; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_posZ_current); } else { m_curSpeed = 0f; } HandlePos curPos = CurPos; curPos = ((Mathf.Abs(m_posZ_current - m_posZ_forward) < 0.001f) ? ((HandlePos)0) : ((Mathf.Abs(m_posZ_current - m_posZ_lock) < 0.001f) ? ((HandlePos)2) : ((Mathf.Abs(m_posZ_current - m_posZ_rear) < 0.001f) ? ((HandlePos)4) : ((!(m_posZ_current > m_posZ_lock)) ? ((HandlePos)3) : ((HandlePos)1))))); int num5 = (int)CurPos; CurPos = (HandlePos)Mathf.Clamp((int)curPos, num5 - 1, num5 + 1); if ((int)CurPos == 0 && (int)LastPos != 0) { Event_ArriveAtFore(); } else if (((int)CurPos != 1 || (int)LastPos != 0) && ((int)CurPos != 2 || (int)LastPos != 1) && ((int)CurPos != 1 || (int)LastPos != 2)) { if ((int)CurPos == 2 && (int)LastPos == 3 && m_isAtLockAngle) { Event_HitLockPosition(); } else if ((int)CurPos == 4 && (int)LastPos != 4) { Event_SmackRear(); } } LastPos = CurPos; } private void Event_ArriveAtFore() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)11, 1f); if (HasRotatingPart) { RotatingPart.localEulerAngles = RotatingPartNeutralEulers; } } private void Event_HitLockPosition() { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)12, 1f); } private void Event_SmackRear() { ((FVRFireArm)Weapon).PlayAudioEvent((FirearmAudioEventType)10, 1f); } } public class DoubleBarrelLeverAction : FVRFireArm { public enum ZPos { Forward, Middle, Rear } [Serializable] public class LeverActuatedPiece { public Transform Piece; public Vector3 PosBack; public Vector3 PosForward; public InterpStyle InterpStyle; public ActuationType ActuationType; } public enum ActuationType { Lever, Hammer } [Header("LeverAction Config")] public FVRFireArmChamber Chamber; public bool UsesSecondChamber; public FVRFireArmChamber Chamber2; public Transform SecondEjectionSpot; public Transform SecondMuzzle; private bool m_isHammerCocked2; private bool m_isSecondaryMuzzlePos; public Transform Lever; public Transform LeverRoot; public Transform Hammer; public Transform LoadingGate; public Transform Trigger; public Vector2 TriggerRotRange; public FVRAlternateGrip ForeGrip; public Vector2 LeverAngleRange = new Vector2(-68f, 0f); public Vector2 HammerAngleRange = new Vector2(-36f, 0f); public Vector2 LoadingGateAngleRange = new Vector2(-24f, 0f); public Vector3 EjectionDir = new Vector3(0f, 2f, 0f); public Vector3 EjectionSpin = new Vector3(80f, 0f, 0f); private bool m_isLeverReleasePressed; private float m_curLeverRot; private float m_tarLeverRot; private float m_leverRotSpeed = 700f; private bool m_isActionMovingForward; private ZPos m_curLeverPos = (ZPos)2; private ZPos m_lastLeverPos = (ZPos)2; private FVRFirearmMovingProxyRound m_proxy; private FVRFirearmMovingProxyRound m_proxy2; [Header("Round Positions Config")] public Transform ReceiverLowerPathForward; public Transform ReceiverLowerPathRearward; public Transform ReceiverUpperPathForward; public Transform ReceiverUpperPathRearward; public Transform ReceiverEjectionPathForward; public Transform ReceiverEjectionPathRearward; public Transform ReceiverEjectionPoint; public bool GrabsRoundFromMagOnBoltForward; private bool m_isHammerCocked; [Header("Spinning Config")] public Transform PoseSpinHolder; public bool CanSpin; private bool m_isSpinning; public LeverActuatedPiece[] ActuatedPieces; private bool useLinearRacking = true; private float baseDistance = 1f; private float BaseAngleOffset; private bool m_wasLeverLocked; private Vector3 m_baseSpinPosition = Vector3.zero; private float curDistanceBetweenGrips = 1f; private float lastDistanceBetweenGrips = -1f; private float m_rackingDisplacement; private float xSpinRot; private float xSpinVel; [Header("Double Barrel Params")] public Transform MuzzleTwo; public Transform RLPF2; public Transform RLPR2; public Transform RUPF2; public Transform RUPR2; public Transform REPF2; public Transform REPR2; public Transform REP2; public Vector3 EjectionVector2; public bool IsHammerCocked => m_isHammerCocked; public override void Awake() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_00b1: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown ((FVRFireArm)this).Awake(); base.FChambers.Add(Chamber); if (UsesSecondChamber && (Object)(object)Chamber2 != (Object)null) { base.FChambers.Add(Chamber2); } GameObject val = new GameObject("m_proxyRound"); m_proxy = val.AddComponent(); m_proxy.Init(((Component)this).transform); if ((Object)(object)Chamber2 != (Object)null) { GameObject val2 = new GameObject("m_proxyRound2"); m_proxy2 = val2.AddComponent(); m_proxy2.Init(((Component)this).transform); } m_baseSpinPosition = PoseSpinHolder.localPosition; } public override Transform GetMuzzle() { if (!UsesSecondChamber) { return ((FVRFireArm)this).GetMuzzle(); } if (m_isSecondaryMuzzlePos) { return SecondMuzzle; } return base.MuzzlePos; } public override void BeginInteraction(FVRViveHand hand) { ((FVRFireArm)this).BeginInteraction(hand); SetBaseHandAngle(hand); } public override void UpdateInteraction(FVRViveHand hand) { //IL_0044: 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_0070: Invalid comparison between Unknown and I4 //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); UpdateLever(); Trigger.localEulerAngles = new Vector3(Mathf.Lerp(TriggerRotRange.x, TriggerRotRange.y, hand.Input.TriggerFloat), 0f, 0f); if (hand.Input.TriggerDown && !((FVRPhysicalObject)this).IsAltHeld && (int)m_curLeverPos == 2 && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && m_isHammerCocked) { Fire(); } float num = Mathf.InverseLerp(LeverAngleRange.y, LeverAngleRange.x, m_curLeverRot); if ((Object)(object)Hammer != (Object)null) { if (m_isHammerCocked) { Hammer.localEulerAngles = new Vector3(HammerAngleRange.x, 0f, 0f); } else { Hammer.localEulerAngles = new Vector3(Mathf.Lerp(HammerAngleRange.y, HammerAngleRange.x, num), 0f, 0f); } } } public override void EndInteraction(FVRViveHand hand) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) Trigger.localEulerAngles = new Vector3(0f, 0f, 0f); ((FVRFireArm)this).EndInteraction(hand); } private void SetBaseHandAngle(FVRViveHand hand) { //IL_000c: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.ProjectOnPlane(((FVRInteractiveObject)this).m_hand.PoseOverride.forward, LeverRoot.right); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 forward = LeverRoot.forward; float baseAngleOffset = Mathf.Atan2(Vector3.Dot(LeverRoot.right, Vector3.Cross(forward, normalized)), Vector3.Dot(forward, normalized)) * 57.29578f; BaseAngleOffset = baseAngleOffset; } private void UpdateLever() { //IL_00f0: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Invalid comparison between Unknown and I4 //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Invalid comparison between Unknown and I4 //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03ad: Unknown result type (might be due to invalid IL or missing references) //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_03b6: 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) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03d9: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_0587: Unknown result type (might be due to invalid IL or missing references) //IL_0555: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Invalid comparison between Unknown and I4 //IL_051f: Unknown result type (might be due to invalid IL or missing references) //IL_0511: Unknown result type (might be due to invalid IL or missing references) //IL_0595: Unknown result type (might be due to invalid IL or missing references) //IL_059b: Invalid comparison between Unknown and I4 //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_06c2: Unknown result type (might be due to invalid IL or missing references) //IL_05a1: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Invalid comparison between Unknown and I4 //IL_06cd: Unknown result type (might be due to invalid IL or missing references) //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0983: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Invalid comparison between Unknown and I4 //IL_0a54: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Invalid comparison between Unknown and I4 //IL_098f: Unknown result type (might be due to invalid IL or missing references) //IL_0995: Invalid comparison between Unknown and I4 //IL_0a60: Unknown result type (might be due to invalid IL or missing references) //IL_0bfd: Unknown result type (might be due to invalid IL or missing references) //IL_0c08: Unknown result type (might be due to invalid IL or missing references) //IL_0c0f: Unknown result type (might be due to invalid IL or missing references) //IL_0c2a: Unknown result type (might be due to invalid IL or missing references) //IL_0c35: Unknown result type (might be due to invalid IL or missing references) //IL_0c3c: Unknown result type (might be due to invalid IL or missing references) //IL_0b64: Unknown result type (might be due to invalid IL or missing references) //IL_0b6f: Unknown result type (might be due to invalid IL or missing references) //IL_0b76: Unknown result type (might be due to invalid IL or missing references) //IL_0b91: Unknown result type (might be due to invalid IL or missing references) //IL_0b9c: Unknown result type (might be due to invalid IL or missing references) //IL_0ba3: Unknown result type (might be due to invalid IL or missing references) //IL_0764: Unknown result type (might be due to invalid IL or missing references) //IL_076f: Unknown result type (might be due to invalid IL or missing references) //IL_077f: Unknown result type (might be due to invalid IL or missing references) //IL_078a: Unknown result type (might be due to invalid IL or missing references) //IL_079a: Unknown result type (might be due to invalid IL or missing references) //IL_079f: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07ba: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07ca: Unknown result type (might be due to invalid IL or missing references) //IL_07da: Unknown result type (might be due to invalid IL or missing references) //IL_07e5: Unknown result type (might be due to invalid IL or missing references) //IL_07f5: Unknown result type (might be due to invalid IL or missing references) //IL_07fa: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0815: Unknown result type (might be due to invalid IL or missing references) //IL_081a: Unknown result type (might be due to invalid IL or missing references) //IL_0825: Unknown result type (might be due to invalid IL or missing references) //IL_0830: Unknown result type (might be due to invalid IL or missing references) //IL_0d8c: Unknown result type (might be due to invalid IL or missing references) //IL_0d0f: Unknown result type (might be due to invalid IL or missing references) //IL_0d1a: Unknown result type (might be due to invalid IL or missing references) //IL_0d21: Unknown result type (might be due to invalid IL or missing references) //IL_0d3c: Unknown result type (might be due to invalid IL or missing references) //IL_0d47: Unknown result type (might be due to invalid IL or missing references) //IL_0d4e: Unknown result type (might be due to invalid IL or missing references) //IL_0cae: Unknown result type (might be due to invalid IL or missing references) //IL_0cb9: Unknown result type (might be due to invalid IL or missing references) //IL_0cc0: Unknown result type (might be due to invalid IL or missing references) //IL_0cdb: Unknown result type (might be due to invalid IL or missing references) //IL_0ce6: Unknown result type (might be due to invalid IL or missing references) //IL_0ced: Unknown result type (might be due to invalid IL or missing references) //IL_0c73: Unknown result type (might be due to invalid IL or missing references) //IL_0bda: Unknown result type (might be due to invalid IL or missing references) //IL_0db9: Unknown result type (might be due to invalid IL or missing references) //IL_0dc4: Unknown result type (might be due to invalid IL or missing references) //IL_0dcb: Unknown result type (might be due to invalid IL or missing references) //IL_0de6: Unknown result type (might be due to invalid IL or missing references) //IL_0df1: Unknown result type (might be due to invalid IL or missing references) //IL_0df8: Unknown result type (might be due to invalid IL or missing references) //IL_0e7b: Unknown result type (might be due to invalid IL or missing references) //IL_0e81: Invalid comparison between Unknown and I4 //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_089c: Unknown result type (might be due to invalid IL or missing references) //IL_08ac: Unknown result type (might be due to invalid IL or missing references) //IL_08b7: Unknown result type (might be due to invalid IL or missing references) //IL_08c7: Unknown result type (might be due to invalid IL or missing references) //IL_08cc: Unknown result type (might be due to invalid IL or missing references) //IL_08d7: Unknown result type (might be due to invalid IL or missing references) //IL_08e7: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_0907: Unknown result type (might be due to invalid IL or missing references) //IL_0912: Unknown result type (might be due to invalid IL or missing references) //IL_0922: Unknown result type (might be due to invalid IL or missing references) //IL_0927: Unknown result type (might be due to invalid IL or missing references) //IL_0932: Unknown result type (might be due to invalid IL or missing references) //IL_0942: Unknown result type (might be due to invalid IL or missing references) //IL_0947: Unknown result type (might be due to invalid IL or missing references) //IL_0952: Unknown result type (might be due to invalid IL or missing references) //IL_095d: Unknown result type (might be due to invalid IL or missing references) //IL_0e30: Unknown result type (might be due to invalid IL or missing references) //IL_0e3b: Unknown result type (might be due to invalid IL or missing references) //IL_0e42: Unknown result type (might be due to invalid IL or missing references) //IL_0e5d: Unknown result type (might be due to invalid IL or missing references) //IL_0e68: Unknown result type (might be due to invalid IL or missing references) //IL_0e6f: Unknown result type (might be due to invalid IL or missing references) //IL_0ec4: Unknown result type (might be due to invalid IL or missing references) //IL_0eca: Invalid comparison between Unknown and I4 //IL_0f13: Unknown result type (might be due to invalid IL or missing references) //IL_0faa: Unknown result type (might be due to invalid IL or missing references) //IL_0faf: Unknown result type (might be due to invalid IL or missing references) //IL_0f72: Unknown result type (might be due to invalid IL or missing references) //IL_0f80: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0f35: Unknown result type (might be due to invalid IL or missing references) //IL_0f43: Unknown result type (might be due to invalid IL or missing references) //IL_0f4a: Unknown result type (might be due to invalid IL or missing references) bool flag = false; bool flag2 = false; if (((FVRInteractiveObject)this).IsHeld) { if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode) { flag = ((FVRInteractiveObject)this).m_hand.Input.BYButtonPressed; flag2 = ((FVRInteractiveObject)this).m_hand.Input.BYButtonUp; } else { flag = ((FVRInteractiveObject)this).m_hand.Input.TouchpadPressed; flag2 = ((FVRInteractiveObject)this).m_hand.Input.TouchpadUp; } } m_isLeverReleasePressed = false; bool flag3 = false; if (!((FVRPhysicalObject)this).IsAltHeld && (Object)(object)((FVRInteractiveObject)ForeGrip).m_hand != (Object)null) { if (((FVRInteractiveObject)ForeGrip).m_hand.Input.TriggerPressed && ((FVRInteractiveObject)ForeGrip).m_hasTriggeredUpSinceBegin && (int)GM.Options.ControlOptions.LongGunSnipingAssist != 1) { flag3 = true; } m_isLeverReleasePressed = true; curDistanceBetweenGrips = Vector3.Distance(((FVRInteractiveObject)this).m_hand.PalmTransform.position, ((FVRInteractiveObject)((FVRPhysicalObject)this).AltGrip).m_hand.PalmTransform.position); if (lastDistanceBetweenGrips < 0f) { lastDistanceBetweenGrips = curDistanceBetweenGrips; } } else { lastDistanceBetweenGrips = -1f; } m_isSpinning = false; if (!((FVRPhysicalObject)this).IsAltHeld && CanSpin && flag) { m_isSpinning = true; } bool flag4 = false; if (m_isHammerCocked && !m_isSpinning && (int)m_curLeverPos == 2) { flag4 = true; } if (flag3) { flag4 = false; } if ((Object)(object)((FVRPhysicalObject)this).AltGrip == (Object)null && !((FVRPhysicalObject)this).IsAltHeld) { flag4 = true; } if (flag4 && useLinearRacking) { SetBaseHandAngle(((FVRInteractiveObject)this).m_hand); } m_wasLeverLocked = flag4; if (flag2) { m_tarLeverRot = 0f; PoseSpinHolder.localPosition = m_baseSpinPosition; lastDistanceBetweenGrips = curDistanceBetweenGrips; m_rackingDisplacement = 0f; } else if (m_isLeverReleasePressed && !flag4) { if (useLinearRacking) { curDistanceBetweenGrips = Vector3.Distance(((FVRInteractiveObject)this).m_hand.PalmTransform.position, ((FVRInteractiveObject)((FVRPhysicalObject)this).AltGrip).m_hand.PalmTransform.position); if (curDistanceBetweenGrips < lastDistanceBetweenGrips) { float num = lastDistanceBetweenGrips - curDistanceBetweenGrips; m_rackingDisplacement += num; } else { float num2 = curDistanceBetweenGrips - lastDistanceBetweenGrips; m_rackingDisplacement -= num2; } m_rackingDisplacement = Mathf.Clamp(m_rackingDisplacement, 0f, 0.04f); if (m_rackingDisplacement < 0.005f) { m_rackingDisplacement = 0f; } if (m_rackingDisplacement > 0.035f) { m_rackingDisplacement = 0.04f; } PoseSpinHolder.localPosition = m_baseSpinPosition + Vector3.forward * m_rackingDisplacement * 2f; m_tarLeverRot = Mathf.Lerp(LeverAngleRange.y, LeverAngleRange.x, m_rackingDisplacement * 25f); lastDistanceBetweenGrips = curDistanceBetweenGrips; } else { Vector3 val = Vector3.ProjectOnPlane(((FVRInteractiveObject)this).m_hand.PoseOverride.forward, LeverRoot.right); Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 forward = LeverRoot.forward; float num3 = Mathf.Atan2(Vector3.Dot(LeverRoot.right, Vector3.Cross(forward, normalized)), Vector3.Dot(forward, normalized)) * 57.29578f; num3 -= BaseAngleOffset; num3 *= 3f; num3 = Mathf.Clamp(num3, LeverAngleRange.x, LeverAngleRange.y); m_tarLeverRot = num3; } } else if (m_isSpinning) { float num4 = Mathf.Clamp(((Vector3)(ref ((FVRInteractiveObject)this).m_hand.Input.VelLinearWorld)).magnitude - 1f, 0f, 3f); float num5 = num4 * 120f; float num6 = Mathf.Repeat(Mathf.Abs(xSpinRot), 360f); num5 = Mathf.Clamp(num5, 0f, num6 * 0.5f); m_tarLeverRot = Mathf.Clamp(0f - num5, LeverAngleRange.x, LeverAngleRange.y); PoseSpinHolder.localPosition = m_baseSpinPosition; } if (Mathf.Abs(m_curLeverRot - LeverAngleRange.y) < 1f) { if ((int)m_lastLeverPos == 0) { m_curLeverPos = (ZPos)1; } else { m_curLeverPos = (ZPos)2; base.IsBreachOpenForGasOut = false; } } else if (Mathf.Abs(m_curLeverRot - LeverAngleRange.x) < 1f) { if ((int)m_lastLeverPos == 2) { m_curLeverPos = (ZPos)1; } else { m_curLeverPos = (ZPos)0; base.IsBreachOpenForGasOut = true; } } else { m_curLeverPos = (ZPos)1; base.IsBreachOpenForGasOut = true; } if ((int)m_curLeverPos == 2 && (int)m_lastLeverPos != 2) { m_tarLeverRot = LeverAngleRange.y; m_curLeverRot = LeverAngleRange.y; if (m_isActionMovingForward && m_proxy.IsFull && !Chamber.IsFull) { ((FVRInteractiveObject)this).m_hand.Buzz(((FVRInteractiveObject)this).m_hand.Buzzer.Buzz_OnHoverInteractive); Chamber.SetRound(m_proxy.Round, false); m_proxy.ClearProxy(); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)10, 1f); } else { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)41, 1f); } if (UsesSecondChamber && m_isActionMovingForward && m_proxy2.IsFull && !Chamber2.IsFull) { Chamber2.SetRound(m_proxy2.Round, false); m_proxy2.ClearProxy(); } m_isActionMovingForward = false; } else if ((int)m_curLeverPos == 0 && (int)m_lastLeverPos != 0) { m_tarLeverRot = LeverAngleRange.x; m_curLeverRot = LeverAngleRange.x; m_isHammerCocked = true; if (UsesSecondChamber) { m_isHammerCocked2 = true; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); if (!m_isActionMovingForward && Chamber.IsFull) { ((FVRInteractiveObject)this).m_hand.Buzz(((FVRInteractiveObject)this).m_hand.Buzzer.Buzz_OnHoverInteractive); Chamber.EjectRound(ReceiverEjectionPoint.position, ((Component)this).transform.right * EjectionDir.x + ((Component)this).transform.up * EjectionDir.y + ((Component)this).transform.forward * EjectionDir.z, ((Component)this).transform.right * EjectionSpin.x + ((Component)this).transform.up * EjectionSpin.y + ((Component)this).transform.forward * EjectionSpin.z, ReceiverEjectionPoint.position, ReceiverEjectionPoint.rotation, false); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)11, 1f); } else { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)40, 1f); } if (UsesSecondChamber && !m_isActionMovingForward && Chamber2.IsFull) { Chamber2.EjectRound(REP2.position, ((Component)this).transform.right * EjectionVector2.x + ((Component)this).transform.up * EjectionVector2.y + ((Component)this).transform.forward * EjectionVector2.z, ((Component)this).transform.right * EjectionSpin.x + ((Component)this).transform.up * EjectionSpin.y + ((Component)this).transform.forward * EjectionSpin.z, ReceiverEjectionPoint.position, ReceiverEjectionPoint.rotation, false); } m_isActionMovingForward = true; } else if (!GrabsRoundFromMagOnBoltForward && (int)m_curLeverPos == 1 && (int)m_lastLeverPos == 2) { if ((Object)(object)base.Magazine != (Object)null && !m_proxy.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference = base.Magazine.RemoveRound(false); m_proxy.SetFromPrefabReference(fromPrefabReference); } if (UsesSecondChamber && (Object)(object)base.Magazine != (Object)null && !m_proxy2.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference2 = base.Magazine.RemoveRound(false); m_proxy2.SetFromPrefabReference(fromPrefabReference2); } } else if (GrabsRoundFromMagOnBoltForward && (int)m_curLeverPos == 1 && (int)m_lastLeverPos == 0) { if ((Object)(object)base.Magazine != (Object)null && !m_proxy.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference3 = base.Magazine.RemoveRound(false); m_proxy.SetFromPrefabReference(fromPrefabReference3); } if (UsesSecondChamber && (Object)(object)base.Magazine != (Object)null && !m_proxy2.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference4 = base.Magazine.RemoveRound(false); m_proxy2.SetFromPrefabReference(fromPrefabReference4); } } float num7 = Mathf.InverseLerp(LeverAngleRange.y, LeverAngleRange.x, m_curLeverRot); if (m_proxy.IsFull) { if (m_isActionMovingForward) { m_proxy.ProxyRound.position = Vector3.Lerp(ReceiverUpperPathForward.position, ReceiverUpperPathRearward.position, num7); m_proxy.ProxyRound.rotation = Quaternion.Slerp(ReceiverUpperPathForward.rotation, ReceiverUpperPathRearward.rotation, num7); if ((Object)(object)LoadingGate != (Object)null) { LoadingGate.localEulerAngles = new Vector3(LoadingGateAngleRange.x, 0f, 0f); } } else { m_proxy.ProxyRound.position = Vector3.Lerp(ReceiverLowerPathForward.position, ReceiverLowerPathRearward.position, num7); m_proxy.ProxyRound.rotation = Quaternion.Slerp(ReceiverLowerPathForward.rotation, ReceiverLowerPathRearward.rotation, num7); if ((Object)(object)LoadingGate != (Object)null) { LoadingGate.localEulerAngles = new Vector3(LoadingGateAngleRange.y, 0f, 0f); } } } if (m_proxy2.IsFull) { if (m_isActionMovingForward) { m_proxy2.ProxyRound.position = Vector3.Lerp(RUPF2.position, RUPR2.position, num7); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RUPF2.rotation, RUPR2.rotation, num7); } else { m_proxy2.ProxyRound.position = Vector3.Lerp(RLPF2.position, RLPR2.position, num7); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RLPF2.rotation, RLPR2.rotation, num7); } } else if ((Object)(object)LoadingGate != (Object)null) { LoadingGate.localEulerAngles = new Vector3(LoadingGateAngleRange.y, 0f, 0f); } if (Chamber.IsFull) { Chamber.ProxyRound.position = Vector3.Lerp(ReceiverEjectionPathForward.position, ReceiverEjectionPathRearward.position, num7); Chamber.ProxyRound.rotation = Quaternion.Slerp(ReceiverEjectionPathForward.rotation, ReceiverEjectionPathRearward.rotation, num7); } if (UsesSecondChamber && Chamber2.IsFull) { Chamber2.ProxyRound.position = Vector3.Lerp(ReceiverEjectionPathForward.position, ReceiverEjectionPathRearward.position, num7); Chamber2.ProxyRound.rotation = Quaternion.Slerp(ReceiverEjectionPathForward.rotation, ReceiverEjectionPathRearward.rotation, num7); } if ((int)m_curLeverPos != 2 && !m_proxy.IsFull) { Chamber.IsAccessible = true; } else { Chamber.IsAccessible = false; } if (UsesSecondChamber) { if ((int)m_curLeverPos != 2 && !m_proxy2.IsFull) { Chamber2.IsAccessible = true; } else { Chamber2.IsAccessible = false; } } for (int i = 0; i < ActuatedPieces.Length; i++) { if ((int)ActuatedPieces[i].InterpStyle == 0) { ActuatedPieces[i].Piece.localPosition = Vector3.Lerp(ActuatedPieces[i].PosBack, ActuatedPieces[i].PosForward, num7); } else { ActuatedPieces[i].Piece.localEulerAngles = Vector3.Lerp(ActuatedPieces[i].PosBack, ActuatedPieces[i].PosForward, num7); } } m_lastLeverPos = m_curLeverPos; } private void Fire() { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) if (m_isHammerCocked) { m_isHammerCocked = false; } else if (m_isHammerCocked2) { m_isHammerCocked2 = false; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); if (Chamber.Fire()) { ((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), true, 1f, -1f); } if (Chamber2.Fire()) { ((FVRFireArm)this).Fire(Chamber2, MuzzleTwo, true, 1f, -1f); } ((FVRFireArm)this).FireMuzzleSmoke(); bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null; bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); ((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); } public override void FVRFixedUpdate() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).FVRFixedUpdate(); m_curLeverRot = Mathf.MoveTowards(m_curLeverRot, m_tarLeverRot, m_leverRotSpeed * Time.deltaTime); Lever.localEulerAngles = new Vector3(m_curLeverRot, 0f, 0f); UpdateSpinning(); } private void UpdateSpinning() { //IL_025e: 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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if (!((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)this).IsAltHeld || (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null) { m_isSpinning = false; } if (m_isSpinning) { Vector3 val = Vector3.zero; if ((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null) { val = ((FVRInteractiveObject)this).m_hand.Input.VelLinearWorld; } float num = Vector3.Dot(((Vector3)(ref val)).normalized, ((Component)this).transform.up); num = Mathf.Clamp(num, 0f - ((Vector3)(ref val)).magnitude, ((Vector3)(ref val)).magnitude); if (Mathf.Abs(xSpinVel) < 90f) { xSpinVel += num * Time.deltaTime * 600f; } else if (Mathf.Sign(num) == Mathf.Sign(xSpinVel)) { xSpinVel += num * Time.deltaTime * 600f; } if (Mathf.Abs(xSpinVel) < 90f) { if (Vector3.Dot(((Component)this).transform.up, Vector3.down) >= 0f && Mathf.Sign(xSpinVel) == 1f) { xSpinVel += Time.deltaTime * 50f; } if (Vector3.Dot(((Component)this).transform.up, Vector3.down) < 0f && Mathf.Sign(xSpinVel) == -1f) { xSpinVel -= Time.deltaTime * 50f; } } xSpinVel = Mathf.Clamp(xSpinVel, -200f, 200f); xSpinRot += xSpinVel * Time.deltaTime * 5f; PoseSpinHolder.localEulerAngles = new Vector3(xSpinRot, 0f, 0f); xSpinVel = Mathf.Lerp(xSpinVel, 0f, Time.deltaTime * 0.6f); } else { xSpinRot = 0f; xSpinVel = 0f; PoseSpinHolder.localEulerAngles = new Vector3(xSpinRot, 0f, 0f); } } public override List GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List list = new List(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List rounds) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (rounds.Count > 0) { Chamber.Autochamber(rounds[0]); } } } public class DoubleBarrelToggleLocks : MonoBehaviour { public ClosedBoltWeapon Gun; public ManipulateTransforms MT1; public ManipulateTransforms MT2; public GameObject DummyTransform; public Transform Muzzle1; public Transform Muzzle2; private bool IsOn = true; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)Gun) { SwapBarrelCluster(); } } public void SwapBarrelCluster() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) IsOn = !IsOn; if (IsOn) { ((FVRFireArm)Gun).MuzzlePos.localPosition = Muzzle1.localPosition; MT1.TransformGroups[0].ObservedTransform = ((Component)Gun.Bolt).gameObject.transform; MT2.TransformGroups[0].ObservedTransform = DummyTransform.transform; } else { ((FVRFireArm)Gun).MuzzlePos.localPosition = Muzzle2.localPosition; MT1.TransformGroups[0].ObservedTransform = DummyTransform.transform; MT2.TransformGroups[0].ObservedTransform = ((Component)Gun.Bolt).gameObject.transform; } ((FVRFireArm)Gun).UpdateCurrentMuzzle(); } } public class Epoch : FVRFireArm { [Header("Epoch Component Params")] public GameObject UnchargedBolt; public GameObject ChargedBolt; private bool HasRound = false; [Header("Epoch Trigger Params")] public float TriggerBreakPoint; public Transform Trigger; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public Axis TriggerAxis; public InterpStyle TriggerInterpStyle = (InterpStyle)1; private float TriggerHeldStartTime = 0f; public float SafeHoldTime = 1f; public float MaxUnsafeHoldTime = 3f; public GameObject[] SelfDestructPrefabs; private float m_triggerFloat; private bool IsChargedToPowerful = false; private float ManipulationFactor = 0f; private float ManipulationFactor2 = 0f; private bool HasStartedCharging = false; [Header("Epoch Visual Params")] public ParticleSystem ChargingParticles; public ParticleSystem ChargedParticles; public ParticleSystem FiringParticles; public int NumberOfParticles; public Transform MainChargeBars; public Vector2 YScaleMainSafe; public Vector2 YScaleMainUnsafe; public Transform OpticChargeBar; public Vector2 YScaleOptic; public Vector2 YScaleOpticUnsafe; [Header("Epoch Audio Params")] public FVRTailSoundClass TailClass = (FVRTailSoundClass)8; public AudioEvent ChargingClip; public AudioEvent FullyChargedClip; public AudioSource ChargeLoopAudio; private bool HasPlayedFullyChargedSound = false; public float MaxChargeLoopPitch = 1.5f; private void Start() { ChargeLoopAudio.Stop(); ChargingParticles.Stop(); ChargedParticles.Stop(); } public override void EndInteraction(FVRViveHand hand) { ((FVRFireArm)this).EndInteraction(hand); ManipulationFactor = 0f; ManipulationFactor2 = 0f; if (ChargingParticles.isPlaying) { ChargingParticles.Stop(); } if (ChargedParticles.isPlaying) { ChargedParticles.Stop(); } if (ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Stop(); } HasPlayedFullyChargedSound = false; } public override void UpdateInteraction(FVRViveHand hand) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_021b: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); m_triggerFloat = hand.Input.TriggerFloat; if (IsChargedToPowerful && !ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Play(); } if (!IsChargedToPowerful && ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Stop(); } if ((Object)(object)Trigger != (Object)null) { ((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), TriggerInterpStyle, TriggerAxis); } HasRound = true; EpochMagazine epochMagazine = (EpochMagazine)(object)base.Magazine; if ((Object)(object)epochMagazine == (Object)null || epochMagazine.NumOfRoundsRemaining == 0) { HasRound = false; } if (!((FVRPhysicalObject)this).IsAltHeld && m_triggerFloat >= TriggerBreakPoint && !HasStartedCharging && HasRound) { HasStartedCharging = true; TriggerHeldStartTime = Time.time; IsChargedToPowerful = false; ManipulationFactor = 0f; SM.PlayCoreSound((FVRPooledAudioType)0, ChargingClip, ((Component)this).transform.position); } if (!((FVRPhysicalObject)this).IsAltHeld && m_triggerFloat >= TriggerBreakPoint) { float num = Time.time - TriggerHeldStartTime; if (num < SafeHoldTime) { ManipulationFactor = Mathf.Clamp01(num / SafeHoldTime); } if (num >= SafeHoldTime) { ManipulationFactor = 1f; IsChargedToPowerful = true; if (!HasPlayedFullyChargedSound) { SM.PlayCoreSound((FVRPooledAudioType)0, FullyChargedClip, ((Component)this).transform.position); HasPlayedFullyChargedSound = true; } } if (num >= SafeHoldTime && num < MaxUnsafeHoldTime) { if (!HasPlayedFullyChargedSound) { SM.PlayCoreSound((FVRPooledAudioType)0, FullyChargedClip, ((Component)this).transform.position); HasPlayedFullyChargedSound = true; } ManipulationFactor = 1f; IsChargedToPowerful = true; ManipulationFactor2 = Mathf.Clamp01((num - SafeHoldTime) / (MaxUnsafeHoldTime - SafeHoldTime)); ChargeLoopAudio.pitch = 1f + ManipulationFactor2 * MaxChargeLoopPitch; } if (num >= MaxUnsafeHoldTime) { SelfDestruct(hand); } if (!ChargingParticles.isPlaying) { ChargingParticles.Play(); } } if (m_triggerFloat < TriggerBreakPoint && IsChargedToPowerful && !((FVRPhysicalObject)this).IsAltHeld) { Fire(); IsChargedToPowerful = false; ManipulationFactor = 0f; ManipulationFactor2 = 0f; FiringParticles.Emit(NumberOfParticles); ChargingParticles.Stop(); HasPlayedFullyChargedSound = false; } if (m_triggerFloat < TriggerBreakPoint && !IsChargedToPowerful) { ManipulationFactor = 0f; if (ChargingParticles.isPlaying) { ChargingParticles.Stop(); } HasPlayedFullyChargedSound = false; HasStartedCharging = false; TriggerHeldStartTime = Time.time; } UpdateAnimatedParts(); } public void UpdateAnimatedParts() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) float num = YScaleMainSafe.x - YScaleMainSafe.y; float num2 = YScaleMainUnsafe.x - YScaleMainUnsafe.y; Vector3 localScale = ((Component)MainChargeBars).transform.localScale; localScale.y = 1f - (ManipulationFactor * num + ManipulationFactor2 * num2); ((Component)MainChargeBars).transform.localScale = localScale; float num3 = YScaleOptic.x - YScaleOptic.y; float num4 = YScaleOpticUnsafe.x - YScaleOpticUnsafe.y; Vector3 localScale2 = ((Component)OpticChargeBar).transform.localScale; localScale2.y = 1f - (num3 * ManipulationFactor + ManipulationFactor2 * num4); ((Component)OpticChargeBar).transform.localScale = localScale2; if (IsChargedToPowerful && !ChargedParticles.isPlaying) { ChargedParticles.Play(); } if (!IsChargedToPowerful && ChargedParticles.isPlaying) { ChargedParticles.Stop(); } } public void Fire() { //IL_001b: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: 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_00f7: 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_004a: 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) GameObject val = null; if (IsChargedToPowerful) { val = Object.Instantiate(UnchargedBolt, ((FVRFireArm)this).GetMuzzle().position, ((FVRFireArm)this).GetMuzzle().rotation); } if (!IsChargedToPowerful) { val = Object.Instantiate(ChargedBolt, ((FVRFireArm)this).GetMuzzle().position, ((FVRFireArm)this).GetMuzzle().rotation); } BallisticProjectile component = val.GetComponent(); component.Fire(val.transform.forward, (FVRFireArm)(object)this); HasPlayedFullyChargedSound = false; ((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); base.m_pool_shot.PlayClip(base.AudioClipSet.Shots_Main, base.MuzzlePos.position, (AudioMixerGroup)null); base.m_pool_tail.PlayClipPitchOverride(SM.GetTailSet(TailClass, GM.CurrentPlayerBody.GetCurrentSoundEnvironment()), ((FVRFireArm)this).GetMuzzle().position, base.AudioClipSet.TailPitchMod_Main, (AudioMixerGroup)null); if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { EpochMagazine epochMagazine = (EpochMagazine)(object)base.Magazine; epochMagazine.NumOfRoundsRemaining++; } HasStartedCharging = false; ChargeLoopAudio.pitch = 1f; } public void SelfDestruct(FVRViveHand hand) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).EndInteraction(hand); GameObject[] selfDestructPrefabs = SelfDestructPrefabs; foreach (GameObject val in selfDestructPrefabs) { Object.Instantiate(val, ((Component)this).transform.position, ((Component)this).transform.rotation); } ((FVRInteractiveObject)this).ForceBreakInteraction(); Object.Destroy((Object)(object)((Component)this).gameObject); } } public class EpochMagazine : FVRFireArmMagazine { [Header("Epoch Cell Params")] public int NumOfRoundsRemaining = 3; } } 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 FirearmFlyOutOfHand : MonoBehaviour { public FVRFireArm Gun; public FVRFireArmChamber Chamber; public float TriggerFloat = 0.85f; protected bool IsSpent = false; protected bool WasSpent = false; public float Force = 30f; public float Torque = 20f; private void Update() { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) IsSpent = Chamber.IsSpent; if (IsSpent && !WasSpent && (Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null && ((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat >= TriggerFloat && !Gun.IsTwoHandStabilized() && !Gun.IsForegripStabilized()) { if ((Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null) { ((FVRInteractiveObject)Gun).m_hand.EndInteractionIfHeld((FVRInteractiveObject)(object)Gun); ((FVRInteractiveObject)Gun).ForceBreakInteraction(); } ((FVRPhysicalObject)Gun).RootRigidbody.AddForceAtPosition((-((Component)this).transform.forward + ((Component)this).transform.up + Random.onUnitSphere * 0.25f) * Force, Gun.MuzzlePos.position, (ForceMode)1); ((FVRPhysicalObject)Gun).RootRigidbody.AddRelativeTorque(Vector3.right * Torque, (ForceMode)1); } WasSpent = Chamber.IsSpent; } } public class FirearmMainHandObjectToggler : MonoBehaviour { public bool OnOff = true; public GameObject[] ItemsToToggle; public AudioEvent AudEvent_OnClip; public AudioEvent AudEvent_OffClip; private bool _isItemToggled = false; public FVRFireArm Weapon; private void Update() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) FVRViveHand hand = ((FVRInteractiveObject)Weapon).m_hand; if (!((Object)(object)hand == (Object)null)) { Vector2 touchpadAxes = hand.Input.TouchpadAxes; if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (hand.Input.TouchpadDown && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.left) <= 45f)) { Toggle(); } } } public void Toggle() { //IL_00b3: 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) if (!OnOff) { return; } if (_isItemToggled) { GameObject[] itemsToToggle = ItemsToToggle; foreach (GameObject val in itemsToToggle) { val.SetActive(false); } SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_OffClip, ((Component)this).transform.position); _isItemToggled = false; } else { GameObject[] itemsToToggle2 = ItemsToToggle; foreach (GameObject val2 in itemsToToggle2) { val2.SetActive(true); } SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_OnClip, ((Component)this).transform.position); _isItemToggled = true; } } } 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() { if ((Object)(object)SpinnySounds != (Object)null) { 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 GenericToggleAction : MonoBehaviour { private void Start() { } private void Update() { } } namespace ShermanJumbo { public class GrenadeFuseTimeReadout : MonoBehaviour { public PinnedGrenade Grenade; public Text Text; public bool UseBetterVarTimeFuse = true; public float[] FuzeTimes; public float PitchStart = 1f; public float PitchEnd = 2.5f; private int FuzeTimeIndex = 0; private void Update() { //IL_00fc: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) if (Grenade.m_isLeverReleased) { float num = Grenade.m_fuseTime; if (num < 0f) { num = 0f; } Text.text = num.ToString("F1") + "s"; if (UseBetterVarTimeFuse) { float num2 = Mathf.Clamp(1f - Grenade.m_fuseTime / Grenade.m_startFuseTime, 0f, 1f); num2 = Mathf.Pow(num2, 2f); if (Grenade.m_fuse_tick <= 0f) { Grenade.m_fuse_tick = Mathf.Lerp(Grenade.m_fuse_StartRefire, Grenade.m_fuse_EndRefire, num2); float num3 = Mathf.Lerp(PitchStart, PitchEnd, num2); SM.PlayCoreSoundOverrides((FVRPooledAudioType)0, Grenade.AudEvent_FusePulse, ((FVRInteractiveObject)Grenade).Transform.position, new Vector2(1f, 1f), new Vector2(num3, num3)); Grenade.FusePSystem.Emit(2); } else { PinnedGrenade grenade = Grenade; grenade.m_fuse_tick -= Time.deltaTime; } } } if (!UseBetterVarTimeFuse) { return; } if ((Object)(object)((FVRInteractiveObject)Grenade).m_hand != (Object)null && ((((FVRInteractiveObject)Grenade).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)Grenade).m_hand.Input.BYButtonDown) || (((FVRInteractiveObject)Grenade).m_hand.Input.TouchpadDown && ((Vector2)(ref ((FVRInteractiveObject)Grenade).m_hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(((FVRInteractiveObject)Grenade).m_hand.Input.TouchpadAxes, Vector2.up) <= 45f))) { if (FuzeTimeIndex < FuzeTimes.Length - 1) { FuzeTimeIndex++; } else { FuzeTimeIndex = 0; } } Grenade.DefaultFuse.x = FuzeTimes[FuzeTimeIndex]; Grenade.DefaultFuse.y = FuzeTimes[FuzeTimeIndex]; if (!Grenade.m_isLeverReleased) { float num4 = FuzeTimes[FuzeTimeIndex]; Grenade.DefaultFuse.x = num4; Grenade.DefaultFuse.y = num4; Grenade.m_startFuseTime = num4; Grenade.m_fuseTime = num4; Text.text = num4.ToString("F1") + "s"; } } } } namespace BitWizrd.GrenadeMod { public class GrenadeMod : FVRPhysicalObject { [Header("Grenade Settings")] public GameObject grenadeGameObject; public PinnedGrenadeRing pinnedGrenadeRing; public Rigidbody grenadeRigidbody; public bool activateLeverOnPinPull = false; [Header("Sticky Grenade Settings")] public bool isStickyGrenade = true; public Collider stickyCollider; public float stickingDistance = 0.1f; public LayerMask stickyLayers; public float embeddingDistance = 0.02f; public bool playStickSoundForRigidbodiesOnly = true; public AudioSource stickSoundSource; public AudioClip[] stickSounds; public float minimumStickVelocity = 2f; public float regrabActivationDelay = 0.5f; public float massWhileStuck = 10f; [Header("Grenade Cooking Settings")] public GameObject pinPullEffectPrefab; public AudioSource cookingAudioSource; public AudioClip[] cookingClips; public float cookingSoundDelay = 1f; [Header("Grenade Fast Throw Settings")] public AudioSource fastThrowAudioSource; public AudioClip[] fastThrowClips; public float fastThrowVelocityThreshold = 10f; public float releaseWindow = 0.5f; private PinnedGrenade grenade; private Collider grenadeCollider; private bool hasPlayedFastThrowSound = false; private bool isPinPulled = false; private bool isHeld = false; private bool wasHeld = false; private bool pinPulledChecked = false; private bool shouldCheckVelocity = false; private bool hasReleasedLever = false; private bool isSticking = false; private bool canStick = false; private float timeSinceRelease = 0f; private GameObject parentObject; private Vector3 savedPosition; private Quaternion savedRotation; private Vector3 savedScale; private FVRInteractiveObject interactiveObject; private bool isCookingCoroutineRunning = false; private void Start() { interactiveObject = ((Component)this).GetComponent(); } public override void FVRUpdate() { ((FVRPhysicalObject)this).FVRUpdate(); if ((Object)(object)grenadeGameObject == (Object)null) { return; } grenade = grenadeGameObject.GetComponent(); if ((Object)(object)grenade == (Object)null) { return; } FVRPhysicalObject component = grenadeGameObject.GetComponent(); if ((Object)(object)component == (Object)null) { return; } grenadeCollider = grenadeGameObject.GetComponent(); if ((Object)(object)grenadeCollider == (Object)null) { return; } isHeld = ((FVRInteractiveObject)component).IsHeld; if ((Object)(object)pinnedGrenadeRing != (Object)null) { isPinPulled = pinnedGrenadeRing.HasPinDetached(); if (!pinPulledChecked && isPinPulled) { pinPulledChecked = true; shouldCheckVelocity = true; if (isStickyGrenade) { EnableStickyCollider(); } if ((Object)(object)pinPullEffectPrefab != (Object)null) { pinPullEffectPrefab.SetActive(true); } } if (!wasHeld && isHeld) { hasPlayedFastThrowSound = false; timeSinceRelease = 0f; if (isPinPulled) { EnableStickyCollider(); } shouldCheckVelocity = isPinPulled; wasHeld = true; canStick = true; isSticking = false; FixedJoint component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; Debug.Log((object)"FixedJoint grenade unstuck upon being picked up."); } else if ((Object)(object)((Component)this).transform.parent != (Object)null && ((Object)((Component)((Component)this).transform.parent).gameObject).name == "DummyParent") { GameObject gameObject = ((Component)((Component)this).transform.parent).gameObject; ((Component)this).transform.SetParent((Transform)null, true); Object.Destroy((Object)(object)gameObject); grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; Debug.Log((object)"Static-stuck grenade unstuck upon being picked up."); } if (isStickyGrenade) { DisableStickyColliderTemporarily(); } } if (wasHeld && !isHeld) { isSticking = false; wasHeld = false; } } if (isPinPulled || !isHeld) { DisableMeleeDamage(component); } else { EnableMeleeDamage(component); } if (isPinPulled && !cookingAudioSource.isPlaying && cookingClips.Length > 0 && !isCookingCoroutineRunning) { if (cookingSoundDelay == 0f) { PlayCookingSoundImmediately(); } else { ((MonoBehaviour)this).StartCoroutine(HandleCookingSoundDelay()); } } if (isPinPulled && (Object)(object)pinPullEffectPrefab != (Object)null) { pinPullEffectPrefab.SetActive(true); } if (isPinPulled && activateLeverOnPinPull && !hasReleasedLever) { grenade.ReleaseLever(); hasReleasedLever = true; } } public override void FVRFixedUpdate() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_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 references) ((FVRPhysicalObject)this).FVRFixedUpdate(); if (shouldCheckVelocity && isHeld) { Vector3 velocity = grenadeRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude >= minimumStickVelocity) { canStick = true; } else { canStick = false; } } if (!shouldCheckVelocity || isHeld) { return; } timeSinceRelease += Time.fixedDeltaTime; if (timeSinceRelease <= releaseWindow) { Vector3 velocity2 = grenadeRigidbody.velocity; if (((Vector3)(ref velocity2)).magnitude > fastThrowVelocityThreshold && !hasPlayedFastThrowSound) { PlayFastThrowSound(); } } else { shouldCheckVelocity = false; } } private void DisableMeleeDamage(FVRPhysicalObject physicalObject) { if (physicalObject.MP != null && physicalObject.MP.IsMeleeWeapon) { physicalObject.MP.IsMeleeWeapon = false; } } private void EnableMeleeDamage(FVRPhysicalObject physicalObject) { if (physicalObject.MP != null && !physicalObject.MP.IsMeleeWeapon) { physicalObject.MP.IsMeleeWeapon = true; } } private void PlayFastThrowSound() { if (fastThrowClips.Length > 0 && (Object)(object)fastThrowAudioSource != (Object)null) { AudioClip val = fastThrowClips[Random.Range(0, fastThrowClips.Length)]; fastThrowAudioSource.PlayOneShot(val); } hasPlayedFastThrowSound = true; } private void OnCollisionEnter(Collision collision) { //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: 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) if (!isPinPulled || isSticking || !isStickyGrenade || !((Object)(object)stickyCollider != (Object)null) || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null || (Object)(object)collision.gameObject.GetComponent() != (Object)null) { return; } ContactPoint[] contacts = collision.contacts; for (int i = 0; i < contacts.Length; i++) { ContactPoint contact = contacts[i]; if (!((Object)(object)((ContactPoint)(ref contact)).thisCollider == (Object)(object)stickyCollider)) { continue; } if ((LayerMask.op_Implicit(stickyLayers) & (1 << collision.gameObject.layer)) == 0 || !IsContactPointWithinStickingDistance(((ContactPoint)(ref contact)).point)) { break; } isSticking = true; StickToSurface(collision, contact); PlayStickingSound(collision); parentObject = collision.gameObject; if ((Object)(object)parentObject != (Object)null) { DestroyNotifier destroyNotifier = parentObject.GetComponent(); if ((Object)(object)destroyNotifier == (Object)null) { destroyNotifier = parentObject.AddComponent(); } destroyNotifier.OnDestroyed += OnDestroyUnstickGrenade; } break; } } private bool IsContactPointWithinStickingDistance(Vector3 contactPoint) { //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_000d: 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_000f: Unknown result type (might be due to invalid IL or missing references) Vector3 val = stickyCollider.ClosestPoint(contactPoint); float num = Vector3.Distance(contactPoint, val); return num < stickingDistance; } private void StickToSurface(Collision collision, ContactPoint contact) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_005d: 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_006d: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0151: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)stickyCollider == (Object)null) { return; } if ((Object)(object)interactiveObject != (Object)null && interactiveObject.IsHeld) { interactiveObject.ForceBreakInteraction(); } savedPosition = ((Component)this).transform.position; savedRotation = ((Component)this).transform.rotation; Vector3 lossyScale = ((Component)this).transform.lossyScale; Rigidbody rigidbody = collision.rigidbody; Vector3 val = ((ContactPoint)(ref contact)).normal * embeddingDistance; if ((Object)(object)rigidbody != (Object)null) { ((Component)this).transform.position = ((ContactPoint)(ref contact)).point + val; FixedJoint component = ((Component)this).GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); } FixedJoint val2 = ((Component)this).gameObject.AddComponent(); ((Joint)val2).connectedBody = rigidbody; ((Joint)val2).breakForce = float.MaxValue; ((Joint)val2).breakTorque = float.MaxValue; grenadeRigidbody.useGravity = false; grenadeRigidbody.isKinematic = false; grenadeRigidbody.constraints = (RigidbodyConstraints)0; grenadeRigidbody.mass = massWhileStuck; SetCollidersToLayer(stickyCollider, "NoCol"); } else { GameObject val3 = new GameObject("DummyParent"); val3.transform.position = ((ContactPoint)(ref contact)).point; val3.transform.rotation = collision.transform.rotation; grenadeRigidbody.isKinematic = true; val3.transform.SetParent(collision.transform, true); ((Component)this).transform.SetParent(val3.transform, false); ((Component)this).transform.localScale = new Vector3(lossyScale.x / ((Component)this).transform.lossyScale.x, lossyScale.y / ((Component)this).transform.lossyScale.y, lossyScale.z / ((Component)this).transform.lossyScale.z); ((Component)this).transform.position = ((ContactPoint)(ref contact)).point + val; ((Component)this).transform.rotation = savedRotation; } } private void EnableStickyCollider() { if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = true; } } private void DisableStickyColliderTemporarily() { if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = false; } ((MonoBehaviour)this).StartCoroutine(ReenableStickyColliderAfterDelay()); } private IEnumerator ReenableStickyColliderAfterDelay() { yield return (object)new WaitForSeconds(regrabActivationDelay); EnableStickyCollider(); } private void PlayStickingSound(Collision collision) { if ((Object)(object)stickSoundSource != (Object)null && stickSounds.Length > 0 && ((playStickSoundForRigidbodiesOnly && (Object)(object)collision.rigidbody != (Object)null) || !playStickSoundForRigidbodiesOnly)) { int num = Random.Range(0, stickSounds.Length); stickSoundSource.clip = stickSounds[num]; stickSoundSource.Play(); } } private void OnDestroyUnstickGrenade() { if ((Object)(object)this == (Object)null) { return; } if ((Object)(object)parentObject != (Object)null) { DestroyNotifier component = parentObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.OnDestroyed -= OnDestroyUnstickGrenade; } parentObject = null; } FixedJoint component2 = ((Component)this).GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); } else if ((Object)(object)((Component)this).transform.parent != (Object)null) { ((Component)this).transform.SetParent((Transform)null); } if ((Object)(object)grenadeRigidbody != (Object)null) { grenadeRigidbody.isKinematic = false; grenadeRigidbody.detectCollisions = true; grenadeRigidbody.useGravity = true; grenadeRigidbody.constraints = (RigidbodyConstraints)0; } isSticking = false; if ((Object)(object)stickyCollider != (Object)null) { stickyCollider.enabled = false; } canStick = false; } private void SetCollidersToLayer(Collider collider, string layer) { ((Component)collider).gameObject.layer = LayerMask.NameToLayer(layer); } private IEnumerator HandleCookingSoundDelay() { isCookingCoroutineRunning = true; if (cookingSoundDelay > 0f) { yield return (object)new WaitForSeconds(cookingSoundDelay); } if ((Object)(object)cookingAudioSource != (Object)null && cookingClips.Length > 0) { int num = Random.Range(0, cookingClips.Length); cookingAudioSource.clip = cookingClips[num]; cookingAudioSource.Play(); } isCookingCoroutineRunning = false; } private void PlayCookingSoundImmediately() { if ((Object)(object)cookingAudioSource != (Object)null && cookingClips.Length > 0) { int num = Random.Range(0, cookingClips.Length); cookingAudioSource.clip = cookingClips[num]; cookingAudioSource.Play(); } } private void OnDestroy() { if ((Object)(object)parentObject != (Object)null) { DestroyNotifier component = parentObject.GetComponent(); if ((Object)(object)component != (Object)null) { component.OnDestroyed -= OnDestroyUnstickGrenade; } } } } public class DestroyNotifier : MonoBehaviour { public delegate void DestroyedAction(); public event DestroyedAction OnDestroyed; private void OnDestroy() { if (this.OnDestroyed != null) { this.OnDestroyed(); } } } } namespace ShermanJumbo { 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(); } } } } public class GrenadeTouchpadArm : MonoBehaviour { public PinnedGrenade Grenade; private FVRViveHand Hand; private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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) Hand = ((FVRInteractiveObject)Grenade).m_hand; if ((Object)(object)Hand == (Object)null) { return; } Vector2 touchpadAxes = Hand.Input.TouchpadAxes; if ((!Hand.IsInStreamlinedMode || !Hand.Input.AXButtonPressed) && (!Hand.Input.TouchpadPressed || !(((Vector2)(ref touchpadAxes)).magnitude > 0.2f) || !(Vector2.Angle(touchpadAxes, Vector2.down) <= 45f))) { return; } foreach (PinnedGrenadeRing ring in Grenade.m_rings) { ring.PopOutRoutine(); } Grenade.ReleaseLever(); } } public class GripSafety : MonoBehaviour { public FVRInteractiveObject Object; public Transform Safety; public bool IsRotation = true; public Vector3 SafetyUnheld; public Vector3 SafetyHeld; private void Update() { //IL_007a: 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_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (Object.IsHeld) { if (IsRotation) { Safety.localEulerAngles = SafetyHeld; } else { Safety.localPosition = SafetyHeld; } } else if (IsRotation) { Safety.localEulerAngles = SafetyUnheld; } else { Safety.localPosition = SafetyUnheld; } } } public class Guycot : FVRFireArm { [Header("Guycot Params")] public Transform Trigger; private float m_triggerFloat; public float TriggerForward; public float TriggerRearward; public float TriggerFiringThreshold = 0.85f; public float TriggerResetThreshold = 0.35f; private bool IsTriggerResetting = false; public Transform FiringPin; public float PinForward; public float PinSafety; public float PinRearward; public Transform Safety; public float SafetyOff; public bool isOnSafe = false; public Transform LoadingGate; public Transform LoadingGateClosed; public Transform LoadingGateOpen; public bool isGateOpen = false; public int ChamberIndex; private int PrevChamberIndex; public FVRFireArmChamber[] Chambers; public Transform[] Bucket; public Transform[] Linkage; public Vector3[] BucketLocalPos; public Quaternion[] BucketLocalRot; public Vector3[] LinkageLocalPos; public Quaternion[] LinkageLocalRot; public void ToggleSafety() { //IL_0058: 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) isOnSafe = !isOnSafe; if (isOnSafe) { Safety.localEulerAngles = new Vector3(0f, 0f, 0f); } else { Safety.localEulerAngles = new Vector3(SafetyOff, 0f, 0f); } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)14, 1f); } public void ToggleLoadingGate() { //IL_0045: 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) isGateOpen = !isGateOpen; if (isGateOpen) { LoadingGate.localPosition = LoadingGateOpen.localPosition; } else { LoadingGate.localPosition = LoadingGateClosed.localPosition; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)17, 1f); } public override void FVRUpdate() { ((FVRFireArm)this).FVRUpdate(); } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); if (!((FVRPhysicalObject)this).IsAltHeld) { m_triggerFloat = hand.Input.TriggerFloat; UpdateChainLogic(); UpdateFiringPin(); FVRFireArmChamber[] chambers = Chambers; foreach (FVRFireArmChamber val in chambers) { val.IsAccessible = false; } if (isGateOpen) { int num = (ChamberIndex - 10 + Chambers.Length) % Chambers.Length; Chambers[num].IsAccessible = true; } } } public void Fire() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) IsTriggerResetting = true; if (Chambers[ChamberIndex].IsFull) { Chambers[ChamberIndex].Fire(); ((FVRFireArm)this).Fire(Chambers[ChamberIndex], ((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(Chambers[ChamberIndex].GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { Chambers[ChamberIndex].IsSpent = false; Chambers[ChamberIndex].UpdateProxyDisplay(); } else { Chambers[ChamberIndex].SetRound((FVRFireArmRound)null, false); } } } public void UpdateChainLogic() { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00bd: 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) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_0129: 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) int num = Bucket.Length; float num2 = Mathf.InverseLerp(0f, TriggerFiringThreshold, m_triggerFloat); if (IsTriggerResetting && m_triggerFloat > 0f) { num2 = 0f; } for (int i = 0; i < num; i++) { int num3 = (i + PrevChamberIndex) % num; int num4 = (i + ChamberIndex) % num; Bucket[i].localPosition = Vector3.Lerp(BucketLocalPos[num3], BucketLocalPos[num4], num2); Linkage[i].localPosition = Vector3.Lerp(LinkageLocalPos[num3], LinkageLocalPos[num4], num2); Bucket[i].localRotation = Quaternion.Slerp(BucketLocalRot[num3], BucketLocalRot[num4], num2); Linkage[i].localRotation = Quaternion.Slerp(LinkageLocalRot[num3], LinkageLocalRot[num4], num2); } } public void UpdateFiringPin() { //IL_003a: 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_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.InverseLerp(0f, TriggerFiringThreshold, m_triggerFloat); Trigger.localPosition = new Vector3(0f, 0f, Mathf.Lerp(TriggerForward, TriggerRearward, num)); if (!IsTriggerResetting && m_triggerFloat >= TriggerFiringThreshold) { IsTriggerResetting = true; PrevChamberIndex = ChamberIndex; ChamberIndex = (ChamberIndex + 1) % Chambers.Length; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); if (!isOnSafe) { Fire(); } } if (IsTriggerResetting && m_triggerFloat <= TriggerResetThreshold) { IsTriggerResetting = false; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)16, 1f); } if (!IsTriggerResetting) { if (isOnSafe) { FiringPin.localPosition = new Vector3(0f, 0f, Mathf.Lerp(PinSafety, PinRearward, num)); } else { FiringPin.localPosition = new Vector3(0f, 0f, Mathf.Lerp(PinForward, PinRearward, num)); } } else { FiringPin.localPosition = new Vector3(0f, 0f, (!isOnSafe) ? PinForward : PinSafety); } } [ContextMenu("CalculatePoses")] public void CalculatePoses() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_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_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) for (int i = 0; i < Chambers.Length; i++) { ref Vector3 reference = ref BucketLocalPos[i]; reference = Bucket[i].localPosition; ref Quaternion reference2 = ref BucketLocalRot[i]; reference2 = Bucket[i].localRotation; ref Vector3 reference3 = ref LinkageLocalPos[i]; reference3 = Linkage[i].localPosition; ref Quaternion reference4 = ref LinkageLocalRot[i]; reference4 = Linkage[i].localRotation; if (i > 39) { break; } } } } } public class GuycotTrigger : FVRInteractiveObject { public Guycot Gun; public bool IsSafety; public bool IsLoadingGate; public bool IsCoverToggle; private bool IsCoverActive = false; public GameObject Cover; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); if (IsSafety) { Gun.ToggleSafety(); } if (IsLoadingGate) { Gun.ToggleLoadingGate(); } if (IsCoverToggle) { Cover.SetActive(IsCoverActive); IsCoverActive = !IsCoverActive; } } } namespace ShermanJumbo { public class HammergewehrHelper : MonoBehaviour { public DoubleBarreledClosedBoltWeapon Gun; public ManipulateTransforms MT1; public ManipulateTransforms MT2; public GameObject DummyTransform; public Transform Muzzle1; public Transform Muzzle2; private Vector3 OrigMuzz1Pos; private Vector3 OrigMuzz2Pos; public Transform ChamberPoint1; public Transform ChamberPoint2; private Vector3 OrigChamberPoint1; private Vector3 OrigChamberPoint2; public Transform RoundPos_Ejecting1; public Transform RoundPos_Ejection1; public Transform RoundPos_MagazinePos1; public Transform RoundPos_Ejecting2; public Transform RoundPos_Ejection2; public Transform RoundPos_MagazinePos2; private Vector3 OrigRoundPos_Ejecting1; private Vector3 OrigRoundPos_Ejection1; private Vector3 OrigRoundPos_MagazinePos1; private Vector3 OrigRoundPos_Ejecting2; private Vector3 OrigRoundPos_Ejection2; private Vector3 OrigRoundPos_MagazinePos2; public Vector3 EjectionSpeed = new Vector3(4f, 2.5f, -1.2f); public Vector3 EjectionSpin = new Vector3(20f, 180f, 30f); private Vector3 OrigEjectionSpeed = new Vector3(4f, 2.5f, -1.2f); private Vector3 OrigEjectionSpin = new Vector3(20f, 180f, 30f); private Vector3 OrigEjectionSpeed2 = new Vector3(4f, 2.5f, -1.2f); private Vector3 OrigEjectionSpin2 = new Vector3(20f, 180f, 30f); private bool WasFirstFire = false; 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) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //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_006f: 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_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_009b: 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_00b1: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) OrigMuzz1Pos = ((FVRFireArm)Gun).MuzzlePos.localPosition; OrigMuzz2Pos = Gun.SecondMuzzle.localPosition; OrigChamberPoint1 = ((Component)Gun.Chamber).transform.localPosition; OrigChamberPoint2 = ((Component)Gun.Chamber2).transform.localPosition; OrigRoundPos_Ejecting1 = Gun.RoundPos_Ejecting.localPosition; OrigRoundPos_Ejection1 = Gun.RoundPos_Ejection.localPosition; OrigRoundPos_MagazinePos1 = Gun.RoundPos_MagazinePos.localPosition; OrigRoundPos_Ejecting2 = Gun.RoundPos_Ejecting2.localPosition; OrigRoundPos_Ejection2 = Gun.RoundPos_Ejection2.localPosition; OrigRoundPos_MagazinePos2 = Gun.RoundPos_MagazinePos2.localPosition; OrigEjectionSpeed = Gun.EjectionSpeed; OrigEjectionSpin = Gun.EjectionSpin; OrigEjectionSpeed2 = Gun.EjectionSpeed2; OrigEjectionSpin2 = Gun.EjectionSpin2; Gun.Bolt.ImpartFiringImpulse(); } private void Update() { if (WasFirstFire != Gun.IsFirstFire) { SwapBarrelCluster(); } WasFirstFire = Gun.IsFirstFire; } public void SwapBarrelCluster() { //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_004f: 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_0080: 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_00ac: 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_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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) if (Gun.IsFirstFire) { ((FVRFireArm)Gun).MuzzlePos.localPosition = OrigMuzz1Pos; Gun.SecondMuzzle.localPosition = OrigMuzz2Pos; ((Component)Gun.Chamber).transform.localPosition = OrigChamberPoint1; ((Component)Gun.Chamber2).transform.localPosition = OrigChamberPoint2; Gun.RoundPos_Ejecting.localPosition = OrigRoundPos_Ejecting1; Gun.RoundPos_Ejection.localPosition = OrigRoundPos_Ejection1; Gun.RoundPos_MagazinePos.localPosition = OrigRoundPos_MagazinePos1; Gun.RoundPos_Ejecting2.localPosition = OrigRoundPos_Ejecting2; Gun.RoundPos_Ejection2.localPosition = OrigRoundPos_Ejection2; Gun.RoundPos_MagazinePos2.localPosition = OrigRoundPos_MagazinePos2; Gun.EjectionSpeed = OrigEjectionSpeed; Gun.EjectionSpin = OrigEjectionSpin; Gun.EjectionSpeed2 = OrigEjectionSpeed2; Gun.EjectionSpin2 = OrigEjectionSpin2; MT1.TransformGroups[0].ObservedTransform = ((Component)Gun.Bolt).gameObject.transform; MT2.TransformGroups[0].ObservedTransform = DummyTransform.transform; } else { ((FVRFireArm)Gun).MuzzlePos.localPosition = Muzzle1.localPosition; Gun.SecondMuzzle.localPosition = Muzzle2.localPosition; ((Component)Gun.Chamber).transform.localPosition = ChamberPoint1.localPosition; ((Component)Gun.Chamber2).transform.localPosition = ChamberPoint2.localPosition; Gun.RoundPos_Ejecting.localPosition = RoundPos_Ejecting1.localPosition; Gun.RoundPos_Ejection.localPosition = RoundPos_Ejection1.localPosition; Gun.RoundPos_MagazinePos.localPosition = RoundPos_MagazinePos1.localPosition; Gun.RoundPos_Ejecting2.localPosition = RoundPos_Ejecting2.localPosition; Gun.RoundPos_Ejection2.localPosition = RoundPos_Ejection2.localPosition; Gun.RoundPos_MagazinePos2.localPosition = RoundPos_MagazinePos2.localPosition; Gun.EjectionSpeed = EjectionSpeed; Gun.EjectionSpin = EjectionSpin; Gun.EjectionSpeed2 = EjectionSpeed; Gun.EjectionSpin2 = EjectionSpin; MT2.TransformGroups[0].ObservedTransform = ((Component)Gun.Bolt).gameObject.transform; MT1.TransformGroups[0].ObservedTransform = DummyTransform.transform; } ((FVRFireArm)Gun).UpdateCurrentMuzzle(); } } public class HandCrankAdvanced : FVRInteractiveObject { public OpenBoltReceiver Gun; private Vector3 m_curCrankDir; private float m_CrankDelta; private float m_crankedAmount; public bool m_isCrankHeld; public Transform YUpTarget; [Header("Gun Stuff")] public Transform GunBarrels; private float m_curRot; private float m_rotTilShot = 36f; public float CrankAnglePerShot = 360f; public float BarrelsAnglePerShot = 72f; public bool IsClicky = false; public AudioEvent ClickSound; public float RotToClick; private float remainingRotToClick; 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_curCrankDir = ((Component)this).transform.forward; m_rotTilShot = CrankAnglePerShot; remainingRotToClick = RotToClick; } public override void BeginInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).BeginInteraction(hand); m_isCrankHeld = true; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0048: 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_0054: 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_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 val = ((HandInput)(ref hand.Input)).Pos - ((Component)this).transform.position; Vector3 normalized = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.ProjectOnPlane(normalized, YUpTarget.up); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; float signedAngle = GetSignedAngle(m_curCrankDir, normalized2, YUpTarget.up); signedAngle = Mathf.Clamp(signedAngle, -20f, 20f); if (Mathf.Abs(signedAngle) > 0.01f) { if (signedAngle > 0f) { CrankGun(signedAngle); m_curCrankDir = normalized2; } m_curCrankDir = normalized2; ((Component)this).transform.rotation = Quaternion.LookRotation(m_curCrankDir, YUpTarget.up); } } private float GetSignedAngle(Vector3 from, Vector3 to, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Angle(from, to); float num2 = Mathf.Sign(Vector3.Dot(axis, Vector3.Cross(from, to))); return num * num2; } public void CrankGun(float delta) { //IL_0035: 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) m_curRot += delta; float num = BarrelsAnglePerShot / CrankAnglePerShot; GunBarrels.localEulerAngles = new Vector3(0f, 0f, m_curRot * num); m_rotTilShot -= delta; if (IsClicky) { remainingRotToClick -= delta; if (remainingRotToClick <= 0f) { ((FVRFireArm)Gun).PlayAudioAsHandling(ClickSound, ((Component)this).transform.position); remainingRotToClick += RotToClick; } } while (m_rotTilShot <= 0f) { FireShot(); m_rotTilShot += CrankAnglePerShot; } if (m_rotTilShot <= CrankAnglePerShot * 0.5f) { PrimeShot(); } } private void PrimeShot() { Gun.Bolt.SetBoltToRear(); Gun.EngageSeer(); } private void FireShot() { Gun.ReleaseSeer(); } public override void FVRUpdate() { ((FVRInteractiveObject)this).FVRUpdate(); } } public class HeatingEffectNoHeatWhileFiring : MonoBehaviour { public FirearmHeatingEffect HeatEffect; public FVRFireArm Weapon; private float CDRate = 0f; private void Start() { CDRate = HeatEffect.CooldownRate; } private void Update() { if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null && ((FVRInteractiveObject)Weapon).m_hand.Input.TriggerFloat >= 0.85f) { HeatEffect.CooldownRate = 0f; } else { HeatEffect.CooldownRate = CDRate; } } } public class LAPD2019LaserMaxDistance : MonoBehaviour { public GameObject BeamHitPoint; public Transform Aperture; public LayerMask LM; private RaycastHit m_hit; private bool m_isOn; public bool UsesAutoOnOff; public FVRPhysicalObject PO; public Transform Muzzle; public float MaxDistance = 1000f; public void TurnOn() { m_isOn = true; } public void TurnOff() { m_isOn = false; } private void Update() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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_009c: 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) //IL_00b3: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: 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_011b: 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_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) if (UsesAutoOnOff) { if (((FVRInteractiveObject)PO).IsHeld) { TurnOn(); } else { TurnOff(); } } if (m_isOn) { if ((Object)(object)Muzzle != (Object)null) { ((Component)Aperture).transform.LookAt(Muzzle.position + Muzzle.forward * 25f); ((Component)Aperture).transform.localEulerAngles = new Vector3(((Component)Aperture).transform.localEulerAngles.x, 0f, 0f); } if (!BeamHitPoint.activeSelf) { BeamHitPoint.SetActive(true); } Vector3 position = Aperture.position + Aperture.forward * MaxDistance; float num = MaxDistance; if (Physics.Raycast(Aperture.position, Aperture.forward, ref m_hit, MaxDistance, LayerMask.op_Implicit(LM), (QueryTriggerInteraction)1)) { position = ((RaycastHit)(ref m_hit)).point; num = ((RaycastHit)(ref m_hit)).distance; } float num2 = num * 0.01f; float num3 = Mathf.Lerp(0.01f, 0.2f, num2); BeamHitPoint.transform.position = position; BeamHitPoint.transform.localScale = new Vector3(num3, num3, num3); } else if (BeamHitPoint.activeSelf) { BeamHitPoint.SetActive(false); } } } public class LAPDLaserAsAttachment : MonoBehaviour { public LAPD2019Laser Laser; private void Awake() { Laser.m_isOn = true; } } public class LaserWeaponOverheatFix : MonoBehaviour { public LaserWeapon Weapon; public ParticleSystem OverheatPFX; public ParticleSystem[] WarningParticles; public float MaxEmission = 30f; public float WarningFraction = 0.4f; public AudioSource WarningSounds; public float MaxSoundVolume = 0.5f; public float MinPitch = 1f; public float MaxPitch = 1.5f; public bool UsesHinge = false; protected bool waitingToEject = false; public SimpleHinge Hinge; private void Start() { ParticleSystem[] warningParticles = WarningParticles; foreach (ParticleSystem val in warningParticles) { if (val.isPlaying) { val.Stop(); } } if ((Object)(object)WarningSounds != (Object)null) { WarningSounds.volume = 0f; if (!WarningSounds.isPlaying) { WarningSounds.Play(); } } if (UsesHinge) { Hinge.Unlatch(); } } private void Update() { //IL_00bc: 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_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Invalid comparison between Unknown and I4 //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) FVRFireArmMagazine magazine = ((FVRFireArm)Weapon).Magazine; LaserWeaponPowerCell val = (LaserWeaponPowerCell)(object)((magazine is LaserWeaponPowerCell) ? magazine : null); if ((Object)(object)val == (Object)null) { StopAllWarningPFX(); if ((Object)(object)WarningSounds != (Object)null) { WarningSounds.volume = 0f; } if (UsesHinge) { Hinge.Unlatch(); } return; } if (UsesHinge && val.CanPassivelyRegenerate) { Hinge.Latch(); } if (((FVRFireArmMagazine)val).FuelAmountLeft <= 0.3f) { if (!UsesHinge) { ((FVRFireArm)Weapon).PlayAudioAsHandling(Weapon.AudEvent_Overheat, ((Component)this).transform.position); ((FVRFireArm)Weapon).PlayAudioAsHandling(Weapon.AudEvent_End[0], ((Component)this).transform.position); val.CanPassivelyRegenerate = false; ((FVRFireArm)Weapon).EjectMag(false); OverheatPFX.Emit(15); Weapon.PSys_Disengage.Emit(20); } if (UsesHinge && !waitingToEject) { val.CanPassivelyRegenerate = false; ((FVRFireArm)Weapon).PlayAudioAsHandling(Weapon.AudEvent_Overheat, ((Component)this).transform.position); ((FVRFireArm)Weapon).PlayAudioAsHandling(Weapon.AudEvent_End[0], ((Component)this).transform.position); Hinge.Unlatch(); waitingToEject = true; OverheatPFX.Emit(15); Weapon.PSys_Disengage.Emit(20); } } if (UsesHinge && waitingToEject && (int)Hinge.m_hingeState == 2) { ((FVRFireArm)Weapon).EjectMag(false); waitingToEject = false; } if (((FVRFireArmMagazine)val).FuelAmountLeft < val.MaximumEnergyCapacity * WarningFraction) { float num = ((FVRFireArmMagazine)val).FuelAmountLeft / val.MaximumEnergyCapacity; ParticleSystem[] warningParticles = WarningParticles; foreach (ParticleSystem val2 in warningParticles) { if (!val2.isPlaying) { val2.Play(); } EmissionModule emission = val2.emission; float num2 = MaxEmission - MaxEmission * (num / WarningFraction); ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(num2); } if ((Object)(object)WarningSounds != (Object)null) { WarningSounds.volume = MaxSoundVolume - MaxSoundVolume * (num / WarningFraction); float num3 = Mathf.Clamp01(num / WarningFraction); WarningSounds.pitch = Mathf.Lerp(MaxPitch, MinPitch, num3); } } else { StopAllWarningPFX(); if ((Object)(object)WarningSounds != (Object)null) { WarningSounds.volume = 0f; } } } private void StopAllWarningPFX() { ParticleSystem[] warningParticles = WarningParticles; foreach (ParticleSystem val in warningParticles) { if (val.isPlaying) { val.Stop(); } } } } } public class LaserWeaponPowerCellChargeBar : MonoBehaviour { public LaserWeaponPowerCell Cell; public Transform BarCover; public float BarCoverYScaleMax; private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Vector3 localScale = BarCover.localScale; float fuelAmountLeft = ((FVRFireArmMagazine)Cell).FuelAmountLeft; float num = 1f - fuelAmountLeft / Cell.MaximumEnergyCapacity; localScale.y = 1f - num * BarCoverYScaleMax; BarCover.localScale = localScale; FVRFireArm fireArm = ((FVRFireArmMagazine)Cell).FireArm; LaserWeapon val = (LaserWeapon)(object)((fireArm is LaserWeapon) ? fireArm : null); if (((FVRFireArmMagazine)Cell).FuelAmountLeft > 0.3f) { if ((Object)(object)val == (Object)null) { Cell.CanPassivelyRegenerate = true; return; } FVRViveHand hand = ((FVRInteractiveObject)val).m_hand; if ((Object)(object)hand == (Object)null) { Cell.CanPassivelyRegenerate = true; } else if (hand.Input.TriggerFloat >= val.TriggerFiringThreshold) { Cell.CanPassivelyRegenerate = false; } else { Cell.CanPassivelyRegenerate = true; } } else { Cell.CanPassivelyRegenerate = false; } } } namespace ShermanJumbo { public class LeverActionTwinMag : MonoBehaviour { public LeverActionFirearm Gun; public FVRFireArmMagazine Mag1; public Transform LowerPathForward1; public Transform LowerPathRearward1; public FVRFireArmMagazine Mag2; public Transform LowerPathForward2; public Transform LowerPathRearward2; private void Update() { if (Mag1.HasARound()) { ((FVRFireArm)Gun).Magazine = Mag1; Gun.ReceiverLowerPathForward = LowerPathForward1; Gun.ReceiverLowerPathRearward = LowerPathRearward1; } else { ((FVRFireArm)Gun).Magazine = Mag2; Gun.ReceiverLowerPathForward = LowerPathForward2; Gun.ReceiverLowerPathRearward = LowerPathRearward2; } } } } 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> segments = new List>(); 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(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(start, val2)); segments.Add(new KeyValuePair(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.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 LightningBoltOnFire : MonoBehaviour { public FVRFireArm FireArm; public LightningBoltScript LightningBolt; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)FireArm) { LightningBolt.Trigger(); } } } } public class MagazineBeltBoxFlap : MonoBehaviour { public FVRFireArmMagazine Magazine; public Transform Flap; public Vector3 AngleUnattached; public Vector3 AngleAttached; private void Update() { //IL_0007: 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_0019: Unknown result type (might be due to invalid IL or missing references) if ((int)Magazine.State == 0) { Flap.localEulerAngles = AngleUnattached; } else { Flap.localEulerAngles = AngleAttached; } } } 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.Guycot_Chain_Pistol { [BepInPlugin("ShermanJumbo.Guycot_Chain_Pistol", "Guycot_Chain_Pistol", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class Guycot_Chain_PistolPlugin : 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.Guycot_Chain_Pistol"); OtherLoader.RegisterDirectLoad(BasePath, "ShermanJumbo.Guycot_Chain_Pistol", "", "", "shermanjumbo_guycotchainpistol", ""); } } } namespace ShermanJumbo { public class MeleeParamCopier : MonoBehaviour { public FVRPhysicalObject Base; public FVRPhysicalObject Target; [ContextMenu("Migrate")] public void Migrate() { //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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0405: Unknown result type (might be due to invalid IL or missing references) FVRPhysicalObject target = Target; target.MP.HandPoint = Base.MP.HandPoint; target.MP.EndPoint = Base.MP.EndPoint; target.MP.BaseDamageBCP = Base.MP.BaseDamageBCP; target.MP.HighDamageBCP = Base.MP.HighDamageBCP; target.MP.StabDamageBCP = Base.MP.StabDamageBCP; target.MP.TearDamageBCP = Base.MP.TearDamageBCP; target.MP.HighDamageColliders = Base.MP.HighDamageColliders; target.MP.HighDamageVectors = Base.MP.HighDamageVectors; target.MP.DoesCyclePosePoints = Base.MP.DoesCyclePosePoints; target.MP.PosePoints = Base.MP.PosePoints; target.MP.IsThrownDisposable = Base.MP.IsThrownDisposable; target.MP.m_isThrownAutoAim = Base.MP.m_isThrownAutoAim; target.MP.ThrownDetectMask = Base.MP.ThrownDetectMask; target.MP.StartThrownDisposalTickdownOnSpawn = Base.MP.StartThrownDisposalTickdownOnSpawn; target.MP.IsLongThrowable = Base.MP.IsLongThrowable; target.MP.IsThrowableDirInverted = Base.MP.IsThrowableDirInverted; target.MP.CanNewStab = Base.MP.CanNewStab; target.MP.BladeLength = Base.MP.BladeLength; target.MP.MassWhileStabbed = Base.MP.MassWhileStabbed; target.MP.StabDirection = Base.MP.StabDirection; target.MP.StabAngularThreshold = Base.MP.StabAngularThreshold; target.MP.StabColliders = Base.MP.StabColliders; target.MP.StabVelocityRequirement = Base.MP.StabVelocityRequirement; target.MP.CanTearOut = Base.MP.CanTearOut; target.MP.TearOutVelThreshold = Base.MP.TearOutVelThreshold; target.MP.CanNewLodge = Base.MP.CanNewLodge; target.MP.LodgeDepth = Base.MP.LodgeDepth; target.MP.MassWhileLodged = Base.MP.MassWhileLodged; target.MP.LodgeDirections = Base.MP.LodgeDirections; target.MP.LodgeColliders = Base.MP.LodgeColliders; target.MP.LodgeVelocityRequirement = Base.MP.LodgeVelocityRequirement; target.MP.DeLodgeVelocityRequirement = Base.MP.DeLodgeVelocityRequirement; target.MP.UsesSweepTesting = Base.MP.UsesSweepTesting; target.MP.UsesSweepDebug = Base.MP.UsesSweepDebug; target.MP.TestCols = Base.MP.TestCols; target.MP.SweepTransformStart = Base.MP.SweepTransformStart; target.MP.SweepTransformEnd = Base.MP.SweepTransformEnd; target.MP.LM_DamageTest = Base.MP.LM_DamageTest; } } public class MicroMissiles : MonoBehaviour { public OpenBoltReceiver Gun; public Transform LauncherMuzzle; private Transform OrigMuzzle; public FVRFireArmMagazine LauncherMag; private FVRFireArmMagazine OldMag; public Transform Launcher; public float LauncherRaiseLowerSpeed = 4f; public float LauncherRefillTime = 1f; private float curRefillTimer = 1f; public FireArmRoundClass RoundType; private bool LauncherMode = false; private bool LauncherUp = false; private bool IsMoving = false; public float LauncherYUp; private float lerp = 0f; public GameObject MagTrigger; public GameObject BeltGrabTrigger; public FVRFirearmBeltDisplayData DD; public AudioEvent AudioLauncherUp; public AudioEvent AudioLauncherDown; private void Update() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) FVRViveHand hand = ((FVRInteractiveObject)Gun).m_hand; if ((Object)(object)hand != (Object)null && ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f))) { SwapFiremodes(); } } private void FixedUpdate() { if (IsMoving) { UpdatePosition(); } UpdateMagRefillLogic(); } public void UpdateMagRefillLogic() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) LauncherMag.UpdateBulletDisplay(); if ((Object)(object)((FVRInteractiveObject)Gun).m_hand != (Object)null && ((FVRInteractiveObject)Gun).m_hand.Input.TriggerFloat >= Gun.TriggerFiringThreshold && LauncherMode) { curRefillTimer = LauncherRefillTime; } else if (LauncherMag.m_numRounds < 6) { curRefillTimer -= Time.fixedDeltaTime; if (curRefillTimer <= 0f) { LauncherMag.AddRound(RoundType, false, true); curRefillTimer = LauncherRefillTime; } } else { curRefillTimer = LauncherRefillTime; } } public void SwapFiremodes() { //IL_0175: 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) if (!LauncherMode) { OrigMuzzle = ((FVRFireArm)Gun).MuzzlePos; if ((Object)(object)((FVRFireArm)Gun).Magazine != (Object)null) { OldMag = ((FVRFireArm)Gun).Magazine; } } LauncherMode = !LauncherMode; ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)14, 1f); IsMoving = true; Gun.Bolt.ImpartFiringImpulse(); if (LauncherMode) { if ((Object)(object)OldMag != (Object)null) { ((Component)OldMag.BeltGrabTrigger).gameObject.SetActive(false); } DD.ForceRelease(); ((FVRFireArm)Gun).Magazine = null; ((FVRFireArm)Gun).MuzzlePos = LauncherMuzzle; ((FVRFireArm)Gun).UpdateCurrentMuzzle(); ((FVRFireArm)Gun).Magazine = LauncherMag; MagTrigger.SetActive(false); BeltGrabTrigger.SetActive(false); ((FVRFireArm)Gun).PlayAudioAsHandling(AudioLauncherUp, ((Component)this).transform.position); } if (!LauncherMode) { ((FVRFireArm)Gun).Magazine = null; ((FVRFireArm)Gun).MuzzlePos = OrigMuzzle; ((FVRFireArm)Gun).UpdateCurrentMuzzle(); ((FVRFireArm)Gun).PlayAudioAsHandling(AudioLauncherDown, ((Component)this).transform.position); if ((Object)(object)OldMag != (Object)null) { ((FVRFireArm)Gun).Magazine = OldMag; ((Component)OldMag.BeltGrabTrigger).gameObject.SetActive(true); DD.m_isBeltGrabbed = false; DD.m_isStraightAngle = false; DD.Firearm.ConnectedToBox = true; DD.Firearm.HasBelt = true; DD.PullPushBelt(OldMag, DD.BeltCapacity); DD.UpdateProxyRounds(0); ((FVRFireArm)Gun).UpdateCurrentMuzzle(); } MagTrigger.SetActive(true); BeltGrabTrigger.SetActive(true); } } public void UpdatePosition() { //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_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) lerp += LauncherRaiseLowerSpeed * Time.deltaTime; lerp = Mathf.Clamp01(lerp); float y = Launcher.localPosition.y; float num = ((!LauncherMode) ? 0f : LauncherYUp); Vector3 localPosition = Launcher.localPosition; localPosition.y = Mathf.Lerp(y, num, lerp); Launcher.localPosition = localPosition; if (Mathf.Abs(localPosition.y - num) < 0.005f) { LauncherUp = LauncherMode; IsMoving = false; lerp = 0f; } } } public class MinigunBoxExtra : MonoBehaviour { public MinigunBox Mag; public GameObject Bullets; public Transform Rotate; public float RotateMax = 360f; private float MaxRnds; private void Start() { MaxRnds = Mag.NumBulletsLeft; } private void Update() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) if (Mag.NumBulletsLeft < 1) { Bullets.SetActive(false); } else { Bullets.SetActive(true); } float num = (float)Mag.NumBulletsLeft / MaxRnds; Rotate.localEulerAngles = new Vector3(0f, 0f, (1f - num) * RotateMax); } } public class MinigunExtraBarrelVisual : MonoBehaviour { public Minigun Minigun; public Transform Barrel; public Renderer BarrelRend; private Material barrelMat; public bool HeatsUp = true; private void Start() { barrelMat = BarrelRend.material; } private void Update() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) Barrel.localEulerAngles = new Vector3(0f, 0f, Minigun.m_foreRot); if (HeatsUp) { barrelMat.SetFloat("_EmissionWeight", Minigun.m_heat * Minigun.m_heat); } } } public class MinigunMultipleMuzzles : MonoBehaviour { public Minigun Minigun; private int CurrentRoundCount; private int PreviousRoundCount; public Transform[] Muzzles; private int MuzzleIndex; private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown MinigunBox val = (MinigunBox)((FVRFireArm)Minigun).Magazine; if ((Object)(object)val == (Object)null) { return; } CurrentRoundCount = val.NumBulletsLeft; if (CurrentRoundCount < PreviousRoundCount) { MuzzleIndex++; if (MuzzleIndex > Muzzles.Length - 1) { MuzzleIndex = 0; } ((FVRFireArm)Minigun).MuzzlePos = Muzzles[MuzzleIndex]; ((FVRFireArm)Minigun).UpdateCurrentMuzzle(); } PreviousRoundCount = CurrentRoundCount; } } public class MinigunOverheat : MonoBehaviour { public Minigun Minigun; public float MaxFireTime = 6f; public float CooldownTime = 2.5f; public float TimeSpentFiring = 0f; public Renderer BarrelRend; private bool IsOverheated = false; private MinigunBox Box; public AudioSource OverheatingSounds; public float MaxVolume = 0.6f; public AudioEvent OverheatedClip; private Material barrelMat; private void Start() { barrelMat = BarrelRend.material; OverheatingSounds.Play(); OverheatingSounds.volume = 0f; } private void Update() { //IL_0116: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Box == (Object)null) { ref MinigunBox box = ref Box; FVRFireArmMagazine magazine = ((FVRFireArm)Minigun).Magazine; box = (MinigunBox)(object)((magazine is MinigunBox) ? magazine : null); if ((Object)(object)Box == (Object)null) { return; } } float num = TimeSpentFiring / MaxFireTime; num = Mathf.Clamp01(num); barrelMat.SetFloat("_EmissionWeight", num * num); OverheatingSounds.volume = num * MaxVolume; if (Minigun.m_isTriggerEngaged && !IsOverheated) { TimeSpentFiring += Time.deltaTime; } else if (!Minigun.m_isTriggerEngaged && !IsOverheated) { TimeSpentFiring -= Time.deltaTime; } if (!IsOverheated && TimeSpentFiring >= MaxFireTime) { IsOverheated = true; DepleteAmmo(); SM.PlayCoreSound((FVRPooledAudioType)11, OverheatedClip, ((Component)this).transform.position); } if (IsOverheated) { TimeSpentFiring -= MaxFireTime / CooldownTime * Time.deltaTime; if (TimeSpentFiring <= 0f) { IsOverheated = false; RefillAmmo(); } } TimeSpentFiring = Mathf.Clamp(TimeSpentFiring, 0f, MaxFireTime); } public void DepleteAmmo() { Box.NumBulletsLeft = 0; } public void RefillAmmo() { Box.NumBulletsLeft = 2000; } } public class Miniskulls : FVRPhysicalObject { [Serializable] public class MiniskullsPose { public string ExpressionName; public Vector2 MouthMatOffset; public Vector2 EyesMatOffset; } public MeshRenderer Head; private Material EyesMat; private Material MouthMat; private int currentPose = 0; public MiniskullsPose[] Poses; public override void Awake() { ((FVRPhysicalObject)this).Awake(); MouthMat = ((Renderer)Head).materials[1]; EyesMat = ((Renderer)Head).materials[2]; } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown)) { CyclePose(); } } public void CyclePose() { //IL_0040: 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) currentPose++; if (currentPose > Poses.Length - 1) { currentPose = 0; } EyesMat.mainTextureOffset = Poses[currentPose].EyesMatOffset; MouthMat.mainTextureOffset = Poses[currentPose].MouthMatOffset; } } 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); } Weapon.IsFirstFire = !Weapon.IsFirstFire; } 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 DoubleBarrelClosedBoltWeaponChargingHandle 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 m_primedBombs = new List(); [Header("Double Barrel Config")] public FVRFireArmChamber Chamber2; public Transform SecondMuzzle; public bool IsFirstFire; public bool SafetyChangesBoltSpeed = false; public Vector3 NewForwardBackwardStiff; private float BoltForwardOrig; private float BoltRearwardOrig; private float BoltStiffOrig; private bool IsSecondSpeed = false; [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(); m_proxy.Init(((Component)this).transform); GameObject val2 = new GameObject("m_proxyRound2"); m_proxy2 = val2.AddComponent(); m_proxy2.Init(((Component)this).transform); if (SafetyChangesBoltSpeed) { BoltForwardOrig = Bolt.Speed_Forward; BoltRearwardOrig = Bolt.Speed_Rearward; BoltStiffOrig = Bolt.SpringStiffness; } } 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(); if (SafetyChangesBoltSpeed) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f); IsSecondSpeed = !IsSecondSpeed; if (IsSecondSpeed) { Bolt.Speed_Forward = NewForwardBackwardStiff.x; Bolt.Speed_Rearward = NewForwardBackwardStiff.y; Bolt.SpringStiffness = NewForwardBackwardStiff.z; } else { Bolt.Speed_Forward = BoltForwardOrig; Bolt.Speed_Rearward = BoltRearwardOrig; Bolt.SpringStiffness = BoltStiffOrig; } } } 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 GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List list = new List(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List 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 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 GetFlagDic() { Dictionary 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 ChainsawAnimator : MonoBehaviour { public Chainsaw Saw; public float SpeedMod = 0f; public float SpeedModIdle = 0.2f; public float IntensityMod = 2f; public Animator Anim; public bool IsDebug = false; private void Update() { if (!IsDebug) { if (!Saw.m_isRunning) { SpeedMod = 0f; } if (Saw.m_isRunning) { if (Saw.m_sawingIntesity < 0.1f) { SpeedMod = SpeedModIdle; } else { SpeedMod = Saw.m_sawingIntesity * IntensityMod; } } } Anim.speed = SpeedMod; } } 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 references) ((FVRInteractiveObject)this).EndInteraction(hand); float num = Mathf.Abs(m_curZ - ChamberPoint_Back.localPosition.z); float num2 = Mathf.Abs(m_curZ - ChamberPoint_Forward.localPosition.z); if (num < ZThreshold * 2f) { m_tarZ = ChamberPoint_Back.localPosition.z; } else if (num2 < ZThreshold * 2f) { m_tarZ = ChamberPoint_Forward.localPosition.z; } } public override void BeginInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).BeginInteraction(hand); m_timeHeld = 0f; } public override void FVRUpdate() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_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 references) //IL_00a8: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); m_timeHeld += Time.deltaTime; if (!(Mathf.Abs(m_curZ - m_tarZ) > 0.001f)) { return; } m_curZ = Mathf.MoveTowards(m_curZ, m_tarZ, Time.deltaTime * 1f); ((Component)CG.Chamber).transform.localPosition = new Vector3(((Component)CG.Chamber).transform.localPosition.x, ((Component)CG.Chamber).transform.localPosition.y, m_curZ); float num = Mathf.Abs(m_curZ - ChamberPoint_Back.localPosition.z); float num2 = Mathf.Abs(m_curZ - ChamberPoint_Forward.localPosition.z); ChamberSlideState cSState = CSState; if (num < ZThreshold) { CSState = ChamberSlideState.Out; } else if (num2 < ZThreshold) { CSState = ChamberSlideState.In; } else { CSState = ChamberSlideState.Middle; } if (CSState == ChamberSlideState.Out && cSState != ChamberSlideState.Out) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_ShellOut, ((Component)this).transform.position); if (m_timeHeld > 0.2f) { FVRFireArmRound val = CG.Chamber.EjectRound(((Component)ChamberPoint_Back).transform.position, ChamberPoint_Back.forward * 0.1f, Vector3.zero, false); if (((FVRInteractiveObject)this).IsHeld) { FVRViveHand hand = base.m_hand; hand.ForceSetInteractable((FVRInteractiveObject)(object)val); ((FVRInteractiveObject)val).BeginInteraction(hand); } CG.FixCOM(); } } else if (CSState == ChamberSlideState.In && cSState != 0) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_ShellIn, ((Component)this).transform.position); ((FVRInteractiveObject)this).ForceBreakInteraction(); CG.FixCOM(); } else if (CSState == ChamberSlideState.Middle && cSState == ChamberSlideState.In) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_ShellOutStart, ((Component)this).transform.position); } else if (CSState == ChamberSlideState.Middle && cSState == ChamberSlideState.Out) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_ShellInStart, ((Component)this).transform.position); } } } public class GR8TailLatch : FVRInteractiveObject { public enum CGLatchType { Main, Lock } public enum CGLatchState { Closed, Middle, Open } public GR8RecoillessRifle CG; public CGLatchType LType; public CGLatchState LState; public float RotMin; public float RotMax; public bool IsMinOpen; public AudioEvent AudEvent_Open; public AudioEvent AudEvent_Close; public Transform BaseZeroDir; private float m_curRot; private float m_tarRot; public bool DisablesUseWhenNotInGivenState = true; public GR8TailLatch RestrictingLatch; public CGLatchState RequiredState = CGLatchState.Open; public bool DoesPartialChamberingBlock; public bool IsOpen() { return LState == CGLatchState.Open; } public override bool IsInteractable() { return (!DoesPartialChamberingBlock || !CG.Chamber.IsFull || CG.ShellInsertEject.CSState == GR8ShellInsertEject.ChamberSlideState.In) && (!DisablesUseWhenNotInGivenState || RestrictingLatch.LState == RequiredState) && ((FVRInteractiveObject)this).IsInteractable(); } public override void UpdateInteraction(FVRViveHand hand) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 val = ((HandInput)(ref hand.Input)).Pos - ((Component)this).transform.position; val = Vector3.ProjectOnPlane(val, BaseZeroDir.up); float signedAngle = GetSignedAngle(val, BaseZeroDir.forward, BaseZeroDir.up); signedAngle = Mathf.Clamp(signedAngle, RotMin, RotMax); m_tarRot = signedAngle; } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); float num = Mathf.Abs(m_curRot - RotMin); float num2 = Mathf.Abs(m_curRot - RotMax); if (num < num2) { m_tarRot = RotMin; } else { m_tarRot = RotMax; } } public override void FVRUpdate() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (!(Mathf.Abs(m_curRot - m_tarRot) > 0.001f)) { return; } m_curRot = Mathf.MoveTowards(m_curRot, m_tarRot, Time.deltaTime * 900f); ((Component)this).transform.localEulerAngles = new Vector3(0f, m_curRot, 0f); float num = Mathf.Abs(m_curRot - RotMin); float num2 = Mathf.Abs(m_curRot - RotMax); CGLatchState lState = LState; if (num < 1f) { if (IsMinOpen) { LState = CGLatchState.Open; } else { LState = CGLatchState.Closed; } } else if (num2 < 1f) { if (IsMinOpen) { LState = CGLatchState.Closed; } else { LState = CGLatchState.Open; } } else { LState = CGLatchState.Middle; } if (LState == CGLatchState.Closed && lState != 0) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_Close, ((Component)this).transform.position); } else if (LState == CGLatchState.Open && lState != CGLatchState.Open) { ((FVRFireArm)CG).PlayAudioAsHandling(AudEvent_Open, ((Component)this).transform.position); } } public float GetSignedAngle(Vector3 from, Vector3 to, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: 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_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0013: 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_001a: 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_0027: 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) Vector3 val = Vector3.ProjectOnPlane(from, axis); from = ((Vector3)(ref val)).normalized; Vector3 val2 = Vector3.Cross(axis, to); float num = Mathf.Sign(Vector3.Dot(from, val2)); float num2 = Vector3.Angle(from, to); return num2 * num; } } public class ModularBreakActionLever : ModularWeaponPart { [Header("Latch Params")] public Transform Latch; public Axis LatchAxis = (Axis)1; public float MaxRotExtent; private Transform OrigLatch; private Axis OrigLatchAxis = (Axis)1; private float OrigMaxRotExtent; protected BreakActionWeapon _boWeapon; public override void EnablePart() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) ((ModularWeaponPart)this).EnablePart(); _boWeapon = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)_boWeapon != (Object)null) { OrigLatch = _boWeapon.Latch; OrigLatchAxis = _boWeapon.LatchAxis; OrigMaxRotExtent = _boWeapon.MaxRotExtent; _boWeapon.Latch = Latch; _boWeapon.LatchAxis = LatchAxis; _boWeapon.MaxRotExtent = MaxRotExtent; } else if ((Object)(object)_boWeapon == (Object)null) { ModularWorkshopManager.LogWarning((MonoBehaviour)(object)this, "Break Action Weapon not found! Lever disabled!"); } } public override void DisablePart() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) ((ModularWeaponPart)this).DisablePart(); _boWeapon = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)_boWeapon != (Object)null) { _boWeapon.Latch = OrigLatch; _boWeapon.LatchAxis = OrigLatchAxis; _boWeapon.MaxRotExtent = OrigMaxRotExtent; } } } public class ModularBreakActionWeaponBarrels : ModularWeaponPart { [Header("Barrels Params")] public BreakActionBarrel[] Barrels; public Transform MuzzleCenter; public bool ChangesBreakOpenAngle; public float OpenAngle = 30f; public float EjectAngle = 25f; private float OGOpenAngle; private float OGEjectAngle; public bool UsesManuallyCockedHammers = false; private bool UsedManualHammers = false; public FireArmRoundType RoundType; protected BreakActionWeapon _boWeapon; public bool ChangesMuzzleState = false; public MuzzleState MuzzleState; public FVRFireArmMechanicalAccuracyClass MuzzleDamping; public bool ChangesMuzzleFire = false; public MuzzleEffectEntry MuzzleFire; public int[] MuzzleFireValuesToReplace; public override void EnablePart() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) ((ModularWeaponPart)this).EnablePart(); _boWeapon = ((Component)((Component)this).transform).GetComponentInParent(); if (!((Object)(object)_boWeapon != (Object)null)) { return; } OGOpenAngle = _boWeapon.HingeLimit; OGEjectAngle = _boWeapon.HingeEjectLimit; ((FVRFireArm)_boWeapon).FChambers.Clear(); _boWeapon.Barrels = Barrels; if (ChangesBreakOpenAngle) { _boWeapon.HingeLimit = OpenAngle; _boWeapon.HingeEjectLimit = EjectAngle; if ((Object)(object)_boWeapon.Hinge != (Object)null) { JointSpring spring = _boWeapon.Hinge.spring; spring.targetPosition = OpenAngle; _boWeapon.Hinge.spring = spring; } } if (_boWeapon.UsesManuallyCockedHammers) { UsedManualHammers = true; } if (UsesManuallyCockedHammers) { _boWeapon.UsesManuallyCockedHammers = true; } ((FVRFireArm)_boWeapon).RoundType = RoundType; ((FVRPhysicalObject)_boWeapon).ObjectWrapper.RoundType = RoundType; if (ChangesMuzzleState) { ((FVRFireArm)_boWeapon).DefaultMuzzleState = MuzzleState; ((FVRFireArm)_boWeapon).DefaultMuzzleDamping = MuzzleDamping; } if (ChangesMuzzleFire) { int[] muzzleFireValuesToReplace = MuzzleFireValuesToReplace; foreach (int num in muzzleFireValuesToReplace) { ((FVRFireArm)_boWeapon).MuzzleEffects[num].Entry = MuzzleFire; ((FVRFireArm)_boWeapon).RegenerateMuzzleEffects((MuzzleDevice)null); } } BreakActionBarrel[] barrels = Barrels; foreach (BreakActionBarrel val in barrels) { ((FVRFireArm)_boWeapon).FChambers.Add(val.Chamber); val.Chamber.Firearm = (FVRFireArm)(object)_boWeapon; ((FVRFireArm)_boWeapon).GasOutEffects[val.GasOutIndexBarrel].Parent = val.Muzzle; ((Component)((FVRFireArm)_boWeapon).GasOutEffects[val.GasOutIndexBarrel].PSystem).gameObject.transform.localPosition = Vector3.zero; ((FVRFireArm)_boWeapon).GasOutEffects[val.GasOutIndexBreach].Parent = ((Component)val.Chamber).transform; ((Component)((FVRFireArm)_boWeapon).GasOutEffects[val.GasOutIndexBreach].PSystem).gameObject.transform.localPosition = Vector3.zero; } } public override void DisablePart() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: 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) ((ModularWeaponPart)this).DisablePart(); _boWeapon = ((Component)((Component)this).transform).GetComponentInParent(); if (!((Object)(object)_boWeapon != (Object)null)) { return; } ((FVRFireArm)_boWeapon).FChambers.Clear(); _boWeapon.Barrels = null; if (!UsedManualHammers && UsesManuallyCockedHammers) { _boWeapon.UsesManuallyCockedHammers = false; } _boWeapon.HingeLimit = OGOpenAngle; _boWeapon.HingeEjectLimit = OGEjectAngle; ((FVRFireArm)_boWeapon).DefaultMuzzleState = (MuzzleState)0; ((FVRFireArm)_boWeapon).DefaultMuzzleDamping = (FVRFireArmMechanicalAccuracyClass)0; if (ChangesMuzzleFire) { int[] muzzleFireValuesToReplace = MuzzleFireValuesToReplace; foreach (int num in muzzleFireValuesToReplace) { ((FVRFireArm)_boWeapon).MuzzleEffects[num].Entry = (MuzzleEffectEntry)11; } } if ((Object)(object)_boWeapon.Hinge != (Object)null) { JointSpring spring = _boWeapon.Hinge.spring; spring.targetPosition = OGOpenAngle; _boWeapon.Hinge.spring = spring; } } } public class ModularBreakActionWeaponGasTweak : MonoBehaviour { public ModularBreakActionWeapon Weapon; private void Update() { int num = ((BreakActionWeapon)Weapon).Barrels.Length * 2; for (int i = 0; i < ((FVRFireArm)Weapon).GasOutEffects.Length; i++) { bool active = i < num; ParticleSystem pSystem = ((FVRFireArm)Weapon).GasOutEffects[i].PSystem; if ((Object)(object)pSystem != (Object)null) { ((Component)pSystem).gameObject.SetActive(active); } } } } public class ModularShotgunFireModePart : ModularWeaponPart { public bool FireAllBarrels = false; protected ModularTubeFedMultiBarrelShotgun TubeGun; protected ModularBreakActionWeapon BreakGun; public override void EnablePart() { ((ModularWeaponPart)this).EnablePart(); BreakGun = ((Component)((Component)this).transform).GetComponentInParent(); TubeGun = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)BreakGun != (Object)null) { ((BreakActionWeapon)BreakGun).FireAllBarrels = FireAllBarrels; } if ((Object)(object)TubeGun != (Object)null) { TubeGun.FireAllBarrels = FireAllBarrels; } } } public class ModularTubeFedMultiBarrelShotgun : FVRFireArm, IModularWeapon { public enum ShotgunMode { PumpMode, Automatic } public bool PlayOneShotSound = false; [Header("Shotgun Params")] public ModularTubeFedMultiBarrelShotgunBolt Bolt; public ModularTubeFedMultiBarrelShotgunHandle Handle; public FVRFireArmChamber Chamber; public bool HasHandle; [Header("Component Connections")] public Transform Trigger; public Transform Safety; public GameObject ReloadTriggerWell; [Header("Carrier System")] public bool UsesAnimatedCarrier; public Transform Carrier; public Vector2 CarrierRots; public Transform CarrierComparePoint1; public Transform CarrierComparePoint2; public float CarrierDetectDistance; private float m_curCarrierRot; private float m_tarCarrierRot; [Header("Round Positions")] public Transform RoundPos_LowerPath_Forward; public Transform RoundPos_LowerPath_Rearward; public Transform RoundPos_UpperPath_Forward; public Transform RoundPos_UpperPath_Rearward; public Transform RoundPos_Ejecting; public Transform RoundPos_Ejection; public Vector3 RoundEjectionSpeed; public Vector3 RoundEjectionSpin; private FVRFirearmMovingProxyRound m_proxy; private bool m_isExtractedRoundOnLowerPath = true; [Header("Trigger Params")] public bool HasTrigger; public InterpStyle TriggerInterp; public Axis TriggerAxis; public float TriggerUnheld; public float TriggerHeld; public float TriggerResetThreshold = 0.45f; public float TriggerBreakThreshold = 0.85f; private float m_triggerFloat; private bool m_hasTriggerReset = true; public bool UsesSlamFireTrigger; [Header("Safety Params")] public bool HasSafety; public InterpStyle Safety_Interp; public Axis SafetyAxis; public float SafetyOff; public float SafetyOn; private bool m_isSafetyEngaged = true; private bool m_isHammerCocked; [Header("Control Params")] public bool HasSlideReleaseButton; [HideInInspector] public bool IsSlideReleaseButtonHeld; [Header("Mode Params")] public bool CanModeSwitch; public ShotgunMode Mode; private bool m_isChamberRoundOnExtractor; private bool m_isChamber2RoundOnExtractor; private bool m_isChamber3RoundOnExtractor; [Header("Multi Barrel Params")] public FVRFireArmChamber Chamber2; public Transform Muzzle2; private FVRFirearmMovingProxyRound m_proxy2; private bool m_isHammer2Cocked; public Transform RoundPos_Ejection2; public FVRFireArmChamber Chamber3; public Transform Muzzle3; private FVRFirearmMovingProxyRound m_proxy3; private bool m_isHammer3Cocked; public Transform RoundPos_Ejection3; public bool FireAllBarrels = false; public int CurrentChamber = 1; [Header("Modular Configuration")] public ModularFVRFireArm ModularFVRFireArm; public bool AllowExternalBoltReleaseButtonModification = true; public bool IsSafetyEngaged => m_isSafetyEngaged; public bool IsHammerCocked => m_isHammerCocked; public GameObject UIPrefab => ModularFVRFireArm.UIPrefab; public string ModularBarrelPartsID => ModularFVRFireArm.ModularBarrelAttachmentPoint.ModularPartsGroupID; public Transform ModularBarrelPoint => ModularFVRFireArm.ModularBarrelAttachmentPoint.ModularPartPoint; public TransformProxy ModularBarrelUIPointProxy => ModularFVRFireArm.ModularBarrelAttachmentPoint.ModularPartUIPointProxy; public Dictionary ModularBarrelPrefabsDictionary => ModularFVRFireArm.ModularBarrelPrefabsDictionary; public string ModularHandguardPartsID => ModularFVRFireArm.ModularHandguardAttachmentPoint.ModularPartsGroupID; public Transform ModularHandguardPoint => ModularFVRFireArm.ModularHandguardAttachmentPoint.ModularPartPoint; public TransformProxy ModularHandguardUIPointProxy => ModularFVRFireArm.ModularHandguardAttachmentPoint.ModularPartUIPointProxy; public Dictionary ModularHandguardPrefabsDictionary => ModularFVRFireArm.ModularHandguardPrefabsDictionary; public string ModularStockPartsID => ModularFVRFireArm.ModularStockAttachmentPoint.ModularPartsGroupID; public Transform ModularStockPoint => ModularFVRFireArm.ModularStockAttachmentPoint.ModularPartPoint; public TransformProxy ModularStockUIPointProxy => ModularFVRFireArm.ModularStockAttachmentPoint.ModularPartUIPointProxy; public Dictionary ModularStockPrefabsDictionary => ModularFVRFireArm.ModularStockPrefabsDictionary; public string SelectedModularBarrel => ModularFVRFireArm.ModularBarrelAttachmentPoint.SelectedModularWeaponPart; public string SelectedModularHandguard => ModularFVRFireArm.ModularHandguardAttachmentPoint.SelectedModularWeaponPart; public string SelectedModularStock => ModularFVRFireArm.ModularStockAttachmentPoint.SelectedModularWeaponPart; public ModularWeaponPartsAttachmentPoint[] ModularWeaponPartsAttachmentPoints => ModularFVRFireArm.ModularWeaponPartsAttachmentPoints; public ModularWorkshopPlatform WorkshopPlatform { get { return ModularFVRFireArm.WorkshopPlatform; } set { ModularFVRFireArm.WorkshopPlatform = value; } } public List SubAttachmentPoints => ModularFVRFireArm.SubAttachmentPoints; public ModularFVRFireArm GetModularFVRFireArm => ModularFVRFireArm; public Dictionary AllAttachmentPoints => ModularFVRFireArm.AllAttachmentPoints; public bool HasExtractedRound() { return m_proxy.IsFull; } public override void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown ((FVRFireArm)this).Awake(); base.FChambers.Add(Chamber); if ((int)Mode == 1) { if (HasHandle) { Handle.LockHandle(); } } else if (HasHandle) { Handle.UnlockHandle(); } if (!HasSafety) { m_isSafetyEngaged = false; } GameObject val = new GameObject("m_proxyRound"); m_proxy = val.AddComponent(); m_proxy.Init(((Component)this).transform); GameObject val2 = new GameObject("m_proxyRound2"); m_proxy2 = val2.AddComponent(); m_proxy2.Init(((Component)this).transform); GameObject val3 = new GameObject("m_proxyRound3"); m_proxy3 = val3.AddComponent(); m_proxy3.Init(((Component)this).transform); ConvertTransformsToProxies(); ModularFVRFireArm.Awake((FVRFireArm)(object)this); ConfigureAll(); } public override int GetTutorialState() { if (m_isSafetyEngaged) { return 2; } if (Chamber.IsFull && !Chamber.IsSpent) { return 3; } if ((Object)(object)base.Magazine == (Object)null || !base.Magazine.HasARound()) { return 0; } return 1; } public void BoltReleasePressed() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)Mode == 1) { Bolt.ReleaseBolt(); } } public bool CanCycleMagState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return (int)Handle.CurPos == 0 && !HasExtractedRound(); } public void ToggleSafety() { if (HasSafety) { m_isSafetyEngaged = !m_isSafetyEngaged; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)14, 1f); UpdateSafetyGeo(); } } private void UpdateSafetyGeo() { //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) float num = ((!m_isSafetyEngaged) ? SafetyOff : SafetyOn); ((FVRPhysicalObject)this).SetAnimatedComponent(Safety, num, Safety_Interp, SafetyAxis); } public void EjectExtractedRound() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006c: 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_007c: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) if (m_isChamberRoundOnExtractor) { m_isChamberRoundOnExtractor = false; if (Chamber.IsFull) { Chamber.EjectRound(RoundPos_Ejection.position, ((Component)this).transform.right * RoundEjectionSpeed.x + ((Component)this).transform.up * RoundEjectionSpeed.y + ((Component)this).transform.forward * RoundEjectionSpeed.z, ((Component)this).transform.right * RoundEjectionSpin.x + ((Component)this).transform.up * RoundEjectionSpin.y + ((Component)this).transform.forward * RoundEjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false); } if ((Object)(object)Chamber2 != (Object)null && Chamber2.IsFull) { Chamber2.EjectRound(RoundPos_Ejection2.position, ((Component)this).transform.right * RoundEjectionSpeed.x + ((Component)this).transform.up * RoundEjectionSpeed.y + ((Component)this).transform.forward * RoundEjectionSpeed.z, ((Component)this).transform.right * RoundEjectionSpin.x + ((Component)this).transform.up * RoundEjectionSpin.y + ((Component)this).transform.forward * RoundEjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false); } if ((Object)(object)Chamber3 != (Object)null && Chamber3.IsFull) { Chamber3.EjectRound(RoundPos_Ejection3.position, ((Component)this).transform.right * RoundEjectionSpeed.x + ((Component)this).transform.up * RoundEjectionSpeed.y + ((Component)this).transform.forward * RoundEjectionSpeed.z, ((Component)this).transform.right * RoundEjectionSpin.x + ((Component)this).transform.up * RoundEjectionSpin.y + ((Component)this).transform.forward * RoundEjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false); } } } public void ExtractRound() { if (!((Object)(object)base.Magazine == (Object)null) && !m_proxy.IsFull) { if (!m_proxy.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference = base.Magazine.RemoveRound(false); m_proxy.SetFromPrefabReference(fromPrefabReference); m_isExtractedRoundOnLowerPath = true; } if ((Object)(object)Chamber2 != (Object)null && !m_proxy2.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference2 = base.Magazine.RemoveRound(false); m_proxy2.SetFromPrefabReference(fromPrefabReference2); } if ((Object)(object)Chamber3 != (Object)null && !m_proxy3.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference3 = base.Magazine.RemoveRound(false); m_proxy3.SetFromPrefabReference(fromPrefabReference3); } } } public bool ChamberRound() { if (Chamber.IsFull) { m_isChamberRoundOnExtractor = true; } if (m_proxy.IsFull && !Chamber.IsFull && !m_isExtractedRoundOnLowerPath) { m_isChamberRoundOnExtractor = true; Chamber.SetRound(m_proxy.Round, false); m_proxy.ClearProxy(); if ((Object)(object)Chamber2 == (Object)null) { return true; } } if ((Object)(object)Chamber2 != (Object)null && m_proxy2.IsFull && !Chamber2.IsFull) { Chamber2.SetRound(m_proxy2.Round, false); m_proxy2.ClearProxy(); if ((Object)(object)Chamber3 == (Object)null) { return true; } } if ((Object)(object)Chamber3 != (Object)null && m_proxy3.IsFull && !Chamber3.IsFull) { Chamber3.SetRound(m_proxy3.Round, false); m_proxy3.ClearProxy(); return true; } return false; } public bool ReturnCarrierRoundToMagazineIfRelevant() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if (m_proxy.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy.Round.RoundClass, false, true); m_proxy.ClearProxy(); if ((Object)(object)Chamber2 == (Object)null) { return true; } } if (m_proxy2.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy2.Round.RoundClass, false, true); m_proxy2.ClearProxy(); if ((Object)(object)Chamber3 == (Object)null) { return true; } } if (m_proxy3.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy3.Round.RoundClass, false, true); m_proxy3.ClearProxy(); return true; } return false; } public void TransferShellToUpperTrack() { if (m_proxy.IsFull && m_isExtractedRoundOnLowerPath && !Chamber.IsFull) { m_isExtractedRoundOnLowerPath = false; } } public void ToggleMode() { //IL_0007: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if ((int)Bolt.CurPos != 0) { Debug.Log((object)"not forward"); return; } if (HasHandle && (int)Handle.CurPos != 0) { Debug.Log((object)"not forward"); return; } if (m_isHammerCocked) { Debug.Log((object)"hammer cocked"); return; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f); if ((int)Mode == 0) { Mode = (ShotgunMode)1; if (HasHandle) { Handle.LockHandle(); } } else { Mode = (ShotgunMode)0; if (HasHandle) { Handle.UnlockHandle(); } } } public void CockHammer() { if (!m_isHammerCocked) { m_isHammerCocked = true; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } if (!m_isHammer2Cocked) { m_isHammer2Cocked = true; } if (!m_isHammer3Cocked) { m_isHammer3Cocked = true; } } public void ReleaseHammer() { //IL_0007: 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) if ((int)Bolt.CurPos != 0) { return; } if (m_isHammerCocked) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); Fire(); PlayOneShotSound = false; if (FireAllBarrels) { PlayOneShotSound = true; m_isHammerCocked = false; Fire2(); m_isHammer2Cocked = false; Fire3(); m_isHammer3Cocked = false; Handle.UnlockHandle(); } else { m_isHammerCocked = false; if (HasHandle && (int)Mode == 0 && (Object)(object)Chamber2 == (Object)null) { Handle.UnlockHandle(); } } } else if (!m_isHammerCocked && m_isHammer2Cocked) { if ((Object)(object)Chamber2 != (Object)null) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); } Fire2(); m_isHammer2Cocked = false; if ((Object)(object)Chamber3 == (Object)null) { Handle.UnlockHandle(); } } else if (!m_isHammerCocked && !m_isHammer2Cocked && m_isHammer3Cocked) { if ((Object)(object)Chamber3 != (Object)null) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); } Fire3(); m_isHammer3Cocked = false; Handle.UnlockHandle(); } } public bool Fire() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Invalid comparison between Unknown and I4 if (!Chamber.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber, base.MuzzlePos, true, 1f, -1f); ((FVRFireArm)this).FireMuzzleSmoke(0); ((FVRFireArm)this).FireMuzzleSmoke(1); bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); ((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if ((int)Mode == 1 && Chamber.GetRound().IsHighPressure && !Bolt.UsesLateralLocking) { Bolt.ImpartFiringImpulse(); } if ((Object)(object)Chamber2 == (Object)null || ((Object)(object)Chamber2 != (Object)null && !Chamber2.IsFull)) { Handle.UnlockHandle(); } return true; } public bool Fire2() { //IL_009e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Chamber2 == (Object)null) { return false; } if (!Chamber2.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber2, Muzzle2, true, 1f, -1f); ((FVRFireArm)this).FireMuzzleSmoke(2); ((FVRFireArm)this).FireMuzzleSmoke(3); bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); if (!PlayOneShotSound) { ((FVRFireArm)this).PlayAudioGunShot(Chamber2.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); } if ((Object)(object)Chamber3 == (Object)null || ((Object)(object)Chamber3 != (Object)null && !Chamber3.IsFull)) { Handle.UnlockHandle(); } return true; } public bool Fire3() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Chamber3 == (Object)null) { return false; } if (!Chamber3.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber3, Muzzle3, true, 1f, -1f); ((FVRFireArm)this).FireMuzzleSmoke(4); ((FVRFireArm)this).FireMuzzleSmoke(5); bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); if (!PlayOneShotSound) { ((FVRFireArm)this).PlayAudioGunShot(Chamber3.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); } Handle.UnlockHandle(); return true; } public override void FVRUpdate() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).FVRUpdate(); UpdateComponents(); UpdateCarrier(); if (HasHandle) { Handle.UpdateHandle(); bool state = false; if ((((FVRInteractiveObject)Handle).IsHeld || ((FVRPhysicalObject)this).IsAltHeld) && (int)Mode == 0) { state = true; } Bolt.UpdateHandleHeldState(state, 1f - Handle.GetBoltLerpBetweenRearAndFore()); } Bolt.UpdateBolt(); UpdateDisplayRoundPositions(); if (HasExtractedRound() && m_isExtractedRoundOnLowerPath) { if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.IsDropInLoadable = false; } } else if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.IsDropInLoadable = true; } } private void UpdateCarrier() { //IL_0065: 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_007c: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) if (!UsesAnimatedCarrier) { return; } if (((FVRInteractiveObject)this).IsHeld) { if ((Object)(object)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable != (Object)null) { if (((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable is FVRFireArmRound) { float num = Vector3.Distance(((Component)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable).transform.position, ((FVRInteractiveObject)this).GetClosestValidPoint(CarrierComparePoint1.position, CarrierComparePoint2.position, ((Component)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable).transform.position)); if (num < CarrierDetectDistance) { m_tarCarrierRot = CarrierRots.y; } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } if (HasExtractedRound() && !m_isExtractedRoundOnLowerPath) { m_tarCarrierRot = CarrierRots.y; } if (Mathf.Abs(m_curCarrierRot - m_tarCarrierRot) > 0.001f) { m_curCarrierRot = Mathf.MoveTowards(m_curCarrierRot, m_tarCarrierRot, 270f * Time.deltaTime); Carrier.localEulerAngles = new Vector3(m_curCarrierRot, 0f, 0f); } } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); UpdateInputAndAnimate(hand); } private void UpdateInputAndAnimate(FVRViveHand hand) { //IL_0081: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_014e: Invalid comparison between Unknown and I4 //IL_01ab: Unknown result type (might be due to invalid IL or missing references) IsSlideReleaseButtonHeld = false; if (((FVRPhysicalObject)this).IsAltHeld) { 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); } Vector2 touchpadAxes = hand.Input.TouchpadAxes; if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown) { ToggleSafety(); } if (hand.Input.AXButtonPressed) { IsSlideReleaseButtonHeld = true; if (HasHandle && (int)Mode == 0) { Handle.UnlockHandle(); } } } else { if (hand.Input.TouchpadDown && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f) { if (Vector2.Angle(touchpadAxes, Vector2.left) <= 45f) { ToggleSafety(); } else if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f && (int)Mode == 1) { Bolt.ReleaseBolt(); } } if (hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.up) <= 45f) { IsSlideReleaseButtonHeld = true; if (HasHandle && (int)Mode == 0) { Handle.UnlockHandle(); } } } bool flag = false; if (Bolt.UsesLateralLocking && !Bolt.GetIsLateralLocked()) { flag = true; } if (m_triggerFloat >= TriggerBreakThreshold && (m_isHammerCocked || m_isHammer2Cocked || m_isHammer3Cocked) && !m_isSafetyEngaged && !flag) { if (m_hasTriggerReset || UsesSlamFireTrigger) { ReleaseHammer(); } m_hasTriggerReset = false; } } 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) if (HasTrigger) { ((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(TriggerUnheld, TriggerHeld, m_triggerFloat), TriggerInterp, TriggerAxis); } } private void UpdateDisplayRoundPositions() { //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: 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_0051: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: 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_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: 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_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) float boltLerpBetweenLockAndFore = Bolt.GetBoltLerpBetweenLockAndFore(); if (Chamber.IsFull) { if (m_isChamberRoundOnExtractor) { 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 ((Object)(object)Chamber2 != (Object)null) { Chamber2.ProxyRound.position = Vector3.Lerp(RoundPos_Ejecting.position, ((Component)Chamber2).transform.position, boltLerpBetweenLockAndFore); Chamber2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_Ejecting.rotation, ((Component)Chamber2).transform.rotation, boltLerpBetweenLockAndFore); } if ((Object)(object)Chamber3 != (Object)null) { Chamber3.ProxyRound.position = Vector3.Lerp(RoundPos_Ejecting.position, ((Component)Chamber3).transform.position, boltLerpBetweenLockAndFore); Chamber3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_Ejecting.rotation, ((Component)Chamber3).transform.rotation, boltLerpBetweenLockAndFore); } } else { Chamber.ProxyRound.position = ((Component)Chamber).transform.position; Chamber.ProxyRound.rotation = ((Component)Chamber).transform.rotation; if ((Object)(object)Chamber2 != (Object)null) { Chamber2.ProxyRound.position = ((Component)Chamber2).transform.position; Chamber2.ProxyRound.rotation = ((Component)Chamber2).transform.rotation; } if ((Object)(object)Chamber3 != (Object)null) { Chamber3.ProxyRound.position = ((Component)Chamber3).transform.position; Chamber3.ProxyRound.rotation = ((Component)Chamber3).transform.rotation; } } } if (m_proxy.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber.IsFull) { m_proxy.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward.position, RoundPos_LowerPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward.rotation, RoundPos_LowerPath_Forward.rotation, boltLerpBetweenLockAndFore); } else { m_proxy.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward.position, RoundPos_UpperPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward.rotation, RoundPos_UpperPath_Forward.rotation, boltLerpBetweenLockAndFore); } } if (m_proxy2.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber2.IsFull) { m_proxy2.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward.position, RoundPos_LowerPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward.rotation, RoundPos_LowerPath_Forward.rotation, boltLerpBetweenLockAndFore); } else { m_proxy2.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward.position, RoundPos_UpperPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward.rotation, RoundPos_UpperPath_Forward.rotation, boltLerpBetweenLockAndFore); } } if (m_proxy3.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber3.IsFull) { m_proxy3.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward.position, RoundPos_LowerPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward.rotation, RoundPos_LowerPath_Forward.rotation, boltLerpBetweenLockAndFore); } else { m_proxy3.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward.position, RoundPos_UpperPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward.rotation, RoundPos_UpperPath_Forward.rotation, boltLerpBetweenLockAndFore); } } } public override List GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List list = new List(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List 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 f) { string empty = string.Empty; string empty2 = string.Empty; empty = "HammerState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; if (empty2 == "Cocked") { m_isHammerCocked = true; } } if (HasSafety) { empty = "SafetyState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; if (empty2 == "On") { m_isSafetyEngaged = true; } UpdateSafetyGeo(); } } ((FVRFireArm)this).ConfigureFromFlagDic(f); ModularFVRFireArm.ConfigureFromFlagDic(f, (FVRFireArm)(object)this); } public override Dictionary GetFlagDic() { Dictionary flagDic = ((FVRFireArm)this).GetFlagDic(); flagDic.Add("HammerState", (!m_isHammerCocked) ? "Uncocked" : "Cocked"); if (HasSafety) { flagDic.Add("SafetyState", (!m_isSafetyEngaged) ? "Off" : "On"); } return ModularFVRFireArm.GetFlagDic(flagDic); } public ModularWeaponPart ConfigureModularWeaponPart(ModularWeaponPartsAttachmentPoint modularWeaponPartsAttachmentPoint, string selectedPart, bool isRandomized = false) { return ModularFVRFireArm.ConfigureModularWeaponPart(modularWeaponPartsAttachmentPoint, selectedPart, isRandomized, (Dictionary)null, (Dictionary)null); } public ModularBarrel ConfigureModularBarrel(string selectedPart, bool isRandomized = false) { return ModularFVRFireArm.ConfigureModularBarrel(selectedPart, isRandomized); } public ModularHandguard ConfigureModularHandguard(string selectedPart, bool isRandomized = false) { return ModularFVRFireArm.ConfigureModularHandguard(selectedPart, isRandomized); } public ModularStock ConfigureModularStock(string selectedPart, bool isRandomized = false) { return ModularFVRFireArm.ConfigureModularStock(selectedPart, isRandomized); } public void ConfigureAll() { if (ModularBarrelPartsID != string.Empty) { string selectedPart = ((!ModularFVRFireArm.IsInTakeAndHold || ModularFVRFireArm.WasUnvaulted || ModularFVRFireArm.ModularBarrelAttachmentPoint.DisallowTakeAndHoldRandomization) ? SelectedModularBarrel : ModularWorkshopManager.ModularWorkshopPartsGroupsDictionary[ModularBarrelPartsID].GetRandomPart()); ConfigureModularBarrel(selectedPart); } if (ModularHandguardPartsID != string.Empty) { string selectedPart2 = ((!ModularFVRFireArm.IsInTakeAndHold || ModularFVRFireArm.WasUnvaulted || ModularFVRFireArm.ModularHandguardAttachmentPoint.DisallowTakeAndHoldRandomization) ? SelectedModularHandguard : ModularWorkshopManager.ModularWorkshopPartsGroupsDictionary[ModularHandguardPartsID].GetRandomPart()); ConfigureModularHandguard(selectedPart2); } if (ModularStockPartsID != string.Empty) { string selectedPart3 = ((!ModularFVRFireArm.IsInTakeAndHold || ModularFVRFireArm.WasUnvaulted || ModularFVRFireArm.ModularStockAttachmentPoint.DisallowTakeAndHoldRandomization) ? SelectedModularStock : ModularWorkshopManager.ModularWorkshopPartsGroupsDictionary[ModularStockPartsID].GetRandomPart()); ConfigureModularStock(selectedPart3); } ModularWeaponPartsAttachmentPoint[] modularWeaponPartsAttachmentPoints = ModularFVRFireArm.ModularWeaponPartsAttachmentPoints; foreach (ModularWeaponPartsAttachmentPoint val in modularWeaponPartsAttachmentPoints) { if (!val.IsPointDisabled && ModularWorkshopManager.ModularWorkshopPartsGroupsDictionary.TryGetValue(val.ModularPartsGroupID, out var value) && value.PartsDictionary.Count > 0) { string selectedPart4 = ((!ModularFVRFireArm.IsInTakeAndHold || ModularFVRFireArm.WasUnvaulted || val.DisallowTakeAndHoldRandomization) ? val.SelectedModularWeaponPart : ModularWorkshopManager.ModularWorkshopPartsGroupsDictionary[val.ModularPartsGroupID].GetRandomPart()); ConfigureModularWeaponPart(val, selectedPart4, ModularFVRFireArm.IsInTakeAndHold); } } } public void ConvertTransformsToProxies() { ModularFVRFireArm.ConvertTransformsToProxies((FVRFireArm)(object)this); } public void ApplySkin(string ModularPartsGroupID, string SkinName) { AllAttachmentPoints[ModularPartsGroupID].ApplySkin(SkinName); } [ContextMenu("Populate Receiver Mesh Renderer List")] public void PopulateReceiverMeshList() { ModularFVRFireArm.GetReceiverMeshRenderers((FVRFireArm)(object)this); } } public class ModularTubeFedMultiBarrelShotgunBarrelCluster : ModularWeaponPart { [Header("Barrel Cluster Params")] public FVRFireArmChamber Chamber1; public Transform Muzzle1; public FVRFireArmChamber Chamber2; public Transform Muzzle2; public FVRFireArmChamber Chamber3; public Transform Muzzle3; protected ModularTubeFedMultiBarrelShotgun Weapon; public override void EnablePart() { ((ModularWeaponPart)this).EnablePart(); Weapon = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)Weapon != (Object)null) { Weapon.Chamber = Chamber1; ((FVRFireArm)Weapon).MuzzlePos = Muzzle1; Chamber1.Firearm = (FVRFireArm)(object)Weapon; if ((Object)(object)Chamber2 != (Object)null) { Weapon.Chamber2 = Chamber2; Weapon.Muzzle2 = Muzzle2; Chamber2.Firearm = (FVRFireArm)(object)Weapon; } if ((Object)(object)Chamber3 != (Object)null) { Weapon.Chamber3 = Chamber3; Weapon.Muzzle3 = Muzzle3; Chamber3.Firearm = (FVRFireArm)(object)Weapon; } } } } public class ModularTubeFedMultiBarrelShotgunBolt : FVRInteractiveObject { public enum BoltPos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Shotgun Bolt")] public ModularTubeFedMultiBarrelShotgun Shotgun; 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 bool HasLastRoundBoltHoldOpen = 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 bool m_isBoltLocked; private bool m_isHandleHeld; private float m_HandleLerp; [Header("Reciprocating Barrel")] public bool HasReciprocatingBarrel; public Transform Barrel; public Vector3 BarrelForward; public Vector3 BarrelRearward; private bool m_isBarrelReciprocating; [Header("Elevator")] public bool HasElevator; public Transform Elevator; public Vector3 ElevatorForward; public Vector3 ElevatorRearward; [Header("Hammer")] public bool HasHammer; public Transform Hammer; public Vector3 HammerForward; public Vector3 HammerRearward; [Header("LateralLocking")] public bool UsesLateralLocking; public Transform LateralLock; public Vector3 Point_LateralLock_In; public Vector3 Point_LateralLock_Out; public Transform LaterlockGoal_In; public Transform LaterlockGoal_Out; private bool m_isLateralLockIn = true; public bool GetIsLateralLocked() { return m_isLateralLockIn; } 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) ((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; } public override bool IsInteractable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 return (int)Shotgun.Mode == 1 && ((FVRInteractiveObject)this).IsInteractable(); } 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) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)8, 1f); m_isBoltLocked = false; } } public void UpdateHandleHeldState(bool state, float lerp) { m_isHandleHeld = state; m_HandleLerp = lerp; } public void ImpartFiringImpulse() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) m_curBoltSpeed = Speed_Rearward; if ((int)CurPos == 0) { m_isBarrelReciprocating = true; } } 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Invalid comparison between Unknown and I4 //IL_0103: 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) //IL_0222: Invalid comparison between Unknown and I4 //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Invalid comparison between Unknown and I4 //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Expected I4, but got Unknown //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Expected I4, but got Unknown //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Invalid comparison between Unknown and I4 //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043a: 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_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Invalid comparison between Unknown and I4 //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Invalid comparison between Unknown and I4 //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_05af: Unknown result type (might be due to invalid IL or missing references) //IL_05b5: Invalid comparison between Unknown and I4 //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05da: Invalid comparison between Unknown and I4 //IL_05bb: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Invalid comparison between Unknown and I4 //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_0639: Invalid comparison between Unknown and I4 //IL_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_05f3: Invalid comparison between Unknown and I4 //IL_05e0: Unknown result type (might be due to invalid IL or missing references) //IL_05e6: Invalid comparison between Unknown and I4 //IL_06c4: Unknown result type (might be due to invalid IL or missing references) //IL_06c9: Unknown result type (might be due to invalid IL or missing references) //IL_0644: Unknown result type (might be due to invalid IL or missing references) //IL_064a: Invalid comparison between Unknown and I4 //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0618: Invalid comparison between Unknown and I4 //IL_05f9: Unknown result type (might be due to invalid IL or missing references) //IL_05ff: Invalid comparison between Unknown and I4 //IL_061e: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Invalid comparison between Unknown and I4 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)Shotgun).transform.InverseTransformPoint(closestValidPoint).z; if (UsesLateralLocking && (int)CurPos == 0) { float num = Vector3.Distance(LaterlockGoal_In.position, ((HandInput)(ref base.m_hand.Input)).Pos); float num2 = Vector3.Distance(LaterlockGoal_Out.position, ((HandInput)(ref base.m_hand.Input)).Pos); if (num < num2 && !m_isLateralLockIn) { m_isLateralLockIn = true; ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)12, 1f); LateralLock.localPosition = Point_LateralLock_In; } else if (num > num2 && m_isLateralLockIn) { m_isLateralLockIn = false; ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)13, 1f); LateralLock.localPosition = Point_LateralLock_Out; } } } 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 (UsesLateralLocking && m_isLateralLockIn) { ((Vector2)(ref val))..ctor(m_boltZ_forward, m_boltZ_forward); } if (flag) { m_curBoltSpeed = 0f; } else if ((int)Shotgun.Mode == 1 && (((int)CurPos < 3 && m_curBoltSpeed >= 0f) || (int)LastPos >= 4)) { m_curBoltSpeed = Mathf.MoveTowards(m_curBoltSpeed, Speed_Forward, Time.deltaTime * SpringStiffness); } float num3 = m_boltZ_current; float boltZ_current = m_boltZ_current; if (flag) { boltZ_current = m_boltZ_heldTarget; num3 = Mathf.MoveTowards(m_boltZ_current, boltZ_current, Speed_Held * Time.deltaTime); } else if ((int)Shotgun.Mode == 1) { num3 = m_boltZ_current + m_curBoltSpeed * Time.deltaTime; } num3 = Mathf.Clamp(num3, val.x, val.y); if (Mathf.Abs(num3 - m_boltZ_current) > Mathf.Epsilon) { m_boltZ_current = num3; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current); if (HasElevator) { float boltLerpBetweenLockAndFore = GetBoltLerpBetweenLockAndFore(); Elevator.localEulerAngles = Vector3.Lerp(ElevatorRearward, ElevatorForward, boltLerpBetweenLockAndFore); } } else { m_curBoltSpeed = 0f; } if (HasHammer) { if (Shotgun.IsHammerCocked) { Hammer.localEulerAngles = HammerRearward; } else { float boltLerpBetweenLockAndFore2 = GetBoltLerpBetweenLockAndFore(); Hammer.localEulerAngles = Vector3.Lerp(HammerRearward, HammerForward, boltLerpBetweenLockAndFore2); } } if (HasReciprocatingBarrel && m_isBarrelReciprocating) { float num4 = 0f; if (!m_isBoltLocked && !((FVRInteractiveObject)this).IsHeld) { num4 = 1f - GetBoltLerpBetweenLockAndFore(); } Barrel.localPosition = Vector3.Lerp(BarrelForward, BarrelRearward, num4); } BoltPos curPos = CurPos; curPos = ((Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.0015f) ? ((BoltPos)0) : ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.0015f) ? ((BoltPos)2) : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.0015f) ? ((BoltPos)4) : ((!(m_boltZ_current > m_boltZ_lock)) ? ((BoltPos)3) : ((BoltPos)1))))); int num5 = (int)CurPos; CurPos = (BoltPos)Mathf.Clamp((int)curPos, num5 - 1, num5 + 1); if ((int)CurPos >= 2) { Shotgun.Chamber.IsAccessible = true; } else { Shotgun.Chamber.IsAccessible = false; } if ((int)CurPos >= 1) { ((FVRFireArm)Shotgun).IsBreachOpenForGasOut = true; } else { ((FVRFireArm)Shotgun).IsBreachOpenForGasOut = false; } if ((int)CurPos == 0 && (int)LastPos != 0) { BoltEvent_ArriveAtFore(); } else if ((int)CurPos == 1 && (int)LastPos == 0) { BoltEvent_ExtractRoundFromMag(); } else if ((int)CurPos == 2 && (int)LastPos == 1) { BoltEvent_EjectRound(); } else if ((int)CurPos != 1 || (int)LastPos != 2) { if ((int)CurPos == 2 && (int)LastPos == 3) { BoltEvent_BoltCaught(); } else if ((int)CurPos == 4 && (int)LastPos != 4) { BoltEvent_SmackRear(); } } if ((int)CurPos >= 2 && (int)Shotgun.Mode == 1 && HasLastRoundBoltHoldOpen && (Object)(object)((FVRFireArm)Shotgun).Magazine != (Object)null && !Shotgun.HasExtractedRound() && !((FVRFireArm)Shotgun).Magazine.HasARound() && !Shotgun.Chamber.IsFull && !Shotgun.IsSlideReleaseButtonHeld) { LockBolt(); } LastPos = CurPos; } private void BoltEvent_ArriveAtFore() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) Shotgun.ChamberRound(); Shotgun.ReturnCarrierRoundToMagazineIfRelevant(); if (HasReciprocatingBarrel && m_isBarrelReciprocating) { m_isBarrelReciprocating = false; Barrel.localPosition = BarrelForward; } if (((FVRInteractiveObject)this).IsHeld) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)2, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)0, 1f); } } private void BoltEvent_EjectRound() { Shotgun.EjectExtractedRound(); Shotgun.TransferShellToUpperTrack(); Shotgun.CockHammer(); } private void BoltEvent_ExtractRoundFromMag() { Shotgun.ExtractRound(); } private void BoltEvent_SmackRear() { if (((FVRInteractiveObject)this).IsHeld || m_isHandleHeld) { ReleaseBolt(); } if (((FVRInteractiveObject)this).IsHeld) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)3, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)1, 1f); } } private void BoltEvent_BoltCaught() { if (m_isBoltLocked) { if (HasReciprocatingBarrel && m_isBarrelReciprocating) { m_isBarrelReciprocating = false; } ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)4, 1f); } } } public class ModularTubeFedMultiBarrelShotgunHandle : FVRAlternateGrip { public enum BoltPos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Shotgun Handle")] public ModularTubeFedMultiBarrelShotgun Shotgun; public float Speed_Held; public BoltPos CurPos; public BoltPos LastPos; public Transform Point_Bolt_Forward; public Transform Point_Bolt_LockPoint; public Transform Point_Bolt_Rear; private float m_handZOffset; 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 bool m_isHandleLocked; 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) ((FVRAlternateGrip)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; } public override void BeginInteraction(FVRViveHand hand) { //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_0018: Unknown result type (might be due to invalid IL or missing references) m_handZOffset = ((Component)this).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z; ((FVRAlternateGrip)this).BeginInteraction(hand); } 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 LockHandle() { m_isHandleLocked = true; } public void UnlockHandle() { m_isHandleLocked = false; } public void UpdateHandle() { //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_021b: 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) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected I4, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected I4, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Invalid comparison between Unknown and I4 //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Invalid comparison between Unknown and I4 bool flag = false; if (((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)Shotgun).IsAltHeld) { flag = true; } if (flag && !m_isHandleLocked) { Vector3 closestValidPoint; if (((FVRInteractiveObject)this).IsHeld) { closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Bolt_Forward.position, Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)this).m_hand.Input)).Pos + -((Component)this).transform.forward * m_handZOffset * ((Component)Shotgun).transform.localScale.x); } else { if (((FVRInteractiveObject)Shotgun).m_hand.Input.TriggerPressed) { Vector3 velLinearWorld = ((FVRInteractiveObject)Shotgun).m_hand.Input.VelLinearWorld; velLinearWorld = Vector3.Project(velLinearWorld, ((Component)Shotgun).transform.forward); velLinearWorld = ((Component)Shotgun).transform.InverseTransformDirection(velLinearWorld); if (Mathf.Abs(velLinearWorld.z) > 1f) { float z = ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.z; float num = (0f - velLinearWorld.z) * Time.deltaTime; z += num; z = Mathf.Clamp(z, Point_Bolt_Rear.localPosition.z - 0.1f, Point_Bolt_Forward.localPosition.z + 0.1f); ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition = new Vector3(((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.x, ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.y, z); } } closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Bolt_Forward.position, Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)Shotgun).m_hand.Input)).Pos); } m_boltZ_heldTarget = ((Component)Shotgun).transform.InverseTransformPoint(closestValidPoint).z; } float num2 = m_boltZ_current; float boltZ_current = m_boltZ_current; if (flag && !m_isHandleLocked) { boltZ_current = m_boltZ_heldTarget; num2 = Mathf.MoveTowards(m_boltZ_current, boltZ_current, Speed_Held * Time.deltaTime); } if (Mathf.Abs(num2 - m_boltZ_current) > Mathf.Epsilon) { m_boltZ_current = num2; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current); } BoltPos curPos = CurPos; curPos = ((Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.001f) ? ((BoltPos)0) : ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.001f) ? ((BoltPos)2) : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.001f) ? ((BoltPos)4) : ((!(m_boltZ_current > m_boltZ_lock)) ? ((BoltPos)3) : ((BoltPos)1))))); int num3 = (int)CurPos; CurPos = (BoltPos)Mathf.Clamp((int)curPos, num3 - 1, num3 + 1); if ((int)CurPos == 0 && (int)LastPos != 0) { BoltEvent_ArriveAtFore(); } else if ((int)CurPos == 4 && (int)LastPos != 4) { BoltEvent_SmackRear(); } LastPos = CurPos; } private void BoltEvent_ArriveAtFore() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)Shotgun.Mode == 0) { if (Shotgun.IsHammerCocked) { LockHandle(); } if (Shotgun.Chamber.IsFull || Shotgun.HasExtractedRound()) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)11, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)40, 1f); } } } private void BoltEvent_SmackRear() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)Shotgun.Mode == 0) { if (Shotgun.Chamber.IsFull || Shotgun.HasExtractedRound()) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)10, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)41, 1f); } } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector2 touchpadAxes = hand.Input.TouchpadAxes; bool flag = false; if (hand.IsInStreamlinedMode && hand.Input.BYButtonDown) { flag = true; } else if (hand.Input.TouchpadDown) { flag = true; } if (flag && (int)CurPos == 0 && Shotgun.CanModeSwitch) { Shotgun.ToggleMode(); } ((FVRAlternateGrip)this).UpdateInteraction(hand); } } public class ModularTubeFedShotgunFeedSystem : ModularWeaponPart { [Header("Tube Magazine Params")] public bool IsFixedMag = false; public FVRFireArmMagazine TubeMag; public FireArmRoundType RoundType; [Header("Box Magazine Params")] public bool IsBoxMag = false; public FireArmMagazineType MagType; public Transform MagMountPos; public Transform MagEjectPos; public UniversalMagGrabTrigger MagGrabTrigger; public FVRFireArmReloadTriggerWell ReloadWell; protected ModularTubeFedMultiBarrelShotgun Weapon; public override void EnablePart() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((ModularWeaponPart)this).EnablePart(); Weapon = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)Weapon != (Object)null) { if (IsFixedMag) { ((FVRFireArm)Weapon).Magazine = TubeMag; TubeMag.FireArm = (FVRFireArm)(object)Weapon; ((FVRFireArm)Weapon).MagazineMountPos = ((Component)TubeMag).transform; ((FVRFireArm)Weapon).MagazineEjectPos = ((Component)TubeMag).transform; ((FVRPhysicalObject)Weapon).ObjectWrapper.UsesRoundTypeFlag = true; ((FVRPhysicalObject)Weapon).ObjectWrapper.RoundType = RoundType; ((FVRFireArm)Weapon).RoundType = RoundType; } if (IsBoxMag) { ReloadWell.FireArm = (FVRFireArm)(object)Weapon; ((FVRFireArm)Weapon).MagazineType = MagType; MagGrabTrigger.FireArm = (FVRFireArm)(object)Weapon; ((FVRFireArm)Weapon).MagazineMountPos = MagMountPos; ((FVRFireArm)Weapon).MagazineEjectPos = MagEjectPos; ((FVRPhysicalObject)Weapon).ObjectWrapper.UsesRoundTypeFlag = false; ((FVRPhysicalObject)Weapon).ObjectWrapper.MagazineType = MagType; } } } public override void DisablePart() { ((ModularWeaponPart)this).DisablePart(); if (IsBoxMag && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null) { ((FVRFireArm)Weapon).EjectMag(false); } } } public class ModularWeaponPartForeFollower : ModularWeaponPart { protected ModularTubeFedMultiBarrelShotgun TubeGun; protected ModularBreakActionWeapon BreakGun; public Transform TransformToRotate; public float ForeForward; public float ForeRearward; public float ForeMaxRotate; private bool DoesRotation; private bool DoesTranslation; public override void EnablePart() { ((ModularWeaponPart)this).EnablePart(); BreakGun = ((Component)((Component)this).transform).GetComponentInParent(); TubeGun = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)BreakGun != (Object)null) { DoesRotation = true; } if ((Object)(object)TubeGun != (Object)null) { DoesTranslation = true; } } public void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) if (DoesRotation) { float x = ((Component)((BreakActionWeapon)BreakGun).Hinge).transform.localEulerAngles.x; Vector3 localEulerAngles = ((Component)TransformToRotate).transform.localEulerAngles; localEulerAngles.x = 0f - x; ((Component)TransformToRotate).transform.localEulerAngles = localEulerAngles; } if (DoesTranslation) { float z = ((Component)TubeGun.Handle).transform.localPosition.z; float num = Mathf.InverseLerp(ForeRearward, ForeForward, z); float x2 = Mathf.Lerp(ForeMaxRotate, 0f, num); Vector3 localEulerAngles2 = ((Component)TransformToRotate).transform.localEulerAngles; localEulerAngles2.x = x2; ((Component)TransformToRotate).transform.localEulerAngles = localEulerAngles2; } } } public class ModularWeaponPartReflexSightScope : ModularWeaponPart { public ReflexSightController ReflexSightController; public PIPScopeController PIPScopeController; protected FVRFireArm Weapon; public override void EnablePart() { ((ModularWeaponPart)this).EnablePart(); Weapon = ((Component)((Component)this).transform).GetComponentInParent(); if ((Object)(object)Weapon != (Object)null) { if ((Object)(object)ReflexSightController != (Object)null) { ReflexSightController.OverrideFireArm = Weapon; ReflexSightController.OverrideMuzzle = Weapon.GetMuzzle(); } if ((Object)(object)PIPScopeController != (Object)null) { PIPScopeController.OverrideFireArm = Weapon; PIPScopeController.OverrideMuzzle = Weapon.GetMuzzle(); } } } } public class NeosteadMagSwitcher : MonoBehaviour { public TubeFedShotgun Gun; public Transform Switch; public Vector3 RotLeftCenterRight; public int State; public FVRFireArmMagazine Mag1; public GameObject MagTrig1; public FVRFireArmMagazine Mag2; public GameObject MagTrig2; private int prevNumRounds; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { if ((Object)(object)firearm == (Object)(object)Gun && State == 1) { SwapMagTubes(); } } public void SwapMagTubes() { if ((Object)(object)((FVRFireArm)Gun).Magazine == (Object)(object)Mag1) { ((FVRFireArm)Gun).Magazine = Mag2; } else { ((FVRFireArm)Gun).Magazine = Mag1; } } public void SwapState(int goalState) { if (State == goalState) { return; } State = goalState; ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)15, 1f); if (State == 0) { ((FVRPhysicalObject)Gun).SetAnimatedComponent(Switch, RotLeftCenterRight.x, (InterpStyle)1, (Axis)2); ((FVRFireArm)Gun).Magazine = Mag2; if (MagTrig1.activeInHierarchy) { MagTrig1.SetActive(false); } if (!MagTrig2.activeInHierarchy) { MagTrig2.SetActive(true); } } if (State == 1) { ((FVRPhysicalObject)Gun).SetAnimatedComponent(Switch, RotLeftCenterRight.y, (InterpStyle)1, (Axis)2); if (Mag1.HasARound()) { ((FVRFireArm)Gun).Magazine = Mag1; } else { ((FVRFireArm)Gun).Magazine = Mag2; } if (!MagTrig1.activeInHierarchy) { MagTrig1.SetActive(true); } if (!MagTrig2.activeInHierarchy) { MagTrig2.SetActive(true); } } if (State == 2) { ((FVRPhysicalObject)Gun).SetAnimatedComponent(Switch, RotLeftCenterRight.z, (InterpStyle)1, (Axis)2); ((FVRFireArm)Gun).Magazine = Mag1; if (!MagTrig1.activeInHierarchy) { MagTrig1.SetActive(true); } if (MagTrig2.activeInHierarchy) { MagTrig2.SetActive(false); } } } } public class NeosteadMagSwitcherTrigger : FVRInteractiveObject { public NeosteadMagSwitcher Switch; public int State; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); Switch.SwapState(State); } } public class OpenBoltChargingHandleFlyForwardOnFire : MonoBehaviour { public OpenBoltReceiver Gun; public OpenBoltChargingHandle Handle; private bool IsFlyingForward = false; public void Awake() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(ShotFired); } public void OnDestroy() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(ShotFired); } private void ShotFired(FVRFireArm firearm) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)firearm == (Object)(object)Gun && (int)Handle.CurPos != 0) { Handle.ForwardSpeed = 5f; IsFlyingForward = true; } } private void Update() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) if (IsFlyingForward && (int)Handle.CurPos == 0) { Handle.ForwardSpeed = 0f; IsFlyingForward = false; } } } public class OpenBoltRackBoltPokeableButton : FVRInteractiveObject { public OpenBoltReceiver Weapon; public AudioEvent PokeSound; public override void Poke(FVRViveHand hand) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (((Object)(object)((FVRInteractiveObject)Weapon).m_hand == (Object)null || (Object)(object)hand != (Object)(object)((FVRInteractiveObject)Weapon).m_hand) && (int)Weapon.Bolt.CurPos == 0 && (Object)(object)((FVRFireArm)Weapon).Magazine != (Object)null && ((FVRFireArm)Weapon).Magazine.HasARound()) { Weapon.Bolt.ImpartFiringImpulse(); SM.PlayCoreSound((FVRPooledAudioType)0, PokeSound, ((Component)this).transform.position); } } } public class OpenBoltSlamfireFix : MonoBehaviour { public OpenBoltReceiver OBGun; private float CurBoltZ; private float PrevBoltZ; private void Update() { //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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00a6: 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) FVRViveHand hand = ((FVRInteractiveObject)OBGun).m_hand; CurBoltZ = ((Component)OBGun.Bolt).transform.localPosition.z; if ((Object)(object)hand != (Object)null && !((FVRPhysicalObject)OBGun).IsAltHeld && hand.Input.TriggerFloat < OBGun.TriggerFiringThreshold && CurBoltZ > OBGun.Bolt.Point_Bolt_LockPoint.localPosition.z && PrevBoltZ <= OBGun.Bolt.Point_Bolt_LockPoint.localPosition.z) { OBGun.Bolt.SetBoltToRear(); OBGun.EngageSeer(); } PrevBoltZ = ((Component)OBGun.Bolt).transform.localPosition.z; } } [RequireComponent(typeof(FirearmHeatingEffect))] public class OverheatingWeapon : MonoBehaviour { public enum ManualCooldownButton { AOrTouchpadDown, BOrTouchpadUp } [Header("General Stuff (read the tooltips!)")] public FirearmHeatingEffect HeatingEffect; [Tooltip("When cooling down from overheated, the cooldown rate is multiplied by this number.")] public float OverheatCooldownMultiplier = 1f; [Tooltip("If enabled, automatically cycle the bolt when the gun cools down completely after overheating. If this UsesHeatsinkBehavior, it auto-racks the bolt when a new heatsink is inserted. Only works for Open Bolts, Closed Bolts, and Handguns.")] public bool AutoCycleBoltOnCooldown; public bool OnlyCoolsDownIfBoltActionBoltIsOpen; public BoltActionRifle_Handle BoltHandle; [Header("Manual Cooldown")] [Tooltip("If enabled, pressing a button on your controller (choose which one below) will manually trigger the cooldown state, even if the gun isn't completely overheated. Only works if the gun doesn't UseHeatsinkBehavior, obviously. Just eject the magazine, silly.")] public bool CanManuallyTriggerCooldown; public ManualCooldownButton CooldownButton; [Tooltip("The minimum heat at which it is possible to manually trigger the cooldown state.")] public float MinHeatRequiredForManualCooldown = 0.1f; [Header("Heatsink Behavior")] [Tooltip("If enabled, the firearm will have unlimited ammunition but will deplete its magazine (heatsink) if it hits maximum heat to force a reload. Swapping sinks after hitting max heat will instantly reset the heat to zero. If disabled, the gun + magazine will function conventionally, but hitting max heat will force the gun into an overheat state where it can't fire until it cools down completely.")] public bool UsesHeatsinkBehavior; [Tooltip("If enabled, and if this also uses heatsink behavior, the gun will automatically eject its mag (heatsink) when it burns out.")] public bool AutoEjectsSpentHeatsink; [Tooltip("If enabled, and if this auto ejects spent heatsink, automatically break open the given break open trigger and eject the mag when it burns out.")] public bool UsesSimpleHinge; public SimpleHinge Hinge; [Header("Visuals/Audio")] [Tooltip("Optional. When overheated, play these particle systems until the gun has cooled down fully.")] public ParticleSystem[] OverheatedParticles; public AudioEvent OverheatSound; public AudioEvent CooldownSound; private bool IsCoolingToZero; private FVRFireArm Weapon; private float CurrentHeat; private Handgun hg; private ClosedBoltWeapon cbw; private OpenBoltReceiver obr; private float BaseCooldownRate; private bool inputResetPending = false; private void Start() { Weapon = HeatingEffect.FireArm; BaseCooldownRate = HeatingEffect.CooldownRate; if (AutoCycleBoltOnCooldown) { if (Weapon is Handgun) { ref Handgun reference = ref hg; FVRFireArm weapon = Weapon; reference = (Handgun)(object)((weapon is Handgun) ? weapon : null); hg.Slide.ImpartFiringImpulse(); } if (Weapon is ClosedBoltWeapon) { ref ClosedBoltWeapon reference2 = ref cbw; FVRFireArm weapon2 = Weapon; reference2 = (ClosedBoltWeapon)(object)((weapon2 is ClosedBoltWeapon) ? weapon2 : null); cbw.Bolt.ImpartFiringImpulse(); } if (Weapon is OpenBoltReceiver) { ref OpenBoltReceiver reference3 = ref obr; FVRFireArm weapon3 = Weapon; reference3 = (OpenBoltReceiver)(object)((weapon3 is OpenBoltReceiver) ? weapon3 : null); obr.Bolt.ImpartFiringImpulse(); } } StopOverheatedParticles(); } private void Update() { CurrentHeat = HeatingEffect.Heat; FVRFireArmMagazine magazine = Weapon.Magazine; if ((Object)(object)magazine == (Object)null) { return; } if (UsesHeatsinkBehavior) { HandleHeatsinkBehavior(magazine); } if (!UsesHeatsinkBehavior) { if (CanManuallyTriggerCooldown) { TryToManuallyStartCooldown(); } if (OnlyCoolsDownIfBoltActionBoltIsOpen) { HandleBoltActionOverheat(magazine); } else { HandleStandardOverheat(magazine); } } } private void HandleHeatsinkBehavior(FVRFireArmMagazine mag) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) if (CurrentHeat >= 1f && !IsCoolingToZero) { IsCoolingToZero = true; mag.IsInfinite = false; mag.ForceEmpty(); SM.PlayCoreSound((FVRPooledAudioType)0, OverheatSound, ((Component)this).transform.position); HeatingEffect.CooldownRate = BaseCooldownRate * OverheatCooldownMultiplier; if (AutoEjectsSpentHeatsink && !UsesSimpleHinge) { Weapon.EjectMag(false); } if (UsesSimpleHinge) { Hinge.EjectMagOnOpen = true; Hinge.Unlatch(); } PlayOverheatedParticles(); } if (!IsCoolingToZero) { mag.IsInfinite = true; } if (IsCoolingToZero && (Object)(object)mag != (Object)null && mag.HasARound() && mag.IsExtractable) { HeatingEffect.Heat = 0f; IsCoolingToZero = false; mag.IsInfinite = true; HeatingEffect.CooldownRate = BaseCooldownRate; SM.PlayCoreSound((FVRPooledAudioType)0, CooldownSound, ((Component)this).transform.position); if (AutoCycleBoltOnCooldown) { AutoCycleBolt(); } StopOverheatedParticles(); } } private void HandleStandardOverheat(FVRFireArmMagazine mag) { //IL_0081: Unknown result type (might be due to invalid IL or missing references) if (CurrentHeat >= 1f && !IsCoolingToZero) { StartCooldownStandard(mag); } if (!IsCoolingToZero) { mag.IsExtractable = true; } if (IsCoolingToZero && CurrentHeat <= 0f) { IsCoolingToZero = false; mag.IsExtractable = true; HeatingEffect.CooldownRate = BaseCooldownRate; SM.PlayCoreSound((FVRPooledAudioType)0, CooldownSound, ((Component)this).transform.position); if (AutoCycleBoltOnCooldown) { AutoCycleBolt(); } StopOverheatedParticles(); } } private void HandleBoltActionOverheat(FVRFireArmMagazine mag) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 //IL_0102: Unknown result type (might be due to invalid IL or missing references) bool flag = (int)BoltHandle.HandleState == 2; if (!IsCoolingToZero && CurrentHeat >= 1f && flag) { StartCooldownStandard(mag); } if (IsCoolingToZero) { if (flag) { HeatingEffect.CooldownRate = BaseCooldownRate * OverheatCooldownMultiplier; } else { HeatingEffect.CooldownRate = 0f; } } else { HeatingEffect.CooldownRate = ((!flag) ? 0f : BaseCooldownRate); } if (!IsCoolingToZero) { mag.IsExtractable = true; } if (IsCoolingToZero && CurrentHeat <= 0f) { IsCoolingToZero = false; mag.IsExtractable = true; HeatingEffect.CooldownRate = BaseCooldownRate; SM.PlayCoreSound((FVRPooledAudioType)0, CooldownSound, ((Component)this).transform.position); if (AutoCycleBoltOnCooldown) { AutoCycleBolt(); } StopOverheatedParticles(); } } private void StartCooldownStandard(FVRFireArmMagazine mag) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (!IsCoolingToZero) { IsCoolingToZero = true; mag.IsExtractable = false; HeatingEffect.CooldownRate = BaseCooldownRate * OverheatCooldownMultiplier; SM.PlayCoreSound((FVRPooledAudioType)0, OverheatSound, ((Component)this).transform.position); PlayOverheatedParticles(); } } private void TryToManuallyStartCooldown() { //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand == (Object)null) { return; } if (CooldownButton == ManualCooldownButton.AOrTouchpadDown) { if (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)Weapon).m_hand.Input.AXButtonDown && !IsCoolingToZero && CurrentHeat > MinHeatRequiredForManualCooldown) { StartCooldownStandard(Weapon.Magazine); } } else if (!IsCoolingToZero && CurrentHeat > MinHeatRequiredForManualCooldown && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, Vector2.down) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) { StartCooldownStandard(Weapon.Magazine); } } else if (((FVRInteractiveObject)Weapon).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)Weapon).m_hand.Input.BYButtonDown && !IsCoolingToZero && CurrentHeat > MinHeatRequiredForManualCooldown) { StartCooldownStandard(Weapon.Magazine); } } else if (!IsCoolingToZero && CurrentHeat > MinHeatRequiredForManualCooldown && Vector2.Angle(((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes, Vector2.up) <= 45f && ((Vector2)(ref ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadAxes)).magnitude > 0.4f && ((FVRInteractiveObject)Weapon).m_hand.Input.TouchpadPressed) { StartCooldownStandard(Weapon.Magazine); } } private void PlayOverheatedParticles() { if (OverheatedParticles == null) { return; } ParticleSystem[] overheatedParticles = OverheatedParticles; foreach (ParticleSystem val in overheatedParticles) { if ((Object)(object)val != (Object)null && !val.isPlaying) { val.Play(); } } } private void StopOverheatedParticles() { if (OverheatedParticles == null) { return; } ParticleSystem[] overheatedParticles = OverheatedParticles; foreach (ParticleSystem val in overheatedParticles) { if ((Object)(object)val != (Object)null && val.isPlaying) { val.Stop(); } } } private void AutoCycleBolt() { if ((Object)(object)hg != (Object)null) { hg.Slide.ImpartFiringImpulse(); } if ((Object)(object)cbw != (Object)null) { cbw.Bolt.ImpartFiringImpulse(); } if ((Object)(object)obr != (Object)null) { obr.Bolt.ImpartFiringImpulse(); } } } } public class DynamicBoneDemo1 : MonoBehaviour { public GameObject m_Player; private float m_weight = 1f; private void Update() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0056: 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_006a: Unknown result type (might be due to invalid IL or missing references) m_Player.transform.Rotate(new Vector3(0f, Input.GetAxis("Horizontal") * Time.deltaTime * 200f, 0f)); m_Player.transform.Translate(((Component)this).transform.forward * Input.GetAxis("Vertical") * Time.deltaTime * 4f); } private void OnGUI() { //IL_0015: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: 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_0137: Unknown result type (might be due to invalid IL or missing references) GUI.Label(new Rect(50f, 50f, 200f, 24f), "Press arrow key to move"); Animation componentInChildren = m_Player.GetComponentInChildren(); ((Behaviour)componentInChildren).enabled = GUI.Toggle(new Rect(50f, 70f, 200f, 24f), ((Behaviour)componentInChildren).enabled, "Play Animation"); DynamicBone[] components = m_Player.GetComponents(); GUI.Label(new Rect(50f, 100f, 200f, 24f), "Choose dynamic bone:"); DynamicBone obj = components[0]; bool enabled = GUI.Toggle(new Rect(50f, 120f, 100f, 24f), ((Behaviour)components[0]).enabled, "Breasts"); ((Behaviour)components[1]).enabled = enabled; ((Behaviour)obj).enabled = enabled; ((Behaviour)components[2]).enabled = GUI.Toggle(new Rect(50f, 140f, 100f, 24f), ((Behaviour)components[2]).enabled, "Tail"); GUI.Label(new Rect(50f, 160f, 200f, 24f), "Weight"); m_weight = GUI.HorizontalSlider(new Rect(100f, 160f, 100f, 24f), m_weight, 0f, 1f); DynamicBone[] array = components; foreach (DynamicBone dynamicBone in array) { dynamicBone.SetWeight(m_weight); } } } [AddComponentMenu("Dynamic Bone/Dynamic Bone")] public class DynamicBone : MonoBehaviour { public enum UpdateMode { Normal, AnimatePhysics, UnscaledTime } public enum FreezeAxis { None, X, Y, Z } private class Particle { public Transform m_Transform = null; public int m_ParentIndex = -1; public float m_Damping = 0f; public float m_Elasticity = 0f; public float m_Stiffness = 0f; public float m_Inert = 0f; public float m_Friction = 0f; public float m_Radius = 0f; public float m_BoneLength = 0f; public bool m_isCollide = false; public Vector3 m_Position = Vector3.zero; public Vector3 m_PrevPosition = Vector3.zero; public Vector3 m_EndOffset = Vector3.zero; public Vector3 m_InitLocalPosition = Vector3.zero; public Quaternion m_InitLocalRotation = Quaternion.identity; } [Tooltip("The root of the transform hierarchy to apply physics.")] public Transform m_Root = null; [Tooltip("Internal physics simulation rate.")] public float m_UpdateRate = 60f; public UpdateMode m_UpdateMode = UpdateMode.Normal; [Tooltip("How much the bones slowed down.")] [Range(0f, 1f)] public float m_Damping = 0.1f; public AnimationCurve m_DampingDistrib = null; [Tooltip("How much the force applied to return each bone to original orientation.")] [Range(0f, 1f)] public float m_Elasticity = 0.1f; public AnimationCurve m_ElasticityDistrib = null; [Tooltip("How much bone's original orientation are preserved.")] [Range(0f, 1f)] public float m_Stiffness = 0.1f; public AnimationCurve m_StiffnessDistrib = null; [Tooltip("How much character's position change is ignored in physics simulation.")] [Range(0f, 1f)] public float m_Inert = 0f; public AnimationCurve m_InertDistrib = null; [Tooltip("How much the bones slowed down when collide.")] public float m_Friction = 0f; public AnimationCurve m_FrictionDistrib = null; [Tooltip("Each bone can be a sphere to collide with colliders. Radius describe sphere's size.")] public float m_Radius = 0f; public AnimationCurve m_RadiusDistrib = null; [Tooltip("If End Length is not zero, an extra bone is generated at the end of transform hierarchy.")] public float m_EndLength = 0f; [Tooltip("If End Offset is not zero, an extra bone is generated at the end of transform hierarchy.")] public Vector3 m_EndOffset = Vector3.zero; [Tooltip("The force apply to bones. Partial force apply to character's initial pose is cancelled out.")] public Vector3 m_Gravity = Vector3.zero; [Tooltip("The force apply to bones.")] public Vector3 m_Force = Vector3.zero; [Tooltip("Collider objects interact with the bones.")] public List m_Colliders = null; [Tooltip("Bones exclude from physics simulation.")] public List m_Exclusions = null; [Tooltip("Constrain bones to move on specified plane.")] public FreezeAxis m_FreezeAxis = FreezeAxis.None; [Tooltip("Disable physics simulation automatically if character is far from camera or player.")] public bool m_DistantDisable = false; public Transform m_ReferenceObject = null; public float m_DistanceToObject = 20f; private Vector3 m_LocalGravity = Vector3.zero; private Vector3 m_ObjectMove = Vector3.zero; private Vector3 m_ObjectPrevPosition = Vector3.zero; private float m_BoneTotalLength = 0f; private float m_ObjectScale = 1f; private float m_Time = 0f; private float m_Weight = 1f; private bool m_DistantDisabled = false; private List m_Particles = new List(); private void Start() { SetupParticles(); } private void FixedUpdate() { if (m_UpdateMode == UpdateMode.AnimatePhysics) { PreUpdate(); } } private void Update() { if (m_UpdateMode != UpdateMode.AnimatePhysics) { PreUpdate(); } } private void LateUpdate() { if (m_DistantDisable) { CheckDistance(); } if (m_Weight > 0f && (!m_DistantDisable || !m_DistantDisabled)) { float t = ((m_UpdateMode != UpdateMode.UnscaledTime) ? Time.deltaTime : Time.unscaledDeltaTime); UpdateDynamicBones(t); } } private void PreUpdate() { if (m_Weight > 0f && (!m_DistantDisable || !m_DistantDisabled)) { InitTransforms(); } } private void CheckDistance() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) Transform val = m_ReferenceObject; if ((Object)(object)val == (Object)null && (Object)(object)Camera.main != (Object)null) { val = ((Component)Camera.main).transform; } if (!((Object)(object)val != (Object)null)) { return; } Vector3 val2 = val.position - ((Component)this).transform.position; float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; bool flag = sqrMagnitude > m_DistanceToObject * m_DistanceToObject; if (flag != m_DistantDisabled) { if (!flag) { ResetParticlesPosition(); } m_DistantDisabled = flag; } } private void OnEnable() { ResetParticlesPosition(); } private void OnDisable() { InitTransforms(); } private void OnValidate() { m_UpdateRate = Mathf.Max(m_UpdateRate, 0f); m_Damping = Mathf.Clamp01(m_Damping); m_Elasticity = Mathf.Clamp01(m_Elasticity); m_Stiffness = Mathf.Clamp01(m_Stiffness); m_Inert = Mathf.Clamp01(m_Inert); m_Friction = Mathf.Clamp01(m_Friction); m_Radius = Mathf.Max(m_Radius, 0f); if (Application.isEditor && Application.isPlaying) { InitTransforms(); SetupParticles(); } } private void OnDrawGizmosSelected() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled || (Object)(object)m_Root == (Object)null) { return; } if (Application.isEditor && !Application.isPlaying && ((Component)this).transform.hasChanged) { InitTransforms(); SetupParticles(); } Gizmos.color = Color.white; for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { Particle particle2 = m_Particles[particle.m_ParentIndex]; Gizmos.DrawLine(particle.m_Position, particle2.m_Position); } if (particle.m_Radius > 0f) { Gizmos.DrawWireSphere(particle.m_Position, particle.m_Radius * m_ObjectScale); } } } public void SetWeight(float w) { if (m_Weight != w) { if (w == 0f) { InitTransforms(); } else if (m_Weight == 0f) { ResetParticlesPosition(); } m_Weight = w; } } public float GetWeight() { return m_Weight; } private void UpdateDynamicBones(float t) { //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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_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) if ((Object)(object)m_Root == (Object)null) { return; } m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectMove = ((Component)this).transform.position - m_ObjectPrevPosition; m_ObjectPrevPosition = ((Component)this).transform.position; int num = 1; if (m_UpdateRate > 0f) { float num2 = 1f / m_UpdateRate; m_Time += t; num = 0; while (m_Time >= num2) { m_Time -= num2; if (++num >= 3) { m_Time = 0f; break; } } } if (num > 0) { for (int i = 0; i < num; i++) { UpdateParticles1(); UpdateParticles2(); m_ObjectMove = Vector3.zero; } } else { SkipUpdateParticles(); } ApplyParticlesToTransforms(); } private void SetupParticles() { //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_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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) m_Particles.Clear(); if (!((Object)(object)m_Root == (Object)null)) { m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); m_ObjectScale = Mathf.Abs(((Component)this).transform.lossyScale.x); m_ObjectPrevPosition = ((Component)this).transform.position; m_ObjectMove = Vector3.zero; m_BoneTotalLength = 0f; AppendParticles(m_Root, -1, 0f); UpdateParameters(); } } private void AppendParticles(Transform b, int parentIndex, float boneLength) { //IL_0025: 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_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_0124: 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_008f: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) Particle particle = new Particle(); particle.m_Transform = b; particle.m_ParentIndex = parentIndex; Vector3 val; if ((Object)(object)b != (Object)null) { val = (particle.m_Position = (particle.m_PrevPosition = b.position)); particle.m_InitLocalPosition = b.localPosition; particle.m_InitLocalRotation = b.localRotation; } else { Transform transform = m_Particles[parentIndex].m_Transform; if (m_EndLength > 0f) { Transform parent = transform.parent; if ((Object)(object)parent != (Object)null) { particle.m_EndOffset = transform.InverseTransformPoint(transform.position * 2f - parent.position) * m_EndLength; } else { particle.m_EndOffset = new Vector3(m_EndLength, 0f, 0f); } } else { particle.m_EndOffset = transform.InverseTransformPoint(((Component)this).transform.TransformDirection(m_EndOffset) + transform.position); } val = (particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset))); } if (parentIndex >= 0) { float num = boneLength; val = m_Particles[parentIndex].m_Transform.position - particle.m_Position; boneLength = num + ((Vector3)(ref val)).magnitude; particle.m_BoneLength = boneLength; m_BoneTotalLength = Mathf.Max(m_BoneTotalLength, boneLength); } int count = m_Particles.Count; m_Particles.Add(particle); if (!((Object)(object)b != (Object)null)) { return; } for (int i = 0; i < b.childCount; i++) { bool flag = false; if (m_Exclusions != null) { for (int j = 0; j < m_Exclusions.Count; j++) { Transform val2 = m_Exclusions[j]; if ((Object)(object)val2 == (Object)(object)b.GetChild(i)) { flag = true; break; } } } if (!flag) { AppendParticles(b.GetChild(i), count, boneLength); } else if (m_EndLength > 0f || m_EndOffset != Vector3.zero) { AppendParticles(null, count, boneLength); } } if (b.childCount == 0 && (m_EndLength > 0f || m_EndOffset != Vector3.zero)) { AppendParticles(null, count, boneLength); } } public void UpdateParameters() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_Root == (Object)null) { return; } m_LocalGravity = m_Root.InverseTransformDirection(m_Gravity); for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; particle.m_Damping = m_Damping; particle.m_Elasticity = m_Elasticity; particle.m_Stiffness = m_Stiffness; particle.m_Inert = m_Inert; particle.m_Friction = m_Friction; particle.m_Radius = m_Radius; if (m_BoneTotalLength > 0f) { float num = particle.m_BoneLength / m_BoneTotalLength; if (m_DampingDistrib != null && m_DampingDistrib.keys.Length > 0) { particle.m_Damping *= m_DampingDistrib.Evaluate(num); } if (m_ElasticityDistrib != null && m_ElasticityDistrib.keys.Length > 0) { particle.m_Elasticity *= m_ElasticityDistrib.Evaluate(num); } if (m_StiffnessDistrib != null && m_StiffnessDistrib.keys.Length > 0) { particle.m_Stiffness *= m_StiffnessDistrib.Evaluate(num); } if (m_InertDistrib != null && m_InertDistrib.keys.Length > 0) { particle.m_Inert *= m_InertDistrib.Evaluate(num); } if (m_FrictionDistrib != null && m_FrictionDistrib.keys.Length > 0) { particle.m_Friction *= m_FrictionDistrib.Evaluate(num); } if (m_RadiusDistrib != null && m_RadiusDistrib.keys.Length > 0) { particle.m_Radius *= m_RadiusDistrib.Evaluate(num); } } particle.m_Damping = Mathf.Clamp01(particle.m_Damping); particle.m_Elasticity = Mathf.Clamp01(particle.m_Elasticity); particle.m_Stiffness = Mathf.Clamp01(particle.m_Stiffness); particle.m_Inert = Mathf.Clamp01(particle.m_Inert); particle.m_Friction = Mathf.Clamp01(particle.m_Friction); particle.m_Radius = Mathf.Max(particle.m_Radius, 0f); } } private void InitTransforms() { //IL_002f: 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) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Transform.localPosition = particle.m_InitLocalPosition; particle.m_Transform.localRotation = particle.m_InitLocalRotation; } } } private void ResetParticlesPosition() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Position = (particle.m_PrevPosition = particle.m_Transform.position); } else { Transform transform = m_Particles[particle.m_ParentIndex].m_Transform; particle.m_Position = (particle.m_PrevPosition = transform.TransformPoint(particle.m_EndOffset)); } particle.m_isCollide = false; } m_ObjectPrevPosition = ((Component)this).transform.position; } private void UpdateParticles1() { //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_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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_0027: 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_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: 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_00b1: 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_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) Vector3 gravity = m_Gravity; Vector3 normalized = ((Vector3)(ref m_Gravity)).normalized; Vector3 val = m_Root.TransformDirection(m_LocalGravity); Vector3 val2 = normalized * Mathf.Max(Vector3.Dot(val, normalized), 0f); gravity -= val2; gravity = (gravity + m_Force) * m_ObjectScale; for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { Vector3 val3 = particle.m_Position - particle.m_PrevPosition; Vector3 val4 = m_ObjectMove * particle.m_Inert; particle.m_PrevPosition = particle.m_Position + val4; float num = particle.m_Damping; if (particle.m_isCollide) { num += particle.m_Friction; if (num > 1f) { num = 1f; } particle.m_isCollide = false; } particle.m_Position += val3 * (1f - num) + gravity + val4; } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_Transform.position; } } } private void UpdateParticles2() { //IL_0003: 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_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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0118: 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_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: 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_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_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_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: 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_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028d: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) Plane val = default(Plane); for (int i = 1; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; Particle particle2 = m_Particles[particle.m_ParentIndex]; float magnitude; if ((Object)(object)particle.m_Transform != (Object)null) { Vector3 val2 = particle2.m_Transform.position - particle.m_Transform.position; magnitude = ((Vector3)(ref val2)).magnitude; } else { Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix; Vector3 val3 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val3)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f || particle.m_Elasticity > 0f) { Matrix4x4 localToWorldMatrix2 = particle2.m_Transform.localToWorldMatrix; ((Matrix4x4)(ref localToWorldMatrix2)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val4 = ((!((Object)(object)particle.m_Transform != (Object)null)) ? ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_Transform.localPosition)); Vector3 val5 = val4 - particle.m_Position; particle.m_Position += val5 * particle.m_Elasticity; if (num > 0f) { val5 = val4 - particle.m_Position; float magnitude2 = ((Vector3)(ref val5)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val5 * ((magnitude2 - num2) / magnitude2); } } } if (m_Colliders != null) { float particleRadius = particle.m_Radius * m_ObjectScale; for (int j = 0; j < m_Colliders.Count; j++) { DynamicBoneColliderBase dynamicBoneColliderBase = m_Colliders[j]; if ((Object)(object)dynamicBoneColliderBase != (Object)null && ((Behaviour)dynamicBoneColliderBase).enabled) { particle.m_isCollide |= dynamicBoneColliderBase.Collide(ref particle.m_Position, particleRadius); } } } if (m_FreezeAxis != 0) { switch (m_FreezeAxis) { case FreezeAxis.X: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.right, particle2.m_Position); break; case FreezeAxis.Y: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.up, particle2.m_Position); break; case FreezeAxis.Z: ((Plane)(ref val)).SetNormalAndPosition(particle2.m_Transform.forward, particle2.m_Position); break; } particle.m_Position -= ((Plane)(ref val)).normal * ((Plane)(ref val)).GetDistanceToPoint(particle.m_Position); } Vector3 val6 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val6)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val6 * ((magnitude3 - magnitude) / magnitude3); } } } private void SkipUpdateParticles() { //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: 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_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_008f: 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_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_012a: 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_0143: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) for (int i = 0; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; if (particle.m_ParentIndex >= 0) { particle.m_PrevPosition += m_ObjectMove; particle.m_Position += m_ObjectMove; Particle particle2 = m_Particles[particle.m_ParentIndex]; float magnitude; if ((Object)(object)particle.m_Transform != (Object)null) { Vector3 val = particle2.m_Transform.position - particle.m_Transform.position; magnitude = ((Vector3)(ref val)).magnitude; } else { Matrix4x4 localToWorldMatrix = particle2.m_Transform.localToWorldMatrix; Vector3 val2 = ((Matrix4x4)(ref localToWorldMatrix)).MultiplyVector(particle.m_EndOffset); magnitude = ((Vector3)(ref val2)).magnitude; } float num = Mathf.Lerp(1f, particle.m_Stiffness, m_Weight); if (num > 0f) { Matrix4x4 localToWorldMatrix2 = particle2.m_Transform.localToWorldMatrix; ((Matrix4x4)(ref localToWorldMatrix2)).SetColumn(3, Vector4.op_Implicit(particle2.m_Position)); Vector3 val3 = ((!((Object)(object)particle.m_Transform != (Object)null)) ? ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_EndOffset) : ((Matrix4x4)(ref localToWorldMatrix2)).MultiplyPoint3x4(particle.m_Transform.localPosition)); Vector3 val4 = val3 - particle.m_Position; float magnitude2 = ((Vector3)(ref val4)).magnitude; float num2 = magnitude * (1f - num) * 2f; if (magnitude2 > num2) { particle.m_Position += val4 * ((magnitude2 - num2) / magnitude2); } } Vector3 val5 = particle2.m_Position - particle.m_Position; float magnitude3 = ((Vector3)(ref val5)).magnitude; if (magnitude3 > 0f) { particle.m_Position += val5 * ((magnitude3 - magnitude) / magnitude3); } } else { particle.m_PrevPosition = particle.m_Position; particle.m_Position = particle.m_Transform.position; } } } private static Vector3 MirrorVector(Vector3 v, Vector3 axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return v - axis * (Vector3.Dot(v, axis) * 2f); } private void ApplyParticlesToTransforms() { //IL_00c1: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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_006f: 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_007c: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_009e: Unknown result type (might be due to invalid IL or missing references) for (int i = 1; i < m_Particles.Count; i++) { Particle particle = m_Particles[i]; Particle particle2 = m_Particles[particle.m_ParentIndex]; if (particle2.m_Transform.childCount <= 1) { Vector3 val = ((!((Object)(object)particle.m_Transform != (Object)null)) ? particle.m_EndOffset : particle.m_Transform.localPosition); Vector3 val2 = particle.m_Position - particle2.m_Position; Quaternion val3 = Quaternion.FromToRotation(particle2.m_Transform.TransformDirection(val), val2); particle2.m_Transform.rotation = val3 * particle2.m_Transform.rotation; } if ((Object)(object)particle.m_Transform != (Object)null) { particle.m_Transform.position = particle.m_Position; } } } } [AddComponentMenu("Dynamic Bone/Dynamic Bone Collider")] public class DynamicBoneCollider : DynamicBoneColliderBase { [Tooltip("The radius of the sphere or capsule.")] public float m_Radius = 0.5f; [Tooltip("The height of the capsule.")] public float m_Height = 0f; private void OnValidate() { m_Radius = Mathf.Max(m_Radius, 0f); m_Height = Mathf.Max(m_Height, 0f); } public override bool Collide(ref Vector3 particlePosition, float particleRadius) { //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_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_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_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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0172: 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_013d: 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_014a: Unknown result type (might be due to invalid IL or missing references) float num = m_Radius * Mathf.Abs(((Component)this).transform.lossyScale.x); float num2 = m_Height * 0.5f - m_Radius; if (num2 <= 0f) { if (m_Bound == Bound.Outside) { return OutsideSphere(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(m_Center), num); } return InsideSphere(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(m_Center), num); } Vector3 center = m_Center; Vector3 center2 = m_Center; switch (m_Direction) { case Direction.X: center.x -= num2; center2.x += num2; break; case Direction.Y: center.y -= num2; center2.y += num2; break; case Direction.Z: center.z -= num2; center2.z += num2; break; } if (m_Bound == Bound.Outside) { return OutsideCapsule(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(center), ((Component)this).transform.TransformPoint(center2), num); } return InsideCapsule(ref particlePosition, particleRadius, ((Component)this).transform.TransformPoint(center), ((Component)this).transform.TransformPoint(center2), num); } private static bool OutsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_004a: Unknown result type (might be due to invalid IL or missing references) float num = sphereRadius + particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool InsideSphere(ref Vector3 particlePosition, float particleRadius, Vector3 sphereCenter, float sphereRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) float num = sphereRadius - particleRadius; float num2 = num * num; Vector3 val = particlePosition - sphereCenter; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude > num2) { float num3 = Mathf.Sqrt(sqrMagnitude); particlePosition = sphereCenter + val * (num / num3); return true; } return false; } private static bool OutsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_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 references) //IL_009b: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0145: 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) float num = capsuleRadius + particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > 0f && sqrMagnitude < num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; if (num3 >= sqrMagnitude2) { val2 = particlePosition - capsuleP1; float sqrMagnitude3 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude3 > 0f && sqrMagnitude3 < num2) { float num5 = Mathf.Sqrt(sqrMagnitude3); particlePosition = capsuleP1 + val2 * (num / num5); return true; } } else if (sqrMagnitude2 > 0f) { num3 /= sqrMagnitude2; val2 -= val * num3; float sqrMagnitude4 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude4 > 0f && sqrMagnitude4 < num2) { float num6 = Mathf.Sqrt(sqrMagnitude4); particlePosition += val2 * ((num - num6) / num6); return true; } } } return false; } private static bool InsideCapsule(ref Vector3 particlePosition, float particleRadius, Vector3 capsuleP0, Vector3 capsuleP1, float capsuleRadius) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) float num = capsuleRadius - particleRadius; float num2 = num * num; Vector3 val = capsuleP1 - capsuleP0; Vector3 val2 = particlePosition - capsuleP0; float num3 = Vector3.Dot(val2, val); if (num3 <= 0f) { float sqrMagnitude = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude > num2) { float num4 = Mathf.Sqrt(sqrMagnitude); particlePosition = capsuleP0 + val2 * (num / num4); return true; } } else { float sqrMagnitude2 = ((Vector3)(ref val)).sqrMagnitude; if (num3 >= sqrMagnitude2) { val2 = particlePosition - capsuleP1; float sqrMagnitude3 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude3 > num2) { float num5 = Mathf.Sqrt(sqrMagnitude3); particlePosition = capsuleP1 + val2 * (num / num5); return true; } } else if (sqrMagnitude2 > 0f) { num3 /= sqrMagnitude2; val2 -= val * num3; float sqrMagnitude4 = ((Vector3)(ref val2)).sqrMagnitude; if (sqrMagnitude4 > num2) { float num6 = Mathf.Sqrt(sqrMagnitude4); particlePosition += val2 * ((num - num6) / num6); return true; } } } return false; } private void OnDrawGizmosSelected() { //IL_002b: 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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: 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_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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) if (!((Behaviour)this).enabled) { return; } if (m_Bound == Bound.Outside) { Gizmos.color = Color.yellow; } else { Gizmos.color = Color.magenta; } float num = m_Radius * Mathf.Abs(((Component)this).transform.lossyScale.x); float num2 = m_Height * 0.5f - m_Radius; if (num2 <= 0f) { Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(m_Center), num); return; } Vector3 center = m_Center; Vector3 center2 = m_Center; switch (m_Direction) { case Direction.X: center.x -= num2; center2.x += num2; break; case Direction.Y: center.y -= num2; center2.y += num2; break; case Direction.Z: center.z -= num2; center2.z += num2; break; } Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(center), num); Gizmos.DrawWireSphere(((Component)this).transform.TransformPoint(center2), num); } } public class DynamicBoneColliderBase : MonoBehaviour { public enum Direction { X, Y, Z } public enum Bound { Outside, Inside } [Tooltip("The axis of the capsule's height.")] public Direction m_Direction = Direction.Y; [Tooltip("The center of the sphere or capsule, in the object's local space.")] public Vector3 m_Center = Vector3.zero; [Tooltip("Constrain bones to outside bound or inside bound.")] public Bound m_Bound = Bound.Outside; public virtual bool Collide(ref Vector3 particlePosition, float particleRadius) { return false; } } [AddComponentMenu("Dynamic Bone/Dynamic Bone Plane Collider")] public class DynamicBonePlaneCollider : DynamicBoneColliderBase { private void OnValidate() { } public override bool Collide(ref Vector3 particlePosition, float particleRadius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_006f: 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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //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_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_00dc: 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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.up; switch (m_Direction) { case Direction.X: val = ((Component)this).transform.right; break; case Direction.Y: val = ((Component)this).transform.up; break; case Direction.Z: val = ((Component)this).transform.forward; break; } Vector3 val2 = ((Component)this).transform.TransformPoint(m_Center); Plane val3 = default(Plane); ((Plane)(ref val3))..ctor(val, val2); float distanceToPoint = ((Plane)(ref val3)).GetDistanceToPoint(particlePosition); if (m_Bound == Bound.Outside) { if (distanceToPoint < 0f) { particlePosition -= val * distanceToPoint; return true; } } else if (distanceToPoint > 0f) { particlePosition -= val * distanceToPoint; return true; } return false; } private void OnDrawGizmosSelected() { //IL_002b: 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_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 references) //IL_009f: 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) //IL_00a2: 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_0072: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (((Behaviour)this).enabled) { if (m_Bound == Bound.Outside) { Gizmos.color = Color.yellow; } else { Gizmos.color = Color.magenta; } Vector3 val = Vector3.up; switch (m_Direction) { case Direction.X: val = ((Component)this).transform.right; break; case Direction.Y: val = ((Component)this).transform.up; break; case Direction.Z: val = ((Component)this).transform.forward; break; } Vector3 val2 = ((Component)this).transform.TransformPoint(m_Center); Gizmos.DrawLine(val2, val2 + val); } } } namespace ShermanJumbo { public class PilotLight : MonoBehaviour { private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) ((Component)this).gameObject.transform.localScale = Vector3.one + Random.onUnitSphere * 0.05f; } } public class PinlessGrenade : FVRPhysicalObject, IFVRDamageable { public bool DoesUseHandedPose = true; private bool m_isInRightHandMode = true; [Header("Fusing")] public bool IsExternallyFused = false; public bool m_isArmed = false; public Vector2 DefaultFuse = new Vector2(3.3f, 3.3f); private float m_startFuseTime = 15f; private float m_fuseTime = 15f; public bool FuseOnSpawn; private bool m_isFused; public bool HasImpactFuse; public bool DoesImpactFuseTickHeld; public float ImpactFuseVelThreshold = 5f; private bool m_isImpactFuseActive; public float m_impactFuseBurnDown = 1f; public bool ExplodesIfDamaged = false; public bool ExplodeEvenIfNotArmed = false; [Header("Fire Params")] public bool UsesGroundFireEffect; public GameObject GroundFirePrefab; public int GroundFireAmount = 8; public float GroundFireRange = 5f; public LayerMask LM_Env; private RaycastHit m_hit; [Header("Payload")] public List SpawnOnSplode; public SmokeSolidEmitter SmokeEmitter; [Header("Audio")] public AudioEvent ActivatedSound; [Header("Variable Fuse Params")] public bool IsExternallyControlled = false; private float m_fuse_tick; private float m_fuse_StartRefire = 0.4f; private float m_fuse_EndRefire = 0.02f; public bool UseBetterVarTimeFuse = true; public AudioEvent FusePulseSound; public ParticleSystem FusePSystem; public Text ReadoutText; public float[] FuzeTimes; public float PitchStart = 1f; public float PitchEnd = 2.5f; private int FuzeTimeIndex = 0; private bool m_isPinPulled; private bool m_hasSploded; public int IFF; public override void Awake() { ((FVRPhysicalObject)this).Awake(); if (UseBetterVarTimeFuse) { ReadoutText.text = FuzeTimes[FuzeTimeIndex].ToString("F1") + "s"; } } public void UpdateFuseTime() { if (FuzeTimeIndex < FuzeTimes.Length - 1) { FuzeTimeIndex++; } else { FuzeTimeIndex = 0; } ReadoutText.text = FuzeTimes[FuzeTimeIndex].ToString("F1") + "s"; } public void Damage(Damage d) { if (ExplodesIfDamaged && (ExplodeEvenIfNotArmed || (m_isArmed && !ExplodeEvenIfNotArmed))) { m_fuseTime = 0f; } } public override void FVRUpdate() { //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0384: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isArmed && !HasImpactFuse) { m_fuseTime -= Time.deltaTime; } if (UseBetterVarTimeFuse) { if ((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null && !m_isArmed && ((((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.BYButtonDown) || (((FVRInteractiveObject)this).m_hand.Input.TouchpadDown && ((Vector2)(ref ((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes, Vector2.up) <= 45f))) { if (IsExternallyControlled) { return; } UpdateFuseTime(); } if (m_isArmed) { float num = m_fuseTime; if (num < 0f) { num = 0f; } ReadoutText.text = num.ToString("F1") + "s"; if (UseBetterVarTimeFuse) { float num2 = Mathf.Clamp(1f - m_fuseTime / m_startFuseTime, 0f, 1f); num2 = Mathf.Pow(num2, 2f); if (m_fuse_tick <= 0f) { m_fuse_tick = Mathf.Lerp(m_fuse_StartRefire, m_fuse_EndRefire, num2); float num3 = Mathf.Lerp(PitchStart, PitchEnd, num2); SM.PlayCoreSoundOverrides((FVRPooledAudioType)0, FusePulseSound, ((FVRInteractiveObject)this).Transform.position, new Vector2(1f, 1f), new Vector2(num3, num3)); FusePSystem.Emit(2); } else { m_fuse_tick -= Time.deltaTime; } } } } if (!(m_fuseTime <= 0.05f)) { return; } if (!m_hasSploded) { m_hasSploded = true; for (int i = 0; i < SpawnOnSplode.Count; i++) { GameObject val = Object.Instantiate(SpawnOnSplode[i], ((Component)this).transform.position, Quaternion.identity); Explosion component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.IFF = IFF; } ExplosionSound component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } GrenadeExplosion component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.IFF = IFF; } } if (UsesGroundFireEffect) { int num4 = 0; for (int j = 0; j < 5; j++) { if (num4 > 2) { break; } Vector3 val2 = -Vector3.up; if (j > 0) { val2 = Random.onUnitSphere; if (val2.y > 0f) { val2.y = 0f - val2.y; } } if (Physics.Raycast(((Component)this).transform.position + Vector3.up, val2, ref m_hit, GroundFireRange, LayerMask.op_Implicit(LM_Env), (QueryTriggerInteraction)1)) { Object.Instantiate(GroundFirePrefab, ((RaycastHit)(ref m_hit)).point, Quaternion.LookRotation(Vector3.up)); num4++; } } } } if ((Object)(object)SmokeEmitter != (Object)null) { SmokeEmitter.Engaged = true; return; } if (((FVRInteractiveObject)this).IsHeld) { FVRViveHand hand = ((FVRInteractiveObject)this).m_hand; ((FVRInteractiveObject)this).m_hand.ForceSetInteractable((FVRInteractiveObject)null); ((FVRInteractiveObject)this).EndInteraction(hand); } Object.Destroy((Object)(object)((Component)this).gameObject); } public override void FVRFixedUpdate() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRFixedUpdate(); if (!m_isArmed || !HasImpactFuse || m_isImpactFuseActive || (((FVRInteractiveObject)this).IsHeld && !DoesImpactFuseTickHeld) || !((Object)(object)((FVRPhysicalObject)this).QuickbeltSlot == (Object)null)) { return; } Vector3 velocity = ((FVRPhysicalObject)this).RootRigidbody.velocity; if (((Vector3)(ref velocity)).magnitude > ImpactFuseVelThreshold) { m_impactFuseBurnDown -= Time.deltaTime; if (m_impactFuseBurnDown <= 0f) { m_isImpactFuseActive = true; } } } public void ActivateFuse() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!m_isArmed) { SM.PlayCoreSound((FVRPooledAudioType)10, ActivatedSound, ((Component)this).transform.position); m_isArmed = true; if (UseBetterVarTimeFuse) { m_fuseTime = (m_startFuseTime = FuzeTimes[FuzeTimeIndex]); } else { m_fuseTime = (m_startFuseTime = Random.Range(DefaultFuse.x, DefaultFuse.y)); } } } public override void OnCollisionEnter(Collision col) { //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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).OnCollisionEnter(col); if (!m_isImpactFuseActive || m_hasSploded) { return; } m_hasSploded = true; for (int i = 0; i < SpawnOnSplode.Count; i++) { GameObject val = Object.Instantiate(SpawnOnSplode[i], ((Component)this).transform.position, Quaternion.identity); Explosion component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.IFF = IFF; } ExplosionSound component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.IFF = IFF; } GrenadeExplosion component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { component3.IFF = IFF; } } if (UsesGroundFireEffect) { int num = 0; for (int j = 0; j < 5; j++) { if (num > 2) { break; } Vector3 val2 = -Vector3.up; if (j > 0) { val2 = Random.onUnitSphere; if (val2.y > 0f) { val2.y = 0f - val2.y; } } if (Physics.Raycast(((Component)this).transform.position + Vector3.up, val2, ref m_hit, GroundFireRange, LayerMask.op_Implicit(LM_Env), (QueryTriggerInteraction)1)) { Object.Instantiate(GroundFirePrefab, ((RaycastHit)(ref m_hit)).point, Quaternion.LookRotation(Vector3.up)); num++; } } } if (((FVRInteractiveObject)this).IsHeld) { FVRViveHand hand = ((FVRInteractiveObject)this).m_hand; ((FVRInteractiveObject)this).m_hand.ForceSetInteractable((FVRInteractiveObject)null); ((FVRInteractiveObject)this).EndInteraction(hand); } Object.Destroy((Object)(object)((Component)this).gameObject); } public override void BeginInteraction(FVRViveHand hand) { //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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_004e: 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_005a: 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_0066: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008a: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: 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) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0126: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) if (DoesUseHandedPose) { if (!hand.IsThisTheRightHand && m_isInRightHandMode) { Vector3 up = ((FVRInteractiveObject)this).PoseOverride.up; Vector3 forward = ((FVRInteractiveObject)this).PoseOverride.forward; up = Vector3.Reflect(up, ((Component)this).transform.right); forward = Vector3.Reflect(forward, ((Component)this).transform.right); ((FVRInteractiveObject)this).PoseOverride.rotation = Quaternion.LookRotation(forward, up); up = ((FVRInteractiveObject)this).PoseOverride_Touch.up; forward = ((FVRInteractiveObject)this).PoseOverride_Touch.forward; up = Vector3.Reflect(up, ((Component)this).transform.right); forward = Vector3.Reflect(forward, ((Component)this).transform.right); ((FVRInteractiveObject)this).PoseOverride_Touch.rotation = Quaternion.LookRotation(forward, up); m_isInRightHandMode = false; } else if (hand.IsThisTheRightHand && !m_isInRightHandMode) { Vector3 up2 = ((FVRInteractiveObject)this).PoseOverride.up; Vector3 forward2 = ((FVRInteractiveObject)this).PoseOverride.forward; up2 = Vector3.Reflect(up2, ((Component)this).transform.right); forward2 = Vector3.Reflect(forward2, ((Component)this).transform.right); ((FVRInteractiveObject)this).PoseOverride.rotation = Quaternion.LookRotation(forward2, up2); up2 = ((FVRInteractiveObject)this).PoseOverride_Touch.up; forward2 = ((FVRInteractiveObject)this).PoseOverride_Touch.forward; up2 = Vector3.Reflect(up2, ((Component)this).transform.right); forward2 = Vector3.Reflect(forward2, ((Component)this).transform.right); ((FVRInteractiveObject)this).PoseOverride_Touch.rotation = Quaternion.LookRotation(forward2, up2); m_isInRightHandMode = true; } } ((FVRPhysicalObject)this).BeginInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { //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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); IFF = GM.CurrentPlayerBody.GetPlayerIFF(); Vector2 touchpadAxes = hand.Input.TouchpadAxes; if (((hand.IsInStreamlinedMode && hand.Input.AXButtonPressed) || (hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.down) <= 45f)) && !IsExternallyFused) { ActivateFuse(); } } } public class PinlessGrenadeArmingTrigger : FVRInteractiveObject { public PinlessGrenade Grenade; public bool IsFuseChangeTrigger = false; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); if (!Grenade.m_isArmed) { if (!IsFuseChangeTrigger) { Grenade.ActivateFuse(); } else { Grenade.UpdateFuseTime(); } } } } public class PixelGunMedkit : FVRPhysicalObject { [Header("Medkit Params")] public Text CooldownText; public float CooldownDuration = 30f; private float currentCooldown = 0f; private bool IsReady = true; public GameObject HealCloudPrefab; public AudioEvent HealSound; public bool IsCoolingDown = false; private void Update() { //IL_00cc: 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_00ea: 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) if (IsReady && !IsCoolingDown && (Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null && ((((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.BYButtonDown) || (((FVRInteractiveObject)this).m_hand.Input.TouchpadDown && ((Vector2)(ref ((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes, Vector2.up) <= 45f))) { IsReady = false; IsCoolingDown = true; currentCooldown = CooldownDuration; Object.Instantiate(HealCloudPrefab, ((Component)this).transform.position, Quaternion.identity); SM.PlayCoreSound((FVRPooledAudioType)10, HealSound, ((Component)this).transform.position); } if (IsCoolingDown) { if (currentCooldown < 0f) { IsCoolingDown = false; IsReady = true; CooldownText.text = null; } else { currentCooldown -= Time.deltaTime; CooldownText.text = currentCooldown.ToString("F1"); } } } } public class PlayAudioEventOnAwakeConfigurableDelay : MonoBehaviour { public AudioEvent AudioEvent; public bool TravelsAtSpeedOfSound; public bool HasDelay; public float LengthOfDelay; public FVRPooledAudioType Type = (FVRPooledAudioType)11; public bool IsRepeating = false; public float RepeatDelay = 5f; private float m_countdowntoDelay = 0f; private void Start() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) if (HasDelay) { SM.PlayCoreSoundDelayed(Type, AudioEvent, ((Component)this).transform.position, LengthOfDelay); } else if (TravelsAtSpeedOfSound) { float num = Vector3.Distance(GM.CurrentPlayerRoot.position, ((Component)this).transform.position); float num2 = num / 343f; SM.PlayCoreSoundDelayed(Type, AudioEvent, ((Component)this).transform.position, num2); } else { SM.PlayCoreSound(Type, AudioEvent, ((Component)this).transform.position); } } private void Update() { //IL_00a8: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (!IsRepeating) { return; } if (m_countdowntoDelay < RepeatDelay) { m_countdowntoDelay += Time.deltaTime; } if (m_countdowntoDelay >= RepeatDelay) { m_countdowntoDelay = 0f; if (TravelsAtSpeedOfSound) { float num = Vector3.Distance(GM.CurrentPlayerRoot.position, ((Component)this).transform.position); float num2 = num / 343f; SM.PlayCoreSoundDelayed(Type, AudioEvent, ((Component)this).transform.position, num2); } else { SM.PlayCoreSound(Type, AudioEvent, ((Component)this).transform.position); } } } } public class PlayerBodyOutfitToggle : FVRInteractiveObject { [Serializable] public class PlayerBodyOutfit { public GameObject Outfit; public DynamicBone[] DynamicBones; } public PlayerBodyOutfit[] Outfits; private int CurrentOutfit = 0; public override void SimpleInteraction(FVRViveHand hand) { Outfits[CurrentOutfit].Outfit.SetActive(false); DynamicBone[] dynamicBones = Outfits[CurrentOutfit].DynamicBones; foreach (DynamicBone dynamicBone in dynamicBones) { ((Component)dynamicBone).gameObject.SetActive(false); } CurrentOutfit++; if (CurrentOutfit > Outfits.Length - 1) { CurrentOutfit = 0; } Outfits[CurrentOutfit].Outfit.SetActive(true); DynamicBone[] dynamicBones2 = Outfits[CurrentOutfit].DynamicBones; foreach (DynamicBone dynamicBone2 in dynamicBones2) { ((Component)dynamicBone2).gameObject.SetActive(true); } } } public class PortableHellbomb : FVRPhysicalObject { [Header("Portable Hellbomb")] public float FuseTime; public Animator Animator; public string ArmingAnimationNodeName = "animation"; public GameObject[] ExplosionPrefabs; public Text[] TextPrintouts; public GameObject[] SetActiveIfArmed; public AudioEvent ArmedSound; public bool IsArmed = false; private bool m_HasStartedFuse = false; private void Update() { if (IsArmed && !m_HasStartedFuse) { ArmBomb(); } } private void ArmBomb() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) m_HasStartedFuse = true; SM.PlayCoreSound((FVRPooledAudioType)0, ArmedSound, ((Component)this).transform.position); Animator.Play(ArmingAnimationNodeName); GameObject[] setActiveIfArmed = SetActiveIfArmed; foreach (GameObject val in setActiveIfArmed) { val.SetActive(true); } ((MonoBehaviour)this).StartCoroutine(FuseCountdown()); } private IEnumerator FuseCountdown() { for (float timeRemaining = FuseTime; timeRemaining > 0f; timeRemaining -= 1f) { int displayDigit = Mathf.FloorToInt(timeRemaining) % 10; Text[] textPrintouts = TextPrintouts; foreach (Text val in textPrintouts) { if ((Object)(object)val != (Object)null) { val.text = displayDigit.ToString(); } } yield return (object)new WaitForSeconds(1f); } Text[] textPrintouts2 = TextPrintouts; foreach (Text val2 in textPrintouts2) { if ((Object)(object)val2 != (Object)null) { val2.text = "0"; } } Explode(); } private void Explode() { //IL_001c: 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) GameObject[] explosionPrefabs = ExplosionPrefabs; foreach (GameObject val in explosionPrefabs) { Object.Instantiate(val, ((Component)this).transform.position, ((Component)this).transform.rotation); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class PortableHellbombArmingTrigger : FVRInteractiveObject { public PortableHellbomb Hellbomb; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); Hellbomb.IsArmed = true; } } public class PrefabSpawnerRandomDirection : MonoBehaviour { public GameObject Prefab; public int NumToSpawn = 0; private int NumPrefabsSpawned = 0; private void Update() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (NumPrefabsSpawned > NumToSpawn) { Object.Destroy((Object)(object)((Component)this).gameObject); } NumPrefabsSpawned++; GameObject val = Object.Instantiate(Prefab, ((Component)this).transform.position, Random.rotation); } } public class ProjectileModeSwitchWithSounds : MonoBehaviour { public enum ProjMode { FirstMode, SecondMode } public FVRFireArmRound ParentRound; [Header("Mode Control")] public List ModeName; public List ModeClass; public List AltObjWrapper; public ProjMode CurrentMode = ProjMode.FirstMode; public FVRPooledAudioType Type = (FVRPooledAudioType)11; public AudioEvent AudioEvent; [Header("UI Display")] public GameObject Canvas; public Text DisplayText; public void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) FVRViveHand hand = ((FVRInteractiveObject)ParentRound).m_hand; if ((Object)(object)hand != (Object)null) { if (hand.Input.TouchpadDown && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.right) < 45f) { SwapMode(); } if (hand.IsInStreamlinedMode && hand.Input.BYButtonDown) { SwapMode(); } Canvas.gameObject.SetActive(true); } else { Canvas.gameObject.SetActive(false); } } public void SwapMode() { //IL_0002: 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) SM.PlayCoreSound(Type, AudioEvent, ((Component)this).transform.position); if (CurrentMode == ProjMode.FirstMode) { CurrentMode = ProjMode.SecondMode; } else { CurrentMode = ProjMode.FirstMode; } UpdateMenu(); } public void UpdateMenu() { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)DisplayText != (Object)null) { DisplayText.text = ModeName[(int)CurrentMode]; } ParentRound.RoundClass = ModeClass[(int)CurrentMode]; ((FVRPhysicalObject)ParentRound).ObjectWrapper = AltObjWrapper[(int)CurrentMode]; } } public class Railgun : FVRFireArm { public enum RailgunFiremode { Safe, Unsafe } [Header("Railgun Round Params")] public FVRFireArmChamber Chamber; public Transform RoundPos_Ejection; public Vector3 EjectionSpeed; public Vector3 EjectionSpin; public float CurrentVelMult = 1f; public float MaxUnsafeVelMult = 2.5f; [Header("Railgun Trigger Params")] public float TriggerBreakPoint; public Transform Trigger; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public Axis TriggerAxis; public InterpStyle TriggerInterpStyle = (InterpStyle)1; private float TriggerHeldStartTime = 0f; public float SafeHoldTime = 1f; public float MaxUnsafeHoldTime = 3f; public GameObject[] SelfDestructPrefabs; private float m_triggerFloat; public RailgunFiremode Firemode; private bool IsChargedToSafe = false; private float ManipulationFactor = 0f; private float ManipulationFactor2 = 0f; private bool HasStartedCharging = false; [Header("Railgun Visual Params")] public ParticleSystem ChargingParticles; public ParticleSystem ChargedParticles; public ParticleSystem FiringParticles; public int NumberOfParticles; public GameObject UnsafeIndicator; public Animator Animator; public string FiringAnimationNode = "RailgunFire"; public Transform MainChargeBars; public Vector2 YScaleMainSafe; public Vector2 YScaleMainUnsafe; public Transform OpticChargeBar; public Vector2 YScaleOptic; public Vector2 YScaleOpticUnsafe; [Header("Railgun Audio Params")] public AudioEvent ChargingClip; public AudioEvent FullyChargedClip; public AudioSource ChargeLoopAudio; private bool HasPlayedFullyChargedSound = false; public float MaxChargeLoopPitch = 1.5f; private void Start() { ChargeLoopAudio.Stop(); ChargingParticles.Stop(); ChargedParticles.Stop(); } public override void EndInteraction(FVRViveHand hand) { ((FVRFireArm)this).EndInteraction(hand); ManipulationFactor = 0f; ManipulationFactor2 = 0f; if (ChargingParticles.isPlaying) { ChargingParticles.Stop(); } if (ChargedParticles.isPlaying) { ChargedParticles.Stop(); } if (ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Stop(); } HasPlayedFullyChargedSound = false; } public override void UpdateInteraction(FVRViveHand hand) { //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); m_triggerFloat = hand.Input.TriggerFloat; if (IsChargedToSafe && !ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Play(); } if (!IsChargedToSafe && ChargeLoopAudio.isPlaying) { ChargeLoopAudio.Stop(); } if ((Object)(object)Trigger != (Object)null) { ((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), TriggerInterpStyle, TriggerAxis); } if (!HasStartedCharging && ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown))) { SwapFiremodes(); } if (!((FVRPhysicalObject)this).IsAltHeld && m_triggerFloat >= TriggerBreakPoint && Chamber.IsFull && !Chamber.IsSpent && !HasStartedCharging) { HasStartedCharging = true; TriggerHeldStartTime = Time.time; IsChargedToSafe = false; ManipulationFactor = 0f; SM.PlayCoreSound((FVRPooledAudioType)0, ChargingClip, ((Component)this).transform.position); } if (!((FVRPhysicalObject)this).IsAltHeld && Chamber.IsFull && !Chamber.IsSpent && m_triggerFloat >= TriggerBreakPoint) { float num = Time.time - TriggerHeldStartTime; if (num < SafeHoldTime) { ManipulationFactor = Mathf.Clamp01(num / SafeHoldTime); } if (num >= SafeHoldTime && Firemode == RailgunFiremode.Safe) { ManipulationFactor = 1f; IsChargedToSafe = true; if (!HasPlayedFullyChargedSound) { SM.PlayCoreSound((FVRPooledAudioType)0, FullyChargedClip, ((Component)this).transform.position); HasPlayedFullyChargedSound = true; } } if (Firemode == RailgunFiremode.Unsafe) { if (num >= SafeHoldTime && num < MaxUnsafeHoldTime) { if (!HasPlayedFullyChargedSound) { SM.PlayCoreSound((FVRPooledAudioType)0, FullyChargedClip, ((Component)this).transform.position); HasPlayedFullyChargedSound = true; } ManipulationFactor = 1f; IsChargedToSafe = true; ManipulationFactor2 = Mathf.Clamp01((num - SafeHoldTime) / (MaxUnsafeHoldTime - SafeHoldTime)); Chamber.ChamberVelocityMultiplier = 1f + ManipulationFactor2 * MaxUnsafeVelMult; ChargeLoopAudio.pitch = 1f + ManipulationFactor2 * MaxChargeLoopPitch; } if (num >= MaxUnsafeHoldTime) { SelfDestruct(hand); } } if (!ChargingParticles.isPlaying) { ChargingParticles.Play(); } } if (m_triggerFloat < TriggerBreakPoint && IsChargedToSafe && !((FVRPhysicalObject)this).IsAltHeld) { if (Firemode == RailgunFiremode.Safe) { Chamber.ChamberVelocityMultiplier = 1f; } Fire(); EjectRound(); IsChargedToSafe = false; ManipulationFactor = 0f; ManipulationFactor2 = 0f; Animator.Play(FiringAnimationNode); FiringParticles.Emit(NumberOfParticles); ChargingParticles.Stop(); HasPlayedFullyChargedSound = false; } if (m_triggerFloat < TriggerBreakPoint && !IsChargedToSafe) { ManipulationFactor = 0f; if (ChargingParticles.isPlaying) { ChargingParticles.Stop(); } HasPlayedFullyChargedSound = false; HasStartedCharging = false; TriggerHeldStartTime = Time.time; } UpdateAnimatedParts(); } public void UpdateAnimatedParts() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) float num = YScaleMainSafe.x - YScaleMainSafe.y; float num2 = YScaleMainUnsafe.x - YScaleMainUnsafe.y; Vector3 localScale = ((Component)MainChargeBars).transform.localScale; localScale.y = 1f - (ManipulationFactor * num + ManipulationFactor2 * num2); ((Component)MainChargeBars).transform.localScale = localScale; float num3 = YScaleOptic.x - YScaleOptic.y; float num4 = YScaleOpticUnsafe.x - YScaleOpticUnsafe.y; Vector3 localScale2 = ((Component)OpticChargeBar).transform.localScale; localScale2.y = 1f - (num3 * ManipulationFactor + ManipulationFactor2 * num4); ((Component)OpticChargeBar).transform.localScale = localScale2; if (IsChargedToSafe && !ChargedParticles.isPlaying) { ChargedParticles.Play(); } if (!IsChargedToSafe && ChargedParticles.isPlaying) { ChargedParticles.Stop(); } if (Firemode == RailgunFiremode.Unsafe && !UnsafeIndicator.activeInHierarchy) { UnsafeIndicator.SetActive(true); } if (Firemode != RailgunFiremode.Unsafe && UnsafeIndicator.activeInHierarchy) { UnsafeIndicator.SetActive(false); } } public void Fire() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { Chamber.Fire(); HasPlayedFullyChargedSound = false; ((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), true, CurrentVelMult, -1f); ((FVRFireArm)this).FireMuzzleSmoke(); bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null; bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); ((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { Chamber.IsSpent = false; Chamber.UpdateProxyDisplay(); } HasStartedCharging = false; ChargeLoopAudio.pitch = 1f; } } public void SelfDestruct(FVRViveHand hand) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).EndInteraction(hand); GameObject[] selfDestructPrefabs = SelfDestructPrefabs; foreach (GameObject val in selfDestructPrefabs) { Object.Instantiate(val, ((Component)this).transform.position, ((Component)this).transform.rotation); } ((FVRInteractiveObject)this).ForceBreakInteraction(); Object.Destroy((Object)(object)((Component)this).gameObject); } public void SwapFiremodes() { TriggerHeldStartTime = Time.time; IsChargedToSafe = false; ManipulationFactor = 0f; ManipulationFactor2 = 0f; HasStartedCharging = false; HasPlayedFullyChargedSound = false; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f); if (Firemode == RailgunFiremode.Safe) { Firemode = RailgunFiremode.Unsafe; } else if (Firemode == RailgunFiremode.Unsafe) { Firemode = RailgunFiremode.Safe; } } public void EjectRound() { //IL_002e: 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_0049: 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_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && Chamber.IsSpent) { 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); } } public override List GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List list = new List(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List rounds) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (rounds.Count > 0) { Chamber.Autochamber(rounds[0]); } } } public class RevolverFixedCylinder : FVRFireArm { [Serializable] public class TriggerPiece { public Transform TPiece; public Axis TAxis; public Vector2 TRange; public InterpStyle TInterp; } public enum RecockingState { Forward, GoingBack, GoingForward } [Header("Revolver Config")] public bool AllowsSuppressor; public bool isChiappa; public bool isChiappaHammer; public bool isOTS; public Transform Hammer; public bool CanManuallyCockHammer = true; public bool IsDoubleActionTrigger = true; public bool DoesTriggerBlockHammer = true; private float m_hammerForwardRot; public float m_hammerBackwardRot = -49f; private float m_hammerCurrentRot; public bool CanFan; public Transform HammerFanDir; [Header("Trigger")] public Transform Trigger; private float m_triggerForwardRot; public float m_triggerBackwardRot = 30f; private float m_triggerCurrentRot; private bool m_isHammerLocked; private bool m_hasTriggerCycled; public Transform CylinderReleaseButton; public bool isCyclinderReleaseARot; public Vector3 CylinderReleaseButtonForwardPos; public Vector3 CylinderReleaseButtonRearPos; private bool m_isCylinderReleasePressed; private float m_curCyclinderReleaseRot; [Header("Cylinder Config")] private bool m_isCylinderArmLocked = true; private bool m_wasCylinderArmLocked = true; public bool IsCylinderRotClockwise = true; public bool RequiresManualEject; public bool AngInvert; public RevolverFixedCylinderCylinder Cylinder; public int ChamberOffset; private int m_curChamber; private float m_tarChamberLerp; private float m_curChamberLerp; [Header("Cylinder Holding Latch")] public bool UsesHoldingLatch; public Transform HoldingLatch; public Axis HoldingLatchAxis; public InterpStyle HoldingLatchInterp; public Vector2 HoldingLatchRange = new Vector2(0f, 30f); private float m_holdingLatchLerp; [Header("Chambers Config")] public FVRFireArmChamber[] Chambers; public bool UsesSpeedLoadedEjection; [Header("Spinning Config")] public Transform PoseSpinHolder; public bool CanSpin = true; private bool m_isSpinning; public Transform Muzzle; public bool UsesAltPoseSwitch = true; public Transform Pose_Main; public Transform Pose_Reloading; private bool m_isInMainpose = true; private Vector2 TouchPadAxes = Vector2.zero; private bool m_hasEjectedSinceOpening; public List TPieces; [Header("Tround Config")] public bool UsesTroundSystem; public GameObject TroundMagTrigger; public Transform TroundEjectPoint; public Vector2 TroundClipArmClamp; private float xSpinRot; private float xSpinVel; private float lastTriggerRot; private float m_curTriggerFloat; private float m_tarTriggerFloat; private float m_curRealTriggerFloat; private float m_tarRealTriggerFloat; [Header("Recocking System")] public bool DoesFiringRecock; public Transform RecockingPiece; public Transform RecockingPoint_Forward; public Transform RecockingPoint_Rearward; public Vector2 RecockingSpeeds = new Vector2(8f, 3f); private float m_recockingLerp; private RecockingState m_recockingState; private bool m_shouldRecock; public float ShotLoudnessMult = 1f; private float m_CylCloseVel; [Header("Fixed Cylinder Logic")] public RevolverPullableEjector EjectorLever; public bool isCylinderArmLocked => m_isCylinderArmLocked; public int CurChamber { get { return m_curChamber; } set { if (value < 0) { m_curChamber = Cylinder.numChambers - 1; } else { m_curChamber = value % Cylinder.numChambers; } } } public override void Awake() { ((FVRFireArm)this).Awake(); FVRFireArmChamber[] chambers = Chambers; foreach (FVRFireArmChamber item in chambers) { base.FChambers.Add(item); } } public override int GetTutorialState() { int num = 0; int num2 = 0; for (int i = 0; i < Chambers.Length; i++) { if (Chambers[i].IsFull) { num++; if (!Chambers[i].IsSpent) { num2++; } } } if (num <= 0) { if (m_isCylinderArmLocked) { return 0; } return 1; } if (num2 > 0) { if (m_isCylinderArmLocked) { return 3; } return 2; } if (m_isCylinderArmLocked) { return 0; } return 4; } public override void FVRUpdate() { ((FVRFireArm)this).FVRUpdate(); UpdateRecocking(); } public override void BeginInteraction(FVRViveHand hand) { //IL_00d4: 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_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0042: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((FVRFireArm)this).BeginInteraction(hand); if (!((FVRPhysicalObject)this).IsAltHeld) { if (m_isInMainpose) { ((FVRInteractiveObject)this).PoseOverride.localPosition = Pose_Main.localPosition; ((FVRInteractiveObject)this).m_grabPointTransform.localPosition = Pose_Main.localPosition; if (GM.Options.ControlOptions.UseGunRigMode2) { ((FVRInteractiveObject)this).PoseOverride.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); } else { ((FVRInteractiveObject)this).PoseOverride.localRotation = Pose_Main.localRotation; ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Pose_Main.localRotation; } } else { ((FVRInteractiveObject)this).PoseOverride.localPosition = Pose_Reloading.localPosition; ((FVRInteractiveObject)this).PoseOverride.localRotation = Pose_Reloading.localRotation; ((FVRInteractiveObject)this).m_grabPointTransform.localPosition = Pose_Reloading.localPosition; ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Pose_Reloading.localRotation; } } ((FVRPhysicalObject)this).RootRigidbody.maxAngularVelocity = 40f; } public override void EndInteraction(FVRViveHand hand) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).EndInteraction(hand); ((FVRPhysicalObject)this).RootRigidbody.AddRelativeTorque(new Vector3((0f - xSpinVel) * 0.1f, 0f, 0f), (ForceMode)2); } public override void UpdateInteraction(FVRViveHand hand) { //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_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (((FVRPhysicalObject)this).IsAltHeld && !m_isInMainpose) { m_isInMainpose = true; ((FVRInteractiveObject)this).PoseOverride.localPosition = Pose_Main.localPosition; ((FVRInteractiveObject)this).m_grabPointTransform.localPosition = Pose_Main.localPosition; if (GM.Options.ControlOptions.UseGunRigMode2) { ((FVRInteractiveObject)this).PoseOverride.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); } else { ((FVRInteractiveObject)this).PoseOverride.localRotation = Pose_Main.localRotation; ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Pose_Main.localRotation; } } TouchPadAxes = hand.Input.TouchpadAxes; m_isSpinning = false; if (!((FVRPhysicalObject)this).IsAltHeld && !hand.IsInStreamlinedMode) { if (hand.Input.TouchpadPressed && Vector2.Angle(TouchPadAxes, Vector2.up) < 45f) { m_isSpinning = true; } if (hand.Input.TouchpadDown && Vector2.Angle(TouchPadAxes, Vector2.right) < 45f && UsesAltPoseSwitch) { m_isInMainpose = !m_isInMainpose; if (m_isInMainpose) { ((FVRInteractiveObject)this).PoseOverride.localPosition = Pose_Main.localPosition; ((FVRInteractiveObject)this).m_grabPointTransform.localPosition = Pose_Main.localPosition; if (GM.Options.ControlOptions.UseGunRigMode2) { ((FVRInteractiveObject)this).PoseOverride.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Quaternion.Inverse(hand.m_storedInitialPointingTransformDir); } else { ((FVRInteractiveObject)this).PoseOverride.localRotation = Pose_Main.localRotation; ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Pose_Main.localRotation; } } else { ((FVRInteractiveObject)this).PoseOverride.localPosition = Pose_Reloading.localPosition; ((FVRInteractiveObject)this).PoseOverride.localRotation = Pose_Reloading.localRotation; ((FVRInteractiveObject)this).m_grabPointTransform.localPosition = Pose_Reloading.localPosition; ((FVRInteractiveObject)this).m_grabPointTransform.localRotation = Pose_Reloading.localRotation; } } } UpdateTriggerHammer(); if (!((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)this).IsAltHeld || (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null) { m_isSpinning = false; } if (EjectorLever.CurPos == RevolverPullableEjector.EjectorPos.Forward) { FVRFireArmChamber[] chambers = Chambers; foreach (FVRFireArmChamber val in chambers) { val.IsAccessible = false; m_isCylinderArmLocked = true; } } else { FVRFireArmChamber[] chambers2 = Chambers; foreach (FVRFireArmChamber val2 in chambers2) { val2.IsAccessible = true; m_isCylinderArmLocked = false; } } } public override void FVRFixedUpdate() { UpdateSpinning(); ((FVRFireArm)this).FVRFixedUpdate(); } public void EjectChambers() { //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.Magazine != (Object)null) { return; } bool flag = false; if (UsesSpeedLoadedEjection && Cylinder.HasSpeedLoadedIn) { for (int i = 0; i < Chambers.Length; i++) { if (Chambers[i].IsFull) { flag = true; } } if (flag) { string key = Cylinder.Eject(); GameObject val = Object.Instantiate(((AnvilAsset)IM.OD[key]).GetGameObject(), ((Component)Cylinder).transform.position - ((Component)Cylinder).transform.forward * Cylinder.CartridgeLength * 1.6f, ((Component)Cylinder).transform.rotation); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)21, 1f); val.GetComponent().velocity = -((Component)Cylinder).transform.forward * 0.5f; Speedloader component = val.GetComponent(); for (int j = 0; j < Chambers.Length; j++) { component.Chambers[j].IsLoaded = Chambers[j].IsFull; component.Chambers[j].IsSpent = Chambers[j].IsSpent; component.Chambers[j].UpdateViz(); Chambers[j].SetRound((FVRFireArmRound)null, false); } } return; } for (int k = 0; k < Chambers.Length; k++) { if (Chambers[k].IsFull) { flag = true; if (AngInvert) { Chambers[k].EjectRound(((Component)Chambers[k]).transform.position + ((Component)Chambers[k]).transform.forward * Cylinder.CartridgeLength, ((Component)Chambers[k]).transform.forward, Random.onUnitSphere, true); } else { Chambers[k].EjectRound(((Component)Chambers[k]).transform.position + -((Component)Chambers[k]).transform.forward * Cylinder.CartridgeLength, -((Component)Chambers[k]).transform.forward, Random.onUnitSphere, true); } } } if (flag) { Cylinder.Eject(); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)21, 1f); } } private void UpdateSpinning() { //IL_003d: 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_0069: 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_0060: 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_0200: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) if (!((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)this).IsAltHeld || (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null) { m_isSpinning = false; } if (m_isSpinning) { Vector3 val = Vector3.zero; if ((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null) { val = ((FVRInteractiveObject)this).m_hand.Input.VelLinearWorld; } float num = Vector3.Dot(((Vector3)(ref val)).normalized, ((Component)this).transform.up); num = Mathf.Clamp(num, 0f - ((Vector3)(ref val)).magnitude, ((Vector3)(ref val)).magnitude); if (Mathf.Abs(xSpinVel) < 90f) { xSpinVel += num * Time.deltaTime * 600f; } else if (Mathf.Sign(num) == Mathf.Sign(xSpinVel)) { xSpinVel += num * Time.deltaTime * 600f; } if (Mathf.Abs(xSpinVel) < 90f) { if (Vector3.Dot(((Component)this).transform.up, Vector3.down) >= 0f && Mathf.Sign(xSpinVel) == 1f) { xSpinVel += Time.deltaTime * 50f; } if (Vector3.Dot(((Component)this).transform.up, Vector3.down) < 0f && Mathf.Sign(xSpinVel) == -1f) { xSpinVel -= Time.deltaTime * 50f; } } xSpinVel = Mathf.Clamp(xSpinVel, -500f, 500f); xSpinRot += xSpinVel * Time.deltaTime * 5f; PoseSpinHolder.localEulerAngles = new Vector3(xSpinRot, 0f, 0f); xSpinVel = Mathf.Lerp(xSpinVel, 0f, Time.deltaTime * 0.6f); } else { xSpinRot = 0f; xSpinVel = 0f; } } private void InitiateRecock() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) if ((int)m_recockingState == 0) { m_recockingLerp = 0f; m_recockingState = (RecockingState)1; } } private void UpdateRecocking() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Invalid comparison between Unknown and I4 //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0076: 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_008c: 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) RecockingState recockingState = m_recockingState; if ((int)recockingState != 1) { if ((int)recockingState == 2) { m_recockingLerp -= Time.deltaTime * RecockingSpeeds.y; if (m_recockingLerp <= 0f) { m_recockingState = (RecockingState)0; } m_recockingLerp = Mathf.Clamp(m_recockingLerp, 0f, 1f); RecockingPiece.position = Vector3.Lerp(RecockingPoint_Forward.position, RecockingPoint_Rearward.position, m_recockingLerp); } } else { m_recockingLerp += Time.deltaTime * RecockingSpeeds.x; if (m_recockingLerp >= 1f) { m_recockingState = (RecockingState)2; m_isHammerLocked = true; } m_recockingLerp = Mathf.Clamp(m_recockingLerp, 0f, 1f); RecockingPiece.position = Vector3.Lerp(RecockingPoint_Forward.position, RecockingPoint_Rearward.position, m_recockingLerp); } } private void UpdateTriggerHammer() { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //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_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_06f8: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_04da: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0578: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0979: Unknown result type (might be due to invalid IL or missing references) //IL_098d: Unknown result type (might be due to invalid IL or missing references) //IL_0a93: Unknown result type (might be due to invalid IL or missing references) //IL_0aa0: Unknown result type (might be due to invalid IL or missing references) //IL_0aab: Unknown result type (might be due to invalid IL or missing references) //IL_0a18: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && !m_isSpinning && !((FVRPhysicalObject)this).IsAltHeld && isCylinderArmLocked) { m_tarTriggerFloat = ((FVRInteractiveObject)this).m_hand.Input.TriggerFloat; m_tarRealTriggerFloat = ((FVRInteractiveObject)this).m_hand.Input.TriggerFloat; } else { m_tarTriggerFloat = 0f; m_tarRealTriggerFloat = 0f; } if (m_isHammerLocked) { m_tarTriggerFloat += 0.8f; m_triggerCurrentRot = Mathf.Lerp(m_triggerForwardRot, m_triggerBackwardRot, m_curTriggerFloat); } else { m_triggerCurrentRot = Mathf.Lerp(m_triggerForwardRot, m_triggerBackwardRot, m_curTriggerFloat); } m_curTriggerFloat = Mathf.MoveTowards(m_curTriggerFloat, m_tarTriggerFloat, Time.deltaTime * 14f); m_curRealTriggerFloat = Mathf.MoveTowards(m_curRealTriggerFloat, m_tarRealTriggerFloat, Time.deltaTime * 14f); if (Mathf.Abs(m_triggerCurrentRot - lastTriggerRot) > 0.01f) { if ((Object)(object)Trigger != (Object)null) { Trigger.localEulerAngles = new Vector3(m_triggerCurrentRot, 0f, 0f); } for (int i = 0; i < TPieces.Count; i++) { ((FVRPhysicalObject)this).SetAnimatedComponent(TPieces[i].TPiece, Mathf.Lerp(TPieces[i].TRange.x, TPieces[i].TRange.y, m_curTriggerFloat), TPieces[i].TInterp, TPieces[i].TAxis); } } lastTriggerRot = m_triggerCurrentRot; if (m_shouldRecock) { m_shouldRecock = false; InitiateRecock(); } if (CanFan && ((FVRInteractiveObject)this).IsHeld && !m_isHammerLocked && (int)m_recockingState == 0 && (Object)(object)((FVRInteractiveObject)this).m_hand.OtherHand != (Object)null) { Vector3 velLinearWorld = ((FVRInteractiveObject)this).m_hand.OtherHand.Input.VelLinearWorld; float num = Vector3.Distance(((FVRInteractiveObject)this).m_hand.OtherHand.PalmTransform.position, HammerFanDir.position); if (num < 0.15f && Vector3.Angle(velLinearWorld, HammerFanDir.forward) < 60f && ((Vector3)(ref velLinearWorld)).magnitude > 1f) { InitiateRecock(); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } } if (!m_hasTriggerCycled || (!IsDoubleActionTrigger && !DoesFiringRecock)) { bool flag = false; if ((int)m_recockingState != 0) { flag = true; } if (!flag && m_curTriggerFloat >= 0.95f && (m_isHammerLocked || IsDoubleActionTrigger) && !((FVRInteractiveObject)this).m_hand.Input.TouchpadPressed) { if (m_isCylinderArmLocked) { m_hasTriggerCycled = true; m_isHammerLocked = false; if (IsCylinderRotClockwise) { CurChamber++; } else { int curChamber = CurChamber - 1; CurChamber = curChamber; } m_curChamberLerp = 0f; m_tarChamberLerp = 0f; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); int num2 = CurChamber + ChamberOffset; if (num2 >= Cylinder.numChambers) { num2 -= Cylinder.numChambers; } if (Chambers[num2].IsFull && !Chambers[num2].IsSpent) { Chambers[num2].Fire(); Fire(); if (GM.CurrentSceneSettings.IsAmmoInfinite || GM.CurrentPlayerBody.IsInfiniteAmmo) { Chambers[num2].IsSpent = false; Chambers[num2].UpdateProxyDisplay(); } if (DoesFiringRecock) { m_shouldRecock = true; } } } } else if ((m_curTriggerFloat <= 0.14f || !IsDoubleActionTrigger) && !m_isHammerLocked && CanManuallyCockHammer) { bool flag2 = false; if (DoesFiringRecock && (int)m_recockingState != 0) { flag2 = true; } if (DoesTriggerBlockHammer && m_curTriggerFloat > 0.14f) { flag2 = true; } if (!((FVRPhysicalObject)this).IsAltHeld && !flag2) { if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)this).m_hand.Input.AXButtonDown) { m_isHammerLocked = true; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } } else if (((FVRInteractiveObject)this).m_hand.Input.TouchpadDown && Vector2.Angle(TouchPadAxes, Vector2.down) < 45f) { m_isHammerLocked = true; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } } } } else if (m_hasTriggerCycled && m_curRealTriggerFloat <= 0.08f) { m_hasTriggerCycled = false; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)16, 1f); } if (!isChiappaHammer) { if (m_hasTriggerCycled || !IsDoubleActionTrigger) { if (m_isHammerLocked) { m_hammerCurrentRot = Mathf.Lerp(m_hammerCurrentRot, m_hammerBackwardRot, Time.deltaTime * 10f); } else { m_hammerCurrentRot = Mathf.Lerp(m_hammerCurrentRot, m_hammerForwardRot, Time.deltaTime * 30f); } } else if (m_isHammerLocked) { m_hammerCurrentRot = Mathf.Lerp(m_hammerCurrentRot, m_hammerBackwardRot, Time.deltaTime * 10f); } else { m_hammerCurrentRot = Mathf.Lerp(m_hammerForwardRot, m_hammerBackwardRot, m_curTriggerFloat); } } if (isChiappaHammer) { bool flag3 = false; if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode && ((FVRInteractiveObject)this).m_hand.Input.AXButtonPressed) { flag3 = true; } else if (Vector2.Angle(((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes, Vector2.down) < 45f && ((FVRInteractiveObject)this).m_hand.Input.TouchpadPressed) { flag3 = true; } if (m_curTriggerFloat <= 0.02f && !((FVRPhysicalObject)this).IsAltHeld && flag3) { m_hammerCurrentRot = Mathf.Lerp(m_hammerCurrentRot, m_hammerBackwardRot, Time.deltaTime * 15f); } else { m_hammerCurrentRot = Mathf.Lerp(m_hammerCurrentRot, m_hammerForwardRot, Time.deltaTime * 6f); } } if ((Object)(object)Hammer != (Object)null) { Hammer.localEulerAngles = new Vector3(m_hammerCurrentRot, 0f, 0f); } if (m_isCylinderArmLocked && !m_wasCylinderArmLocked) { if (!UsesTroundSystem) { m_curChamber = Cylinder.GetClosestChamberIndex(); if (m_isHammerLocked) { if (!IsCylinderRotClockwise) { m_curChamber++; m_curChamber %= Cylinder.numChambers; } else { m_curChamber--; if (m_curChamber < 0) { m_curChamber = Cylinder.numChambers - 1; } } } ((Component)Cylinder).transform.localRotation = Cylinder.GetLocalRotationFromCylinder(m_curChamber); m_curChamberLerp = 0f; m_tarChamberLerp = 0f; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)18, 1f); } if (m_isHammerLocked) { m_tarChamberLerp = 1f; } else if (!m_hasTriggerCycled && IsDoubleActionTrigger) { m_tarChamberLerp = m_curTriggerFloat * 1.4f; } m_curChamberLerp = Mathf.Lerp(m_curChamberLerp, m_tarChamberLerp, Time.deltaTime * 16f); if (UsesTroundSystem) { if (m_curChamberLerp > 0.3f && Chambers[CurChamber].IsFull) { Chambers[CurChamber].EjectRound(TroundEjectPoint.position, TroundEjectPoint.forward, new Vector3(0f, 120f, 0f), false); } if (m_curChamberLerp > 0.8f && UsesTroundSystem && isCylinderArmLocked) { int num3 = CurChamber + 2; num3 %= Cylinder.numChambers; if (!Chambers[num3].IsFull && base.Magazine.HasARound()) { FVRLoadedRound val = base.Magazine.RemoveRound(0); Chambers[num3].Autochamber(val.LR_Class); } } } int cylinder = ((!IsCylinderRotClockwise) ? ((CurChamber - 1) % Cylinder.numChambers) : ((CurChamber + 1) % Cylinder.numChambers)); if (isCylinderArmLocked || UsesTroundSystem) { ((Component)Cylinder).transform.localRotation = Quaternion.Slerp(Cylinder.GetLocalRotationFromCylinder(CurChamber), Cylinder.GetLocalRotationFromCylinder(cylinder), m_curChamberLerp); } m_wasCylinderArmLocked = m_isCylinderArmLocked; } private void Fire() { //IL_00a1: Unknown result type (might be due to invalid IL or missing references) int num = CurChamber + ChamberOffset; if (num >= Cylinder.numChambers) { num -= Cylinder.numChambers; } FVRFireArmChamber val = Chambers[num]; ((FVRFireArm)this).Fire(val, ((FVRFireArm)this).GetMuzzle(), true, 1f, -1f); ((FVRFireArm)this).FireMuzzleSmoke(); if (val.GetRound().IsHighPressure) { 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(val.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), ShotLoudnessMult); if (val.GetRound().IsCaseless) { val.SetRound((FVRFireArmRound)null, false); } } public override List GetChamberRoundList() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) bool flag = false; List list = new List(); for (int i = 0; i < Chambers.Length; i++) { if (Chambers[i].IsFull) { list.Add(Chambers[i].GetRound().RoundClass); flag = true; } } if (flag) { return list; } return null; } public override void SetLoadedChambers(List rounds) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) if (rounds.Count <= 0) { return; } for (int i = 0; i < Chambers.Length; i++) { if (i < rounds.Count) { Chambers[i].Autochamber(rounds[i]); } } } } public class RevolverFixedCylinderCylinder : FVRInteractiveObject { [Header("Revolver Cylinder Config")] public RevolverFixedCylinder Revolver; private float m_fakeAngularVel; public int numChambers = 6; public float CartridgeLength = 0.04f; public GameObject MoonClip; public string SpeedLoaderID; private bool m_hasSpeedLoadedIn; private float m_timeSinceEject; public bool HasSpeedLoadedIn => m_hasSpeedLoadedIn; public override void Awake() { ((FVRInteractiveObject)this).Awake(); } public override bool IsInteractable() { return !Revolver.isCylinderArmLocked; } public void LoadFromSpeedLoader(Speedloader loader) { //IL_00ee: 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_00ac: 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) SpeedLoaderID = ((FVRPhysicalObject)loader).ObjectWrapper.ItemID; m_hasSpeedLoadedIn = true; bool flag = false; for (int i = 0; i < loader.Chambers.Count; i++) { if (i < Revolver.Chambers.Length && loader.Chambers[i].IsLoaded && !Revolver.Chambers[i].IsFull) { if (!loader.Chambers[i].IsSpent) { Revolver.Chambers[i].SetRound(loader.Chambers[i].Unload(), ((Component)loader.Chambers[i]).transform.position, ((Component)loader.Chambers[i]).transform.rotation); flag = true; } else { Revolver.Chambers[i].Autochamber(loader.Chambers[i].Unload()); Revolver.Chambers[i].Fire(); flag = true; } } } if (flag) { ((FVRFireArm)Revolver).PlayAudioEvent((FirearmAudioEventType)20, 1f); if ((Object)(object)MoonClip != (Object)null) { MoonClip.SetActive(true); } } } public string Eject() { m_timeSinceEject = 0f; if ((Object)(object)MoonClip != (Object)null) { MoonClip.SetActive(false); } m_hasSpeedLoadedIn = false; return SpeedLoaderID; } public bool CanAccept() { return m_timeSinceEject > 0.2f; } public override void UpdateInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).UpdateInteraction(hand); } public override void EndInteraction(FVRViveHand hand) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) m_fakeAngularVel = (0f - ((Component)Revolver).transform.InverseTransformDirection(hand.Input.VelLinearWorld).y) * 120f; m_fakeAngularVel = Mathf.Clamp(m_fakeAngularVel, -360f, 360f); ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRUpdate() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (m_timeSinceEject < 1f) { m_timeSinceEject += Time.deltaTime; } if (!Revolver.isCylinderArmLocked) { ((Component)this).transform.localEulerAngles = new Vector3(0f, 0f, ((Component)this).transform.localEulerAngles.z + m_fakeAngularVel); if (Mathf.Abs(m_fakeAngularVel) > 0f) { m_fakeAngularVel = Mathf.Lerp(m_fakeAngularVel, 0f, Time.deltaTime * 0.8f); } } else { m_fakeAngularVel = 0f; } } public int GetClosestChamberIndex() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) float num = 0f - ((Component)this).transform.localEulerAngles.z; if (Revolver.isChiappa || Revolver.isOTS) { num += 180f; } num += 360f / (float)numChambers * 0.5f; num = Mathf.Repeat(num, 360f); return Mathf.CeilToInt(num / (360f / (float)numChambers)) - 1; } public Quaternion GetLocalRotationFromCylinder(int cylinder) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = (float)cylinder * (360f / (float)numChambers) * -1f; if (Revolver.isChiappa) { num += 180f; } num = Mathf.Repeat(num, 360f); return Quaternion.Euler(new Vector3(0f, 0f, num)); } } public class RevolverPullableEjector : FVRInteractiveObject { public enum EjectorPos { Forward, Middle, Rear } [Header("Pullable Ejector")] public Revolver Revolver; public RevolverFixedCylinder Galand; public SingleActionRevolver SARevolver; public bool EjectsOnlyFiredCasings = false; public Transform ForwardPoint; public Transform RearwardPoint; public float ForwardSpeed = 1f; private float m_boltZ_forward; private float m_boltZ_rear; private float m_currentHandleZ; public EjectorPos CurPos; public EjectorPos LastPos; public override bool IsInteractable() { if ((Object)(object)Revolver != (Object)null) { return !Revolver.isCylinderArmLocked; } if ((Object)(object)SARevolver != (Object)null) { return SARevolver.m_isStateToggled; } if ((Object)(object)Galand != (Object)null) { return true; } return true; } 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) ((FVRInteractiveObject)this).Awake(); m_boltZ_forward = ForwardPoint.localPosition.z; m_boltZ_rear = RearwardPoint.localPosition.z; m_currentHandleZ = ((Component)this).transform.localPosition.z; } public override void UpdateInteraction(FVRViveHand hand) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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) ((FVRInteractiveObject)this).UpdateInteraction(hand); Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(ForwardPoint.position, RearwardPoint.position, ((HandInput)(ref base.m_hand.Input)).Pos); ((Component)this).transform.position = closestValidPoint; m_currentHandleZ = ((Component)this).transform.localPosition.z; float num = Mathf.InverseLerp(m_boltZ_forward, m_boltZ_rear, m_currentHandleZ); } public override void EndInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).EndInteraction(hand); } public override void FVRUpdate() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033b: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c2: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041e: Unknown result type (might be due to invalid IL or missing references) //IL_0423: Unknown result type (might be due to invalid IL or missing references) //IL_0438: Unknown result type (might be due to invalid IL or missing references) //IL_043d: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0453: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_03e0: Unknown result type (might be due to invalid IL or missing references) //IL_03e5: Unknown result type (might be due to invalid IL or missing references) //IL_03f1: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).FVRUpdate(); if (!((FVRInteractiveObject)this).IsHeld && Mathf.Abs(m_currentHandleZ - m_boltZ_forward) > 0.001f) { m_currentHandleZ = Mathf.MoveTowards(m_currentHandleZ, m_boltZ_forward, Time.deltaTime * ForwardSpeed); ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_currentHandleZ); } if (Mathf.Abs(m_currentHandleZ - m_boltZ_forward) < 0.005f) { CurPos = EjectorPos.Forward; } else if (Mathf.Abs(m_currentHandleZ - m_boltZ_rear) < 0.005f) { CurPos = EjectorPos.Rear; } else { CurPos = EjectorPos.Middle; } if (CurPos == EjectorPos.Forward && LastPos != 0) { if ((Object)(object)Revolver != (Object)null) { ((FVRFireArm)Revolver).PlayAudioEvent((FirearmAudioEventType)11, 1f); } if ((Object)(object)Galand != (Object)null) { ((FVRFireArm)Galand).PlayAudioEvent((FirearmAudioEventType)11, 1f); } if ((Object)(object)SARevolver != (Object)null) { ((FVRFireArm)SARevolver).PlayAudioEvent((FirearmAudioEventType)11, 1f); } } else if (CurPos == EjectorPos.Rear && LastPos != EjectorPos.Rear) { bool flag = false; if ((Object)(object)Revolver != (Object)null) { ((FVRFireArm)Revolver).PlayAudioEvent((FirearmAudioEventType)10, 1f); } if ((Object)(object)Galand != (Object)null) { ((FVRFireArm)Galand).PlayAudioEvent((FirearmAudioEventType)10, 1f); } if ((Object)(object)SARevolver != (Object)null) { ((FVRFireArm)SARevolver).PlayAudioEvent((FirearmAudioEventType)10, 1f); SARevolver.EjectPrevCylinder(); } if (!EjectsOnlyFiredCasings) { if ((Object)(object)Revolver != (Object)null) { Revolver.EjectChambers(); } if ((Object)(object)Galand != (Object)null) { Galand.EjectChambers(); } flag = true; } if (EjectsOnlyFiredCasings) { if ((Object)(object)Revolver != (Object)null) { FVRFireArmChamber[] chambers = Revolver.Chambers; foreach (FVRFireArmChamber val in chambers) { if (val.IsSpent) { if (Revolver.AngInvert) { val.EjectRound(((Component)val).transform.position + ((Component)val).transform.forward * Revolver.Cylinder.CartridgeLength, ((Component)val).transform.forward, Random.onUnitSphere, true); } else { val.EjectRound(((Component)val).transform.position + -((Component)val).transform.forward * Revolver.Cylinder.CartridgeLength, -((Component)val).transform.forward, Random.onUnitSphere, true); } flag = true; } } } if ((Object)(object)Galand != (Object)null) { FVRFireArmChamber[] chambers2 = Galand.Chambers; foreach (FVRFireArmChamber val2 in chambers2) { if (val2.IsSpent) { if (Galand.AngInvert) { val2.EjectRound(((Component)val2).transform.position + ((Component)val2).transform.forward * Galand.Cylinder.CartridgeLength, ((Component)val2).transform.forward, Random.onUnitSphere, true); } else { val2.EjectRound(((Component)val2).transform.position + -((Component)val2).transform.forward * Galand.Cylinder.CartridgeLength, -((Component)val2).transform.forward, Random.onUnitSphere, true); } flag = true; } } } } if (flag) { if ((Object)(object)Revolver != (Object)null) { ((FVRFireArm)Revolver).PlayAudioEvent((FirearmAudioEventType)21, 1f); } if ((Object)(object)Galand != (Object)null) { ((FVRFireArm)Galand).PlayAudioEvent((FirearmAudioEventType)21, 1f); } } } LastPos = CurPos; } } public class RevolverSpinToReload : MonoBehaviour { public Revolver Gun; public FVRFireArmChamber[] Chambers; public float DegreesPerLoad; public FireArmRoundClass ChamberClass; private float currentSpin; public int ChambersLoaded = 0; private void Update() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)Gun).m_hand == (Object)null || ((FVRInteractiveObject)Gun).m_hand.IsInStreamlinedMode) { return; } if (!Gun.m_isSpinning) { ChambersLoaded = 0; return; } currentSpin = Mathf.Abs(Gun.xSpinRot) - DegreesPerLoad * (float)ChambersLoaded; if (currentSpin < DegreesPerLoad || ChambersLoaded == Chambers.Length || !(currentSpin >= DegreesPerLoad)) { return; } for (int i = 0; i < Chambers.Length; i++) { if (!Chambers[i].IsFull) { Chambers[i].Autochamber(ChamberClass); ChambersLoaded++; ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)42, 1f); break; } } } } public class RevolverTopBreakEjectOnlyFired : MonoBehaviour { public Revolver Gun; private void Update() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) float num = Gun.CylinderArm.localEulerAngles.x; if (num > 180f) { num -= 360f; } if (num < -180f) { num += 360f; } if (!Gun.IsCylinderArmZ || !(Mathf.Abs(num) > Mathf.Min(45f, Gun.CylinderRotRange.y * 0.8f)) || Gun.m_hasEjectedSinceOpening) { return; } Gun.m_hasEjectedSinceOpening = true; if (!((Object)(object)Gun != (Object)null)) { return; } bool flag = false; FVRFireArmChamber[] chambers = Gun.Chambers; foreach (FVRFireArmChamber val in chambers) { if (val.IsSpent && val.IsFull) { flag = true; if (Gun.AngInvert) { val.EjectRound(((Component)val).transform.position + ((Component)val).transform.forward * Gun.Cylinder.CartridgeLength, ((Component)val).transform.forward, Random.onUnitSphere, true); } else { val.EjectRound(((Component)val).transform.position + -((Component)val).transform.forward * Gun.Cylinder.CartridgeLength, -((Component)val).transform.forward, Random.onUnitSphere, true); } } } if (flag) { ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)21, 1f); } } } public class RevolvingShotgunDisplayIfCylinderLoaded : MonoBehaviour { public RevolvingShotgun Weapon; public GameObject Display; private void Update() { if (!((Object)(object)Display == (Object)null) && !((Object)(object)Weapon == (Object)null)) { if (Weapon.CylinderLoaded && !Display.activeInHierarchy) { Display.SetActive(true); } if (!Weapon.CylinderLoaded && Display.activeInHierarchy) { Display.SetActive(false); } } } } public class RevolvingShotgunHammer : MonoBehaviour { public RevolvingShotgun Weapon; public Transform Hammer; public Vector2 HammerRots; private float hammerLerp; private void Update() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)((FVRInteractiveObject)Weapon).m_hand != (Object)null) { float triggerFloat = ((FVRInteractiveObject)Weapon).m_hand.Input.TriggerFloat; if (!Weapon.m_hasTriggerCycled) { hammerLerp = Mathf.InverseLerp(Weapon.TriggerResetThreshold, Weapon.TriggerFiringThreshold, triggerFloat); } else { hammerLerp = 0f; } } else { hammerLerp = 0f; } float num = Mathf.Lerp(HammerRots.x, HammerRots.y, hammerLerp); Hammer.localRotation = Quaternion.Euler(num, 0f, 0f); } } public class SRMForegrip : FVRAlternateGrip { public FVRFireArm Gun; public float RotationMagnitude = 10f; private bool hasTriggered; public AudioEvent RotateSound; public override void UpdateInteraction(FVRViveHand hand) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) ((FVRAlternateGrip)this).UpdateInteraction(hand); if ((Object)(object)Gun == (Object)null) { return; } SRMMagazine sRMMagazine = Gun.Magazine as SRMMagazine; if (!((Object)(object)sRMMagazine == (Object)null)) { float z = ((Component)this).transform.InverseTransformDirection(hand.Input.VelAngularWorld).z; if (z < 0f - RotationMagnitude && !hasTriggered) { hasTriggered = true; sRMMagazine.AdvanceTube(); SM.PlayGenericSound(RotateSound, ((Component)this).transform.position); } else if (z > -1f) { hasTriggered = false; } } } } public class SRMMagazine : FVRFireArmMagazine { [Serializable] public class SRMTube { public int ShellsInTube = 4; public int RemainingShells = 4; public GameObject DisplayShell; } [Header("SRM Parts")] public Transform Pivot; public SRMTube[] Tubes; public float RotationRate = 360f; private int pendingTube = -1; private float currentAngle; private float targetAngle; private bool isRotating; private int previousNumRounds; public int CurrentTube { get; private set; } private void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArmMagazine)this).Awake(); if ((Object)(object)Pivot != (Object)null) { currentAngle = Pivot.localEulerAngles.y; } previousNumRounds = base.m_numRounds; } private void Update() { if (!((Object)(object)Pivot == (Object)null) && Tubes != null && Tubes.Length != 0) { HandleRotation(); HandleAmmoDelta(); UpdateExtractable(); UpdateVisuals(); UpdateBoltLock(); } } private void UpdateBoltLock() { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Invalid comparison between Unknown and I4 //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Invalid comparison between Unknown and I4 FVRFireArm fireArm = base.FireArm; ClosedBoltWeapon val = (ClosedBoltWeapon)(object)((fireArm is ClosedBoltWeapon) ? fireArm : null); if (!((Object)(object)val == (Object)null)) { if (Tubes[CurrentTube].RemainingShells == 0 && !val.m_proxy.IsFull && (int)val.Bolt.CurPos == 4 && !val.Bolt.IsBoltLocked()) { val.Bolt.LockBolt(); } if (Tubes[CurrentTube].RemainingShells > 0 && (int)val.Bolt.CurPos == 2 && val.Bolt.IsBoltLocked()) { val.Bolt.ReleaseBolt(); } } } private void HandleRotation() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (isRotating) { currentAngle = Mathf.MoveTowardsAngle(currentAngle, targetAngle, RotationRate * Time.deltaTime); Pivot.localRotation = Quaternion.Euler(0f, currentAngle, 0f); if (Mathf.Abs(Mathf.DeltaAngle(currentAngle, targetAngle)) < 0.1f) { isRotating = false; CurrentTube = pendingTube; pendingTube = -1; } } } public void AdvanceTube() { if (isRotating) { return; } int num = CurrentTube; for (int i = 0; i < Tubes.Length; i++) { num = (num + 1) % Tubes.Length; if (Tubes[num].RemainingShells > 0) { break; } } pendingTube = num; float num2 = 360f / (float)Tubes.Length; targetAngle = currentAngle + num2; isRotating = true; } private void HandleAmmoDelta() { int num = base.m_numRounds - previousNumRounds; if (num < 0) { int num2 = -num; for (int i = 0; i < num2; i++) { ConsumeShell(); } } else if (num > 0) { int num3 = num; for (int j = 0; j < num3; j++) { RefillOneShell(); } } previousNumRounds = base.m_numRounds; } private void ConsumeShell() { SRMTube sRMTube = Tubes[CurrentTube]; sRMTube.RemainingShells = Mathf.Max(0, sRMTube.RemainingShells - 1); } private void RefillOneShell() { for (int i = 0; i < Tubes.Length; i++) { if (Tubes[i].RemainingShells < Tubes[i].ShellsInTube) { Tubes[i].RemainingShells++; break; } } } private void UpdateExtractable() { base.IsExtractable = Tubes[CurrentTube].RemainingShells > 0; } private void UpdateVisuals() { SRMTube[] tubes = Tubes; foreach (SRMTube sRMTube in tubes) { if (!((Object)(object)sRMTube.DisplayShell == (Object)null)) { sRMTube.DisplayShell.SetActive(sRMTube.RemainingShells > 0); } } } } public class SimpleHinge : MonoBehaviour { public enum StreamlinedButton { AX, BY } [Header("Base Hinge Params")] public FVRFireArm Gun; public FVRMeleeWeapon Melee; public Transform Hinge; public Axis HingeAxis; public float RotationOpen = 35f; public bool IsNegative = false; public HingeState m_hingeState; public AudioEvent HingeOpenSound; public AudioEvent HingeCloseSound; private float m_hingeLerp; [Header("Input Params")] public bool HasInput = true; private FVRViveHand HandToRead; public StreamlinedButton ButtonStreamlined; [Tooltip("Valid strings are up, down, left, and right.")] public string ButtonClassic = "up"; public bool CanFlick = true; public bool OnlyFlicksOpen = false; [Header("Extra Params")] public bool EjectMagOnOpen = false; public bool HasMagEjectInputWhenOpened = false; public bool DoesFlaregunGravityMagEject = false; private bool HasEjected = false; private OpenBoltReceiver OBWeapon; [Tooltip("If you don't know what this means, ignore it!")] public bool UseHeatsinkLogicMode = false; [Tooltip("Only works for guns that actually use magazines, revolvers and revolving shotguns don't work.")] public bool PreventMagFromFeedingWhenOpen = false; public bool UseAEKStyleLogic = false; public bool IsLeverActionM1911 = false; private Handgun M1911; private float OrigSpeedHeld = 0f; private TubeFedShotgun Shotgun; [Header("Launcher/Commando Params")] public bool PreventLauncherFromFiringWhenOpen = true; private SimpleLauncher Launcher; private Commando Cmdo; public bool MakeChamberInaccessableWhenClosed = false; public bool DoesFlaregunGravityEject = false; [Header("Generic Extra Params")] public ParticleSystem PSysPlayWhenOpen; public GameObject[] ActiveIfClosed; public GameObject[] ActiveIfOpened; [Header("Slap Params")] public bool IsSlappable = false; public Transform SlapPoint; public float SlapDistance = 0.1f; private void Start() { ref OpenBoltReceiver oBWeapon = ref OBWeapon; FVRFireArm gun = Gun; oBWeapon = (OpenBoltReceiver)(object)((gun is OpenBoltReceiver) ? gun : null); ref SimpleLauncher launcher = ref Launcher; FVRFireArm gun2 = Gun; launcher = (SimpleLauncher)(object)((gun2 is SimpleLauncher) ? gun2 : null); ref TubeFedShotgun shotgun = ref Shotgun; FVRFireArm gun3 = Gun; shotgun = (TubeFedShotgun)(object)((gun3 is TubeFedShotgun) ? gun3 : null); ref Handgun m = ref M1911; FVRFireArm gun4 = Gun; m = (Handgun)(object)((gun4 is Handgun) ? gun4 : null); Cmdo = Gun as Commando; if ((Object)(object)Shotgun != (Object)null) { OrigSpeedHeld = Shotgun.Handle.Speed_Held; } } private void UpdateFlaregunGravMagEject() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if ((int)m_hingeState == 2 && Vector3.Angle(Vector3.up, ((Component)OBWeapon.Chamber).transform.forward) < 70f) { if (!HasEjected && (Object)(object)((FVRFireArm)OBWeapon).Magazine != (Object)null) { ((FVRFireArm)OBWeapon).EjectMag(false); } HasEjected = true; } if ((int)m_hingeState == 0 && HasEjected) { HasEjected = false; } } private void Update() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Invalid comparison between Unknown and I4 //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Invalid comparison between Unknown and I4 //IL_015b: 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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Invalid comparison between Unknown and I4 //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Invalid comparison between Unknown and I4 //IL_05ce: Unknown result type (might be due to invalid IL or missing references) //IL_05d4: Invalid comparison between Unknown and I4 //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0699: Unknown result type (might be due to invalid IL or missing references) //IL_069f: Invalid comparison between Unknown and I4 //IL_036c: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Invalid comparison between Unknown and I4 //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_075b: Invalid comparison between Unknown and I4 //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Invalid comparison between Unknown and I4 //IL_0744: Unknown result type (might be due to invalid IL or missing references) //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_07df: Unknown result type (might be due to invalid IL or missing references) //IL_07af: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_0625: Unknown result type (might be due to invalid IL or missing references) //IL_0637: Unknown result type (might be due to invalid IL or missing references) //IL_0648: Unknown result type (might be due to invalid IL or missing references) //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04aa: Unknown result type (might be due to invalid IL or missing references) //IL_04be: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_05a5: Invalid comparison between Unknown and I4 //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) UpdateGOToggle(); if (DoesFlaregunGravityEject) { UpdateGravityEject(); } if (DoesFlaregunGravityMagEject) { UpdateFlaregunGravMagEject(); } if (IsLeverActionM1911 && (Object)(object)M1911 != (Object)null) { HandgunSlide slide = M1911.Slide; if ((int)m_hingeState == 2) { slide.m_curSlideSpeed = -15f; } else if ((int)m_hingeState == 0) { slide.m_curSlideSpeed = slide.Speed_Forward; } } if ((Object)(object)PSysPlayWhenOpen != (Object)null) { if (!PSysPlayWhenOpen.isPlaying && (int)m_hingeState == 2) { PSysPlayWhenOpen.Play(); } if (PSysPlayWhenOpen.isPlaying && (int)m_hingeState != 2) { PSysPlayWhenOpen.Stop(); } } if ((Object)(object)Launcher != (Object)null && PreventLauncherFromFiringWhenOpen) { if ((int)m_hingeState != 0) { Launcher.HasTrigger = false; } else { Launcher.HasTrigger = true; } } if ((Object)(object)Cmdo != (Object)null && PreventLauncherFromFiringWhenOpen) { if ((int)m_hingeState != 0) { Cmdo.CanFire = false; } else { Cmdo.CanFire = true; } } if (MakeChamberInaccessableWhenClosed && (Object)(object)Launcher != (Object)null) { if ((int)m_hingeState == 0) { Launcher.Chamber.IsAccessible = false; } else { Launcher.Chamber.IsAccessible = true; } } if (PreventMagFromFeedingWhenOpen && (Object)(object)Gun.Magazine != (Object)null) { if ((int)m_hingeState == 2) { Gun.Magazine.IsExtractable = false; } else { Gun.Magazine.IsExtractable = true; } } if (UseAEKStyleLogic) { if ((int)m_hingeState == 2) { Shotgun.Handle.Speed_Held = 0f; } else { Shotgun.Handle.Speed_Held = OrigSpeedHeld; } } if ((Object)(object)Gun != (Object)null) { HandToRead = ((FVRInteractiveObject)Gun).m_hand; } if ((Object)(object)Melee != (Object)null) { HandToRead = ((FVRInteractiveObject)Melee).m_hand; } if ((Object)(object)HandToRead != (Object)null) { float num = 0f; Axis hingeAxis = HingeAxis; if ((int)hingeAxis != 0) { if ((int)hingeAxis != 1) { if ((int)hingeAxis == 2) { num = ((Component)this).transform.InverseTransformDirection(HandToRead.Input.VelAngularWorld).z; } } else { num = ((Component)this).transform.InverseTransformDirection(HandToRead.Input.VelAngularWorld).y; } } else { num = ((Component)this).transform.InverseTransformDirection(HandToRead.Input.VelAngularWorld).x; } if (num > 15f && CanFlick) { if (!IsNegative) { Unlatch(); } else if (!OnlyFlicksOpen) { Latch(); } } else if (num < -15f && CanFlick) { if (!IsNegative) { if (!OnlyFlicksOpen) { Latch(); } } else { Unlatch(); } } bool flag = false; if (HandToRead.IsInStreamlinedMode && HasInput) { if ((HandToRead.Input.BYButtonDown && ButtonStreamlined == StreamlinedButton.BY) || (HandToRead.Input.AXButtonDown && ButtonStreamlined == StreamlinedButton.AX)) { flag = true; } } else if (HandToRead.Input.TouchpadDown && HasInput) { Vector2 touchpadAxes = HandToRead.Input.TouchpadAxes; if (((Vector2)(ref touchpadAxes)).magnitude > 0.2f && ((Vector2.Angle(touchpadAxes, Vector2.up) < 45f && ButtonClassic == "up") || (Vector2.Angle(touchpadAxes, Vector2.down) < 45f && ButtonClassic == "down") || (Vector2.Angle(touchpadAxes, Vector2.left) < 45f && ButtonClassic == "left") || (Vector2.Angle(touchpadAxes, Vector2.right) < 45f && ButtonClassic == "right"))) { ToggleLatchState(); } } if (flag) { ToggleLatchState(); } if ((Object)(object)OBWeapon != (Object)null && HasMagEjectInputWhenOpened) { if ((int)m_hingeState == 2) { OBWeapon.HasMagReleaseButton = true; } else { OBWeapon.HasMagReleaseButton = false; } } } if ((int)m_hingeState == 2 && IsSlappable && IsSlappable && ((FVRInteractiveObject)Gun).IsHeld) { FVRViveHand otherHand = ((FVRInteractiveObject)Gun).m_hand.OtherHand; float num2 = Vector3.Distance(SlapPoint.position, ((HandInput)(ref otherHand.Input)).Pos); float num3 = Vector3.Dot(SlapPoint.forward, ((Vector3)(ref otherHand.Input.VelLinearWorld)).normalized); if (num2 < SlapDistance && num3 > 0.3f) { float magnitude = ((Vector3)(ref otherHand.Input.VelLinearWorld)).magnitude; if (magnitude > 1f) { Latch(); } } } if ((int)m_hingeState == 3) { m_hingeLerp += Time.deltaTime * Mathf.Lerp(4f, 30f, m_hingeLerp * m_hingeLerp); if (m_hingeLerp >= 1f) { m_hingeState = (HingeState)2; m_hingeLerp = 1f; if (EjectMagOnOpen) { Gun.EjectMag(false); if (UseHeatsinkLogicMode) { EjectMagOnOpen = false; } } } SetAnimatedComponent(Hinge, Mathf.Lerp(0f, RotationOpen, m_hingeLerp), (InterpStyle)1, HingeAxis); } else if ((int)m_hingeState == 1) { m_hingeLerp -= Time.deltaTime * Mathf.Lerp(3f, 25f, (m_hingeLerp - 1f) * (m_hingeLerp - 1f)); if (m_hingeLerp <= 0f) { m_hingeState = (HingeState)0; m_hingeLerp = 0f; } SetAnimatedComponent(Hinge, Mathf.Lerp(0f, RotationOpen, m_hingeLerp), (InterpStyle)1, HingeAxis); } } public void UpdateGOToggle() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0084: Unknown result type (might be due to invalid IL or missing references) if ((int)m_hingeState == 2) { GameObject[] activeIfClosed = ActiveIfClosed; foreach (GameObject val in activeIfClosed) { if (val.activeInHierarchy) { val.SetActive(false); } } GameObject[] activeIfOpened = ActiveIfOpened; foreach (GameObject val2 in activeIfOpened) { if (!val2.activeInHierarchy) { val2.SetActive(true); } } } if ((int)m_hingeState != 0) { return; } GameObject[] activeIfClosed2 = ActiveIfClosed; foreach (GameObject val3 in activeIfClosed2) { if (!val3.activeInHierarchy) { val3.SetActive(true); } } GameObject[] activeIfOpened2 = ActiveIfOpened; foreach (GameObject val4 in activeIfOpened2) { if (val4.activeInHierarchy) { val4.SetActive(false); } } } public void UpdateGravityEject() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Invalid comparison between Unknown and I4 //IL_001c: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_0190: 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_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) if ((((Object)(object)Launcher != (Object)null) & ((int)m_hingeState == 2)) && Vector3.Angle(Vector3.up, ((Component)Launcher.Chamber).transform.forward) < 70f && Launcher.Chamber.IsFull && Launcher.Chamber.IsSpent) { ((FVRFireArm)Launcher).PlayAudioEvent((FirearmAudioEventType)29, 1f); Launcher.Chamber.EjectRound(((Component)Launcher.Chamber).transform.position + ((Component)Launcher.Chamber).transform.forward * -0.08f, ((Component)Launcher.Chamber).transform.forward * -0.3f, Vector3.right, false); } if (!(((Object)(object)Cmdo != (Object)null) & ((int)m_hingeState == 2)) || !(Vector3.Angle(Vector3.up, ((Component)this).transform.forward) < 70f)) { return; } FVRFireArmChamber[] commandoChambers = Cmdo.CommandoChambers; foreach (FVRFireArmChamber val in commandoChambers) { if (val.IsFull && val.IsSpent) { ((FVRFireArm)Cmdo).PlayAudioEvent((FirearmAudioEventType)29, 1f); val.EjectRound(((Component)val).transform.position + ((Component)val).transform.forward * -0.08f, ((Component)val).transform.forward * -0.3f, Vector3.right, false); } } } public void ToggleLatchState() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Invalid comparison between Unknown and I4 if ((int)m_hingeState == 0) { Unlatch(); } else if ((int)m_hingeState == 2) { Latch(); } } public void Unlatch() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) if ((int)m_hingeState == 0 && (!UseAEKStyleLogic || (int)Shotgun.Handle.CurPos == 0)) { m_hingeState = (HingeState)3; m_hingeLerp = 0f; SM.PlayCoreSound((FVRPooledAudioType)10, HingeOpenSound, ((Component)this).transform.position); } } public void Latch() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) if ((int)m_hingeState == 2) { m_hingeState = (HingeState)1; m_hingeLerp = 1f; SM.PlayCoreSound((FVRPooledAudioType)10, HingeCloseSound, ((Component)this).transform.position); } } public void SetAnimatedComponent(Transform t, float val, InterpStyle interp, Axis axis) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0009: 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_007a: Invalid comparison between Unknown and I4 //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Invalid comparison between Unknown and I4 //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_005b: 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_002b: Invalid comparison between Unknown and I4 if ((int)interp != 1) { if ((int)interp != 0) { return; } Vector3 localPosition = t.localPosition; if ((int)axis != 0) { if ((int)axis != 1) { if ((int)axis == 2) { localPosition.z = val; } } else { localPosition.y = val; } } else { localPosition.x = val; } t.localPosition = localPosition; return; } Vector3 zero = Vector3.zero; if ((int)axis != 0) { if ((int)axis != 1) { if ((int)axis == 2) { zero.z = val; } } else { zero.y = val; } } else { zero.x = val; } t.localEulerAngles = zero; } } public class SimpleLauncherSafety : MonoBehaviour { public SimpleLauncher Launcher; public Transform Safety; public Vector2 SafetyOnSafetyOff; public bool IsSafetyOn = true; public Transform Trigger; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public InterpStyle TriggerInterpStyle = (InterpStyle)1; public Axis TriggerAxis; private void Update() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) FVRViveHand hand = ((FVRInteractiveObject)Launcher).m_hand; if (!((Object)(object)hand != (Object)null)) { return; } if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown && ((Vector2)(ref hand.Input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(hand.Input.TouchpadAxes, Vector2.left) <= 45f)) { if (((FVRPhysicalObject)Launcher).IsAltHeld) { return; } SwapFiremodes(); } ((FVRPhysicalObject)Launcher).SetAnimatedComponent(Trigger, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, hand.Input.TriggerFloat), TriggerInterpStyle, TriggerAxis); } public void SwapFiremodes() { //IL_006f: 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) IsSafetyOn = !IsSafetyOn; if (IsSafetyOn) { Safety.localEulerAngles = new Vector3(SafetyOnSafetyOff.x, 0f, 0f); Launcher.HasTrigger = false; } else { Safety.localEulerAngles = new Vector3(SafetyOnSafetyOff.y, 0f, 0f); Launcher.HasTrigger = true; } ((FVRFireArm)Launcher).PlayAudioEvent((FirearmAudioEventType)14, 1f); } } public class SimpleObjectToggler : FVRInteractiveObject { public GameObject[] GOs; public AudioEvent Sound; public override void SimpleInteraction(FVRViveHand hand) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); GameObject[] gOs = GOs; foreach (GameObject val in gOs) { if (val.activeInHierarchy) { val.SetActive(false); } else { val.SetActive(true); } SM.PlayCoreSound((FVRPooledAudioType)10, Sound, ((Component)this).transform.position); } } } public class SingleActionRevolverAdvancedForegrip : FVRAlternateGrip { public SingleActionRevolver Gun; public float HandZVelEjectionReq = -2f; private void Update() { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0118: Unknown result type (might be due to invalid IL or missing references) if (!Gun.m_isStateToggled || !((FVRPhysicalObject)Gun).IsAltHeld) { return; } if (((FVRInteractiveObject)Gun).m_hand.Input.TriggerDown || (Vector3.Angle(((Component)Gun).transform.forward, Vector3.up) <= 120f && ((Component)Gun).transform.InverseTransformDirection(((FVRInteractiveObject)Gun).m_hand.Input.VelLinearWorld).z < HandZVelEjectionReq)) { Gun.EjectPrevCylinder(); } if (((FVRInteractiveObject)Gun).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)Gun).m_hand.Input.AXButtonDown) { Gun.AdvanceCylinder(); } } else if (((FVRInteractiveObject)Gun).m_hand.Input.TouchpadDown && Vector2.Angle(((FVRInteractiveObject)Gun).m_hand.Input.TouchpadAxes, Vector2.right) < 45f) { Gun.AdvanceCylinder(); } } } public class SingleActionRevolverSmoothCylinder : MonoBehaviour { public SingleActionRevolver Revolver; public Transform ProxyCylinder; public float RotationRate = 360f; private float TargetAngle; private float curAngle; private void Start() { //IL_0009: 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) curAngle = NormalizeAngle(ProxyCylinder.localEulerAngles.z); } public void Update() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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) TargetAngle = NormalizeAngle(((Component)Revolver.Cylinder).transform.localEulerAngles.z); if (Revolver.m_isStateToggled) { curAngle = Mathf.MoveTowardsAngle(curAngle, TargetAngle, RotationRate * Time.deltaTime); ProxyCylinder.localRotation = Quaternion.Euler(0f, 0f, curAngle); } else { curAngle = NormalizeAngle(((Component)Revolver.Cylinder).transform.localEulerAngles.z); ProxyCylinder.localRotation = Quaternion.Euler(0f, 0f, curAngle); } } private float NormalizeAngle(float angle) { angle = Mathf.Repeat(angle + 180f, 360f) - 180f; return angle; } } public class SmartProjectileEngageDelay : MonoBehaviour { public SmartProjectile Proj; public float EngageDelay = 0.5f; private float TurnRate = 0f; private bool HasEngaged = false; private void Start() { TurnRate = Proj.TurningSpeed; Proj.TurningSpeed = 0f; } private void Update() { EngageDelay -= Time.deltaTime; if (EngageDelay <= 0f && !HasEngaged) { HasEngaged = true; Proj.TurningSpeed = TurnRate; } } } public class SmokeSolidEmitterTimeDelay : MonoBehaviour { public SmokeSolidEmitter[] Emitters; public float TimeDelay = 1f; private float RemainingDelay; private void Start() { RemainingDelay = TimeDelay; } private void Update() { RemainingDelay -= Time.deltaTime; if (!(RemainingDelay <= 0f)) { return; } SmokeSolidEmitter[] emitters = Emitters; foreach (SmokeSolidEmitter val in emitters) { if (!val.Engaged) { val.Engaged = true; } } } } public class StA52Patches : MonoBehaviour { public ClosedBoltWeapon Weapon; public GameObject[] GOs; private void Update() { GameObject[] gOs = GOs; foreach (GameObject val in gOs) { if (((FVRFireArm)Weapon).IsTopCoverUp) { val.SetActive(true); } else { val.SetActive(false); } } } } public class StAX3MovingPart : MonoBehaviour { [Serializable] public class StAX3Part { public Transform Part; public bool IsRotate = false; public Vector3 StartPose; public Vector3 EndPose; } public OpenBoltReceiverBolt Bolt; public bool EjectMagWhenBoltLocksOpen = true; public bool HasEjectedMag = false; public StAX3Part[] Parts; private void Update() { //IL_00b3: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Bolt == (Object)null) { return; } if (EjectMagWhenBoltLocksOpen && !HasEjectedMag && Bolt.m_currentBoltRot > 25f) { HasEjectedMag = true; Bolt.Receiver.ReleaseMag(); } if (((FVRInteractiveObject)Bolt).IsHeld || Bolt.m_currentBoltRot > 0f) { StAX3Part[] parts = Parts; foreach (StAX3Part stAX3Part in parts) { if (stAX3Part == null) { break; } if (stAX3Part.IsRotate) { stAX3Part.Part.localEulerAngles = stAX3Part.EndPose; } if (!stAX3Part.IsRotate) { stAX3Part.Part.localPosition = stAX3Part.EndPose; } } return; } StAX3Part[] parts2 = Parts; foreach (StAX3Part stAX3Part2 in parts2) { if (stAX3Part2 == null) { return; } if (stAX3Part2.IsRotate) { stAX3Part2.Part.localEulerAngles = stAX3Part2.StartPose; } if (!stAX3Part2.IsRotate) { stAX3Part2.Part.localPosition = stAX3Part2.StartPose; } } if (EjectMagWhenBoltLocksOpen && HasEjectedMag) { HasEjectedMag = false; } } } public class StickyGrenadeProjectileAddon : MonoBehaviour { public MF2_StickyBomb Stickybomb; public MF2_Demonade Demonade; public ParticleSystem PSystem; public AudioSource AudioSource; public AudioEvent StickSound; public float ExplodeDelay; private float m_remainingDelay; private bool hasStuck = false; private void Start() { if (!AudioSource.isPlaying) { AudioSource.Play(); } if (PSystem.isPlaying) { PSystem.Stop(); } m_remainingDelay = ExplodeDelay; } private void Update() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) if (Stickybomb.m_hasStuck && !hasStuck) { hasStuck = true; AudioSource.Stop(); PSystem.Play(); SM.PlayCoreSound((FVRPooledAudioType)11, StickSound, ((Component)this).transform.position); } if (hasStuck) { m_remainingDelay -= Time.deltaTime; if (m_remainingDelay <= 0f) { Demonade.Explode(); } } } } public class TopCoverMagCutoff : MonoBehaviour { public FVRFireArm Firearm; private void Update() { if (!((Object)(object)Firearm.Magazine == (Object)null)) { if (Firearm.IsTopCoverUp) { Firearm.Magazine.IsExtractable = false; Firearm.Magazine.IsDropInLoadable = true; } else { Firearm.Magazine.IsExtractable = true; Firearm.Magazine.IsDropInLoadable = false; } } } } public class TopCoverPlus : MonoBehaviour { public FVRFireArm Gun; public GameObject[] SetActiveIfTopCoverUp; private void Update() { if (Gun.IsTopCoverUp) { GameObject[] setActiveIfTopCoverUp = SetActiveIfTopCoverUp; foreach (GameObject val in setActiveIfTopCoverUp) { if (!val.activeInHierarchy) { val.SetActive(true); } } return; } GameObject[] setActiveIfTopCoverUp2 = SetActiveIfTopCoverUp; foreach (GameObject val2 in setActiveIfTopCoverUp2) { if (val2.activeInHierarchy) { val2.SetActive(false); } } } } } namespace Cityrobo { [RequireComponent(typeof(TrailRenderer))] public class TrailFade : MonoBehaviour { public AnimationCurve FadeCurve; private TrailRenderer _trailRenderer; private float _timePassed = 0f; public void Awake() { _trailRenderer = ((Component)this).GetComponent(); } public void Update() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) _timePassed += Time.deltaTime; float num = FadeCurve.Evaluate(_timePassed); Gradient val = new Gradient(); val.SetKeys((GradientColorKey[])(object)new GradientColorKey[2] { new GradientColorKey(Color.white, 0f), new GradientColorKey(Color.white, 1f) }, (GradientAlphaKey[])(object)new GradientAlphaKey[2] { new GradientAlphaKey(num, 0f), new GradientAlphaKey(num, 1f) }); _trailRenderer.colorGradient = val; } } } namespace ShermanJumbo { public class TubeFedMultiBarrelShotgun : FVRFireArm { public enum ShotgunMode { PumpMode, Automatic } public bool PlayOneShotSound = false; [Header("Shotgun Params")] public TubeFedMultiBarrelShotgunBolt Bolt; public TubeFedMultiBarrelShotgunHandle Handle; public FVRFireArmChamber Chamber; public bool HasHandle; [Header("Component Connections")] public Transform Trigger; public Transform Safety; public GameObject ReloadTriggerWell; [Header("Carrier System")] public bool UsesAnimatedCarrier; public Transform Carrier; public Vector2 CarrierRots; public Transform CarrierComparePoint1; public Transform CarrierComparePoint2; public float CarrierDetectDistance; private float m_curCarrierRot; private float m_tarCarrierRot; [Header("Round Positions")] public Transform RoundPos_LowerPath_Forward; public Transform RoundPos_LowerPath_Rearward; public Transform RoundPos_UpperPath_Forward; public Transform RoundPos_UpperPath_Rearward; public Transform RoundPos_Ejecting; public Transform RoundPos_Ejection; public Vector3 RoundEjectionSpeed; public Vector3 RoundEjectionSpin; private FVRFirearmMovingProxyRound m_proxy; private bool m_isExtractedRoundOnLowerPath = true; [Header("Trigger Params")] public bool HasTrigger; public InterpStyle TriggerInterp; public Axis TriggerAxis; public float TriggerUnheld; public float TriggerHeld; public float TriggerResetThreshold = 0.45f; public float TriggerBreakThreshold = 0.85f; private float m_triggerFloat; private bool m_hasTriggerReset = true; public bool UsesSlamFireTrigger; [Header("Safety Params")] public bool HasSafety; public InterpStyle Safety_Interp; public Axis SafetyAxis; public float SafetyOff; public float SafetyOn; private bool m_isSafetyEngaged = true; private bool m_isHammerCocked; [Header("Control Params")] public bool HasSlideReleaseButton; [HideInInspector] public bool IsSlideReleaseButtonHeld; [Header("Mode Params")] public bool CanModeSwitch; public ShotgunMode Mode; private bool m_isChamberRoundOnExtractor; private bool m_isChamber2RoundOnExtractor; private bool m_isChamber3RoundOnExtractor; [Header("Multi Barrel Params")] public FVRFireArmChamber Chamber2; public Transform Muzzle2; private FVRFirearmMovingProxyRound m_proxy2; private bool m_isHammer2Cocked; public FVRFireArmChamber Chamber3; public Transform Muzzle3; private FVRFirearmMovingProxyRound m_proxy3; private bool m_isHammer3Cocked; public Transform RoundPos_Ejection3; public bool FireAllBarrels = false; public int CurrentChamber = 1; public bool UsesMuzzleFX = false; public Vector3 Chamber2RoundEjectSpeed; public Vector3 Chamber2RoundEjectSpin; public Transform RoundPos_LowerPath_Forward2; public Transform RoundPos_LowerPath_Rearward2; public Transform RoundPos_UpperPath_Forward2; public Transform RoundPos_UpperPath_Rearward2; public Transform RoundPos_Ejecting2; public Transform RoundPos_Ejection2; public bool DoesPFXOnFire = false; public ParticleSystem PFX1; public ParticleSystem PFX2; public bool IsSafetyEngaged => m_isSafetyEngaged; public bool IsHammerCocked => m_isHammerCocked; public bool HasExtractedRound() { return m_proxy.IsFull; } public override void Awake() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown ((FVRFireArm)this).Awake(); base.FChambers.Add(Chamber); if ((int)Mode == 1) { if (HasHandle) { Handle.LockHandle(); } } else if (HasHandle) { Handle.UnlockHandle(); } if (!HasSafety) { m_isSafetyEngaged = false; } GameObject val = new GameObject("m_proxyRound"); m_proxy = val.AddComponent(); m_proxy.Init(((Component)this).transform); GameObject val2 = new GameObject("m_proxyRound2"); m_proxy2 = val2.AddComponent(); m_proxy2.Init(((Component)this).transform); GameObject val3 = new GameObject("m_proxyRound3"); m_proxy3 = val3.AddComponent(); m_proxy3.Init(((Component)this).transform); } public override int GetTutorialState() { if (m_isSafetyEngaged) { return 2; } if (Chamber.IsFull && !Chamber.IsSpent) { return 3; } if ((Object)(object)base.Magazine == (Object)null || !base.Magazine.HasARound()) { return 0; } return 1; } public void BoltReleasePressed() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)Mode == 1) { Bolt.ReleaseBolt(); } } public bool CanCycleMagState() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) return (int)Handle.CurPos == 0 && !HasExtractedRound(); } public void ToggleSafety() { if (HasSafety) { m_isSafetyEngaged = !m_isSafetyEngaged; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)14, 1f); UpdateSafetyGeo(); } } private void UpdateSafetyGeo() { //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) float num = ((!m_isSafetyEngaged) ? SafetyOff : SafetyOn); ((FVRPhysicalObject)this).SetAnimatedComponent(Safety, num, Safety_Interp, SafetyAxis); } public void EjectExtractedRound() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006c: 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_007c: 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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01be: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0310: Unknown result type (might be due to invalid IL or missing references) if (m_isChamberRoundOnExtractor) { m_isChamberRoundOnExtractor = false; if (Chamber.IsFull) { Chamber.EjectRound(RoundPos_Ejection.position, ((Component)this).transform.right * RoundEjectionSpeed.x + ((Component)this).transform.up * RoundEjectionSpeed.y + ((Component)this).transform.forward * RoundEjectionSpeed.z, ((Component)this).transform.right * RoundEjectionSpin.x + ((Component)this).transform.up * RoundEjectionSpin.y + ((Component)this).transform.forward * RoundEjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false); } if ((Object)(object)Chamber2 != (Object)null && Chamber2.IsFull) { Chamber2.EjectRound(RoundPos_Ejection2.position, ((Component)this).transform.right * Chamber2RoundEjectSpeed.x + ((Component)this).transform.up * Chamber2RoundEjectSpeed.y + ((Component)this).transform.forward * Chamber2RoundEjectSpeed.z, ((Component)this).transform.right * Chamber2RoundEjectSpin.x + ((Component)this).transform.up * Chamber2RoundEjectSpin.y + ((Component)this).transform.forward * Chamber2RoundEjectSpin.z, RoundPos_Ejection2.position, RoundPos_Ejection2.rotation, false); } if ((Object)(object)Chamber3 != (Object)null && Chamber3.IsFull) { Chamber3.EjectRound(RoundPos_Ejection3.position, ((Component)this).transform.right * RoundEjectionSpeed.x + ((Component)this).transform.up * RoundEjectionSpeed.y + ((Component)this).transform.forward * RoundEjectionSpeed.z, ((Component)this).transform.right * RoundEjectionSpin.x + ((Component)this).transform.up * RoundEjectionSpin.y + ((Component)this).transform.forward * RoundEjectionSpin.z, RoundPos_Ejection.position, RoundPos_Ejection.rotation, false); } } } public void ExtractRound() { if (!((Object)(object)base.Magazine == (Object)null) && !m_proxy.IsFull) { if (!m_proxy.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference = base.Magazine.RemoveRound(false); m_proxy.SetFromPrefabReference(fromPrefabReference); m_isExtractedRoundOnLowerPath = true; } if ((Object)(object)Chamber2 != (Object)null && !m_proxy2.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference2 = base.Magazine.RemoveRound(false); m_proxy2.SetFromPrefabReference(fromPrefabReference2); } if ((Object)(object)Chamber3 != (Object)null && !m_proxy3.IsFull && base.Magazine.HasARound()) { GameObject fromPrefabReference3 = base.Magazine.RemoveRound(false); m_proxy3.SetFromPrefabReference(fromPrefabReference3); } } } public bool ChamberRound() { if (Chamber.IsFull) { m_isChamberRoundOnExtractor = true; } if (m_proxy.IsFull && !Chamber.IsFull && !m_isExtractedRoundOnLowerPath) { m_isChamberRoundOnExtractor = true; Chamber.SetRound(m_proxy.Round, false); m_proxy.ClearProxy(); if ((Object)(object)Chamber2 == (Object)null) { return true; } } if ((Object)(object)Chamber2 != (Object)null && m_proxy2.IsFull && !Chamber2.IsFull) { Chamber2.SetRound(m_proxy2.Round, false); m_proxy2.ClearProxy(); if ((Object)(object)Chamber3 == (Object)null) { return true; } } if ((Object)(object)Chamber3 != (Object)null && m_proxy3.IsFull && !Chamber3.IsFull) { Chamber3.SetRound(m_proxy3.Round, false); m_proxy3.ClearProxy(); return true; } return false; } public bool ReturnCarrierRoundToMagazineIfRelevant() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) if (m_proxy.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy.Round.RoundClass, false, true); m_proxy.ClearProxy(); if ((Object)(object)Chamber2 == (Object)null) { return true; } } if (m_proxy2.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy2.Round.RoundClass, false, true); m_proxy2.ClearProxy(); if ((Object)(object)Chamber3 == (Object)null) { return true; } } if (m_proxy3.IsFull && m_isExtractedRoundOnLowerPath) { base.Magazine.AddRound(m_proxy3.Round.RoundClass, false, true); m_proxy3.ClearProxy(); return true; } return false; } public void TransferShellToUpperTrack() { if (m_proxy.IsFull && m_isExtractedRoundOnLowerPath && !Chamber.IsFull) { m_isExtractedRoundOnLowerPath = false; } } public void ToggleMode() { //IL_0007: 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_0075: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if ((int)Bolt.CurPos != 0) { Debug.Log((object)"not forward"); return; } if (HasHandle && (int)Handle.CurPos != 0) { Debug.Log((object)"not forward"); return; } if (m_isHammerCocked) { Debug.Log((object)"hammer cocked"); return; } ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f); if ((int)Mode == 0) { Mode = (ShotgunMode)1; if (HasHandle) { Handle.LockHandle(); } } else { Mode = (ShotgunMode)0; if (HasHandle) { Handle.UnlockHandle(); } } } public void CockHammer() { if (!m_isHammerCocked) { m_isHammerCocked = true; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } if (!m_isHammer2Cocked) { m_isHammer2Cocked = true; } if (!m_isHammer3Cocked) { m_isHammer3Cocked = true; } } public void ReleaseHammer() { //IL_0007: 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) if ((int)Bolt.CurPos != 0) { return; } if (m_isHammerCocked) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); Fire(); PlayOneShotSound = false; if (FireAllBarrels) { PlayOneShotSound = true; m_isHammerCocked = false; Fire2(); m_isHammer2Cocked = false; Fire3(); m_isHammer3Cocked = false; Handle.UnlockHandle(); } else { m_isHammerCocked = false; if (HasHandle && (int)Mode == 0 && (Object)(object)Chamber2 == (Object)null) { Handle.UnlockHandle(); } } } else if (!m_isHammerCocked && m_isHammer2Cocked) { if ((Object)(object)Chamber2 != (Object)null) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); } Fire2(); m_isHammer2Cocked = false; if ((Object)(object)Chamber3 == (Object)null) { Handle.UnlockHandle(); } } else if (!m_isHammerCocked && !m_isHammer2Cocked && m_isHammer3Cocked) { if ((Object)(object)Chamber3 != (Object)null) { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); } Fire3(); m_isHammer3Cocked = false; Handle.UnlockHandle(); } } public bool Fire() { //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_00b5: Invalid comparison between Unknown and I4 if (!Chamber.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber, base.MuzzlePos, true, 1f, -1f); if (UsesMuzzleFX) { ((FVRFireArm)this).FireMuzzleSmoke(0); ((FVRFireArm)this).FireMuzzleSmoke(1); } if (DoesPFXOnFire) { PFX1.Emit(1); } bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); ((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); if ((int)Mode == 1 && Chamber.GetRound().IsHighPressure && !Bolt.UsesLateralLocking) { Bolt.ImpartFiringImpulse(); } if ((Object)(object)Chamber2 == (Object)null || ((Object)(object)Chamber2 != (Object)null && !Chamber2.IsFull)) { Handle.UnlockHandle(); } return true; } public bool Fire2() { //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Chamber2 == (Object)null) { return false; } if (!Chamber2.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber2, Muzzle2, true, 1f, -1f); if (UsesMuzzleFX) { ((FVRFireArm)this).FireMuzzleSmoke(2); ((FVRFireArm)this).FireMuzzleSmoke(3); } if (DoesPFXOnFire) { PFX2.Emit(1); } bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); if (!PlayOneShotSound) { ((FVRFireArm)this).PlayAudioGunShot(Chamber2.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); } if ((Object)(object)Chamber3 == (Object)null || ((Object)(object)Chamber3 != (Object)null && !Chamber3.IsFull)) { Handle.UnlockHandle(); } return true; } public bool Fire3() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Chamber3 == (Object)null) { return false; } if (!Chamber3.Fire()) { return false; } ((FVRFireArm)this).Fire(Chamber3, Muzzle3, true, 1f, -1f); if (UsesMuzzleFX) { ((FVRFireArm)this).FireMuzzleSmoke(4); ((FVRFireArm)this).FireMuzzleSmoke(5); } bool flag = ((FVRFireArm)this).IsTwoHandStabilized(); bool flag2 = ((FVRFireArm)this).IsForegripStabilized(); bool flag3 = ((FVRFireArm)this).IsShoulderStabilized(); ((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f); if (!PlayOneShotSound) { ((FVRFireArm)this).PlayAudioGunShot(Chamber3.GetRound(), GM.CurrentPlayerBody.GetCurrentSoundEnvironment(), 1f); } Handle.UnlockHandle(); return true; } public override void FVRUpdate() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)this).FVRUpdate(); UpdateComponents(); UpdateCarrier(); if (HasHandle) { Handle.UpdateHandle(); bool state = false; if ((((FVRInteractiveObject)Handle).IsHeld || ((FVRPhysicalObject)this).IsAltHeld) && (int)Mode == 0) { state = true; } Bolt.UpdateHandleHeldState(state, 1f - Handle.GetBoltLerpBetweenRearAndFore()); } Bolt.UpdateBolt(); UpdateDisplayRoundPositions(); if (HasExtractedRound() && m_isExtractedRoundOnLowerPath) { if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.IsDropInLoadable = false; } } else if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.IsDropInLoadable = true; } } private void UpdateCarrier() { //IL_0065: 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_007c: 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_009b: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) if (!UsesAnimatedCarrier) { return; } if (((FVRInteractiveObject)this).IsHeld) { if ((Object)(object)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable != (Object)null) { if (((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable is FVRFireArmRound) { float num = Vector3.Distance(((Component)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable).transform.position, ((FVRInteractiveObject)this).GetClosestValidPoint(CarrierComparePoint1.position, CarrierComparePoint2.position, ((Component)((FVRInteractiveObject)this).m_hand.OtherHand.CurrentInteractable).transform.position)); if (num < CarrierDetectDistance) { m_tarCarrierRot = CarrierRots.y; } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } } else { m_tarCarrierRot = CarrierRots.x; } if (HasExtractedRound() && !m_isExtractedRoundOnLowerPath) { m_tarCarrierRot = CarrierRots.y; } if (Mathf.Abs(m_curCarrierRot - m_tarCarrierRot) > 0.001f) { m_curCarrierRot = Mathf.MoveTowards(m_curCarrierRot, m_tarCarrierRot, 270f * Time.deltaTime); Carrier.localEulerAngles = new Vector3(m_curCarrierRot, 0f, 0f); } } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); UpdateInputAndAnimate(hand); } private void UpdateInputAndAnimate(FVRViveHand hand) { //IL_0081: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_014e: Invalid comparison between Unknown and I4 //IL_01ab: Unknown result type (might be due to invalid IL or missing references) IsSlideReleaseButtonHeld = false; if (((FVRPhysicalObject)this).IsAltHeld) { 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); } Vector2 touchpadAxes = hand.Input.TouchpadAxes; if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown) { ToggleSafety(); } if (hand.Input.AXButtonPressed) { IsSlideReleaseButtonHeld = true; if (HasHandle && (int)Mode == 0) { Handle.UnlockHandle(); } } } else { if (hand.Input.TouchpadDown && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f) { if (Vector2.Angle(touchpadAxes, Vector2.left) <= 45f) { ToggleSafety(); } else if (Vector2.Angle(touchpadAxes, Vector2.up) <= 45f && (int)Mode == 1) { Bolt.ReleaseBolt(); } } if (hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.up) <= 45f) { IsSlideReleaseButtonHeld = true; if (HasHandle && (int)Mode == 0) { Handle.UnlockHandle(); } } } bool flag = false; if (Bolt.UsesLateralLocking && !Bolt.GetIsLateralLocked()) { flag = true; } if (m_triggerFloat >= TriggerBreakThreshold && (m_isHammerCocked || m_isHammer2Cocked || m_isHammer3Cocked) && !m_isSafetyEngaged && !flag) { if (m_hasTriggerReset || UsesSlamFireTrigger) { ReleaseHammer(); } m_hasTriggerReset = false; } } 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) if (HasTrigger) { ((FVRPhysicalObject)this).SetAnimatedComponent(Trigger, Mathf.Lerp(TriggerUnheld, TriggerHeld, m_triggerFloat), TriggerInterp, TriggerAxis); } } private void UpdateDisplayRoundPositions() { //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: 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_0051: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_0205: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0134: 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_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_047a: Unknown result type (might be due to invalid IL or missing references) //IL_0480: Unknown result type (might be due to invalid IL or missing references) //IL_049b: Unknown result type (might be due to invalid IL or missing references) //IL_04a6: 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_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: 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_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04fa: Unknown result type (might be due to invalid IL or missing references) //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) float boltLerpBetweenLockAndFore = Bolt.GetBoltLerpBetweenLockAndFore(); if (Chamber.IsFull) { if (m_isChamberRoundOnExtractor) { 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 ((Object)(object)Chamber2 != (Object)null) { 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 ((Object)(object)Chamber3 != (Object)null) { Chamber3.ProxyRound.position = Vector3.Lerp(RoundPos_Ejecting.position, ((Component)Chamber3).transform.position, boltLerpBetweenLockAndFore); Chamber3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_Ejecting.rotation, ((Component)Chamber3).transform.rotation, boltLerpBetweenLockAndFore); } } else { Chamber.ProxyRound.position = ((Component)Chamber).transform.position; Chamber.ProxyRound.rotation = ((Component)Chamber).transform.rotation; if ((Object)(object)Chamber2 != (Object)null) { Chamber2.ProxyRound.position = ((Component)Chamber2).transform.position; Chamber2.ProxyRound.rotation = ((Component)Chamber2).transform.rotation; } if ((Object)(object)Chamber3 != (Object)null) { Chamber3.ProxyRound.position = ((Component)Chamber3).transform.position; Chamber3.ProxyRound.rotation = ((Component)Chamber3).transform.rotation; } } } if (m_proxy.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber.IsFull) { m_proxy.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward.position, RoundPos_LowerPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward.rotation, RoundPos_LowerPath_Forward.rotation, boltLerpBetweenLockAndFore); } else { m_proxy.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward.position, RoundPos_UpperPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward.rotation, RoundPos_UpperPath_Forward.rotation, boltLerpBetweenLockAndFore); } } if (m_proxy2.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber2.IsFull) { m_proxy2.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward2.position, RoundPos_LowerPath_Forward2.position, boltLerpBetweenLockAndFore); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward2.rotation, RoundPos_LowerPath_Forward2.rotation, boltLerpBetweenLockAndFore); } else { m_proxy2.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward2.position, RoundPos_UpperPath_Forward2.position, boltLerpBetweenLockAndFore); m_proxy2.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward2.rotation, RoundPos_UpperPath_Forward2.rotation, boltLerpBetweenLockAndFore); } } if (m_proxy3.IsFull) { if (m_isExtractedRoundOnLowerPath || Chamber3.IsFull) { m_proxy3.ProxyRound.position = Vector3.Lerp(RoundPos_LowerPath_Rearward.position, RoundPos_LowerPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_LowerPath_Rearward.rotation, RoundPos_LowerPath_Forward.rotation, boltLerpBetweenLockAndFore); } else { m_proxy3.ProxyRound.position = Vector3.Lerp(RoundPos_UpperPath_Rearward.position, RoundPos_UpperPath_Forward.position, boltLerpBetweenLockAndFore); m_proxy3.ProxyRound.rotation = Quaternion.Slerp(RoundPos_UpperPath_Rearward.rotation, RoundPos_UpperPath_Forward.rotation, boltLerpBetweenLockAndFore); } } } public override List GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List list = new List(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List 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 f) { string empty = string.Empty; string empty2 = string.Empty; empty = "HammerState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; if (empty2 == "Cocked") { m_isHammerCocked = true; } } if (HasSafety) { empty = "SafetyState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; if (empty2 == "On") { m_isSafetyEngaged = true; } UpdateSafetyGeo(); } } ((FVRFireArm)this).ConfigureFromFlagDic(f); } } public class TubeFedMultiBarrelShotgunBolt : FVRInteractiveObject { public enum BoltPos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Shotgun Bolt")] public TubeFedMultiBarrelShotgun Shotgun; 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 bool HasLastRoundBoltHoldOpen = 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 bool m_isBoltLocked; private bool m_isHandleHeld; private float m_HandleLerp; [Header("Reciprocating Barrel")] public bool HasReciprocatingBarrel; public Transform Barrel; public Vector3 BarrelForward; public Vector3 BarrelRearward; private bool m_isBarrelReciprocating; [Header("Elevator")] public bool HasElevator; public Transform Elevator; public Vector3 ElevatorForward; public Vector3 ElevatorRearward; [Header("Hammer")] public bool HasHammer; public Transform Hammer; public Vector3 HammerForward; public Vector3 HammerRearward; [Header("LateralLocking")] public bool UsesLateralLocking; public Transform LateralLock; public Vector3 Point_LateralLock_In; public Vector3 Point_LateralLock_Out; public Transform LaterlockGoal_In; public Transform LaterlockGoal_Out; private bool m_isLateralLockIn = true; public bool ChambersAreAlwaysAccessible = false; public bool GetIsLateralLocked() { return m_isLateralLockIn; } 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) ((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; } public override bool IsInteractable() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 return (int)Shotgun.Mode == 1 && ((FVRInteractiveObject)this).IsInteractable(); } 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) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)8, 1f); m_isBoltLocked = false; } } public void UpdateHandleHeldState(bool state, float lerp) { m_isHandleHeld = state; m_HandleLerp = lerp; } public void ImpartFiringImpulse() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) m_curBoltSpeed = Speed_Rearward; if ((int)CurPos == 0) { m_isBarrelReciprocating = true; } } 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Invalid comparison between Unknown and I4 //IL_0103: 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) //IL_0222: Invalid comparison between Unknown and I4 //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Invalid comparison between Unknown and I4 //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0361: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_04e7: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Expected I4, but got Unknown //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04fe: Expected I4, but got Unknown //IL_04fe: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_043a: 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_04be: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Invalid comparison between Unknown and I4 //IL_04e3: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Invalid comparison between Unknown and I4 //IL_058b: Unknown result type (might be due to invalid IL or missing references) //IL_05ae: Unknown result type (might be due to invalid IL or missing references) //IL_05b4: Invalid comparison between Unknown and I4 //IL_0596: Unknown result type (might be due to invalid IL or missing references) //IL_05d2: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Invalid comparison between Unknown and I4 //IL_05ba: Unknown result type (might be due to invalid IL or missing references) //IL_05f7: Unknown result type (might be due to invalid IL or missing references) //IL_05fd: Invalid comparison between Unknown and I4 //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e4: Invalid comparison between Unknown and I4 //IL_0656: Unknown result type (might be due to invalid IL or missing references) //IL_065c: Invalid comparison between Unknown and I4 //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_0616: Invalid comparison between Unknown and I4 //IL_0603: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Invalid comparison between Unknown and I4 //IL_06e7: Unknown result type (might be due to invalid IL or missing references) //IL_06ec: Unknown result type (might be due to invalid IL or missing references) //IL_0667: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Invalid comparison between Unknown and I4 //IL_0635: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Invalid comparison between Unknown and I4 //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Invalid comparison between Unknown and I4 //IL_0641: Unknown result type (might be due to invalid IL or missing references) //IL_0647: Invalid comparison between Unknown and I4 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)Shotgun).transform.InverseTransformPoint(closestValidPoint).z; if (UsesLateralLocking && (int)CurPos == 0) { float num = Vector3.Distance(LaterlockGoal_In.position, ((HandInput)(ref base.m_hand.Input)).Pos); float num2 = Vector3.Distance(LaterlockGoal_Out.position, ((HandInput)(ref base.m_hand.Input)).Pos); if (num < num2 && !m_isLateralLockIn) { m_isLateralLockIn = true; ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)12, 1f); LateralLock.localPosition = Point_LateralLock_In; } else if (num > num2 && m_isLateralLockIn) { m_isLateralLockIn = false; ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)13, 1f); LateralLock.localPosition = Point_LateralLock_Out; } } } 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 (UsesLateralLocking && m_isLateralLockIn) { ((Vector2)(ref val))..ctor(m_boltZ_forward, m_boltZ_forward); } if (flag) { m_curBoltSpeed = 0f; } else if ((int)Shotgun.Mode == 1 && (((int)CurPos < 3 && m_curBoltSpeed >= 0f) || (int)LastPos >= 4)) { m_curBoltSpeed = Mathf.MoveTowards(m_curBoltSpeed, Speed_Forward, Time.deltaTime * SpringStiffness); } float num3 = m_boltZ_current; float boltZ_current = m_boltZ_current; if (flag) { boltZ_current = m_boltZ_heldTarget; num3 = Mathf.MoveTowards(m_boltZ_current, boltZ_current, Speed_Held * Time.deltaTime); } else if ((int)Shotgun.Mode == 1) { num3 = m_boltZ_current + m_curBoltSpeed * Time.deltaTime; } num3 = Mathf.Clamp(num3, val.x, val.y); if (Mathf.Abs(num3 - m_boltZ_current) > Mathf.Epsilon) { m_boltZ_current = num3; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current); if (HasElevator) { float boltLerpBetweenLockAndFore = GetBoltLerpBetweenLockAndFore(); Elevator.localEulerAngles = Vector3.Lerp(ElevatorRearward, ElevatorForward, boltLerpBetweenLockAndFore); } } else { m_curBoltSpeed = 0f; } if (HasHammer) { if (Shotgun.IsHammerCocked) { Hammer.localEulerAngles = HammerRearward; } else { float boltLerpBetweenLockAndFore2 = GetBoltLerpBetweenLockAndFore(); Hammer.localEulerAngles = Vector3.Lerp(HammerRearward, HammerForward, boltLerpBetweenLockAndFore2); } } if (HasReciprocatingBarrel && m_isBarrelReciprocating) { float num4 = 0f; if (!m_isBoltLocked && !((FVRInteractiveObject)this).IsHeld) { num4 = 1f - GetBoltLerpBetweenLockAndFore(); } Barrel.localPosition = Vector3.Lerp(BarrelForward, BarrelRearward, num4); } BoltPos curPos = CurPos; curPos = ((Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.0015f) ? ((BoltPos)0) : ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.0015f) ? ((BoltPos)2) : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.0015f) ? ((BoltPos)4) : ((!(m_boltZ_current > m_boltZ_lock)) ? ((BoltPos)3) : ((BoltPos)1))))); int num5 = (int)CurPos; CurPos = (BoltPos)Mathf.Clamp((int)curPos, num5 - 1, num5 + 1); if (!ChambersAreAlwaysAccessible) { if ((int)CurPos >= 2) { Shotgun.Chamber.IsAccessible = true; } else { Shotgun.Chamber.IsAccessible = false; } } else { Shotgun.Chamber.IsAccessible = true; } if ((int)CurPos >= 1) { ((FVRFireArm)Shotgun).IsBreachOpenForGasOut = true; } else { ((FVRFireArm)Shotgun).IsBreachOpenForGasOut = false; } if ((int)CurPos == 0 && (int)LastPos != 0) { BoltEvent_ArriveAtFore(); } else if ((int)CurPos == 1 && (int)LastPos == 0) { BoltEvent_ExtractRoundFromMag(); } else if ((int)CurPos == 2 && (int)LastPos == 1) { BoltEvent_EjectRound(); } else if ((int)CurPos != 1 || (int)LastPos != 2) { if ((int)CurPos == 2 && (int)LastPos == 3) { BoltEvent_BoltCaught(); } else if ((int)CurPos == 4 && (int)LastPos != 4) { BoltEvent_SmackRear(); } } if ((int)CurPos >= 2 && (int)Shotgun.Mode == 1 && HasLastRoundBoltHoldOpen && (Object)(object)((FVRFireArm)Shotgun).Magazine != (Object)null && !Shotgun.HasExtractedRound() && !((FVRFireArm)Shotgun).Magazine.HasARound() && !Shotgun.Chamber.IsFull && !Shotgun.IsSlideReleaseButtonHeld) { LockBolt(); } LastPos = CurPos; } private void BoltEvent_ArriveAtFore() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) Shotgun.ChamberRound(); Shotgun.ReturnCarrierRoundToMagazineIfRelevant(); if (HasReciprocatingBarrel && m_isBarrelReciprocating) { m_isBarrelReciprocating = false; Barrel.localPosition = BarrelForward; } if (((FVRInteractiveObject)this).IsHeld) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)2, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)0, 1f); } } private void BoltEvent_EjectRound() { Shotgun.EjectExtractedRound(); Shotgun.TransferShellToUpperTrack(); Shotgun.CockHammer(); } private void BoltEvent_ExtractRoundFromMag() { Shotgun.ExtractRound(); } private void BoltEvent_SmackRear() { if (((FVRInteractiveObject)this).IsHeld || m_isHandleHeld) { ReleaseBolt(); } if (((FVRInteractiveObject)this).IsHeld) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)3, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)1, 1f); } } private void BoltEvent_BoltCaught() { if (m_isBoltLocked) { if (HasReciprocatingBarrel && m_isBarrelReciprocating) { m_isBarrelReciprocating = false; } ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)4, 1f); } } } public class TubeFedMultiBarrelShotgunFireSelector : FVRInteractiveObject { public TubeFedMultiBarrelShotgun Gun; public Transform Selector; public float XRotEnabled; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); Gun.FireAllBarrels = !Gun.FireAllBarrels; ((FVRFireArm)Gun).PlayAudioEvent((FirearmAudioEventType)15, 1f); if (Gun.FireAllBarrels) { ((FVRPhysicalObject)Gun).SetAnimatedComponent(Selector, XRotEnabled, (InterpStyle)1, (Axis)0); } else { ((FVRPhysicalObject)Gun).SetAnimatedComponent(Selector, 0f, (InterpStyle)1, (Axis)0); } } } public class TubeFedMultiBarrelShotgunHandle : FVRAlternateGrip { public enum BoltPos { Forward, ForwardToMid, Locked, LockedToRear, Rear } [Header("Shotgun Handle")] public TubeFedMultiBarrelShotgun Shotgun; public float Speed_Held; public BoltPos CurPos; public BoltPos LastPos; public Transform Point_Bolt_Forward; public Transform Point_Bolt_LockPoint; public Transform Point_Bolt_Rear; private float m_handZOffset; 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 bool m_isHandleLocked; 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) ((FVRAlternateGrip)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; } public override void BeginInteraction(FVRViveHand hand) { //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_0018: Unknown result type (might be due to invalid IL or missing references) m_handZOffset = ((Component)this).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z; ((FVRAlternateGrip)this).BeginInteraction(hand); } 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 LockHandle() { m_isHandleLocked = true; } public void UnlockHandle() { m_isHandleLocked = false; } public void UpdateHandle() { //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: 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_021b: 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) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Expected I4, but got Unknown //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Expected I4, but got Unknown //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Invalid comparison between Unknown and I4 //IL_0399: Unknown result type (might be due to invalid IL or missing references) //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03bd: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Invalid comparison between Unknown and I4 bool flag = false; if (((FVRInteractiveObject)this).IsHeld || ((FVRPhysicalObject)Shotgun).IsAltHeld) { flag = true; } if (flag && !m_isHandleLocked) { Vector3 closestValidPoint; if (((FVRInteractiveObject)this).IsHeld) { closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Bolt_Forward.position, Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)this).m_hand.Input)).Pos + -((Component)this).transform.forward * m_handZOffset * ((Component)Shotgun).transform.localScale.x); } else { if (((FVRInteractiveObject)Shotgun).m_hand.Input.TriggerPressed) { Vector3 velLinearWorld = ((FVRInteractiveObject)Shotgun).m_hand.Input.VelLinearWorld; velLinearWorld = Vector3.Project(velLinearWorld, ((Component)Shotgun).transform.forward); velLinearWorld = ((Component)Shotgun).transform.InverseTransformDirection(velLinearWorld); if (Mathf.Abs(velLinearWorld.z) > 1f) { float z = ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.z; float num = (0f - velLinearWorld.z) * Time.deltaTime; z += num; z = Mathf.Clamp(z, Point_Bolt_Rear.localPosition.z - 0.1f, Point_Bolt_Forward.localPosition.z + 0.1f); ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition = new Vector3(((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.x, ((FVRInteractiveObject)Shotgun).GrabPointTransform.localPosition.y, z); } } closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Bolt_Forward.position, Point_Bolt_Rear.position, ((HandInput)(ref ((FVRInteractiveObject)Shotgun).m_hand.Input)).Pos); } m_boltZ_heldTarget = ((Component)Shotgun).transform.InverseTransformPoint(closestValidPoint).z; } float num2 = m_boltZ_current; float boltZ_current = m_boltZ_current; if (flag && !m_isHandleLocked) { boltZ_current = m_boltZ_heldTarget; num2 = Mathf.MoveTowards(m_boltZ_current, boltZ_current, Speed_Held * Time.deltaTime); } if (Mathf.Abs(num2 - m_boltZ_current) > Mathf.Epsilon) { m_boltZ_current = num2; ((Component)this).transform.localPosition = new Vector3(((Component)this).transform.localPosition.x, ((Component)this).transform.localPosition.y, m_boltZ_current); } BoltPos curPos = CurPos; curPos = ((Mathf.Abs(m_boltZ_current - m_boltZ_forward) < 0.001f) ? ((BoltPos)0) : ((Mathf.Abs(m_boltZ_current - m_boltZ_lock) < 0.001f) ? ((BoltPos)2) : ((Mathf.Abs(m_boltZ_current - m_boltZ_rear) < 0.001f) ? ((BoltPos)4) : ((!(m_boltZ_current > m_boltZ_lock)) ? ((BoltPos)3) : ((BoltPos)1))))); int num3 = (int)CurPos; CurPos = (BoltPos)Mathf.Clamp((int)curPos, num3 - 1, num3 + 1); if ((int)CurPos == 0 && (int)LastPos != 0) { BoltEvent_ArriveAtFore(); } else if ((int)CurPos == 4 && (int)LastPos != 4) { BoltEvent_SmackRear(); } LastPos = CurPos; } private void BoltEvent_ArriveAtFore() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)Shotgun.Mode == 0) { if (Shotgun.IsHammerCocked) { LockHandle(); } if (Shotgun.Chamber.IsFull || Shotgun.HasExtractedRound()) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)11, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)40, 1f); } } } private void BoltEvent_SmackRear() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) if ((int)Shotgun.Mode == 0) { if (Shotgun.Chamber.IsFull || Shotgun.HasExtractedRound()) { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)10, 1f); } else { ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)41, 1f); } } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) Vector2 touchpadAxes = hand.Input.TouchpadAxes; bool flag = false; if (hand.IsInStreamlinedMode && hand.Input.BYButtonDown) { flag = true; } else if (hand.Input.TouchpadDown) { flag = true; } if (flag && (int)CurPos == 0 && Shotgun.CanModeSwitch) { Shotgun.ToggleMode(); } ((FVRAlternateGrip)this).UpdateInteraction(hand); } } public class TubeFedShotgunAutoModeSwitch : MonoBehaviour { public TubeFedShotgun Gun; public bool IsMagFed = false; private void Start() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Invalid comparison between Unknown and I4 if ((int)Gun.Mode == 1) { ModeSwap(); } } private void Update() { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Invalid comparison between Unknown and I4 //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Invalid comparison between Unknown and I4 //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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) if (!IsMagFed) { if ((int)Gun.Mode == 1 && !Gun.Chamber.IsFull && (int)Gun.Bolt.CurPos == 0) { ModeSwap(); } if ((int)Gun.Mode == 0 && Gun.Chamber.IsFull && (int)Gun.Bolt.CurPos == 0) { ModeSwap(); } } else { if ((int)Gun.Mode == 1 && (int)Gun.Bolt.CurPos == 0 && !Gun.Chamber.IsFull && ((Object)(object)((FVRFireArm)Gun).Magazine == (Object)null || ((Object)(object)((FVRFireArm)Gun).Magazine != (Object)null && !((FVRFireArm)Gun).Magazine.HasARound()))) { ModeSwap(); } if ((int)Gun.Mode == 0 && Gun.Chamber.IsFull && (int)Gun.Bolt.CurPos == 0) { ModeSwap(); } } } private void ModeSwap() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if ((int)Gun.Mode == 0) { Gun.Mode = (ShotgunMode)1; if (Gun.HasHandle) { Gun.Handle.LockHandle(); } } else { Gun.Mode = (ShotgunMode)0; if (Gun.HasHandle) { Gun.Handle.UnlockHandle(); } } } } public class TubeFedShotgunFakeAutoMagSwitcher : MonoBehaviour { public enum MagState { LeftMag, RightMag } [Serializable] public class FauxMag { public Transform LowerPathForward; public Transform LowerPathRearward; public Transform TrigPoint; } public FVRFireArmMagazine Magazine; public TubeFedShotgun Shotgun; public FVRFireArmMagazineReloadTrigger Trig; public Transform Switch; public List FauxMags; public MagState CurState; private void Update() { if ((float)Magazine.m_numRounds < 8f) { CurState = MagState.RightMag; } else { CurState = MagState.LeftMag; } UpdateState(); } private void UpdateState() { //IL_0029: 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_0075: 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_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) if (CurState == MagState.LeftMag) { Shotgun.RoundPos_LowerPath_Forward.position = FauxMags[0].LowerPathForward.position; Shotgun.RoundPos_LowerPath_Rearward.position = FauxMags[0].LowerPathRearward.position; ((Component)Trig).transform.position = FauxMags[0].TrigPoint.position; ((Component)Switch).transform.localEulerAngles = new Vector3(0f, 0f, 16f); } else if (CurState == MagState.RightMag) { Shotgun.RoundPos_LowerPath_Forward.position = FauxMags[1].LowerPathForward.position; Shotgun.RoundPos_LowerPath_Rearward.position = FauxMags[1].LowerPathRearward.position; ((Component)Trig).transform.position = FauxMags[1].TrigPoint.position; ((Component)Switch).transform.localEulerAngles = new Vector3(0f, 0f, -16f); } } } public class TubeFedShotgunFireSelector : MonoBehaviour { public TubeFedShotgun Shotgun; public Transform Switch; public Vector3 RotSemi; public Vector3 RotAuto; private bool isFullAuto = false; private void Update() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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) FVRViveHand hand = ((FVRInteractiveObject)Shotgun).m_hand; if (!((Object)(object)hand == (Object)null)) { Vector2 touchpadAxes = hand.Input.TouchpadAxes; if ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (hand.Input.TouchpadDown && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.left) <= 45f)) { SwapMode(); } } } public void SwapMode() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) ((FVRFireArm)Shotgun).PlayAudioEvent((FirearmAudioEventType)14, 1f); isFullAuto = !isFullAuto; Shotgun.UsesSlamFireTrigger = isFullAuto; if (isFullAuto) { Switch.localEulerAngles = RotAuto; } else { Switch.localEulerAngles = RotSemi; } } } public class TubeFedShotgunMagazineCutoff : MonoBehaviour { public TubeFedShotgun Shotgun; public Transform Button; public Vector2 ButtonLocalY; private FVRViveHand Hand; private void Update() { //IL_003f: 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_00c1: 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_0091: Unknown result type (might be due to invalid IL or missing references) Hand = ((FVRInteractiveObject)Shotgun.Handle).m_hand; if ((Object)(object)Hand == (Object)null) { ResetButton(); return; } Vector2 touchpadAxes = Hand.Input.TouchpadAxes; if ((Hand.IsInStreamlinedMode && Hand.Input.AXButtonPressed) || (Hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.down) <= 45f)) { Button.localPosition = new Vector3(0f, ButtonLocalY.y, 0f); ((FVRFireArm)Shotgun).Magazine.IsExtractable = false; } else { ResetButton(); } } public void ResetButton() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) Button.localPosition = new Vector3(0f, ButtonLocalY.x, 0f); ((FVRFireArm)Shotgun).Magazine.IsExtractable = true; } } public class TubeFedShotgunVisualForeRelease : MonoBehaviour { public TubeFedShotgun Shotgun; public Transform ForeRelease; public Vector2 Angles; public bool IsYMove = false; public Vector2 PosUnpressedPressed; private FVRViveHand Hand; private void Update() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) Hand = ((FVRInteractiveObject)Shotgun).m_hand; if ((Object)(object)Hand == (Object)null) { return; } Vector2 touchpadAxes = Hand.Input.TouchpadAxes; if ((Hand.IsInStreamlinedMode && Hand.Input.AXButtonPressed) || (Hand.Input.TouchpadPressed && ((Vector2)(ref touchpadAxes)).magnitude > 0.2f && Vector2.Angle(touchpadAxes, Vector2.up) <= 45f)) { if (!IsYMove) { ForeRelease.localEulerAngles = new Vector3(Angles.y, 0f, 0f); } else { ForeRelease.localPosition = new Vector3(0f, PosUnpressedPressed.y, 0f); } } else if (!IsYMove) { ForeRelease.localEulerAngles = new Vector3(Angles.x, 0f, 0f); } else { ForeRelease.localPosition = new Vector3(0f, PosUnpressedPressed.x, 0f); } } } public class TurretSelfDestruct : MonoBehaviour { private float TurretTimeAlive = 0f; public AutoMeater Turret; public Transform SmokeParticleSystem; public float MaxLifetime = 10f; public float LifetimeToStartSmoking = 5f; private void Update() { if (TurretTimeAlive < MaxLifetime) { TurretTimeAlive += Time.deltaTime; } if ((Object)(object)SmokeParticleSystem != (Object)null) { ((Component)SmokeParticleSystem).gameObject.SetActive(TurretTimeAlive >= LifetimeToStartSmoking); } if (TurretTimeAlive >= MaxLifetime && (Object)(object)Turret != (Object)null) { Turret.KillMe(); } } } public class TurretSpinnyBarrels : MonoBehaviour { public GameObject SpinnyThing; public float SpinRate; public float SpinRateSameAsAbove; public dirType DirectionOfSpin; public AutoMeater Turret; public float FiringSpinRate; public AudioSource SpinningSounds; public AudioEvent StopSpinningSounds; private AutoMeaterState previousState; public void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) previousState = Turret.m_state; } public void FixedUpdate() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_0025: 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_0037: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 //IL_0098: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Invalid comparison between Unknown and I4 //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Invalid comparison between Unknown and I4 //IL_00f7: 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_00df: Invalid comparison between Unknown and I4 Vector3 zero = Vector3.zero; ((Vector3)(ref zero))[(int)DirectionOfSpin] = SpinRate; SpinnyThing.transform.Rotate(zero); if ((int)Turret.m_state == 2 || (int)Turret.m_state == 3) { SpinRate = FiringSpinRate; if (previousState != Turret.m_state) { SpinningSounds.Play(); } } else { SpinRate = SpinRateSameAsAbove; if (previousState != Turret.m_state) { SpinningSounds.Stop(); } } if ((int)Turret.m_state == 1 && ((int)previousState == 2 || (int)previousState == 3)) { SM.PlayCoreSound((FVRPooledAudioType)0, StopSpinningSounds, SpinnyThing.transform.position); } previousState = Turret.m_state; } } }