Decompiled source of HELLDIVERS LAS13 Trident v1.0.4
HELLDIVERS_LAS13_Trident.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Logging; using FistVR; using HarmonyLib; using OpenScripts2; using OtherLoader; using Sodalite; using Sodalite.Api; using UnityEngine; using theWNbotMods; [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 theWNbotMods { public class RemoteFire : FVRPhysicalObject { [Header("Binding")] [Tooltip("The firearm to control. Can be assigned in Inspector or at runtime via BindFirearm().")] public FVRFireArm targetFirearm; [Tooltip("If true and targetFirearm is null, will try to auto-find a FVRFireArm on the same GameObject or its children in Start().")] public bool autoFindFirearm = true; [Header("Trigger Settings")] [Tooltip("If true, a single TriggerDown will attempt a single fire call.")] public bool fireOnTriggerDown = true; [Tooltip("If true, holding trigger will repeatedly call the fire method each frame while held (use with caution).")] public bool continuousWhileHeld = false; [Header("Debug")] [Tooltip("In Inspector, toggle to simulate a trigger press (auto-resets).")] public bool DebugTriggerOnce = false; private bool _wasTriggerHeld = false; private void Start() { if ((Object)(object)targetFirearm == (Object)null && autoFindFirearm) { targetFirearm = ((Component)this).GetComponentInChildren<FVRFireArm>(); } } private void OnValidate() { if (!Application.isPlaying && DebugTriggerOnce) { DebugTriggerOnce = false; } } private void Update() { if (DebugTriggerOnce) { DebugTriggerOnce = false; TryTriggerFire(); } if (!((Object)(object)((FVRInteractiveObject)this).m_hand != (Object)null)) { return; } if (fireOnTriggerDown && ((FVRInteractiveObject)this).m_hand.Input.TriggerDown) { TryTriggerFire(); } if (continuousWhileHeld) { bool triggerPressed = ((FVRInteractiveObject)this).m_hand.Input.TriggerPressed; if (triggerPressed && !_wasTriggerHeld) { TryTriggerFire(); } else if (triggerPressed && _wasTriggerHeld) { TryTriggerFire(); } _wasTriggerHeld = triggerPressed; } } public void BindFirearm(FVRFireArm firearm) { targetFirearm = firearm; } public void UnbindFirearm() { targetFirearm = null; } private void TryTriggerFire() { if ((Object)(object)targetFirearm == (Object)null) { return; } Type type = ((object)targetFirearm).GetType(); MethodInfo method = type.GetMethod("Fire", BindingFlags.Instance | BindingFlags.Public); if ((object)method != null) { try { method.Invoke(targetFirearm, null); return; } catch (Exception) { } } MethodInfo method2 = type.GetMethod("DropHammer", BindingFlags.Instance | BindingFlags.Public); if ((object)method2 != null) { try { method2.Invoke(targetFirearm, null); return; } catch (Exception) { } } MethodInfo method3 = type.GetMethod("CockHammer", BindingFlags.Instance | BindingFlags.Public); if ((object)method3 != null) { try { ParameterInfo[] parameters = method3.GetParameters(); if (parameters.Length == 1 && (object)parameters[0].ParameterType == typeof(bool)) { method3.Invoke(targetFirearm, new object[1] { true }); } else { method3.Invoke(targetFirearm, null); } method2?.Invoke(targetFirearm, null); return; } catch (Exception) { } } try { ((Component)targetFirearm).gameObject.SendMessage("Fire", (SendMessageOptions)1); } catch (Exception) { } } } public class AC130TabletLeftHand : FVRInteractiveObject { [Header("平板主控制器")] public AC130TabletRightHand tabletController; [Header("干扰弹 Prefab")] public GameObject countermeasurePrefab; [Header("Debug 模拟输入")] public bool SimTrigger = false; public bool SimStickLeft = false; public bool SimStickRight = false; public bool SimStickUp = false; public bool SimStickDown = false; private Vector2 _lAxes; public override void UpdateInteraction(FVRViveHand hand) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 //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) ((FVRInteractiveObject)this).UpdateInteraction(hand); if ((int)hand.HandSource != 1) { return; } if ((int)hand.CMode == 3 || (int)hand.CMode == 1) { _lAxes = hand.Input.Secondary2AxisInputAxes; } else { _lAxes = hand.Input.TouchpadAxes; } if (SimStickLeft) { _lAxes.x = -1f; SimStickLeft = false; } if (SimStickRight) { _lAxes.x = 1f; SimStickRight = false; } if (SimStickUp) { _lAxes.y = 1f; SimStickUp = false; } if (SimStickDown) { _lAxes.y = -1f; SimStickDown = false; } if (_lAxes.x > 0.8f) { tabletController.CurrentIndex++; } else if (_lAxes.x < -0.8f) { tabletController.CurrentIndex--; } if (hand.Input.TriggerDown || SimTrigger) { if ((Object)(object)countermeasurePrefab != (Object)null) { countermeasurePrefab.SetActive(true); } SimTrigger = false; } } } public class AC130TabletRightHand : FVRPhysicalObject { [Header("炮艇控制器")] public OrbitalStrikeController[] strikeControllers; public GameObject[] cannonUIPrefabs; [Header("摄像头角度限制")] public Transform cameraPivot; public float yawLimit = 60f; public float pitchLimit = 30f; public float rotationSpeed = 2f; [Header("Debug 模拟输入")] public bool SimTrigger = false; public bool SimStickLeft = false; public bool SimStickRight = false; public bool SimStickUp = false; public bool SimStickDown = false; private Vector2 _rAxes; private int currentIndex = 0; public int CurrentIndex { get { return currentIndex; } set { currentIndex = Mathf.Clamp(value, 0, strikeControllers.Length - 1); UpdateUI(); } } public override void UpdateInteraction(FVRViveHand hand) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Invalid comparison between Unknown and I4 //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_00ea: 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_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_0163: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if ((int)hand.HandSource != 2) { return; } if ((int)hand.CMode == 3 || (int)hand.CMode == 1) { _rAxes = hand.Input.Secondary2AxisInputAxes; } else { _rAxes = hand.Input.TouchpadAxes; } if (SimStickLeft) { _rAxes.x = -1f; SimStickLeft = false; } if (SimStickRight) { _rAxes.x = 1f; SimStickRight = false; } if (SimStickUp) { _rAxes.y = 1f; SimStickUp = false; } if (SimStickDown) { _rAxes.y = -1f; SimStickDown = false; } float num = Mathf.Clamp(cameraPivot.localEulerAngles.y + _rAxes.x * rotationSpeed, 0f - yawLimit, yawLimit); float num2 = Mathf.Clamp(cameraPivot.localEulerAngles.x - _rAxes.y * rotationSpeed, 0f - pitchLimit, pitchLimit); cameraPivot.localRotation = Quaternion.Euler(num2, num, 0f); if (!hand.Input.TriggerDown && !SimTrigger) { return; } if (strikeControllers != null && strikeControllers.Length > 0) { OrbitalStrikeController orbitalStrikeController = strikeControllers[currentIndex]; if ((Object)(object)orbitalStrikeController != (Object)null) { orbitalStrikeController.shouldFire = true; } } SimTrigger = false; } public void UpdateUI() { for (int i = 0; i < cannonUIPrefabs.Length; i++) { if ((Object)(object)cannonUIPrefabs[i] != (Object)null) { cannonUIPrefabs[i].SetActive(i == currentIndex); } } } public void SetCurrentIndex(int index) { CurrentIndex = index; } } public class AirstrikeBinocular : FVRPhysicalObject { [Header("望远镜镜头中心(Ray 起点)")] public Transform RayOrigin; [Header("默认空袭 Prefab")] public GameObject defaultAirstrikePrefab; [Header("最大射程")] public float MaxDistance = 500f; [Header("可命中的层(地面、环境等)")] public LayerMask HitLayers; [Header("菜单 UI Canvas")] public GameObject menuCanvas; [Header("音效播放")] public AudioSource audioSource; private GameObject currentAirstrikePrefab; private AudioClip[] currentAirstrikeClips; [Header("调试信息")] [SerializeField] private string currentTypeName = "None"; [Header("部署方向设置")] [SerializeField] private Vector3 rotationOffsetEuler = Vector3.zero; [Header("冷却时间设置")] [SerializeField] private float cooldownTime = 5f; private float lastDeployTime = -999f; [Header("调试开关")] [SerializeField] private bool debugTrigger = false; private void Start() { currentAirstrikePrefab = defaultAirstrikePrefab; currentTypeName = ((!((Object)(object)defaultAirstrikePrefab != (Object)null)) ? "None" : ((Object)defaultAirstrikePrefab).name); if ((Object)(object)menuCanvas != (Object)null) { menuCanvas.SetActive(false); } Debug.Log((object)("AirstrikeBinocular当前空袭类型: " + currentTypeName)); } private void Update() { if (debugTrigger) { Debug.Log((object)("调试Inspector触发空袭 → " + currentTypeName)); DeployAirstrike(null); debugTrigger = false; } } public void ToggleMenu(bool isOpen) { if ((Object)(object)menuCanvas != (Object)null) { menuCanvas.SetActive(isOpen); } } public void SetAirstrikeType(GameObject prefab, AudioClip[] clips) { currentAirstrikePrefab = prefab; currentAirstrikeClips = clips; currentTypeName = ((!((Object)(object)prefab != (Object)null)) ? "None" : ((Object)prefab).name); Debug.Log((object)("当前空袭类型切换为: " + currentTypeName)); } public override void UpdateInteraction(FVRViveHand hand) { ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.Input.TriggerFloat > 0.8f) { DeployAirstrike(hand); } } public void DeployAirstrike(FVRViveHand hand) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b5: 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_00c0: 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_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_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_00dc: 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_010c: 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_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) RaycastHit val = default(RaycastHit); if (Time.time - lastDeployTime < cooldownTime) { Debug.Log((object)("冷却中,剩余时间: " + (cooldownTime - (Time.time - lastDeployTime)).ToString("F1") + " 秒")); } else if (Physics.Raycast(RayOrigin.position, RayOrigin.forward, ref val, MaxDistance, LayerMask.op_Implicit(HitLayers))) { Vector3 forward = RayOrigin.forward; forward.y = 0f; if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { forward = Vector3.forward; } Quaternion val2 = Quaternion.LookRotation(forward, Vector3.up); Quaternion val3 = val2 * Quaternion.Euler(rotationOffsetEuler); Object.Instantiate<GameObject>(currentAirstrikePrefab, ((RaycastHit)(ref val)).point, val3); Debug.Log((object)string.Concat("释放空袭: ", currentTypeName, " 于位置 ", ((RaycastHit)(ref val)).point, ",旋转: ", ((Quaternion)(ref val3)).eulerAngles)); lastDeployTime = Time.time; if ((Object)(object)audioSource != (Object)null && currentAirstrikeClips != null && currentAirstrikeClips.Length > 0) { AudioClip val4 = currentAirstrikeClips[Random.Range(0, currentAirstrikeClips.Length)]; audioSource.PlayOneShot(val4); } if ((Object)(object)hand != (Object)null) { hand.Buzz(hand.Buzzer.Buzz_OnHoverInteractive); } } } } public class AirstrikeDebugger : MonoBehaviour { [Header("移动速度")] public float moveSpeed = 5f; [Header("鼠标灵敏度")] public float mouseSensitivity = 2f; [Header("头部对象(联动 UILookAtPlayer)")] public Transform headTransform; private float rotationX = 0f; private float rotationY = 0f; private void Start() { Cursor.lockState = (CursorLockMode)1; Cursor.visible = false; } private void Update() { //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) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_005b: 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_0061: 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_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_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_0131: Unknown result type (might be due to invalid IL or missing references) float axis = Input.GetAxis("Horizontal"); float axis2 = Input.GetAxis("Vertical"); Vector3 val = (((Component)this).transform.right * axis + ((Component)this).transform.forward * axis2) * moveSpeed * Time.deltaTime; Transform transform = ((Component)this).transform; transform.position += val; float num = Input.GetAxis("Mouse X") * mouseSensitivity; float num2 = Input.GetAxis("Mouse Y") * mouseSensitivity; rotationY += num; rotationX -= num2; rotationX = Mathf.Clamp(rotationX, -80f, 80f); ((Component)this).transform.rotation = Quaternion.Euler(rotationX, rotationY, 0f); if ((Object)(object)headTransform != (Object)null) { headTransform.position = ((Component)this).transform.position + Vector3.up * 1.6f; headTransform.rotation = ((Component)this).transform.rotation; } } } public class ChangeTypeWhenAwake : MonoBehaviour { public GameObject airstrikePrefab; public AudioClip[] airstrikeClips; public AirstrikeBinocular binocular; private void OnEnable() { if ((Object)(object)binocular != (Object)null && (Object)(object)airstrikePrefab != (Object)null) { binocular.SetAirstrikeType(airstrikePrefab, airstrikeClips); } } } } public class ScopeScript : MonoBehaviour { [SerializeField] [Range(0f, 1f)] private float zoom; [SerializeField] private float minFOV; [SerializeField] private float maxFOV; [SerializeField] private Camera myCamera; [SerializeField] private Transform myCrossHair; [SerializeField] private float minCrossHairScale; [SerializeField] private float maxCrossHairScale; [SerializeField] private Material imageMat; [SerializeField] private float minDistortion; [SerializeField] private float maxDistortion; private void Start() { } private void Update() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) myCamera.fieldOfView = Mathf.Lerp(maxFOV, minFOV, zoom); float num = Mathf.Lerp(minCrossHairScale, maxCrossHairScale, zoom); myCrossHair.localScale = new Vector3(num, num, 1f); imageMat.SetFloat("_Constant", Mathf.Lerp(minDistortion, maxDistortion, zoom)); } } namespace theWNbotMods { public class scopeFocusScript : MonoBehaviour { [Header("眼睛位置(VR Head 或 Debug Head)")] [SerializeField] private Transform eye; [Header("瞄具参考点(通常是镜片中心)")] [SerializeField] private Transform eyeDistPos; [Header("聚焦参数")] [SerializeField] private float fadedDist = 0.2f; [SerializeField] private float maxAngle = 15f; [Header("材质控制")] [SerializeField] private Material focusMat; [SerializeField] private float minMult = 0f; [SerializeField] private float maxMult = 1f; private Vector2 posInput; private float circleCenterMovement; private void LateUpdate() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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) //IL_00b9: 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_00de: 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_00ed: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)eye == (Object)null) && !((Object)(object)eyeDistPos == (Object)null) && !((Object)(object)focusMat == (Object)null)) { float num = Vector3.Distance(eyeDistPos.position, eye.position); float num2 = num / fadedDist; num2 = Mathf.Clamp(num2, minMult, maxMult); Vector3 val = ((Component)this).transform.position - eye.position; float num3 = Vector3.Angle(val, ((Component)this).transform.forward); circleCenterMovement = num3 / maxAngle; Vector3 val2 = ((Component)this).transform.InverseTransformDirection(val); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(val2.x, val2.y); posInput = ((Vector2)(ref val3)).normalized * circleCenterMovement / 2f; focusMat.SetFloat("_Mult", num2); focusMat.SetFloat("_XPos", 0.5f + posInput.x); focusMat.SetFloat("_YPos", 0.5f + posInput.y); } } } } [HelpURL("https://geom.io/bakery/wiki/index.php?title=Manual#Bakery_Light_Filter")] [DisallowMultipleComponent] public class BakeryLightFilter : MonoBehaviour { public Texture2D texture; [HideInInspector] public int lmid = 0; } namespace theWNbotMods { public class MWStim : MonoBehaviour { [Header("References")] public FVRPhysicalObject fvrObject; public KillAfter ka; public GameObject stimneedle; public GameObject torsoref; public AudioEvent inject; [Header("Rot Objects")] public GameObject[] rot1s; public GameObject[] rot2s; [Header("Rotation Settings")] public float rotSpeed = 5f; [Header("Cap Settings")] public GameObject capObject; public GameObject capRemovedPrefab; public Transform capSpawnPoint; public bool destroyCapObject = true; [Header("Mouth Bite Settings")] public float biteDistance = 0.2f; public GameObject biteFXPrefab; public Vector3 biteFXOffset = new Vector3(0f, -0.05f, 0.1f); private bool isTriggerHeld = false; private bool hasInjected = false; private bool capRemoved = false; private Transform headTransform; private void Awake() { if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)GM.CurrentPlayerBody.Head != (Object)null) { headTransform = GM.CurrentPlayerBody.Head; } if ((Object)(object)fvrObject == (Object)null) { fvrObject = ((Component)this).GetComponent<FVRPhysicalObject>(); } } private void Update() { //IL_00c8: 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_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_009a: 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_01a6: 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_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)GM.CurrentPlayerBody.Torso != (Object)null && (Object)(object)torsoref != (Object)null && (Object)(object)stimneedle != (Object)null) { torsoref.transform.position = new Vector3(GM.CurrentPlayerBody.Torso.position.x, stimneedle.transform.position.y, GM.CurrentPlayerBody.Torso.position.z); } if (!capRemoved && (Object)(object)headTransform != (Object)null) { float num = Vector3.Distance(((Component)this).transform.position, headTransform.position); if (num <= biteDistance) { BiteCap(); SpawnBiteFX(); } } if ((Object)(object)fvrObject != (Object)null && ((FVRInteractiveObject)fvrObject).m_isHeld && (Object)(object)((FVRInteractiveObject)fvrObject).m_hand != (Object)null) { if (((FVRInteractiveObject)fvrObject).m_hand.Input.TriggerFloat >= 0.5f || ((FVRInteractiveObject)fvrObject).m_hand.Input.AXButtonDown || ((FVRInteractiveObject)fvrObject).m_hand.Input.BYButtonDown) { stimneedle.transform.localPosition = new Vector3(0f, -0.1f, 0f); if (!capRemoved) { RemoveCap(); return; } isTriggerHeld = true; if (Vector3.Distance(torsoref.transform.position, stimneedle.transform.position) <= 0.25f && !hasInjected) { ((FVRInteractiveObject)fvrObject).m_hand.m_buzztime = 1f; ((FVRInteractiveObject)fvrObject).IsSimpleInteract = true; fvrObject.DistantGrabbable = false; SM.PlayCoreSound((FVRPooledAudioType)41, inject, stimneedle.transform.position); GM.CurrentPlayerBody.ActivatePower((PowerupType)0, (PowerUpIntensity)1, (PowerUpDuration)1, false, false, -1f); hasInjected = true; if ((Object)(object)ka != (Object)null) { ((Behaviour)ka).enabled = true; } } } else { stimneedle.transform.localPosition = Vector3.zero; isTriggerHeld = false; } } else { isTriggerHeld = false; } UpdateRotations(); } private void UpdateRotations() { //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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) if (rot1s != null) { GameObject[] array = rot1s; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null) { float num = ((!isTriggerHeld) ? 0f : 90f); float num2 = Mathf.Lerp(val.transform.localEulerAngles.x, num, Time.deltaTime * rotSpeed); val.transform.localEulerAngles = new Vector3(num2, 0f, 0f); } } } if (rot2s == null) { return; } GameObject[] array2 = rot2s; foreach (GameObject val2 in array2) { if ((Object)(object)val2 != (Object)null) { float num3 = ((!hasInjected) ? 0f : 90f); float num4 = Mathf.Lerp(val2.transform.localEulerAngles.x, num3, Time.deltaTime * rotSpeed); val2.transform.localEulerAngles = new Vector3(num4, 0f, 0f); } } } private void RemoveCap() { //IL_008b: 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_0090: 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_00a8: 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_00c5: Unknown result type (might be due to invalid IL or missing references) if (capRemoved) { return; } capRemoved = true; if ((Object)(object)capObject != (Object)null) { if (destroyCapObject) { Object.Destroy((Object)(object)capObject); } else { capObject.SetActive(false); } } if ((Object)(object)capRemovedPrefab != (Object)null) { Vector3 val = ((!((Object)(object)capSpawnPoint != (Object)null)) ? ((Component)this).transform.position : capSpawnPoint.position); Quaternion val2 = ((!((Object)(object)capSpawnPoint != (Object)null)) ? ((Component)this).transform.rotation : capSpawnPoint.rotation); Object.Instantiate<GameObject>(capRemovedPrefab, val, val2); } } private void BiteCap() { if (!capRemoved) { capRemoved = true; if ((Object)(object)capObject != (Object)null) { capObject.SetActive(false); } } } private void SpawnBiteFX() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) if ((Object)(object)biteFXPrefab != (Object)null && (Object)(object)headTransform != (Object)null) { Vector3 val = headTransform.position + headTransform.TransformVector(biteFXOffset); GameObject val2 = Object.Instantiate<GameObject>(biteFXPrefab, val, headTransform.rotation); val2.transform.SetParent(headTransform, true); } } } public class CQCFists : MonoBehaviour { [Header("CQC Settings")] public float GrabRange = 1f; public float FollowStrength = 10f; public float ThrowForce = 10f; public float DownSwingThreshold = 1.2f; public float ReleaseDistance = 0.8f; [Header("Audio Settings")] public AudioClip CQC_GrabSFX; public AudioClip CQC_ThrowSFX; [Header("Effect Durations")] public float HostageConfuseDuration = 999f; public float UnconsciousDuration = 5f; private FVRViveHand hand; private bool isGrabbing = false; private bool readyToThrow = false; private SosigLink grabbedLink = null; private Vector3 grabOffset; private Vector3 initialGrabPos; private void Update() { if (!((Component)this).gameObject.activeSelf) { return; } hand = FindHand(); if (!((Object)(object)hand == (Object)null)) { float triggerFloat = hand.Input.TriggerFloat; if (triggerFloat > 0.75f && !isGrabbing) { TryGrabNearestLink(); } if (isGrabbing && (Object)(object)grabbedLink != (Object)null) { FollowHandMovement(); DetectDownSwing(); DetectPullRelease(); } if (isGrabbing && triggerFloat <= 0.75f) { PerformThrow(); } } } private FVRViveHand FindHand() { if ((Object)(object)((Component)this).transform.parent == (Object)(object)((Component)GM.CurrentPlayerBody.LeftHand).transform) { return GM.CurrentMovementManager.Hands[0]; } if ((Object)(object)((Component)this).transform.parent == (Object)(object)((Component)GM.CurrentPlayerBody.RightHand).transform) { return GM.CurrentMovementManager.Hands[1]; } return null; } private void TryGrabNearestLink() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_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_00ba: 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_00fa: 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_0129: Unknown result type (might be due to invalid IL or missing references) SosigLink[] array = Object.FindObjectsOfType<SosigLink>(); float num = float.PositiveInfinity; SosigLink val = null; SosigLink[] array2 = array; foreach (SosigLink val2 in array2) { float num2 = Vector3.Distance(((Component)val2).transform.position, ((Component)this).transform.position); if (num2 < GrabRange && num2 < num) { num = num2; val = val2; } } if (!((Object)(object)val != (Object)null)) { return; } grabbedLink = val; isGrabbing = true; grabOffset = ((Component)grabbedLink).transform.position - ((Component)this).transform.position; initialGrabPos = ((Component)grabbedLink).transform.position; Sosig s = val.S; if ((Object)(object)s != (Object)null) { s.m_isConfused = true; s.m_confusedTime = HostageConfuseDuration; s.SetBodyPose((SosigBodyPose)0); s.ObjectUsageFocus = (SosigObjectUsageFocus)0; if ((Object)(object)s.Agent != (Object)null) { ((Behaviour)s.Agent).enabled = false; } s.SetCurrentOrder((SosigOrder)0); s.FallbackOrder = (SosigOrder)0; } if ((Object)(object)CQC_GrabSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_GrabSFX, ((Component)val).transform.position); } } private void FollowHandMovement() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)this).transform.position + grabOffset; ((Component)grabbedLink).transform.position = Vector3.Lerp(((Component)grabbedLink).transform.position, val, Time.deltaTime * FollowStrength); } private void DetectDownSwing() { //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) Vector3 throwLinearVelWorld = hand.GetThrowLinearVelWorld(); if (Vector3.Dot(((Vector3)(ref throwLinearVelWorld)).normalized, Vector3.down) > 0.6f && ((Vector3)(ref throwLinearVelWorld)).magnitude > DownSwingThreshold) { readyToThrow = true; } } private void DetectPullRelease() { //IL_000c: 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_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_00be: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(((Component)grabbedLink).transform.position, ((Component)this).transform.position); if (!(num > ReleaseDistance)) { return; } Vector3 val = ((Component)grabbedLink).transform.position - initialGrabPos; Vector3 normalized = ((Vector3)(ref val)).normalized; Sosig s = grabbedLink.S; if ((Object)(object)s != (Object)null && (Object)(object)s.CoreRB != (Object)null) { s.CoreRB.AddForce(normalized * ThrowForce, (ForceMode)2); s.KnockUnconscious(UnconsciousDuration); if ((Object)(object)CQC_ThrowSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_ThrowSFX, ((Component)s).transform.position); } } ResetCQC(); } private void PerformThrow() { //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_005b: 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_0079: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if (!readyToThrow || (Object)(object)grabbedLink == (Object)null) { ResetCQC(); return; } Sosig s = grabbedLink.S; if ((Object)(object)s == (Object)null) { ResetCQC(); return; } Vector3 throwLinearVelWorld = hand.GetThrowLinearVelWorld(); Vector3 normalized = ((Vector3)(ref throwLinearVelWorld)).normalized; if ((Object)(object)s.CoreRB != (Object)null) { s.CoreRB.AddForce(normalized * ThrowForce, (ForceMode)2); } s.KnockUnconscious(UnconsciousDuration); if ((Object)(object)CQC_ThrowSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_ThrowSFX, ((Component)s).transform.position); } ResetCQC(); } private void ResetCQC() { //IL_004c: 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) isGrabbing = false; readyToThrow = false; if ((Object)(object)grabbedLink != (Object)null && (Object)(object)grabbedLink.S != (Object)null) { Sosig s = grabbedLink.S; s.m_isConfused = false; s.ObjectUsageFocus = (SosigObjectUsageFocus)1; if ((Object)(object)s.Agent != (Object)null) { ((Behaviour)s.Agent).enabled = true; } s.SetCurrentOrder((SosigOrder)9); s.FallbackOrder = (SosigOrder)9; } grabbedLink = null; } private void OnDrawGizmosSelected() { //IL_0001: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, GrabRange); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, ReleaseDistance); } } public class CQCFistsSystem : MonoBehaviour { [Header("Prefabs")] public GameObject CQCHandLeftPrefab; public GameObject CQCHandRightPrefab; private GameObject leftHandObj; private GameObject rightHandObj; private void Update() { if ((Object)(object)GM.CurrentPlayerBody == (Object)null) { return; } if ((Object)(object)GM.CurrentMovementManager.Hands[0].m_currentInteractable == (Object)null && GM.CurrentMovementManager.Hands[0].Input.TriggerPressed) { if ((Object)(object)leftHandObj == (Object)null) { leftHandObj = Object.Instantiate<GameObject>(CQCHandLeftPrefab, ((Component)GM.CurrentPlayerBody.LeftHand).transform); } leftHandObj.SetActive(true); } else if ((Object)(object)leftHandObj != (Object)null) { leftHandObj.SetActive(false); } if ((Object)(object)GM.CurrentMovementManager.Hands[1].m_currentInteractable == (Object)null && GM.CurrentMovementManager.Hands[1].Input.TriggerPressed) { if ((Object)(object)rightHandObj == (Object)null) { rightHandObj = Object.Instantiate<GameObject>(CQCHandRightPrefab, ((Component)GM.CurrentPlayerBody.RightHand).transform); } rightHandObj.SetActive(true); } else if ((Object)(object)rightHandObj != (Object)null) { rightHandObj.SetActive(false); } } private void OnDestroy() { if ((Object)(object)leftHandObj != (Object)null) { Object.Destroy((Object)(object)leftHandObj); } if ((Object)(object)rightHandObj != (Object)null) { Object.Destroy((Object)(object)rightHandObj); } } } [BepInProcess("h3vr.exe")] [BepInPlugin("theWNbotMods.CQCFistsToggle", "CQCFistsToggle", "1.0.0")] public class CQCFistsToggle : BaseUnityPlugin { private static class CQCFistsPatch { [HarmonyPatch(typeof(FVRWristMenu2), "Awake")] [HarmonyPostfix] public static void MenuButton(FVRWristMenu2 __instance) { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Expected O, but got Unknown //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Expected O, but got Unknown if ((Object)(object)__instance == (Object)null) { Logger.LogMessage((object)"No FVRWristMenu2"); return; } bool flag = false; foreach (WristMenuButton button in WristMenuAPI.Buttons) { if (button.Text == "CQCFistsToggle") { flag = true; break; } } if (!flag) { WristMenuAPI.Buttons.Add(new WristMenuButton("CQCFistsToggle", new ButtonClickEvent(ToggleCQCFistsSystem))); Logger.LogMessage((object)"CQCFistsToggle button added to wrist menu!"); } } public static void ToggleCQCFistsSystem(object sender, ButtonClickEventArgs args) { GameObject val = GameObject.Find("CQCFistsSystem(Clone)"); if ((Object)(object)val != (Object)null) { Logger.LogMessage((object)"CQCFistsSystem found, destroying..."); Object.Destroy((Object)(object)val); return; } Logger.LogMessage((object)"Spawning CQCFistsSystem from Inspector reference..."); CQCFistsToggle component = Chainloader.ManagerObject.GetComponent<CQCFistsToggle>(); if ((Object)(object)component != (Object)null && (Object)(object)component.CQCFistsSystemPrefab != (Object)null) { GameObject val2 = Object.Instantiate<GameObject>(component.CQCFistsSystemPrefab); Object.DontDestroyOnLoad((Object)(object)val2); ((Object)val2).name = "CQCFistsSystem(Clone)"; } else { Logger.LogMessage((object)"CQCFistsSystem Prefab not assigned in Inspector!"); } } } public GameObject CQCFistsSystemPrefab; internal static ManualLogSource Logger { get; private set; } public void Awake() { Logger = ((BaseUnityPlugin)this).Logger; Harmony.CreateAndPatchAll(typeof(CQCFistsPatch), (string)null); Logger.LogMessage((object)"CQCFistsToggle loaded!"); } } public class CQCMelee : MonoBehaviour { [Header("CQC Settings")] public float GrabRange = 1f; public float FollowStrength = 10f; public float ThrowForce = 10f; public float DownSwingThreshold = 1.2f; public float ReleaseDistance = 0.8f; [Header("Audio Settings")] public AudioClip CQC_GrabSFX; public AudioClip CQC_ThrowSFX; [Header("Effect Durations")] public float HostageConfuseDuration = 999f; public float UnconsciousDuration = 5f; [Header("Disable Prefabs on Grab")] public GameObject[] disableOnGrab; private FVRMeleeWeapon weapon; private FVRViveHand hand; private bool isGrabbing = false; private bool readyToThrow = false; private SosigLink grabbedLink = null; private Vector3 grabOffset; private Vector3 initialGrabPos; private void Start() { weapon = ((Component)this).GetComponent<FVRMeleeWeapon>(); } private void Update() { if ((Object)(object)weapon == (Object)null || !((FVRInteractiveObject)weapon).IsHeld) { return; } hand = ((FVRInteractiveObject)weapon).m_hand; if (!((Object)(object)hand == (Object)null)) { float triggerFloat = hand.Input.TriggerFloat; if (triggerFloat > 0.75f && !isGrabbing) { TryGrabNearestLink(); } if (isGrabbing && (Object)(object)grabbedLink != (Object)null) { FollowWeaponMovement(); DetectDownSwing(); DetectPullRelease(); } if (isGrabbing && triggerFloat <= 0.75f) { PerformThrow(); } } } private void TryGrabNearestLink() { //IL_0028: 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_0099: 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_00b3: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) SosigLink[] array = Object.FindObjectsOfType<SosigLink>(); float num = float.PositiveInfinity; SosigLink val = null; SosigLink[] array2 = array; foreach (SosigLink val2 in array2) { float num2 = Vector3.Distance(((Component)val2).transform.position, ((Component)weapon).transform.position); if (num2 < GrabRange && num2 < num) { num = num2; val = val2; } } if (!((Object)(object)val != (Object)null)) { return; } grabbedLink = val; isGrabbing = true; grabOffset = ((Component)grabbedLink).transform.position - ((Component)weapon).transform.position; initialGrabPos = ((Component)grabbedLink).transform.position; Sosig s = val.S; if ((Object)(object)s != (Object)null) { s.m_isConfused = true; s.m_confusedTime = HostageConfuseDuration; s.SetBodyPose((SosigBodyPose)0); s.ObjectUsageFocus = (SosigObjectUsageFocus)0; if ((Object)(object)s.Agent != (Object)null) { ((Behaviour)s.Agent).enabled = false; } s.SetCurrentOrder((SosigOrder)0); s.FallbackOrder = (SosigOrder)0; } if ((Object)(object)CQC_GrabSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_GrabSFX, ((Component)val).transform.position); } if (disableOnGrab == null) { return; } GameObject[] array3 = disableOnGrab; foreach (GameObject val3 in array3) { if ((Object)(object)val3 != (Object)null) { val3.SetActive(false); } } } private void FollowWeaponMovement() { //IL_000c: 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) //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_0045: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)weapon).transform.position + grabOffset; ((Component)grabbedLink).transform.position = Vector3.Lerp(((Component)grabbedLink).transform.position, val, Time.deltaTime * FollowStrength); } private void DetectDownSwing() { //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) Vector3 throwLinearVelWorld = hand.GetThrowLinearVelWorld(); if (Vector3.Dot(((Vector3)(ref throwLinearVelWorld)).normalized, Vector3.down) > 0.6f && ((Vector3)(ref throwLinearVelWorld)).magnitude > DownSwingThreshold) { readyToThrow = true; } } private void DetectPullRelease() { //IL_000c: 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_003f: 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_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_0088: 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_00c3: Unknown result type (might be due to invalid IL or missing references) float num = Vector3.Distance(((Component)grabbedLink).transform.position, ((Component)weapon).transform.position); if (!(num > ReleaseDistance)) { return; } Vector3 val = ((Component)grabbedLink).transform.position - initialGrabPos; Vector3 normalized = ((Vector3)(ref val)).normalized; Sosig s = grabbedLink.S; if ((Object)(object)s != (Object)null && (Object)(object)s.CoreRB != (Object)null) { s.CoreRB.AddForce(normalized * ThrowForce, (ForceMode)2); s.KnockUnconscious(UnconsciousDuration); if ((Object)(object)CQC_ThrowSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_ThrowSFX, ((Component)s).transform.position); } } ResetCQC(); } private void PerformThrow() { //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_005b: 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_0079: 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_00b5: Unknown result type (might be due to invalid IL or missing references) if (!readyToThrow || (Object)(object)grabbedLink == (Object)null) { ResetCQC(); return; } Sosig s = grabbedLink.S; if ((Object)(object)s == (Object)null) { ResetCQC(); return; } Vector3 throwLinearVelWorld = hand.GetThrowLinearVelWorld(); Vector3 normalized = ((Vector3)(ref throwLinearVelWorld)).normalized; if ((Object)(object)s.CoreRB != (Object)null) { s.CoreRB.AddForce(normalized * ThrowForce, (ForceMode)2); } s.KnockUnconscious(UnconsciousDuration); if ((Object)(object)CQC_ThrowSFX != (Object)null) { AudioSource.PlayClipAtPoint(CQC_ThrowSFX, ((Component)s).transform.position); } ResetCQC(); } private void ResetCQC() { //IL_004c: 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) isGrabbing = false; readyToThrow = false; if ((Object)(object)grabbedLink != (Object)null && (Object)(object)grabbedLink.S != (Object)null) { Sosig s = grabbedLink.S; s.m_isConfused = false; s.ObjectUsageFocus = (SosigObjectUsageFocus)1; if ((Object)(object)s.Agent != (Object)null) { ((Behaviour)s.Agent).enabled = true; } s.SetCurrentOrder((SosigOrder)9); s.FallbackOrder = (SosigOrder)9; } grabbedLink = null; if (disableOnGrab == null) { return; } GameObject[] array = disableOnGrab; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null) { val.SetActive(true); } } } private void OnDrawGizmosSelected() { //IL_0001: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Gizmos.color = Color.red; Gizmos.DrawWireSphere(((Component)this).transform.position, GrabRange); Gizmos.color = Color.yellow; Gizmos.DrawWireSphere(((Component)this).transform.position, ReleaseDistance); } } public class CigaretteAttach : MonoBehaviour { [Header("Attach Settings")] public float attachDistance = 0.2f; public Vector3 positionOffset = new Vector3(0f, -0.05f, 0.05f); public Vector3 rotationOffsetEuler = new Vector3(0f, 0f, 0f); [Header("Smoke Settings")] public GameObject PuffedSmokePrefab; public float puffDelay = 3f; public float puffCooldown = 2f; public Vector3 smokeOffset = new Vector3(0f, -0.1f, 0.1f); [Header("References")] public FVRCigarette cigarette; [Header("Attach Prefab Control")] public GameObject[] enableOnAttach; public GameObject[] disableOnAttach; [Header("Detach Prefab Control")] public GameObject[] enableOnDetach; public GameObject[] disableOnDetach; private bool isAttachedToHead = false; private Transform headTransform; private FVRPhysicalObject fvrObject; private Rigidbody rb; private float puffTimer = 0f; private bool inCooldown = false; private void Awake() { if ((Object)(object)GM.CurrentPlayerBody != (Object)null && (Object)(object)GM.CurrentPlayerBody.Head != (Object)null) { headTransform = GM.CurrentPlayerBody.Head; } fvrObject = ((Component)this).GetComponent<FVRPhysicalObject>(); rb = ((Component)this).GetComponent<Rigidbody>(); } private void Update() { //IL_0029: 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) if ((Object)(object)headTransform == (Object)null) { return; } if (!isAttachedToHead) { float num = Vector3.Distance(((Component)this).transform.position, headTransform.position); if (num <= attachDistance) { AttachToHead(); } } if (isAttachedToHead) { if ((Object)(object)fvrObject != (Object)null && ((FVRInteractiveObject)fvrObject).m_isHeld) { DetachFromHead(); } else { HandleSmokeLogic(); } } } private void AttachToHead() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) isAttachedToHead = true; ((Component)this).transform.SetParent(headTransform); ((Component)this).transform.localPosition = positionOffset; ((Component)this).transform.localRotation = Quaternion.Euler(rotationOffsetEuler); if ((Object)(object)rb != (Object)null) { rb.isKinematic = true; rb.useGravity = false; } puffTimer = 0f; inCooldown = false; GameObject[] array = enableOnAttach; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null) { val.SetActive(true); } } GameObject[] array2 = disableOnAttach; foreach (GameObject val2 in array2) { if ((Object)(object)val2 != (Object)null) { val2.SetActive(false); } } } private void DetachFromHead() { isAttachedToHead = false; ((Component)this).transform.SetParent((Transform)null); if ((Object)(object)rb != (Object)null) { rb.isKinematic = false; rb.useGravity = true; } puffTimer = 0f; inCooldown = false; GameObject[] array = enableOnDetach; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null) { val.SetActive(true); } } GameObject[] array2 = disableOnDetach; foreach (GameObject val2 in array2) { if ((Object)(object)val2 != (Object)null) { val2.SetActive(false); } } } private void HandleSmokeLogic() { //IL_006e: 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_007f: 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_0090: 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) if ((Object)(object)cigarette == (Object)null || !cigarette.IsBurning()) { return; } puffTimer += Time.deltaTime; if (!inCooldown && puffTimer >= puffDelay) { if ((Object)(object)PuffedSmokePrefab != (Object)null) { Vector3 val = headTransform.position + headTransform.TransformVector(smokeOffset); Object.Instantiate<GameObject>(PuffedSmokePrefab, val, headTransform.rotation); } inCooldown = true; puffTimer = 0f; } else if (inCooldown && puffTimer >= puffCooldown) { inCooldown = false; puffTimer = 0f; } } } public class CigaretteBox : FVRPhysicalObject { private bool triggerPressedLastFrame = false; private bool isOpen = false; private bool isTouching = false; private Vector2 initTouch = Vector2.zero; private Vector2 LastTouchPoint = Vector2.zero; public Transform CaseLid; public float openRotationX = 90f; public float openRotationY = 0f; public float openRotationZ = 0f; public float closeRotationX = 0f; public float closeRotationY = 0f; public float closeRotationZ = 0f; public float rotationSpeed = 5f; public AudioSource audioSource; public AudioClip openSound; public AudioClip closeSound; public GameObject objectToToggle; public List<Transform> Dings; public int m_numDings; public CigaretteBoxTrigger cigaretteBoxTrigger; 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_016b: 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_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) //IL_0119: 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_011f: 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_012b: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) ((FVRPhysicalObject)this).UpdateInteraction(hand); if (hand.Input.TriggerFloat > 0.8f && !triggerPressedLastFrame && (Object)(object)hand.CurrentInteractable == (Object)(object)this) { ToggleLid(); triggerPressedLastFrame = true; } else if (hand.Input.TriggerFloat < 0.2f) { triggerPressedLastFrame = false; } 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(openRotationX, openRotationY, openRotationZ) : Quaternion.Euler(closeRotationX, closeRotationY, closeRotationZ)); 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 CigaretteBoxTrigger : FVRInteractiveObject { public CigaretteBox cigaretteBox; public GameObject cigarPrefab; public override bool IsInteractable() { return cigaretteBox.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 (cigaretteBox.IsOpen()) { cigaretteBox.RemoveDing(); GameObject val = Object.Instantiate<GameObject>(cigarPrefab, ((HandInput)(ref hand.Input)).Pos, ((HandInput)(ref hand.Input)).Rot); FVRPhysicalObject component = val.GetComponent<FVRPhysicalObject>(); hand.ForceSetInteractable((FVRInteractiveObject)(object)component); ((FVRInteractiveObject)component).BeginInteraction(hand); } else { cigaretteBox.Open(); } } } namespace theWNbotMods { [Serializable] public class MotionPart { public GameObject motionPrefab; public GameObject startPrefab; public GameObject endPrefab; } public class FVRCigarette : QBArmorHelmet { [Header("Visual Prefabs")] public GameObject Unlit; public GameObject Lit; [Header("Motion Parts")] public MotionPart[] motionParts; [Header("Animation Settings")] public float burnAnimDuration = 10f; private float burnAnimTimer = 0f; private bool animPlaying = false; [Header("Burn Settings")] public float BurnDuration = 120f; public float DestructionDelay = 10f; private bool m_isBurning = false; private bool m_hasBeenLit = false; private float m_burnTimer; [Header("Fire Prefabs Control")] public GameObject[] fireOnPrefabs; public GameObject[] fireOffPrefabs; [Header("Torch Prefab Control")] public GameObject torchPrefab; [Header("Extinguish Collider")] public Collider ExtinguishCollider; [Header("Extinguish Settings")] public LayerMask ExtinguishLayers; [Header("Audio Settings")] public AudioSource audioSource; public AudioClip extinguishSound; public override void Awake() { ((QBArmorHelmet)this).Awake(); if ((Object)(object)Unlit != (Object)null) { Unlit.SetActive(true); } if ((Object)(object)Lit != (Object)null) { Lit.SetActive(false); } if (motionParts == null) { return; } MotionPart[] array = motionParts; foreach (MotionPart motionPart in array) { if ((Object)(object)motionPart.motionPrefab != (Object)null) { motionPart.motionPrefab.SetActive(false); } } } public override void FVRUpdate() { //IL_00b4: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0120: 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_0136: Unknown result type (might be due to invalid IL or missing references) ((QBArmorPiece)this).FVRUpdate(); if (!m_isBurning) { return; } m_burnTimer -= Time.deltaTime; if (animPlaying) { burnAnimTimer += Time.deltaTime; float num = Mathf.Clamp01(burnAnimTimer / burnAnimDuration); MotionPart[] array = motionParts; foreach (MotionPart motionPart in array) { if ((Object)(object)motionPart.motionPrefab != (Object)null && (Object)(object)motionPart.startPrefab != (Object)null && (Object)(object)motionPart.endPrefab != (Object)null) { motionPart.motionPrefab.transform.position = Vector3.Lerp(motionPart.startPrefab.transform.position, motionPart.endPrefab.transform.position, num); motionPart.motionPrefab.transform.rotation = Quaternion.Lerp(motionPart.startPrefab.transform.rotation, motionPart.endPrefab.transform.rotation, num); motionPart.motionPrefab.transform.localScale = Vector3.Lerp(motionPart.startPrefab.transform.localScale, motionPart.endPrefab.transform.localScale, num); } } if (num >= 1f) { animPlaying = false; } } if (m_burnTimer <= 0f) { StopBurning(); } } public void Ignite() { if (m_isBurning) { return; } m_hasBeenLit = true; m_isBurning = true; if (m_burnTimer <= 0f) { m_burnTimer = BurnDuration; } if ((Object)(object)Unlit != (Object)null) { Unlit.SetActive(false); } if ((Object)(object)Lit != (Object)null) { Lit.SetActive(true); } animPlaying = true; if (motionParts != null) { MotionPart[] array = motionParts; foreach (MotionPart motionPart in array) { if ((Object)(object)motionPart.motionPrefab != (Object)null && (Object)(object)motionPart.startPrefab != (Object)null) { motionPart.motionPrefab.SetActive(true); } } } GameObject[] array2 = fireOnPrefabs; foreach (GameObject val in array2) { if ((Object)(object)val != (Object)null) { val.SetActive(true); } } if ((Object)(object)torchPrefab != (Object)null) { torchPrefab.SetActive(false); } } private void Extinguish() { if (!m_isBurning) { return; } m_isBurning = false; animPlaying = false; if ((Object)(object)Lit != (Object)null) { Lit.SetActive(true); } if ((Object)(object)Unlit != (Object)null) { Unlit.SetActive(false); } GameObject[] array = fireOffPrefabs; foreach (GameObject val in array) { if ((Object)(object)val != (Object)null) { val.SetActive(false); } } if ((Object)(object)torchPrefab != (Object)null) { torchPrefab.SetActive(true); } if ((Object)(object)audioSource != (Object)null && (Object)(object)extinguishSound != (Object)null) { audioSource.PlayOneShot(extinguishSound); } } private void StopBurning() { m_isBurning = false; animPlaying = false; if (motionParts == null) { return; } MotionPart[] array = motionParts; foreach (MotionPart motionPart in array) { if ((Object)(object)motionPart.motionPrefab != (Object)null) { motionPart.motionPrefab.SetActive(false); } } } private void OnCollisionEnter(Collision collision) { //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_0062: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)ExtinguishCollider == (Object)null) { return; } ContactPoint[] contacts = collision.contacts; for (int i = 0; i < contacts.Length; i++) { ContactPoint val = contacts[i]; if ((Object)(object)((ContactPoint)(ref val)).thisCollider == (Object)(object)ExtinguishCollider && ((1 << ((Component)collision.collider).gameObject.layer) & LayerMask.op_Implicit(ExtinguishLayers)) != 0) { Extinguish(); break; } } } public bool IsBurning() { return m_isBurning; } } public class TorchCigaretteTrigger : MonoBehaviour { [Header("Cigarette Reference")] public FVRCigarette Cigarette; [Header("Torch Prefab")] public GameObject torchPrefab; private void OnTriggerEnter(Collider col) { if ((Object)(object)Cigarette != (Object)null) { Cigarette.Ignite(); if ((Object)(object)torchPrefab != (Object)null) { torchPrefab.SetActive(false); } } } } public class DelayedActive : MonoBehaviour { [Header("延迟多少秒后激活 Prefab")] public float delay = 1f; [Header("要激活的 Prefab 列表")] public GameObject[] prefabsToActivate; private void OnEnable() { ((MonoBehaviour)this).StartCoroutine(ActivateAfterDelay()); } private IEnumerator ActivateAfterDelay() { if (delay > 0f) { yield return (object)new WaitForSeconds(delay); } for (int i = 0; i < prefabsToActivate.Length; i++) { if ((Object)(object)prefabsToActivate[i] != (Object)null) { prefabsToActivate[i].SetActive(true); } } } } public class SpamConsle : MonoBehaviour { [Header("Spam Settings")] public float spamInterval = 0.2f; private float timer = 0f; private string[] horrorMessages = new string[10] { "ITS ME", "HIDE", "SAVE THEM", "STRING LOST", "ITS ME", "ERROR331", "ERROR115", "LEFT TO ROT", "ERROR130", "ITS ME" }; private void Update() { timer += Time.deltaTime; if (timer >= spamInterval) { timer = 0f; string text = horrorMessages[Random.Range(0, horrorMessages.Length)]; Debug.Log((object)text); if (Random.value > 0.85f) { Debug.LogError((object)("!!! CRITICAL ERROR: " + text + " !!!")); } } } } public class FultonDevice : MonoBehaviour { [Header("References")] public FVRPhysicalObject fvrObject; public Rigidbody rootRB; public Transform animationRot; public Transform balloonObject; [Header("Recovery Heights")] public float posAHeight = 2f; public float posBHeight = 8f; [Header("Settings")] public float stickCooldown = 0.2f; public float animSpeed = 5f; public float hoverTime = 0.5f; public float dipDistance = 0.15f; public float dipSpeed = 2f; public float riseStartSpeed = 1.5f; public float riseRecoverySpeed = 3f; [Header("Balloon Settings")] public float balloonHeightStart = 0.3f; public float balloonHeightEnd = 1.2f; public float balloonHeightSpeed = 2f; [Header("Balloon Explosion Settings")] public Collider[] balloonColliders; public LayerMask balloonHitMask; public AudioClip balloonExplodeSFX; public float balloonExplodeForce = 2f; public bool balloonExplodeOnDamage = true; [Header("Balloon HP shit")] public float startingBalloonHealth = 100f; private float currentBalloonHealth; public Vector2 resistMult_Blunt = new Vector2(0f, 1f); public Vector2 resistMult_Piercing = new Vector2(0f, 1f); public Vector2 resistMult_Cutting = new Vector2(0f, 1f); [Header("Audio")] public AudioClip fultonStartSFX; public AudioClip flyAwaySFX; [Header("Debug Tools")] public bool ForceRecovery = false; [Header("Arming Settings")] public bool requireTriggerToStick = true; [Header("Sosig Affect Settings(这个目前坏了,用不了)")] public bool affectNearbySosigs = true; public float sosigAffectRadius = 1f; public float sosigKnockDuration = 999f; [Header("Arm Detector")] public GameObject armIndicator; [Header("Auto BoomBalloon Settings")] public bool autoExplodeOnFail = true; public float autoExplodeDelay = 10f; private bool isTriggerHeld = false; private bool isJointed = false; private bool isRecoverable = false; private float cooldownTimer = 0f; private FixedJoint joint; private Collider jointedCollider; private Rigidbody jointedRB; private FVRViveHand hand; private bool recoveryStarted = false; public bool IsArmed => isTriggerHeld; private void Awake() { if (balloonColliders != null) { Collider[] array = balloonColliders; foreach (Collider val in array) { if ((Object)(object)val != (Object)null) { val.isTrigger = true; } } } currentBalloonHealth = startingBalloonHealth; if (balloonColliders == null) { return; } Collider[] array2 = balloonColliders; foreach (Collider val2 in array2) { if ((Object)(object)val2 != (Object)null) { val2.isTrigger = true; } } } private Rigidbody GetRootRigidbody(Rigidbody rb) { Transform val = ((Component)rb).transform; Rigidbody result = rb; FVRPhysicalObject val2 = null; while ((Object)(object)val.parent != (Object)null) { Rigidbody component = ((Component)val.parent).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { result = component; } FVRPhysicalObject component2 = ((Component)val.parent).GetComponent<FVRPhysicalObject>(); if ((Object)(object)component2 != (Object)null) { val2 = component2; } val = val.parent; } if ((Object)(object)val2 != (Object)null) { Rigidbody component3 = ((Component)val2).GetComponent<Rigidbody>(); if ((Object)(object)component3 != (Object)null) { return component3; } } return result; } public void Damage(Damage dam) { float num = Mathf.Clamp((dam.Dam_Blunt - resistMult_Blunt.x) * resistMult_Blunt.y, 0f, dam.Dam_Blunt); float num2 = Mathf.Clamp((dam.Dam_Cutting - resistMult_Cutting.x) * resistMult_Cutting.y, 0f, dam.Dam_Cutting); float num3 = Mathf.Clamp((dam.Dam_Piercing - resistMult_Piercing.x) * resistMult_Piercing.y, 0f, dam.Dam_Piercing); float num4 = num + num2 + num3; currentBalloonHealth -= num4; if (currentBalloonHealth <= 0f) { BalloonExplode(); } } public void StartRecovery() { if (!recoveryStarted) { ((MonoBehaviour)this).StartCoroutine(FultonRecoveryRoutine()); } } private void Update() { //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) if (cooldownTimer < stickCooldown) { cooldownTimer += Time.deltaTime; } if (isJointed && (Object)(object)jointedCollider == (Object)null) { Disconnect(); } if (!recoveryStarted && ForceRecovery) { ForceRecovery = false; StartRecovery(); } if (isRecoverable && !recoveryStarted && (Object)(object)fvrObject != (Object)null && ((FVRInteractiveObject)fvrObject).m_isHeld) { hand = ((FVRInteractiveObject)fvrObject).m_hand; if ((Object)(object)hand != (Object)null && hand.Input.TriggerDown) { StartRecovery(); } } if ((Object)(object)fvrObject != (Object)null && ((FVRInteractiveObject)fvrObject).m_isHeld) { hand = ((FVRInteractiveObject)fvrObject).m_hand; if ((Object)(object)hand != (Object)null) { isTriggerHeld = hand.Input.TriggerFloat >= 0.5f; } } else { isTriggerHeld = false; } if ((Object)(object)armIndicator != (Object)null) { armIndicator.SetActive(IsArmed); } if ((Object)(object)balloonObject != (Object)null) { Quaternion rotation = balloonObject.rotation; Vector3 eulerAngles = ((Quaternion)(ref rotation)).eulerAngles; balloonObject.rotation = Quaternion.Euler(0f, eulerAngles.y, 0f); } } private void OnCollisionEnter(Collision col) { if (!isJointed && !(cooldownTimer < stickCooldown) && !((Object)(object)col.collider == (Object)null) && (!requireTriggerToStick || isTriggerHeld)) { Rigidbody attachedRigidbody = col.collider.attachedRigidbody; if ((Object)(object)attachedRigidbody != (Object)null) { StickToRigidbody(col.collider, attachedRigidbody); isRecoverable = true; } else { StickToStatic(col.collider); } } } private void StickToRigidbody(Collider col, Rigidbody hitRB) { jointedCollider = col; jointedRB = GetRootRigidbody(hitRB); if ((Object)(object)jointedRB != (Object)null) { FVRPhysicalObject componentInParent = ((Component)jointedRB).GetComponentInParent<FVRPhysicalObject>(); if ((Object)(object)componentInParent != (Object)null && ((FVRInteractiveObject)componentInParent).m_isHeld) { ((FVRInteractiveObject)componentInParent).ForceBreakInteraction(); } } joint = ((Component)this).gameObject.AddComponent<FixedJoint>(); ((Joint)joint).connectedBody = jointedRB; isJointed = true; } private void StickToStatic(Collider col) { jointedCollider = col; isRecoverable = true; isJointed = true; } public void Disconnect() { if ((Object)(object)joint != (Object)null) { Object.Destroy((Object)(object)joint); } if ((Object)(object)rootRB != (Object)null) { rootRB.isKinematic = false; } isJointed = false; jointedRB = null; jointedCollider = null; isRecoverable = false; isTriggerHeld = false; if ((Object)(object)armIndicator != (Object)null) { armIndicator.SetActive(false); } } private IEnumerator BalloonHeightRoutine() { float t = 0f; while (t < 1f) { t += Time.deltaTime * balloonHeightSpeed; float h = Mathf.Lerp(balloonHeightStart, balloonHeightEnd, t); if ((Object)(object)balloonObject != (Object)null) { balloonObject.localPosition = new Vector3(balloonObject.localPosition.x, h, balloonObject.localPosition.z); } yield return null; } } private void BalloonExplode() { //IL_002e: 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_0078: Unknown result type (might be due to invalid IL or missing references) if (recoveryStarted) { if ((Object)(object)balloonExplodeSFX != (Object)null) { AudioSource.PlayClipAtPoint(balloonExplodeSFX, ((Component)this).transform.position); } if ((Object)(object)jointedRB != (Object)null) { ((Component)jointedRB).transform.SetParent((Transform)null); jointedRB.isKinematic = false; jointedRB.AddForce(Vector3.up * balloonExplodeForce, (ForceMode)1); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public void TakeDamage(Damage d) { if (balloonExplodeOnDamage) { BalloonExplode(); } } private void OnTriggerEnter(Collider other) { if (balloonColliders == null) { return; } Collider[] array = balloonColliders; foreach (Collider val in array) { if (!((Object)(object)val == (Object)null) && !((Object)(object)other == (Object)(object)val) && (((LayerMask)(ref balloonHitMask)).value == 0 || ((1 << ((Component)other).gameObject.layer) & ((LayerMask)(ref balloonHitMask)).value) != 0)) { BalloonExplode(); break; } } } private IEnumerator FultonRecoveryRoutine() { recoveryStarted = true; Sosig sosig = ((!((Object)(object)jointedRB != (Object)null)) ? null : ((Component)jointedRB).GetComponentInParent<Sosig>()); if ((Object)(object)sosig != (Object)null && (int)sosig.BodyState == 0) { ((MonoBehaviour)this).StartCoroutine(DelayedExplosionRoutine()); } if (autoExplodeOnFail) { ((MonoBehaviour)this).StartCoroutine(AutoExplodeRoutine()); } if ((Object)(object)jointedRB != (Object)null) { FVRPhysicalObject componentInParent = ((Component)jointedRB).GetComponentInParent<FVRPhysicalObject>(); if ((Object)(object)componentInParent != (Object)null && ((FVRInteractiveObject)componentInParent).m_isHeld) { ((FVRInteractiveObject)componentInParent).ForceBreakInteraction(); } } if (affectNearbySosigs) { Collider[] array = Physics.OverlapSphere(((Component)this).transform.position, sosigAffectRadius); Collider[] array2 = array; foreach (Collider val in array2) { Sosig componentInParent2 = ((Component)val).GetComponentInParent<Sosig>(); if ((Object)(object)componentInParent2 != (Object)null) { componentInParent2.KnockUnconscious(sosigKnockDuration); componentInParent2.m_isConfused = true; componentInParent2.m_confusedTime = sosigKnockDuration; if ((Object)(object)componentInParent2.Agent != (Object)null) { ((Behaviour)componentInParent2.Agent).enabled = false; } componentInParent2.SetCurrentOrder((SosigOrder)0); componentInParent2.FallbackOrder = (SosigOrder)0; } } } if ((Object)(object)fultonStartSFX != (Object)null) { AudioSource.PlayClipAtPoint(fultonStartSFX, ((Component)this).transform.position); } ((MonoBehaviour)this).StartCoroutine(BalloonHeightRoutine()); Vector3 posAWorld = ((Component)this).transform.position + Vector3.up * posAHeight; Vector3 posBWorld = ((Component)this).transform.position + Vector3.up * posBHeight; if ((Object)(object)animationRot != (Object)null) { float t = 0f; float startX = animationRot.localEulerAngles.x; while (t < 1f) { t += Time.deltaTime * animSpeed; float newX = Mathf.Lerp(startX, 90f, t); animationRot.localEulerAngles = new Vector3(newX, animationRot.localEulerAngles.y, animationRot.localEulerAngles.z); yield return null; } } if ((Object)(object)jointedRB != (Object)null) { ((Component)jointedRB).transform.SetParent(((Component)this).transform); jointedRB.isKinematic = true; } yield return MoveToPosition(posAWorld, riseStartSpeed); yield return (object)new WaitForSeconds(hoverTime); Vector3 dipPos = posAWorld - new Vector3(0f, dipDistance, 0f); yield return MoveToPosition(dipPos, dipSpeed); if ((Object)(object)flyAwaySFX != (Object)null) { AudioSource.PlayClipAtPoint(flyAwaySFX, ((Component)this).transform.position); } yield return MoveToPosition(posBWorld, riseRecoverySpeed); if ((Object)(object)jointedRB != (Object)null) { Object.Destroy((Object)(object)((Component)jointedRB).gameObject); } Object.Destroy((Object)(object)((Component)this).gameObject); } private IEnumerator DelayedExplosionRoutine() { yield return (object)new WaitForSeconds(3f); BalloonExplode(); } private IEnumerator AutoExplodeRoutine() { yield return (object)new WaitForSeconds(autoExplodeDelay); if (recoveryStarted && (Object)(object)this != (Object)null) { BalloonExplode(); } } private IEnumerator MoveToPosition(Vector3 target, float speed) { //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) while (Vector3.Distance(((Component)this).transform.position, target) > 0.01f) { ((Component)this).transform.position = Vector3.MoveTowards(((Component)this).transform.position, target, Time.deltaTime * speed); if ((Object)(object)jointedRB != (Object)null) { Quaternion val = Quaternion.LookRotation(Vector3.forward, Vector3.up); ((Component)jointedRB).transform.rotation = Quaternion.Lerp(((Component)jointedRB).transform.rotation, val, Time.deltaTime * 1.5f); } yield return null; } } private void OnDrawGizmosSelected() { //IL_0001: 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) Gizmos.color = Color.cyan; Gizmos.DrawWireSphere(((Component)this).transform.position, sosigAffectRadius); } } public class FultonStartTrigger : MonoBehaviour { private AR15HandleSightFlipper flipper; private FultonDevice fulton; private bool lastState; private void Start() { flipper = ((Component)this).GetComponent<AR15HandleSightFlipper>(); if ((Object)(object)flipper == (Object)null) { ((Behaviour)this).enabled = false; return; } fulton = ((Component)this).GetComponent<FultonDevice>(); if ((Object)(object)fulton == (Object)null) { ((Behaviour)this).enabled = false; } else { lastState = flipper.m_isLargeAperture; } } private void Update() { if (flipper.m_isLargeAperture != lastState) { fulton.StartRecovery(); lastState = flipper.m_isLargeAperture; } } } public class AR15FlipSightUniversalTrigger : MonoBehaviour { public enum AnimationType { OneWay, Lever, Button } [Serializable] public class AnimatedTarget { [Header("目标设置")] public Transform target; public GameObject startPrefab; public GameObject endPrefab; [Header("动画类型")] public AnimationType animationType = AnimationType.OneWay; [Header("动画参数")] public float delayBeforeStart = 0f; public float durationToEnd = 1f; public float delayBeforeReturn = 0f; public float durationToStart = 1f; [HideInInspector] public bool hasPlayed = false; [HideInInspector] public bool isAtEnd = false; [HideInInspector] public Vector3 startPos; [HideInInspector] public Vector3 endPos; [HideInInspector] public Vector3 startRot; [HideInInspector] public Vector3 endRot; [HideInInspector] public Vector3 startScale; [HideInInspector] public Vector3 endScale; } [Header("触发事件:生成 Prefab")] public GameObject prefabToSpawn; public Transform spawnPoint; [Header("动画目标列表")] public List<AnimatedTarget> animatedTargets = new List<AnimatedTarget>(); private AR15HandleSightFlipper flipper; private bool lastState; private void Start() { //IL_00bc: 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_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_00e8: 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_00fe: 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_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) flipper = ((Component)this).GetComponent<AR15HandleSightFlipper>(); if ((Object)(object)flipper == (Object)null) { Debug.LogError((object)"[UniversalTrigger] 找不到 AR15HandleSightFlipper!"); ((Behaviour)this).enabled = false; return; } if ((Object)(object)spawnPoint == (Object)null) { spawnPoint = ((Component)this).transform; } foreach (AnimatedTarget animatedTarget in animatedTargets) { if ((Object)(object)animatedTarget.target == (Object)null || (Object)(object)animatedTarget.startPrefab == (Object)null || (Object)(object)animatedTarget.endPrefab == (Object)null) { Debug.LogWarning((object)"[UniversalTrigger] 有动画目标未设置完整!"); continue; } animatedTarget.startPos = animatedTarget.startPrefab.transform.localPosition; animatedTarget.startRot = animatedTarget.startPrefab.transform.localEulerAngles; animatedTarget.startScale = animatedTarget.startPrefab.transform.localScale; animatedTarget.endPos = animatedTarget.endPrefab.transform.localPosition; animatedTarget.endRot = animatedTarget.endPrefab.transform.localEulerAngles; animatedTarget.endScale = animatedTarget.endPrefab.transform.localScale; } lastState = flipper.m_isLargeAperture; } private void Update() { if (flipper.m_isLargeAperture != lastState) { TriggerEvent(); lastState = flipper.m_isLargeAperture; } } public void TriggerEvent() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)prefabToSpawn != (Object)null) { Object.Instantiate<GameObject>(prefabToSpawn, spawnPoint.position, spawnPoint.rotation); } foreach (AnimatedTarget animatedTarget in animatedTargets) { if ((Object)(object)animatedTarget.target == (Object)null) { continue; } switch (animatedTarget.animationType) { case AnimationType.OneWay: if (!animatedTarget.hasPlayed) { ((MonoBehaviour)this).StartCoroutine(Animate(animatedTarget, toEnd: true)); animatedTarget.hasPlayed = true; } break; case AnimationType.Lever: ((MonoBehaviour)this).StartCoroutine(Animate(animatedTarget, !animatedTarget.isAtEnd)); animatedTarget.isAtEnd = !animatedTarget.isAtEnd; break; case AnimationType.Button: ((MonoBehaviour)this).StartCoroutine(Animate(animatedTarget, toEnd: true)); ((MonoBehaviour)this).StartCoroutine(Animate(animatedTarget, toEnd: false, animatedTarget.delayBeforeStart + animatedTarget.durationToEnd + animatedTarget.delayBeforeReturn)); break; } } } private IEnumerator Animate(AnimatedTarget target, bool toEnd, float extraDelay = 0f) { float delay = ((!toEnd) ? target.delayBeforeReturn : target.delayBeforeStart); float duration = ((!toEnd) ? target.durationToStart : target.durationToEnd); if (extraDelay > 0f) { yield return (object)new WaitForSeconds(extraDelay); } if (delay > 0f) { yield return (object)new WaitForSeconds(delay); } float t = 0f; while (t < duration) { float lerp = t / duration; Vector3 pos = Vector3.Lerp((!toEnd) ? target.endPos : target.startPos, (!toEnd) ? target.startPos : target.endPos, lerp); Vector3 rot = Vector3.Lerp((!toEnd) ? target.endRot : target.startRot, (!toEnd) ? target.startRot : target.endRot, lerp); Vector3 scale = Vector3.Lerp((!toEnd) ? target.endScale : target.startScale, (!toEnd) ? target.startScale : target.endScale, lerp); target.target.localPosition = pos; target.target.localEulerAngles = rot; target.target.localScale = scale; t += Time.deltaTime; yield return null; } target.target.localPosition = ((!toEnd) ? target.startPos : target.endPos); target.target.localEulerAngles = ((!toEnd) ? target.startRot : target.endRot); target.target.localScale = ((!toEnd) ? target.startScale : target.endScale); } } } public class Nuclear_bomb : MonoBehaviour { [Range(1f, 256f)] public float NukeDuration = 40f; private float CurrentDuration; public AnimationCurve SizeCurve; [Range(1f, 1024f)] public float SizeCurve_multiply; public float LightRadius = 2048f; public AnimationCurve LightRadius_curve; public float LightPower = 64f; public AnimationCurve LightPower_curve; private float FinalCurveVaue; private Vector3 finalShockWaveSize; public float sizeSpeed = 1f; private float finalShockSizeF; public Transform ShockWaveTransform; public Light BlastLight; public ParticleSystem blowPart; public MeshRenderer Mushrom; public float Emmis_mush; public float Emmis_steam; public AnimationCurve Mat_SizeCurve; public float _mat_SizeCurve_multiply; private void Start() { //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) finalShockWaveSize = new Vector3(0f, 0f, 0f); CurrentDuration = 0f; finalShockSizeF = 0f; } private void Update() { //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_003e: Unknown result type (might be due to invalid IL or missing references) finalShockSizeF += Time.deltaTime * sizeSpeed; finalShockWaveSize = new Vector3(finalShockSizeF, finalShockSizeF, finalShockSizeF); ShockWaveTransform.localScale = finalShockWaveSize; CurrentDuration += Time.deltaTime; FinalCurveVaue = Mathf.Clamp01(CurrentDuration / NukeDuration); BlastLight.intensity = LightPower * LightPower_curve.Evaluate(FinalCurveVaue); BlastLight.range = Mathf.Lerp(LightRadius, 0f, LightRadius_curve.Evaluate(FinalCurveVaue)); if (CurrentDuration > 40f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class NukeBomb : MonoBehaviour { public GameObject Prefab; private void Start() { } private void Update() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) if (Input.GetButtonDown("Fire1")) { Object.Instantiate<GameObject>(Prefab, ((Component)this).transform.position, ((Component)this).transform.rotation); } } } public class ShockWave : MonoBehaviour { public AudioSource shockwaveSound; private void Start() { } private void Update() { } private void OnTriggerEnter(Collider other) { if (((Component)other).gameObject.tag == "Player") { shockwaveSound.Play(); } } } namespace theWNbotMods { public class AirStrikeController : MonoBehaviour { [Serializable] public class BombConfig { public Transform dropPoint; public GameObject prefab; public float delay = 2f; public float forwardForce = 50f; [Header("额外参数")] public Vector3 spawnRotationOffset; public float downwardForce = 20f; } [Header("飞行参数")] public float flightSpeed = 80f; public Transform pos1; public Transform pos2; [Header("贝塞尔控制点")] public bool useAutoControlPoint = true; public float bendHeight = 50f; public float bendSide = 0f; public Transform controlPoint; [Header("多少个boomboom炸弹")] public BombConfig[] bombs; [Header("Flare 参数(机身自带隐藏的 Flare 对象)")] public GameObject flareObject; public float flareDelay = 5f; [Header("生命周期")] public float cleanupDelayAfterFlare = 5f; private float elapsedTime = 0f; private float totalTime = 0f; private Vector3 p0; private Vector3 p1; private Vector3 p2; private bool flareReleased = false; private void Awake() { if ((Object)(object)pos1 == (Object)null || (Object)(object)pos2 == (Object)null) { Debug.LogError((object)"[AirStrikeController] 请在 Inspector 设置 pos1 和 pos2。脚本已禁用。"); ((Behaviour)this).enabled = false; } else if ((Object)(object)flareObject != (Object)null) { flareObject.SetActive(false); } } private void Start() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_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_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_003b: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005c: 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_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_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_00c8: 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_00d9: Unknown result type (might be due to invalid IL or missing references) p0 = pos1.position; p2 = pos2.position; if (useAutoControlPoint) { Vector3 val = (p0 +