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<BreakActionSpeedloaderInsertTrigger>() != (Object)null))
{
return;
}
BreakActionSpeedloaderInsertTrigger component = ((Component)collider).gameObject.GetComponent<BreakActionSpeedloaderInsertTrigger>();
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<GameObject> 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<FVRInteractiveObject>();
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<FixedJoint>();
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<GameObject>(SpawnOnSplode[k], ((Component)this).transform.position, Quaternion.identity);
Explosion component2 = val3.GetComponent<Explosion>();
if ((Object)(object)component2 != (Object)null)
{
component2.IFF = IFF;
}
ExplosionSound component3 = val3.GetComponent<ExplosionSound>();
if ((Object)(object)component3 != (Object)null)
{
component3.IFF = IFF;
}
GrenadeExplosion component4 = val3.GetComponent<GrenadeExplosion>();
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<GameObject>(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<BreakableGlass>() != (Object)null || (Object)(object)collision.gameObject.GetComponent<PinnedGrenade>() != (Object)null || (Object)(object)collision.gameObject.GetComponent<PinnedGrenadePin>() != (Object)null || (Object)(object)collision.gameObject.GetComponent<SosigWeapon>() != (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<CSGDestroyNotifier>();
if ((Object)(object)cSGDestroyNotifier == (Object)null)
{
cSGDestroyNotifier = parentObject.AddComponent<CSGDestroyNotifier>();
}
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<FixedJoint>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
FixedJoint val2 = ((Component)this).gameObject.AddComponent<FixedJoint>();
((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<CSGDestroyNotifier>();
if ((Object)(object)component != (Object)null)
{
component.OnDestroyed -= OnDestroyUnstickGrenade;
}
parentObject = null;
}
FixedJoint component2 = ((Component)this).GetComponent<FixedJoint>();
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<CSGDestroyNotifier>();
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<GameObject>(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 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 =