Decompiled source of ChestTornadoMod v1.0.1

┐¬▒ª╧Σ╦µ╗·╔·│╔┴·╛φ╖τ.dll

Decompiled 2 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using Photon.Pun;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("楠橘MOD")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("BEIBAO")]
[assembly: AssemblyCopyright("Copyright ©  2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9aee3863-d82a-4798-b114-f7e0aa25197d")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace ChestTornadoMod;

[BepInPlugin("com.chesttornadomod.example", "开启宝箱生成龙卷风", "1.0.0")]
public class ChestTornadoMod : BaseUnityPlugin
{
	[CompilerGenerated]
	private sealed class <SpawnTornadoAfterDelay>d__12 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public Character character;

		public float delay;

		public ChestTornadoMod <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <SpawnTornadoAfterDelay>d__12(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(delay);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.SpawnTornado(character);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <SpawnTornadoAtChestAfterDelay>d__13 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public Character character;

		public Vector3 chestPosition;

		public float delay;

		public ChestTornadoMod <>4__this;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <SpawnTornadoAtChestAfterDelay>d__13(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Expected O, but got Unknown
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				<>2__current = (object)new WaitForSeconds(delay);
				<>1__state = 1;
				return true;
			case 1:
				<>1__state = -1;
				<>4__this.SpawnTornadoAtChest(character, chestPosition);
				return false;
			}
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	[CompilerGenerated]
	private sealed class <UpdatePathPointsCoroutine>d__19 : IEnumerator<object>, IDisposable, IEnumerator
	{
		private int <>1__state;

		private object <>2__current;

		public GameObject pathContainer;

		public Transform playerTransform;

		public GameObject tornadoObject;

		public ChestTornadoMod <>4__this;

		private Transform <tornadoPoints>5__1;

		private int <pointCount>5__2;

		private float <radius>5__3;

		private int <i>5__4;

		private Transform <pathPoint>5__5;

		private float <angle>5__6;

		private Vector3 <pointPos>5__7;

		private RaycastHit <groundHit>5__8;

		object IEnumerator<object>.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		object IEnumerator.Current
		{
			[DebuggerHidden]
			get
			{
				return <>2__current;
			}
		}

		[DebuggerHidden]
		public <UpdatePathPointsCoroutine>d__19(int <>1__state)
		{
			this.<>1__state = <>1__state;
		}

		[DebuggerHidden]
		void IDisposable.Dispose()
		{
			<tornadoPoints>5__1 = null;
			<pathPoint>5__5 = null;
			<>1__state = -2;
		}

		private bool MoveNext()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Expected O, but got Unknown
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_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)
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0172: 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_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
			switch (<>1__state)
			{
			default:
				return false;
			case 0:
				<>1__state = -1;
				break;
			case 1:
				<>1__state = -1;
				break;
			}
			if ((Object)(object)tornadoObject != (Object)null && (Object)(object)pathContainer != (Object)null && (Object)(object)playerTransform != (Object)null)
			{
				try
				{
					pathContainer.transform.position = tornadoObject.transform.position;
					<tornadoPoints>5__1 = pathContainer.transform.Find("TornadoPoints");
					if ((Object)(object)<tornadoPoints>5__1 != (Object)null)
					{
						<pointCount>5__2 = <tornadoPoints>5__1.childCount;
						<radius>5__3 = 50f;
						<i>5__4 = 0;
						while (<i>5__4 < <pointCount>5__2)
						{
							<pathPoint>5__5 = <tornadoPoints>5__1.GetChild(<i>5__4);
							if ((Object)(object)<pathPoint>5__5 != (Object)null)
							{
								<angle>5__6 = (float)<i>5__4 * (360f / (float)<pointCount>5__2) + Time.time * 10f;
								<pointPos>5__7 = playerTransform.position + Quaternion.Euler(0f, <angle>5__6, 0f) * Vector3.forward * <radius>5__3;
								if (Physics.Raycast(<pointPos>5__7 + Vector3.up * 200f, Vector3.down, ref <groundHit>5__8, 250f))
								{
									<pointPos>5__7 = ((RaycastHit)(ref <groundHit>5__8)).point + Vector3.up * 0.5f;
								}
								else
								{
									<pointPos>5__7.y = playerTransform.position.y + 1f;
								}
								<pathPoint>5__5.position = <pointPos>5__7;
							}
							<pathPoint>5__5 = null;
							<i>5__4++;
						}
					}
					<tornadoPoints>5__1 = null;
				}
				catch (Exception)
				{
					return false;
				}
				<>2__current = (object)new WaitForSeconds(2f);
				<>1__state = 1;
				return true;
			}
			if ((Object)(object)pathContainer != (Object)null)
			{
				PhotonNetwork.Destroy(pathContainer);
			}
			return false;
		}

		bool IEnumerator.MoveNext()
		{
			//ILSpy generated this explicit interface implementation from .override directive in MoveNext
			return this.MoveNext();
		}

		[DebuggerHidden]
		void IEnumerator.Reset()
		{
			throw new NotSupportedException();
		}
	}

	private float spawnChance = 0.2f;

	private float spawnDistance = 100f;

	private bool isTestMode = false;

	private float normalSpawnChance = 0.2f;

	private float testSpawnChance = 1f;

	private HashSet<int> openedChests = new HashSet<int>();

	private PhotonView modPhotonView;

	private void Start()
	{
		GlobalEvents.OnRespawnChestOpened = (Action<RespawnChest, Character>)Delegate.Combine(GlobalEvents.OnRespawnChestOpened, new Action<RespawnChest, Character>(OnRespawnChestOpened));
		GlobalEvents.OnLuggageOpened = (Action<Luggage, Character>)Delegate.Combine(GlobalEvents.OnLuggageOpened, new Action<Luggage, Character>(OnLuggageOpened));
		modPhotonView = ((Component)this).gameObject.GetComponent<PhotonView>();
		if ((Object)(object)modPhotonView == (Object)null)
		{
			modPhotonView = ((Component)this).gameObject.AddComponent<PhotonView>();
			modPhotonView.ViewID = PhotonNetwork.AllocateViewID(false);
		}
	}

	private void OnDestroy()
	{
		GlobalEvents.OnRespawnChestOpened = (Action<RespawnChest, Character>)Delegate.Remove(GlobalEvents.OnRespawnChestOpened, new Action<RespawnChest, Character>(OnRespawnChestOpened));
		GlobalEvents.OnLuggageOpened = (Action<Luggage, Character>)Delegate.Remove(GlobalEvents.OnLuggageOpened, new Action<Luggage, Character>(OnLuggageOpened));
	}

	private void Update()
	{
		if (Input.GetKeyDown((KeyCode)55))
		{
			isTestMode = !isTestMode;
			spawnChance = (isTestMode ? 1f : 0.2f);
			Debug.Log((object)string.Format("ChestTornadoMod: 检测到7键,测试模式已{0} - 生成几率: {1}%", isTestMode ? "开启" : "关闭", spawnChance * 100f));
		}
	}

	private void OnRespawnChestOpened(RespawnChest chest, Character character)
	{
		//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_00dc: 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_00f8: 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)character == (Object)null || (Object)(object)chest == (Object)null || (Object)(object)character != (Object)(object)Character.localCharacter)
		{
			return;
		}
		int viewID = ((MonoBehaviourPun)chest).photonView.ViewID;
		if (openedChests.Contains(viewID))
		{
			return;
		}
		openedChests.Add(viewID);
		Vector3 position = ((Component)chest).transform.position;
		if (Random.value <= spawnChance)
		{
			if (PhotonNetwork.IsMasterClient)
			{
				((MonoBehaviour)this).StartCoroutine(SpawnTornadoAtChestAfterDelay(character, position, 1f));
				return;
			}
			modPhotonView.RPC("RPC_RequestSpawnTornadoAtChest", (RpcTarget)2, new object[5]
			{
				((MonoBehaviourPun)character).photonView.ViewID,
				viewID,
				position.x,
				position.y,
				position.z
			});
		}
	}

	private void OnLuggageOpened(Luggage luggage, Character character)
	{
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_006f: Unknown result type (might be due to invalid IL or missing references)
		//IL_00de: 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_00fa: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)character == (Object)null || (Object)(object)luggage == (Object)null || (Object)(object)character != (Object)(object)Character.localCharacter)
		{
			return;
		}
		int viewID = ((MonoBehaviourPun)luggage).photonView.ViewID;
		if (openedChests.Contains(viewID))
		{
			return;
		}
		openedChests.Add(viewID);
		Vector3 position = ((Component)luggage).transform.position;
		if (Random.value <= spawnChance)
		{
			if (PhotonNetwork.IsMasterClient)
			{
				((MonoBehaviour)this).StartCoroutine(SpawnTornadoAtChestAfterDelay(character, position, 1f));
				return;
			}
			modPhotonView.RPC("RPC_RequestSpawnTornadoAtChest", (RpcTarget)2, new object[5]
			{
				((MonoBehaviourPun)character).photonView.ViewID,
				viewID,
				position.x,
				position.y,
				position.z
			});
		}
	}

	[IteratorStateMachine(typeof(<SpawnTornadoAfterDelay>d__12))]
	private IEnumerator SpawnTornadoAfterDelay(Character character, float delay)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <SpawnTornadoAfterDelay>d__12(0)
		{
			<>4__this = this,
			character = character,
			delay = delay
		};
	}

	[IteratorStateMachine(typeof(<SpawnTornadoAtChestAfterDelay>d__13))]
	private IEnumerator SpawnTornadoAtChestAfterDelay(Character character, Vector3 chestPosition, float delay)
	{
		//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)
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <SpawnTornadoAtChestAfterDelay>d__13(0)
		{
			<>4__this = this,
			character = character,
			chestPosition = chestPosition,
			delay = delay
		};
	}

	[PunRPC]
	private void RPC_RequestSpawnTornado(int characterViewId, int chestId)
	{
		if (!PhotonNetwork.IsMasterClient || openedChests.Contains(chestId))
		{
			return;
		}
		openedChests.Add(chestId);
		PhotonView val = PhotonView.Find(characterViewId);
		if ((Object)(object)val != (Object)null)
		{
			Character component = ((Component)val).GetComponent<Character>();
			if ((Object)(object)component != (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(SpawnTornadoAfterDelay(component, 1f));
			}
		}
	}

	[PunRPC]
	private void RPC_RequestSpawnTornadoAtChest(int characterViewId, int chestId, float chestX, float chestY, float chestZ)
	{
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		if (!PhotonNetwork.IsMasterClient || openedChests.Contains(chestId))
		{
			return;
		}
		openedChests.Add(chestId);
		PhotonView val = PhotonView.Find(characterViewId);
		if ((Object)(object)val != (Object)null)
		{
			Character component = ((Component)val).GetComponent<Character>();
			if ((Object)(object)component != (Object)null)
			{
				Vector3 chestPosition = default(Vector3);
				((Vector3)(ref chestPosition))..ctor(chestX, chestY, chestZ);
				((MonoBehaviour)this).StartCoroutine(SpawnTornadoAtChestAfterDelay(component, chestPosition, 1f));
			}
		}
	}

	private void SpawnTornado(Character character)
	{
		//IL_001b: 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_002b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_003e: Unknown result type (might be due to invalid IL or missing references)
		//IL_003f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_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_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_0095: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0079: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: 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_008d: 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_00b1: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)character == (Object)null)
		{
			return;
		}
		try
		{
			Transform transform = ((Component)character).transform;
			Vector3 val = Random.insideUnitSphere * spawnDistance;
			val.y = 0f;
			Vector3 val2 = transform.position + val;
			RaycastHit val3 = default(RaycastHit);
			if (Physics.Raycast(val2 + Vector3.up * 200f, Vector3.down, ref val3, 250f))
			{
				val2 = ((RaycastHit)(ref val3)).point + Vector3.up * 0.5f;
			}
			else
			{
				val2.y = transform.position.y + 1f;
			}
			GameObject val4 = PhotonNetwork.Instantiate("Tornado", val2, Quaternion.identity, (byte)0, (object[])null);
			if ((Object)(object)val4 != (Object)null)
			{
				PhotonView component = val4.GetComponent<PhotonView>();
				if ((Object)(object)component != (Object)null)
				{
					CreateDynamicPathPoints(val4, transform);
				}
			}
		}
		catch (Exception)
		{
		}
	}

	private void SpawnTornadoAtChest(Character character, Vector3 chestPosition)
	{
		//IL_0014: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0030: Unknown result type (might be due to invalid IL or missing references)
		//IL_0031: Unknown result type (might be due to invalid IL or missing references)
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_0037: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		//IL_0039: Unknown result type (might be due to invalid IL or missing references)
		//IL_0043: 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_004d: 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_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_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_0080: Unknown result type (might be due to invalid IL or missing references)
		//IL_009e: Unknown result type (might be due to invalid IL or missing references)
		//IL_009f: Unknown result type (might be due to invalid IL or missing references)
		if ((Object)(object)character == (Object)null)
		{
			return;
		}
		try
		{
			Vector3 val = Random.insideUnitSphere * 30f;
			val.y = 0f;
			Vector3 val2 = chestPosition + val;
			RaycastHit val3 = default(RaycastHit);
			if (Physics.Raycast(val2 + Vector3.up * 200f, Vector3.down, ref val3, 250f))
			{
				val2 = ((RaycastHit)(ref val3)).point + Vector3.up * 0.5f;
			}
			else
			{
				val2.y = chestPosition.y + 1f;
			}
			GameObject val4 = PhotonNetwork.Instantiate("Tornado", val2, Quaternion.identity, (byte)0, (object[])null);
			if ((Object)(object)val4 != (Object)null)
			{
				PhotonView component = val4.GetComponent<PhotonView>();
				if ((Object)(object)component != (Object)null)
				{
					CreateDynamicPathPoints(val4, ((Component)character).transform);
				}
			}
		}
		catch (Exception)
		{
		}
	}

	private void CreateDynamicPathPoints(GameObject tornadoObject, Transform playerTransform)
	{
		//IL_001b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0021: Expected O, but got Unknown
		//IL_002d: 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_0057: Expected O, but got Unknown
		//IL_006f: 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_00a4: Expected O, but got Unknown
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e1: 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_00f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
		//IL_00f6: Unknown result type (might be due to invalid IL or missing references)
		//IL_0100: Unknown result type (might be due to invalid IL or missing references)
		//IL_0105: Unknown result type (might be due to invalid IL or missing references)
		//IL_010a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0146: Unknown result type (might be due to invalid IL or missing references)
		//IL_0124: Unknown result type (might be due to invalid IL or missing references)
		//IL_0129: Unknown result type (might be due to invalid IL or missing references)
		//IL_0133: Unknown result type (might be due to invalid IL or missing references)
		//IL_0138: Unknown result type (might be due to invalid IL or missing references)
		//IL_013d: 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)
		try
		{
			GameObject val = new GameObject("DynamicTornadoPath_" + ((Object)tornadoObject).GetInstanceID());
			val.transform.position = tornadoObject.transform.position;
			PhotonView val2 = val.AddComponent<PhotonView>();
			val2.ViewID = PhotonNetwork.AllocateViewID(false);
			GameObject val3 = new GameObject("TornadoPoints");
			val3.transform.SetParent(val.transform);
			val3.transform.localPosition = Vector3.zero;
			int num = 8;
			float num2 = 50f;
			RaycastHit val6 = default(RaycastHit);
			for (int i = 0; i < num; i++)
			{
				GameObject val4 = new GameObject("PathPoint_" + i);
				val4.transform.SetParent(val3.transform);
				float num3 = (float)i * (360f / (float)num);
				Vector3 val5 = playerTransform.position + Quaternion.Euler(0f, num3, 0f) * Vector3.forward * num2;
				if (Physics.Raycast(val5 + Vector3.up * 200f, Vector3.down, ref val6, 250f))
				{
					val5 = ((RaycastHit)(ref val6)).point + Vector3.up * 0.5f;
				}
				else
				{
					val5.y = playerTransform.position.y + 1f;
				}
				val4.transform.position = val5;
			}
			PhotonView component = tornadoObject.GetComponent<PhotonView>();
			if ((Object)(object)component != (Object)null)
			{
				component.RPC("RPCA_InitTornado", (RpcTarget)0, new object[1] { val2.ViewID });
			}
			if (PhotonNetwork.IsMasterClient)
			{
				((MonoBehaviour)this).StartCoroutine(UpdatePathPointsCoroutine(val, playerTransform, tornadoObject));
			}
		}
		catch (Exception)
		{
		}
	}

	[IteratorStateMachine(typeof(<UpdatePathPointsCoroutine>d__19))]
	private IEnumerator UpdatePathPointsCoroutine(GameObject pathContainer, Transform playerTransform, GameObject tornadoObject)
	{
		//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
		return new <UpdatePathPointsCoroutine>d__19(0)
		{
			<>4__this = this,
			pathContainer = pathContainer,
			playerTransform = playerTransform,
			tornadoObject = tornadoObject
		};
	}
}