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 FistVR;
using HarmonyLib;
using OtherLoader;
using UnityEngine;
using UnityEngine.Audio;
[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 BitWizrd.HuntAltarBoy
{
[BepInProcess("h3vr.exe")]
[BepInPlugin("BitWizrd.HuntAltarBoy", "HuntAltarBoy", "1.0.1")]
[BepInDependency("h3vr.otherloader", "1.3.0")]
[Description("Built with MeatKit")]
public class HuntAltarBoyPlugin : BaseUnityPlugin
{
private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
internal static ManualLogSource Logger;
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
LoadAssets();
}
private void LoadAssets()
{
Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "BitWizrd.HuntAltarBoy");
OtherLoader.RegisterDirectLoad(BasePath, "BitWizrd.HuntAltarBoy", "", "altar boy", "", "");
}
}
}
public class BloodBondSR : MonoBehaviour
{
private void Awake()
{
string name = "Ammo_69_CashMoney_D100(Clone)";
((Object)((Component)this).gameObject).name = name;
Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
((Object)((Component)componentsInChildren[i]).gameObject).name = name;
}
}
}
public class CooldownSound : MonoBehaviour
{
public ClosedBoltWeapon weapon;
public AudioClip[] audioClips;
public float volume = 1f;
public int minShots = 5;
public int maxShots = 10;
public float minDelay = 0.5f;
public float maxDelay = 2f;
public float resetTime = 1.5f;
private AudioSource audioSource;
private int shotCounter = 0;
private float lastShotTime;
private bool lastRoundSpent;
private int nextShotThreshold;
private bool isPlayingSound = false;
private void Start()
{
if ((Object)(object)weapon == (Object)null)
{
weapon = ((Component)this).GetComponent<ClosedBoltWeapon>();
}
if ((Object)(object)weapon == (Object)null)
{
Debug.LogError((object)"CooldownSound: Weapon reference is missing. Attach this script to a ClosedBoltWeapon.");
return;
}
audioSource = ((Component)weapon).gameObject.GetComponent<AudioSource>();
if ((Object)(object)audioSource == (Object)null)
{
audioSource = ((Component)weapon).gameObject.AddComponent<AudioSource>();
}
audioSource.spatialBlend = 1f;
audioSource.playOnAwake = false;
audioSource.rolloffMode = (AudioRolloffMode)0;
lastRoundSpent = weapon.Chamber.IsSpent;
SetNewShotThreshold();
}
private void Update()
{
DetectFiring();
}
private void DetectFiring()
{
if (weapon.Chamber.IsFull && weapon.Chamber.IsSpent && !lastRoundSpent)
{
OnWeaponFired();
}
lastRoundSpent = weapon.Chamber.IsSpent;
}
private void OnWeaponFired()
{
float num = Time.time - lastShotTime;
if (num > resetTime)
{
shotCounter = 0;
SetNewShotThreshold();
}
shotCounter++;
lastShotTime = Time.time;
if (shotCounter >= nextShotThreshold)
{
((MonoBehaviour)this).StartCoroutine(PlaySoundWithDelay());
shotCounter = 0;
SetNewShotThreshold();
}
}
private IEnumerator PlaySoundWithDelay()
{
if (!isPlayingSound)
{
isPlayingSound = true;
float delay = Random.Range(minDelay, maxDelay);
yield return (object)new WaitForSeconds(delay);
if (audioClips.Length > 0)
{
int index = Random.Range(0, audioClips.Length);
audioSource.clip = audioClips[index];
audioSource.PlayOneShot(audioSource.clip, volume);
yield return (object)new WaitForSeconds(audioSource.clip.length);
}
isPlayingSound = false;
}
}
private void SetNewShotThreshold()
{
nextShotThreshold = Random.Range(minShots, maxShots + 1);
}
}
public class CustomWaggleJoint : MonoBehaviour
{
public float distanceLimit = 0.25f;
public float angleLimitLeft = 45f;
public float angleLimitRight = 45f;
public float gravityScale = 1f;
public bool useSpring;
public float springApproachRate = 0.95f;
public float damping;
public Transform hingeGraphic;
public Vector3 hingeGraphicRotationOffset;
public bool invertWaggleAxis;
public bool ManualExecution;
public float onHitLimitCooldown = 0.05f;
public Vector3 waggleAxis = Vector3.up;
public Vector3 rotationAxis = Vector3.up;
[Header("Gizmo Options")]
public bool debugGizmos = false;
public bool showRotationExtremes = false;
public bool showRotationDirectionArrows = false;
private Vector3 particlePos;
private Vector3 particleVel;
private bool leftCatchState;
private bool rightCatchState;
private float lastTouchTime = float.MinValue;
private Vector3 EffectiveWaggleDir()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
return ((Component)this).transform.TransformDirection((!invertWaggleAxis) ? waggleAxis : (-waggleAxis));
}
private void GetEffectiveAngleLimits(out float effectiveAngleMin, out float effectiveAngleMax)
{
if (invertWaggleAxis)
{
effectiveAngleMin = 0f - angleLimitLeft;
effectiveAngleMax = angleLimitRight;
}
else
{
effectiveAngleMin = 0f - angleLimitRight;
effectiveAngleMax = angleLimitLeft;
}
}
public void ResetParticlePos()
{
//IL_0008: 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_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_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)
particlePos = ((Component)this).transform.position + EffectiveWaggleDir() * distanceLimit;
particleVel = Vector3.zero;
}
private void OnHitLimit(float angularVelocity)
{
}
public void Execute()
{
//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_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_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: 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_00d6: 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_00e4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: 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_0101: 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_0092: 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_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_013c: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Unknown result type (might be due to invalid IL or missing references)
float deltaTime = Time.deltaTime;
Transform transform = ((Component)this).transform;
Vector3 val = Physics.gravity * gravityScale;
Vector3 val2 = particlePos;
Vector3 val3 = particleVel * Mathf.Pow(1f - damping, deltaTime) + val * deltaTime;
Vector3 val4 = val2 + val3 * deltaTime;
Vector3 val5 = transform.TransformDirection(((Vector3)(ref rotationAxis)).normalized);
Vector3 val6 = EffectiveWaggleDir();
Vector3 position = transform.position;
if (useSpring)
{
val4 = Vector3.Lerp(val4, position + val6 * distanceLimit, 1f - Mathf.Pow(1f - springApproachRate, deltaTime));
}
GetEffectiveAngleLimits(out var effectiveAngleMin, out var effectiveAngleMax);
particlePos = ProjectOnHinge(val4, position, val5, val6, distanceLimit, effectiveAngleMin, effectiveAngleMax);
particleVel = (particlePos - val2) / deltaTime;
if ((Object)(object)hingeGraphic != (Object)null)
{
hingeGraphic.rotation = Quaternion.LookRotation(particlePos - transform.position, val5) * Quaternion.Euler(hingeGraphicRotationOffset);
}
}
private Vector3 ProjectOnHinge(Vector3 point, Vector3 hingePivot, Vector3 hingeAxis, Vector3 hingeDirection, float distanceLimit, float angleMin, float angleMax)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0004: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: 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_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_003b: Unknown result type (might be due to invalid IL or missing references)
float num = ToHingeAngle(point, hingePivot, hingeAxis, hingeDirection);
num = Mathf.Clamp(num, angleMin, angleMax);
Vector3 val = Quaternion.AngleAxis(num, hingeAxis) * hingeDirection;
return val * distanceLimit + hingePivot;
}
private float ToHingeAngle(Vector3 point, Vector3 hingePivot, Vector3 hingeAxis, Vector3 hingeDirection)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = point - hingePivot;
Vector3 val2 = Vector3.ProjectOnPlane(val, hingeAxis);
Vector3 normalized = ((Vector3)(ref val2)).normalized;
return SignedAngle(hingeDirection, normalized, hingeAxis);
}
private float SignedAngle(Vector3 from, Vector3 to, Vector3 axis)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
float num = Vector3.Angle(from, to);
return num * Mathf.Sign(Vector3.Dot(axis, Vector3.Cross(from, to)));
}
private void Start()
{
ResetParticlePos();
}
private void Update()
{
if (!ManualExecution)
{
Execute();
}
}
}
public class GunStockLace : MonoBehaviour
{
public float length = 0.5f;
public float gravity = 9.81f;
public float damping = 0.05f;
public float maxDeviationAngle = 45f;
public LayerMask collisionMask;
public bool showGizmos = false;
private Vector3 pendulumDirection;
private Vector3 angularVelocity;
private Quaternion baseRotation;
private Vector3 restDirection;
private Vector3 previousPosition;
private void Start()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_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_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
baseRotation = ((Component)this).transform.rotation;
restDirection = baseRotation * -Vector3.up;
pendulumDirection = restDirection;
previousPosition = ((Component)this).transform.position;
}
private void FixedUpdate()
{
//IL_0007: 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_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: 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)
//IL_0061: 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_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0101: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = ((Component)this).transform.position - previousPosition;
previousPosition = ((Component)this).transform.position;
float fixedDeltaTime = Time.fixedDeltaTime;
Vector3 val2 = Vector3.Cross(((Vector3)(ref pendulumDirection)).normalized, Vector3.down) * gravity / length;
Vector3 val3 = val * 10f / fixedDeltaTime;
angularVelocity += (val2 + val3) * fixedDeltaTime;
angularVelocity *= Mathf.Clamp01(1f - damping * fixedDeltaTime);
Quaternion val4 = Quaternion.Euler(angularVelocity * fixedDeltaTime * 57.29578f);
pendulumDirection = val4 * pendulumDirection;
HandleCollisionLimits();
ClampToMaxAngle();
((Component)this).transform.rotation = Quaternion.FromToRotation(-Vector3.up, pendulumDirection) * baseRotation;
}
private void HandleCollisionLimits()
{
//IL_0007: 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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_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_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
RaycastHit val = default(RaycastHit);
if (Physics.Raycast(((Component)this).transform.position, pendulumDirection, ref val, length, LayerMask.op_Implicit(collisionMask)))
{
Vector3 normal = ((RaycastHit)(ref val)).normal;
Vector3 val2 = Vector3.ProjectOnPlane(pendulumDirection, normal);
Vector3 normalized = ((Vector3)(ref val2)).normalized;
float num = Vector3.Angle(pendulumDirection, normalized);
pendulumDirection = Vector3.RotateTowards(pendulumDirection, normalized, num * ((float)Math.PI / 180f), 0f);
angularVelocity = Vector3.ProjectOnPlane(angularVelocity, normal);
}
}
private void ClampToMaxAngle()
{
//IL_0002: 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_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: 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)
float num = Vector3.Angle(restDirection, pendulumDirection);
if (num > maxDeviationAngle)
{
pendulumDirection = Vector3.RotateTowards(restDirection, pendulumDirection, maxDeviationAngle * ((float)Math.PI / 180f), 0f);
angularVelocity *= 0.5f;
}
}
private void OnDrawGizmos()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
if (showGizmos)
{
Gizmos.color = Color.yellow;
Gizmos.DrawLine(((Component)this).transform.position, ((Component)this).transform.position + pendulumDirection * length);
Gizmos.color = Color.red;
Gizmos.DrawWireSphere(((Component)this).transform.position + pendulumDirection * length, 0.02f);
}
}
}
public class HuntDollarSR : MonoBehaviour
{
private IEnumerator Start()
{
yield return (object)new WaitForSeconds(3f);
string str = "CharcoalBriquette(Clone)";
((Object)((Component)this).gameObject).name = str;
Collider[] componentsInChildren = ((Component)this).GetComponentsInChildren<Collider>(true);
for (int i = 0; i < componentsInChildren.Length; i++)
{
Component val = (Component)(object)componentsInChildren[i];
((Object)val.gameObject).name = str;
}
}
}
namespace BitWizrd.LebelRifle
{
public class Lebel : FVRFireArm
{
public enum ZPos
{
Forward,
Middle,
Rear
}
public enum HammerCockType
{
OnBack,
OnUp,
OnClose,
OnForward
}
public enum FireSelectorModeType
{
Safe,
Single
}
public enum LifterState
{
Down,
Up
}
[Serializable]
public class FireSelectorMode
{
public float SelectorPosition;
public FireSelectorModeType ModeType;
public bool IsBoltLocked;
}
[Header("Bolt Action Config")]
public FVRFireArmChamber Chamber;
public bool HasMagEjectionButton = true;
public bool HasFireSelectorButton = true;
public Lebel_Handle BoltHandle;
public float BoltLerp;
public bool BoltMovingForward;
public Lebel_Handle.BoltActionHandleState CurBoltHandleState;
public Lebel_Handle.BoltActionHandleState LastBoltHandleState;
[Header("Hammer Config")]
public bool HasVisualHammer;
public Transform Hammer;
public float HammerUncocked;
public float HammerCocked;
private bool m_isHammerCocked;
public HammerCockType CockType;
private FVRFirearmMovingProxyRound m_proxy;
[Header("Round Positions Config")]
public Transform Extraction_MagazinePos;
public Transform Extraction_ChamberPos;
public Transform Extraction_Ejecting;
public Transform EjectionPos;
public Transform ManualChamberingPos;
public float UpwardEjectionForce;
public float RightwardEjectionForce = 2f;
public float YSpinEjectionTorque = 80f;
public Transform Muzzle;
public GameObject ReloadTriggerWell;
[Header("Trigger Config")]
public float TriggerResetThreshold = 0.1f;
public float TriggerFiringThreshold = 0.8f;
public bool FireOnTriggerDown = false;
private float m_triggerFloat;
private bool m_hasTriggerCycled;
public Transform Trigger_Display;
public float Trigger_ForwardValue;
public float Trigger_RearwardValue;
public InterpStyle TriggerInterpStyle = (InterpStyle)1;
public Transform Trigger_Display2;
public float Trigger_ForwardValue2;
public float Trigger_RearwardValue2;
public InterpStyle TriggerInterpStyle2 = (InterpStyle)1;
[Header("Magazine Release Config")]
private bool m_isMagReleasePressed;
public Transform MagReleaseButton_Display;
public Axis MagReleaseAxis;
public InterpStyle MagReleaseInterpStyle = (InterpStyle)1;
public float MagReleasePressedValue;
public float MagReleaseUnpressedValue;
private float m_magReleaseCurValue;
private float m_magReleaseTarValue;
[Header("Fire Selector Config")]
private Vector2 TouchPadAxes = Vector2.zero;
public Transform FireSelector_Display;
public Axis FireSelector_Axis;
public InterpStyle FireSelector_InterpStyle = (InterpStyle)1;
public FireSelectorMode[] FireSelector_Modes;
private int m_fireSelectorMode;
public bool RequiresHammerUncockedToToggleFireSelector;
public bool UsesSecondFireSelectorChange;
public Transform FireSelector_Display_Secondary;
public Axis FireSelector_Axis_Secondary;
public InterpStyle FireSelector_InterpStyle_Secondary = (InterpStyle)1;
public FireSelectorMode[] FireSelector_Modes_Secondary;
[Header("Special Features")]
public bool EjectsMagazineOnEmpty;
public bool PlaysExtraTailOnShot;
public FVRTailSoundClass ExtraTail = (FVRTailSoundClass)8;
[Header("Reciprocating Barrel")]
public bool HasReciprocatingBarrel;
public G11RecoilingSystem RecoilSystem;
private bool m_isQuickboltTouching;
private Vector2 lastTPTouchPoint = Vector2.zero;
[Header("Lifter Config")]
public LebelLifter LifterComponent;
public float LifterUpRotation;
public float LifterDownRotation;
public float LifterLerpSpeed = 10f;
public float MinBoltTravelDistance = 0.1f;
public float LifterInteractionDistance = 0.1f;
public float LifterHapticStrength = 0.5f;
public float LifterHapticFrequency = 0.1f;
public float LifterMovementThreshold = 0.01f;
public Collider LifterTriggerCollider;
public float LifterHapticIntensityMultiplier = 1f;
public bool HasLifterLock = true;
[Header("Lifter Lock Config")]
public Transform LifterLockSwitch;
public Transform LifterLockMechanism;
public float LifterLockSwitchLockedPosition;
public float LifterLockSwitchUnlockedPosition;
public float LifterLockMechanismLockedRotation;
public float LifterLockMechanismUnlockedRotation;
private float m_lifterLockSwitchLerp = 0f;
public FVRFirearmMovingProxyRound lifterProxy;
private bool m_readyToExtractRound = false;
private bool m_lifterHasCycledSinceEmpty = false;
private bool m_lifterNeedsRaiseAfterLoad = false;
private bool m_lifterNeedsLowerAfterRaise = false;
private bool m_wasMagazineEmpty = true;
private bool m_needsLifterCycle = false;
private bool m_lifterProxyDisabledAfterChambering = false;
public bool m_magazineFullPlusOne = false;
public bool m_boltLockedDown = false;
private bool m_wasManuallyChambered = false;
private bool m_wasLifterUpWhenChambered = false;
private Lebel_Handle.BoltActionHandleRot m_lastHandleRot;
[Header("Magazine Config")]
public FVRFireArmMagazineReloadTrigger MagazineReloadTrigger;
public bool IsHammerCocked => m_isHammerCocked;
public FVRFirearmMovingProxyRound Proxy => m_proxy;
public FVRFirearmMovingProxyRound ProxyRound => m_proxy;
public bool HasExtractedRound()
{
return m_proxy.IsFull;
}
public override void Awake()
{
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Expected O, but got Unknown
((FVRFireArm)this).Awake();
base.FChambers.Add(Chamber);
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.ResetTracking();
}
if (base.UsesClips && (Object)(object)base.ClipTrigger != (Object)null)
{
if (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Rear)
{
if (!base.ClipTrigger.activeSelf)
{
base.ClipTrigger.SetActive(true);
}
}
else if (base.ClipTrigger.activeSelf)
{
base.ClipTrigger.SetActive(false);
}
}
GameObject val = new GameObject("m_proxyRound");
m_proxy = val.AddComponent<FVRFirearmMovingProxyRound>();
m_proxy.Init(((Component)this).transform);
m_lastHandleRot = (((Object)(object)BoltHandle != (Object)null) ? BoltHandle.HandleRot : Lebel_Handle.BoltActionHandleRot.Up);
}
public bool CanBoltMove()
{
if (FireSelector_Modes.Length < 1)
{
return true;
}
if (FireSelector_Modes[m_fireSelectorMode].IsBoltLocked)
{
return false;
}
return true;
}
public override int GetTutorialState()
{
if (FireSelector_Modes[m_fireSelectorMode].ModeType == FireSelectorModeType.Safe)
{
return 4;
}
if (Chamber.IsFull)
{
if (Chamber.IsSpent)
{
return 0;
}
if ((Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null)
{
return 6;
}
return 5;
}
if ((Object)(object)base.Magazine != (Object)null && !base.Magazine.HasARound())
{
if (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Forward || CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Mid)
{
return 0;
}
if ((Object)(object)base.Clip != (Object)null)
{
return 2;
}
if (!base.Magazine.IsFull())
{
return 1;
}
return 3;
}
return 3;
}
public override void BeginInteraction(FVRViveHand hand)
{
((FVRFireArm)this).BeginInteraction(hand);
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_024b: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_0267: Invalid comparison between Unknown and I4
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0226: Unknown result type (might be due to invalid IL or missing references)
//IL_035c: Unknown result type (might be due to invalid IL or missing references)
//IL_0361: Unknown result type (might be due to invalid IL or missing references)
//IL_031b: Unknown result type (might be due to invalid IL or missing references)
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
//IL_039f: Unknown result type (might be due to invalid IL or missing references)
//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
//IL_0616: Unknown result type (might be due to invalid IL or missing references)
//IL_061b: Unknown result type (might be due to invalid IL or missing references)
//IL_054a: Unknown result type (might be due to invalid IL or missing references)
//IL_054f: Unknown result type (might be due to invalid IL or missing references)
//IL_0498: Unknown result type (might be due to invalid IL or missing references)
//IL_049d: Unknown result type (might be due to invalid IL or missing references)
//IL_0539: Unknown result type (might be due to invalid IL or missing references)
//IL_053e: Unknown result type (might be due to invalid IL or missing references)
//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
//IL_04be: Unknown result type (might be due to invalid IL or missing references)
//IL_04c3: Unknown result type (might be due to invalid IL or missing references)
//IL_056b: Unknown result type (might be due to invalid IL or missing references)
//IL_057b: Unknown result type (might be due to invalid IL or missing references)
//IL_05a0: Unknown result type (might be due to invalid IL or missing references)
//IL_05a5: Unknown result type (might be due to invalid IL or missing references)
//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
//IL_05af: Unknown result type (might be due to invalid IL or missing references)
//IL_052c: Unknown result type (might be due to invalid IL or missing references)
//IL_052d: Unknown result type (might be due to invalid IL or missing references)
//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
//IL_04ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0505: Unknown result type (might be due to invalid IL or missing references)
((FVRPhysicalObject)this).UpdateInteraction(hand);
TouchPadAxes = hand.Input.TouchpadAxes;
if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && !((FVRPhysicalObject)this).IsAltHeld)
{
m_triggerFloat = hand.Input.TriggerFloat;
}
if (!m_hasTriggerCycled)
{
if (m_triggerFloat >= TriggerFiringThreshold)
{
m_hasTriggerCycled = true;
}
}
else if (m_triggerFloat <= TriggerResetThreshold)
{
m_hasTriggerCycled = false;
}
m_isMagReleasePressed = false;
bool flag = false;
bool flag2 = false;
bool flag3 = false;
if (hand.IsInStreamlinedMode)
{
if (HasFireSelectorButton && hand.Input.BYButtonDown)
{
ToggleFireSelector();
if (HasLifterLock)
{
ToggleLifterLock();
}
}
if (HasMagEjectionButton && hand.Input.AXButtonPressed && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
{
m_isMagReleasePressed = true;
}
if (HasMagEjectionButton && hand.Input.AXButtonDown && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)
{
ReleaseMag();
}
flag3 = true;
if ((Object)(object)((FVRPhysicalObject)this).Bipod != (Object)null && ((FVRPhysicalObject)this).Bipod.IsBipodActive)
{
flag3 = false;
}
if (!CanBoltMove())
{
flag2 = false;
flag3 = false;
}
if (flag3 && !((FVRPhysicalObject)this).IsAltHeld && (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null && ((FVRInteractiveObject)((FVRPhysicalObject)this).AltGrip).m_hasTriggeredUpSinceBegin && ((FVRInteractiveObject)((FVRPhysicalObject)this).AltGrip).IsHeld && ((FVRInteractiveObject)((FVRPhysicalObject)this).AltGrip).m_hand.Input.BYButtonDown && BoltHandle.UsesQuickRelease && BoltHandle.HandleState == Lebel_Handle.BoltActionHandleState.Forward)
{
flag = true;
}
}
else
{
if (HasMagEjectionButton && hand.Input.TouchpadPressed && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && ((Vector2)(ref TouchPadAxes)).magnitude > 0.3f && Vector2.Angle(TouchPadAxes, Vector2.down) <= 45f)
{
m_isMagReleasePressed = true;
}
if ((int)GM.Options.QuickbeltOptions.BoltActionModeSetting == 0)
{
flag3 = true;
}
if ((int)GM.Options.QuickbeltOptions.BoltActionModeSetting == 1)
{
flag2 = true;
}
if (GM.Options.ControlOptions.UseGunRigMode2)
{
flag2 = true;
flag3 = true;
}
if ((Object)(object)((FVRPhysicalObject)this).Bipod != (Object)null && ((FVRPhysicalObject)this).Bipod.IsBipodActive)
{
flag2 = true;
flag3 = false;
}
if (!CanBoltMove())
{
flag2 = false;
flag3 = false;
}
if (IsHammerCocked && BoltHandle.HandleState == Lebel_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down)
{
flag2 = false;
}
if (hand.Input.TouchpadDown && ((Vector2)(ref TouchPadAxes)).magnitude > 0.1f)
{
if (flag3 && Vector2.Angle(TouchPadAxes, Vector2.right) <= 45f && BoltHandle.UsesQuickRelease && BoltHandle.HandleState == Lebel_Handle.BoltActionHandleState.Forward)
{
flag = true;
}
else if (Vector2.Angle(TouchPadAxes, Vector2.left) <= 45f)
{
if (HasFireSelectorButton)
{
ToggleFireSelector();
}
if (HasLifterLock)
{
ToggleLifterLock();
}
}
else if (Vector2.Angle(TouchPadAxes, Vector2.down) <= 45f && HasMagEjectionButton)
{
ReleaseMag();
}
}
}
if (m_isMagReleasePressed)
{
if ((Object)(object)ReloadTriggerWell != (Object)null)
{
ReloadTriggerWell.SetActive(false);
}
}
else if ((Object)(object)ReloadTriggerWell != (Object)null)
{
ReloadTriggerWell.SetActive(true);
}
if (((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && !flag && flag2)
{
if (((Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null && !((FVRPhysicalObject)this).IsAltHeld) || GM.Options.ControlOptions.UseGunRigMode2 || ((Object)(object)((FVRPhysicalObject)this).Bipod != (Object)null && ((FVRPhysicalObject)this).Bipod.IsBipodActive))
{
if (hand.Input.TouchpadTouched)
{
Vector2 touchpadAxes = hand.Input.TouchpadAxes;
if (((Vector2)(ref touchpadAxes)).magnitude > 0.1f)
{
bool isQuickboltTouching = m_isQuickboltTouching;
if (Vector2.Angle(touchpadAxes, Vector2.right + Vector2.up) < 90f && !m_isQuickboltTouching)
{
m_isQuickboltTouching = true;
}
if (m_isQuickboltTouching && isQuickboltTouching)
{
float sAngle = GetSAngle(touchpadAxes, lastTPTouchPoint, hand.CMode);
BoltHandle.DriveBolt((0f - sAngle) / 90f);
}
lastTPTouchPoint = touchpadAxes;
}
else
{
lastTPTouchPoint = Vector2.zero;
}
}
else
{
lastTPTouchPoint = Vector2.zero;
}
}
if (m_isQuickboltTouching)
{
Debug.DrawLine(BoltHandle.BoltActionHandleRoot.position, BoltHandle.BoltActionHandleRoot.position + 0.1f * new Vector3(lastTPTouchPoint.x, lastTPTouchPoint.y, 0f), Color.blue);
}
}
if (hand.Input.TouchpadTouchUp)
{
m_isQuickboltTouching = false;
lastTPTouchPoint = Vector2.zero;
}
FiringSystem();
((FVRPhysicalObject)this).UpdateInteraction(hand);
if (flag && !((FVRPhysicalObject)this).IsAltHeld && (Object)(object)((FVRPhysicalObject)this).AltGrip != (Object)null)
{
m_isQuickboltTouching = false;
lastTPTouchPoint = Vector2.zero;
hand.Buzz(hand.Buzzer.Buzz_BeginInteraction);
hand.HandMadeGrabReleaseSound();
hand.EndInteractionIfHeld((FVRInteractiveObject)(object)this);
((FVRInteractiveObject)this).EndInteraction(hand);
((FVRInteractiveObject)BoltHandle).BeginInteraction(hand);
hand.ForceSetInteractable((FVRInteractiveObject)(object)BoltHandle);
BoltHandle.TPInitiate();
}
}
private Vector3 GetClosestValidPoint(Vector3 start, Vector3 end, Vector3 point)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = end - start;
Vector3 val2 = point - start;
float magnitude = ((Vector3)(ref val)).magnitude;
Vector3 val3 = val / magnitude;
float num = Vector3.Dot(val2, val3);
num = Mathf.Clamp(num, 0f, magnitude);
return start + val3 * num;
}
public float GetSignedAngle(Vector2 from, Vector2 to)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = default(Vector2);
((Vector2)(ref val))..ctor(from.y, 0f - from.x);
Vector2 normalized = ((Vector2)(ref val)).normalized;
float num = Mathf.Sign(Vector2.Dot(from, normalized));
float num2 = Vector2.Angle(from, to);
return num2 * num;
}
private float GetSAngle(Vector2 v1, Vector2 v2, ControlMode m)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Invalid comparison between Unknown and I4
//IL_0048: 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)
if ((int)m == 3)
{
return (v1.y - v2.y) * 130f;
}
float num = Mathf.Sign(v1.x * v2.y - v1.y * v2.x);
return Vector2.Angle(v1, v2) * num;
}
public override void EndInteraction(FVRViveHand hand)
{
//IL_0022: 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)
m_triggerFloat = 0f;
m_hasTriggerCycled = false;
m_isMagReleasePressed = false;
m_isQuickboltTouching = false;
lastTPTouchPoint = Vector2.zero;
((FVRFireArm)this).EndInteraction(hand);
}
public void SetHasTriggeredUp()
{
((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin = true;
}
public void CockHammer()
{
if (!m_isHammerCocked)
{
m_isHammerCocked = true;
if (HasVisualHammer)
{
((FVRPhysicalObject)this).SetAnimatedComponent(Hammer, HammerCocked, (InterpStyle)0, (Axis)2);
}
}
}
public void DropHammer()
{
if (IsHammerCocked)
{
m_isHammerCocked = false;
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f);
Fire();
if (HasVisualHammer)
{
((FVRPhysicalObject)this).SetAnimatedComponent(Hammer, HammerUncocked, (InterpStyle)0, (Axis)2);
}
}
}
protected virtual void ToggleFireSelector()
{
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
if ((RequiresHammerUncockedToToggleFireSelector && IsHammerCocked) || ((FVRInteractiveObject)BoltHandle).IsHeld || CurBoltHandleState != 0 || BoltHandle.HandleRot != Lebel_Handle.BoltActionHandleRot.Down || FireSelector_Modes.Length <= 1)
{
return;
}
m_fireSelectorMode++;
if (m_fireSelectorMode >= FireSelector_Modes.Length)
{
m_fireSelectorMode -= FireSelector_Modes.Length;
}
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f);
if ((Object)(object)FireSelector_Display != (Object)null)
{
((FVRPhysicalObject)this).SetAnimatedComponent(FireSelector_Display, FireSelector_Modes[m_fireSelectorMode].SelectorPosition, FireSelector_InterpStyle, FireSelector_Axis);
if (UsesSecondFireSelectorChange)
{
((FVRPhysicalObject)this).SetAnimatedComponent(FireSelector_Display_Secondary, FireSelector_Modes_Secondary[m_fireSelectorMode].SelectorPosition, FireSelector_InterpStyle_Secondary, FireSelector_Axis_Secondary);
}
}
}
protected virtual void ToggleLifterLock()
{
if (!((FVRInteractiveObject)BoltHandle).IsHeld && CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Rear && (!Chamber.IsFull || !((Object)(object)LifterComponent != (Object)null) || LifterComponent.GetLifterState() != 0) && LifterComponent.HasLifterLock)
{
bool flag = !LifterComponent.IsLifterLocked();
LifterComponent.SetLifterLocked(flag);
if (flag && LifterComponent.GetLifterState() == LifterState.Down)
{
LifterComponent.SetLifterState(LifterState.Up);
}
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)15, 1f);
}
}
public void ReleaseMag()
{
if ((Object)(object)base.Magazine != (Object)null)
{
m_magReleaseCurValue = MagReleasePressedValue;
((FVRFireArm)this).EjectMag(false);
}
}
public FireSelectorMode GetFiringMode()
{
return FireSelector_Modes[m_fireSelectorMode];
}
protected virtual void FiringSystem()
{
bool flag = false;
if (FireOnTriggerDown)
{
flag = FireSelector_Modes[m_fireSelectorMode].ModeType != 0 && BoltHandle.HandleState == Lebel_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down && ((FVRInteractiveObject)this).m_hand.Input.TriggerDown && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && (!Chamber.IsFull || !Chamber.IsSpent);
}
else
{
if (!m_hasTriggerCycled)
{
if (m_triggerFloat >= TriggerFiringThreshold)
{
m_hasTriggerCycled = true;
}
}
else if (m_triggerFloat <= TriggerResetThreshold)
{
m_hasTriggerCycled = false;
}
flag = FireSelector_Modes[m_fireSelectorMode].ModeType != 0 && BoltHandle.HandleState == Lebel_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down && m_hasTriggerCycled && (!Chamber.IsFull || !Chamber.IsSpent);
}
if (flag)
{
DropHammer();
if (!FireOnTriggerDown)
{
m_hasTriggerCycled = true;
}
}
}
public bool Fire()
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
FireSelectorMode fireSelectorMode = FireSelector_Modes[m_fireSelectorMode];
if (!Chamber.Fire())
{
return false;
}
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.ResetTracking();
}
((FVRFireArm)this).Fire(Chamber, ((FVRFireArm)this).GetMuzzle(), true, 1f, -1f);
((FVRFireArm)this).FireMuzzleSmoke();
bool flag = ((FVRFireArm)this).IsTwoHandStabilized();
bool flag2 = ((FVRFireArm)this).IsForegripStabilized();
bool flag3 = ((FVRFireArm)this).IsShoulderStabilized();
((FVRFireArm)this).Recoil(flag, flag2, flag3, (FVRFireArmRecoilProfile)null, 1f);
FVRSoundEnvironment currentSoundEnvironment = GM.CurrentPlayerBody.GetCurrentSoundEnvironment();
((FVRFireArm)this).PlayAudioGunShot(Chamber.GetRound(), currentSoundEnvironment, 1f);
if (PlaysExtraTailOnShot)
{
AudioEvent tailSet = SM.GetTailSet(ExtraTail, currentSoundEnvironment);
base.m_pool_tail.PlayClipVolumePitchOverride(tailSet, ((Component)this).transform.position, tailSet.VolumeRange * 1f, base.AudioClipSet.TailPitchMod_Main * tailSet.PitchRange.x, (AudioMixerGroup)null);
}
if (HasReciprocatingBarrel)
{
RecoilSystem.Recoil(false);
}
return true;
}
public override void FVRUpdate()
{
((FVRFireArm)this).FVRUpdate();
UpdateChamberAccessibility();
}
public override void FVRFixedUpdate()
{
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
((FVRFireArm)this).FVRFixedUpdate();
CheckMagazineState();
UpdateComponentDisplay();
UpdateChamberAccessibility();
UpdateLifterProxyVisibility();
if ((Object)(object)BoltHandle != (Object)null)
{
if (BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down && m_lastHandleRot != Lebel_Handle.BoltActionHandleRot.Down && (Object)(object)LifterComponent != (Object)null && !LifterComponent.IsLifterLocked())
{
LifterComponent.SetLifterState(LifterState.Down);
}
m_lastHandleRot = BoltHandle.HandleRot;
}
if ((Object)(object)m_proxy != (Object)null && m_proxy.IsFull && (Object)(object)m_proxy.ProxyRound != (Object)null)
{
m_proxy.ProxyRound.position = Extraction_MagazinePos.position;
m_proxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
}
private void UpdateChamberAccessibility()
{
if ((Object)(object)Chamber == (Object)null)
{
return;
}
bool flag = (Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Up;
bool flag2 = !Chamber.IsFull;
bool flag3 = (Object)(object)base.Magazine == (Object)null || !base.Magazine.HasARound();
bool flag4 = (Object)(object)base.Magazine != (Object)null && base.Magazine.IsFull();
bool flag5 = !flag4;
bool flag6 = (Object)(object)LifterComponent != (Object)null && LifterComponent.IsLifterLocked();
bool flag7 = (Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Down;
bool flag8 = ((Object)(object)lifterProxy == (Object)null || !lifterProxy.IsFull) && flag;
bool flag9 = flag && flag2 && flag3;
bool flag10 = flag7 && flag2 && (flag4 || m_magazineFullPlusOne);
bool flag11 = flag6 && flag2;
bool flag12 = flag && flag2 && flag5;
bool flag13 = flag9 || flag10 || flag11 || flag8 || flag12;
Chamber.IsAccessible = flag13;
if (flag13)
{
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.SetFromMagazine(fromMagazine: false);
}
}
}
private void UpdateComponentDisplay()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Invalid comparison between Unknown and I4
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: 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_00ec: Invalid comparison between Unknown and I4
//IL_00d6: 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_0118: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: Invalid comparison between Unknown and I4
//IL_01d6: 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_0195: Invalid comparison between Unknown and I4
//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Invalid comparison between Unknown and I4
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)Trigger_Display != (Object)null)
{
if ((int)TriggerInterpStyle == 0)
{
Trigger_Display.localPosition = new Vector3(0f, 0f, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat));
}
else if ((int)TriggerInterpStyle == 1)
{
Trigger_Display.localEulerAngles = new Vector3(Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), 0f, 0f);
}
}
if ((Object)(object)Trigger_Display2 != (Object)null)
{
if ((int)TriggerInterpStyle2 == 0)
{
Trigger_Display2.localPosition = new Vector3(0f, 0f, Mathf.Lerp(Trigger_ForwardValue2, Trigger_RearwardValue2, m_triggerFloat));
}
else if ((int)TriggerInterpStyle2 == 1)
{
Trigger_Display2.localEulerAngles = new Vector3(Mathf.Lerp(Trigger_ForwardValue2, Trigger_RearwardValue2, m_triggerFloat), 0f, 0f);
}
}
if ((Object)(object)MagReleaseButton_Display != (Object)null)
{
Vector3 zero = Vector3.zero;
m_magReleaseTarValue = ((!m_isMagReleasePressed) ? MagReleaseUnpressedValue : MagReleasePressedValue);
m_magReleaseCurValue = Mathf.Lerp(m_magReleaseCurValue, m_magReleaseTarValue, Time.deltaTime * 4f);
Axis magReleaseAxis = MagReleaseAxis;
if ((int)magReleaseAxis != 0)
{
if ((int)magReleaseAxis != 1)
{
if ((int)magReleaseAxis == 2)
{
zero.z = m_magReleaseCurValue;
}
}
else
{
zero.y = m_magReleaseCurValue;
}
}
else
{
zero.x = m_magReleaseCurValue;
}
if ((int)MagReleaseInterpStyle == 0)
{
MagReleaseButton_Display.localPosition = zero;
}
else if ((int)MagReleaseInterpStyle == 1)
{
MagReleaseButton_Display.localEulerAngles = zero;
}
}
base.IsBreachOpenForGasOut = CurBoltHandleState != Lebel_Handle.BoltActionHandleState.Forward;
}
private void CheckMagazineState()
{
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)base.Magazine == (Object)null)
{
return;
}
if (!base.Magazine.HasARound())
{
m_needsLifterCycle = true;
}
if (base.Magazine.IsFull() && base.Magazine.HasARound() && !m_proxy.IsFull)
{
GameObject val = base.Magazine.RemoveRound(false);
if ((Object)(object)val != (Object)null)
{
m_proxy.SetFromPrefabReference(val);
m_proxy.IsFull = true;
m_proxy.UpdateProxyDisplay();
m_proxy.ProxyRound.position = Extraction_MagazinePos.position;
m_proxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
if (!m_magazineFullPlusOne)
{
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)28, 1f);
}
m_magazineFullPlusOne = true;
}
}
else if (m_magazineFullPlusOne && !m_proxy.IsFull)
{
m_magazineFullPlusOne = false;
}
if ((Object)(object)MagazineReloadTrigger != (Object)null)
{
((Component)MagazineReloadTrigger).gameObject.SetActive(!m_magazineFullPlusOne);
}
}
private void TryExtractFromMagazine()
{
//IL_0094: 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)
if (!m_needsLifterCycle)
{
if ((Object)(object)base.Magazine != (Object)null && base.Magazine.HasARound() && !m_proxy.IsFull && !Chamber.IsFull)
{
GameObject fromPrefabReference = base.Magazine.RemoveRound(false);
m_proxy.SetFromPrefabReference(fromPrefabReference);
m_proxy.IsFull = true;
m_proxy.UpdateProxyDisplay();
m_proxy.ProxyRound.position = Extraction_MagazinePos.position;
m_proxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
if (EjectsMagazineOnEmpty && (Object)(object)base.Magazine != (Object)null && !base.Magazine.HasARound())
{
((FVRFireArm)this).EjectMag(false);
}
}
}
public void NotifyLifterLowered()
{
if ((Object)(object)m_proxy.Round != (Object)null && CurBoltHandleState != 0 && (Object)(object)base.Magazine != (Object)null)
{
base.Magazine.AddRound(m_proxy.Round, true, true, false);
m_proxy.ClearProxy();
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)28, 1f);
}
}
public void NotifyLifterRaised()
{
}
public override List<FireArmRoundClass> GetChamberRoundList()
{
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
if (Chamber.IsFull && !Chamber.IsSpent)
{
List<FireArmRoundClass> list = new List<FireArmRoundClass>();
list.Add(Chamber.GetRound().RoundClass);
return list;
}
return null;
}
public override void SetLoadedChambers(List<FireArmRoundClass> rounds)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
if (rounds.Count > 0)
{
Chamber.Autochamber(rounds[0]);
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.ResetTracking();
}
}
}
public override void ConfigureFromFlagDic(Dictionary<string, string> f)
{
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
string key = "HammerState";
if (f.ContainsKey(key))
{
string text = f[key];
if (text == "Cocked")
{
m_isHammerCocked = true;
}
if (HasVisualHammer)
{
((FVRPhysicalObject)this).SetAnimatedComponent(Hammer, HammerCocked, (InterpStyle)0, (Axis)2);
}
}
if (FireSelector_Modes.Length > 1)
{
key = "FireSelectorState";
if (f.ContainsKey(key))
{
string text = f[key];
int.TryParse(text, out m_fireSelectorMode);
}
if ((Object)(object)FireSelector_Display != (Object)null)
{
((FVRPhysicalObject)this).SetAnimatedComponent(FireSelector_Display, FireSelector_Modes[m_fireSelectorMode].SelectorPosition, FireSelector_InterpStyle, FireSelector_Axis);
}
}
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.ResetTracking();
}
((FVRFireArm)this).ConfigureFromFlagDic(f);
}
public override Dictionary<string, string> GetFlagDic()
{
Dictionary<string, string> flagDic = ((FVRFireArm)this).GetFlagDic();
flagDic.Add("HammerState", (!m_isHammerCocked) ? "Uncocked" : "Cocked");
if (FireSelector_Modes.Length > 1)
{
flagDic.Add("FireSelectorState", m_fireSelectorMode.ToString());
}
return flagDic;
}
public FVRFireArmRound UpdateBolt(Lebel_Handle.BoltActionHandleState State, float lerp, bool isCatchHeld)
{
//IL_06f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0702: Unknown result type (might be due to invalid IL or missing references)
//IL_070d: Unknown result type (might be due to invalid IL or missing references)
//IL_0728: Unknown result type (might be due to invalid IL or missing references)
//IL_0733: Unknown result type (might be due to invalid IL or missing references)
//IL_073e: Unknown result type (might be due to invalid IL or missing references)
//IL_023a: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_0281: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: 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_077c: Unknown result type (might be due to invalid IL or missing references)
//IL_0797: Unknown result type (might be due to invalid IL or missing references)
//IL_0682: Unknown result type (might be due to invalid IL or missing references)
//IL_068d: Unknown result type (might be due to invalid IL or missing references)
//IL_0698: Unknown result type (might be due to invalid IL or missing references)
//IL_06b3: Unknown result type (might be due to invalid IL or missing references)
//IL_06be: Unknown result type (might be due to invalid IL or missing references)
//IL_06c9: Unknown result type (might be due to invalid IL or missing references)
FVRFireArmRound result = null;
CurBoltHandleState = State;
BoltLerp = lerp;
if (BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down && m_lastHandleRot != Lebel_Handle.BoltActionHandleRot.Down)
{
if ((Object)(object)LifterComponent != (Object)null && !LifterComponent.IsLifterLocked())
{
LifterComponent.SetLifterState(LifterState.Down);
}
if ((Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Down && (Object)(object)base.Magazine != (Object)null && base.Magazine.HasARound() && !m_proxy.IsFull && !m_magazineFullPlusOne)
{
GameObject val = base.Magazine.RemoveRound(false);
if ((Object)(object)val != (Object)null)
{
m_proxy.SetFromPrefabReference(val);
m_proxy.IsFull = true;
m_proxy.UpdateProxyDisplay();
m_proxy.ProxyRound.position = Extraction_MagazinePos.position;
m_proxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
}
}
if (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Rear && LastBoltHandleState != Lebel_Handle.BoltActionHandleState.Rear)
{
if (CockType == HammerCockType.OnBack)
{
CockHammer();
}
bool flag = false;
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null && lebelChamber.WasManuallyChambered)
{
if ((Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Down)
{
flag = true;
}
else
{
lebelChamber.ResetTracking();
}
}
if (flag)
{
if ((Object)(object)LifterComponent != (Object)null && !LifterComponent.IsLifterLocked())
{
LifterComponent.SetLifterState(LifterState.Up);
}
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)41, 1f);
}
else if (Chamber.IsFull && !flag && (!((Object)(object)lebelChamber != (Object)null) || !lebelChamber.WasManuallyChambered))
{
FVRFireArmRound val2 = Chamber.EjectRound(EjectionPos.position, ((Component)this).transform.right * RightwardEjectionForce + ((Component)this).transform.up * UpwardEjectionForce, ((Component)this).transform.up * YSpinEjectionTorque, EjectionPos.position, EjectionPos.rotation, false);
if ((Object)(object)val2 != (Object)null)
{
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)29, 1f);
}
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)10, 1f);
if (isCatchHeld && (Object)(object)val2 != (Object)null && !val2.IsSpent)
{
result = val2;
}
if ((Object)(object)lebelChamber != (Object)null)
{
lebelChamber.ResetTracking();
}
}
else
{
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)41, 1f);
}
BoltMovingForward = true;
if ((Object)(object)LifterComponent != (Object)null && !LifterComponent.IsLifterLocked())
{
LifterComponent.SetLifterState(LifterState.Up);
}
}
else if (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Forward && LastBoltHandleState != 0)
{
if (CockType == HammerCockType.OnForward)
{
CockHammer();
}
if (m_proxy.IsFull && !Chamber.IsFull)
{
bool flag2 = true;
if (m_magazineFullPlusOne && (Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Down && !Chamber.IsFull)
{
flag2 = false;
}
if (flag2)
{
LebelChamber lebelChamber2 = Chamber as LebelChamber;
if ((Object)(object)lebelChamber2 != (Object)null)
{
lebelChamber2.SetFromMagazine(fromMagazine: true);
}
Chamber.SetRound(m_proxy.Round, false);
m_proxy.ClearProxy();
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)11, 1f);
}
else
{
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)40, 1f);
}
}
else
{
((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)40, 1f);
}
BoltMovingForward = false;
}
else if (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Mid && LastBoltHandleState == Lebel_Handle.BoltActionHandleState.Rear && (Object)(object)base.Magazine != (Object)null)
{
if (!m_proxy.IsFull && base.Magazine.HasARound() && !Chamber.IsFull && (Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Up && BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down)
{
GameObject fromPrefabReference = base.Magazine.RemoveRound(false);
m_proxy.SetFromPrefabReference(fromPrefabReference);
}
if (EjectsMagazineOnEmpty && !base.Magazine.HasARound())
{
((FVRFireArm)this).EjectMag(false);
}
}
if (CurBoltHandleState != LastBoltHandleState)
{
LebelChamber lebelChamber3 = Chamber as LebelChamber;
if ((Object)(object)lebelChamber3 != (Object)null && (!lebelChamber3.WasManuallyChambered || (CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Forward && LastBoltHandleState == Lebel_Handle.BoltActionHandleState.Mid)))
{
lebelChamber3.ResetTracking();
}
}
if (CurBoltHandleState != 0 && !m_proxy.IsFull && !Chamber.IsFull)
{
Chamber.IsAccessible = true;
}
else
{
Chamber.IsAccessible = false;
}
if (m_proxy.IsFull)
{
bool flag3 = true;
if (m_magazineFullPlusOne && (Object)(object)LifterComponent != (Object)null && LifterComponent.GetLifterState() == LifterState.Down && !Chamber.IsFull)
{
flag3 = false;
}
LebelChamber lebelChamber4 = Chamber as LebelChamber;
if (((Object)(object)lebelChamber4 == (Object)null || !lebelChamber4.WasManuallyChambered) && flag3)
{
m_proxy.ProxyRound.position = Vector3.Lerp(Extraction_ChamberPos.position, Extraction_MagazinePos.position, BoltLerp);
m_proxy.ProxyRound.rotation = Quaternion.Slerp(Extraction_ChamberPos.rotation, Extraction_MagazinePos.rotation, BoltLerp);
}
}
if (Chamber.IsFull)
{
Chamber.ProxyRound.position = Vector3.Lerp(Extraction_ChamberPos.position, Extraction_Ejecting.position, BoltLerp);
Chamber.ProxyRound.rotation = Quaternion.Slerp(Extraction_ChamberPos.rotation, Extraction_Ejecting.rotation, BoltLerp);
}
if ((Object)(object)LifterComponent != (Object)null && LifterComponent.IsLifterBeingHeld())
{
Extraction_MagazinePos.position = ((Component)LifterComponent).transform.position;
Extraction_MagazinePos.rotation = ((Component)LifterComponent).transform.rotation;
}
LastBoltHandleState = CurBoltHandleState;
m_lastHandleRot = BoltHandle.HandleRot;
return result;
}
private void UpdateLifterProxyDisplay()
{
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
//IL_0231: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Expected O, but got Unknown
//IL_0187: 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_01ad: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
if (m_needsLifterCycle)
{
if ((Object)(object)lifterProxy != (Object)null && (Object)(object)lifterProxy.ProxyRenderer != (Object)null)
{
((Renderer)lifterProxy.ProxyRenderer).enabled = false;
}
return;
}
if (((Object)(object)base.Magazine != (Object)null && base.Magazine.HasARound() && !m_lifterProxyDisabledAfterChambering) || (m_magazineFullPlusOne && m_proxy.IsFull))
{
if ((Object)(object)base.Magazine != (Object)null && base.Magazine.LoadedRounds != null && base.Magazine.LoadedRounds.Length > 0 && base.Magazine.m_numRounds > 0 && base.Magazine.LoadedRounds[base.Magazine.m_numRounds - 1] != null)
{
FVRLoadedRound val = base.Magazine.LoadedRounds[base.Magazine.m_numRounds - 1];
if ((Object)(object)lifterProxy == (Object)null)
{
GameObject val2 = new GameObject("LifterProxyRound");
lifterProxy = val2.AddComponent<FVRFirearmMovingProxyRound>();
lifterProxy.Init(((Component)this).transform);
lifterProxy.NukeShadowCasting();
}
lifterProxy.IsFull = true;
lifterProxy.IsSpent = false;
lifterProxy.ProxyMesh.mesh = AM.GetRoundMesh(base.Magazine.RoundType, val.LR_Class);
((Renderer)lifterProxy.ProxyRenderer).material = AM.GetRoundMaterial(base.Magazine.RoundType, val.LR_Class);
lifterProxy.ProxyRound.position = Extraction_MagazinePos.position;
lifterProxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
else if (m_magazineFullPlusOne && m_proxy.IsFull)
{
if ((Object)(object)lifterProxy == (Object)null)
{
GameObject val3 = new GameObject("LifterProxyRound");
lifterProxy = val3.AddComponent<FVRFirearmMovingProxyRound>();
lifterProxy.Init(((Component)this).transform);
lifterProxy.NukeShadowCasting();
}
lifterProxy.IsFull = true;
lifterProxy.IsSpent = false;
lifterProxy.ProxyMesh.mesh = m_proxy.ProxyMesh.mesh;
((Renderer)lifterProxy.ProxyRenderer).material = ((Renderer)m_proxy.ProxyRenderer).material;
lifterProxy.ProxyRound.position = Extraction_MagazinePos.position;
lifterProxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
}
if (!((Object)(object)LifterComponent != (Object)null) || !((Object)(object)Chamber != (Object)null) || !((Object)(object)Chamber.ProxyRound != (Object)null) || !((Object)(object)((Component)Chamber.ProxyRound).GetComponent<Renderer>() != (Object)null))
{
return;
}
bool flag = false;
if (LifterComponent.GetLifterState() == LifterState.Down)
{
LebelChamber lebelChamber = Chamber as LebelChamber;
if ((Object)(object)lebelChamber != (Object)null && lebelChamber.WasManuallyChambered)
{
flag = true;
}
}
((Component)Chamber.ProxyRound).GetComponent<Renderer>().enabled = !flag;
}
private void UpdateLifterProxyVisibility()
{
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Expected O, but got Unknown
//IL_014f: 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)
if (m_magazineFullPlusOne && m_proxy.IsFull && (Object)(object)LifterComponent != (Object)null)
{
if ((Object)(object)lifterProxy == (Object)null)
{
GameObject val = new GameObject("LifterProxyRound");
lifterProxy = val.AddComponent<FVRFirearmMovingProxyRound>();
lifterProxy.Init(((Component)this).transform);
lifterProxy.NukeShadowCasting();
}
lifterProxy.IsFull = true;
lifterProxy.IsSpent = false;
if ((Object)(object)m_proxy.ProxyMesh != (Object)null && (Object)(object)m_proxy.ProxyRenderer != (Object)null)
{
lifterProxy.ProxyMesh.mesh = m_proxy.ProxyMesh.mesh;
((Renderer)lifterProxy.ProxyRenderer).material = ((Renderer)m_proxy.ProxyRenderer).material;
}
if ((Object)(object)BoltHandle != (Object)null && BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down && LifterComponent.GetLifterState() == LifterState.Down)
{
((Renderer)lifterProxy.ProxyRenderer).enabled = true;
lifterProxy.ProxyRound.position = Extraction_MagazinePos.position;
lifterProxy.ProxyRound.rotation = Extraction_MagazinePos.rotation;
}
}
}
}
public class LebelChamber : FVRFireArmChamber
{
[Header("Lebel Chamber Tracking")]
public bool WasManuallyChambered;
private bool m_isFromMagazine;
private bool m_hasDetectedManualChambering;
public void ResetTracking()
{
WasManuallyChambered = false;
m_isFromMagazine = false;
m_hasDetectedManualChambering = false;
}
public void SetFromMagazine(bool fromMagazine)
{
m_isFromMagazine = fromMagazine;
if (fromMagazine)
{
m_hasDetectedManualChambering = false;
WasManuallyChambered = false;
}
}
private void OnTriggerEnter(Collider other)
{
if (((Component)other).CompareTag("FVRFireArmRound"))
{
FVRFireArmRound component = ((Component)other).GetComponent<FVRFireArmRound>();
if ((Object)(object)component != (Object)null && !m_isFromMagazine && base.IsManuallyChamberable && base.IsAccessible && !m_hasDetectedManualChambering)
{
WasManuallyChambered = true;
m_hasDetectedManualChambering = true;
}
}
}
public override void BeginInteraction(FVRViveHand hand)
{
((FVRFireArmChamber)this).BeginInteraction(hand);
}
public override void FVRUpdate()
{
((FVRFireArmChamber)this).FVRUpdate();
}
public override void Awake()
{
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
((FVRFireArmChamber)this).Awake();
base.IsFull = false;
m_hasDetectedManualChambering = false;
if ((Object)(object)((Component)this).GetComponent<Collider>() == (Object)null)
{
BoxCollider val = ((Component)this).gameObject.AddComponent<BoxCollider>();
((Collider)val).isTrigger = true;
val.size = new Vector3(0.02f, 0.02f, 0.05f);
}
}
public override bool IsInteractable()
{
return ((FVRFireArmChamber)this).IsInteractable();
}
public void OnRoundEnter(FVRFireArmRound round)
{
if ((Object)(object)round != (Object)null && !m_isFromMagazine && base.IsManuallyChamberable && base.IsAccessible && !m_hasDetectedManualChambering)
{
WasManuallyChambered = true;
m_hasDetectedManualChambering = true;
}
}
public void SetRoundWithTracking(FVRFireArmRound round, bool animate = false)
{
OnRoundEnter(round);
((FVRFireArmChamber)this).SetRound(round, animate);
}
public void SetRoundWithTracking(FVRFireArmRound round, Vector3 p, Quaternion r)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
OnRoundEnter(round);
((FVRFireArmChamber)this).SetRound(round, p, r);
}
public void Chamber(FVRFireArmRound round, bool makeChamberingSound)
{
if ((Object)(object)round != (Object)null && !base.IsFull && base.IsAccessible)
{
if (!m_isFromMagazine && !m_hasDetectedManualChambering)
{
WasManuallyChambered = true;
m_hasDetectedManualChambering = true;
}
SetRoundWithTracking(round);
if (makeChamberingSound)
{
((FVRFireArmChamber)this).PlayChamberingAudio();
}
}
}
}
public class LebelLifter : FVRInteractiveObject
{
private Lebel m_parentLebel;
private float m_lifterLerp = 0f;
private bool m_isLifterBeingHeld = false;
private Vector3 m_lastHandPosition;
private float m_lifterHapticTimer = 0f;
private bool m_isLifterMoving = false;
private bool m_isHandInLifterTrigger = false;
private bool m_isLifterLocked = false;
private bool m_wasHandInLifterTrigger = false;
private Vector3 m_initialHandPosition;
private float m_initialLifterLerp;
private float m_handZOffset;
private float m_lifterLockSwitchLerp = 0f;
private const float MANUAL_MOVEMENT_SPEED_MULTIPLIER = 3f;
private float m_lastLifterLerp = 0f;
private Lebel.LifterState m_currentLifterState = Lebel.LifterState.Down;
public bool HasLifterLock => m_parentLebel.HasLifterLock;
public override void Awake()
{
((FVRInteractiveObject)this).Awake();
m_parentLebel = ((Component)this).GetComponentInParent<Lebel>();
}
public override void BeginInteraction(FVRViveHand hand)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
((FVRInteractiveObject)this).BeginInteraction(hand);
m_handZOffset = ((Component)this).transform.InverseTransformPoint(((HandInput)(ref hand.Input)).Pos).z;
}
public override void UpdateInteraction(FVRViveHand hand)
{
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02d1: 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_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
((FVRInteractiveObject)this).UpdateInteraction(hand);
if (!m_isLifterLocked && m_parentLebel.CurBoltHandleState == Lebel_Handle.BoltActionHandleState.Rear && m_parentLebel.BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Up)
{
if ((Object)(object)m_parentLebel.LifterTriggerCollider != (Object)null)
{
m_isHandInLifterTrigger = Vector3.Distance(((Component)hand).transform.position, m_parentLebel.LifterTriggerCollider.ClosestPoint(((Component)hand).transform.position)) < m_parentLebel.LifterInteractionDistance;
}
if (m_isHandInLifterTrigger)
{
if (!m_wasHandInLifterTrigger)
{
m_initialHandPosition = ((Component)hand).transform.position;
m_initialLifterLerp = m_lifterLerp;
m_wasHandInLifterTrigger = true;
}
if (hand.Input.TriggerFloat > 0.5f)
{
m_isLifterBeingHeld = true;
Vector3 pos = ((HandInput)(ref hand.Input)).Pos;
Vector3 closestValidPoint = GetClosestValidPoint(((Component)this).transform.position + ((Component)this).transform.up * m_parentLebel.LifterUpRotation, ((Component)this).transform.position + ((Component)this).transform.up * m_parentLebel.LifterDownRotation, pos);
float num = Mathf.InverseLerp(m_parentLebel.LifterUpRotation, m_parentLebel.LifterDownRotation, Vector3.Distance(closestValidPoint, ((Component)this).transform.position));
if (num < m_lifterLerp)
{
m_lifterLerp = Mathf.Lerp(m_lifterLerp, num, Time.deltaTime * m_parentLebel.LifterLerpSpeed * 3f);
Lebel.LifterState lifterState = ((!(m_lifterLerp < 0.5f)) ? Lebel.LifterState.Up : Lebel.LifterState.Down);
if (lifterState != m_currentLifterState)
{
SetLifterState(lifterState);
}
bool flag = (m_isLifterMoving = Mathf.Abs(m_lifterLerp - m_lastLifterLerp) > 0.001f);
m_lastLifterLerp = m_lifterLerp;
if (flag)
{
m_lifterHapticTimer += Time.deltaTime;
if (m_lifterHapticTimer >= m_parentLebel.LifterHapticFrequency)
{
hand.Buzz(hand.Buzzer.Buzz_BeginInteraction);
m_lifterHapticTimer = 0f;
}
}
}
}
else
{
m_isLifterBeingHeld = false;
m_isLifterMoving = false;
}
}
else
{
m_wasHandInLifterTrigger = false;
m_isLifterBeingHeld = false;
m_isLifterMoving = false;
}
}
else
{
m_isLifterBeingHeld = false;
m_isLifterMoving = false;
m_isHandInLifterTrigger = false;
m_wasHandInLifterTrigger = false;
}
m_lastHandPosition = ((Component)hand).transform.position;
}
public override void FVRFixedUpdate()
{
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
((FVRInteractiveObject)this).FVRFixedUpdate();
if (HasLifterLock)
{
if ((Object)(object)m_parentLebel.LifterLockSwitch != (Object)null)
{
float num = ((!m_isLifterLocked) ? 0f : 1f);
m_lifterLockSwitchLerp = Mathf.Lerp(m_lifterLockSwitchLerp, num, Time.deltaTime * 10f);
float num2 = Mathf.Lerp(m_parentLebel.LifterLockSwitchUnlockedPosition, m_parentLebel.LifterLockSwitchLockedPosition, m_lifterLockSwitchLerp);
m_parentLebel.LifterLockSwitch.localPosition = new Vector3(0f, 0f, num2);
}
if ((Object)(object)m_parentLebel.LifterLockMechanism != (Object)null)
{
float num3 = Mathf.Lerp(m_parentLebel.LifterLockMechanismUnlockedRotation, m_parentLebel.LifterLockMechanismLockedRotation, m_lifterLockSwitchLerp);
m_parentLebel.LifterLockMechanism.localEulerAngles = new Vector3(num3, 0f, 0f);
}
}
float num4 = ((m_currentLifterState != Lebel.LifterState.Up) ? 0f : 1f);
if (!m_isLifterBeingHeld)
{
m_lifterLerp = Mathf.Lerp(m_lifterLerp, num4, Time.deltaTime * m_parentLebel.LifterLerpSpeed);
}
float num5 = Mathf.Lerp(m_parentLebel.LifterDownRotation, m_parentLebel.LifterUpRotation, m_lifterLerp);
((Component)this).transform.localEulerAngles = new Vector3(num5, 0f, 0f);
}
private Vector3 GetClosestValidPoint(Vector3 start, Vector3 end, Vector3 point)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: 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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = end - start;
Vector3 val2 = point - start;
float magnitude = ((Vector3)(ref val)).magnitude;
Vector3 val3 = val / magnitude;
float num = Vector3.Dot(val2, val3);
num = Mathf.Clamp(num, 0f, magnitude);
return start + val3 * num;
}
public void SetLifterState(Lebel.LifterState state)
{
//IL_01a7: 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_0114: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
if (state != m_currentLifterState)
{
if (state == Lebel.LifterState.Up)
{
((FVRFireArm)m_parentLebel).PlayAudioEvent((FirearmAudioEventType)23, 1f);
m_parentLebel.NotifyLifterRaised();
}
else
{
((FVRFireArm)m_parentLebel).PlayAudioEvent((FirearmAudioEventType)24, 1f);
m_parentLebel.NotifyLifterLowered();
}
}
m_currentLifterState = state;
if ((Object)(object)m_parentLebel.Proxy != (Object)null && (Object)(object)m_parentLebel.Proxy.ProxyRenderer != (Object)null)
{
bool flag = state == Lebel.LifterState.Down && !m_parentLebel.Chamber.IsFull && !m_parentLebel.Proxy.IsSpent;
((Renderer)m_parentLebel.Proxy.ProxyRenderer).enabled = !flag;
if (state == Lebel.LifterState.Down && m_parentLebel.Chamber.IsFull)
{
m_parentLebel.Proxy.ProxyRound.position = m_parentLebel.Extraction_MagazinePos.position;
m_parentLebel.Proxy.ProxyRound.rotation = m_parentLebel.Extraction_MagazinePos.rotation;
}
}
if ((Object)(object)m_parentLebel.lifterProxy != (Object)null && (Object)(object)m_parentLebel.lifterProxy.ProxyRenderer != (Object)null)
{
((Component)m_parentLebel.lifterProxy).transform.SetParent(m_parentLebel.Extraction_MagazinePos);
((Component)m_parentLebel.lifterProxy).transform.localPosition = Vector3.zero;
((Component)m_parentLebel.lifterProxy).transform.localRotation = Quaternion.identity;
bool enabled = false;
if (m_parentLebel.m_magazineFullPlusOne && m_parentLebel.Proxy.IsFull && state == Lebel.LifterState.Down && m_parentLebel.BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down)
{
enabled = true;
}
else if (state == Lebel.LifterState.Down && m_parentLebel.Proxy.IsFull && (Object)(object)((FVRFireArm)m_parentLebel).Magazine != (Object)null && ((FVRFireArm)m_parentLebel).Magazine.HasARound() && m_parentLebel.BoltHandle.HandleRot == Lebel_Handle.BoltActionHandleRot.Down)
{
enabled = true;
}
((Renderer)m_parentLebel.lifterProxy.ProxyRenderer).enabled = enabled;
}
switch (state)
{
case Lebel.LifterState.Down:
m_lifterLerp = 0f;
break;
case Lebel.LifterState.Up:
m_lifterLerp = 1f;
break;
}
}
public Lebel.LifterState GetLifterState()
{
return m_currentLifterState;
}
public void SetLifterLocked(bool locked)
{
m_isLifterLocked = locked;
}
public bool IsLifterLocked()
{
return m_isLifterLocked;
}
public bool IsLifterBeingHeld()
{
return m_isLifterBeingHeld;
}
}
public class Lebel_Handle : FVRInteractiveObject
{
public enum BoltActionHandleState
{
Forward,
Mid,
Rear
}
public enum BoltActionHandleRot
{
Up,
Mid,
Down
}
public Lebel Rifle;
public bool UsesQuickRelease;
public Transform BoltActionHandleRoot;
public Transform BoltActionHandle;
public float BaseRotOffset;
private float rotAngle;
public float MinRot;
public float MaxRot;
public float UnlockThreshold = 70f;
public Transform Point_Forward;
public Transform Point_Rearward;
public Vector3 HandPosOffset = new Vector3(0f, 0f, 0f);
private bool m_wasTPInitiated;
public bool UsesExtraRotationPiece;
public Transform ExtraRotationPiece;
public BoltActionHandleState HandleState;
public BoltActionHandleState LastHandleState;
public BoltActionHandleRot HandleRot = BoltActionHandleRot.Down;
public BoltActionHandleRot LastHandleRot = BoltActionHandleRot.Down;
private Vector3 m_localHandPos_BoltDown;
private Vector3 m_localHandPos_BoltUp;
private Vector3 m_localHandPos_BoltBack;
private float fakeBoltDrive;
public bool CursedLeftHanded;
public override void Awake()
{
((FVRInteractiveObject)this).Awake();
CalculateHandPoses();
}
public void TPInitiate()
{
m_wasTPInitiated = true;
}
public override void EndInteraction(FVRViveHand hand)
{
m_wasTPInitiated = false;
((FVRInteractiveObject)this).EndInteraction(hand);
}
public override bool IsInteractable()
{
if (!Rifle.CanBoltMove())
{
return false;
}
return ((FVRInteractiveObject)this).IsInteractable();
}
private void CalculateHandPoses()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_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_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_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_007e: 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_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
m_localHandPos_BoltDown = ((Component)Rifle).transform.InverseTransformPoint(((Component)this).transform.position);
Vector3 val = ((Component)this).transform.position - BoltActionHandleRoot.position;
val = Quaternion.AngleAxis(Mathf.Abs(MaxRot - MinRot) + 10f, BoltActionHandleRoot.forward) * val;
val += BoltActionHandleRoot.position;
m_localHandPos_BoltUp = ((Component)Rifle).transform.InverseTransformPoint(val);
Vector3 val2 = val + -BoltActionHandleRoot.forward * (0.005f + Vector3.Distance(Point_Forward.position, Point_Rearward.position));
m_localHandPos_BoltBack = ((Component)Rifle).transform.InverseTransformPoint(val2);
}
public override void FVRUpdate()
{
((FVRInteractiveObject)this).FVRUpdate();
}
public void DriveBolt(float amount)
{
//IL_008a: 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)
//IL_0062: 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_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)((FVRFireArm)Rifle).Clip != (Object)null)
{
((FVRFireArm)Rifle).EjectClip();
return;
}
fakeBoltDrive += amount;
fakeBoltDrive = Mathf.Clamp(fakeBoltDrive, 0f, 1f);
Vector3 val = ((fakeBoltDrive < 0.5f) ? Vector3.Slerp(m_localHandPos_BoltDown, m_localHandPos_BoltUp, fakeBoltDrive * 2f) : Vector3.Lerp(m_localHandPos_BoltUp, m_localHandPos_BoltBack, (fakeBoltDrive - 0.5f) * 2f));
val = ((Component)Rifle).transform.TransformPoint(val);
ManipulateBoltUsingPosition(val, touchpadDrive: true);
float num = Mathf.InverseLerp(Point_Forward.localPosition.z, Point_Rearward.localPosition.z, BoltActionHandleRoot.localPosition.z);
if (num < 0.05f)
{
HandleState = BoltActionHandleState.Forward;
}
else if (num > 0.95f)
{
HandleState = BoltActionHandleState.Rear;
}
else
{
HandleState = BoltActionHandleState.Mid;
}
Rifle.UpdateBolt(HandleState, num, isCatchHeld: false);
LastHandleState = HandleState;
}
private bool ManipulateBoltUsingPosition(Vector3 pos, bool touchpadDrive)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing