Decompiled source of Cursed Stratagems v1.0.1

Cursed_Stratagems.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using FistVR;
using HarmonyLib;
using OtherLoader;
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 Nikpo
{
	public class ObjectLevelRotation : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.rotation = Quaternion.identity;
		}
	}
	public class ObjectLookAtPlayer : MonoBehaviour
	{
		private void Awake()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: 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)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			((Component)this).transform.localEulerAngles = new Vector3(0f, ((Component)this).transform.localEulerAngles.y, 0f);
		}
	}
	public class UILookAtPlayer : MonoBehaviour
	{
		public Transform canvasToCheck;

		public float scaleFactor = 0.05f;

		public float minScale = 0.5f;

		public float maxScale = 2f;

		public float dotFadeThreshold = -0.8f;

		public float fadeSpeed = 0.1f;

		public float dotProductValue;

		private CanvasGroup canvasGroup;

		private void Start()
		{
			canvasGroup = ((Component)this).GetComponent<CanvasGroup>();
		}

		private void LateUpdate()
		{
			//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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.LookAt(GM.CurrentPlayerBody.Head.position);
			float num = Vector3.Distance(((Component)this).transform.position, GM.CurrentPlayerBody.Head.position);
			num *= scaleFactor;
			num = Mathf.Clamp(num, minScale, maxScale);
			((Component)this).transform.localScale = Vector3.one * num;
			float x = ((Component)this).transform.localScale.x;
			Vector3 forward = canvasToCheck.forward;
			Vector3 normalized = ((Vector3)(ref forward)).normalized;
			Vector3 forward2 = GM.CurrentPlayerBody.Head.forward;
			Vector3 normalized2 = ((Vector3)(ref forward2)).normalized;
			dotProductValue = Vector3.Dot(normalized, normalized2);
			if (x <= minScale)
			{
				FadeOut();
			}
			else if (dotProductValue <= dotFadeThreshold)
			{
				FadeIn();
			}
			else
			{
				FadeOut();
			}
		}

		private void FadeIn()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 1f, fadeSpeed);
		}

		private void FadeOut()
		{
			canvasGroup.alpha = Mathf.Lerp(canvasGroup.alpha, 0.2f, fadeSpeed);
		}
	}
}
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 + p2) * 0.5f;
				Vector3 val2 = Vector3.right * bendSide;
				Vector3 val3 = Vector3.up * bendHeight;
				p1 = val + val3 + val2;
			}
			else
			{
				if ((Object)(object)controlPoint == (Object)null)
				{
					Debug.LogError((object)"[AirStrikeController] useAutoControlPoint = false 时必须指定 controlPoint。脚本已禁用。");
					((Behaviour)this).enabled = false;
					return;
				}
				p1 = controlPoint.position;
			}
			((Component)this).transform.position = p0;
			float num = Vector3.Distance(p0, p2);
			totalTime = Mathf.Max(0.01f, num / Mathf.Max(0.01f, flightSpeed));
			BombConfig[] array = bombs;
			foreach (BombConfig bombConfig in array)
			{
				if (bombConfig != null && (Object)(object)bombConfig.prefab != (Object)null && (Object)(object)bombConfig.dropPoint != (Object)null)
				{
					((MonoBehaviour)this).StartCoroutine(DropBombWithDelay(bombConfig));
				}
			}
		}

		private void Update()
		{
			//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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			elapsedTime += Time.deltaTime;
			float num = Mathf.Clamp01(elapsedTime / totalTime);
			Vector3 position = (1f - num) * (1f - num) * p0 + 2f * (1f - num) * num * p1 + num * num * p2;
			((Component)this).transform.position = position;
			Vector3 val = 2f * (1f - num) * (p1 - p0) + 2f * num * (p2 - p1);
			if (((Vector3)(ref val)).sqrMagnitude > 1E-06f)
			{
				((Component)this).transform.forward = ((Vector3)(ref val)).normalized;
			}
			if (!flareReleased && elapsedTime >= flareDelay)
			{
				flareReleased = true;
				DeployFlare();
				if (cleanupDelayAfterFlare > 0f)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject, cleanupDelayAfterFlare);
				}
			}
		}

		private IEnumerator DropBombWithDelay(BombConfig bomb)
		{
			yield return (object)new WaitForSeconds(bomb.delay);
			Quaternion spawnRot = bomb.dropPoint.rotation * Quaternion.Euler(bomb.spawnRotationOffset);
			GameObject newBomb = Object.Instantiate<GameObject>(bomb.prefab, bomb.dropPoint.position, spawnRot);
			Rigidbody rb = newBomb.GetComponent<Rigidbody>();
			if ((Object)(object)rb != (Object)null)
			{
				rb.velocity = ((Component)this).transform.forward * bomb.forwardForce;
				rb.AddForce(Vector3.down * bomb.downwardForce, (ForceMode)2);
			}
		}

		private void DeployFlare()
		{
			if ((Object)(object)flareObject == (Object)null)
			{
				Debug.LogWarning((object)"[AirStrikeController] 未设置 flareObject,跳过 Flare 释放。");
				return;
			}
			flareObject.SetActive(true);
			flareObject.SendMessage("StartDeploy", (SendMessageOptions)1);
		}

		private void OnValidate()
		{
			flightSpeed = Mathf.Max(0.01f, flightSpeed);
			flareDelay = Mathf.Max(0f, flareDelay);
			cleanupDelayAfterFlare = Mathf.Max(0f, cleanupDelayAfterFlare);
		}
	}
	public class AirburstClusterScripts : MonoBehaviour
	{
		public enum StrikeMode
		{
			Airburst,
			Cluster
		}

		[Header("General Settings")]
		public StrikeMode mode = StrikeMode.Airburst;

		public GameObject fragmentPrefab;

		public GameObject subBombPrefab;

		public int count = 10;

		public float delay = 2f;

		public float initialSpeed = 20f;

		[Header("Cone Settings (for Airburst)")]
		public Transform pos1;

		public Transform pos2;

		public float coneRadius = 10f;

		private bool triggered = false;

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(SpawnRoutine());
		}

		private IEnumerator SpawnRoutine()
		{
			yield return (object)new WaitForSeconds(delay);
			TriggerSpawn();
		}

		public void TriggerSpawn()
		{
			if (!triggered)
			{
				triggered = true;
				if (mode == StrikeMode.Airburst)
				{
					SpawnAirburst();
				}
				else if (mode == StrikeMode.Cluster)
				{
					SpawnCluster();
				}
			}
		}

		private void SpawnAirburst()
		{
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0080: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0149: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)pos1 == (Object)null || (Object)(object)pos2 == (Object)null)
			{
				Debug.LogError((object)"Airburst mode requires pos1 and pos2 to define cone.");
				return;
			}
			Vector3 val = pos2.position - pos1.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			float num = Vector3.Distance(pos1.position, pos2.position);
			float num2 = Mathf.Atan2(coneRadius, num);
			OrthonormalBasis(normalized, out var u, out var v);
			for (int i = 0; i < count; i++)
			{
				float num3 = Mathf.Lerp(1f, Mathf.Cos(num2), Random.value);
				float num4 = Mathf.Sqrt(1f - num3 * num3);
				float num5 = Random.Range(0f, (float)Math.PI * 2f);
				Vector3 val2 = normalized * num3 + (u * Mathf.Cos(num5) + v * Mathf.Sin(num5)) * num4;
				((Vector3)(ref val2)).Normalize();
				GameObject val3 = Object.Instantiate<GameObject>(fragmentPrefab, pos1.position, Quaternion.identity);
				Rigidbody component = val3.GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.velocity = val2 * initialSpeed;
				}
			}
		}

		private void SpawnCluster()
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			for (int i = 0; i < count; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(subBombPrefab, ((Component)this).transform.position, Quaternion.identity);
				Rigidbody component = val.GetComponent<Rigidbody>();
				if ((Object)(object)component != (Object)null)
				{
					component.velocity = Random.insideUnitSphere * initialSpeed;
				}
			}
		}

		private static void OrthonormalBasis(Vector3 axis, out Vector3 u, out Vector3 v)
		{
			//IL_0021: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = ((!(Mathf.Abs(axis.y) < 0.99f)) ? Vector3.right : Vector3.up);
			u = Vector3.Normalize(Vector3.Cross(val, axis));
			v = Vector3.Normalize(Vector3.Cross(axis, u));
		}

		private void OnDrawGizmosSelected()
		{
			//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_0043: 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_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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: 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_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)pos1 == (Object)null) && !((Object)(object)pos2 == (Object)null))
			{
				Gizmos.color = Color.yellow;
				Gizmos.DrawLine(pos1.position, pos2.position);
				Vector3 val = pos2.position - pos1.position;
				Vector3 normalized = ((Vector3)(ref val)).normalized;
				OrthonormalBasis(normalized, out var u, out var v);
				int num = 36;
				Vector3 val2 = pos2.position + u * coneRadius;
				for (int i = 1; i <= num; i++)
				{
					float num2 = (float)i / (float)num * (float)Math.PI * 2f;
					Vector3 val3 = pos2.position + (u * Mathf.Cos(num2) + v * Mathf.Sin(num2)) * coneRadius;
					Gizmos.DrawLine(val2, val3);
					Gizmos.DrawLine(pos1.position, val3);
					val2 = val3;
				}
			}
		}
	}
}
public class Clustershit : MonoBehaviour
{
	public FVRDestroyableObject DO;

	public string bname;

	private void OnCollisionEnter(Collision collision)
	{
		if (((Object)((Component)collision.collider).gameObject).name != bname)
		{
			DO.m_isDestroyed = true;
		}
	}
}
namespace theWNbotMods
{
	public class DSSEagleStorm : MonoBehaviour
	{
		[Header("生成设置")]
		public GameObject[] eaglePrefabs;

		public Transform floorPos;

		public float spawnRadius = 50f;

		public float spawnInterval = 1f;

		public float stormDuration = 10f;

		[Header("角度设置")]
		public bool randomRotation = true;

		public Vector3 fixedRotationEuler;

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(StormRoutine());
		}

		private IEnumerator StormRoutine()
		{
			float startTime = Time.time;
			while (Time.time - startTime < stormDuration)
			{
				SpawnEagle();
				yield return (object)new WaitForSeconds(spawnInterval);
			}
		}

		private void SpawnEagle()
		{
			//IL_0094: 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_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			if (eaglePrefabs != null && eaglePrefabs.Length != 0 && !((Object)(object)floorPos == (Object)null))
			{
				GameObject val = eaglePrefabs[Random.Range(0, eaglePrefabs.Length)];
				float num = Random.Range(0f, 360f);
				float num2 = Random.Range(0f, spawnRadius);
				Vector3 val2 = default(Vector3);
				((Vector3)(ref val2))..ctor(Mathf.Cos(num * ((float)Math.PI / 180f)) * num2, 0f, Mathf.Sin(num * ((float)Math.PI / 180f)) * num2);
				Vector3 val3 = floorPos.position + val2;
				Quaternion val4 = ((!randomRotation) ? Quaternion.Euler(fixedRotationEuler) : Quaternion.Euler(0f, Random.Range(0f, 360f), 0f));
				Object.Instantiate<GameObject>(val, val3, val4);
			}
		}
	}
}
namespace calafex.Factory
{
	public class DamageArea : MonoBehaviour
	{
		private Dictionary<Collider, IFVRDamageable> _trackedDamageables = new Dictionary<Collider, IFVRDamageable>();

		public int Damage = 25;

		public DamageAreaType DamageAreaType;

		public bool IsContinuous = false;

		public float DamageFrequency = 0.5f;

		private float _timeUntilNextHit = 0f;

		public bool PlaySoundOnHit = false;

		public AudioSource AudioSource;

		public AudioClip[] AudioClips;

		private float _timeAfterLastSoundPlay = 0f;

		private void Start()
		{
			_timeUntilNextHit = DamageFrequency;
		}

		private void OnTriggerEnter(Collider col)
		{
			Component component = ((Component)col).gameObject.GetComponent(typeof(IFVRDamageable));
			if (!Object.op_Implicit((Object)(object)component))
			{
				return;
			}
			IFVRDamageable val = (IFVRDamageable)(object)((component is IFVRDamageable) ? component : null);
			if (!IsAffectable(col, val))
			{
				return;
			}
			ApplyDamage(col, val);
			if (IsContinuous && !_trackedDamageables.ContainsKey(col))
			{
				_trackedDamageables.Add(col, val);
			}
			if (((Component)col).gameObject.layer == 15)
			{
				if (GM.CurrentPlayerBody.GetPlayerHealthRaw() <= Damage)
				{
					GM.CurrentPlayerBody.KillPlayer(false);
				}
				else if (GM.CurrentPlayerBody.GetPlayerHealthRaw() > Damage)
				{
					FVRPlayerBody currentPlayerBody = GM.CurrentPlayerBody;
					currentPlayerBody.Health -= (float)Damage;
					GM.CurrentPlayerBody.HitEffect();
				}
			}
		}

		private void OnTriggerExit(Collider col)
		{
			if (IsContinuous && _trackedDamageables.ContainsKey(col))
			{
				_trackedDamageables.Remove(col);
			}
		}

		private void Update()
		{
			if (_timeAfterLastSoundPlay < 1f)
			{
				_timeAfterLastSoundPlay += Time.deltaTime;
			}
			if (!IsContinuous)
			{
				return;
			}
			_timeUntilNextHit -= Time.deltaTime;
			if (_timeUntilNextHit > 0f)
			{
				return;
			}
			_trackedDamageables = _trackedDamageables.Where((KeyValuePair<Collider, IFVRDamageable> kvp) => (Object)(object)kvp.Key != (Object)null).ToDictionary((KeyValuePair<Collider, IFVRDamageable> kvp) => kvp.Key, (KeyValuePair<Collider, IFVRDamageable> kvp) => kvp.Value);
			foreach (KeyValuePair<Collider, IFVRDamageable> trackedDamageable in _trackedDamageables)
			{
				ApplyDamage(trackedDamageable.Key, trackedDamageable.Value);
			}
			_timeUntilNextHit = DamageFrequency;
		}

		private bool IsAffectable(Collider col, IFVRDamageable damageable)
		{
			bool result = false;
			if (DamageAreaType == DamageAreaType.Fire)
			{
				if ((Object)(object)((Component)col).gameObject.GetComponent<FVRIgnitable>() != (Object)null)
				{
					result = true;
				}
				if (damageable is FVRMatchhead)
				{
					result = true;
				}
				if (damageable is HairsprayCan || damageable is HairsprayIgnitionTrigger)
				{
					result = true;
				}
				if (damageable is RotrwCharcoal)
				{
					result = true;
				}
			}
			if (DamageAreaType == DamageAreaType.Piercing)
			{
				if (damageable is UberShatterable)
				{
					result = true;
				}
				if (damageable is SodaCan)
				{
					result = true;
				}
			}
			if (damageable is FVRPlayerHitbox)
			{
				result = true;
			}
			if (damageable is SosigLink)
			{
				result = true;
			}
			if (damageable is MeatCrab)
			{
				result = true;
			}
			if (damageable is JerryCan)
			{
				result = true;
			}
			if (damageable is LightFluid)
			{
				result = true;
			}
			if (damageable is Molotov)
			{
				result = true;
			}
			return result;
		}

		private void ApplyDamage(Collider col, IFVRDamageable damageable)
		{
			//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_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Vector3 hitPoint = col.ClosestPoint(((Component)this).transform.position);
			damageable.Damage(GetDamage(hitPoint));
			if (DamageAreaType == DamageAreaType.Fire)
			{
				FVRIgnitable component = ((Component)col).gameObject.GetComponent<FVRIgnitable>();
				if (Object.op_Implicit((Object)(object)component))
				{
					FXM.Ignite(component, Random.Range(0.5f, 1.5f));
				}
			}
			if (PlaySoundOnHit)
			{
				PlaySound();
			}
		}

		private void PlaySound()
		{
			if (_timeAfterLastSoundPlay > 0.2f)
			{
				AudioSource.PlayOneShot(AudioClips[Random.Range(0, AudioClips.Length)]);
				_timeAfterLastSoundPlay = 0f;
			}
		}

		private Damage GetDamage(Vector3 hitPoint)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Expected O, but got Unknown
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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)
			Damage val = new Damage();
			val.point = hitPoint;
			val.hitNormal = Vector3.up;
			val.strikeDir = ((Component)this).transform.up;
			Damage val2 = val;
			switch (DamageAreaType)
			{
			case DamageAreaType.Fire:
				val2.Class = (DamageClass)0;
				val2.Dam_Thermal = Damage;
				val2.Dam_TotalEnergetic = Damage;
				break;
			case DamageAreaType.Piercing:
				val2.Class = (DamageClass)3;
				val2.Dam_Piercing = Damage;
				val2.Dam_TotalKinetic = Damage;
				break;
			}
			return val2;
		}
	}
	public enum DamageAreaType
	{
		Fire = 1,
		Piercing
	}
}
namespace theWNbotMods
{
	public class DelayedExplosion : MonoBehaviour
	{
		[Header("爆炸参数")]
		public float delay = 0.5f;

		public GameObject[] explosionPrefabs;

		public Transform spawnPoint;

		[Header("插入地表参数")]
		public float embedDepth = 0.5f;

		private void Start()
		{
			Debug.Log((object)"[DelayedExplosion] 出生,开始延迟爆炸倒计时");
			((MonoBehaviour)this).StartCoroutine(ExplodeAfterDelay());
		}

		private IEnumerator ExplodeAfterDelay()
		{
			yield return (object)new WaitForSeconds(delay);
			Transform transform = ((Component)this).transform;
			transform.position += Vector3.down * embedDepth;
			GameObject[] array = explosionPrefabs;
			foreach (GameObject val in array)
			{
				if ((Object)(object)val != (Object)null)
				{
					Vector3 val2 = ((!((Object)(object)spawnPoint != (Object)null)) ? ((Component)this).transform.position : spawnPoint.position);
					Quaternion val3 = ((!((Object)(object)spawnPoint != (Object)null)) ? Quaternion.identity : spawnPoint.rotation);
					GameObject val4 = Object.Instantiate<GameObject>(val, val2, val3);
					ParticleSystem[] componentsInChildren = val4.GetComponentsInChildren<ParticleSystem>();
					foreach (ParticleSystem val5 in componentsInChildren)
					{
						val5.Play();
					}
					AudioSource[] componentsInChildren2 = val4.GetComponentsInChildren<AudioSource>();
					foreach (AudioSource val6 in componentsInChildren2)
					{
						val6.Play();
					}
				}
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
}
namespace JerryComponent
{
	public class DestroyerAimmingSystem : MonoBehaviour
	{
		public LaserLight laserL;

		public Transform nearestAI;

		public Transform nearestEntity;

		public List<SosigLink> currentAI = null;

		public List<AIEntity> currentEntity = null;

		public GameObject lookAtObj;

		public float distanceNearest = 0f;

		public Transform player;

		public OrbitalStrikeController con;

		public float cd = 0.75f;

		public bool ed = false;

		private void OnTriggerEnter(Collider other)
		{
			if (((Object)((Component)other).gameObject).name == "Sosig_Torso")
			{
				currentAI.Add(((Component)other).gameObject.GetComponent<SosigLink>());
			}
		}

		private void Update()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)nearestEntity != (Object)null)
			{
				AxisLookAt(lookAtObj.transform, nearestEntity.position, Vector3.forward);
				distanceNearest = Vector3.Distance(((Component)this).gameObject.transform.position, ((Component)nearestEntity).transform.position);
				if (ed)
				{
					laserL.IsActive = false;
				}
				if (!ed)
				{
					if (cd > 0f)
					{
						cd -= Time.deltaTime;
					}
					if (cd <= 0f)
					{
						laserL.IsActive = true;
						con.shouldFire = true;
						ed = true;
					}
				}
			}
			if (currentEntity != null)
			{
				for (int i = 0; i < currentEntity.Count; i++)
				{
					if ((Object)(object)currentEntity[i] == (Object)null)
					{
						currentEntity.Remove(currentEntity[i]);
					}
				}
				nearestEntity = GetNearestGameObjectAI(player, currentEntity);
			}
			if (currentAI == null)
			{
				AIEntity[] array = Object.FindObjectsOfType<AIEntity>();
				AIEntity[] array2 = array;
				foreach (AIEntity val in array2)
				{
					if (!currentEntity.Contains(val) && val.IFFCode != GM.CurrentPlayerBody.GetPlayerIFF())
					{
						currentEntity.Add(val);
					}
				}
			}
			if ((Object)(object)nearestEntity == (Object)null || currentEntity == null || currentAI == null || (Object)(object)nearestAI == (Object)null || distanceNearest > 1500f)
			{
				lookAtObj.transform.localEulerAngles = new Vector3(0f, 0f, 0f);
				laserL.IsActive = false;
			}
			if ((Object)(object)nearestAI != (Object)null)
			{
				AxisLookAt(lookAtObj.transform, nearestAI.position, Vector3.forward);
				distanceNearest = Vector3.Distance(((Component)this).gameObject.transform.position, ((Component)nearestAI).transform.position);
				if (ed)
				{
					laserL.IsActive = false;
				}
				if (!ed)
				{
					if (cd > 0f)
					{
						cd -= Time.deltaTime;
					}
					if (cd <= 0f)
					{
						laserL.IsActive = true;
						con.shouldFire = true;
						ed = true;
					}
				}
			}
			if (currentAI == null)
			{
				return;
			}
			if (currentAI.Count <= 0)
			{
				AIEntity[] array3 = Object.FindObjectsOfType<AIEntity>();
				AIEntity[] array4 = array3;
				foreach (AIEntity item in array4)
				{
					if (!currentEntity.Contains(item))
					{
						currentEntity.Add(item);
					}
				}
			}
			else
			{
				if (currentAI.Count <= 0)
				{
					return;
				}
				nearestEntity = null;
				currentEntity = null;
				for (int l = 0; l < currentAI.Count; l++)
				{
					if ((Object)(object)currentAI[l] == (Object)null)
					{
						currentAI.Remove(currentAI[l]);
					}
				}
				nearestAI = GetNearestGameObject(player, currentAI);
			}
		}

		private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f);
		}

		public Transform GetNearestGameObject(Transform player, List<SosigLink> objects)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			Transform val = null;
			if (objects == null || (Object)(object)val == (Object)null)
			{
			}
			if (objects.Count > 1)
			{
				val = ((Component)objects[0]).transform;
				float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position);
				for (int i = 1; i < objects.Count; i++)
				{
					float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position);
					if (num > num2)
					{
						num = num2;
						val = ((Component)objects[i]).transform;
					}
				}
			}
			else if (objects.Count == 1)
			{
				val = ((Component)objects[0]).transform;
			}
			return val;
		}

		public Transform GetNearestGameObjectAI(Transform player, List<AIEntity> objects)
		{
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			Transform val = null;
			if (objects == null || (Object)(object)val == (Object)null)
			{
			}
			if (objects.Count > 1)
			{
				val = ((Component)objects[0]).transform;
				float num = Vector3.Distance(player.position, ((Component)objects[0]).transform.position);
				for (int i = 1; i < objects.Count; i++)
				{
					float num2 = Vector3.Distance(player.position, ((Component)objects[i]).transform.position);
					if (num > num2)
					{
						num = num2;
						val = ((Component)objects[i]).transform;
					}
				}
			}
			else if (objects.Count == 1)
			{
				val = ((Component)objects[0]).transform;
			}
			return val;
		}
	}
	public class DestroyerLaser : MonoBehaviour
	{
		public LineRenderer LR;

		public DestroyerAimmingSystem DAS;

		public GameObject HitPoint;

		public GameObject DamagePoint;

		public Vector3 RefHit;

		public GameObject Aperture;

		public LayerMask lm;

		public bool Started = false;

		public bool Started2 = false;

		public bool StartLaser = false;

		public bool StartLaser2 = false;

		public AudioEvent On;

		public float cd = 0.1f;

		public AudioEvent Off;

		public GameObject FirePrefab;

		private void Update()
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0334: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_035a: Unknown result type (might be due to invalid IL or missing references)
			//IL_036f: Unknown result type (might be due to invalid IL or missing references)
			//IL_037f: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0411: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_045b: Unknown result type (might be due to invalid IL or missing references)
			LR.SetPosition(0, Aperture.transform.position);
			LR.SetPosition(1, DamagePoint.transform.position);
			if ((Object)(object)DAS.nearestAI != (Object)null && DAS.ed)
			{
				StartLaser = true;
			}
			if ((Object)(object)DAS.nearestEntity != (Object)null && DAS.ed)
			{
				StartLaser2 = true;
			}
			if ((Object)(object)DAS.nearestAI == (Object)null || !DAS.ed)
			{
				StartLaser = false;
			}
			if ((Object)(object)DAS.nearestEntity == (Object)null || !DAS.ed)
			{
				StartLaser2 = false;
			}
			if (!StartLaser && StartLaser2)
			{
				((Renderer)LR).enabled = false;
				DamagePoint.transform.localPosition = new Vector3(0f, 0f, 0f);
				DamagePoint.SetActive(false);
			}
			if (StartLaser)
			{
				((Renderer)LR).enabled = true;
				HitPoint.transform.position = Vector3.SmoothDamp(HitPoint.transform.position, ((Component)DAS.nearestAI).gameObject.transform.position, ref RefHit, 0.15f);
				AxisLookAt(Aperture.transform, HitPoint.transform.position, Vector3.forward);
				RaycastHit val = default(RaycastHit);
				if (Physics.Raycast(Aperture.transform.position, Aperture.transform.forward, ref val, float.PositiveInfinity, LayerMask.op_Implicit(lm)))
				{
					DamagePoint.transform.position = ((RaycastHit)(ref val)).point;
					DamagePoint.SetActive(true);
					cd -= Time.deltaTime;
					if (cd < 0f)
					{
						Object.Instantiate<GameObject>(FirePrefab, DamagePoint.transform.position, new Quaternion(0f, 0f, 0f, 0f));
						cd = 0.1f;
					}
				}
				else
				{
					DamagePoint.SetActive(false);
				}
				if (!Started)
				{
					SM.PlayCoreSound((FVRPooledAudioType)41, On, DamagePoint.transform.position);
					Started = true;
				}
			}
			if (!StartLaser2)
			{
				return;
			}
			((Renderer)LR).enabled = true;
			HitPoint.transform.position = Vector3.SmoothDamp(HitPoint.transform.position, ((Component)DAS.nearestEntity).gameObject.transform.position, ref RefHit, 0.15f);
			AxisLookAt(Aperture.transform, HitPoint.transform.position, Vector3.forward);
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(Aperture.transform.position, Aperture.transform.forward, ref val2, float.PositiveInfinity, LayerMask.op_Implicit(lm)))
			{
				DamagePoint.transform.position = ((RaycastHit)(ref val2)).point;
				DamagePoint.SetActive(true);
				cd -= Time.deltaTime;
				if (cd < 0f)
				{
					Object.Instantiate<GameObject>(FirePrefab, DamagePoint.transform.position, new Quaternion(0f, 0f, 0f, 0f));
					cd = 0.1f;
				}
			}
			else
			{
				DamagePoint.SetActive(false);
			}
			if (!Started2)
			{
				SM.PlayCoreSound((FVRPooledAudioType)41, On, DamagePoint.transform.position);
				Started2 = true;
			}
		}

		private void AxisLookAt(Transform tr_self, Vector3 lookPos, Vector3 directionAxis)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			Quaternion rotation = tr_self.rotation;
			Vector3 val = lookPos - tr_self.position;
			Vector3 val2 = tr_self.rotation * directionAxis;
			Vector3 val3 = Vector3.Cross(val2, val);
			Vector3 normalized = ((Vector3)(ref val3)).normalized;
			float num = Vector3.Angle(val2, val);
			tr_self.rotation = Quaternion.AngleAxis(num, normalized) * rotation;
			tr_self.localEulerAngles = new Vector3(tr_self.localEulerAngles.x, tr_self.localEulerAngles.y, 0f);
		}

		private void OnDestroy()
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			SM.PlayCoreSound((FVRPooledAudioType)41, Off, ((Component)this).gameObject.transform.position);
		}
	}
}
namespace theWNbotMods
{
	public class DestroyerMover : MonoBehaviour
	{
		[Header("路径点")]
		public Transform entryPos;

		public Transform stayPoint;

		public Transform exitPos;

		public Transform strikePos;

		[Header("速度设置")]
		public float entrySpeed = 300f;

		public float exitSpeed = 400f;

		public float rotateSpeed = 90f;

		[Header("时间设置")]
		public float waitBeforeStrike = 1f;

		public float strikeDuration = 2f;

		public float waitAfterExit = 3f;

		[Header("Prefab 设置")]
		public GameObject strikePrefab;

		[Header("音效控制")]
		public GameObject arriveStayPrefab;

		public float arriveSoundDuration = 2f;

		public GameObject leaveStayPrefab;

		public float leaveSoundLeadTime = 0.5f;

		[Header("驱逐舰模型设置")]
		public Transform destroyerRoot;

		public Vector3 modelForwardOffsetEuler;

		public bool yawOnly = true;

		private void Start()
		{
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)destroyerRoot == (Object)null)
			{
				Debug.LogError((object)"[DestroyerMover] 请在 Inspector 指定 destroyerRoot(驱逐舰模型子物体)");
				((Behaviour)this).enabled = false;
				return;
			}
			if ((Object)(object)entryPos != (Object)null)
			{
				destroyerRoot.position = entryPos.position;
			}
			((MonoBehaviour)this).StartCoroutine(DestroyerRoutine());
		}

		private IEnumerator DestroyerRoutine()
		{
			if ((Object)(object)arriveStayPrefab != (Object)null)
			{
				arriveStayPrefab.SetActive(true);
				AudioSource audio2 = arriveStayPrefab.GetComponent<AudioSource>();
				if ((Object)(object)audio2 != (Object)null)
				{
					audio2.Play();
				}
				yield return (object)new WaitForSeconds(arriveSoundDuration);
			}
			yield return MoveToPoint(stayPoint.position, entrySpeed);
			yield return (object)new WaitForSeconds(waitBeforeStrike);
			if ((Object)(object)strikePrefab != (Object)null && (Object)(object)strikePos != (Object)null)
			{
				Object.Instantiate<GameObject>(strikePrefab, strikePos.position, strikePos.rotation);
			}
			if ((Object)(object)leaveStayPrefab != (Object)null)
			{
				yield return (object)new WaitForSeconds(Mathf.Max(0f, strikeDuration - leaveSoundLeadTime));
				leaveStayPrefab.SetActive(true);
				AudioSource audio = leaveStayPrefab.GetComponent<AudioSource>();
				if ((Object)(object)audio != (Object)null)
				{
					audio.Play();
				}
				yield return (object)new WaitForSeconds(leaveSoundLeadTime);
			}
			else
			{
				yield return (object)new WaitForSeconds(strikeDuration);
			}
			yield return MoveToPoint(exitPos.position, exitSpeed);
			yield return (object)new WaitForSeconds(waitAfterExit);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		private IEnumerator MoveToPoint(Vector3 targetPos, 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)
			Quaternion forwardOffset = Quaternion.Euler(modelForwardOffsetEuler);
			while (Vector3.Distance(destroyerRoot.position, targetPos) > 0.1f)
			{
				destroyerRoot.position = Vector3.MoveTowards(destroyerRoot.position, targetPos, speed * Time.deltaTime);
				Vector3 moveDir = targetPos - destroyerRoot.position;
				if (yawOnly)
				{
					moveDir.y = 0f;
				}
				if (((Vector3)(ref moveDir)).sqrMagnitude > 0.001f)
				{
					Quaternion val = Quaternion.LookRotation(((Vector3)(ref moveDir)).normalized, Vector3.up) * forwardOffset;
					destroyerRoot.rotation = Quaternion.RotateTowards(destroyerRoot.rotation, val, rotateSpeed * Time.deltaTime);
				}
				yield return null;
			}
		}
	}
}
namespace JerryComponent
{
	public class EagleBrrrrrt : MonoBehaviour
	{
		public FVRFireArm gun;

		public FVRFireArmChamber chamber;

		public Transform muzzle;

		public bool isInTarget = false;

		public Transform originalPoint;

		public LayerMask lm;

		public float radius = 10f;

		public FireArmRoundClass rclass;

		public float cd = 0.005f;

		public KillAfter ka;

		public int shotsremain = 25;

		private void OnShotFired(FVRFireArm firearm)
		{
			if ((Object)(object)firearm == (Object)(object)gun)
			{
				shotsremain--;
			}
		}

		private void Awake()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent += new ShotFired(OnShotFired);
		}

		private void Update()
		{
			//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_0029: 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_004b: 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_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit val = default(RaycastHit);
			if (Physics.Raycast(((Component)muzzle).transform.position, ((Component)muzzle).transform.forward, ref val, 2500f, LayerMask.op_Implicit(lm)) && Vector3.Distance(((RaycastHit)(ref val)).point, originalPoint.position) <= radius)
			{
				((Behaviour)ka).enabled = true;
				isInTarget = true;
			}
			if (isInTarget && shotsremain > 0)
			{
				cd -= Time.deltaTime;
				if (cd <= 0f)
				{
					chamber.SetRound(rclass, ((Component)chamber).transform.position, ((Component)chamber).transform.rotation);
					gun.Fire(chamber, muzzle, false, 1f, -1f);
					cd = 0.005f;
				}
			}
		}

		private void OnDestroy()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Expected O, but got Unknown
			GM.CurrentSceneSettings.ShotFiredEvent -= new ShotFired(OnShotFired);
		}
	}
}
namespace theWNbotMods
{
	public class OneWayMover : MonoBehaviour
	{
		[Header("移动点")]
		public Transform pos1;

		public Transform pos2;

		public Transform targetObject;

		[Header("移动设置")]
		public float moveDuration = 2f;

		[Header("音效设置")]
		public AudioSource audioAtStart;

		public AudioSource audioAtEnd;

		private void Start()
		{
			if ((Object)(object)targetObject == (Object)null)
			{
				targetObject = ((Component)this).transform;
			}
			((MonoBehaviour)this).StartCoroutine(MoveRoutine());
		}

		private IEnumerator MoveRoutine()
		{
			if ((Object)(object)audioAtStart != (Object)null)
			{
				((Component)audioAtStart).gameObject.SetActive(true);
				audioAtStart.Play();
			}
			yield return MoveBetween(pos1.position, pos2.position, moveDuration);
			if ((Object)(object)audioAtEnd != (Object)null)
			{
				((Component)audioAtEnd).gameObject.SetActive(true);
				audioAtEnd.Play();
			}
		}

		private IEnumerator MoveBetween(Vector3 start, Vector3 end, float duration)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			float elapsed = 0f;
			while (elapsed < duration)
			{
				elapsed += Time.deltaTime;
				float t = Mathf.Clamp01(elapsed / duration);
				targetObject.position = Vector3.Lerp(start, end, t);
				yield return null;
			}
			targetObject.position = end;
		}
	}
	public class OrbitalStrikeController : MonoBehaviour
	{
		[Header("炮击参数")]
		public GameObject shellPrefab;

		public GameObject explosionPrefab;

		public float fireInterval = 0.2f;

		public float duration = 10f;

		public float shellSpeed = 100f;

		[Header("锥形散布参数")]
		[Range(0f, 45f)]
		public float coneAngle = 5f;

		public Transform firePos;

		public Transform landPos;

		[Header("三连发模式参数")]
		public bool burstMode = false;

		public int burstCount = 3;

		public float burstInterval = 0.1f;

		[Header("状态变量")]
		public bool ispublicFiring = false;

		private bool isFiring = false;

		public bool shouldFire = true;

		private void Start()
		{
			if ((Object)(object)shellPrefab == (Object)null || (Object)(object)firePos == (Object)null || (Object)(object)landPos == (Object)null)
			{
				Debug.LogError((object)"[OrbitalStrikeController] 请在 Inspector 设置 shellPrefab、firePos 和 landPos。");
				((Behaviour)this).enabled = false;
			}
		}

		private void FixedUpdate()
		{
			ispublicFiring = isFiring;
			if (shouldFire)
			{
				((MonoBehaviour)this).StartCoroutine(FireShells());
				shouldFire = false;
			}
		}

		private IEnumerator FireShells()
		{
			isFiring = true;
			for (float elapsed = 0f; elapsed < duration; elapsed += fireInterval)
			{
				if (burstMode)
				{
					for (int i = 0; i < burstCount; i++)
					{
						SpawnShell();
						yield return (object)new WaitForSeconds(burstInterval);
					}
				}
				else
				{
					SpawnShell();
				}
				yield return (object)new WaitForSeconds(fireInterval);
			}
			isFiring = false;
		}

		private void SpawnShell()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//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_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = landPos.position - firePos.position;
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			Quaternion val2 = Quaternion.AngleAxis(Random.Range(0f, coneAngle), Random.onUnitSphere);
			Vector3 val3 = val2 * normalized;
			GameObject val4 = Object.Instantiate<GameObject>(shellPrefab, firePos.position, Quaternion.LookRotation(val3));
			Rigidbody component = val4.GetComponent<Rigidbody>();
			if ((Object)(object)component != (Object)null)
			{
				component.velocity = val3 * shellSpeed;
			}
			if ((Object)(object)explosionPrefab != (Object)null)
			{
				Object.Instantiate<GameObject>(explosionPrefab, val4.transform.position, Quaternion.identity);
			}
		}
	}
	public class PlayRandomAudioWhenSpawn : MonoBehaviour
	{
		[Header("音频源 (挂在物体上的 AudioSource)")]
		public AudioSource audioSource;

		[Header("可选音频剪辑列表")]
		public AudioClip[] audioClips;

		private void Start()
		{
			if ((Object)(object)audioSource != (Object)null && audioClips != null && audioClips.Length > 0)
			{
				int num = Random.Range(0, audioClips.Length);
				AudioClip val = audioClips[num];
				audioSource.PlayOneShot(val);
			}
			else
			{
				Debug.LogWarning((object)"[RandomAudioOnSpawn] 缺少 AudioSource 或音频剪辑,无法播放。");
			}
		}
	}
	public class ShredderMissileController : MonoBehaviour
	{
		[Header("路径点设置")]
		public Transform launchPos;

		public Transform targetPos;

		[Header("导弹设置")]
		public GameObject missilePrefab;

		public float flightTime = 3f;

		public float rotateSpeed = 180f;

		public float warningDuration = 2f;

		[Header("音效设置")]
		public AudioSource warningAudio;

		private GameObject missileInstance;

		private void Start()
		{
			((MonoBehaviour)this).StartCoroutine(MissileRoutine());
		}

		private IEnumerator MissileRoutine()
		{
			if ((Object)(object)warningAudio != (Object)null)
			{
				((Component)warningAudio).gameObject.SetActive(true);
				warningAudio.Play();
			}
			yield return (object)new WaitForSeconds(warningDuration);
			if ((Object)(object)missilePrefab != (Object)null && (Object)(object)launchPos != (Object)null)
			{
				missileInstance = Object.Instantiate<GameObject>(missilePrefab, launchPos.position, Quaternion.identity);
				((MonoBehaviour)this).StartCoroutine(FlyMissile());
			}
		}

		private IEnumerator FlyMissile()
		{
			Vector3 start = launchPos.position;
			Vector3 end = targetPos.position;
			float elapsed = 0f;
			while (elapsed < flightTime)
			{
				elapsed += Time.deltaTime;
				float t = elapsed / flightTime;
				Vector3 pos = Vector3.Lerp(start, end, t);
				pos.y += Mathf.Sin(t * (float)Math.PI) * 20f;
				missileInstance.transform.position = pos;
				Vector3 val = end - missileInstance.transform.position;
				Vector3 dir = ((Vector3)(ref val)).normalized;
				Quaternion targetRot = Quaternion.LookRotation(dir, Vector3.up);
				missileInstance.transform.rotation = Quaternion.RotateTowards(missileInstance.transform.rotation, targetRot, rotateSpeed * Time.deltaTime);
				yield return null;
			}
			Object.Destroy((Object)(object)missileInstance);
		}
	}
	public class SuperKillAfter : MonoBehaviour
	{
		[Header("销毁延迟时间 (秒)")]
		public float killDelay = 5f;

		private void Start()
		{
			Object.Destroy((Object)(object)((Component)this).gameObject, killDelay);
		}
	}
}
public class LightFlicker : MonoBehaviour
{
	public bool flicker = true;

	public float flickerIntensity = 0.5f;

	private float baseIntensity;

	private Light lightComp;

	private void Awake()
	{
		lightComp = ((Component)this).gameObject.GetComponent<Light>();
		baseIntensity = lightComp.intensity;
	}

	private void Update()
	{
		if (flicker)
		{
			float num = Mathf.PerlinNoise(Random.Range(0f, 1000f), Time.time);
			lightComp.intensity = Mathf.Lerp(baseIntensity - flickerIntensity, baseIntensity, num);
		}
	}
}
namespace thewnbot.Cursed_Stratagems
{
	[BepInPlugin("thewnbot.Cursed_Stratagems", "Cursed_Stratagems", "1.0.0")]
	[BepInProcess("h3vr.exe")]
	[Description("Built with MeatKit")]
	[BepInDependency("h3vr.otherloader", "1.3.0")]
	public class Cursed_StratagemsPlugin : BaseUnityPlugin
	{
		private static readonly string BasePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);

		internal static ManualLogSource Logger;

		private void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			LoadAssets();
		}

		private void LoadAssets()
		{
			Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "thewnbot.Cursed_Stratagems");
			OtherLoader.RegisterDirectLoad(BasePath, "thewnbot.Cursed_Stratagems", "", "", "hd2_thewnbotstratagems_brascheagle500kg,hd2_thewnbotstratagems_eaglebunkerbuster,hd2_thewnbotstratagems_eaglecarpet,hd2_thewnbotstratagems_eagleotto,hd2_thewnbotstratagems_gatlingincendiary,hd2_thewnbotstratagems_orbitaleagle", "");
		}
	}
}