Decompiled source of HuntBerthier1892 v1.0.7
HuntBerthier1892.dll
Decompiled 2 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.Globalization; 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.HuntBerthier1892 { [BepInPlugin("BitWizrd.HuntBerthier1892", "HuntBerthier1892", "1.0.7")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class HuntBerthier1892Plugin : 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.HuntBerthier1892"); OtherLoader.RegisterDirectLoad(BasePath, "BitWizrd.HuntBerthier1892", "", "berthier 1892", "", ""); } } } namespace BitWizrd.BerthierRifle { public class Berthier : FVRFireArm { public enum ZPos { Forward, Middle, Rear } public enum HammerCockType { OnBack, OnUp, OnClose, OnForward } public enum FireSelectorModeType { Safe, Single } [Serializable] public class FireSelectorMode { public float SelectorPosition; public FireSelectorModeType ModeType; public bool IsBoltLocked; } [Header("BoltActionRifle Config")] public FVRFireArmChamber Chamber; public bool HasMagEjectionButton = true; public bool HasFireSelectorButton = true; public Berthier_Handle BoltHandle; public float BoltLerp; public bool BoltMovingForward; public Berthier_Handle.BoltActionHandleState CurBoltHandleState; public Berthier_Handle.BoltActionHandleState LastBoltHandleState; [Header("Hammer Config")] public bool HasVisualHammer; public Transform Hammer; public float HammerUncocked; public float HammerCocked; [NonSerialized] public bool m_isHammerCocked; public HammerCockType CockType; [NonSerialized] public FVRFirearmMovingProxyRound m_proxy; [Header("Round Positions Config")] public Transform Extraction_MagazinePos; public Transform Extraction_ChamberPos; public Transform Extraction_Ejecting; public Transform EjectionPos; public float UpwardEjectionForce; public float RightwardEjectionForce = 2f; public float YSpinEjectionTorque = 80f; public Transform Muzzle; public GameObject ReloadTriggerWell; [Header("Control Config")] public float TriggerResetThreshold = 0.1f; public float TriggerFiringThreshold = 0.8f; public bool FireOnTriggerDown = true; [NonSerialized] public float m_triggerFloat; [NonSerialized] public bool m_hasTriggerCycled; [NonSerialized] public bool m_isMagReleasePressed; 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; public Transform MagReleaseButton_Display; public Axis MagReleaseAxis; public InterpStyle MagReleaseInterpStyle = (InterpStyle)1; public float MagReleasePressedValue; public float MagReleaseUnpressedValue; [NonSerialized] public float m_magReleaseCurValue; [NonSerialized] public float m_magReleaseTarValue; [NonSerialized] public Vector2 TouchPadAxes = Vector2.zero; public Transform FireSelector_Display; public Axis FireSelector_Axis; public InterpStyle FireSelector_InterpStyle = (InterpStyle)1; public FireSelectorMode[] FireSelector_Modes; [NonSerialized] public 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; [NonSerialized] public bool m_isQuickboltTouching; [NonSerialized] public Vector2 lastTPTouchPoint = Vector2.zero; [Header("Berthier Config")] public Transform UpwardMagEjection; public float MagEjectForce = 1.5f; public bool IsHammerCocked => m_isHammerCocked; public bool HasExtractedRound() { return m_proxy.IsFull; } public override void Awake() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Expected O, but got Unknown ((FVRFireArm)this).Awake(); base.FChambers.Add(Chamber); if (base.UsesClips && (Object)(object)base.ClipTrigger != (Object)null) { if (CurBoltHandleState == Berthier_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); } 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 == Berthier_Handle.BoltActionHandleState.Forward || CurBoltHandleState == Berthier_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_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_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Invalid comparison between Unknown and I4 //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_033e: Unknown result type (might be due to invalid IL or missing references) //IL_0608: Unknown result type (might be due to invalid IL or missing references) //IL_060d: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_0650: Unknown result type (might be due to invalid IL or missing references) //IL_0572: Unknown result type (might be due to invalid IL or missing references) //IL_0577: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Unknown result type (might be due to invalid IL or missing references) //IL_055f: Unknown result type (might be due to invalid IL or missing references) //IL_0564: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04dc: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Unknown result type (might be due to invalid IL or missing references) //IL_04e6: Unknown result type (might be due to invalid IL or missing references) //IL_059a: 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_05d4: Unknown result type (might be due to invalid IL or missing references) //IL_05d9: Unknown result type (might be due to invalid IL or missing references) //IL_05de: Unknown result type (might be due to invalid IL or missing references) //IL_05e3: Unknown result type (might be due to invalid IL or missing references) //IL_0551: Unknown result type (might be due to invalid IL or missing references) //IL_0552: Unknown result type (might be due to invalid IL or missing references) //IL_0522: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) 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 (HasMagEjectionButton && hand.Input.AXButtonPressed && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin) { m_isMagReleasePressed = true; } if (HasMagEjectionButton && hand.Input.AXButtonDown && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin && CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Rear) { EjectMagUpward(); } 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 == Berthier_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 == Berthier_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot == Berthier_Handle.BoltActionHandleRot.Down) { flag2 = false; } if (!BoltHandle.UsesQuickRelease) { flag2 = false; } if (hand.Input.TouchpadDown && ((Vector2)(ref TouchPadAxes)).magnitude > 0.1f) { if (flag3 && Vector2.Angle(TouchPadAxes, Vector2.right) <= 45f && BoltHandle.UsesQuickRelease && BoltHandle.HandleState == Berthier_Handle.BoltActionHandleState.Forward) { flag = true; } else if (Vector2.Angle(TouchPadAxes, Vector2.left) <= 45f && HasFireSelectorButton) { ToggleFireSelector(); } else if (Vector2.Angle(TouchPadAxes, Vector2.down) <= 45f && HasMagEjectionButton && CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Rear) { EjectMagUpward(); } } } 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(((Component)BoltHandle.BoltActionHandleRoot).transform.position, ((Component)BoltHandle.BoltActionHandleRoot).transform.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 void EjectMagUpward() { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: 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) FVRFireArmMagazine magazine = base.Magazine; if ((Object)(object)magazine == (Object)null) { return; } ReleaseMag(); if (!((Object)(object)UpwardMagEjection == (Object)null)) { ((Component)magazine).transform.position = UpwardMagEjection.position; ((Component)magazine).transform.rotation = UpwardMagEjection.rotation; Rigidbody component = ((Component)magazine).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.velocity = Vector3.zero; component.angularVelocity = Vector3.zero; component.AddForce(UpwardMagEjection.up * MagEjectForce, (ForceMode)1); } } } public float GetSignedAngle(Vector2 from, Vector2 to) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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; } public 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if ((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); } } } public virtual void ToggleFireSelector() { //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) if ((RequiresHammerUncockedToToggleFireSelector && IsHammerCocked) || ((FVRInteractiveObject)BoltHandle).IsHeld || CurBoltHandleState != Berthier_Handle.BoltActionHandleState.Forward || BoltHandle.HandleRot != Berthier_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); } } } 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]; } public virtual void FiringSystem() { bool flag = false; if ((!FireOnTriggerDown) ? (FireSelector_Modes[m_fireSelectorMode].ModeType != FireSelectorModeType.Safe && !((FVRPhysicalObject)this).IsAltHeld && BoltHandle.HandleState == Berthier_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot != Berthier_Handle.BoltActionHandleRot.Up && m_hasTriggerCycled) : (FireSelector_Modes[m_fireSelectorMode].ModeType != FireSelectorModeType.Safe && !((FVRPhysicalObject)this).IsAltHeld && BoltHandle.HandleState == Berthier_Handle.BoltActionHandleState.Forward && BoltHandle.HandleRot != Berthier_Handle.BoltActionHandleRot.Up && (Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null && ((FVRInteractiveObject)this).m_hand.Input.TriggerDown && ((FVRInteractiveObject)this).m_hasTriggeredUpSinceBegin)) { DropHammer(); } } public bool Fire() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (!Chamber.Fire()) { return false; } ((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 FVRFixedUpdate() { ((FVRFireArm)this).FVRFixedUpdate(); UpdateComponentDisplay(); } public void UpdateComponentDisplay() { //IL_0014: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Invalid comparison between Unknown and I4 //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Invalid comparison between Unknown and I4 //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Invalid comparison between Unknown and I4 //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Invalid comparison between Unknown and I4 //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Invalid comparison between Unknown and I4 //IL_020f: 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)TriggerInterpStyle == 0) { Trigger_Display2.localPosition = new Vector3(0f, 0f, Mathf.Lerp(Trigger_ForwardValue2, Trigger_RearwardValue2, m_triggerFloat)); } else if ((int)TriggerInterpStyle == 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; if (m_isMagReleasePressed) { m_magReleaseTarValue = MagReleasePressedValue; } else { m_magReleaseTarValue = MagReleaseUnpressedValue; } m_magReleaseCurValue = Mathf.Lerp(m_magReleaseCurValue, m_magReleaseTarValue, Time.deltaTime * 4f); float magReleaseCurValue = m_magReleaseCurValue; Axis magReleaseAxis = MagReleaseAxis; if ((int)magReleaseAxis != 0) { if ((int)magReleaseAxis != 1) { if ((int)magReleaseAxis == 2) { zero.z = magReleaseCurValue; } } else { zero.y = magReleaseCurValue; } } else { zero.x = magReleaseCurValue; } InterpStyle magReleaseInterpStyle = MagReleaseInterpStyle; if ((int)magReleaseInterpStyle != 0) { if ((int)magReleaseInterpStyle == 1) { MagReleaseButton_Display.localEulerAngles = zero; } } else { MagReleaseButton_Display.localPosition = zero; } } if (CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Forward) { base.IsBreachOpenForGasOut = false; } else { base.IsBreachOpenForGasOut = true; } } public FVRFireArmRound UpdateBolt(Berthier_Handle.BoltActionHandleState State, float lerp, bool isCatchHeld) { //IL_00c7: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_036e: Unknown result type (might be due to invalid IL or missing references) //IL_0379: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) FVRFireArmRound result = null; CurBoltHandleState = State; BoltLerp = lerp; if (base.UsesClips && (Object)(object)base.ClipTrigger != (Object)null) { if (CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Rear) { if (!base.ClipTrigger.activeSelf) { base.ClipTrigger.SetActive(true); } } else if (base.ClipTrigger.activeSelf) { base.ClipTrigger.SetActive(false); } } if (CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Rear && LastBoltHandleState != Berthier_Handle.BoltActionHandleState.Rear) { if (CockType == HammerCockType.OnBack) { CockHammer(); } if (Chamber.IsFull) { FVRFireArmRound val = Chamber.EjectRound(EjectionPos.position, ((Component)this).transform.right * RightwardEjectionForce + ((Component)this).transform.up * UpwardEjectionForce, ((Component)this).transform.up * YSpinEjectionTorque, EjectionPos.position, EjectionPos.rotation, false); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)10, 1f); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)29, 1f); if (isCatchHeld && (Object)(object)val != (Object)null && !val.IsSpent) { result = val; } } else { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)41, 1f); } BoltMovingForward = true; } else if (CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Forward && LastBoltHandleState != Berthier_Handle.BoltActionHandleState.Forward) { if (CockType == HammerCockType.OnForward) { CockHammer(); } if (m_proxy.IsFull && !Chamber.IsFull) { Chamber.SetRound(m_proxy.Round, false); m_proxy.ClearProxy(); ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)11, 1f); } else { ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)40, 1f); } BoltMovingForward = false; } else if (CurBoltHandleState == Berthier_Handle.BoltActionHandleState.Mid && LastBoltHandleState == Berthier_Handle.BoltActionHandleState.Rear && (Object)(object)base.Magazine != (Object)null) { if (!m_proxy.IsFull && base.Magazine.HasARound() && !Chamber.IsFull) { GameObject fromPrefabReference = base.Magazine.RemoveRound(false); m_proxy.SetFromPrefabReference(fromPrefabReference); } if (EjectsMagazineOnEmpty && !base.Magazine.HasARound()) { ((FVRFireArm)this).EjectMag(false); } } if (CurBoltHandleState != Berthier_Handle.BoltActionHandleState.Forward && !m_proxy.IsFull && !Chamber.IsFull) { Chamber.IsAccessible = true; } else { Chamber.IsAccessible = false; } if (m_proxy.IsFull) { 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); } LastBoltHandleState = CurBoltHandleState; return result; } public override List<FireArmRoundClass> GetChamberRoundList() { //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (Chamber.IsFull && !Chamber.IsSpent) { List<FireArmRoundClass> list = new List<FireArmRoundClass>(); list.Add(Chamber.GetRound().RoundClass); return list; } return null; } public override void SetLoadedChambers(List<FireArmRoundClass> rounds) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (rounds.Count > 0) { Chamber.Autochamber(rounds[0]); } } public override void ConfigureFromFlagDic(Dictionary<string, string> f) { //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) string empty = string.Empty; string empty2 = string.Empty; empty = "HammerState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; if (empty2 == "Cocked") { m_isHammerCocked = true; } if (HasVisualHammer) { ((FVRPhysicalObject)this).SetAnimatedComponent(Hammer, HammerCocked, (InterpStyle)0, (Axis)2); } } if (FireSelector_Modes.Length > 1) { empty = "FireSelectorState"; if (f.ContainsKey(empty)) { empty2 = f[empty]; int.TryParse(empty2, out m_fireSelectorMode); } if ((Object)(object)FireSelector_Display != (Object)null) { FireSelectorMode fireSelectorMode = FireSelector_Modes[m_fireSelectorMode]; ((FVRPhysicalObject)this).SetAnimatedComponent(FireSelector_Display, fireSelectorMode.SelectorPosition, FireSelector_InterpStyle, FireSelector_Axis); } } ((FVRFireArm)this).ConfigureFromFlagDic(f); } public override Dictionary<string, string> GetFlagDic() { Dictionary<string, string> flagDic = ((FVRFireArm)this).GetFlagDic(); string key = "HammerState"; string value = "Uncocked"; if (m_isHammerCocked) { value = "Cocked"; } flagDic.Add(key, value); if (FireSelector_Modes.Length > 1) { key = "FireSelectorState"; value = m_fireSelectorMode.ToString(); flagDic.Add(key, value); } return flagDic; } } public class Berthier_Handle : FVRInteractiveObject { public enum BoltActionHandleState { Forward, Mid, Rear } public enum BoltActionHandleRot { Up, Mid, Down } public Berthier Rifle; public bool UsesQuickRelease; public Transform BoltActionHandleRoot; public Transform BoltActionHandle; public float BaseRotOffset; [NonSerialized] public 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); [NonSerialized] public 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; [NonSerialized] public Vector3 m_localHandPos_BoltDown; [NonSerialized] public Vector3 m_localHandPos_BoltUp; [NonSerialized] public Vector3 m_localHandPos_BoltBack; [NonSerialized] public 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 ((Object)(object)Rifle == (Object)null) { return false; } if (!Rifle.CanBoltMove()) { return false; } return ((FVRInteractiveObject)this).IsInteractable(); } public 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; } public 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 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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0256: 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_0260: 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_027b: Unknown result type (might be due to invalid IL or missing references) //IL_0280: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_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_008c: 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_00e9: 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_0115: Unknown result type (might be due to invalid IL or missing references) bool result = false; if (HandleState == BoltActionHandleState.Forward) { Vector3 val = pos - BoltActionHandle.position; Vector3 val2 = Vector3.ProjectOnPlane(val, ((Component)BoltActionHandleRoot).transform.forward); val = ((Vector3)(ref val2)).normalized; Vector3 val3 = ((Component)BoltActionHandleRoot).transform.right; if (CursedLeftHanded) { val3 = -((Component)BoltActionHandleRoot).transform.right; } rotAngle = Mathf.Atan2(Vector3.Dot(BoltActionHandleRoot.forward, Vector3.Cross(val3, val)), Vector3.Dot(val3, val)) * 57.29578f; rotAngle += BaseRotOffset; rotAngle = Mathf.Clamp(rotAngle, MinRot, MaxRot); BoltActionHandle.localEulerAngles = new Vector3(0f, 0f, rotAngle); if (UsesExtraRotationPiece) { ExtraRotationPiece.localEulerAngles = new Vector3(0f, 0f, rotAngle); } if (rotAngle >= UnlockThreshold) { HandleRot = BoltActionHandleRot.Up; } else if (Mathf.Abs(rotAngle - MinRot) < 2f) { HandleRot = BoltActionHandleRot.Down; } else { HandleRot = BoltActionHandleRot.Mid; } if (HandleRot == BoltActionHandleRot.Up && LastHandleRot != BoltActionHandleRot.Up) { ((FVRFireArm)Rifle).PlayAudioEvent((FirearmAudioEventType)12, 1f); if (Rifle.CockType == Berthier.HammerCockType.OnUp) { Rifle.CockHammer(); } } else if (HandleRot == BoltActionHandleRot.Down && LastHandleRot != BoltActionHandleRot.Down) { ((FVRFireArm)Rifle).PlayAudioEvent((FirearmAudioEventType)13, 1f); if (Rifle.CockType == Berthier.HammerCockType.OnClose) { Rifle.CockHammer(); } result = true; } LastHandleRot = HandleRot; } if (rotAngle >= UnlockThreshold) { Vector3 val4 = HandPosOffset.x * BoltActionHandleRoot.right + HandPosOffset.y * BoltActionHandleRoot.up + HandPosOffset.z * BoltActionHandleRoot.forward; Vector3 closestValidPoint = ((FVRInteractiveObject)this).GetClosestValidPoint(Point_Forward.position, Point_Rearward.position, pos - val4); BoltActionHandleRoot.position = closestValidPoint; } return result; } public override void UpdateInteraction(FVRViveHand hand) { //IL_0031: 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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_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_00df: Unknown result type (might be due to invalid IL or missing references) bool flag = false; if ((Object)(object)((FVRFireArm)Rifle).Clip != (Object)null) { ((FVRFireArm)Rifle).EjectClip(); return; } flag = ManipulateBoltUsingPosition(((HandInput)(ref hand.Input)).Pos, touchpadDrive: false); bool isCatchHeld = false; float num = Mathf.InverseLerp(Point_Forward.localPosition.z, Point_Rearward.localPosition.z, BoltActionHandleRoot.localPosition.z); if (base.m_hand.IsInStreamlinedMode) { if (base.m_hand.Input.AXButtonPressed) { isCatchHeld = true; } } else if (base.m_hand.Input.TouchpadPressed && Vector3.Angle(Vector2.op_Implicit(base.m_hand.Input.TouchpadAxes), Vector2.op_Implicit(Vector2.down)) < 45f) { isCatchHeld = true; } if (num < 0.025f) { HandleState = BoltActionHandleState.Forward; } else if (num > 0.975f) { HandleState = BoltActionHandleState.Rear; } else { HandleState = BoltActionHandleState.Mid; } if ((HandleState == BoltActionHandleState.Forward && LastHandleState != BoltActionHandleState.Forward) || HandleState != BoltActionHandleState.Rear || LastHandleState != BoltActionHandleState.Rear) { } FVRFireArmRound val = Rifle.UpdateBolt(HandleState, num, isCatchHeld); LastHandleState = HandleState; ((FVRInteractiveObject)this).UpdateInteraction(hand); if ((Object)(object)val == (Object)null && flag && UsesQuickRelease && m_wasTPInitiated && (((FVRPhysicalObject)Rifle).IsAltHeld || !((FVRInteractiveObject)Rifle).IsHeld)) { hand.Buzz(hand.Buzzer.Buzz_BeginInteraction); ((FVRInteractiveObject)this).EndInteraction(hand); ((FVRInteractiveObject)Rifle).BeginInteraction(hand); hand.ForceSetInteractable((FVRInteractiveObject)(object)Rifle); if (!hand.Input.TriggerPressed) { Rifle.SetHasTriggeredUp(); } } if ((Object)(object)val != (Object)null) { hand.Buzz(hand.Buzzer.Buzz_BeginInteraction); ((FVRInteractiveObject)this).EndInteraction(hand); ((FVRInteractiveObject)val).BeginInteraction(hand); hand.ForceSetInteractable((FVRInteractiveObject)(object)val); } } } } 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 ComponentActivateRandomRuntime : MonoBehaviour { public float Probability; public int Group; public float SelectionStart; [NonSerialized] private bool rollResolved; [NonSerialized] private float sharedRoll; private void Awake() { if (Probability >= 1f) { return; } bool flag; if (Group != 0) { if (!rollResolved) { ResolveGroupRollsForRoot(); } flag = sharedRoll >= SelectionStart && sharedRoll <= SelectionStart + Probability; } else { flag = Random.value <= Probability; } if (!flag) { ((Component)this).gameObject.SetActive(false); } } private void ResolveGroupRollsForRoot() { ComponentActivateRandomRuntime[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<ComponentActivateRandomRuntime>(true); Dictionary<int, float> dictionary = new Dictionary<int, float>(); foreach (ComponentActivateRandomRuntime componentActivateRandomRuntime in componentsInChildren) { if (componentActivateRandomRuntime.Group != 0 && !componentActivateRandomRuntime.rollResolved) { if (!dictionary.TryGetValue(componentActivateRandomRuntime.Group, out var value)) { value = Random.value; dictionary[componentActivateRandomRuntime.Group] = value; } componentActivateRandomRuntime.sharedRoll = value; componentActivateRandomRuntime.rollResolved = true; } } } } 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); } } [ExecuteInEditMode] public class CryErosionDriver : MonoBehaviour { private static readonly int ErosionValueId = Shader.PropertyToID("_ErosionValue"); [Range(0f, 1f)] public float Burn = 0f; public Renderer[] Renderers; public bool HideWhenGone = true; private MaterialPropertyBlock _block; private float _burnRate; private float _lastApplied = -1f; public void BurnOver(float seconds) { _burnRate = ((!(seconds > 0.0001f)) ? 0f : ((1f - Burn) / seconds)); if (_burnRate <= 0f) { Burn = 1f; } } public void Restore() { _burnRate = 0f; Burn = 0f; Apply(force: true); } private void LateUpdate() { if (_burnRate > 0f && Application.isPlaying) { Burn = Mathf.Min(1f, Burn + _burnRate * Time.deltaTime); if (Burn >= 1f) { _burnRate = 0f; } } Apply(force: false); } private void OnValidate() { Apply(force: true); } private void Apply(bool force) { //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown float num = Mathf.Clamp01(Burn); if (!force && Mathf.Approximately(num, _lastApplied)) { return; } _lastApplied = num; if (Renderers == null || Renderers.Length == 0) { Renderers = ((Component)this).GetComponentsInChildren<Renderer>(true); } if (_block == null) { _block = new MaterialPropertyBlock(); } bool flag = HideWhenGone && num >= 1f; for (int i = 0; i < Renderers.Length; i++) { Renderer val = Renderers[i]; if (!((Object)(object)val == (Object)null)) { val.GetPropertyBlock(_block); _block.SetFloat(ErosionValueId, 1f - num); val.SetPropertyBlock(_block); if (HideWhenGone) { val.enabled = !flag; } } } } } 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 FireLightFlicker : MonoBehaviour { public Light Light; public float BaseIntensity = 1f; public float FlickerMin = 1f; public float FlickerMax = 1f; public float FlickerSpeed = 1f; private float noiseOffset; private void Awake() { if ((Object)(object)Light == (Object)null) { Light = ((Component)this).GetComponent<Light>(); } noiseOffset = Random.value * 1000f; } private void Update() { if (!((Object)(object)Light == (Object)null)) { float num = Mathf.PerlinNoise(Time.time * FlickerSpeed + noiseOffset, 0f); Light.intensity = BaseIntensity * Mathf.Lerp(FlickerMin, FlickerMax, num); } } } 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; } } } public class ParticleAffectorCoordinator : MonoBehaviour { [Serializable] public struct BeamConfig { public Transform SourceTransform; public Vector3 SourceOffset; public Transform DestTransform; public Vector3 DestOffset; public bool HasLine; } [Serializable] public struct LocationOffsetEntry { public Vector3 Direction; public float ScaleMin; public float ScaleMax; } [Serializable] public struct VelocityExtraEntry { public Vector3 Direction; public float ConeAngleDeg; public float SpeedMin; public float SpeedMax; } [Serializable] public struct GravityEntry { public bool UseAxis; public float Accel; public float Decay; public Vector3 Axis; public Transform Target; } [Serializable] public struct VortexEntry { public float Speed; public float Decay; public Vector3 Axis; public Transform Target; public float Drag; } public ParticleSystem Ps; public bool HasBeam; public BeamConfig Beam; public LocationOffsetEntry[] LocationOffsets; public string[] LocationOffsetScaleCurveKeysStrs; [NonSerialized] private AnimationCurve[] _locationOffsetScaleCurves; public VelocityExtraEntry[] VelocityExtras; public GravityEntry[] GravityEntries; public VortexEntry[] VortexEntries; public bool HasGravityDrag; public float GravityDrag; public bool HasDragCurve; public AnimationCurve DragCurve; public Vector3 DragWind; public float MaxCameraDistance; [NonSerialized] private ParticleSystemRenderer _cullRenderer; public bool HasMoveRelativeToEmitter; public Transform MoveRelEmitter; public float MoveRelPositionInherit; public float MoveRelVelocityInherit; public bool HasAlignRotation; public Transform AlignParentTransform; public Vector3 AlignAxisLocal; [NonSerialized] private Vector3 _alignTargetWorldDir; public Quaternion ShapeAimRotation = Quaternion.identity; [NonSerialized] private Quaternion _inverseShapeAim = Quaternion.identity; private Particle[] buffer; private Vector3 beamSourceWorld; private Vector3 beamDestWorld; private Vector3 lastEmitterPos; private Quaternion lastEmitterRot; private HashSet<uint> lastFrameSeeds = new HashSet<uint>(); private HashSet<uint> currentFrameSeeds = new HashSet<uint>(); private static Camera s_viewerCamera; private void Awake() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0272: 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_013b: 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_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_029a: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Ps == (Object)null) { Ps = ((Component)this).GetComponent<ParticleSystem>(); } Quaternion val = ShapeAimRotation; if (val.x == 0f && val.y == 0f && val.z == 0f && val.w == 0f) { val = Quaternion.identity; } _inverseShapeAim = Quaternion.Inverse(val); if (LocationOffsetScaleCurveKeysStrs != null && LocationOffsetScaleCurveKeysStrs.Length > 0) { _locationOffsetScaleCurves = (AnimationCurve[])(object)new AnimationCurve[LocationOffsetScaleCurveKeysStrs.Length]; for (int i = 0; i < LocationOffsetScaleCurveKeysStrs.Length; i++) { _locationOffsetScaleCurves[i] = ParseScaleCurveKeysStr(LocationOffsetScaleCurveKeysStrs[i]); } } if (HasBeam) { Vector3 val2 = ((!((Object)(object)Beam.SourceTransform != (Object)null)) ? ((Component)this).transform.position : Beam.SourceTransform.position); Vector3 val3 = ((!((Object)(object)Beam.DestTransform != (Object)null)) ? ((Component)this).transform.position : Beam.DestTransform.position); beamSourceWorld = val2 + Beam.SourceOffset; beamDestWorld = val3 + Beam.DestOffset; if (Beam.HasLine) { LineRenderer val4 = ((Component)this).GetComponent<LineRenderer>(); if ((Object)(object)val4 == (Object)null) { val4 = ((Component)this).gameObject.AddComponent<LineRenderer>(); } ParticleSystemRenderer component = ((Component)this).GetComponent<ParticleSystemRenderer>(); if ((Object)(object)component != (Object)null) { ((Renderer)val4).material = ((Renderer)component).sharedMaterial; } val4.useWorldSpace = true; val4.positionCount = 2; val4.SetPosition(0, beamSourceWorld); val4.SetPosition(1, beamDestWorld); } } if (HasMoveRelativeToEmitter) { if ((Object)(object)MoveRelEmitter == (Object)null) { MoveRelEmitter = ((Component)this).transform; } lastEmitterPos = MoveRelEmitter.position; lastEmitterRot = MoveRelEmitter.rotation; } if (HasAlignRotation) { Quaternion val5 = ((!((Object)(object)AlignParentTransform != (Object)null)) ? Quaternion.identity : AlignParentTransform.rotation); Vector3 val6 = val5 * AlignAxisLocal; _alignTargetWorldDir = ((Vector3)(ref val6)).normalized; } } private void LateUpdate() { //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Unknown result type (might be due to invalid IL or missing references) //IL_0a40: Unknown result type (might be due to invalid IL or missing references) //IL_0a45: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: 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_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0362: Unknown result type (might be due to invalid IL or missing references) //IL_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Unknown result type (might be due to invalid IL or missing references) //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04d0: Unknown result type (might be due to invalid IL or missing references) //IL_04eb: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_04f5: Unknown result type (might be due to invalid IL or missing references) //IL_0524: Unknown result type (might be due to invalid IL or missing references) //IL_0526: Unknown result type (might be due to invalid IL or missing references) //IL_052a: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_059a: Unknown result type (might be due to invalid IL or missing references) //IL_058a: 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_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d0: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_09a7: Unknown result type (might be due to invalid IL or missing references) //IL_09bb: Unknown result type (might be due to invalid IL or missing references) //IL_059f: Unknown result type (might be due to invalid IL or missing references) //IL_07d0: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_0780: Unknown result type (might be due to invalid IL or missing references) //IL_05c8: Unknown result type (might be due to invalid IL or missing references) //IL_05be: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_0466: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_0477: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0921: Unknown result type (might be due to invalid IL or missing references) //IL_0923: Unknown result type (might be due to invalid IL or missing references) //IL_0926: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0935: Unknown result type (might be due to invalid IL or missing references) //IL_0937: Unknown result type (might be due to invalid IL or missing references) //IL_093c: Unknown result type (might be due to invalid IL or missing references) //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0940: Unknown result type (might be due to invalid IL or missing references) //IL_0948: Unknown result type (might be due to invalid IL or missing references) //IL_094d: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_05cd: Unknown result type (might be due to invalid IL or missing references) //IL_05cf: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: 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_0961: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_0965: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_096c: Unknown result type (might be due to invalid IL or missing references) //IL_096e: Unknown result type (might be due to invalid IL or missing references) //IL_0976: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_0803: Unknown result type (might be due to invalid IL or missing references) //IL_0805: Unknown result type (might be due to invalid IL or missing references) //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_0809: Unknown result type (might be due to invalid IL or missing references) //IL_080e: Unknown result type (might be due to invalid IL or missing references) //IL_064b: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_064f: Unknown result type (might be due to invalid IL or missing references) //IL_0654: Unknown result type (might be due to invalid IL or missing references) //IL_0619: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_061d: Unknown result type (might be due to invalid IL or missing references) //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_0626: Unknown result type (might be due to invalid IL or missing references) //IL_0628: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0636: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_063d: Unknown result type (might be due to invalid IL or missing references) //IL_0642: Unknown result type (might be due to invalid IL or missing references) //IL_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0844: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_084b: Unknown result type (might be due to invalid IL or missing references) //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_084f: Unknown result type (might be due to invalid IL or missing references) //IL_0851: Unknown result type (might be due to invalid IL or missing references) //IL_0853: Unknown result type (might be due to invalid IL or missing references) //IL_085a: Unknown result type (might be due to invalid IL or missing references) //IL_085f: Unknown result type (might be due to invalid IL or missing references) //IL_0864: Unknown result type (might be due to invalid IL or missing references) //IL_0866: Unknown result type (might be due to invalid IL or missing references) //IL_086b: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_089f: Unknown result t