using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Linq; 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 Sodalite.Api; using Sodalite.Utilities; using UnityEditor; using UnityEngine; using UnityEngine.AI; using UnityEngine.UI; 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.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 PNV57EControlAdj : MonoBehaviour { public GameObject phys; 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; public float pitref; public float volume; public float pitch; public GameObject root; public int scopePara; private void Start() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) scopePara = GM.Options.SimulationOptions.ScopeRecursiveRendering; GM.Options.SimulationOptions.ScopeRecursiveRendering = 0; GM.RefreshQuality(); powerknob.transform.localEulerAngles = new Vector3(30f, 0f, 0f); scopeL.nvDef.nightVisionTargetBrightness = 0f; scopeL.nightVisionManualGainFactor = 0f; scopeR.nvDef.nightVisionTargetBrightness = 0f; scopeR.nightVisionManualGainFactor = 0f; refgain = 0f; reflum = 0f; volref = 0f; pitref = 0f; whing.volume = 0f; whing.pitch = 0f; } private void FixedUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) root.transform.localPosition = new Vector3(0f, 0f, 0f); ((Behaviour)scopeL).enabled = true; scopeL.UpdateParameters(); ((Behaviour)scopeR).enabled = true; scopeR.UpdateParameters(); if (isheadmounted) { phys.transform.SetParent(((Component)GM.CurrentMovementManager.Head).gameObject.transform); phys.transform.localPosition = Vector3.zero; phys.transform.localEulerAngles = Vector3.zero; } 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 pitref, 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, volume, ref volref, onspeed); whing.pitch = Mathf.SmoothDamp(whing.pitch, pitch, ref pitref, 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); GM.Options.SimulationOptions.ScopeRecursiveRendering = scopePara; GM.RefreshQuality(); } } 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); } } } namespace VolksScripts { public class Bulletholder : FVRPhysicalObject { [Header("Bullet Slots")] [Tooltip("Positions where rounds will be placed. Order defines fill order.")] public List BulletSlots = new List(); [Header("Visuals (optional)")] public MeshRenderer SlotHighlight; [Header("Behaviors")] public bool ClearVelocityOnPlace = true; [Header("Capacity")] public int capacity = 8; private FVRFireArmRound[] _storedRounds; public int NumRounds { get; private set; } protected void Awake() { ((FVRPhysicalObject)this).Awake(); if (BulletSlots == null) { BulletSlots = new List(); } _storedRounds = (FVRFireArmRound[])(object)new FVRFireArmRound[capacity]; NumRounds = 0; UpdateBulletDisplay(); } public bool TryPlace(FVRFireArmRound round) { if ((Object)(object)round == (Object)null || NumRounds >= capacity) { return false; } int num = FindFirstFreeSlot(); if (num < 0) { return false; } return PlaceAtIndex(round, num); } public bool PlaceAtIndex(FVRFireArmRound round, int index) { if ((Object)(object)round == (Object)null || index < 0 || index >= capacity) { return false; } if ((Object)(object)_storedRounds[index] != (Object)null) { return false; } PlaceAtSlot(round, BulletSlots[index]); _storedRounds[index] = round; NumRounds++; UpdateBulletDisplay(); return true; } public FVRFireArmRound RemoveAt(int index) { if (index < 0 || index >= capacity) { return null; } FVRFireArmRound val = _storedRounds[index]; if ((Object)(object)val != (Object)null) { _storedRounds[index] = null; NumRounds--; UpdateBulletDisplay(); } return val; } public FVRFireArmRound GetAt(int index) { if (index < 0 || index >= capacity) { return null; } return _storedRounds[index]; } public void ClearAll() { for (int i = 0; i < capacity; i++) { _storedRounds[i] = null; } NumRounds = 0; UpdateBulletDisplay(); } private void PlaceAtSlot(FVRFireArmRound round, Transform slot) { //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_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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_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_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) Vector3 up = ((Component)this).transform.up; Rigidbody val = ((!((Object)(object)((FVRPhysicalObject)round).RootRigidbody != (Object)null)) ? ((Component)round).GetComponent() : ((FVRPhysicalObject)round).RootRigidbody); if ((Object)(object)val != (Object)null && ClearVelocityOnPlace) { val.velocity = Vector3.zero; val.angularVelocity = Vector3.zero; } ((Component)round).transform.rotation = Quaternion.LookRotation(((Component)this).transform.forward, up); if (TryGetBaseAndTipAlongUp(round, up, out var baseAlongUp, out var _)) { float num = Vector3.Dot(slot.position, up); float num2 = num - baseAlongUp; Transform transform = ((Component)round).transform; transform.position += up * num2; Collider componentInChildren = ((Component)round).GetComponentInChildren(); Bounds bounds = componentInChildren.bounds; Vector3 val2 = Vector3.ProjectOnPlane(slot.position, up); Vector3 val3 = Vector3.ProjectOnPlane(((Bounds)(ref bounds)).center, up); Vector3 val4 = val2 - val3; Transform transform2 = ((Component)round).transform; transform2.position += val4; } else { ((Component)round).transform.position = slot.position; } if ((Object)(object)SlotHighlight != (Object)null) { ((Component)SlotHighlight).transform.position = slot.position; } } private bool TryGetBaseAndTipAlongUp(FVRFireArmRound round, Vector3 up, out float baseAlongUp, out float tipAlongUp) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) baseAlongUp = (tipAlongUp = 0f); Collider componentInChildren = ((Component)round).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return false; } Bounds bounds = componentInChildren.bounds; baseAlongUp = Vector3.Dot(((Bounds)(ref bounds)).min, up); tipAlongUp = Vector3.Dot(((Bounds)(ref bounds)).max, up); return true; } private int FindFirstFreeSlot() { for (int i = 0; i < capacity; i++) { if ((Object)(object)_storedRounds[i] == (Object)null) { return i; } } return -1; } public void UpdateBulletDisplay() { for (int i = 0; i < BulletSlots.Count; i++) { if ((Object)(object)BulletSlots[i] != (Object)null) { } } } } public class BulletholderReloadTrigger : MonoBehaviour { public Bulletholder Holder; private void OnTriggerEnter(Collider other) { Debug.Log((object)("Trigger entered by: " + ((Object)other).name)); FVRFireArmRound component = ((Component)other).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)Holder != (Object)null) { Holder.TryPlace(component); } } } } public class Compass : FVRPhysicalObject { [Header("Compass Lid")] public Transform Lid; 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 lidRotationSpeed = 5f; public AudioSource openCloseAudioSource; public AudioClip openClip; public AudioClip closeClip; [Header("Compass Needle")] public Transform Needle; [Tooltip("The direction that is considered North. Default is (0,0,1) (Z+).")] public Vector3 NorthDirection = Vector3.forward; public float needleSmoothTime = 0.5f; public float needleWobbleAmount = 2f; public float needleWobbleSpeed = 5f; private bool isOpen = false; private bool isTouching = false; private Vector2 initTouch = Vector2.zero; private Vector2 lastTouchPoint = Vector2.zero; private float currentNeedleAngle = 0f; private float needleVelocity = 0f; private void Update() { //IL_003a: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0070: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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_0135: Unknown result type (might be due to invalid IL or missing references) Quaternion val = ((!isOpen) ? Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ) : Quaternion.Euler(openRotationX, openRotationY, openRotationZ)); if ((Object)(object)Lid != (Object)null) { Lid.localRotation = Quaternion.Lerp(Lid.localRotation, val, Time.deltaTime * lidRotationSpeed); } if ((Object)(object)Needle != (Object)null) { Vector3 normalized = ((Vector3)(ref NorthDirection)).normalized; Vector3 val2 = Vector3.ProjectOnPlane(((Component)this).transform.forward, Vector3.up); Vector3 val3 = Vector3.ProjectOnPlane(normalized, Vector3.up); float num = Mathf.Atan2(Vector3.Cross(val2, val3).y, Vector3.Dot(val2, val3)) * 57.29578f; float num2 = Mathf.Sin(Time.time * needleWobbleSpeed) * needleWobbleAmount; num += num2; currentNeedleAngle = Mathf.SmoothDampAngle(currentNeedleAngle, num, ref needleVelocity, needleSmoothTime); Needle.localRotation = Quaternion.Euler(0f, currentNeedleAngle, 0f); } } public void ToggleLid() { isOpen = !isOpen; if ((Object)(object)openCloseAudioSource != (Object)null) { openCloseAudioSource.PlayOneShot((!isOpen) ? closeClip : openClip); } } 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 val = lastTouchPoint; float y = (val - initTouch).y; if (y > 0.5f || y < -0.5f) { ToggleLid(); } initTouch = Vector2.zero; val = Vector2.zero; } lastTouchPoint = hand.Input.TouchpadAxes; } } 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); } } public class FlareBody : FVRPhysicalObject { [Header("Flare Parts")] public GameObject FlareHead; public Transform HeadAttachPoint; public Collider StrikeArea; [Header("Ignition")] public int StrikesToIgnite = 3; public float StrikeCooldown = 0.2f; [Header("Effects")] public ParticleSystem FlareParticles; public Light FlareLight; public AudioSource IgniteSound; public AudioSource BurnLoopSound; public AudioSource DieSound; [Header("Lifetime")] public float FlareLifetime = 20f; private int m_strikeCount = 0; private bool m_isHeadAttached = true; private bool m_isIgnited = false; private float m_lastStrikeTime = -1f; private Coroutine m_lifetimeCoroutine; protected void Awake() { ((FVRPhysicalObject)this).Awake(); AttachHead(); if ((Object)(object)FlareParticles != (Object)null) { FlareParticles.Stop(); } if ((Object)(object)FlareLight != (Object)null) { ((Behaviour)FlareLight).enabled = false; } if ((Object)(object)BurnLoopSound != (Object)null) { BurnLoopSound.Stop(); } } public void DetachHead() { if (!m_isHeadAttached) { return; } m_isHeadAttached = false; if ((Object)(object)FlareHead != (Object)null) { FlareHead.transform.parent = null; Rigidbody component = FlareHead.GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = false; } } } public void AttachHead() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) m_isHeadAttached = true; if ((Object)(object)FlareHead != (Object)null && (Object)(object)HeadAttachPoint != (Object)null) { FlareHead.transform.parent = HeadAttachPoint; FlareHead.transform.localPosition = Vector3.zero; FlareHead.transform.localRotation = Quaternion.identity; Rigidbody component = FlareHead.GetComponent(); if ((Object)(object)component != (Object)null) { component.isKinematic = true; } } } public void Strike() { if (!m_isIgnited && !m_isHeadAttached && !(Time.time - m_lastStrikeTime < StrikeCooldown)) { m_lastStrikeTime = Time.time; m_strikeCount++; if (m_strikeCount >= StrikesToIgnite) { Ignite(); } } } private void Ignite() { m_isIgnited = true; if ((Object)(object)FlareParticles != (Object)null) { FlareParticles.Play(); } if ((Object)(object)FlareLight != (Object)null) { ((Behaviour)FlareLight).enabled = true; } if ((Object)(object)IgniteSound != (Object)null) { IgniteSound.Play(); } if ((Object)(object)BurnLoopSound != (Object)null) { BurnLoopSound.loop = true; BurnLoopSound.Play(); } if ((Object)(object)FlareHead != (Object)null) { Object.Destroy((Object)(object)FlareHead); } if (m_lifetimeCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(m_lifetimeCoroutine); } m_lifetimeCoroutine = ((MonoBehaviour)this).StartCoroutine(FlareLifeCoroutine()); } private IEnumerator FlareLifeCoroutine() { yield return (object)new WaitForSeconds(FlareLifetime); if ((Object)(object)BurnLoopSound != (Object)null) { BurnLoopSound.Stop(); } if ((Object)(object)DieSound != (Object)null) { DieSound.Play(); } if ((Object)(object)FlareParticles != (Object)null) { FlareParticles.Stop(); } if ((Object)(object)FlareLight != (Object)null) { ((Behaviour)FlareLight).enabled = false; } float dieSoundLength = ((!((Object)(object)DieSound != (Object)null) || !((Object)(object)DieSound.clip != (Object)null)) ? 0f : DieSound.clip.length); yield return (object)new WaitForSeconds(dieSoundLength); Object.Destroy((Object)(object)((Component)this).gameObject); } public override void OnCollisionEnter(Collision col) { //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) ((FVRPhysicalObject)this).OnCollisionEnter(col); if (m_isHeadAttached || m_isIgnited || !((Object)(object)StrikeArea != (Object)null)) { return; } ContactPoint[] contacts = col.contacts; for (int i = 0; i < contacts.Length; i++) { ContactPoint val = contacts[i]; if (((Object)(object)((ContactPoint)(ref val)).thisCollider == (Object)(object)StrikeArea || (Object)(object)((ContactPoint)(ref val)).otherCollider == (Object)(object)StrikeArea) && (((Object)(object)((ContactPoint)(ref val)).thisCollider != (Object)null && (Object)(object)((Component)((ContactPoint)(ref val)).thisCollider).gameObject.GetComponent() != (Object)null) || ((Object)(object)((ContactPoint)(ref val)).otherCollider != (Object)null && (Object)(object)((Component)((ContactPoint)(ref val)).otherCollider).gameObject.GetComponent() != (Object)null))) { Strike(); break; } } } } public class FlareHead : FVRPhysicalObject { } public class FlyingHotdog : MonoBehaviour { [Tooltip("Seconds to wait before the hotdog starts flying.")] public float waitTime = 2f; [Header("Speed Settings")] [Tooltip("Minimum speed the hotdog can fly.")] public float minFlySpeed = 3f; [Tooltip("Maximum speed the hotdog can fly.")] public float maxFlySpeed = 7f; [Tooltip("How often the hotdog changes direction (seconds).")] public float directionChangeInterval = 1f; [Tooltip("How much the hotdog can move up or down per direction change.")] public float verticalVariance = 2f; [Tooltip("How quickly the hotdog turns toward its new direction. Higher = snappier.")] public float turnSpeed = 1.2f; [Header("Flock Settings")] [Tooltip("Prefab of the hotdog to spawn.")] public GameObject hotdogPrefab; [Tooltip("Minimum number of hotdogs in a flock.")] public int minFlockSize = 3; [Tooltip("Maximum number of hotdogs in a flock.")] public int maxFlockSize = 8; [Tooltip("Spawn radius for flock members.")] public float flockRadius = 2f; [Tooltip("Minimum flying height (Y axis).")] public float minFlyHeight = 15f; [Tooltip("Maximum flying height (Y axis).")] public float maxFlyHeight = 25f; [Tooltip("If true, this object is a flock spawner.")] public bool isSpawner = true; [Tooltip("Delay before spawning the rest of the flock (seconds).")] public float flockSpawnDelay = 1f; private Rigidbody rb; private Vector3 flyDirection; private Vector3 targetDirection; private float currentFlySpeed; private float velocityLerp = 0f; private float targetFlyHeight; private bool isFlying = false; private void Start() { //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) rb = ((Component)this).GetComponent(); if ((Object)(object)rb == (Object)null) { rb = ((Component)this).gameObject.AddComponent(); } rb.useGravity = false; rb.isKinematic = true; rb.collisionDetectionMode = (CollisionDetectionMode)2; rb.interpolation = (RigidbodyInterpolation)1; rb.WakeUp(); if (isSpawner && (Object)(object)hotdogPrefab != (Object)null) { ((MonoBehaviour)this).StartCoroutine(SpawnFlockWithDelay()); return; } currentFlySpeed = minFlySpeed; if (Mathf.Approximately(targetFlyHeight, 0f)) { targetFlyHeight = GetCeilingHeight(((Component)this).transform.position, minFlyHeight, maxFlyHeight); } SetInitialDirection(); flyDirection = targetDirection; ((MonoBehaviour)this).StartCoroutine(FlyRoutine()); } private IEnumerator SpawnFlockWithDelay() { yield return (object)new WaitForSeconds(flockSpawnDelay); int flockCount = Random.Range(minFlockSize, maxFlockSize + 1); for (int i = 0; i < flockCount; i++) { Vector3 val = Random.insideUnitSphere * flockRadius; Vector3 val2 = ((Component)this).transform.position + val; GameObject val3 = Object.Instantiate(hotdogPrefab, val2, Quaternion.identity); val3.SetActive(true); FlyingHotdog component = val3.GetComponent(); if ((Object)(object)component != (Object)null) { component.isSpawner = false; component.targetFlyHeight = GetCeilingHeight(val2, minFlyHeight, maxFlyHeight); } } Object.Destroy((Object)(object)((Component)this).gameObject); } private IEnumerator FlyRoutine() { yield return (object)new WaitForSeconds(waitTime); while (Mathf.Abs(((Component)this).transform.position.y - targetFlyHeight) > 0.1f) { yield return (object)new WaitForFixedUpdate(); float dt = Time.fixedDeltaTime; Vector3 pos = ((Component)this).transform.position; float ascendSpeed = Mathf.Lerp(minFlySpeed, maxFlySpeed, 0.5f); float nextY = Mathf.MoveTowards(pos.y, targetFlyHeight, ascendSpeed * dt); Vector3 nextPos = new Vector3(pos.x, nextY, pos.z); rb.MovePosition(nextPos); } isFlying = true; ((MonoBehaviour)this).StartCoroutine(FlockFlyRoutine()); } private IEnumerator FlockFlyRoutine() { RaycastHit hit = default(RaycastHit); while (true) { SetTargetDirection(); float targetSpeed = Random.Range(minFlySpeed, maxFlySpeed); float timer = 0f; float dt; for (velocityLerp = 0f; timer < directionChangeInterval; timer += dt) { yield return (object)new WaitForFixedUpdate(); dt = Time.fixedDeltaTime; velocityLerp += dt / directionChangeInterval; currentFlySpeed = Mathf.Lerp(currentFlySpeed, targetSpeed, velocityLerp); FlyingHotdog flyingHotdog = this; Vector3 val = Vector3.Slerp(flyDirection, targetDirection, dt * turnSpeed); flyingHotdog.flyDirection = ((Vector3)(ref val)).normalized; Vector3 move = flyDirection * currentFlySpeed * dt; Vector3 nextPos = ((Component)this).transform.position + move; nextPos.y = Mathf.Clamp(nextPos.y, minFlyHeight, maxFlyHeight); if (Physics.Raycast(((Component)this).transform.position, flyDirection, ref hit, ((Vector3)(ref move)).magnitude + 0.5f)) { FlyingHotdog flyingHotdog2 = this; Vector3 val2 = Vector3.Reflect(flyDirection, ((RaycastHit)(ref hit)).normal); flyingHotdog2.flyDirection = ((Vector3)(ref val2)).normalized; targetDirection = flyDirection; } rb.MovePosition(nextPos); } } } private void SetInitialDirection() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * 0.5f; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.y); targetDirection = ((Vector3)(ref val2)).normalized; } private void SetTargetDirection() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; float num = Random.Range(0f - verticalVariance, verticalVariance); float num2 = Mathf.Clamp(((Component)this).transform.position.y + num, minFlyHeight, maxFlyHeight) - ((Component)this).transform.position.y; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(normalized.x, num2, normalized.y); targetDirection = ((Vector3)(ref val)).normalized; } private float GetCeilingHeight(Vector3 pos, float min, float max) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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) RaycastHit val = default(RaycastHit); if (Physics.Raycast(pos + Vector3.up * 2f, Vector3.up, ref val, max - min + 2f)) { return Mathf.Clamp(((RaycastHit)(ref val)).point.y - 1f, min, max); } return Random.Range(min, max); } } [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().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().SetPropertyBlock(m_block); } } public class ClosedBoltMagRelease : FVRInteractiveObject { public ClosedBoltWeapon Weapon; protected void Awake() { ((FVRInteractiveObject)this).Awake(); } public override void SimpleInteraction(FVRViveHand hand) { if ((Object)(object)Weapon != (Object)null && ((Object)(object)((FVRInteractiveObject)Weapon).m_hand == (Object)null || (Object)(object)hand != (Object)(object)((FVRInteractiveObject)Weapon).m_hand)) { ((FVRFireArm)Weapon).EjectMag(false); } ((FVRInteractiveObject)this).SimpleInteraction(hand); } } public class GiantSlingshot : FVRFireArm { [Header("Slingshot")] public Transform Basket; public Transform String_Left; public Transform String_Right; public Transform Centroid; public Transform String_LeftTarget; public Transform String_RightTarget; public GameObject ColGO_Upper; public GameObject ColGO_Basket; public Collider Col_Basket; [Header("Mounting")] public Collider Col; public LayerMask LM_CTest; public float MountRaycastDistance = 0.2f; [Header("Audio")] public AudioEvent AudEvent_Mount; public AudioEvent AudEvent_Fire; [Header("Slingshot Settings")] public float maxSlingVel = 20f; public float maxSlingDistance = 0.5f; private FVRPhysicalObject m_slungObject; private Vector3 m_basketLocalOffset = Vector3.zero; private bool isSlungObjectBeingSlinged; private Vector3 m_basketWorldVel = Vector3.zero; private bool m_isCol; private float m_colChange; private RaycastHit m_hit; public override void OnCollisionEnter(Collision collision) { //IL_00b9: 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_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //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_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).OnCollisionEnter(collision); if ((Object)(object)m_slungObject != (Object)null) { return; } if ((Object)(object)((ContactPoint)(ref collision.contacts[0])).thisCollider == (Object)(object)Col_Basket && (Object)(object)((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody != (Object)null && (Object)(object)((Component)((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody).gameObject.GetComponent() != (Object)null) { FVRPhysicalObject component = ((Component)((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody).gameObject.GetComponent(); Vector3 val = Basket.InverseTransformPoint(((Component)component).transform.position); if (((FVRInteractiveObject)component).IsHeld && !component.RootRigidbody.isKinematic) { if (!(val.z > 0f)) { Vector3 relativeVelocity = collision.relativeVelocity; if (!(Vector3.Angle(((Vector3)(ref relativeVelocity)).normalized, -((Component)this).transform.forward) < 45f)) { goto IL_0173; } } m_slungObject = component; m_basketLocalOffset = ((Component)component).transform.InverseTransformPoint(Basket.position); ColGO_Upper.SetActive(false); ColGO_Basket.SetActive(false); SM.PlayCoreSound((FVRPooledAudioType)0, AudEvent_Mount, Basket.position); } } goto IL_0173; IL_0173: if (CanMakeColChange() && !m_isCol && ((FVRInteractiveObject)this).IsHeld) { Vector3 relativeVelocity2 = collision.relativeVelocity; if (((Vector3)(ref relativeVelocity2)).magnitude > 1f && (Object)(object)((ContactPoint)(ref collision.contacts[0])).thisCollider == (Object)(object)Col && ((Object)(object)((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody == (Object)null || ((ContactPoint)(ref collision.contacts[0])).otherCollider.attachedRigidbody.isKinematic)) { ColOn(); } } } public override void FVRFixedUpdate() { //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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_02d8: 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_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0311: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0178: 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_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01de: 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_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //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_00b5: 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_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)m_slungObject != (Object)null && ((Object)(object)m_slungObject.RootRigidbody == (Object)null || !((Component)m_slungObject).gameObject.activeSelf || (Object)(object)m_slungObject.QuickbeltSlot != (Object)null)) { m_slungObject = null; } if ((Object)(object)m_slungObject == (Object)null) { isSlungObjectBeingSlinged = false; } else if (!isSlungObjectBeingSlinged) { if (((FVRInteractiveObject)m_slungObject).IsHeld) { Vector3 position = ((Component)m_slungObject).transform.TransformPoint(m_basketLocalOffset); Basket.position = position; Vector3 val = Centroid.position - Basket.position; if (((Vector3)(ref val)).magnitude > 0.001f) { Basket.rotation = Quaternion.LookRotation(val, ((Component)this).transform.up); } SyncBasketCollider(); } else { isSlungObjectBeingSlinged = true; Vector3 val2 = Centroid.position - Basket.position; float magnitude = ((Vector3)(ref val2)).magnitude; float num = Mathf.Clamp(magnitude / maxSlingDistance, 0f, 1f); float num2 = Mathf.Lerp(0.1f, maxSlingVel, num); m_slungObject.RootRigidbody.velocity = ((Vector3)(ref val2)).normalized * num2; m_slungObject.RootRigidbody.angularVelocity = Vector3.zero; float num3 = 0.1f + 0.3f * num; float num4 = Random.Range(0.7f, 0.75f) + num * 0.4f; SM.PlayCoreSoundOverrides((FVRPooledAudioType)0, AudEvent_Fire, Basket.position, new Vector2(num3, num3), new Vector2(num4, num4)); m_basketWorldVel = Vector3.zero; } } else { Centroid.rotation = Quaternion.LookRotation(m_slungObject.RootRigidbody.velocity); if (Centroid.InverseTransformPoint(((Component)m_slungObject).transform.position).z >= 0.3f) { isSlungObjectBeingSlinged = false; m_slungObject = null; ColGO_Upper.SetActive(true); ColGO_Basket.SetActive(true); Basket.position = Centroid.position; Basket.rotation = Quaternion.LookRotation(((Component)this).transform.forward, ((Component)this).transform.up); SyncBasketCollider(); } else { Vector3 position2 = ((Component)m_slungObject).transform.TransformPoint(m_basketLocalOffset); Basket.position = position2; Transform basket = Basket; Vector3 velocity = m_slungObject.RootRigidbody.velocity; basket.rotation = Quaternion.LookRotation(((Vector3)(ref velocity)).normalized, ((Component)this).transform.up); SyncBasketCollider(); } } UpdateStrings(); if (m_colChange > 0f) { m_colChange -= Time.fixedDeltaTime; } ((FVRFireArm)this).FVRFixedUpdate(); } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); if ((hand.Input.VelLinearWorld.y > 0.5f || hand.Input.TriggerPressed) && m_isCol && CanMakeColChange()) { ColOff(); } } private void UpdateStrings() { //IL_00a8: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)String_Left == (Object)null) && !((Object)(object)String_Right == (Object)null) && !((Object)(object)String_LeftTarget == (Object)null) && !((Object)(object)String_RightTarget == (Object)null)) { if (!((Component)String_Left).gameObject.activeSelf) { ((Component)String_Left).gameObject.SetActive(true); } if (!((Component)String_Right).gameObject.activeSelf) { ((Component)String_Right).gameObject.SetActive(true); } float num = 15f * Time.deltaTime; Vector3 val = String_LeftTarget.position - String_Left.position; float num2 = Mathf.Lerp(String_Left.localScale.z, ((Vector3)(ref val)).magnitude, num); String_Left.rotation = Quaternion.Slerp(String_Left.rotation, Quaternion.LookRotation(val, ((Component)this).transform.up), num); String_Left.localScale = new Vector3(1f, 1f, Mathf.Max(0.01f, num2)); Vector3 val2 = String_RightTarget.position - String_Right.position; float num3 = Mathf.Lerp(String_Right.localScale.z, ((Vector3)(ref val2)).magnitude, num); String_Right.rotation = Quaternion.Slerp(String_Right.rotation, Quaternion.LookRotation(val2, ((Component)this).transform.up), num); String_Right.localScale = new Vector3(1f, 1f, Mathf.Max(0.01f, num3)); } } private void SyncBasketCollider() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Col_Basket != (Object)null) { ((Component)Col_Basket).transform.position = Basket.position; ((Component)Col_Basket).transform.rotation = Basket.rotation; } } private bool CanMakeColChange() { return m_colChange <= 0f; } private void ColOn() { //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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_005b: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)this).transform.position; Quaternion rotation = ((Component)this).transform.rotation; if (!(Vector3.Angle(Vector3.up, ((Component)this).transform.forward) > 80f) && Physics.Raycast(((Component)this).transform.position, Vector3.down, ref m_hit, MountRaycastDistance, LayerMask.op_Implicit(LM_CTest), (QueryTriggerInteraction)1)) { position = ((RaycastHit)(ref m_hit)).point + Vector3.up * 0.022f; rotation = Quaternion.LookRotation(GM.CurrentPlayerBody.Head.position - position, Vector3.up); m_isCol = true; Col.enabled = false; m_colChange = 1f; ((Component)this).transform.position = position; ((Component)this).transform.rotation = rotation; ((FVRPhysicalObject)this).RootRigidbody.isKinematic = true; SM.PlayImpactSound((ImpactType)160, (MatSoundType)3, (AudioImpactIntensity)2, ((Component)this).transform.position, (FVRPooledAudioType)41, 10f); } } private void ColOff() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (m_isCol) { m_isCol = false; m_colChange = 1f; Col.enabled = true; ((FVRPhysicalObject)this).RootRigidbody.isKinematic = false; SM.PlayImpactSound((ImpactType)160, (MatSoundType)3, (AudioImpactIntensity)1, ((Component)this).transform.position, (FVRPooledAudioType)41, 10f); } } } namespace VolksScripts { public class HeartbeatSensor : FVRPhysicalObject { [Header("Sensor Settings")] public float[] ScanningRanges = new float[3] { 5f, 10f, 20f }; public int CurrentRangeIndex = 0; public float BatteryLifeSeconds = 60f; public float RechargeRate = 10f; [Header("UI & Audio")] public RectTransform Screen; public GameObject PingDotPrefab; public GameObject WallRectPrefab; public AudioSource BeepAudio; public Image BatteryBar; public Text BatteryText; [Header("Button Audio")] public AudioSource ButtonAudioSource; public AudioClip ButtonPressClip; [Header("Detection")] public LayerMask SosigMask; public LayerMask WallMask; [Header("Audio Ping")] public float PingInterval = 1f; private float _pingTimer = 0f; [Header("Radar Filtering")] public float MaxPingHeight = 2f; [Header("Ping Wave")] public GameObject PingWavePrefab; public float PingWaveDuration = 0.8f; private List _activePingWaves = new List(); [Header("Battery Blink")] [Range(0f, 1f)] public float LowBatteryThreshold = 0.25f; public Color LowBatteryColor = Color.red; public float BlinkSpeed = 4f; [Header("Enemy Floor Detection")] [Tooltip("Max vertical distance to consider an enemy on the same floor.")] public float SameFloorHeightThreshold = 0.75f; private Color _batteryTextNormalColor; private Coroutine _blinkRoutine; private bool _isBlinking; private Dictionary _pings = new Dictionary(); private Dictionary _wallRects = new Dictionary(); private bool _isOn = false; private float _battery; private bool _enemyDetected = false; private bool _enemyOnSameFloor = false; private Transform _directionReference; protected void Start() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) _battery = BatteryLifeSeconds; if ((Object)(object)Screen != (Object)null) { ((Component)Screen).gameObject.SetActive(_isOn); } if ((Object)(object)BatteryText != (Object)null) { _batteryTextNormalColor = ((Graphic)BatteryText).color; } GameObject val = new GameObject("DirectionReference"); _directionReference = val.transform; _directionReference.parent = null; _directionReference.position = Vector3.zero; _directionReference.rotation = Quaternion.identity; UpdateUI(); } private void Update() { if ((Object)(object)Screen != (Object)null) { ((Component)Screen).gameObject.SetActive(_isOn); } if (_isOn) { _battery -= Time.deltaTime; if (_battery <= 0f) { _battery = 0f; _isOn = false; if ((Object)(object)Screen != (Object)null) { ((Component)Screen).gameObject.SetActive(false); } UpdateUI(); return; } UpdateScreen(); _pingTimer += Time.deltaTime; if (_pingTimer >= PingInterval && _enemyOnSameFloor) { if (Object.op_Implicit((Object)(object)BeepAudio) && !BeepAudio.mute && (Object)(object)BeepAudio.clip != (Object)null) { BeepAudio.PlayOneShot(BeepAudio.clip); } SpawnPingWave(); _pingTimer = 0f; } } else { if (_battery < BatteryLifeSeconds) { _battery += Time.deltaTime * RechargeRate; } if (Object.op_Implicit((Object)(object)BeepAudio) && BeepAudio.isPlaying) { BeepAudio.Stop(); } _pingTimer = 0f; } UpdateUI(); } private void UpdateUI() { float num = _battery / BatteryLifeSeconds; if (Object.op_Implicit((Object)(object)BatteryBar)) { BatteryBar.fillAmount = num; } if (Object.op_Implicit((Object)(object)BatteryText)) { BatteryText.text = Mathf.RoundToInt(num * 100f) + "%"; if (num <= LowBatteryThreshold) { StartBlink(); } else { StopBlink(); } } } private void StartBlink() { if (!((Object)(object)BatteryText == (Object)null) && !_isBlinking) { _isBlinking = true; _blinkRoutine = ((MonoBehaviour)this).StartCoroutine(BlinkBatteryText()); } } private void StopBlink() { //IL_0053: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)BatteryText == (Object)null) && _isBlinking) { _isBlinking = false; if (_blinkRoutine != null) { ((MonoBehaviour)this).StopCoroutine(_blinkRoutine); } _blinkRoutine = null; ((Graphic)BatteryText).color = _batteryTextNormalColor; } } private IEnumerator BlinkBatteryText() { while (_isBlinking) { float t = (Mathf.Sin(Time.time * BlinkSpeed) + 1f) * 0.5f; ((Graphic)BatteryText).color = Color.Lerp(_batteryTextNormalColor, LowBatteryColor, t); yield return null; } } private void UpdateScreen() { //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_008c: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_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_0323: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) float num = ScanningRanges[CurrentRangeIndex]; float num2 = ((Component)this).transform.position.y; if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)GM.CurrentPlayerBody.Torso != (Object)null) { num2 = GM.CurrentPlayerBody.Torso.position.y + 0.3f; } float num3 = num2 - MaxPingHeight * 0.5f; float num4 = num2 + MaxPingHeight * 0.5f; Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, num, LayerMask.op_Implicit(SosigMask)); HashSet hashSet = new HashSet(); _enemyOnSameFloor = false; Vector2 anchoredPosition = default(Vector2); for (int i = 0; i < array.Length; i++) { Transform transform = ((Component)array[i]).transform; float y = transform.position.y; if ((Object)(object)((Component)transform).GetComponentInParent() != (Object)null) { continue; } FVRPlayerHitbox componentInParent = ((Component)transform).GetComponentInParent(); if ((!((Object)(object)componentInParent != (Object)null) || !((Object)(object)componentInParent.Body != (Object)null)) && !(y < num3) && !(y > num4)) { hashSet.Add(transform); if (!_pings.ContainsKey(transform)) { GameObject value = Object.Instantiate(PingDotPrefab, (Transform)(object)Screen); _pings[transform] = value; } Vector3 val = _directionReference.InverseTransformPoint(transform.position - ((Component)this).transform.position); Rect rect = Screen.rect; float num5 = ((Rect)(ref rect)).width / 2f; Rect rect2 = Screen.rect; float num6 = ((Rect)(ref rect2)).height / 2f; float num7 = Mathf.Max(num5, num6); anchoredPosition.x = val.x / num * num7; anchoredPosition.y = val.z / num * num7; if (Mathf.Abs(anchoredPosition.x) > num5 || Mathf.Abs(anchoredPosition.y) > num6) { _pings[transform].SetActive(false); } else { _pings[transform].SetActive(true); } _pings[transform].GetComponent().anchoredPosition = anchoredPosition; if (Mathf.Abs(y - num2) <= SameFloorHeightThreshold) { _enemyOnSameFloor = true; } } } List list = new List(_pings.Keys); for (int j = 0; j < list.Count; j++) { if (!hashSet.Contains(list[j])) { Object.Destroy((Object)(object)_pings[list[j]]); _pings.Remove(list[j]); } } _enemyDetected = hashSet.Count > 0; Collider[] array2 = Physics.OverlapSphere(((Component)this).transform.position, num, LayerMask.op_Implicit(WallMask)); HashSet hashSet2 = new HashSet(); foreach (Collider val2 in array2) { if (IsLikelyWall(val2)) { Bounds bounds = val2.bounds; float y2 = ((Bounds)(ref bounds)).min.y; Bounds bounds2 = val2.bounds; float y3 = ((Bounds)(ref bounds2)).max.y; if (!(y3 < num3) && !(y2 > num4)) { hashSet2.Add(val2); DrawWallOnScreenRadar_TopDown(val2, num); } } } List list2 = new List(_wallRects.Keys); for (int l = 0; l < list2.Count; l++) { if (!hashSet2.Contains(list2[l])) { Object.Destroy((Object)(object)_wallRects[list2[l]]); _wallRects.Remove(list2[l]); } } } private bool IsLikelyWall(Collider wall) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = wall.bounds; return ((Bounds)(ref bounds)).size.y >= 1.5f; } private Vector2 ProjectToRadar(Vector3 worldPos, float range) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) Vector3 val = _directionReference.InverseTransformPoint(worldPos - ((Component)this).transform.position); Rect rect = Screen.rect; float num = ((Rect)(ref rect)).width / 2f; Rect rect2 = Screen.rect; float num2 = ((Rect)(ref rect2)).height / 2f; float num3 = Mathf.Max(num, num2); Vector2 result = default(Vector2); result.x = val.x / range * num3; result.y = val.z / range * num3; return result; } private void DrawWallOnScreenRadar_TopDown(Collider wall, float range) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: 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_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: 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_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0356: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0374: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = wall.bounds; Vector3 center = ((Bounds)(ref bounds)).center; Vector3 extents = ((Bounds)(ref bounds)).extents; Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(center.x + extents.x, center.y, center.z + extents.z), new Vector3(center.x + extents.x, center.y, center.z - extents.z), new Vector3(center.x - extents.x, center.y, center.z + extents.z), new Vector3(center.x - extents.x, center.y, center.z - extents.z), new Vector3(center.x + extents.x, center.y, center.z), new Vector3(center.x - extents.x, center.y, center.z), new Vector3(center.x, center.y, center.z + extents.z), new Vector3(center.x, center.y, center.z - extents.z) }; Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(float.MaxValue, float.MaxValue); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(float.MinValue, float.MinValue); for (int i = 0; i < array.Length; i++) { Vector2 val3 = ProjectToRadar(array[i], range); val = Vector2.Min(val, val3); val2 = Vector2.Max(val2, val3); } Rect rect = Screen.rect; float num = ((Rect)(ref rect)).width / 2f; Rect rect2 = Screen.rect; float num2 = ((Rect)(ref rect2)).height / 2f; val.x = Mathf.Clamp(val.x, 0f - num, num); val.y = Mathf.Clamp(val.y, 0f - num2, num2); val2.x = Mathf.Clamp(val2.x, 0f - num, num); val2.y = Mathf.Clamp(val2.y, 0f - num2, num2); float num3 = Mathf.Abs(val2.x - val.x); Rect rect3 = Screen.rect; float num4 = Mathf.Min(num3, ((Rect)(ref rect3)).width); float num5 = Mathf.Abs(val2.y - val.y); Rect rect4 = Screen.rect; float num6 = Mathf.Min(num5, ((Rect)(ref rect4)).height); if (!_wallRects.TryGetValue(wall, out var value)) { value = Object.Instantiate(WallRectPrefab, (Transform)(object)Screen); _wallRects[wall] = value; } value.SetActive(true); RectTransform component = value.GetComponent(); component.anchoredPosition = (val + val2) * 0.5f; component.sizeDelta = new Vector2(num4, num6); } private void SpawnPingWave() { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)PingWavePrefab) && Object.op_Implicit((Object)(object)Screen)) { GameObject val = Object.Instantiate(PingWavePrefab, (Transform)(object)Screen); val.GetComponent().anchoredPosition = Vector2.zero; ((Transform)val.GetComponent()).localScale = Vector3.one; _activePingWaves.Add(val); ((MonoBehaviour)this).StartCoroutine(AnimatePingWave(val)); } } private IEnumerator AnimatePingWave(GameObject wave) { RectTransform rt = wave.GetComponent(); Image img = wave.GetComponent(); float t = 0f; Color startColor = ((Graphic)img).color; while (t < PingWaveDuration) { float norm = t / PingWaveDuration; ((Transform)rt).localScale = Vector3.one * Mathf.Lerp(0.2f, 1.2f, norm); ((Graphic)img).color = new Color(startColor.r, startColor.g, startColor.b, Mathf.Lerp(0.5f, 0f, norm)); t += Time.deltaTime; yield return null; } _activePingWaves.Remove(wave); Object.Destroy((Object)(object)wave); } public void ToggleAudio() { if (Object.op_Implicit((Object)(object)BeepAudio)) { BeepAudio.mute = !BeepAudio.mute; } PlayButtonSound(); } public void IncreaseRange() { if (CurrentRangeIndex < ScanningRanges.Length - 1) { CurrentRangeIndex++; } PlayButtonSound(); } public void DecreaseRange() { if (CurrentRangeIndex > 0) { CurrentRangeIndex--; } PlayButtonSound(); } public void TogglePower() { _isOn = !_isOn && _battery > 0f; if ((Object)(object)Screen != (Object)null) { ((Component)Screen).gameObject.SetActive(_isOn); } UpdateUI(); PlayButtonSound(); } private void PlayButtonSound() { if (Object.op_Implicit((Object)(object)ButtonAudioSource) && Object.op_Implicit((Object)(object)ButtonPressClip)) { ButtonAudioSource.PlayOneShot(ButtonPressClip); } } } public class HeartbeatSensorButton : FVRInteractiveObject { public enum ButtonType { Power, Audio, RangePlus, RangeMinus } [Header("Button Settings")] public HeartbeatSensor TargetSensor; public ButtonType Type; public AudioSource ButtonAudioSource; public AudioClip ButtonPressClip; private bool m_isToggled = false; public bool IsToggled => m_isToggled; protected void Awake() { ((FVRInteractiveObject)this).Awake(); } public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); TriggerAction(); } private void TriggerAction() { if (!((Object)(object)TargetSensor == (Object)null)) { switch (Type) { case ButtonType.Power: m_isToggled = !m_isToggled; TargetSensor.TogglePower(); break; case ButtonType.Audio: m_isToggled = !m_isToggled; TargetSensor.ToggleAudio(); break; case ButtonType.RangePlus: TargetSensor.IncreaseRange(); break; case ButtonType.RangeMinus: TargetSensor.DecreaseRange(); break; } if (Object.op_Implicit((Object)(object)ButtonAudioSource) && Object.op_Implicit((Object)(object)ButtonPressClip)) { ButtonAudioSource.PlayOneShot(ButtonPressClip); } } } } } public class GrillButton : FVRInteractiveObject { public KebabGrill grill; public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); if ((Object)(object)grill != (Object)null) { grill.ToggleGrill(); } } } [RequireComponent(typeof(Collider))] public class KebabGrill : FVRInteractiveObject { [Header("Spawner params")] public string itemID; public bool isInfinite = true; [Tooltip("How many objects can be taken from this spawner before it runs out")] public int objectCapacity; private int objectsRemaining; private AnvilCallback itemLoader; [Header("Audio")] public AudioSource audioSource; public AudioClip emptyClip; public AudioClip grillOnClip; public AudioClip grillOffClip; public AudioSource grillLoopSource; public AudioClip grillLoopClip; [Header("Scaling")] public Transform visualToScale; public Vector3 fullScale = Vector3.one; public Vector3 emptyScale = new Vector3(0.2f, 0.2f, 0.2f); [Header("Regeneration")] public bool enableRegeneration = false; public float regenTime = 10f; [Header("Grill Visuals")] public Renderer grillRenderer; public Material grillOnMaterial; public Material grillOffMaterial; [Header("Rotating Object")] public GameObject spinnyThing; public float spinRate = 180f; public int spinAxis = 1; [Header("Grill Toggle Object")] public GameObject grillToggleObject; [Header("Button Animation")] public Transform buttonTransform; public bool animateButtonTranslation = true; public Vector3 buttonOnPosition; public Vector3 buttonOffPosition; public Vector3 buttonOnRotation; public Vector3 buttonOffRotation; public float buttonAnimSpeed = 8f; private Coroutine regenCoroutine; private bool grillOn = false; private float buttonAnimLerp = 0f; private float buttonAnimTarget = 0f; public override void Awake() { //IL_0046: 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_00d9: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).Awake(); itemLoader = ((AnvilAsset)IM.OD[itemID]).GetGameObjectAsync(); objectsRemaining = objectCapacity; if ((Object)(object)visualToScale != (Object)null) { visualToScale.localScale = fullScale; } SetGrillMaterial(on: false); if ((Object)(object)grillToggleObject != (Object)null) { grillToggleObject.SetActive(false); } if ((Object)(object)grillLoopSource != (Object)null) { grillLoopSource.loop = true; grillLoopSource.clip = grillLoopClip; grillLoopSource.Stop(); } if ((Object)(object)buttonTransform != (Object)null) { buttonTransform.localPosition = buttonOffPosition; buttonTransform.localEulerAngles = buttonOffRotation; } } public override void BeginInteraction(FVRViveHand hand) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (!isInfinite && objectsRemaining < 1) { return; } ((FVRInteractiveObject)this).BeginInteraction(hand); if (!((AnvilCallbackBase)itemLoader).IsCompleted) { ((AnvilCallbackBase)itemLoader).CompleteNow(); } FVRPhysicalObject component = Object.Instantiate(itemLoader.Result, ((Component)hand).transform.position, ((Component)hand).transform.rotation).GetComponent(); if ((Object)(object)component != (Object)null) { hand.ForceSetInteractable((FVRInteractiveObject)(object)component); ((FVRInteractiveObject)component).BeginInteraction(hand); } objectsRemaining--; UpdateVisualScale(); if (objectsRemaining < 1) { PlayEmptySound(); if (enableRegeneration && regenCoroutine == null) { regenCoroutine = ((MonoBehaviour)this).StartCoroutine(Regenerate()); } } } private void PlayEmptySound() { if ((Object)(object)audioSource != (Object)null && (Object)(object)emptyClip != (Object)null) { audioSource.PlayOneShot(emptyClip); } } private void UpdateVisualScale() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)visualToScale == (Object)null)) { float num = ((objectCapacity <= 0) ? 0f : Mathf.Clamp01((float)objectsRemaining / (float)objectCapacity)); visualToScale.localScale = Vector3.Lerp(emptyScale, fullScale, num); } } private IEnumerator Regenerate() { while (objectsRemaining < objectCapacity) { yield return (object)new WaitForSeconds(regenTime / (float)objectCapacity); objectsRemaining++; UpdateVisualScale(); } regenCoroutine = null; } private void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) if (grillOn && (Object)(object)spinnyThing != (Object)null) { Vector3 zero = Vector3.zero; ((Vector3)(ref zero))[spinAxis] = spinRate * Time.deltaTime; spinnyThing.transform.Rotate(zero); } if ((Object)(object)buttonTransform != (Object)null) { buttonAnimLerp = Mathf.MoveTowards(buttonAnimLerp, buttonAnimTarget, Time.deltaTime * buttonAnimSpeed); if (animateButtonTranslation) { buttonTransform.localPosition = Vector3.Lerp(buttonOffPosition, buttonOnPosition, buttonAnimLerp); } buttonTransform.localEulerAngles = Vector3.Lerp(buttonOffRotation, buttonOnRotation, buttonAnimLerp); } } public override void SimpleInteraction(FVRViveHand hand) { ((FVRInteractiveObject)this).SimpleInteraction(hand); ToggleGrill(); } public void ToggleGrill() { grillOn = !grillOn; SetGrillMaterial(grillOn); if ((Object)(object)grillToggleObject != (Object)null) { grillToggleObject.SetActive(grillOn); } buttonAnimTarget = ((!grillOn) ? 0f : 1f); if ((Object)(object)audioSource != (Object)null) { audioSource.PlayOneShot((!grillOn) ? grillOffClip : grillOnClip); } if (!((Object)(object)grillLoopSource != (Object)null) || !((Object)(object)grillLoopClip != (Object)null)) { return; } if (grillOn) { if (!grillLoopSource.isPlaying) { grillLoopSource.Play(); } } else { grillLoopSource.Stop(); } } private void SetGrillMaterial(bool on) { if ((Object)(object)grillRenderer != (Object)null) { grillRenderer.material = ((!on) ? grillOffMaterial : grillOnMaterial); } } } 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(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent(); } 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(); 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(); } 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(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent(); } 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(); 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(); } 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); } } } } public class FVRMagazineBeltVisual : MonoBehaviour { [Header("Required")] public FVRFireArmMagazine Magazine; [Header("Belt Path")] public Transform FeedPoint; public Transform MidPoint; public Transform LoosePoint; [Header("Visual Tuning")] public float RoundSpacing = 0.035f; public bool RotateAlongCurve = true; [Header("Link Ejection")] public GameObject LinkPrefab; public Transform EjectionPoint; public float LinkEjectForce = 2f; private void LateUpdate() { //IL_00a0: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: 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_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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Magazine == (Object)null || Magazine.DisplayBullets == null) { return; } int num = Mathf.Min(Magazine.DisplayBullets.Length, Magazine.m_numRounds); if (num <= 0) { return; } for (int i = 0; i < num; i++) { GameObject val = Magazine.DisplayBullets[i]; if ((Object)(object)val == (Object)null) { continue; } Transform transform = val.transform; float num2 = ((num > 1) ? ((float)i / (float)(num - 1)) : 0f); Vector3 val3 = (transform.position = Bezier(FeedPoint.position, MidPoint.position, LoosePoint.position, num2)); if (RotateAlongCurve) { float t = Mathf.Clamp01(num2 + 0.01f); Vector3 val4 = Bezier(FeedPoint.position, MidPoint.position, LoosePoint.position, t); Vector3 val5 = val4 - val3; Vector3 normalized = ((Vector3)(ref val5)).normalized; if (((Vector3)(ref normalized)).sqrMagnitude > 0.0001f) { transform.rotation = Quaternion.LookRotation(normalized); } } } } public void EjectLink() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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) if ((Object)(object)LinkPrefab != (Object)null && (Object)(object)EjectionPoint != (Object)null) { GameObject val = Object.Instantiate(LinkPrefab, EjectionPoint.position, EjectionPoint.rotation); Rigidbody component = val.GetComponent(); if ((Object)(object)component != (Object)null) { component.AddForce(EjectionPoint.forward * LinkEjectForce, (ForceMode)1); } } } private Vector3 Bezier(Vector3 a, Vector3 b, Vector3 c, float t) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: 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_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_0024: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Vector3.Lerp(a, b, t); Vector3 val2 = Vector3.Lerp(b, c, t); return Vector3.Lerp(val, val2, t); } } namespace MeatKit { public class HideInNormalInspectorAttribute : PropertyAttribute { } } namespace Volks.TazerSpazerAnnihilazer { [BepInPlugin("Volks.TazerSpazerAnnihilazer", "TazerSpazerAnnihilazer", "1.0.0")] [BepInProcess("h3vr.exe")] [Description("Built with MeatKit")] [BepInDependency("h3vr.otherloader", "1.3.0")] public class TazerSpazerAnnihilazerPlugin : 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.TazerSpazerAnnihilazer"); OtherLoader.RegisterDirectLoad(BasePath, "Volks.TazerSpazerAnnihilazer", "", "", "fc_tazerspazer", ""); } } } public class SodaCanDrinkable : FVRPhysicalObject { [Header("Drink Settings")] public float RequiredTiltAngle = 100f; public float DrinkRate = 0.12f; public float TotalHealAmount = 0.25f; public float RequiredMouthDistance = 0.15f; [Header("Audio")] public AudioEvent AudioDrinkLoop; [Header("Visuals")] public ParticleSystem DripParticles; private bool m_isOpened; private bool m_isDrinking; private float m_healRemaining; private void Awake() { m_healRemaining = TotalHealAmount; if ((Object)(object)DripParticles != (Object)null) { DripParticles.Stop(); } } public void OnCanOpened() { m_isOpened = true; } private void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) if (!m_isOpened || m_healRemaining <= 0f) { StopDrinking(); return; } if (!((FVRInteractiveObject)this).IsHeld) { StopDrinking(); return; } if ((Object)(object)GM.CurrentPlayerBody == (Object)null || (Object)(object)GM.CurrentPlayerBody.Head == (Object)null) { StopDrinking(); return; } Transform head = GM.CurrentPlayerBody.Head; Vector3 val = head.position + head.up * -0.2f; float num = Vector3.Distance(((Component)this).transform.position, val); if (num > RequiredMouthDistance) { StopDrinking(); return; } float num2 = Vector3.Angle(((Component)this).transform.up, Vector3.up); if (num2 >= RequiredTiltAngle) { Drink(); } else { StopDrinking(); } } private void Drink() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!m_isDrinking) { m_isDrinking = true; SM.PlayCoreSound((FVRPooledAudioType)0, AudioDrinkLoop, ((Component)this).transform.position); if ((Object)(object)DripParticles != (Object)null && !DripParticles.isPlaying) { DripParticles.Play(); } } float num = DrinkRate * Time.deltaTime; num = Mathf.Min(num, m_healRemaining); if ((Object)(object)GM.CurrentPlayerBody != (Object)null) { GM.CurrentPlayerBody.HealPercent(num); } m_healRemaining -= num; } private void StopDrinking() { if (m_isDrinking) { m_isDrinking = false; if ((Object)(object)DripParticles != (Object)null && DripParticles.isPlaying) { DripParticles.Stop(); } } } } public class SodaCanTab : FVRInteractiveObject { [Header("References")] public Transform CanBody; public SodaCanDrinkable Can; [Header("Pull Settings")] public float PullDistanceRequired = 0.035f; public float MaxBackwardPull = 0.01f; [Header("Audio")] public AudioEvent AudioOpen; private Vector3 m_pullStartLocal; private bool m_isOpened; protected void BeginInteraction(FVRViveHand hand) { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).BeginInteraction(hand); if (!m_isOpened && !((Object)(object)CanBody == (Object)null)) { m_pullStartLocal = CanBody.InverseTransformPoint(hand.Input.FilteredPos); } } protected void FVRUpdate() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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) ((FVRInteractiveObject)this).FVRUpdate(); if (!((FVRInteractiveObject)this).IsHeld || m_isOpened || (Object)(object)base.m_hand == (Object)null || (Object)(object)CanBody == (Object)null) { return; } Vector3 val = CanBody.InverseTransformPoint(base.m_hand.Input.FilteredPos); Vector3 val2 = val - m_pullStartLocal; if (!(val2.y < 0f - MaxBackwardPull)) { float magnitude = ((Vector3)(ref val2)).magnitude; float num = Mathf.Clamp01(magnitude / PullDistanceRequired); ((Component)this).transform.localRotation = Quaternion.Euler(Mathf.Lerp(0f, -45f, num), 0f, 0f); if (magnitude >= PullDistanceRequired) { OpenCan(); } } } private void OpenCan() { //IL_0016: 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) m_isOpened = true; SM.PlayCoreSound((FVRPooledAudioType)10, AudioOpen, ((Component)this).transform.position); ((Component)this).transform.localRotation = Quaternion.Euler(-45f, 0f, 0f); if ((Object)(object)Can != (Object)null) { Can.OnCanOpened(); } } public override bool IsInteractable() { return !m_isOpened; } } namespace SimpleLightProbePlacer { [RequireComponent(typeof(LightProbeGroup))] [AddComponentMenu("Rendering/Light Probe Group Control")] public class LightProbeGroupControl : MonoBehaviour { [SerializeField] private float m_mergeDistance = 0.5f; [SerializeField] private bool m_usePointLights = true; [SerializeField] private float m_pointLightRange = 1f; private int m_mergedProbes; private LightProbeGroup m_lightProbeGroup; public float MergeDistance { get { return m_mergeDistance; } set { m_mergeDistance = value; } } public int MergedProbes => m_mergedProbes; public bool UsePointLights { get { return m_usePointLights; } set { m_usePointLights = value; } } public float PointLightRange { get { return m_pointLightRange; } set { m_pointLightRange = value; } } public LightProbeGroup LightProbeGroup { get { if ((Object)(object)m_lightProbeGroup != (Object)null) { return m_lightProbeGroup; } return m_lightProbeGroup = ((Component)this).GetComponent(); } } public void DeleteAll() { LightProbeGroup.probePositions = null; m_mergedProbes = 0; } public void Create() { DeleteAll(); List list = CreatePositions(); list.AddRange(CreateAroundPointLights(m_pointLightRange)); list = MergeClosestPositions(list, m_mergeDistance, out m_mergedProbes); ApplyPositions(list); } public void Merge() { if (LightProbeGroup.probePositions != null) { List source = MergeClosestPositions(LightProbeGroup.probePositions.ToList(), m_mergeDistance, out m_mergedProbes); source = source.Select((Vector3 x) => ((Component)this).transform.TransformPoint(x)).ToList(); ApplyPositions(source); } } private void ApplyPositions(List positions) { LightProbeGroup.probePositions = positions.Select((Vector3 x) => ((Component)this).transform.InverseTransformPoint(x)).ToArray(); } private static List CreatePositions() { LightProbeVolume[] array = Object.FindObjectsOfType(); if (array.Length == 0) { return new List(); } List list = new List(); for (int i = 0; i < array.Length; i++) { list.AddRange(array[i].CreatePositions()); } return list; } private static List CreateAroundPointLights(float range) { List list = (from x in Object.FindObjectsOfType() where (int)x.type == 2 select x).ToList(); if (list.Count == 0) { return new List(); } List list2 = new List(); for (int i = 0; i < list.Count; i++) { list2.AddRange(CreatePositionsAround(((Component)list[i]).transform, range)); } return list2; } private static List MergeClosestPositions(List positions, float distance, out int mergedCount) { //IL_00a2: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) if (positions == null) { mergedCount = 0; return new List(); } int count = positions.Count; bool flag = false; while (!flag) { Dictionary> dictionary = new Dictionary>(); for (int i = 0; i < positions.Count; i++) { List list = positions.Where(delegate(Vector3 x) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Vector3 val2 = x - positions[i]; return ((Vector3)(ref val2)).magnitude < distance; }).ToList(); if (list.Count > 0 && !dictionary.ContainsKey(positions[i])) { dictionary.Add(positions[i], list); } } positions.Clear(); List list2 = dictionary.Keys.ToList(); for (int j = 0; j < list2.Count; j++) { Vector3 center = dictionary[list2[j]].Aggregate(Vector3.zero, (Vector3 result, Vector3 target) => result + target) / (float)dictionary[list2[j]].Count; if (!positions.Exists((Vector3 x) => x == center)) { positions.Add(center); } } flag = positions.Select((Vector3 x) => positions.Where(delegate(Vector3 y) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) int result2; if (y != x) { Vector3 val = y - x; result2 = ((((Vector3)(ref val)).magnitude < distance) ? 1 : 0); } else { result2 = 0; } return (byte)result2 != 0; })).All((IEnumerable x) => !x.Any()); } mergedCount = count - positions.Count; return positions; } public static List CreatePositionsAround(Transform transform, float range) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) Vector3[] source = (Vector3[])(object)new Vector3[8] { new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, -0.5f) }; return source.Select((Vector3 x) => transform.TransformPoint(x * range)).ToList(); } } public enum LightProbeVolumeType { Fixed, Float } [AddComponentMenu("Rendering/Light Probe Volume")] public class LightProbeVolume : TransformVolume { [SerializeField] private LightProbeVolumeType m_type = LightProbeVolumeType.Fixed; [SerializeField] private Vector3 m_densityFixed = Vector3.one; [SerializeField] private Vector3 m_densityFloat = Vector3.one; public LightProbeVolumeType Type { get { return m_type; } set { m_type = value; } } public Vector3 Density { get { //IL_0018: 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_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) return (m_type != 0) ? m_densityFloat : m_densityFixed; } set { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) if (m_type == LightProbeVolumeType.Fixed) { m_densityFixed = value; } else { m_densityFloat = value; } } } public static Color EditorColor => new Color(1f, 0.9f, 0.25f); public List CreatePositions() { return CreatePositions(m_type); } public List CreatePositions(LightProbeVolumeType type) { //IL_0030: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) return (type != 0) ? CreatePositionsFloat(((Component)this).transform, base.Origin, base.Size, Density) : CreatePositionsFixed(((Component)this).transform, base.Origin, base.Size, Density); } public static List CreatePositionsFixed(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 val = origin; float num = size.x / (float)Mathf.FloorToInt(density.x); float num2 = size.y / (float)Mathf.FloorToInt(density.y); float num3 = size.z / (float)Mathf.FloorToInt(density.z); val -= size * 0.5f; for (int i = 0; (float)i <= density.x; i++) { for (int j = 0; (float)j <= density.y; j++) { for (int k = 0; (float)k <= density.z; k++) { Vector3 val2 = val + new Vector3((float)i * num, (float)j * num2, (float)k * num3); val2 = volumeTransform.TransformPoint(val2); list.Add(val2); } } } return list; } public static List CreatePositionsFloat(Transform volumeTransform, Vector3 origin, Vector3 size, Vector3 density) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_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) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 val = origin; int num = Mathf.FloorToInt(size.x / density.x); int num2 = Mathf.FloorToInt(size.y / density.y); int num3 = Mathf.FloorToInt(size.z / density.z); val -= size * 0.5f; val.x += (size.x - (float)num * density.x) * 0.5f; val.y += (size.y - (float)num2 * density.y) * 0.5f; val.z += (size.z - (float)num3 * density.z) * 0.5f; for (int i = 0; i <= num; i++) { for (int j = 0; j <= num2; j++) { for (int k = 0; k <= num3; k++) { Vector3 val2 = val + new Vector3((float)i * density.x, (float)j * density.y, (float)k * density.z); val2 = volumeTransform.TransformPoint(val2); list.Add(val2); } } } return list; } } [AddComponentMenu("")] public class TransformVolume : MonoBehaviour { [SerializeField] private Volume m_volume = new Volume(Vector3.zero, Vector3.one); public Volume Volume { get { return m_volume; } set { m_volume = value; } } public Vector3 Origin => m_volume.Origin; public Vector3 Size => m_volume.Size; public bool IsInBounds(Vector3[] points) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) Bounds bounds = GetBounds(); return ((Bounds)(ref bounds)).Intersects(GetBounds(points)); } public bool IsOnBorder(Vector3[] points) { if (points.All((Vector3 x) => !IsInVolume(x))) { return false; } return !points.All(IsInVolume); } public bool IsInVolume(Vector3[] points) { return points.All(IsInVolume); } public bool IsInVolume(Vector3 position) { //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_0020: Unknown result type (might be due to invalid IL or missing references) Plane val = default(Plane); for (int i = 0; i < 6; i++) { ((Plane)(ref val))..ctor(GetSideDirection(i), GetSidePosition(i)); if (((Plane)(ref val)).GetSide(position)) { return false; } } return true; } public Vector3[] GetCorners() { //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_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(-0.5f, 0.5f, -0.5f), new Vector3(-0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, 0.5f), new Vector3(0.5f, 0.5f, -0.5f), new Vector3(-0.5f, -0.5f, -0.5f), new Vector3(-0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, 0.5f), new Vector3(0.5f, -0.5f, -0.5f) }; for (int i = 0; i < array.Length; i++) { ref Vector3 reference = ref array[i]; reference.x *= m_volume.Size.x; ref Vector3 reference2 = ref array[i]; reference2.y *= m_volume.Size.y; ref Vector3 reference3 = ref array[i]; reference3.z *= m_volume.Size.z; ref Vector3 reference4 = ref array[i]; reference4 = ((Component)this).transform.TransformPoint(m_volume.Origin + array[i]); } return array; } public Bounds GetBounds() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) return GetBounds(GetCorners()); } public Bounds GetBounds(Vector3[] points) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_006a: 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) Vector3 val = points.Aggregate(Vector3.zero, (Vector3 result, Vector3 point) => result + point) / (float)points.Length; Bounds result2 = default(Bounds); ((Bounds)(ref result2))..ctor(val, Vector3.zero); for (int i = 0; i < points.Length; i++) { ((Bounds)(ref result2)).Encapsulate(points[i]); } return result2; } public GameObject[] GetGameObjectsInBounds(LayerMask layerMask) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) MeshRenderer[] array = Object.FindObjectsOfType(); List list = new List(); Bounds bounds = GetBounds(); for (int i = 0; i < array.Length; i++) { if (!((Object)(object)((Component)array[i]).gameObject == (Object)(object)((Component)((Component)this).transform).gameObject) && !((Object)(object)((Component)array[i]).GetComponent() != (Object)null) && ((1 << ((Component)array[i]).gameObject.layer) & ((LayerMask)(ref layerMask)).value) != 0 && ((Bounds)(ref bounds)).Intersects(((Renderer)array[i]).bounds)) { list.Add(((Component)array[i]).gameObject); } } return list.ToArray(); } public Vector3 GetSideDirection(int side) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6]; Vector3 right = Vector3.right; Vector3 up = Vector3.up; Vector3 forward = Vector3.forward; array[0] = right; ref Vector3 reference = ref array[1]; reference = -right; array[2] = up; ref Vector3 reference2 = ref array[3]; reference2 = -up; array[4] = forward; ref Vector3 reference3 = ref array[5]; reference3 = -forward; return ((Component)this).transform.TransformDirection(array[side]); } public Vector3 GetSidePosition(int side) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) Vector3[] array = (Vector3[])(object)new Vector3[6]; Vector3 right = Vector3.right; Vector3 up = Vector3.up; Vector3 forward = Vector3.forward; array[0] = right; ref Vector3 reference = ref array[1]; reference = -right; array[2] = up; ref Vector3 reference2 = ref array[3]; reference2 = -up; array[4] = forward; ref Vector3 reference3 = ref array[5]; reference3 = -forward; return ((Component)this).transform.TransformPoint(array[side] * GetSizeAxis(side) + m_volume.Origin); } public float GetSizeAxis(int side) { //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_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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) switch (side) { case 0: case 1: return m_volume.Size.x * 0.5f; case 2: case 3: return m_volume.Size.y * 0.5f; default: return m_volume.Size.z * 0.5f; } } public static Volume EditorVolumeControl(TransformVolume transformVolume, float handleSize, Color color) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: 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_0148: Expected O, but got Unknown //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: 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_02e7: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032a: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) //IL_0345: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Expected O, but got Unknown Vector3[] array = (Vector3[])(object)new Vector3[6]; Transform transform = ((Component)transformVolume).transform; Handles.color = color; for (int i = 0; i < array.Length; i++) { ref Vector3 reference = ref array[i]; reference = transformVolume.GetSidePosition(i); } ref Vector3 reference2 = ref array[0]; reference2 = Handles.Slider(array[0], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference3 = ref array[1]; reference3 = Handles.Slider(array[1], transform.right, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference4 = ref array[2]; reference4 = Handles.Slider(array[2], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference5 = ref array[3]; reference5 = Handles.Slider(array[3], transform.up, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference6 = ref array[4]; reference6 = Handles.Slider(array[4], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f); ref Vector3 reference7 = ref array[5]; reference7 = Handles.Slider(array[5], transform.forward, handleSize, new CapFunction(Handles.DotHandleCap), 1f); Vector3 origin = default(Vector3); origin.x = transform.InverseTransformPoint((array[0] + array[1]) * 0.5f).x; origin.y = transform.InverseTransformPoint((array[2] + array[3]) * 0.5f).y; origin.z = transform.InverseTransformPoint((array[4] + array[5]) * 0.5f).z; Vector3 size = default(Vector3); size.x = transform.InverseTransformPoint(array[0]).x - transform.InverseTransformPoint(array[1]).x; size.y = transform.InverseTransformPoint(array[2]).y - transform.InverseTransformPoint(array[3]).y; size.z = transform.InverseTransformPoint(array[4]).z - transform.InverseTransformPoint(array[5]).z; return new Volume(origin, size); } } [Serializable] public struct Volume { [SerializeField] private Vector3 m_origin; [SerializeField] private Vector3 m_size; public Vector3 Origin => m_origin; public Vector3 Size => m_size; public Volume(Vector3 origin, Vector3 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) m_origin = origin; m_size = size; } public static bool operator ==(Volume left, Volume right) { return left.Equals(right); } public static bool operator !=(Volume left, Volume right) { return !left.Equals(right); } public bool Equals(Volume other) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) return Origin == other.Origin && Size == other.Size; } public override bool Equals(object obj) { if (object.ReferenceEquals(null, obj)) { return false; } return obj is Volume && Equals((Volume)obj); } public override int GetHashCode() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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) Vector3 origin = Origin; int num = ((object)(Vector3)(ref origin)).GetHashCode() * 397; Vector3 size = Size; return num ^ ((object)(Vector3)(ref size)).GetHashCode(); } public override string ToString() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return $"Origin: {Origin}, Size: {Size}"; } } } namespace nrgill28.AtlasSampleScene { public class CTF_CaptureZone : MonoBehaviour { public CTF_Manager Manager; public CTF_Team Team; public void OnTriggerEnter(Collider other) { CTF_Flag component = ((Component)other).GetComponent(); if (Object.op_Implicit((Object)(object)component) && component.Team != Team) { Manager.FlagCaptured(component); } } } public class CTF_Flag : FVRPhysicalObject { [Header("Flag stuffs")] public CTF_Team Team; public float RespawnDelay = 10f; public Vector3 FloorOffset = new Vector3(0f, 0.25f, 0f); private Vector3 _resetPosition; private Quaternion _resetRotation; private Transform _followTransform; private bool _isHeld; private bool _isTaken; private float _timer; private CTF_Sosig _heldBy; public override void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).Awake(); _resetPosition = ((Component)this).transform.position; _resetRotation = ((Component)this).transform.rotation; } private void Update() { if (_isTaken && !_isHeld) { _timer -= Time.deltaTime; if (_timer < 0f) { ReturnFlag(); } } } public void Take() { _isHeld = true; _isTaken = true; } public void Drop() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) ((FVRInteractiveObject)this).IsHeld = false; _timer = RespawnDelay; NavMeshHit val = default(NavMeshHit); NavMesh.SamplePosition(((Component)this).transform.position, ref val, 100f, -1); ((Component)this).transform.position = ((NavMeshHit)(ref val)).position + FloorOffset; ((Component)this).transform.rotation = Quaternion.identity; } public void ReturnFlag() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (((FVRInteractiveObject)this).IsHeld) { ((FVRInteractiveObject)this).ForceBreakInteraction(); } if (Object.op_Implicit((Object)(object)_heldBy)) { _heldBy.HeldFlag = null; } ((Component)this).transform.SetPositionAndRotation(_resetPosition, _resetRotation); _isTaken = false; } private void OnTriggerEnter(Collider other) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (_isHeld) { return; } CTF_Sosig componentInParent = ((Component)other).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && (int)componentInParent.Sosig.BodyState == 0) { if (componentInParent.Team == Team) { ReturnFlag(); return; } _heldBy = componentInParent; componentInParent.HeldFlag = this; Take(); } } public override void BeginInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).BeginInteraction(hand); Take(); } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); Drop(); } } public class CTF_Manager : MonoBehaviour { [Header("References")] public Text[] ScoreTexts; public Transform[] AttackPoints; public Text StartButtonText; [Header("Red Team")] public CTF_Flag RedFlag; public int RedTeamSize; public Transform[] RedSpawns; public SosigEnemyID[] RedTeam; [Header("Blue Team")] public CTF_Flag BlueFlag; public int BlueTeamSize; public Transform[] BlueSpawns; public SosigEnemyID[] BlueTeam; private int _blueScore; private int _redScore; private bool _running; private readonly List _sosigs = new List(); private readonly SpawnOptions _spawnOptions; public CTF_Manager() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown SpawnOptions val = new SpawnOptions(); val.SpawnState = (SosigOrder)7; val.SpawnActivated = true; val.EquipmentMode = (EquipmentSlots)7; val.SpawnWithFullAmmo = true; _spawnOptions = val; ((MonoBehaviour)this)..ctor(); } private void Start() { UpdateScoreText(); } public void ToggleGame() { if (_running) { EndGame(); StartButtonText.text = "Start Game"; } else { StartGame(); StartButtonText.text = "Stop Game"; } } private void StartGame() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown ResetGame(); _running = true; GM.CurrentSceneSettings.SosigKillEvent += new SosigKill(CurrentSceneSettingsOnSosigKillEvent); ((MonoBehaviour)this).StartCoroutine(DoInitialSpawns()); } private void EndGame() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown GM.CurrentSceneSettings.SosigKillEvent -= new SosigKill(CurrentSceneSettingsOnSosigKillEvent); foreach (CTF_Sosig sosig in _sosigs) { sosig.Sosig.ClearSosig(); } _running = false; } private void CurrentSceneSettingsOnSosigKillEvent(Sosig s) { CTF_Sosig cTF_Sosig = _sosigs.FirstOrDefault((CTF_Sosig x) => (Object)(object)x.Sosig == (Object)(object)s); if (Object.op_Implicit((Object)(object)cTF_Sosig)) { ((MonoBehaviour)this).StartCoroutine(RespawnSosig(cTF_Sosig)); } } private void SpawnSosig(CTF_Team team) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_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_007b: 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_008e: Unknown result type (might be due to invalid IL or missing references) _spawnOptions.IFF = (int)team; _spawnOptions.SosigTargetPosition = SodaliteUtils.GetRandom((IList)AttackPoints).position; Transform transform; SosigEnemyID random; if (team == CTF_Team.Red) { transform = ((Component)SodaliteUtils.GetRandom((IList)RedSpawns)).transform; random = SodaliteUtils.GetRandom((IList)RedTeam); } else { transform = ((Component)SodaliteUtils.GetRandom((IList)BlueSpawns)).transform; random = SodaliteUtils.GetRandom((IList)BlueTeam); } Sosig val = SosigAPI.Spawn(ManagerSingleton.Instance.odicSosigObjsByID[random], _spawnOptions, transform.position, transform.rotation); CTF_Sosig cTF_Sosig = ((Component)val).gameObject.AddComponent(); _sosigs.Add(cTF_Sosig); cTF_Sosig.Sosig = val; cTF_Sosig.Team = team; } private IEnumerator DoInitialSpawns() { int i = 0; while (i < Mathf.Max(RedTeamSize, BlueTeamSize)) { if (i < RedTeamSize) { SpawnSosig(CTF_Team.Red); } if (i < BlueTeamSize) { SpawnSosig(CTF_Team.Blue); } i++; yield return (object)new WaitForSeconds(2.5f); } } private IEnumerator RespawnSosig(CTF_Sosig sosig) { yield return (object)new WaitForSeconds(5f); sosig.Sosig.ClearSosig(); _sosigs.Remove(sosig); yield return (object)new WaitForSeconds(5f); if (_running) { int sosigsLeft = _sosigs.Count((CTF_Sosig x) => x.Team == sosig.Team); int teamSize = ((sosig.Team != 0) ? BlueTeamSize : RedTeamSize); if (sosigsLeft < teamSize) { SpawnSosig(sosig.Team); } } } public void ResetGame() { _blueScore = 0; _redScore = 0; UpdateScoreText(); if (Object.op_Implicit((Object)(object)RedFlag)) { RedFlag.ReturnFlag(); } if (Object.op_Implicit((Object)(object)BlueFlag)) { BlueFlag.ReturnFlag(); } } public void FlagCaptured(CTF_Flag flag) { if (flag.Team == CTF_Team.Red) { _blueScore++; } else { _redScore++; } UpdateScoreText(); flag.ReturnFlag(); } public void UpdateScoreText() { Text[] scoreTexts = ScoreTexts; foreach (Text val in scoreTexts) { val.text = "" + _redScore + " - " + _blueScore + ""; } } private void OnDrawGizmos() { //IL_0001: 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_003b: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Transform[] redSpawns = RedSpawns; foreach (Transform val in redSpawns) { Gizmos.DrawSphere(val.position, 0.15f); } Gizmos.color = Color.blue; Transform[] blueSpawns = BlueSpawns; foreach (Transform val2 in blueSpawns) { Gizmos.DrawSphere(val2.position, 0.15f); } Gizmos.color = Color.green; Transform[] attackPoints = AttackPoints; foreach (Transform val3 in attackPoints) { Gizmos.DrawSphere(val3.position, 0.15f); } } } public class CTF_Sosig : MonoBehaviour { public CTF_Team Team; public CTF_Flag HeldFlag; public Sosig Sosig; private void Awake() { Sosig = ((Component)this).GetComponent(); } private void Update() { //IL_001d: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)HeldFlag)) { Vector3 val = ((Component)Sosig).transform.position - ((Component)Sosig).transform.forward * 0.1f; ((Component)HeldFlag).transform.SetPositionAndRotation(val, ((Component)Sosig).transform.rotation); } } } public enum CTF_Team { Red, Blue } public class PopupTarget : MonoBehaviour, IFVRDamageable { [Flags] public enum TargetRange { Near = 1, Mid = 2, Far = 4, All = 7 } public PopupTargetManager Manager; public TargetRange Range; public Transform Pivot; public Vector3 SetRotation; private Quaternion _startRotation; private Quaternion _endRotation; private bool _set; public bool Set { get { return _set; } set { //IL_003e: 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_0027: 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) if (_set != value) { _set = value; ((MonoBehaviour)this).StartCoroutine((!_set) ? RotateTo(_endRotation, _startRotation) : RotateTo(_startRotation, _endRotation)); } } } private void Awake() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) _startRotation = Pivot.rotation; _endRotation = Quaternion.Euler(SetRotation + ((Quaternion)(ref _startRotation)).eulerAngles); } void IFVRDamageable.Damage(Damage dam) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 if (Set && (int)dam.Class == 1) { Set = false; Manager.TargetHit(this); } } private IEnumerator RotateTo(Quaternion from, Quaternion to) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) float elapsed = 0f; while (elapsed < 0.25f) { yield return null; elapsed += Time.deltaTime; Pivot.localRotation = Quaternion.Slerp(from, to, elapsed / 0.25f); } Pivot.rotation = to; } } public class PopupTargetManager : MonoBehaviour { public List Targets; private readonly List _setTargets = new List(); private void Awake() { ((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All)); } private IEnumerator StartSetAsync(float minDelay, float maxDelay, int numTargets, PopupTarget.TargetRange ranges) { yield return (object)new WaitForSeconds(Random.Range(minDelay, maxDelay)); IListExtensions.Shuffle((IList)Targets); _setTargets.Clear(); foreach (PopupTarget target in Targets) { if ((target.Range & ranges) != 0) { target.Set = true; _setTargets.Add(target); numTargets--; } if (numTargets == 0) { break; } } } public void TargetHit(PopupTarget target) { if (_setTargets.Contains(target)) { _setTargets.Remove(target); if (_setTargets.Count == 0) { ((MonoBehaviour)this).StartCoroutine(StartSetAsync(3f, 8f, 5, PopupTarget.TargetRange.All)); } } } } } namespace VolksScripts { public class PepperSpray : FVRPhysicalObject, IFVRDamageable { [Header("Spray Behaviour")] public float SprayDistance = 6f; public float SprayAngle = 4f; public float SprayCloudSpawnInterval = 0.05f; public LayerMask LM_SprayCast; public string Filltag; [Header("Cloud Effect (PowerUp_Cloud)")] public PowerUp_Cloud PepperCloudPrefab; public float PepperCloudRadius = 3f; public float PepperCloudLifetime = 1f; public bool OverrideCloudParams = true; public PowerupType PepperType = (PowerupType)10; public PowerUpIntensity PepperIntensity = (PowerUpIntensity)1; public PowerUpDuration PepperDuration = (PowerUpDuration)1; public bool PepperIsPuke = false; public bool PepperIsInverted = false; [Header("FX / Audio")] public Transform Tip; public Vector2 TipRange; public Transform Muzzle; public ParticleSystem PSystem_Spray; public AudioEvent AudEvent_Head; public AudioEvent AudEvent_Tail; public AudioEvent AudEvent_Rattle; public AudioSource AudSource_Loop; public AudioClip AudClip_Spray; private bool m_isSpraying; private bool m_wasSpraying; private float m_timeTilCast = 0.02f; private float m_timeTilCloudSpawn; [Header("Rattle (optional)")] public float RattleRadius = 0.02f; public float RattleHeight = 0.01f; public Transform ballviz; private Vector3 m_rattlePos = Vector3.zero; private Vector3 m_rattleLastPos = Vector3.zero; private Vector3 m_rattleVel = Vector3.zero; private bool m_israttleSide; private bool m_wasrattleSide; public void Damage(Damage d) { } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); m_isSpraying = false; float triggerFloat = hand.Input.TriggerFloat; if (triggerFloat > 0.05f) { ((FVRPhysicalObject)this).SetAnimatedComponent(Tip, Mathf.Lerp(TipRange.x, TipRange.y, triggerFloat), (InterpStyle)0, (Axis)1); if (triggerFloat > 0.25f) { m_isSpraying = true; } } else { ((FVRPhysicalObject)this).SetAnimatedComponent(Tip, TipRange.x, (InterpStyle)0, (Axis)1); } } public override void EndInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).EndInteraction(hand); ((FVRPhysicalObject)this).SetAnimatedComponent(Tip, TipRange.x, (InterpStyle)0, (Axis)1); m_isSpraying = false; } public override void FVRUpdate() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).FVRUpdate(); RattleUpdate(); if (m_isSpraying) { if ((Object)(object)PSystem_Spray != (Object)null) { if (!PSystem_Spray.isPlaying) { PSystem_Spray.Play(); } PSystem_Spray.Emit(8); } m_timeTilCast -= Time.deltaTime; m_timeTilCloudSpawn -= Time.deltaTime; if (m_timeTilCast <= 0f) { m_timeTilCast = 0.02f; RaycastHit val = default(RaycastHit); if ((Object)(object)Muzzle != (Object)null && Physics.Raycast(Muzzle.position, Muzzle.forward, ref val, SprayDistance, LayerMask.op_Implicit(LM_SprayCast), (QueryTriggerInteraction)1)) { if (((Component)((RaycastHit)(ref val)).collider).gameObject.CompareTag(Filltag)) { PotatoGun val2 = ((!Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider.attachedRigidbody)) ? null : ((Component)((RaycastHit)(ref val)).collider.attachedRigidbody).gameObject.GetComponent()); if ((Object)(object)val2 != (Object)null) { val2.InsertGas(0.01f); } } TrySpawnPepperCloud(((RaycastHit)(ref val)).point, ((RaycastHit)(ref val)).normal); } else if ((Object)(object)Muzzle != (Object)null) { TrySpawnPepperCloud(Muzzle.position + Muzzle.forward * (SprayDistance * 0.4f), Muzzle.forward); } } } if (m_isSpraying && !m_wasSpraying) { if (AudEvent_Head != null && (Object)(object)Muzzle != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Head, Muzzle.position); } if ((Object)(object)AudSource_Loop != (Object)null && (Object)(object)AudClip_Spray != (Object)null) { AudSource_Loop.clip = AudClip_Spray; AudSource_Loop.loop = true; AudSource_Loop.Play(); } } else if (!m_isSpraying && m_wasSpraying) { if (AudEvent_Tail != null && (Object)(object)Muzzle != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Tail, Muzzle.position); } if ((Object)(object)AudSource_Loop != (Object)null) { AudSource_Loop.Stop(); } } m_wasSpraying = m_isSpraying; } private void TrySpawnPepperCloud(Vector3 pos, Vector3 forward) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)PepperCloudPrefab == (Object)null) && !(m_timeTilCloudSpawn > 0f)) { m_timeTilCloudSpawn = SprayCloudSpawnInterval; PowerUp_Cloud val = Object.Instantiate(PepperCloudPrefab, pos, Quaternion.LookRotation(forward)); val.CloudRadius = PepperCloudRadius; ((object)val).GetType().GetField("LifetimeSeconds")?.SetValue(val, PepperCloudLifetime); if (OverrideCloudParams) { val.SetParams(PepperType, PepperIntensity, PepperDuration, PepperIsPuke, PepperIsInverted); } } } private void RattleUpdate() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: 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_025b: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) m_wasrattleSide = m_israttleSide; if (m_wasrattleSide) { m_rattleVel = ((FVRPhysicalObject)this).RootRigidbody.velocity; } else { m_rattleVel -= ((FVRPhysicalObject)this).RootRigidbody.GetPointVelocity(((Component)this).transform.TransformPoint(m_rattlePos)) * Time.deltaTime; } m_rattleVel += Vector3.up * -0.5f * Time.deltaTime; Vector3 val = ((Component)this).transform.InverseTransformDirection(m_rattleVel); m_rattlePos += val * Time.deltaTime; float num = m_rattlePos.y; Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(m_rattlePos.x, m_rattlePos.z); m_israttleSide = false; float magnitude = ((Vector2)(ref val2)).magnitude; if (magnitude > RattleRadius) { float num2 = RattleRadius - magnitude; val2 = Vector2.op_Implicit(Vector3.ClampMagnitude(Vector2.op_Implicit(val2), RattleRadius)); num += num2 * Mathf.Sign(num); val = Vector3.ProjectOnPlane(val, new Vector3(val2.x, 0f, val2.y)); m_israttleSide = true; } if (Mathf.Abs(num) > RattleHeight) { num = RattleHeight * Mathf.Sign(num); val.y = 0f; m_israttleSide = true; } m_rattlePos = new Vector3(val2.x, num, val2.y); m_rattleVel = ((Component)this).transform.TransformDirection(val); if ((Object)(object)ballviz != (Object)null) { ballviz.localPosition = m_rattlePos; } if (m_israttleSide && !m_wasrattleSide) { float num3 = Mathf.Clamp(4f * (Vector3.Distance(m_rattlePos, m_rattleLastPos) / RattleRadius), 0f, 1f); if (AudEvent_Rattle != null) { SM.PlayCoreSoundOverrides((FVRPooledAudioType)40, AudEvent_Rattle, (!Object.op_Implicit((Object)(object)ballviz)) ? ((Component)this).transform.position : ballviz.position, new Vector2(num3 * 0.4f, num3 * 0.4f), new Vector2(1f, 1f)); } } m_rattleLastPos = m_rattlePos; } } 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(); } 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; } } } } } namespace GravyScripts.Components { public class AttachableFlammenwerfer : AttachableFirearm { [Header("FlameThrower Params")] public FlameThrowerValve Valve; public bool UsesValve = true; public MF2_FlamethrowerValve MF2Valve; public bool UsesMF2Valve; [Header("Trigger Config")] public Transform Trigger; public float TriggerFiringThreshold = 0.8f; public float Trigger_ForwardValue; public float Trigger_RearwardValue; public InterpStyle TriggerInterpStyle = (InterpStyle)1; private float m_triggerFloat; [Header("Special Audio Config")] public AudioEvent AudEvent_Ignite; public AudioEvent AudEvent_Extinguish; public AudioSource AudSource_FireLoop; private float m_triggerHasBeenHeldFor; private bool m_hasFiredStartSound; private bool m_isFiring; public ParticleSystem FireParticles; public Vector2 FireWidthRange; public Vector2 SpeedRangeMin; public Vector2 SpeedRangeMax; public Vector2 SizeRangeMin; public Vector2 SizeRangeMax; public Vector2 AudioPitchRange = new Vector2(1.5f, 0.5f); public float ParticleVolume = 40f; public bool UsesPilotLightSystem; public bool UsesAirBlastSystem; [Header("PilotLight")] public Transform PilotLight; private bool m_isPilotLightOn; public AudioEvent AudEvent_PilotOn; [Header("Airblast")] public bool UsesAirBlast; public Transform AirBlastCenter; public GameObject AirBlastGo; private float m_airBurstRecovery; public override void Awake() { ((AttachableFirearm)this).Awake(); if (UsesPilotLightSystem) { ((Component)PilotLight).gameObject.SetActive(false); } } private float GetVLerp() { if (UsesValve) { return Valve.ValvePos; } if (UsesMF2Valve) { return MF2Valve.Lerp; } return 0.5f; } public override void Update() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) ((AttachableFirearm)this).Update(); UpdateFire(); if (!UsesPilotLightSystem) { return; } if ((Object)(object)base.Magazine != (Object)null && base.Magazine.FuelAmountLeft > 0f) { if (!m_isPilotLightOn) { PilotOn(); } } else if (m_isPilotLightOn) { PilotOff(); } if (m_isPilotLightOn) { PilotLight.localScale = Vector3.one + Random.onUnitSphere * 0.05f; } } private void PilotOn() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) m_isPilotLightOn = true; if (AudEvent_PilotOn != null && (Object)(object)((AttachableFirearm)this).GetMuzzle() != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_PilotOn, ((AttachableFirearm)this).GetMuzzle().position); } ((Component)PilotLight).gameObject.SetActive(true); } private void PilotOff() { m_isPilotLightOn = false; ((Component)PilotLight).gameObject.SetActive(false); } private void AirBlast() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate(AirBlastGo, AirBlastCenter.position, AirBlastCenter.rotation); val.GetComponent().IFF = GM.CurrentPlayerBody.GetPlayerIFF(); val.GetComponent().IFF = GM.CurrentPlayerBody.GetPlayerIFF(); } public void UpdateFire() { //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_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) EmissionModule emission = FireParticles.emission; MinMaxCurve rateOverTime = ((EmissionModule)(ref emission)).rateOverTime; if (m_isFiring) { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverTime)).constantMax = ParticleVolume; ((MinMaxCurve)(ref rateOverTime)).constantMin = ParticleVolume; float vLerp = GetVLerp(); MainModule main = FireParticles.main; MinMaxCurve startSpeed = ((MainModule)(ref main)).startSpeed; ((MinMaxCurve)(ref startSpeed)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref startSpeed)).constantMax = Mathf.Lerp(SpeedRangeMax.x, SpeedRangeMax.y, vLerp); ((MinMaxCurve)(ref startSpeed)).constantMin = Mathf.Lerp(SpeedRangeMin.x, SpeedRangeMin.y, vLerp); ((MainModule)(ref main)).startSpeed = startSpeed; MinMaxCurve startSize = ((MainModule)(ref main)).startSize; ((MinMaxCurve)(ref startSize)).mode = (ParticleSystemCurveMode)3; ((MinMaxCurve)(ref startSize)).constantMax = Mathf.Lerp(SizeRangeMax.x, SizeRangeMax.y, vLerp); ((MinMaxCurve)(ref startSize)).constantMin = Mathf.Lerp(SizeRangeMin.x, SizeRangeMin.y, vLerp); ((MainModule)(ref main)).startSize = startSize; ShapeModule shape = FireParticles.shape; ((ShapeModule)(ref shape)).angle = Mathf.Lerp(FireWidthRange.x, FireWidthRange.y, vLerp); } else { ((MinMaxCurve)(ref rateOverTime)).mode = (ParticleSystemCurveMode)0; ((MinMaxCurve)(ref rateOverTime)).constantMax = 0f; ((MinMaxCurve)(ref rateOverTime)).constantMin = 0f; } ((EmissionModule)(ref emission)).rateOverTime = rateOverTime; } private bool HasFuel() { return !((Object)(object)base.Magazine == (Object)null) && base.Magazine.FuelAmountLeft > 0f; } private void StopFiring() { if (m_isFiring && (Object)(object)AudSource_FireLoop != (Object)null) { AudSource_FireLoop.Stop(); AudSource_FireLoop.volume = 0f; } m_isFiring = false; m_hasFiredStartSound = false; } public override void ProcessInput(FVRViveHand hand, bool fromInterface, FVRInteractiveObject o) { //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Invalid comparison between Unknown and I4 //IL_0339: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) ((AttachableFirearm)this).ProcessInput(hand, fromInterface, o); if ((Object)(object)o == (Object)null || (Object)(object)hand == (Object)null) { return; } if (o.IsHeld) { if (o.m_hasTriggeredUpSinceBegin) { m_triggerFloat = hand.Input.TriggerFloat; } else { m_triggerFloat = 0f; } if (UsesAirBlast && m_airBurstRecovery <= 0f && HasFuel() && ((hand.IsInStreamlinedMode && hand.Input.BYButtonDown) || (!hand.IsInStreamlinedMode && hand.Input.TouchpadDown))) { m_airBurstRecovery = 1f; AirBlast(); if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.DrainFuel(5f); if (!m_hasFiredStartSound) { m_hasFiredStartSound = true; if (AudEvent_Ignite != null && (Object)(object)((AttachableFirearm)this).GetMuzzle() != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Ignite, ((AttachableFirearm)this).GetMuzzle().position); } } } } if (m_airBurstRecovery > 0f) { m_airBurstRecovery -= Time.deltaTime; } if (m_triggerFloat > 0.2f && HasFuel() && m_airBurstRecovery <= 0f) { if (m_triggerHasBeenHeldFor < 2f) { m_triggerHasBeenHeldFor += Time.deltaTime; } m_isFiring = true; if (!m_hasFiredStartSound) { m_hasFiredStartSound = true; if (AudEvent_Ignite != null && (Object)(object)((AttachableFirearm)this).GetMuzzle() != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, AudEvent_Ignite, ((AttachableFirearm)this).GetMuzzle().position); } } if ((Object)(object)AudSource_FireLoop != (Object)null) { float volume = Mathf.Clamp(m_triggerHasBeenHeldFor * 2f, 0f, 0.4f); AudSource_FireLoop.volume = volume; float vLerp = GetVLerp(); AudSource_FireLoop.pitch = Mathf.Lerp(AudioPitchRange.x, AudioPitchRange.y, vLerp); if (!AudSource_FireLoop.isPlaying) { AudSource_FireLoop.Play(); } } if ((Object)(object)base.Magazine != (Object)null) { base.Magazine.DrainFuel(Time.deltaTime); } } else { m_triggerHasBeenHeldFor = 0f; StopFiring(); } } else { m_triggerFloat = 0f; } if (m_triggerFloat <= 0f) { StopFiring(); } if ((Object)(object)Trigger != (Object)null) { if ((int)TriggerInterpStyle == 0) { Trigger.localPosition = new Vector3(0f, 0f, Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat)); } else if ((int)TriggerInterpStyle == 1) { Trigger.localEulerAngles = new Vector3(Mathf.Lerp(Trigger_ForwardValue, Trigger_RearwardValue, m_triggerFloat), 0f, 0f); } } } } } 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 FistVR { public class UnderbarrelMagLatch : MonoBehaviour { public AttachableFirearm AttachableFireArm; public HingeJoint Joint; public float Threshold = -35f; private float timeSinceLastCollision = 6f; private void FixedUpdate() { if (timeSinceLastCollision < 5f) { timeSinceLastCollision += Time.deltaTime; } if ((Object)(object)AttachableFireArm.Magazine != (Object)null && timeSinceLastCollision < 0.03f && Joint.angle < Threshold) { AttachableFireArm.EjectMag(true); } } private void OnCollisionStay(Collision col) { Rigidbody attachedRigidbody = col.collider.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null && (Object)(object)attachedRigidbody != (Object)(object)((Component)AttachableFireArm).GetComponent()) { FVRPhysicalObject component = ((Component)attachedRigidbody).GetComponent(); if ((Object)(object)component != (Object)null && ((FVRInteractiveObject)component).IsHeld) { timeSinceLastCollision = 0f; } } } } } 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 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(cigarPrefab, ((HandInput)(ref hand.Input)).Pos, ((HandInput)(ref hand.Input)).Rot); FVRPhysicalObject component = val.GetComponent(); 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(); FireGO.SetActive(false); } if ((Object)(object)LinkedObject != (Object)null) { LinkedObject.SetActive(false); } playerBody = Object.FindObjectOfType(); } 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(); if (component == null && (Object)(object)((RaycastHit)(ref m_hit)).collider.attachedRigidbody != (Object)null) { component = ((Component)((RaycastHit)(ref m_hit)).collider.attachedRigidbody).gameObject.GetComponent(); } 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(); 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(); } 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 Multiround : FVRInteractiveObject { [Header("FireArm Chamber Config")] public FVRFireArm Firearm; public FVRFirearmAudioSet OverrideAudioSet; [Header("Chamber Params")] public bool IsManuallyExtractable = true; public bool IsManuallyChamberable = true; public float ChamberVelocityMultiplier = 1f; [Header("Chamber State")] public bool IsAccessible = true; public bool IsFull; public bool IsSpent; [Header("Proxy Stuff")] public GameObject LoadedPhys; public Transform ProxyRound; public MeshFilter ProxyMesh; public MeshRenderer ProxyRenderer; public GameObject ShowOnSpent; public GameObject ShowOnUnspent; [Header("Autochamber (template-driven, no type checks)")] public bool DoesAutoChamber; public FVRFireArmRound AutoChamberTemplate; public FireArmRoundType RoundType = (FireArmRoundType)0; private FVRFireArmRound _round; private ObjectTemperature geoTemp; private bool _usesShotOnSpent; private bool _usesShotOnUnspent; public FVRFireArmRound GetRound() { return _round; } [ContextMenu("checkmult")] public void CheckMult() { if (ChamberVelocityMultiplier != 1f) { Debug.Log((object)(((Object)((Component)((Component)this).transform.root).gameObject).name + " has mult of " + ChamberVelocityMultiplier)); } } public override 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(); ProxyRenderer = val.AddComponent(); geoTemp = ((Component)ProxyRound).gameObject.AddComponent(); geoTemp.renderers.Add((Renderer)(object)ProxyRenderer); if ((Object)(object)ShowOnSpent != (Object)null) { _usesShotOnSpent = true; } if ((Object)(object)ShowOnUnspent != (Object)null) { _usesShotOnUnspent = true; } } public override void Start() { ((FVRInteractiveObject)this).Start(); if (DoesAutoChamber) { AutochamberAny(AutoChamberTemplate); } } public override bool IsInteractable() { return IsManuallyExtractable && IsAccessible && IsFull; } public void AutochamberAny(FVRFireArmRound template) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)template == (Object)null)) { GameObject gameObject = ((AnvilAsset)AM.GetRoundSelfPrefab(template.RoundType, template.RoundClass)).GetGameObject(); SetRoundAny(gameObject.GetComponent(), animate: false); } } public void Unload() { SetRoundAny(null, animate: false); } public void SetRoundAny(FVRFireArmRound round, bool animate) { ApplyRound(round); } public void UpdateProxyDisplay() { //IL_0100: 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_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_round == (Object)null) { ProxyMesh.mesh = null; ((Renderer)ProxyRenderer).material = null; ((Renderer)ProxyRenderer).enabled = false; if (_usesShotOnSpent) { ShowOnSpent.SetActive(false); } if (_usesShotOnUnspent) { ShowOnUnspent.SetActive(false); } return; } if (IsSpent) { if ((Object)(object)_round.FiredRenderer != (Object)null) { ProxyMesh.mesh = ((Component)_round.FiredRenderer).gameObject.GetComponent().sharedMesh; ((Renderer)ProxyRenderer).material = _round.FiredRenderer.sharedMaterial; geoTemp.thermalIntensityProfile = (ThermalProfile)8; } else { ProxyMesh.mesh = null; } } else { ProxyMesh.mesh = AM.GetRoundMesh(_round.RoundType, _round.RoundClass); ((Renderer)ProxyRenderer).material = AM.GetRoundMaterial(_round.RoundType, _round.RoundClass); } ((Renderer)ProxyRenderer).enabled = true; if (IsSpent) { if (_usesShotOnSpent) { ShowOnSpent.SetActive(true); } if (_usesShotOnUnspent) { ShowOnUnspent.SetActive(false); } } else { if (_usesShotOnSpent) { ShowOnSpent.SetActive(false); } if (_usesShotOnUnspent) { ShowOnUnspent.SetActive(true); } } } public void PlayChamberingAudio() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Firearm != (Object)null) { Firearm.PlayAudioEvent((FirearmAudioEventType)42, 1f); } else if ((Object)(object)OverrideAudioSet != (Object)null) { SM.PlayCoreSound((FVRPooledAudioType)10, OverrideAudioSet.ChamberManual, ((Component)this).transform.position); } } private void ApplyRound(FVRFireArmRound round) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)round != (Object)null) { IsFull = true; IsSpent = round.IsSpent; _round = ((AnvilAsset)AM.GetRoundSelfPrefab(round.RoundType, round.RoundClass)).GetGameObject().GetComponent(); if ((Object)(object)LoadedPhys != (Object)null) { LoadedPhys.SetActive(true); } } else { IsFull = false; IsSpent = false; _round = null; if ((Object)(object)LoadedPhys != (Object)null) { LoadedPhys.SetActive(false); } } UpdateProxyDisplay(); } } 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(); ProxyRenderer = val.AddComponent(); geoTemp = ((Component)ProxyRound).gameObject.AddComponent(); 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().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(); 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 = LayerMask.NameToLayer("NoCol"); Torch.Ignite(); } } public class FVRSmokingPipe : QBArmorHelmet { public GameObject FireGO; public GameObject LinkedObject; public AudioSource fireAud; public float BurnDuration = 120f; private bool m_isBurning = false; private float m_burnTimer; [Header("Trigger Reset")] public GameObject RelightTrigger; public bool IsBurning => m_isBurning; public override void Awake() { ((QBArmorHelmet)this).Awake(); if ((Object)(object)FireGO != (Object)null) { FireGO.SetActive(false); } if ((Object)(object)LinkedObject != (Object)null) { LinkedObject.SetActive(false); } } public override void FVRUpdate() { ((QBArmorPiece)this).FVRUpdate(); if (m_isBurning) { m_burnTimer -= Time.deltaTime; if (m_burnTimer <= 0f) { StopBurning(); } } } public void Ignite() { if (!m_isBurning) { 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; if ((Object)(object)FireGO != (Object)null) { FireGO.SetActive(false); } if ((Object)(object)fireAud != (Object)null) { fireAud.Stop(); } if ((Object)(object)LinkedObject != (Object)null) { LinkedObject.SetActive(false); } if ((Object)(object)RelightTrigger != (Object)null) { RelightTrigger.SetActive(true); } Debug.Log((object)"Pipe burnt out. Ready to be reignited."); } } public class SmokingPipeTrigger : MonoBehaviour { public FVRSmokingPipe SmokingPipe; public Collider collider; public float ResetDelay = 2f; private bool isActive = true; private void OnTriggerEnter(Collider col) { if (isActive && !SmokingPipe.IsBurning) { isActive = false; SmokingPipe.Ignite(); collider.enabled = false; ((Component)this).gameObject.layer = LayerMask.NameToLayer("NoCol"); ((MonoBehaviour)this).StartCoroutine(ResetTriggerAfterDelay()); } } private IEnumerator ResetTriggerAfterDelay() { yield return (object)new WaitForSeconds(ResetDelay); collider.enabled = true; ((Component)this).gameObject.layer = LayerMask.NameToLayer("Default"); isActive = true; } } public class FlamingSword : FVRMeleeWeapon { [Header("Fire Effects")] public GameObject fireVisuals; public ParticleSystem fireParticles; public AudioSource audioSource; public AudioClip startClip; public AudioClip loopClip; public AudioClip endClip; [Header("Glow Emission")] public Renderer glowRenderer; public Color glowColor = Color.red; public float glowIntensity = 2f; [Header("Timing")] public float extinguishDelay = 2f; private bool isOn = false; private Coroutine extinguishCoroutine; protected void Start() { SetFireState(on: false); } private void Update() { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (!((FVRInteractiveObject)this).IsHeld || (Object)(object)((FVRInteractiveObject)this).m_hand == (Object)null) { if (isOn && extinguishCoroutine == null) { extinguishCoroutine = ((MonoBehaviour)this).StartCoroutine(ExtinguishAfterDelay()); } return; } if (extinguishCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(extinguishCoroutine); extinguishCoroutine = null; } HandInput input = ((FVRInteractiveObject)this).m_hand.Input; bool flag = false; if ((!((FVRInteractiveObject)this).m_hand.IsInStreamlinedMode) ? (input.TouchpadDown && ((Vector2)(ref input.TouchpadAxes)).magnitude > 0.2f && Vector2.Angle(input.TouchpadAxes, Vector2.down) < 45f) : input.BYButtonDown) { isOn = !isOn; SetFireState(isOn); } } private void SetFireState(bool on) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)fireVisuals != (Object)null) { fireVisuals.SetActive(on); } if ((Object)(object)fireParticles != (Object)null) { if (on) { fireParticles.Play(); } else { fireParticles.Stop(); } } if ((Object)(object)glowRenderer != (Object)null) { if (on) { glowRenderer.material.EnableKeyword("_EMISSION"); glowRenderer.material.SetColor("_EmissionColor", glowColor * glowIntensity); } else { glowRenderer.material.DisableKeyword("_EMISSION"); glowRenderer.material.SetColor("_EmissionColor", Color.black); } } if ((Object)(object)audioSource != (Object)null) { audioSource.Stop(); if (on && (Object)(object)startClip != (Object)null) { audioSource.clip = startClip; audioSource.loop = false; audioSource.Play(); ((MonoBehaviour)this).StartCoroutine(PlayLoopAfterDelay(startClip.length)); } else if (!on && (Object)(object)endClip != (Object)null) { audioSource.clip = endClip; audioSource.loop = false; audioSource.Play(); } } } private IEnumerator PlayLoopAfterDelay(float delay) { yield return (object)new WaitForSeconds(delay); if (isOn && (Object)(object)loopClip != (Object)null) { audioSource.clip = loopClip; audioSource.loop = true; audioSource.Play(); } } private IEnumerator ExtinguishAfterDelay() { yield return (object)new WaitForSeconds(extinguishDelay); isOn = false; SetFireState(on: false); extinguishCoroutine = null; } }