Decompiled source of Skateboard v1.0.0
Skateboard.dll
Decompiled 3 weeks 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.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 OpenScripts2; using OtherLoader; using UnityEngine; using VolksScripts; [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 VolksScripts { public class NVGPowerSwitch : FVRInteractiveObject { public PIPScope Scope; [HideInInspector] public bool Toggle = true; public override void SimpleInteraction(FVRViveHand hand) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); SM.PlayCoreSound((FVRPooledAudioType)10, ManagerSingleton<SM>.Instance.AudioEvent_AttachmentClick_Minor, ((Component)this).transform.position); if (Toggle) { Scope.enableNightvision = (Scope.enableThermal = false); } else { Scope.enableNightvision = (Scope.enableThermal = true); } Toggle = !Toggle; } } public class ANVIS21Control : MonoBehaviour { [Header("References")] public PIPScope scope; public Transform NVGObject; [Header("Positions")] public Vector3 OnLocalPosition; public Vector3 OffLocalPosition; public Vector3 OnLocalRotation; public Vector3 OffLocalRotation; [Header("Transition")] public float TransitionSpeed = 5f; [Header("Power State")] public bool IsPoweredOn = false; private Vector3 targetPos; private Quaternion targetRot; private void Start() { SetState(IsPoweredOn, instant: true); } private void Update() { //IL_001f: 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_0036: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)NVGObject != (Object)null) { NVGObject.localPosition = Vector3.Lerp(NVGObject.localPosition, targetPos, Time.deltaTime * TransitionSpeed); NVGObject.localRotation = Quaternion.Slerp(NVGObject.localRotation, targetRot, Time.deltaTime * TransitionSpeed); } if ((Object)(object)scope != (Object)null) { ((Behaviour)scope).enabled = IsPoweredOn; } } public void TogglePower() { SetState(!IsPoweredOn, instant: false); } public void SetState(bool on, bool instant) { //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_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_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) //IL_0070: 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) IsPoweredOn = on; if (on) { targetPos = OnLocalPosition; targetRot = Quaternion.Euler(OnLocalRotation); } else { targetPos = OffLocalPosition; targetRot = Quaternion.Euler(OffLocalRotation); } if (instant && (Object)(object)NVGObject != (Object)null) { NVGObject.localPosition = targetPos; NVGObject.localRotation = targetRot; } if ((Object)(object)scope != (Object)null) { ((Behaviour)scope).enabled = on; } } private void OnTriggerEnter(Collider other) { TogglePower(); } } } public class ForceBindToHead : MonoBehaviour { [Tooltip("The object that should follow the player's head (e.g. NVG physical root).")] public GameObject phys; [Tooltip("Optional: if true, runs even when not equipped.")] public bool alwaysFollow = true; private Transform headTransform; private void Start() { if ((Object)(object)GM.CurrentMovementManager != (Object)null && (Object)(object)GM.CurrentMovementManager.Head != (Object)null) { headTransform = ((Component)GM.CurrentMovementManager.Head).transform; } else { Debug.LogWarning((object)"[ForceBindToHead] Could not find head transform."); } } private void FixedUpdate() { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)phys == (Object)null) && (alwaysFollow || !((Object)(object)headTransform == (Object)null))) { if ((Object)(object)headTransform == (Object)null && (Object)(object)GM.CurrentMovementManager != (Object)null) { headTransform = ((Component)GM.CurrentMovementManager.Head).transform; } if ((Object)(object)phys.transform.parent != (Object)(object)headTransform) { phys.transform.SetParent(headTransform); } phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; } } } namespace JerryComponent { public class PNV57EControl : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scopeL; public PIPScope scopeR; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; public AudioSource whing; public float volref; private void Start() { scopeL.nvDef.nightVisionTargetBrightness = 0f; scopeL.nightVisionManualGainFactor = 0f; scopeR.nvDef.nightVisionTargetBrightness = 0f; scopeR.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Unknown result type (might be due to invalid IL or missing references) //IL_053a: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Invalid comparison between Unknown and I4 //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_0348: Invalid comparison between Unknown and I4 //IL_029c: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_037e: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_03d1: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scopeL).enabled = true; scopeL.UpdateParameters(); ((Behaviour)scopeR).enabled = true; scopeR.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 0f, ref reflum, offspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 0f, ref reflum, offspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0f, ref volref, offspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 0f, ref volref, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scopeL.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeL.nightVisionManualGainFactor, 1f, ref reflum, onspeed); scopeR.nightVisionManualGainFactor = Mathf.SmoothDamp(scopeR.nightVisionManualGainFactor, 1f, ref reflum, onspeed); whing.volume = Mathf.SmoothDamp(whing.volume, 0.5f, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, 1.3f, ref volref, onspeed); if (!started) { scopeL.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeL.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); scopeR.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scopeR.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scopeL.nvDef.nightVisionTargetBrightness > 0.9f && scopeR.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } public class PVS7Control : MonoBehaviour { public GameObject phys; public GameObject armreal; public GameObject armfake; public Vector3 velLinearWorldL; public Vector3 velLinearWorldR; public Transform slapdirUP; public Transform slapdirDown; public HeadAttachment HA; public PIPScope scope; public GameObject powerknob; public float refgain; public float reflum; public AudioEvent flip; public bool started = false; public float onspeed = 0.5f; public float offspeed = 2.5f; public bool isheadmounted = true; private void Start() { scope.nvDef.nightVisionTargetBrightness = 0f; scope.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; } private void FixedUpdate() { //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_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_0464: Unknown result type (might be due to invalid IL or missing references) //IL_0469: 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_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Invalid comparison between Unknown and I4 //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: 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_0132: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Invalid comparison between Unknown and I4 //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0290: 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_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: 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_0367: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) ((Behaviour)scope).enabled = true; scope.UpdateParameters(); if (isheadmounted) { armfake.transform.localEulerAngles = armreal.transform.localEulerAngles; phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; velLinearWorldL = GM.CurrentMovementManager.Hands[0].Input.VelLinearWorld; velLinearWorldR = GM.CurrentMovementManager.Hands[1].Input.VelLinearWorld; if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[0].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldL, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldL)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 0 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirUP.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirUP.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } else if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && (int)HA.MAState == 1 && Vector3.Distance(GM.CurrentMovementManager.Hands[1].PalmTransform.position, slapdirDown.position) < 0.15f && Vector3.Angle(velLinearWorldR, slapdirDown.forward) < 60f && ((Vector3)(ref velLinearWorldR)).magnitude > 1.5f) { HA.ToggleFlip(); SM.PlayCoreSound((FVRPooledAudioType)41, flip, phys.transform.position); } } if (powerknob.transform.localEulerAngles.x > 15f) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 0f, ref refgain, offspeed); scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 0f, ref reflum, offspeed); started = false; } else if (powerknob.transform.localEulerAngles.x < 15f) { scope.nightVisionManualGainFactor = Mathf.SmoothDamp(scope.nightVisionManualGainFactor, 1f, ref reflum, onspeed); if (!started) { scope.nvDef.nightVisionTargetBrightness = Mathf.SmoothDamp(scope.nvDef.nightVisionTargetBrightness, 1f, ref refgain, onspeed); } if (scope.nvDef.nightVisionTargetBrightness > 0.9f) { started = true; } } } private void OnDestroy() { Object.Destroy((Object)(object)phys); } } } public class FlamethrowerValve : FVRInteractiveObject { [Header("References")] public Transform RefFrame; public Transform Valve; [Header("Rotation Settings")] public Vector2 ValveRotRange = new Vector2(-50f, 50f); private float m_valveRot; [Header("Runtime")] public float Lerp = 0.5f; private Vector3 refDir = Vector3.one; public override void BeginInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0027: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((HandInput)(ref hand.Input)).Up; Vector3 val = Vector3.ProjectOnPlane(up, RefFrame.right); refDir = ((Vector3)(ref val)).normalized; ((FVRInteractiveObject)this).BeginInteraction(hand); } public override void UpdateInteraction(FVRViveHand hand) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_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) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((HandInput)(ref hand.Input)).Up; Vector3 val = Vector3.ProjectOnPlane(up, RefFrame.right); Vector3 normalized = ((Vector3)(ref val)).normalized; float num = Mathf.Atan2(Vector3.Dot(RefFrame.right, Vector3.Cross(refDir, normalized)), Vector3.Dot(refDir, normalized)) * 57.29578f; num = Mathf.Clamp(num, -5f, 5f); m_valveRot += num; m_valveRot = Mathf.Clamp(m_valveRot, ValveRotRange.x, ValveRotRange.y); Valve.localEulerAngles = new Vector3(m_valveRot, 0f, 0f); Lerp = Mathf.InverseLerp(ValveRotRange.x, ValveRotRange.y, m_valveRot); refDir = normalized; ((FVRInteractiveObject)this).UpdateInteraction(hand); } } [ExecuteInEditMode] public class HolographicSight : MonoBehaviour { public Transform VirtualQuad; public float Scale = 1f; public bool SizeCompensation = true; private MaterialPropertyBlock m_block; private void OnEnable() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown m_block = new MaterialPropertyBlock(); ((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block); } private void OnWillRenderObject() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.InverseTransformPoint(((Component)VirtualQuad).transform.position); m_block.SetVector("_Offset", Vector4.op_Implicit(val)); m_block.SetFloat("_Scale", Scale); m_block.SetFloat("_SizeCompensation", (!SizeCompensation) ? 0f : 1f); ((Component)this).GetComponent<Renderer>().SetPropertyBlock(m_block); } } namespace VolksScripts { public class BicLighter : FVRPhysicalObject { private bool m_isLit; private bool isTouching; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; [Header("Lighting Chance")] [Range(0f, 1f)] public float LightChance = 0.5f; private float currentChance; public Transform Flame; private float m_flame_min = 0.1f; private float m_flame_max = 0.85f; private float m_flame_cur = 0.1f; public AudioSource Audio_Lighter; public AudioClip AudioClip_Strike; public Transform[] FlameJoints; public float[] FlameWeights; public ParticleSystem Sparks; public AlloyAreaLight AlloyLight; public LayerMask LM_FireDamage; private RaycastHit m_hit; public override void Awake() { ((FVRPhysicalObject)this).Awake(); currentChance = LightChance; } public override void UpdateInteraction(FVRViveHand hand) { //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.AXButtonDown) { TryLight(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y < -0.5f) { TryLight(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } public override void FVRUpdate() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00d7: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isLit) { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_max, Time.deltaTime * 2f); AlloyLight.Intensity = m_flame_cur * (Mathf.PerlinNoise(Time.time * 10f, ((Component)AlloyLight).transform.position.y) * 0.05f + 0.5f); } else { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_min, Time.deltaTime * 7f); } Flame.localScale = new Vector3(m_flame_cur, m_flame_cur, m_flame_cur); Quaternion val = Quaternion.Inverse(((Component)this).transform.rotation); val = Quaternion.Slerp(val, Random.rotation, Mathf.PerlinNoise(Time.time * 5f, 0f) * 0.3f); for (int i = 0; i < FlameJoints.Length; i++) { Quaternion val2 = Quaternion.Slerp(Quaternion.identity, val, FlameWeights[i] + Random.Range(-0.05f, 0.05f)); FlameJoints[i].localScale = new Vector3(Random.Range(0.95f, 1.05f), Random.Range(0.98f, 1.02f), Random.Range(0.95f, 1.05f)); FlameJoints[i].localRotation = Quaternion.Slerp(FlameJoints[i].localRotation, val2, Time.deltaTime * 6f); } if (!m_isLit) { return; } Vector3 position = FlameJoints[0].position; Vector3 position2 = FlameJoints[FlameJoints.Length - 1].position; Vector3 val3 = position2 - position; if (Physics.Raycast(position, ((Vector3)(ref val3)).normalized, ref m_hit, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(LM_FireDamage), (QueryTriggerInteraction)2)) { IFVRDamageable component = ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val4 = new Damage(); val4.Class = (DamageClass)2; val4.Dam_Thermal = 50f; val4.Dam_TotalEnergetic = 50f; val4.point = ((RaycastHit)(ref m_hit)).point; val4.hitNormal = ((RaycastHit)(ref m_hit)).normal; val4.strikeDir = ((Component)this).transform.forward; obj.Damage(val4); } FVRIgnitable component2 = ((Component)((Component)((RaycastHit)(ref m_hit)).collider).transform).gameObject.GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, 0.1f); } } } private void TryLight() { Sparks.Emit(Random.Range(2, 3)); if (!m_isLit) { if (Random.value < currentChance) { m_isLit = true; Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); ((Component)Flame).gameObject.SetActive(true); currentChance = LightChance; } else { Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); currentChance += 0.1f; currentChance = Mathf.Clamp01(currentChance); } } else { m_isLit = false; ((Component)Flame).gameObject.SetActive(false); currentChance = LightChance; } } } public class Lighter : FVRPhysicalObject { private bool m_isLit; private bool isTouching; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; public Transform Flame; private float m_flame_min = 0.1f; private float m_flame_max = 0.85f; private float m_flame_cur = 0.1f; public AudioSource Audio_Lighter; public AudioClip AudioClip_Strike; public AudioClip AudioClip_Extinguish; public Transform[] FlameJoints; public float[] FlameWeights; public ParticleSystem Sparks; public AlloyAreaLight AlloyLight; public LayerMask LM_FireDamage; private RaycastHit m_hit; public override void UpdateInteraction(FVRViveHand hand) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown || hand.Input.AXButtonDown) { Light(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y > 0.5f || y < -0.5f) { Light(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } public override void FVRUpdate() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00d7: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: 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_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: 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_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Expected O, but got Unknown //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isLit) { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_max, Time.deltaTime * 2f); AlloyLight.Intensity = m_flame_cur * (Mathf.PerlinNoise(Time.time * 10f, ((Component)AlloyLight).transform.position.y) * 0.05f + 0.5f); } else { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_min, Time.deltaTime * 7f); } Flame.localScale = new Vector3(m_flame_cur, m_flame_cur, m_flame_cur); Quaternion val = Quaternion.Inverse(((Component)this).transform.rotation); val = Quaternion.Slerp(val, Random.rotation, Mathf.PerlinNoise(Time.time * 5f, 0f) * 0.3f); for (int i = 0; i < FlameJoints.Length; i++) { Quaternion val2 = Quaternion.Slerp(Quaternion.identity, val, FlameWeights[i] + Random.Range(-0.05f, 0.05f)); FlameJoints[i].localScale = new Vector3(Random.Range(0.95f, 1.05f), Random.Range(0.98f, 1.02f), Random.Range(0.95f, 1.05f)); FlameJoints[i].localRotation = Quaternion.Slerp(FlameJoints[i].localRotation, val2, Time.deltaTime * 6f); } if (!m_isLit) { return; } Vector3 position = FlameJoints[0].position; Vector3 position2 = FlameJoints[FlameJoints.Length - 1].position; Vector3 val3 = position2 - position; if (Physics.Raycast(position, ((Vector3)(ref val3)).normalized, ref m_hit, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(LM_FireDamage), (QueryTriggerInteraction)2)) { IFVRDamageable component = ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val4 = new Damage(); val4.Class = (DamageClass)2; val4.Dam_Thermal = 50f; val4.Dam_TotalEnergetic = 50f; val4.point = ((RaycastHit)(ref m_hit)).point; val4.hitNormal = ((RaycastHit)(ref m_hit)).normal; val4.strikeDir = ((Component)this).transform.forward; obj.Damage(val4); } FVRIgnitable component2 = ((Component)((Component)((RaycastHit)(ref m_hit)).collider).transform).gameObject.GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, 0.1f); } } } private void Light() { if (!m_isLit) { Sparks.Emit(Random.Range(2, 3)); m_isLit = true; Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); ((Component)Flame).gameObject.SetActive(true); } else { m_isLit = false; Audio_Lighter.PlayOneShot(AudioClip_Extinguish, 0.3f); ((Component)Flame).gameObject.SetActive(false); } } } } namespace Volks.Skateboard { [BepInPlugin("Volks.Skateboard", "Skateboard", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class SkateboardPlugin : 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(), "Volks.Skateboard"); OtherLoader.RegisterDirectLoad(BasePath, "Volks.Skateboard", "", "", "skateboard", ""); } } } public class PepperSpray : FVRFireArm { [Header("Spray Config")] public ParticleSystem SprayParticles; public GameObject SprayCloudPrefab; public Transform SprayOrigin; public AudioEvent AudEvent_Spray; public AudioSource AudSource_SprayLoop; public float SprayVolume = 40f; private bool m_isSpraying; private float m_triggerFloat; public override void FVRUpdate() { ((FVRFireArm)this).FVRUpdate(); UpdateControls(); UpdateSpray(); } private void UpdateControls() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { m_triggerFloat = ((FVRInteractiveObject)this).m_hand.Input.TriggerFloat; if (m_triggerFloat > 0.2f && HasFuel()) { if (!m_isSpraying) { m_isSpraying = true; if (AudEvent_Spray != null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Spray, SprayOrigin.position); } if ((Object)(object)SprayCloudPrefab != (Object)null) { Object.Instantiate<GameObject>(SprayCloudPrefab, SprayOrigin.position, SprayOrigin.rotation); } if ((Object)(object)AudSource_SprayLoop != (Object)null && !AudSource_SprayLoop.isPlaying) { AudSource_SprayLoop.Play(); } } base.Magazine.DrainFuel(Time.deltaTime); } else { StopSpraying(); } } else { m_triggerFloat = 0f; StopSpraying(); } } private void UpdateSpray() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)SprayParticles == (Object)null)) { EmissionModule emission = SprayParticles.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; if (m_isSpraying) { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverTime)).constantMax = SprayVolume; ((MinMaxCurve)(ref rateOverTime)).constantMin = SprayVolume; } else { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverTime)).constantMax = 0f; ((MinMaxCurve)(ref rateOverTime)).constantMin = 0f; } ((EmissionModule)(ref emission)).rateOverTime = rateOverTime; } } private void StopSpraying() { if (m_isSpraying && (Object)(object)AudSource_SprayLoop != (Object)null) { AudSource_SprayLoop.Stop(); } m_isSpraying = false; } private bool HasFuel() { return (Object)(object)base.Magazine != (Object)null && base.Magazine.FuelAmountLeft > 0f; } } namespace VolksScripts { public class PocketWatch : FVRPhysicalObject { [SerializeField] private GameObject secondsHandle; [SerializeField] private GameObject minutesHandle; [SerializeField] private GameObject hoursHandle; private float secondsMultiplier = 1f; public Transform WatchLid; public float openRotationX = 90f; public float openRotationY = 0f; public float openRotationZ = 0f; public float closeRotationX = 0f; public float closeRotationY = 0f; public float closeRotationZ = 0f; public float rotationSpeed = 5f; private bool isOpen = false; [SerializeField] private AudioSource openCloseAudioSource; [SerializeField] private AudioClip openClip; [SerializeField] private AudioClip closeClip; [SerializeField] private AudioSource tickingAudioSource; [SerializeField] private AudioClip tickingClip; private Coroutine tickingCoroutine; private bool isTouching = false; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; private void Update() { //IL_005c: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_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_0109: Unknown result type (might be due to invalid IL or missing references) DateTime now = DateTime.Now; int second = now.Second; int minute = now.Minute; int hour = now.Hour; float num = second * 6; float num2 = (float)(minute * 6) + (float)second * 0.1f; float num3 = (float)(hour * 30) + (float)minute * 0.5f; secondsHandle.transform.localRotation = Quaternion.Euler(0f - num, 0f, 0f); minutesHandle.transform.localRotation = Quaternion.Euler(0f - num2, 0f, 0f); hoursHandle.transform.localRotation = Quaternion.Euler(0f - num3, 0f, 0f); Quaternion val = ((!isOpen) ? Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ) : Quaternion.Euler(openRotationX, openRotationY, openRotationZ)); WatchLid.localRotation = Quaternion.Lerp(WatchLid.localRotation, val, Time.deltaTime * rotationSpeed); } public void ToggleLid() { isOpen = !isOpen; if (isOpen) { openCloseAudioSource.PlayOneShot(openClip); if (tickingCoroutine == null) { tickingCoroutine = ((MonoBehaviour)this).StartCoroutine(PlayTickingSound()); } return; } openCloseAudioSource.PlayOneShot(closeClip); if (tickingCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(tickingCoroutine); tickingCoroutine = null; } tickingAudioSource.Stop(); } private IEnumerator PlayTickingSound() { while (true) { tickingAudioSource.PlayOneShot(tickingClip); yield return (object)new WaitForSeconds(1f); } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown || hand.Input.AXButtonDown) { ToggleLid(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y > 0.5f || y < -0.5f) { ToggleLid(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } } public class ManualHammerBoltActionRifle : BoltActionRifle { [Header("Manual Hammer Settings")] public float HammerHalfCocked = 0.5f; public float HammerHalfCockedRot = 30f; public bool HammerUsesRotation = false; public Axis HammerRotationAxis = (Axis)2; public float HammerUncockedRot = 0f; public float HammerCockedRot = 60f; [Header("Hammer Animation Speed")] [Tooltip("Controls how fast the hammer moves to its target position/rotation.")] public float HammerAnimationSpeed = 15f; private bool m_isHammerHalfCocked = false; private bool m_wasBoltClosed = false; private const float kBoltClosedThreshold = 0.05f; public override void Awake() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) base.CockType = (HammerCockType)99; ((BoltActionRifle)this).Awake(); } public override void FVRUpdate() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0098: 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_00b3: 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) ((FVRFireArm)this).FVRUpdate(); bool flag = (int)base.CurBoltHandleState == 0 && base.BoltLerp <= 0.05f; if (!m_wasBoltClosed && flag) { SetHammerHalfCock(); } m_wasBoltClosed = flag; if ((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null) { if (((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode) { if (((FVRInteractiveObject)this).m_hand.Input.AXButtonDown) { TryManualCock(); } } else { Vector2 touchpadAxes = ((FVRInteractiveObject)this).m_hand.Input.TouchpadAxes; if (((FVRInteractiveObject)this).m_hand.Input.TouchpadDown && Vector2.Angle(touchpadAxes, Vector2.down) < 45f) { TryManualCock(); } } } UpdateHammerVisual(); } private void TryManualCock() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) if ((int)base.CurBoltHandleState == 0) { if (((BoltActionRifle)this).IsHammerCocked) { m_isHammerHalfCocked = false; return; } ((BoltActionRifle)this).CockHammer(); m_isHammerHalfCocked = false; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)7, 1f); } } private void SetHammerHalfCock() { if (((BoltActionRifle)this).IsHammerCocked) { m_isHammerHalfCocked = false; return; } m_isHammerHalfCocked = true; ((FVRFireArm)this).PlayAudioEvent((FirearmAudioEventType)6, 1f); UpdateHammerVisualImmediate(); } private void UpdateHammerVisual() { //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_00f8: Unknown result type (might be due to invalid IL or missing references) if (!base.HasVisualHammer || (Object)(object)base.Hammer == (Object)null) { return; } if (HammerUsesRotation) { float num = HammerUncockedRot; if (((BoltActionRifle)this).IsHammerCocked) { num = HammerCockedRot; } else if (m_isHammerHalfCocked) { num = HammerHalfCockedRot; } Vector3 localEulerAngles = base.Hammer.localEulerAngles; Axis hammerRotationAxis = HammerRotationAxis; if ((int)hammerRotationAxis != 0) { if ((int)hammerRotationAxis == 1) { localEulerAngles.y = Mathf.LerpAngle(localEulerAngles.y, num, Time.deltaTime * HammerAnimationSpeed); } else { localEulerAngles.z = Mathf.LerpAngle(localEulerAngles.z, num, Time.deltaTime * HammerAnimationSpeed); } } else { localEulerAngles.x = Mathf.LerpAngle(localEulerAngles.x, num, Time.deltaTime * HammerAnimationSpeed); } base.Hammer.localEulerAngles = localEulerAngles; } else { float num2 = base.HammerUncocked; if (((BoltActionRifle)this).IsHammerCocked) { num2 = base.HammerCocked; } else if (m_isHammerHalfCocked) { num2 = HammerHalfCocked; } Vector3 localPosition = base.Hammer.localPosition; localPosition.z = Mathf.Lerp(localPosition.z, num2, Time.deltaTime * HammerAnimationSpeed); base.Hammer.localPosition = localPosition; } } private void UpdateHammerVisualImmediate() { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_010e: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Invalid comparison between Unknown and I4 //IL_00b3: Unknown result type (might be due to invalid IL or missing references) if (!base.HasVisualHammer || (Object)(object)base.Hammer == (Object)null) { return; } if (HammerUsesRotation) { float num = (m_isHammerHalfCocked ? HammerHalfCockedRot : ((!((BoltActionRifle)this).IsHammerCocked) ? HammerUncockedRot : HammerCockedRot)); Vector3 localEulerAngles = base.Hammer.localEulerAngles; Axis hammerRotationAxis = HammerRotationAxis; if ((int)hammerRotationAxis != 0) { if ((int)hammerRotationAxis == 1) { localEulerAngles.y = num; } else { localEulerAngles.z = num; } } else { localEulerAngles.x = num; } base.Hammer.localEulerAngles = localEulerAngles; } else { float z = (m_isHammerHalfCocked ? HammerHalfCocked : ((!((BoltActionRifle)this).IsHammerCocked) ? base.HammerUncocked : base.HammerCocked)); Vector3 localPosition = base.Hammer.localPosition; localPosition.z = z; base.Hammer.localPosition = localPosition; } } public override void EndInteraction(FVRViveHand hand) { ((BoltActionRifle)this).EndInteraction(hand); if (((BoltActionRifle)this).IsHammerCocked) { m_isHammerHalfCocked = false; } } } } namespace JerryComponent { public class ParentPlayer : MonoBehaviour { public FVRPhysicalObject ObjItself; public bool kicked = false; public float kickForceMul = 10f; public GameObject ParentObj; public GameObject PlayerRef; public float SteerMul = 100f; public float MaxX; public float MinX; public float MaxY; public float MinY; public float MaxZ; public float MinZ; public GameObject board; public WheelCollider WheelSteerL; public WheelCollider WheelSteerR; public WheelCollider WheelStaticL; public WheelCollider WheelStaticR; [NonSerialized] public float WFL; [NonSerialized] public float WFR; [NonSerialized] public float WRL; [NonSerialized] public float WRR; public GameObject Fsus; public GameObject Rsus; public GameObject WheelFrontL; public GameObject WheelFrontR; public GameObject WheelRearL; public GameObject WheelRearR; public GameObject navb; [NonSerialized] public float FY; [NonSerialized] public float RY; [NonSerialized] public float BZ; [NonSerialized] public float WSL; [NonSerialized] public float WSR; [NonSerialized] public float WSL2; [NonSerialized] public float WSR2; private void Start() { navb.transform.SetParent((Transform)null); } private void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_007d: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_035d: 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_037a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_039c: Unknown result type (might be due to invalid IL or missing references) //IL_03a1: Unknown result type (might be due to invalid IL or missing references) //IL_03aa: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0702: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_0727: Unknown result type (might be due to invalid IL or missing references) //IL_072c: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_08b2: Unknown result type (might be due to invalid IL or missing references) //IL_08d6: Unknown result type (might be due to invalid IL or missing references) //IL_08fa: Unknown result type (might be due to invalid IL or missing references) //IL_081e: Unknown result type (might be due to invalid IL or missing references) //IL_0823: Unknown result type (might be due to invalid IL or missing references) //IL_0831: Unknown result type (might be due to invalid IL or missing references) //IL_0751: 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_042b: Unknown result type (might be due to invalid IL or missing references) //IL_0430: 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_044f: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_07cf: Unknown result type (might be due to invalid IL or missing references) //IL_07d4: Unknown result type (might be due to invalid IL or missing references) //IL_0536: Unknown result type (might be due to invalid IL or missing references) //IL_053b: Unknown result type (might be due to invalid IL or missing references) //IL_0561: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_0591: Unknown result type (might be due to invalid IL or missing references) //IL_0596: 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_05ed: Unknown result type (might be due to invalid IL or missing references) //IL_0612: Unknown result type (might be due to invalid IL or missing references) //IL_0617: Unknown result type (might be due to invalid IL or missing references) //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0646: 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_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_06cf: Unknown result type (might be due to invalid IL or missing references) //IL_06d4: Unknown result type (might be due to invalid IL or missing references) //IL_06e2: Unknown result type (might be due to invalid IL or missing references) WheelFrontL.transform.localEulerAngles = new Vector3(WheelFrontL.transform.localEulerAngles.x - WheelSteerL.rpm, 0f, 0f); WheelFrontR.transform.localEulerAngles = new Vector3(WheelFrontR.transform.localEulerAngles.x - WheelSteerR.rpm, 0f, 0f); WheelRearL.transform.localEulerAngles = new Vector3(WheelRearL.transform.localEulerAngles.x - WheelStaticL.rpm, 0f, 0f); WheelRearR.transform.localEulerAngles = new Vector3(WheelRearR.transform.localEulerAngles.x - WheelStaticR.rpm, 0f, 0f); WheelStaticL.motorTorque = Mathf.SmoothDamp(WheelStaticL.motorTorque, 0f, ref WSL, 5f); WheelStaticR.motorTorque = Mathf.SmoothDamp(WheelStaticR.motorTorque, 0f, ref WSR, 5f); WheelSteerL.motorTorque = Mathf.SmoothDamp(WheelSteerL.motorTorque, 0f, ref WSL2, 5f); WheelSteerR.motorTorque = Mathf.SmoothDamp(WheelSteerR.motorTorque, 0f, ref WSR2, 5f); if (((FVRInteractiveObject)ObjItself).IsHeld || (Object)(object)ObjItself.QuickbeltSlot != (Object)null) { WheelStaticL.motorTorque = 0f; WheelStaticR.motorTorque = 0f; WheelSteerL.motorTorque = 0f; WheelSteerR.motorTorque = 0f; navb.SetActive(false); ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); kicked = false; WheelSteerL.steerAngle = 0f; WheelSteerR.steerAngle = 0f; WheelStaticL.steerAngle = 0f; WheelStaticR.steerAngle = 0f; Fsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Rsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f); board.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } else { if (((FVRInteractiveObject)ObjItself).IsHeld || !((Object)(object)ObjItself.QuickbeltSlot == (Object)null)) { return; } navb.SetActive(true); if (!((Object)(object)GM.CurrentMovementManager != (Object)null)) { return; } PlayerRef.transform.position = new Vector3(((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.x, ((Component)GM.CurrentMovementManager).gameObject.transform.position.y, ((Component)GM.CurrentPlayerBody.Head).gameObject.transform.position.z); if (PlayerRef.transform.localPosition.x < MaxX && PlayerRef.transform.localPosition.x > MinX && PlayerRef.transform.localPosition.y < MaxY && PlayerRef.transform.localPosition.y > MinY && PlayerRef.transform.localPosition.z < MaxZ && PlayerRef.transform.localPosition.z > MinZ) { if (!kicked) { WheelStaticL.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul; WheelStaticR.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul; WheelSteerL.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul; WheelSteerR.motorTorque = ((Vector3)(ref GM.CurrentMovementManager.m_smoothLocoVelocity)).magnitude * kickForceMul; kicked = true; } WheelSteerL.steerAngle = PlayerRef.transform.localPosition.x * SteerMul; WheelSteerR.steerAngle = PlayerRef.transform.localPosition.x * SteerMul; board.transform.localEulerAngles = new Vector3(PlayerRef.transform.localPosition.x * -73.3f, 0f, 0f); Fsus.transform.localEulerAngles = new Vector3(0f, PlayerRef.transform.localPosition.x * 100f, 0f); Rsus.transform.localEulerAngles = new Vector3(0f, PlayerRef.transform.localPosition.x * -100f, 0f); WheelStaticL.steerAngle = PlayerRef.transform.localPosition.x * (0f - SteerMul); WheelStaticR.steerAngle = PlayerRef.transform.localPosition.x * (0f - SteerMul); ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent(ParentObj.transform); ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles.y, 0f); } else if (PlayerRef.transform.localPosition.x > 2f * MaxX || PlayerRef.transform.localPosition.x < 2f * MinX || PlayerRef.transform.localPosition.y > 2f * MaxY || PlayerRef.transform.localPosition.y < 2f * MinY || PlayerRef.transform.localPosition.z > 2f * MaxZ || PlayerRef.transform.localPosition.z < 2f * MinZ) { if (kicked) { ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles = new Vector3(0f, ((Component)GM.CurrentMovementManager).gameObject.transform.eulerAngles.y, 0f); ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); kicked = false; } WheelSteerL.steerAngle = 0f; WheelSteerR.steerAngle = 0f; WheelStaticL.steerAngle = 0f; WheelStaticR.steerAngle = 0f; Fsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f); Rsus.transform.localEulerAngles = new Vector3(0f, 0f, 0f); board.transform.localEulerAngles = new Vector3(0f, 0f, 0f); } } } private void OnDestroy() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) Object.Destroy((Object)(object)navb); kicked = false; WheelSteerL.steerAngle = Mathf.Lerp(WheelSteerL.steerAngle, 0f, 0.1f); WheelSteerR.steerAngle = Mathf.Lerp(WheelSteerL.steerAngle, 0f, 0.1f); WheelStaticL.steerAngle = Mathf.Lerp(WheelStaticL.steerAngle, 0f, 0.1f); WheelStaticR.steerAngle = Mathf.Lerp(WheelStaticR.steerAngle, 0f, 0.1f); Fsus.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(Fsus.transform.localEulerAngles.y, 0f, ref FY, 0.25f), 0f); Rsus.transform.localEulerAngles = new Vector3(0f, Mathf.SmoothDamp(Rsus.transform.localEulerAngles.y, 0f, ref RY, 0.25f), 0f); board.transform.localEulerAngles = new Vector3(Mathf.SmoothDamp(board.transform.localEulerAngles.x, 0f, ref BZ, 0.25f), 0f, 0f); ((Component)GM.CurrentMovementManager).gameObject.transform.SetParent((Transform)null); } } } namespace VolksScripts { public class WheelVisualSync : MonoBehaviour { public WheelCollider wheelCollider; public Transform wheelVisual; public Vector3 visualRotationOffset; public bool useLocalPose = false; private void Start() { if ((Object)(object)wheelCollider == (Object)null) { wheelCollider = ((Component)this).GetComponent<WheelCollider>(); } if ((Object)(object)wheelVisual == (Object)null) { wheelVisual = ((Component)this).transform; } } private void LateUpdate() { //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_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)wheelCollider == (Object)null) && !((Object)(object)wheelVisual == (Object)null)) { Vector3 val = default(Vector3); Quaternion val2 = default(Quaternion); wheelCollider.GetWorldPose(ref val, ref val2); Quaternion val3 = Quaternion.Euler(visualRotationOffset); if (useLocalPose && (Object)(object)wheelVisual.parent != (Object)null) { wheelVisual.parent.InverseTransformPoint(val); wheelVisual.localPosition = wheelVisual.parent.InverseTransformPoint(val); wheelVisual.localRotation = Quaternion.Inverse(wheelVisual.parent.rotation) * val2 * val3; } else { wheelVisual.position = val; wheelVisual.rotation = val2 * val3; } } } } } public class UBFlameTankRelease : FVRInteractiveObject { public AttachableFirearm AFireArm; public override bool IsInteractable() { return (Object)(object)AFireArm != (Object)null && (Object)(object)AFireArm.Magazine != (Object)null; } public override void BeginInteraction(FVRViveHand hand) { if (!((Object)(object)AFireArm == (Object)null) && (Object)(object)AFireArm.Magazine != (Object)null) { FVRFireArmMagazine magazine = AFireArm.Magazine; AFireArm.EjectMag(false); hand.ForceSetInteractable((FVRInteractiveObject)(object)magazine); ((FVRInteractiveObject)magazine).BeginInteraction(hand); } } } namespace VolksScripts { public class CigarCase : FVRPhysicalObject { private bool isOpen = false; private bool isTouching = false; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; public Transform CaseLid; public float openRotationX = 90f; public float openRotationY = 0f; public float openRotationZ = 0f; public float closeRotationX = 0f; public float closeRotationY = 0f; public float closeRotationZ = 0f; public float rotationSpeed = 5f; public AudioSource audioSource; public AudioClip openSound; public AudioClip closeSound; public GameObject objectToToggle; public List<Transform> Dings; public int m_numDings; public CigarCaseTrigger cigarCaseTrigger; private Quaternion targetRotation; public override void Start() { //IL_0019: 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) CaseLid.localRotation = Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ); targetRotation = CaseLid.localRotation; } private void Update() { //IL_000d: 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_0024: Unknown result type (might be due to invalid IL or missing references) CaseLid.localRotation = Quaternion.Lerp(CaseLid.localRotation, targetRotation, Time.deltaTime * rotationSpeed); } public override void UpdateInteraction(FVRViveHand hand) { //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if (hand.Input.BYButtonDown || hand.Input.AXButtonDown) { ToggleLid(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if (y > 0.5f || y < -0.5f) { ToggleLid(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } private void ToggleLid() { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) isOpen = !isOpen; targetRotation = ((!isOpen) ? Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ) : Quaternion.Euler(openRotationX, openRotationY, openRotationZ)); if (isOpen) { if ((Object)(object)audioSource != (Object)null && (Object)(object)openSound != (Object)null) { audioSource.PlayOneShot(openSound); } if ((Object)(object)objectToToggle != (Object)null) { objectToToggle.SetActive(true); } Open(); } else { if ((Object)(object)audioSource != (Object)null && (Object)(object)closeSound != (Object)null) { audioSource.PlayOneShot(closeSound); } if ((Object)(object)objectToToggle != (Object)null) { objectToToggle.SetActive(false); } Close(); } } public bool IsOpen() { return isOpen; } public bool HasADing() { return m_numDings > 0; } public override void FVRUpdate() { ((FVRPhysicalObject)this).FVRUpdate(); } public void Open() { isOpen = true; if ((Object)(object)audioSource != (Object)null && (Object)(object)openSound != (Object)null) { audioSource.PlayOneShot(openSound); } UpdateDingDisplay(); } public void Close() { isOpen = false; if ((Object)(object)audioSource != (Object)null && (Object)(object)closeSound != (Object)null) { audioSource.PlayOneShot(closeSound); } UpdateDingDisplay(); } public void RemoveDing() { if (m_numDings > 0) { m_numDings--; UpdateDingDisplay(); } } private void UpdateDingDisplay() { for (int i = 0; i < Dings.Count; i++) { if (i < m_numDings) { ((Component)Dings[i]).gameObject.SetActive(true); } else { ((Component)Dings[i]).gameObject.SetActive(false); } } } } } public class CigarCaseTrigger : FVRInteractiveObject { public CigarCase cigarCase; public GameObject cigarPrefab; public override bool IsInteractable() { return cigarCase.HasADing() && ((FVRInteractiveObject)this).IsInteractable(); } public override void BeginInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); } public override void SimpleInteraction(FVRViveHand hand) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).SimpleInteraction(hand); if (cigarCase.IsOpen()) { cigarCase.RemoveDing(); GameObject val = Object.Instantiate<GameObject>(cigarPrefab, ((HandInput)(ref hand.Input)).Pos, ((HandInput)(ref hand.Input)).Rot); FVRPhysicalObject component = val.GetComponent<FVRPhysicalObject>(); hand.ForceSetInteractable((FVRInteractiveObject)(object)component); ((FVRInteractiveObject)component).BeginInteraction(hand); } else { cigarCase.Open(); } } } public class FVRCigar : QBArmorHelmet { public GameObject FireGO; public GameObject LinkedObject; public AudioSource fireAud; public float BurnDuration = 120f; public float DestructionDelay = 10f; public MeshFilter cigarMeshFilter; public MeshRenderer cigarRenderer; public Mesh burntMesh; public Material burntMaterial; public float damageInterval = 1f; private float damageTimer = 0f; private bool m_isBurning = false; private bool m_hasBeenLit = false; private float m_burnTimer; private bool m_isEquipped = false; private float m_unequippedTimer = 0f; private bool m_hasBurntOut = false; private FVRPlayerBody playerBody; public float damageAmount = 1f; public override void Awake() { ((QBArmorHelmet)this).Awake(); if ((Object)(object)FireGO != (Object)null) { fireAud = FireGO.GetComponent<AudioSource>(); FireGO.SetActive(false); } if ((Object)(object)LinkedObject != (Object)null) { LinkedObject.SetActive(false); } playerBody = Object.FindObjectOfType<FVRPlayerBody>(); } public override void FVRUpdate() { ((QBArmorPiece)this).FVRUpdate(); if (m_isBurning) { m_burnTimer -= Time.deltaTime; if ((Object)(object)fireAud != (Object)null) { fireAud.volume = Mathf.Lerp(fireAud.volume, 0f, Time.deltaTime / BurnDuration); } if (m_burnTimer <= 0f) { StopBurning(); } if (m_isEquipped && (Object)(object)playerBody != (Object)null) { damageTimer += Time.deltaTime; if (damageTimer >= damageInterval) { playerBody.RegisterPlayerHit(1f, false, playerBody.GetPlayerIFF()); damageTimer = 0f; } } } if (m_hasBurntOut && !m_isEquipped && !((FVRInteractiveObject)this).IsHeld) { m_unequippedTimer += Time.deltaTime; if (m_unequippedTimer >= DestructionDelay) { Debug.Log((object)"Cigar destroyed after being unequipped and left alone."); Object.Destroy((Object)(object)((Component)this).gameObject); } } else { m_unequippedTimer = 0f; } } public void Ignite() { if (!m_hasBeenLit) { m_hasBeenLit = true; m_isBurning = true; m_burnTimer = BurnDuration; if ((Object)(object)FireGO != (Object)null) { FireGO.SetActive(true); } if ((Object)(object)fireAud != (Object)null) { fireAud.Play(); } if ((Object)(object)LinkedObject != (Object)null) { LinkedObject.SetActive(true); } } } private void StopBurning() { m_isBurning = false; m_hasBurntOut = true; if ((Object)(object)FireGO != (Object)null) { FireGO.SetActive(false); } if ((Object)(object)fireAud != (Object)null) { fireAud.Stop(); } if ((Object)(object)cigarMeshFilter != (Object)null && (Object)(object)burntMesh != (Object)null) { cigarMeshFilter.mesh = burntMesh; } if ((Object)(object)cigarRenderer != (Object)null && (Object)(object)burntMaterial != (Object)null) { ((Renderer)cigarRenderer).material = burntMaterial; } Debug.Log((object)"Cigar has burnt out."); } public override void SetQuickBeltSlot(FVRQuickBeltSlot slot) { ((QBArmorHelmet)this).SetQuickBeltSlot(slot); if ((Object)(object)slot != (Object)null) { m_isEquipped = true; m_unequippedTimer = 0f; } else { m_isEquipped = false; } } } namespace VolksScripts { public class MatchStick : FVRPhysicalObject { private bool m_isLit; private bool m_hasBurntOut; private bool isTouching; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; public Transform Flame; private float m_flame_min = 0.1f; private float m_flame_max = 0.85f; private float m_flame_cur = 0.1f; public AudioSource Audio_Lighter; public AudioClip AudioClip_Strike; public AudioClip AudioClip_Extinguish; public Transform[] FlameJoints; public float[] FlameWeights; public ParticleSystem Sparks; public AlloyAreaLight AlloyLight; public LayerMask LM_FireDamage; private RaycastHit m_hit; public float BurnDuration = 10f; private float burnTimer = 0f; public float DestructionDelay = 5f; private float destructionTimer = 0f; public MeshFilter matchstickMeshFilter; public MeshRenderer matchstickRenderer; public Mesh burntMesh; public Material burntMaterial; public override void UpdateInteraction(FVRViveHand hand) { //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.IsInStreamlinedMode) { if ((hand.Input.BYButtonDown || hand.Input.AXButtonDown) && !m_hasBurntOut) { Light(); } return; } if (hand.Input.TouchpadTouched && !isTouching && hand.Input.TouchpadAxes != Vector2.zero) { isTouching = true; initTouch = hand.Input.TouchpadAxes; } if (hand.Input.TouchpadTouchUp && isTouching) { isTouching = false; Vector2 lastTouchPoint = LastTouchPoint; float y = (lastTouchPoint - initTouch).y; if ((y > 0.5f || y < -0.5f) && !m_hasBurntOut) { Light(); } initTouch = Vector2.zero; lastTouchPoint = Vector2.zero; } LastTouchPoint = hand.Input.TouchpadAxes; } public override void FVRUpdate() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0215: 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_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Expected O, but got Unknown //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02e5: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); if (m_isLit) { burnTimer += Time.deltaTime; if (burnTimer >= BurnDuration) { BurnOut(); } m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_max, Time.deltaTime * 2f); AlloyLight.Intensity = m_flame_cur * (Mathf.PerlinNoise(Time.time * 10f, ((Component)AlloyLight).transform.position.y) * 0.05f + 0.5f); } else { m_flame_cur = Mathf.Lerp(m_flame_cur, m_flame_min, Time.deltaTime * 7f); } Flame.localScale = new Vector3(m_flame_cur, m_flame_cur, m_flame_cur); Quaternion val = Quaternion.Inverse(((Component)this).transform.rotation); val = Quaternion.Slerp(val, Random.rotation, Mathf.PerlinNoise(Time.time * 5f, 0f) * 0.3f); for (int i = 0; i < FlameJoints.Length; i++) { Quaternion val2 = Quaternion.Slerp(Quaternion.identity, val, FlameWeights[i] + Random.Range(-0.05f, 0.05f)); FlameJoints[i].localScale = new Vector3(Random.Range(0.95f, 1.05f), Random.Range(0.98f, 1.02f), Random.Range(0.95f, 1.05f)); FlameJoints[i].localRotation = Quaternion.Slerp(FlameJoints[i].localRotation, val2, Time.deltaTime * 6f); } if (m_isLit) { Vector3 position = FlameJoints[0].position; Vector3 position2 = FlameJoints[FlameJoints.Length - 1].position; Vector3 val3 = position2 - position; if (Physics.Raycast(position, ((Vector3)(ref val3)).normalized, ref m_hit, ((Vector3)(ref val3)).magnitude, LayerMask.op_Implicit(LM_FireDamage), (QueryTriggerInteraction)2)) { IFVRDamageable component = ((Component)((RaycastHit)(ref m_hit)).collider).gameObject.GetComponent<IFVRDamageable>(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<IFVRDamageable>(); } if (component != null) { IFVRDamageable obj = component; Damage val4 = new Damage(); val4.Class = (DamageClass)2; val4.Dam_Thermal = 50f; val4.Dam_TotalEnergetic = 50f; val4.point = ((RaycastHit)(ref m_hit)).point; val4.hitNormal = ((RaycastHit)(ref m_hit)).normal; val4.strikeDir = ((Component)this).transform.forward; obj.Damage(val4); } FVRIgnitable component2 = ((Component)((Component)((RaycastHit)(ref m_hit)).collider).transform).gameObject.GetComponent<FVRIgnitable>(); if ((Object)(object)component2 == (Object)null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent<FVRIgnitable>(); } if ((Object)(object)component2 != (Object)null) { FXM.Ignite(component2, 0.1f); } } } if (m_hasBurntOut && !((FVRInteractiveObject)this).IsHeld) { destructionTimer += Time.deltaTime; if (destructionTimer >= DestructionDelay) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); if (m_hasBurntOut) { destructionTimer = 0f; } } private void Light() { if (!m_isLit && !m_hasBurntOut) { Sparks.Emit(Random.Range(2, 3)); m_isLit = true; burnTimer = 0f; Audio_Lighter.PlayOneShot(AudioClip_Strike, 0.3f); ((Component)Flame).gameObject.SetActive(true); } } private void BurnOut() { m_isLit = false; m_hasBurntOut = true; Audio_Lighter.PlayOneShot(AudioClip_Extinguish, 0.3f); ((Component)Flame).gameObject.SetActive(false); if ((Object)(object)matchstickMeshFilter != (Object)null && (Object)(object)burntMesh != (Object)null) { matchstickMeshFilter.mesh = burntMesh; } if ((Object)(object)matchstickRenderer != (Object)null && (Object)(object)burntMaterial != (Object)null) { ((Renderer)matchstickRenderer).material = burntMaterial; } destructionTimer = 0f; } } public class Shellholder : FVRInteractiveObject { [Header("Shellholder Config")] public bool IsManuallyExtractable; public bool IsAccessible; private FVRFireArmRound m_round; public bool IsFull; [Header("Proxy Display")] public Transform ProxyRound; public MeshFilter ProxyMesh; public MeshRenderer ProxyRenderer; private ObjectTemperature geoTemp; public FVRFireArmRound GetRound() { return m_round; } protected void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0035: 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_0055: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).Awake(); GameObject val = new GameObject("Proxy"); ProxyRound = val.transform; ProxyRound.SetParent(((Component)this).transform); ProxyRound.localPosition = Vector3.zero; ProxyRound.localEulerAngles = Vector3.zero; ProxyRound.localScale = Vector3.one; ProxyMesh = val.AddComponent<MeshFilter>(); ProxyRenderer = val.AddComponent<MeshRenderer>(); geoTemp = ((Component)ProxyRound).gameObject.AddComponent<ObjectTemperature>(); geoTemp.renderers.Add((Renderer)(object)ProxyRenderer); } public void UpdateProxyDisplay() { if ((Object)(object)m_round == (Object)null) { ProxyMesh.mesh = null; ((Renderer)ProxyRenderer).material = null; ((Renderer)ProxyRenderer).enabled = false; return; } if ((Object)(object)m_round.FiredRenderer != (Object)null) { ProxyMesh.mesh = ((Component)m_round.FiredRenderer).gameObject.GetComponent<MeshFilter>().sharedMesh; ((Renderer)ProxyRenderer).material = m_round.FiredRenderer.sharedMaterial; } else { ProxyMesh.mesh = null; ((Renderer)ProxyRenderer).material = null; } ((Renderer)ProxyRenderer).enabled = true; } public void SetRound(FVRFireArmRound round) { if ((Object)(object)round == (Object)null) { Debug.LogWarning((object)"Attempting to set a null round in Shellholder."); } m_round = round; IsFull = (Object)(object)round != (Object)null; UpdateProxyDisplay(); } public void Unload() { SetRound(null); } public override void BeginInteraction(FVRViveHand hand) { if (IsManuallyExtractable && IsAccessible && IsFull) { FVRFireArmRound round = m_round; SetRound(null); if ((Object)(object)round != (Object)null) { ((FVRInteractiveObject)round).BeginInteraction(hand); hand.ForceSetInteractable((FVRInteractiveObject)(object)round); } } } private void OnTriggerEnter(Collider other) { FVRFireArmRound component = ((Component)other).GetComponent<FVRFireArmRound>(); if ((Object)(object)component != (Object)null && !IsFull) { SetRound(component); Object.Destroy((Object)(object)((Component)component).gameObject); Debug.Log((object)"Round stored in shellholder (proxy only)."); } } } } public class TorchTrigger : MonoBehaviour { public FVRCigar Torch; public Collider collider; private void OnTriggerEnter(Collider col) { collider.enabled = false; ((Component)collider).gameObject.layer = La