Decompiled source of Lethal Chaos v1.5.1

LethalChaos.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
using ArtifactGroup;
using BepInEx;
using BepInEx.Configuration;
using GameNetcodeStuff;
using LethalChaos;
using LethalChaos.EntropySystem.Hook_Sources;
using LethalChaos.EntropySystem.Networking;
using LethalChaos.EntropySystem.PrefabScripts;
using LethalChaos.EntropySystem.Util;
using LethalChaos.NetcodePatcher;
using LethalCompanyInputUtils.Api;
using LethalConfig;
using LethalConfig.ConfigItems;
using LethalConfig.ConfigItems.Options;
using LethalLib.Modules;
using Microsoft.CodeAnalysis;
using On;
using On.GameNetcodeStuff;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.InputSystem;
using UnityEngine.Rendering.HighDefinition;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("LethalChaos")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("A horrifying plugin that randomizes aspects of each planet, causing actions to be linked to a set of game events, with a probability to trigger")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+47b7122209fa7d564e60c8a60cee2d4f0d75de20")]
[assembly: AssemblyProduct("LethalChaos")]
[assembly: AssemblyTitle("LethalChaos")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
[module: NetcodePatchedAssembly]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class ClockHook
{
	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static hook_MoveGlobalTime <>9__0_0;

		internal void <.ctor>b__0_0(orig_MoveGlobalTime orig, TimeOfDay self)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Expected O, but got Unknown
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self);
			RoundManager instance = RoundManager.Instance;
			GameObject val = new GameObject();
			val.transform.position = instance.insideAINodes[EntropyEngine.rnd.Next(0, instance.insideAINodes.Length)].transform.position;
			EntropyEngine.getMoonHost().queueHook("ClockIn", val, isSelective: true, targetIsPlayer: true);
			Object.Destroy((Object)(object)val);
			GameObject val2 = new GameObject();
			val2.transform.position = instance.outsideAINodes[EntropyEngine.rnd.Next(0, instance.outsideAINodes.Length)].transform.position;
			EntropyEngine.getMoonHost().queueHook("ClockOut", val2, isSelective: true, targetIsPlayer: true);
			Object.Destroy((Object)(object)val2);
		}
	}

	public ClockHook()
	{
		//IL_0027: 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_0032: Expected O, but got Unknown
		Debug.Log((object)"Lethal Chaos: Hooking  World Modifiers... ");
		object obj = <>c.<>9__0_0;
		if (obj == null)
		{
			hook_MoveGlobalTime val = delegate(orig_MoveGlobalTime orig, TimeOfDay self)
			{
				//IL_000f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Expected O, but got Unknown
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_005f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0065: Expected O, but got Unknown
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				orig.Invoke(self);
				RoundManager instance = RoundManager.Instance;
				GameObject val2 = new GameObject();
				val2.transform.position = instance.insideAINodes[EntropyEngine.rnd.Next(0, instance.insideAINodes.Length)].transform.position;
				EntropyEngine.getMoonHost().queueHook("ClockIn", val2, isSelective: true, targetIsPlayer: true);
				Object.Destroy((Object)(object)val2);
				GameObject val3 = new GameObject();
				val3.transform.position = instance.outsideAINodes[EntropyEngine.rnd.Next(0, instance.outsideAINodes.Length)].transform.position;
				EntropyEngine.getMoonHost().queueHook("ClockOut", val3, isSelective: true, targetIsPlayer: true);
				Object.Destroy((Object)(object)val3);
			};
			<>c.<>9__0_0 = val;
			obj = (object)val;
		}
		TimeOfDay.MoveGlobalTime += (hook_MoveGlobalTime)obj;
	}
}
public class Ball : MonoBehaviour
{
	private Transform myTransform;

	public Transform parent;

	public GameObject Player1;

	public PlayerControllerB playerTarget;

	public GameObject NPC;

	public GameObject game;

	public CanvasScaler scaler;

	public float ballSpeed;

	public float vertSpeed = 0f;

	private Vector3 direction = Vector3.left;

	private Vector3 directionUp = Vector3.up;

	public static int Player1Score;

	public static int Player2Score;

	private void Start()
	{
		//IL_001e: 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)
		myTransform = ((Component)this).transform;
		myTransform.position = ((Component)parent).transform.position + new Vector3(0f, 0.5f, 0f);
	}

	private void Update()
	{
		//IL_003a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0040: Unknown result type (might be due to invalid IL or missing references)
		//IL_004a: 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_0062: 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_007d: 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_00b9: 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)
		float num = ballSpeed * (scaler.scaleFactor / 20f);
		float num2 = vertSpeed * (scaler.scaleFactor / 20f);
		myTransform.Translate(direction * num * Time.deltaTime);
		myTransform.Translate(directionUp * num2 * Time.deltaTime);
		if ((double)myTransform.localPosition.x < -10.5)
		{
			Player2Score++;
			myTransform.localPosition = new Vector3(0f, 0.5f, 0f);
			ballSpeed = 100f;
			entropyBlaster.pongExecute(playerTarget);
			Object.Destroy((Object)(object)game);
			entropyBlaster.playingPong = false;
		}
		if ((double)myTransform.localPosition.x > 10.5)
		{
			Player1Score++;
			myTransform.localPosition = new Vector3(0f, 0.5f, 0f);
			ballSpeed = 100f;
			Object.Destroy((Object)(object)game);
			entropyBlaster.playingPong = false;
		}
	}

	private void OnTriggerEnter2D(Collider2D collider)
	{
		//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_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)
		if (((Object)collider).name.Equals("Player1Middle") || ((Object)collider).name.Equals("Player"))
		{
			direction = Vector3.right;
			vertSpeed = Random.Range((0f - ballSpeed) * 2f, ballSpeed * 2f);
			ballSpeed += 25f;
		}
		if (((Object)collider).name.Equals("NPC"))
		{
			direction = Vector3.left;
			vertSpeed = Random.Range((0f - ballSpeed) * 2f, ballSpeed * 2f);
			NPC.GetComponent<NPC>().skill -= 3;
			ballSpeed += 25f;
		}
		if (((Object)collider).name.Equals("TopBoundary"))
		{
			Debug.Log((object)"TopBoundaryCollide");
			vertSpeed = Math.Abs(vertSpeed) * -1f;
		}
		if (((Object)collider).name.Equals("BottomBoundary"))
		{
			Debug.Log((object)"BottomBoundaryCollide");
			vertSpeed = Math.Abs(vertSpeed);
		}
	}
}
public class InputMap : LcInputActions
{
	[InputAction(/*Could not decode attribute arguments.*/)]
	public InputAction pongUp { get; set; }

	[InputAction(/*Could not decode attribute arguments.*/)]
	public InputAction pongUpAlt { get; set; }

	[InputAction(/*Could not decode attribute arguments.*/)]
	public InputAction pongDown { get; set; }

	[InputAction(/*Could not decode attribute arguments.*/)]
	public InputAction pongDownAlt { get; set; }
}
public class myGUI : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}

	private void OnGUI()
	{
	}
}
public class NPC : MonoBehaviour
{
	private Transform myTransform;

	public Transform parent;

	public GameObject Ball;

	private float vert;

	public int skill = 34;

	public CanvasScaler scaler;

	public GameObject DeadNPC;

	private void Start()
	{
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0033: Unknown result type (might be due to invalid IL or missing references)
		//IL_0038: Unknown result type (might be due to invalid IL or missing references)
		myTransform = ((Component)this).transform;
		myTransform.position = new Vector3(8f, vert, 0f) + ((Component)parent).transform.position;
	}

	private void Update()
	{
		//IL_001f: 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_0054: Unknown result type (might be due to invalid IL or missing references)
		//IL_0083: Unknown result type (might be due to invalid IL or missing references)
		//IL_0096: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		float num = scaler.scaleFactor / 20f;
		vert = Ball.transform.position.y;
		myTransform.localPosition = new Vector3(8f, Mathf.Lerp(myTransform.localPosition.y, Ball.transform.localPosition.y, Time.deltaTime * num * ((float)skill / 10f) * 4f), 0f);
		Vector3 val = default(Vector3);
		((Vector3)(ref val))..ctor(myTransform.localPosition.x, myTransform.localPosition.y, myTransform.localPosition.z);
		if (skill < 1)
		{
			Object.Instantiate<GameObject>(DeadNPC, val, Quaternion.identity);
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}

	private void OnTriggerEnter(Collider collider)
	{
		if (((Component)collider).CompareTag("Ball"))
		{
			skill -= 4;
		}
	}
}
public class Player1Bottom : MonoBehaviour
{
	private Transform myTransform;

	public Transform parent;

	public int playerSpeed = 10;

	private void Start()
	{
		//IL_001e: 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)
		myTransform = ((Component)this).transform;
		myTransform.position = ((Component)parent).transform.position + new Vector3(-8f, -0.5f, 0f);
	}

	private void Update()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: 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_0047: 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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: 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)
		if (Input.GetKey((KeyCode)119))
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * Time.deltaTime);
		}
		if (Input.GetKey((KeyCode)115))
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * Time.deltaTime);
		}
		if (myTransform.localPosition.y > 5f)
		{
			myTransform.localPosition = new Vector3(-8f, 5f, 0f);
		}
		if (myTransform.localPosition.y < -5f)
		{
			myTransform.localPosition = new Vector3(-8f, -5f, 0f);
		}
	}
}
public class Player1Middle : MonoBehaviour
{
	private Transform myTransform;

	public Transform parent;

	public CanvasScaler scaler;

	public int playerSpeed;

	private void Start()
	{
		//IL_001e: 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)
		myTransform = ((Component)this).transform;
		myTransform.position = ((Component)parent).transform.position + new Vector3(-8f, 0.5f, 0f);
	}

	private void Update()
	{
		//IL_0041: Unknown result type (might be due to invalid IL or missing references)
		//IL_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0053: 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_00c5: Unknown result type (might be due to invalid IL or missing references)
		//IL_0097: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a3: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
		//IL_0118: Unknown result type (might be due to invalid IL or missing references)
		//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
		//IL_0106: Unknown result type (might be due to invalid IL or missing references)
		//IL_013c: Unknown result type (might be due to invalid IL or missing references)
		//IL_0151: Unknown result type (might be due to invalid IL or missing references)
		//IL_015b: Unknown result type (might be due to invalid IL or missing references)
		float num = scaler.scaleFactor / 20f;
		if (Plugin.controls.pongUp.IsPressed() || Plugin.controls.pongUpAlt.IsPressed())
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * num * Time.deltaTime);
		}
		if (Plugin.controls.pongDown.IsPressed() || Plugin.controls.pongDownAlt.IsPressed())
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * num * Time.deltaTime);
		}
		if (myTransform.localPosition.y > 7f)
		{
			myTransform.localPosition = new Vector3(myTransform.localPosition.x, 6f, myTransform.localPosition.z);
		}
		if (myTransform.localPosition.y < -8f)
		{
			myTransform.localPosition = new Vector3(myTransform.localPosition.x, -6f, myTransform.localPosition.z);
		}
	}
}
public class Player1Top : MonoBehaviour
{
	private Transform myTransform;

	public Transform parent;

	public int playerSpeed = 10;

	private void Start()
	{
		//IL_001e: 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)
		myTransform = ((Component)this).transform;
		myTransform.position = ((Component)parent).transform.position + new Vector3(-8f, 1.5f, 0f);
	}

	private void Update()
	{
		//IL_0013: Unknown result type (might be due to invalid IL or missing references)
		//IL_001f: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: 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_0047: 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_005d: Unknown result type (might be due to invalid IL or missing references)
		//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
		//IL_009a: 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)
		if (Input.GetKey((KeyCode)119))
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * Time.deltaTime);
		}
		if (Input.GetKey((KeyCode)115))
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * Time.deltaTime);
		}
		if (myTransform.localPosition.y > 7f)
		{
			myTransform.localPosition = new Vector3(-8f, 7f, 0f);
		}
		if (myTransform.localPosition.y < -3f)
		{
			myTransform.localPosition = new Vector3(-8f, -3f, 0f);
		}
	}
}
public class Player2Bottom : MonoBehaviour
{
	private Transform myTransform;

	public int playerSpeed = 10;

	private void Start()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		myTransform = ((Component)this).transform;
		myTransform.position = new Vector3(8f, -0.5f, 0f);
	}

	private void Update()
	{
		//IL_0016: 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_002c: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKey((KeyCode)273))
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * Time.deltaTime);
		}
		if (Input.GetKey((KeyCode)274))
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * Time.deltaTime);
		}
		if (myTransform.position.y > 5f)
		{
			myTransform.position = new Vector3(8f, 5f, 0f);
		}
		if (myTransform.position.y < -5f)
		{
			myTransform.position = new Vector3(8f, -5f, 0f);
		}
	}
}
public class Player2Middle : MonoBehaviour
{
	private Transform myTransform;

	public int playerSpeed = 10;

	private void Start()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		myTransform = ((Component)this).transform;
		myTransform.position = new Vector3(8f, 0.5f, 0f);
	}

	private void Update()
	{
		//IL_0016: 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_002c: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKey((KeyCode)273))
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * Time.deltaTime);
		}
		if (Input.GetKey((KeyCode)274))
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * Time.deltaTime);
		}
		if (myTransform.position.y > 7f)
		{
			myTransform.position = new Vector3(8f, 6f, 0f);
		}
		if (myTransform.position.y < -5f)
		{
			myTransform.position = new Vector3(8f, -4f, 0f);
		}
	}
}
public class Player2Top : MonoBehaviour
{
	private Transform myTransform;

	public int playerSpeed = 10;

	private void Start()
	{
		//IL_0022: Unknown result type (might be due to invalid IL or missing references)
		myTransform = ((Component)this).transform;
		myTransform.position = new Vector3(8f, 1.5f, 0f);
	}

	private void Update()
	{
		//IL_0016: 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_002c: 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_004d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0059: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)
		//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
		//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
		//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
		if (Input.GetKey((KeyCode)273))
		{
			myTransform.Translate(Vector3.up * (float)playerSpeed * Time.deltaTime);
		}
		if (Input.GetKey((KeyCode)274))
		{
			myTransform.Translate(Vector3.down * (float)playerSpeed * Time.deltaTime);
		}
		if (myTransform.position.y > 7f)
		{
			myTransform.position = new Vector3(8f, 7f, 0f);
		}
		if (myTransform.position.y < -3f)
		{
			myTransform.position = new Vector3(8f, -3f, 0f);
		}
	}
}
public class Score : MonoBehaviour
{
	private void Start()
	{
	}

	private void Update()
	{
	}

	private void OnGUI()
	{
	}
}
namespace ArtifactGroup
{
	public class entropyBlaster
	{
		public static Random r = new Random();

		public static Transform btransform = new GameObject().transform;

		public static GameObject spoderRef;

		public static bool playingPong = false;

		public static bool meteorsToday = false;

		public static bool oneOrMorePlayersInFactory()
		{
			try
			{
				GameObject[] players = getPlayers();
				GameObject[] array = players;
				foreach (GameObject val in array)
				{
					PlayerControllerB component = val.GetComponent<PlayerControllerB>();
					if ((Object)(object)component != (Object)null && component.isInsideFactory)
					{
						return true;
					}
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Lethal Chaos: oneOrMorePlayersInFactory method failure -> " + ex.ToString()));
			}
			return false;
		}

		public static bool playerInFactory(GameObject player)
		{
			PlayerControllerB component = player.GetComponent<PlayerControllerB>();
			return component.isInsideFactory;
		}

		public static float nearestPlayerToCoordDistance(Vector3 position)
		{
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject[] players = getPlayers();
				float num = float.PositiveInfinity;
				GameObject[] array = players;
				foreach (GameObject val in array)
				{
					Vector3 val2 = val.transform.position - position;
					float magnitude = ((Vector3)(ref val2)).magnitude;
					if (magnitude < num)
					{
						num = magnitude;
					}
				}
				return num;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Lethal Chaos: nearestPlayerToCoordDistance method failure -> " + ex.ToString()));
			}
			return 0f;
		}

		public static GameObject nearestPlayerToCoord(Vector3 position)
		{
			//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_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)
			GameObject result = null;
			try
			{
				GameObject[] players = getPlayers();
				float num = float.PositiveInfinity;
				GameObject[] array = players;
				foreach (GameObject val in array)
				{
					Vector3 val2 = val.transform.position - position;
					float magnitude = ((Vector3)(ref val2)).magnitude;
					if (magnitude < num)
					{
						num = magnitude;
						result = val;
					}
				}
				return result;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Lethal Chaos: nearestPlayerToCoord method failure -> " + ex.ToString()));
			}
			return result;
		}

		public static GameObject[] getPlayers()
		{
			return GameObject.FindGameObjectsWithTag("Player");
		}

		public static Vector3 safeNodePosition(GameObject target, float inner_threshold, float outer_threshold, int areaCode)
		{
			//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_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: 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_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: 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_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				GameObject val = nearestPlayerToCoord(target.transform.position);
				PlayerControllerB component = val.GetComponent<PlayerControllerB>();
				GameObject[] array = null;
				RoundManager instance = RoundManager.Instance;
				if (component.isInsideFactory && areaCode == 2)
				{
					return Vector3.zero;
				}
				if (!component.isInsideFactory && areaCode == 1)
				{
					return Vector3.zero;
				}
				array = ((!component.isInsideFactory) ? instance.outsideAINodes : instance.insideAINodes);
				List<GameObject> list = new List<GameObject>();
				GameObject[] array2 = array;
				foreach (GameObject val2 in array2)
				{
					float num = nearestPlayerToCoordDistance(val2.transform.position);
					if (num > inner_threshold && num < outer_threshold)
					{
						list.Add(val2);
					}
				}
				if (list.Count != 0)
				{
					return list[EntropyEngine.rnd.Next(0, list.Count)].transform.position;
				}
				return Vector3.zero;
			}
			catch (Exception ex)
			{
				Debug.LogError((object)ex);
				return Vector3.zero;
			}
		}

		public static Vector3 safeRandomizedPositionFlex(GameObject target, float inner_threshold, float outer_threshold, int areaCode, NavMeshHit navHit = default(NavMeshHit))
		{
			//IL_01b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Vector3 val2 = default(Vector3);
				for (int i = 0; i < 5; i++)
				{
					RoundManager instance = RoundManager.Instance;
					GameObject val = nearestPlayerToCoord(target.transform.position);
					PlayerControllerB component = val.GetComponent<PlayerControllerB>();
					if (component.isInsideFactory && areaCode == 2)
					{
						return Vector3.zero;
					}
					if (!component.isInsideFactory && areaCode == 1)
					{
						return Vector3.zero;
					}
					int num = 1;
					int num2 = 1;
					if (EntropyEngine.rnd.NextDouble() < 0.5)
					{
						num = -1;
					}
					if (EntropyEngine.rnd.NextDouble() < 0.5)
					{
						num2 = -1;
					}
					int num3 = 5;
					while (num3 > 0)
					{
						num3--;
						try
						{
							outer_threshold -= inner_threshold;
							float num4 = val.transform.position.x + (inner_threshold + outer_threshold * (float)EntropyEngine.rnd.NextDouble()) * (float)num;
							float num5 = val.transform.position.z + (inner_threshold + outer_threshold * (float)EntropyEngine.rnd.NextDouble()) * (float)num2;
							((Vector3)(ref val2))..ctor(num4, val.transform.position.y, num5);
							if (NavMesh.SamplePosition(val2, ref navHit, outer_threshold, -1) && avoidsAllPlayers(inner_threshold, ((NavMeshHit)(ref navHit)).position))
							{
								return ((NavMeshHit)(ref navHit)).position;
							}
						}
						catch (Exception)
						{
							num3--;
						}
					}
					Debug.Log((object)"Lethal Chaos: Position Flex failed, trying safeRandomizedPosition");
				}
				return safeNodePosition(target, inner_threshold, outer_threshold, areaCode);
			}
			catch (Exception ex2)
			{
				Debug.LogError((object)ex2);
				return Vector3.zero;
			}
		}

		public static bool avoidsAllPlayers(float inner_threshold, Vector3 pos)
		{
			//IL_004a: Unknown result type (might be due to invalid IL or missing references)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			PlayerControllerB[] allPlayerScripts = instance.playersManager.allPlayerScripts;
			foreach (PlayerControllerB val in allPlayerScripts)
			{
				if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).gameObject) && Vector3.Distance(((Component)val).gameObject.transform.position, pos) < inner_threshold)
				{
					return false;
				}
			}
			return true;
		}

		public static void bomb(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Bomb Trigger");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 8f * Accumulators.explosionSafetyMult + 5f, 30f, 0);
				Accumulators.explosionSafetyMult *= 0.9f;
			}
			else
			{
				zero = target.transform.position;
			}
			if (zero != Vector3.zero)
			{
				Plugin.rpcCalls.spawnExplosionClientRpc(zero);
			}
		}

		public static void SpawnRandomOutsideEnemyNear(GameObject target, bool targetIsPlayer)
		{
			//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_002c: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Random Outside EnemyTrigger");
			RoundManager instance = RoundManager.Instance;
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 3f, 25f, 2);
				if (zero != Vector3.zero && EntropyEngine.rnd.NextDouble() < (double)Accumulators.enemySpawnMult)
				{
					int index = EntropyEngine.rnd.Next(0, instance.currentLevel.OutsideEnemies.Count);
					GameObject val = Object.Instantiate<GameObject>(instance.currentLevel.OutsideEnemies[index].enemyType.enemyPrefab, zero, Quaternion.Euler(Vector3.zero));
					val.gameObject.GetComponentInChildren<NetworkObject>().Spawn(true);
					instance.SpawnedEnemies.Add(val.GetComponent<EnemyAI>());
					EnemyType enemyType = val.GetComponent<EnemyAI>().enemyType;
					enemyType.numberSpawned++;
					EntityDestructionManager.destroyOnLeave.Add(val);
					Accumulators.enemySpawnMult *= 0.95f;
				}
				else
				{
					EventThrottler.summons -= 1f;
					EventThrottler.triggerTotals[1]--;
				}
			}
			else
			{
				EventThrottler.summons -= 1f;
				EventThrottler.triggerTotals[1]--;
			}
		}

		public static void SpawnRandomInsideEnemyNear(GameObject target, bool targetIsPlayer)
		{
			//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_002c: 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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Random Inside EnemyTrigger");
			RoundManager instance = RoundManager.Instance;
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 3f, 15f, 1);
				if (zero != Vector3.zero && EntropyEngine.rnd.NextDouble() < (double)Accumulators.enemySpawnMult)
				{
					int index = EntropyEngine.rnd.Next(0, instance.currentLevel.OutsideEnemies.Count);
					GameObject val = Object.Instantiate<GameObject>(instance.currentLevel.Enemies[index].enemyType.enemyPrefab, zero, Quaternion.Euler(Vector3.zero));
					val.gameObject.GetComponentInChildren<NetworkObject>().Spawn(true);
					instance.SpawnedEnemies.Add(val.GetComponent<EnemyAI>());
					EnemyType enemyType = val.GetComponent<EnemyAI>().enemyType;
					enemyType.numberSpawned++;
					EntityDestructionManager.destroyOnLeave.Add(val);
					Accumulators.enemySpawnMult *= 0.9f;
				}
				else
				{
					EventThrottler.summons -= 1f;
					EventThrottler.triggerTotals[5]--;
				}
			}
			else
			{
				EventThrottler.summons -= 1f;
				EventThrottler.triggerTotals[5]--;
			}
		}

		public static void spawnRandomEnemy(GameObject target)
		{
		}

		public static void spawnRandomHazard(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: 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)
			Debug.Log((object)"Lethal Chaos: Spawn Random Hazard Trigger");
			Vector3 zero = Vector3.zero;
			Quaternion rotation = Random.rotation;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 12f, 20f, 0));
			if (!(zero == Vector3.zero))
			{
				RoundManager instance = RoundManager.Instance;
				int num = EntropyEngine.rnd.Next(0, instance.currentLevel.spawnableMapObjects.Length);
				GameObject val = Object.Instantiate<GameObject>(instance.currentLevel.spawnableMapObjects[num].prefabToSpawn, zero, Quaternion.identity, btransform);
				val.GetComponent<NetworkObject>().Spawn(true);
				EntityDestructionManager.destroyOnLeave.Add(val);
			}
		}

		public static void spawnTurret(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Spawn Turret Trigger");
			Quaternion rotation = Random.rotation;
			Vector3 zero = Vector3.zero;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 12f, 40f, 0));
			if (!(zero == Vector3.zero))
			{
				RoundManager instance = RoundManager.Instance;
				GameObject val = Object.Instantiate<GameObject>(instance.currentLevel.spawnableMapObjects[1].prefabToSpawn, zero, Quaternion.identity, btransform);
				val.GetComponent<NetworkObject>().Spawn(true);
				EntityDestructionManager.destroyOnLeave.Add(val);
			}
		}

		public static void spawnMine(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0071: 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)
			Debug.Log((object)"Lethal Chaos: Spawn Mine Trigger");
			Vector3 zero = Vector3.zero;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 10f, 20f, 0));
			if (!(zero == Vector3.zero))
			{
				RoundManager instance = RoundManager.Instance;
				GameObject val = Object.Instantiate<GameObject>(instance.currentLevel.spawnableMapObjects[0].prefabToSpawn, zero, Quaternion.identity, btransform);
				val.GetComponent<NetworkObject>().Spawn(true);
				EntityDestructionManager.destroyOnLeave.Add(val);
			}
		}

		public GameObject[] FindGameObjectsWithLayer(int layer)
		{
			GameObject[] array = Object.FindObjectsOfType<GameObject>();
			List<GameObject> list = new List<GameObject>();
			for (int i = 0; i < array.Length; i++)
			{
				if (array[i].layer == layer)
				{
					list.Add(array[i]);
				}
			}
			if (list.Count == 0)
			{
				return null;
			}
			return list.ToArray();
		}

		public static void spawnHive(GameObject target, bool targetIsPlayer)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			Quaternion rotation = Random.rotation;
			Debug.Log((object)"Lethal Chaos: Spawn Hive Trigger");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 12f, 60f, 2);
				if (!(zero == Vector3.zero))
				{
					RedLocustBees[] array = Resources.FindObjectsOfTypeAll<RedLocustBees>();
					RedLocustBees val = array[0];
					Debug.Log((object)("bee obj: " + ((Object)val).name + " - " + ((object)val).GetType()?.ToString() + " - " + ((object)val).ToString()));
					GameObject gameObject = ((Component)val).gameObject;
					GameObject val2 = Object.Instantiate<GameObject>(gameObject, zero, Quaternion.identity, new GameObject().transform);
					val2.GetComponentInChildren<NetworkObject>().Spawn(true);
					instance.SpawnedEnemies.Add(val2.GetComponent<EnemyAI>());
					val2.SetActive(true);
				}
			}
		}

		public static void spawnRandomPropInside(GameObject target, bool targetIsPlayer)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			Vector3 zero = Vector3.zero;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 7f, 15f, 0));
			if (zero == Vector3.zero)
			{
				return;
			}
			try
			{
				SpawnSyncedObject[] array = Object.FindObjectsOfType<SpawnSyncedObject>();
				if (array != null)
				{
					instance.mapPropsContainer = GameObject.FindGameObjectWithTag("MapPropsContainer");
					Debug.Log((object)$"Lethal Chaos: Spawning synced inside prop on server. Choices Length: {array.Length}");
					int num = EntropyEngine.rnd.Next(0, array.Length);
					GameObject val = Object.Instantiate<GameObject>(array[num].spawnPrefab, zero, target.transform.rotation, new GameObject().transform);
					if ((Object)(object)val != (Object)null)
					{
						val.GetComponent<NetworkObject>().Spawn(true);
						instance.spawnedSyncedObjects.Add(val);
						EntityDestructionManager.destroyOnLeave.Add(val);
					}
				}
			}
			catch (Exception arg)
			{
				Debug.Log((object)$"Exception! Unable to sync spawned objects on host; {arg}");
			}
		}

		public static void spawnRandomPropOutside(GameObject target, bool targetIsPlayer)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			Vector3 zero = Vector3.zero;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 7f, 40f, 0));
			if (zero == Vector3.zero)
			{
				return;
			}
			try
			{
				SpawnSyncedObject[] array = Object.FindObjectsOfType<SpawnSyncedObject>();
				if (array != null)
				{
					instance.mapPropsContainer = GameObject.FindGameObjectWithTag("MapPropsContainer");
					Debug.Log((object)$"Lethal Chaos: Spawning synced outside prop on server. Choices Length: {array.Length}");
					int num = EntropyEngine.rnd.Next(0, array.Length);
					GameObject val = Object.Instantiate<GameObject>(array[num].spawnPrefab, zero, target.transform.rotation, new GameObject().transform);
					if ((Object)(object)val != (Object)null)
					{
						val.GetComponent<NetworkObject>().Spawn(true);
						instance.spawnedSyncedObjects.Add(val);
						EntityDestructionManager.destroyOnLeave.Add(val);
					}
				}
			}
			catch (Exception arg)
			{
				Debug.Log((object)$"Exception! Unable to sync spawned objects on host; {arg}");
			}
		}

		public static void spawnRandomItem(GameObject target, int id, bool targetIsPlayer)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: 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_0050: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: 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_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015c: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			try
			{
				Debug.Log((object)"Lethal Chaos: Spawning synced item on server.");
				Vector3 zero = Vector3.zero;
				Quaternion rotation = Random.rotation;
				zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 3f, 20f, 0));
				if (!(zero == Vector3.zero) && EntropyEngine.rnd.NextDouble() < (double)Accumulators.itemGetMult)
				{
					Item spawnableItem = instance.currentLevel.spawnableScrap[id].spawnableItem;
					GameObject val = Object.Instantiate<GameObject>(spawnableItem.spawnPrefab, zero, Quaternion.identity, new GameObject().transform);
					GrabbableObject component = val.GetComponent<GrabbableObject>();
					((Component)component).transform.rotation = Quaternion.Euler(component.itemProperties.restingRotation);
					component.fallTime = 0f;
					component.scrapValue = (int)((float)EntropyEngine.rnd.Next(spawnableItem.minValue, spawnableItem.maxValue) * instance.scrapValueMultiplier);
					component.SetScrapValue(component.scrapValue);
					NetworkObject component2 = val.GetComponent<NetworkObject>();
					component2.Spawn(false);
					int[] array = new int[1] { component.scrapValue };
					NetworkObjectReference[] array2 = (NetworkObjectReference[])(object)new NetworkObjectReference[1] { NetworkObjectReference.op_Implicit(component2) };
					Accumulators.itemGetMult *= 0.7f;
					val.GetComponent<GrabbableObject>().SetScrapValue(component.scrapValue);
					EntityDestructionManager.destroyOnFail.Add(val);
				}
			}
			catch (Exception arg)
			{
				Debug.Log((object)$"Exception! Unable to sync spawned objects on host; {arg}");
			}
		}

		public static void teleportPlayer(GameObject target, bool targetIsPlayer)
		{
			//IL_0018: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			if (targetIsPlayer)
			{
				Debug.Log((object)"Lethal Chaos: Teleporting Player.");
				GameObject val = nearestPlayerToCoord(target.transform.position);
				PlayerControllerB component = val.GetComponent<PlayerControllerB>();
				Vector3 zero = Vector3.zero;
				zero = safeRandomizedPositionFlex(target, 0f, 25f, 0);
				Plugin.rpcCalls.teleportPlayerClientRpc(((NetworkBehaviour)component).NetworkObjectId, zero);
			}
		}

		public static void LBolt(GameObject target, bool targetIsPlayer)
		{
			//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_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: 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_007f: Unknown result type (might be due to invalid IL or missing references)
			RoundManager instance = RoundManager.Instance;
			Debug.Log((object)"Lethal Chaos: Spawning LBolt");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				Accumulators.lightningSafetyMult *= 0.96f;
				zero = safeRandomizedPositionFlex(target, 4f, 40f * Accumulators.lightningSafetyMult + 15f, 0);
			}
			else
			{
				zero = target.transform.position;
			}
			if (!(zero == Vector3.zero))
			{
				Plugin.rpcCalls.lightningStrikeClientRpc(zero);
			}
		}

		public static void drunk(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Making Player Drunk.");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.makePlayerDrunkClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static async void lightFlicker()
		{
			Debug.Log((object)"Flickering Player Lights");
			Plugin.rpcCalls.lightFlickerClientRpc();
		}

		public static void timeJumpForward()
		{
			Debug.Log((object)"Lethal Chaos: Jumping Time Forward");
			Plugin.rpcCalls.timeJumpForwardClientRpc();
		}

		public static void timeJumpBackward()
		{
		}

		public static void qsand(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_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_0039: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Adding Quicksand.");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 0f, 120f, 0);
				if (!(zero == Vector3.zero))
				{
					Plugin.rpcCalls.qsandClientRpc(zero);
				}
			}
		}

		public static void playSoundInsane(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_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)
			Debug.Log((object)"Lethal Chaos: Insanity Sound.");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 0f, 1f, 0);
				SoundManager.Instance.PlayAudio1AtPositionClientRpc(zero, EntropyEngine.rnd.Next(0, 2));
			}
		}

		public static void indoorJumpscare(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: 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_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_0039: 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)
			Debug.Log((object)"Lethal Chaos: Indoor Spook.");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 15f, 120f, 1);
				if (!(zero == Vector3.zero))
				{
					RoundManager.PlayRandomClip(StartOfRound.Instance.shipAmbianceAudio, StartOfRound.Instance.shipCreakSFX, false, 1f, 0, 1000);
				}
			}
		}

		public static async void wormFromHell(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Worm From Hell.");
			_ = Vector3.zero;
			Vector3 position = safeRandomizedPositionFlex(target, 0f, 45f, 0);
			Quaternion randRot = Random.rotation;
			GameObject WORMBASE = ((Component)Resources.FindObjectsOfTypeAll<SandWormAI>()[0]).gameObject;
			Debug.Log((object)("worm obj: " + (object)WORMBASE.gameObject));
			GameObject worm = Object.Instantiate<GameObject>(WORMBASE, position, randRot, new GameObject().transform);
			Debug.Log((object)("worm init: " + (object)worm));
			worm.SetActive(true);
			SandWormAI AI = worm.GetComponent<SandWormAI>();
			GameObject gameObject = Object.Instantiate<GameObject>(((EnemyAI)AI).enemyType.enemyPrefab, position, randRot);
			gameObject.GetComponentInChildren<NetworkObject>().Spawn(true);
			RoundManager.Instance.SpawnedEnemies.Add(gameObject.GetComponent<EnemyAI>());
			Debug.Log((object)("AI: " + (object)AI));
			((Object)AI).name = "gamer";
			((Object)gameObject).name = "true gamer";
			SandWormAI AI2 = gameObject.GetComponent<SandWormAI>();
			Debug.Log((object)("AI2 Comp " + (object)AI2));
			Debug.Log((object)"Lethal Chaos: Worm Emerge");
			await Task.Delay(500);
			AI2.EmergeServerRpc(0);
			await Task.Delay(10000);
			Object.Destroy((Object)(object)gameObject);
			Object.Destroy((Object)(object)worm);
		}

		public static async void funnyLadder(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Funny Ladder.");
			_ = Vector3.zero;
			Vector3 position = safeRandomizedPositionFlex(target, 5f, 25f, 0);
			Quaternion randRot = Random.rotation;
			if (!(position == Vector3.zero))
			{
				GameObject ladderbase = ((Component)Resources.FindObjectsOfTypeAll<ExtensionLadderItem>()[0]).gameObject;
				GameObject ladder = Object.Instantiate<GameObject>(ladderbase, position, randRot, new GameObject().transform);
				ExtensionLadderItem ITEM = ladder.GetComponent<ExtensionLadderItem>();
				ladder.GetComponentInChildren<NetworkObject>().Spawn(true);
				_ = ((Component)Resources.FindObjectsOfTypeAll<ExtensionLadderItem>()[0]).gameObject;
				GameObject ladder2 = Object.Instantiate<GameObject>(ladderbase, position, randRot, new GameObject().transform);
				ExtensionLadderItem ITEM2 = ladder.GetComponent<ExtensionLadderItem>();
				ladder2.GetComponentInChildren<NetworkObject>().Spawn(true);
				try
				{
					Plugin.rpcCalls.activateLadderClientRpc(((NetworkBehaviour)ITEM).NetworkObjectId);
					Plugin.rpcCalls.activateLadderClientRpc(((NetworkBehaviour)ITEM2).NetworkObjectId);
				}
				catch (Exception)
				{
					Debug.Log((object)"bruh");
				}
				await Task.Delay(25000);
				if (!((GrabbableObject)ITEM).hasBeenHeld && !((GrabbableObject)ITEM).isHeld)
				{
					Object.Destroy((Object)(object)ladder);
					Object.Destroy((Object)(object)ladder2);
				}
				else
				{
					EntityDestructionManager.destroyOnFail.Add(ladderbase);
				}
			}
		}

		public static async void funnyRadio(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Funny Radio.");
			_ = Vector3.zero;
			Quaternion randRot = Random.rotation;
			Vector3 position = safeRandomizedPositionFlex(target, 5f, 25f, 0);
			if (!(position == Vector3.zero))
			{
				GameObject ladderbase = ((Component)Resources.FindObjectsOfTypeAll<BoomboxItem>()[0]).gameObject;
				GameObject ladder = Object.Instantiate<GameObject>(ladderbase, position, randRot, new GameObject().transform);
				ExtensionLadderItem ITEM = ladder.GetComponent<ExtensionLadderItem>();
				ladder.GetComponentInChildren<NetworkObject>().Spawn(true);
				((GrabbableObject)ladder.GetComponentInChildren<BoomboxItem>()).Start();
				((GrabbableObject)ladder.GetComponent<BoomboxItem>()).ItemActivate(true, true);
				((GrabbableObject)ladder.GetComponent<BoomboxItem>()).UseItemOnClient(true);
				await Task.Delay(25000);
				if (!((GrabbableObject)ITEM).hasBeenHeld && !((GrabbableObject)ITEM).isHeld)
				{
					Object.Destroy((Object)(object)ladder);
				}
				else
				{
					EntityDestructionManager.destroyOnFail.Add(ladderbase);
				}
			}
		}

		public static async void bigBalls(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Big Balls.");
			_ = Vector3.zero;
			Vector3 position = safeRandomizedPositionFlex(target, 5f, 25f, 0);
			_ = Random.rotation;
			if (!(position == Vector3.zero))
			{
				GameObject ladderbase = ((Component)Resources.FindObjectsOfTypeAll<SoccerBallProp>()[0]).gameObject;
				GameObject ladder = Object.Instantiate<GameObject>(ladderbase, position, Quaternion.identity, new GameObject().transform);
				SoccerBallProp ITEM = ladder.GetComponent<SoccerBallProp>();
				ladder.GetComponentInChildren<NetworkObject>().Spawn(true);
				((GrabbableObject)ladder.GetComponentInChildren<SoccerBallProp>()).Start();
				Plugin.rpcCalls.bigBallsClientRpc(((NetworkBehaviour)ITEM).NetworkObjectId);
				await Task.Delay(25000);
				if (!((GrabbableObject)ITEM).hasBeenHeld && !((GrabbableObject)ITEM).isHeld)
				{
					Object.Destroy((Object)(object)ladder);
				}
				else
				{
					EntityDestructionManager.destroyOnFail.Add(ladderbase);
				}
			}
		}

		public static void meds(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: finally some free healthcare");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.medsClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void fard(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: fard");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.fardClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void burp(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: burp");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.burpClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void stunPlayer(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: stun");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.stunClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void spawnCar(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: 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_0086: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Spawn Car Trigger");
			Quaternion rotation = Random.rotation;
			Vector3 zero = Vector3.zero;
			zero = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 10f, 20f, 0));
			if (!(zero == Vector3.zero))
			{
				RoundManager instance = RoundManager.Instance;
				Object obj = Object.FindObjectsOfTypeAll(typeof(VehicleController))[0];
				VehicleController val = (VehicleController)(object)((obj is VehicleController) ? obj : null);
				GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, zero, rotation, new GameObject().transform);
				val2.GetComponent<NetworkObject>().Spawn(true);
				EntityDestructionManager.destroyOnLeave.Add(val2);
			}
		}

		public static void createFrontCanvas()
		{
		}

		public static void pong(GameObject target, bool targetIsPlayer)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = nearestPlayerToCoord(target.transform.position);
			if ((Object)(object)val == (Object)null)
			{
				Debug.Log((object)"Lethal Chaos: P O N G Blocked: player is null");
			}
			Plugin.rpcCalls.startPongGameClientRpc(((NetworkBehaviour)val.GetComponent<PlayerControllerB>()).NetworkObjectId);
		}

		public static void pongExecute(PlayerControllerB player)
		{
			//IL_0016: 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)
			Debug.Log((object)"Lethal Chaos: Pong Game lost (get rekt)");
			player.DamagePlayer(90, true, true, (CauseOfDeath)6, 2, false, default(Vector3));
		}

		public static void shipSuck()
		{
			Plugin.rpcCalls.startSuckClipClientRpc();
		}

		public static void spawnWeb(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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_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_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Spoder Web.");
			Vector3 zero = Vector3.zero;
			zero = safeRandomizedPositionFlex(target, 5f, 25f, 0);
			Quaternion rotation = Random.rotation;
			if (zero == Vector3.zero)
			{
				return;
			}
			SandSpiderAI val = Resources.FindObjectsOfTypeAll<SandSpiderAI>()[0];
			GameObject gameObject = ((Component)val).gameObject;
			GameObject val2 = null;
			if ((Object)(object)spoderRef == (Object)null)
			{
				val2 = (spoderRef = Object.Instantiate<GameObject>(gameObject, zero, rotation, new GameObject().transform));
				if (Object.op_Implicit((Object)(object)val2.GetComponentInChildren<NetworkObject>()))
				{
					val2.GetComponentInChildren<NetworkObject>().Spawn(true);
				}
				val2.gameObject.SetActive(true);
			}
			else
			{
				val2 = spoderRef;
			}
			spoderRef = val2;
			SandSpiderAI component = val2.GetComponent<SandSpiderAI>();
			component.SpawnWebTrapClientRpc(zero, zero + new Vector3((float)(25.0 - EntropyEngine.rnd.NextDouble() * 50.0), zero.y, (float)(25.0 - EntropyEngine.rnd.NextDouble() * 50.0)));
		}

		public static void miniMan(GameObject target)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: squish");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.squishClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void amogus(GameObject target)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.startAmogusClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public void eggExplosion(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Egg Bomb Trigger");
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 8f * Accumulators.explosionSafetyMult + 5f, 30f, 0);
				Accumulators.explosionSafetyMult *= 0.9f;
			}
			else
			{
				zero = target.transform.position;
			}
			if (zero != Vector3.zero)
			{
				Plugin.rpcCalls.spawnExplosionClientRpc(zero);
			}
		}

		public static void newEventOfDoom(EntropyHost host)
		{
			if (!(EntropyEngine.rnd.NextDouble() > 0.75))
			{
				Plugin.rpcCalls.newRandomEventWarningClientRpc(1 + Accumulators.outcomeCounter);
				for (int i = 0; i < 1 + Accumulators.outcomeCounter; i++)
				{
					host.addRandomOutcome();
				}
				if (Accumulators.outcomeCounter > 5)
				{
					Accumulators.outcomeCounter = 1;
				}
				if (EntropyEngine.rnd.NextDouble() > 0.5)
				{
					Accumulators.outcomeCounter++;
				}
			}
		}

		public static async void obunga(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Obunga has arrived.");
			_ = Vector3.zero;
			Vector3 position = safeRandomizedPositionFlex(target, 22f, 50f, 0);
			if (position == Vector3.zero)
			{
				return;
			}
			TestEnemy[] allEnemies = Resources.FindObjectsOfTypeAll<TestEnemy>();
			GameObject obunga = null;
			try
			{
				TestEnemy[] array = allEnemies;
				foreach (TestEnemy enemy in array)
				{
					if (!((Object)(object)enemy == (Object)null))
					{
						GameObject go = ((Component)enemy).gameObject;
						Debug.Log((object)go);
						if ((Object)(object)go != (Object)null && ((Object)go).name.ToLower().Contains("capsule"))
						{
							GameObject gameObject = Object.Instantiate<GameObject>(go, position, Quaternion.Euler(Vector3.zero));
							gameObject.gameObject.GetComponentInChildren<NetworkObject>().Spawn(true);
							NavMeshAgent agent = gameObject.GetComponent<EnemyAI>().agent;
							agent.speed /= 1.5f;
							RoundManager.Instance.SpawnedEnemies.Add(gameObject.GetComponent<EnemyAI>());
							EntityDestructionManager.destroyOnLeave.Add(gameObject);
							Accumulators.enemySpawnMult *= 0.95f;
							Plugin.rpcCalls.notifyObungaClientRpc();
							obunga = gameObject;
							break;
						}
					}
				}
			}
			catch (Exception ex)
			{
				Exception e = ex;
				Debug.LogError((object)e);
			}
			await Task.Delay(EntropyEngine.rnd.Next() * 30000);
			if (Object.op_Implicit((Object)(object)obunga))
			{
				Object.Destroy((Object)(object)obunga);
				Plugin.rpcCalls.notifyObungaLeftClientRpc();
			}
			else
			{
				EventThrottler.summons -= 1f;
				EventThrottler.triggerTotals[1]--;
			}
		}

		public static void missileSilo(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Random missile silo");
			fireMissileSilo(target, targetIsPlayer);
		}

		public static void meteorShower()
		{
			if (!meteorsToday)
			{
				RoundManager instance = RoundManager.Instance;
				GameObject val = GameObject.Find("TimeAndWeather");
				TimeOfDay component = val.GetComponent<TimeOfDay>();
				component.MeteorWeather.SetStartMeteorShower();
				meteorsToday = true;
			}
		}

		public static void picklefyNearbyTextures(GameObject target, bool targetIsPlayer)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: 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_0027: 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_0032: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: Picklefy Textures");
			Vector3 zero = Vector3.zero;
			zero = safeRandomizedPositionFlex(target, 1f, 5f, 0);
			Plugin.rpcCalls.picklefyClientRpc(zero);
		}

		public static void freeMoney()
		{
			int groupCredits = Object.FindObjectOfType<Terminal>().groupCredits;
			Plugin.rpcCalls.setCreditsClientRpc((int)((float)groupCredits + (float)groupCredits * 0.1f + 5f));
		}

		public static void bigBoi(GameObject target, bool targetIsPlayer)
		{
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			Debug.Log((object)"Lethal Chaos: big boi");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			PlayerControllerB component = val.GetComponent<PlayerControllerB>();
			Plugin.rpcCalls.expandClientRpc(((NetworkBehaviour)component).NetworkObjectId);
		}

		public static void completelyRandomSound(GameObject target, bool targetIsPlayer)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004d: 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)
			Vector3 zero = Vector3.zero;
			if (targetIsPlayer)
			{
				zero = safeRandomizedPositionFlex(target, 0f, 2f, 0);
			}
			else
			{
				zero = target.transform.position;
			}
			Debug.Log((object)"Lethal Chaos: random sound:::");
			GameObject val = nearestPlayerToCoord(target.transform.position);
			AudioClip[] array = Resources.FindObjectsOfTypeAll<AudioClip>();
			AudioClip val2 = array[EntropyEngine.rnd.Next(0, array.Length)];
			if (Object.op_Implicit((Object)(object)val2))
			{
				Plugin.rpcCalls.completelyRandomSoundClientRpc(((Object)val2).name, val.transform.position);
			}
		}

		public static Quaternion randomDownToSideRotationFull()
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(0f, 90f);
			float num2 = Random.Range(0f, 360f);
			float num3 = Mathf.Sin(num * (MathF.PI / 180f)) * Mathf.Cos(num2 * (MathF.PI / 180f));
			float num4 = 0f - Mathf.Cos(num * (MathF.PI / 180f));
			float num5 = Mathf.Sin(num * (MathF.PI / 180f)) * Mathf.Sin(num2 * (MathF.PI / 180f));
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(num3, num4, num5);
			Quaternion val2 = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up);
			float num6 = Random.Range(0f, 360f);
			Quaternion val3 = Quaternion.AngleAxis(num6, ((Vector3)(ref val)).normalized);
			return val3 * val2;
		}

		private static async void fireMissileSilo(GameObject target, bool targetIsPlayer)
		{
			Debug.Log((object)"Lethal Chaos: Missile Silo");
			int delay = 400;
			int amount = EntropyEngine.rnd.Next(1, 15);
			_ = Vector3.zero;
			Vector3 position = ((!targetIsPlayer) ? target.transform.position : safeRandomizedPositionFlex(target, 0f, 2f, 0));
			if (targetIsPlayer)
			{
				position.y += (float)EntropyEngine.rnd.NextDouble() * 20f + 13f;
			}
			else
			{
				position.y += (float)EntropyEngine.rnd.NextDouble() * 25f;
			}
			for (int i = 0; i < amount; i++)
			{
				Plugin.rpcCalls.makeMissileClientRpc(position, randomDownToSideRotationFull());
				await Task.Delay(delay);
			}
		}

		public static void triggerMostInteractables(GameObject target, bool targetIsPlayer)
		{
			InteractTrigger[] array = Object.FindObjectsOfType<InteractTrigger>();
			foreach (InteractTrigger val in array)
			{
				if ((float)EntropyEngine.rnd.Next() > 0.5f)
				{
					val.Interact(target.transform);
				}
			}
		}

		public static void randomToggleWeather()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			Debug.Log((object)"Lethal Chaos: random toggle weather");
			RoundManager instance = RoundManager.Instance;
			GameObject val = GameObject.Find("TimeAndWeather");
			TimeOfDay component = val.GetComponent<TimeOfDay>();
			List<GameObject> list = new List<GameObject>();
			foreach (Transform item in val.transform)
			{
				Transform val2 = item;
				GameObject gameObject = ((Component)val2).gameObject;
				Debug.Log((object)("Child: " + ((Object)gameObject).name));
				if (!((Object)gameObject).name.ToLower().Contains("meteor") && !((Object)gameObject).name.ToLower().Contains("time"))
				{
					list.Add(gameObject);
				}
			}
			GameObject val3 = list[EntropyEngine.rnd.Next(0, list.Count)];
			if (Object.op_Implicit((Object)(object)val3))
			{
				Plugin.rpcCalls.toggleWeatherClientRpc(((Object)val3).name);
			}
		}

		public static void pufferCloud(GameObject target, bool targetIsPlayer)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_0039: Unknown result type (might be due to invalid IL or missing references)
			Vector3 zero = Vector3.zero;
			zero = safeRandomizedPositionFlex(target, 0f, 26f, 0);
			if (!(zero == Vector3.zero))
			{
				Plugin.rpcCalls.pufferClientRpc(zero);
			}
		}

		public static void shipStreeeeeeeetch()
		{
			Debug.Log((object)"Lethal Chaos: ship streeeeeeeeeeeetch");
			GameObject val = GameObject.Find("HangarShip");
			if (Object.op_Implicit((Object)(object)val))
			{
				int code = EntropyEngine.rnd.Next(0, 3);
				int time = EntropyEngine.rnd.Next(100, 60000);
				Plugin.rpcCalls.shipStretchClientRpc(code, time);
			}
			else
			{
				Debug.LogError((object)"Lethal Chaos: Can't find ship to stretch!");
			}
		}
	}
	internal class EntropyEngine
	{
		public static Random rnd = new Random();

		public static bool SimultaneousOutcomes = false;

		public static float EventHookMultiplier = 1f;

		public static float EventChanceMultiplier = 1f;

		public static float EventChanceOffset = 0f;

		public static EntropyHost entropyHost;

		public static LightningHook lightninghook;

		public static ItemHooks itemhooks;

		public static PlayerHooks playerhooks;

		public static EnemyHooks enemyhooks;

		public static ClockHook modifierhook;

		public static PlanetResetHook resetHooks;

		public static EntityDestructionManager destructionManager = new EntityDestructionManager();

		public static SelectableLevel[] moons = (SelectableLevel[])(object)new SelectableLevel[0];

		public static List<EntropyHost> hosts = new List<EntropyHost>();

		public EntropyEngine()
		{
			Hooks();
		}

		public static void LaunchEngine()
		{
			Debug.Log((object)"Lethal Chaos: Launching Entropy Engine...");
			hosts.Clear();
			if (moons.Length == 0)
			{
				moons = Resources.FindObjectsOfTypeAll(typeof(SelectableLevel)) as SelectableLevel[];
			}
			for (int i = 0; i < moons.Length; i++)
			{
				hosts.Add(new EntropyHost(moons[i].PlanetName));
			}
		}

		public static EntropyHost getMoonHost()
		{
			RoundManager instance = RoundManager.Instance;
			string planetName = instance.currentLevel.PlanetName;
			for (int i = 0; i < moons.Length; i++)
			{
				if (planetName.Equals(moons[i].PlanetName))
				{
					return hosts[i];
				}
			}
			Debug.Log((object)"Lethal Chaos: Failed to find planet. Returning None Planet.");
			return new EntropyHost("None");
		}

		public void Hooks()
		{
			lightninghook = new LightningHook();
			itemhooks = new ItemHooks();
			playerhooks = new PlayerHooks();
			enemyhooks = new EnemyHooks();
			modifierhook = new ClockHook();
			resetHooks = new PlanetResetHook();
			WorldModifiers.Hooks();
		}
	}
	public class EntropyHost
	{
		public static int eventTotal = 47;

		private List<Event> events;

		private ItemSubsetRandomizer it_randomizer;

		public string planet;

		public WorldModifiers modifiers = new WorldModifiers();

		private int it_randomizer_seed = EntropyEngine.rnd.Next();

		public EventThrottler throttler = new EventThrottler();

		public EntropyHost(string planet)
		{
			Debug.Log((object)"Lethal Chaos: New Entropy Host Launched.");
			events = new List<Event>();
			for (int i = 0; i < eventTotal; i++)
			{
				Event @event = new Event(i);
				@event.printData(planet);
				this.planet = planet;
				events.Add(@event);
			}
			throttler = new EventThrottler();
		}

		public void queueHook(string hookID, GameObject obj, bool isSelective, bool targetIsPlayer)
		{
			RoundManager instance = RoundManager.Instance;
			if (it_randomizer == null)
			{
				Debug.Log((object)"Lethal Chaos: Starting Up Subset Randomizers For This Planet");
				it_randomizer = new ItemSubsetRandomizer(instance.currentLevel.spawnableScrap, it_randomizer_seed);
			}
			for (int i = 0; i < events.Count; i++)
			{
				Event @event = events[i];
				if (!@event.hooksAttached.Contains(hookID) || !@event.runOutcome(hookID))
				{
					continue;
				}
				if (EntropyEngine.SimultaneousOutcomes)
				{
					for (int j = 0; j < events.Count; j++)
					{
						Event event2 = events[j];
						if (event2.hooksAttached.Contains(hookID))
						{
							runEvent(event2.eventID, obj, isSelective, targetIsPlayer);
						}
					}
				}
				else
				{
					runEvent(events[i].eventID, obj, isSelective, targetIsPlayer);
				}
			}
		}

		public void runEvent(int method, GameObject obj, bool isSelective, bool playerOrigin)
		{
			try
			{
				RoundManager instance = RoundManager.Instance;
				Debug.Log((object)("running event: " + method + " to " + planet));
				if (!GameNetworkManager.Instance.isHostingGame)
				{
					Debug.Log((object)"block: is not hosting... Returning...");
				}
				else if (EntropyEngine.getMoonHost().planet.Equals("None"))
				{
					Debug.Log((object)"block: host is none. Returning...");
				}
				else if (instance.elevatorUp || instance.totalScrapValueInLevel == 0f)
				{
					Debug.Log((object)"block: Elevator is up. Returning...");
				}
				else if (instance.playersManager.allPlayersDead)
				{
					Debug.Log((object)"block: all players dead. Returning...");
				}
				else
				{
					if ((Object)(object)instance.dungeonGenerator == (Object)null)
					{
						return;
					}
					switch (method)
					{
					case 0:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(0, 15, 0f, 0f))
							{
								return;
							}
							entropyBlaster.bomb(obj, playerOrigin);
						}
						break;
					case 1:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(1, 4, 0f, 1f))
							{
								return;
							}
							entropyBlaster.SpawnRandomOutsideEnemyNear(obj, playerOrigin);
						}
						break;
					case 2:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(2, 12, 0.3f, 0.7f))
							{
								return;
							}
							entropyBlaster.spawnRandomHazard(obj, playerOrigin);
						}
						break;
					case 3:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(3, 10, 0f, 1f))
							{
								return;
							}
							entropyBlaster.spawnTurret(obj, playerOrigin);
						}
						break;
					case 4:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(4, 40, 1f, 0f))
							{
								return;
							}
							entropyBlaster.spawnMine(obj, playerOrigin);
						}
						break;
					case 5:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(5, 4, 0f, 1f))
							{
								return;
							}
							entropyBlaster.SpawnRandomInsideEnemyNear(obj, playerOrigin);
						}
						break;
					case 6:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(6, 10, 0f, 1f))
							{
								return;
							}
							entropyBlaster.spawnHive(obj, playerOrigin);
						}
						break;
					case 7:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(7, 30, 1f, 0f))
							{
								return;
							}
							entropyBlaster.spawnRandomPropOutside(obj, playerOrigin);
						}
						break;
					case 8:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(8, 30, 1f, 0f))
							{
								return;
							}
							entropyBlaster.spawnRandomPropInside(obj, playerOrigin);
						}
						break;
					case 9:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(9, 10, 1f, 0f))
							{
								return;
							}
							entropyBlaster.spawnRandomItem(obj, it_randomizer.provideItemID(), playerOrigin);
						}
						break;
					case 10:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(10, 10, 0f, 0f))
							{
								return;
							}
							entropyBlaster.teleportPlayer(obj, playerOrigin);
						}
						break;
					case 11:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(11, 15, 0f, 0f))
							{
								return;
							}
							entropyBlaster.LBolt(obj, playerOrigin);
						}
						break;
					case 12:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(12, 8, 0f, 0f))
							{
								return;
							}
							entropyBlaster.drunk(obj, playerOrigin);
						}
						break;
					case 13:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(13, 50, 0f, 0f))
						{
							return;
						}
						entropyBlaster.lightFlicker();
						break;
					case 14:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(14, 1000, 0f, 0f))
						{
							return;
						}
						entropyBlaster.timeJumpForward();
						break;
					case 15:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(15, 30, 0f, 0f))
						{
							return;
						}
						entropyBlaster.timeJumpBackward();
						break;
					case 16:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(16, 15, 1f, 0f))
							{
								return;
							}
							entropyBlaster.qsand(obj, playerOrigin);
						}
						break;
					case 17:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(17, 15, 0f, 0f))
						{
							return;
						}
						entropyBlaster.playSoundInsane(obj, playerOrigin);
						break;
					case 18:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(18, 15, 0f, 0f))
							{
								return;
							}
							entropyBlaster.indoorJumpscare(obj, playerOrigin);
						}
						break;
					case 19:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(19, 15, 0f, 0f))
							{
								return;
							}
							entropyBlaster.wormFromHell(obj, playerOrigin);
						}
						break;
					case 20:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(20, 40, 0f, 0f))
							{
								return;
							}
							entropyBlaster.funnyLadder(obj, playerOrigin);
						}
						break;
					case 21:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(21, 30, 0f, 0f))
							{
								return;
							}
							entropyBlaster.fard(obj, playerOrigin);
						}
						break;
					case 22:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(22, 10, 0f, 0f))
							{
								return;
							}
							entropyBlaster.stunPlayer(obj, playerOrigin);
						}
						break;
					case 23:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(23, 100, 0f, 0f))
						{
							return;
						}
						Plugin.rpcCalls.glitchHudClientRpc();
						break;
					case 24:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(24, 20, 0f, 0f))
							{
								return;
							}
							Plugin.rpcCalls.shakeScreenClientRpc();
						}
						break;
					case 25:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(25, 10, 0f, 0f))
						{
							return;
						}
						Plugin.rpcCalls.radiationWarningHudClientRpc();
						break;
					case 26:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(26, 10, 3f, 0f))
							{
								return;
							}
							entropyBlaster.spawnCar(obj, playerOrigin);
						}
						break;
					case 27:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(27, 15, 1f, 0f))
							{
								return;
							}
							entropyBlaster.funnyRadio(obj, playerOrigin);
						}
						break;
					case 28:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(28, 10, 0f, 0f))
							{
								return;
							}
							entropyBlaster.bigBalls(obj, playerOrigin);
						}
						break;
					case 29:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(29, 1, 0f, 0f))
							{
								return;
							}
							entropyBlaster.pong(obj, playerOrigin);
						}
						break;
					case 30:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(30, 1, 0f, 0f))
						{
							return;
						}
						entropyBlaster.newEventOfDoom(this);
						break;
					case 31:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(31, 30, 1f, 0f))
							{
								return;
							}
							entropyBlaster.spawnWeb(obj, playerOrigin);
						}
						break;
					case 32:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(32, 30, 0f, 0f))
							{
								return;
							}
							entropyBlaster.burp(obj, playerOrigin);
						}
						break;
					case 33:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(33, 10, 0f, 0f))
							{
								return;
							}
							entropyBlaster.miniMan(obj);
						}
						break;
					case 34:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(34, 10, 0f, 0f))
							{
								return;
							}
							entropyBlaster.amogus(obj);
						}
						break;
					case 35:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(35, 1, 0f, 0f))
							{
								return;
							}
							entropyBlaster.meds(obj, targetIsPlayer: true);
						}
						break;
					case 36:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(36, 1, 0f, 3f))
							{
								return;
							}
							entropyBlaster.obunga(obj, targetIsPlayer: true);
						}
						break;
					case 37:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(37, 1, 0f, 0f))
						{
							return;
						}
						entropyBlaster.meteorShower();
						break;
					case 38:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(38, 6, 0f, 0f))
						{
							return;
						}
						entropyBlaster.freeMoney();
						break;
					case 39:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(39, 30, 0f, 0f))
							{
								return;
							}
							entropyBlaster.picklefyNearbyTextures(obj, targetIsPlayer: true);
						}
						break;
					case 40:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(40, 9, 0f, 0f))
							{
								return;
							}
							entropyBlaster.bigBoi(obj, targetIsPlayer: true);
						}
						break;
					case 41:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(41, 30, 0f, 0f))
							{
								return;
							}
							entropyBlaster.completelyRandomSound(obj, targetIsPlayer: true);
						}
						break;
					case 42:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(42, 12, 0f, 0f))
							{
								return;
							}
							entropyBlaster.missileSilo(obj, targetIsPlayer: true);
						}
						break;
					case 43:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(43, 2, 0f, 0f))
						{
							return;
						}
						entropyBlaster.shipSuck();
						break;
					case 44:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(44, 0, 0f, 0f))
						{
							return;
						}
						entropyBlaster.randomToggleWeather();
						break;
					case 45:
						if (EntropyEngine.getMoonHost().throttler.throttleGate(45, 1, 0f, 0f))
						{
							return;
						}
						entropyBlaster.shipStreeeeeeeetch();
						break;
					case 46:
						if (isSelective)
						{
							if (EntropyEngine.getMoonHost().throttler.throttleGate(46, 20, 0f, 0f))
							{
								return;
							}
							entropyBlaster.pufferCloud(obj, targetIsPlayer: true);
						}
						break;
					}
					Object.Destroy((Object)(object)obj);
				}
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Lethal Chaos: " + ex.ToString()));
				try
				{
					Object.Destroy((Object)(object)obj);
				}
				catch (Exception)
				{
				}
			}
		}

		public void addRandomOutcome()
		{
			Random random = new Random();
			int