Decompiled source of UltraEvents v1.3.2

UltraEvents/UltraEvents.dll

Decompiled 2 weeks 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.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Newtonsoft.Json;
using TMPro;
using UltraEvents.MonoBehaviours;
using UltraEvents.MonoBehaviours.Effects;
using UltraEvents.MonoBehaviours.Tasks;
using UltraEvents.Utils;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.ResourceManagement.AsyncOperations;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.Video;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("UltraEvents")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("UltraEvents")]
[assembly: AssemblyCopyright("Copyright ©  2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("853e0058-2d8b-4f8e-acd4-3ae25760dd09")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[Serializable]
public class Root
{
	public string id { get; set; }

	public string url { get; set; }

	public int width { get; set; }

	public int height { get; set; }
}
public static class JsonHelper
{
	[Serializable]
	private class Wrapper<T>
	{
		public T[] Items;
	}

	public static T[] FromJson<T>(string json)
	{
		Wrapper<T> wrapper = JsonUtility.FromJson<Wrapper<T>>(json);
		return wrapper.Items;
	}
}
namespace UltraEvents
{
	[BepInPlugin("com.michi.UltraEvents", "UltraEvents", "1.0.0")]
	public class UltraEventsPlugin : BaseUnityPlugin
	{
		[Serializable]
		public class LinkData
		{
			public string link;
		}

		private const string MyGUID = "com.michi.UltraEvents";

		private const string PluginName = "UltraEvents";

		private const string VersionString = "1.0.0";

		private GameObject EffectManager;

		private GameObject TaskManagerObject;

		private static readonly Harmony Harmony = new Harmony("com.michi.UltraEvents");

		public static ManualLogSource Log = new ManualLogSource("UltraEvents");

		public static List<GameObject> plushies = new List<GameObject>();

		private GameObject fishingCanvas;

		public Shader unlitShader;

		private float timer = 5f;

		public ConfigEntry<float> AmountOfTime;

		public ConfigEntry<int> maxAmountOfDeletedOjects;

		public ConfigEntry<bool> rmeoveEffects;

		public ConfigEntry<bool> announceEvents;

		public ConfigEntry<bool> everyFewSeconds;

		public static ConfigEntry<bool> OnSecretReceived;

		public static ConfigEntry<bool> OnParry;

		public static ConfigEntry<bool> OnEnemyDeath;

		public static ConfigEntry<bool> GetHurt;

		public static ConfigEntry<bool> GetStyle;

		private GameObject rot = null;

		private string[] plushieKeys = new string[32]
		{
			"DevPlushie (Jacob)", "DevPlushie (Mako)", "DevPlushie (HEALTH - Jake)", "DevPlushie (Dalia)", "DevPlushie", "DevPlushie (Jericho)", "DevPlushie (Meganeko)", "DevPlushie (Tucker)", "DevPlushie (BigRock)", "DevPlushie (Dawg)",
			"DevPlushie (Sam)", "Mandy Levitating", "DevPlushie (Cameron)", "DevPlushie (Gianni)", "DevPlushie (Salad)", "DevPlushie (Mandy)", "DevPlushie (Joy)", "DevPlushie (Weyte)", "DevPlushie (Heckteck)", "DevPlushie (Hakita)",
			"DevPlushie (Lenval)", "DevPlushie (CabalCrow) Variant", "DevPlushie (Quetzal)", "DevPlushie (HEALTH - John)", "Glasses", "DevPlushie (PITR)", "DevPlushie (HEALTH - BJ)", "DevPlushie (Francis)", "DevPlushie (Vvizard)", "DevPlushie (Lucas)",
			"DevPlushie (Scott)", "DevPlushie (KGC)"
		};

		public ConfigEntry<bool> YEETEvent;

		public ConfigEntry<bool> TPEnemiesEvent;

		public ConfigEntry<bool> RemoveWeaponEvent;

		public ConfigEntry<bool> usePreviousWeaponEvent;

		public ConfigEntry<bool> KaboomEvent;

		public ConfigEntry<bool> DupeEnemyEvent;

		public ConfigEntry<bool> BuffEnemyEvent;

		public ConfigEntry<bool> giveRandomWeaponEvent;

		public ConfigEntry<bool> ReverseGravityEvent;

		public ConfigEntry<bool> KillRandomEnemyEvent;

		public ConfigEntry<bool> KillAllEnemyEvent;

		public ConfigEntry<bool> UseRandomInputEvent;

		public ConfigEntry<bool> RemoveRandomObjectEvent;

		public ConfigEntry<bool> AddRBRandomObjectEvent;

		public ConfigEntry<bool> SpawnItemEvent;

		public ConfigEntry<bool> SlowMotionEvent;

		public ConfigEntry<bool> GiveDualWieldEvent;

		public ConfigEntry<bool> SpawnRandomEnemyEvent;

		public ConfigEntry<bool> LagEvent;

		public ConfigEntry<bool> BlessthemAllEvent;

		public ConfigEntry<bool> waerEvent;

		public ConfigEntry<bool> noHealsEvent;

		public ConfigEntry<bool> GetRodEvent;

		public ConfigEntry<bool> TurnEnemyIntoPuppetEvent;

		public ConfigEntry<bool> MoreTroubleEvent;

		public ConfigEntry<bool> TeleportToEnemyEvent;

		public ConfigEntry<bool> SwapPosEvent;

		public ConfigEntry<bool> FastMotionEvent;

		public ConfigEntry<bool> SwitchArmEvent;

		public ConfigEntry<bool> RemoveStyleEvent;

		public ConfigEntry<bool> DiesEvent;

		public ConfigEntry<bool> FakeParryEvent;

		public ConfigEntry<bool> SpawnAdEvent;

		public ConfigEntry<bool> LoadCatEvent;

		public ConfigEntry<bool> AlakablamEvent;

		public ConfigEntry<bool> AirStrikeEvent;

		public ConfigEntry<bool> DupeAllEnemyEvent;

		public ConfigEntry<bool> RemoveStaminaEvent;

		public ConfigEntry<bool> RemoveChargeEvent;

		public ConfigEntry<bool> OpenRandomLaLinkEvent;

		public ConfigEntry<bool> RemoveRandomObjectsEvent;

		public ConfigEntry<bool> PixelizeScreenEvent;

		public ConfigEntry<bool> AddRBRandomObjectsEvent;

		public ConfigEntry<bool> GetTaskEvent;

		public ConfigEntry<bool> MakeEnemyOutOfSomethingEvent;

		public ConfigEntry<bool> InvisibleEnemiesEvent;

		public ConfigEntry<bool> SchizophreniaUpdateEvent;

		public ConfigEntry<bool> BulletsExplodeNowEvent;

		public ConfigEntry<bool> BulletsAfraidEnemiesEvent;

		public ConfigEntry<bool> ReadEvent;

		public ConfigEntry<bool> VirtualInsanityEvent;

		public string jsonFilePath = "UltraEvents.Jsons.Links.json";

		private List<LinkData> links = new List<LinkData>();

		public string apiUrl = "https://api.thecatapi.com/v1/images/search?limit=1&breed_ids=beng&api_key=REPLACE_ME";

		public Renderer catRenderer;

		public static UltraEventsPlugin Instance { get; private set; }

		public void SetConfigs()
		{
			YEETEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "YEETEvent", true, "When this event is triggered it will yeet you");
			TPEnemiesEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "TPEnemiesEvent", true, "When this event is triggered it will tp all enemies to you");
			RemoveWeaponEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveWeaponEvent", true, "When this event is triggered it will remove the weapon you have currently equipped");
			usePreviousWeaponEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "usePreviousWeaponEvent", true, "When this event is triggered it will automatically select your previous weapon");
			KaboomEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "KaboomEvent", true, "When this event is triggered it will explode every enemy");
			DupeEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "DupeEnemyEvent", true, "When this event is triggered it will dupilcate a random enemy");
			BuffEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "BuffEnemyEvent", true, "When this event is triggered it will buff a random enemy");
			giveRandomWeaponEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "giveRandomWeaponEvent", true, "When this event is triggered it will choose a random weapon for you");
			ReverseGravityEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "ReverseGravityEvent", true, "When this event is triggered it will reverse gravity");
			KillRandomEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "KillRandomEnemyEvent", true, "When this event is triggered it will kill a random enemy");
			KillAllEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "KillAllEnemyEvent", true, "When this event is triggered it will kill every enemy");
			UseRandomInputEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "UseRandomInputEvent", true, "When this event is triggered it will use a random input (currently broken)");
			RemoveRandomObjectEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveRandomObjectEvent", true, "When this event is triggered it will remove a random object");
			AddRBRandomObjectEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "AddRBRandomObjectEvent", true, "When this event is triggered it will add gravity to a random object");
			AddRBRandomObjectsEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "AddRBRandomObjectsEvent", true, "When this event is triggered it will add gravity to a multitude random objects");
			SpawnItemEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "PlushieRain", true, "When this event is triggered it will make a plushie rain");
			SlowMotionEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SlowMotionEvent", true, "When this event is triggered it will go into 0.3 times slowmotion");
			GiveDualWieldEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "GiveDualWieldEvent", true, "When this event is triggered it will give you a random amount of dual wields");
			SpawnRandomEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SpawnRandomEnemyEvent", true, "When this event is triggered it will spawn a random enemy");
			LagEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "LagEvent", true, "When this event is triggered it will teleport you back to your previous position every few seconds");
			BlessthemAllEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "BlessthemAllEvent", true, "When this event is triggered it will bless all the enemies until the next event");
			waerEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "waerEvent", true, "When this event is triggered it will put everything under water");
			noHealsEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "noHealsEvent", true, "When this event is triggered it will sandify every current enemy");
			GetRodEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "GetRodEvent", true, "When this event is triggered it will give you the fishing rod");
			TurnEnemyIntoPuppetEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "TurnEnemyIntoPuppetEvent", true, "When this event is triggered it will turn a random enemy into a puppet");
			MoreTroubleEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "MoreTroubleEvent", true, "When this event is triggered it will activate 2 events");
			TeleportToEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "TeleportToEnemyEvent", true, "When this event is triggered it will teleport you to an enemy");
			SwapPosEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SwapPosEvent", true, "When this event is triggered it will swap 2 objects position");
			FastMotionEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "FastMotionEvent", true, "When this event is triggered it will go in 2 times speed");
			SwitchArmEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SwitchArmEvent", true, "When this event is triggered it will switch your arm");
			RemoveStyleEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveStyleEvent", true, "When this event is triggered it will remove a random amount of your style points");
			DiesEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "DieEvent", true, "When this event is triggered it will kill you");
			FakeParryEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "FakeParryEvent", true, "When this event is triggered it will trigger a flash");
			SpawnAdEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SpawnAdEvent", true, "When this event is triggered it will spawn a random video you have in the videos folder (look at the dll file location)");
			LoadCatEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "LoadCatEvent", true, "When this event is triggered it will make a cube with a randomm cat image");
			AlakablamEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "AlakablamEvent", true, "When this event is triggered it will virtue beam every enemy");
			AirStrikeEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "AirStrikeEvent", true, "When this event is triggered it will virtue beam you");
			DupeAllEnemyEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "DupeAllEnemyEvent", true, "When this event is triggered it will duplicate every enemy");
			RemoveStaminaEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveStaminaEvent", true, "When this event is triggered it will remove your stamina");
			RemoveChargeEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveChargeEvent", true, "When this event is triggered it will remove your railcannon charge");
			OpenRandomLaLinkEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "OpenRandomLaLinkEvent", true, "When this event is triggered it will open a random link from the links json (look at the dll file location)");
			RemoveRandomObjectsEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "RemoveRandomObjectsEvent", true, "When this event is triggered it will remove a few random objects");
			PixelizeScreenEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "PixelizeScreenEvent", true, "When this event is triggered it will pixelize your screen");
			GetTaskEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "GetTaskEvent", true, "When this event is triggered it give you a task");
			MakeEnemyOutOfSomethingEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "MakeEnemyOutOfSomethingEvent", true, "When this event is triggered it will make a random object an enemy");
			InvisibleEnemiesEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "InvisibleEnemiesEvent", true, "When this event is triggered it will turn every enemy invisible");
			SchizophreniaUpdateEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "SchizophreniaUpdateEvent", true, "When this event is triggered it will remove every enemy that you dont see");
			BulletsExplodeNowEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "BulletsExplodeNowEvent", true, "When this event is triggered it will make every bullet explode on contact");
			BulletsAfraidEnemiesEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "BulletsAfraidEnemiesEvent", true, "When this event is triggered it will make every bullet avoid enemies");
			ReadEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "ReadEvent", true, "When this event is triggered it will make you read");
			VirtualInsanityEvent = ((BaseUnityPlugin)this).Config.Bind<bool>("Events", "VirtualInsanityEvent", true, "When this event is triggered it will do the same as the objects in the virtual insanity video");
			AmountOfTime = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "time between events", 5f, (ConfigDescription)null);
			maxAmountOfDeletedOjects = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "max amount of deleted objects", 20, "tied to the 'RemoveRandomObjectsEvent' you can choose what the maximum amount is");
			rmeoveEffects = ((BaseUnityPlugin)this).Config.Bind<bool>("Values", "remove effects", true, "when this is disabled it wont remove any effects. (NOT RECOMMENDED DONT DO THIS VERY LAGGY!!!)");
			announceEvents = ((BaseUnityPlugin)this).Config.Bind<bool>("Values", "announce events", true, "when this is disabled it wont announce what event itll activate no more");
			everyFewSeconds = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "every few seconds", true, "every few seconds an event will trigger");
			OnSecretReceived = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Secret Found", false, "will trigger an event when you find a secret");
			OnParry = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Parry", false, "will trigger an event when you parry");
			OnEnemyDeath = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Enemy Death", false, "will trigger an event when you kill an enemy");
			GetHurt = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Get Hurt", false, "will trigger an event when you receive damage");
			GetStyle = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Get Style", false, "will trigger an event when you receive Style");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"loadedAllConfigs");
		}

		private void Awake()
		{
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Expected O, but got Unknown
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_00e2: 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)
			Instance = this;
			SetConfigs();
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
			((BaseUnityPlugin)this).Logger.LogInfo((object)AmountOfTime.Value);
			timer = AmountOfTime.Value;
			EffectManager = new GameObject("EffectManager");
			Object.DontDestroyOnLoad((Object)(object)EffectManager);
			EffectManager.transform.parent = ((Component)this).transform;
			TaskManagerObject = new GameObject("TaskManager");
			Object.DontDestroyOnLoad((Object)(object)TaskManagerObject);
			TaskManagerObject.transform.parent = ((Component)this).transform;
			TaskManagerObject.AddComponent<TaskManager>();
			Assembly executingAssembly = Assembly.GetExecutingAssembly();
			((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: UltraEvents, VersionString: 1.0.0 is loading...");
			Harmony.PatchAll();
			unlitShader = Addressables.LoadAssetAsync<Shader>((object)"Assets/Shaders/Main/ULTRAKILL-unlit.shader").WaitForCompletion();
			SceneManager.sceneLoaded += SceneManager_sceneLoaded;
		}

		private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues");
			if ((Object)(object)rot == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues 1");
				((MonoBehaviour)this).StartCoroutine(loadRod());
				((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues 1");
			}
			if (plushies.Count < plushieKeys.Length)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues 2");
				((MonoBehaviour)this).StartCoroutine(LoadPlushies());
			}
			if ((Object)(object)fishingCanvas == (Object)null)
			{
				((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues 3");
				((MonoBehaviour)this).StartCoroutine(LoadUI());
			}
			((BaseUnityPlugin)this).Logger.LogInfo((object)"no issues at all");
		}

		private IEnumerator LoadPlushies()
		{
			string[] array = plushieKeys;
			foreach (string key in array)
			{
				string prefabKey = "Assets/Prefabs/Items/DevPlushies/" + key + ".prefab";
				AsyncOperationHandle<GameObject> plushieHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
				yield return (object)new WaitUntil((Func<bool>)(() => plushieHandle.IsDone));
				GameObject plushie = plushieHandle.Result;
				plushies.Add(plushie);
			}
		}

		private IEnumerator loadRod()
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd");
			string prefabKey = "Assets/Prefabs/Fishing/Fishing Rod Weapon.prefab";
			((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd");
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd");
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd");
			if ((int)RodHandle.Status == 1 && (Object)(object)RodHandle.Result != (Object)null)
			{
				rot = RodHandle.Result;
				yield break;
			}
			ManualLogSource logger = ((BaseUnityPlugin)this).Logger;
			AsyncOperationStatus status = RodHandle.Status;
			logger.LogError((object)("Failed to load fishing rod: " + ((object)(AsyncOperationStatus)(ref status)).ToString()));
		}

		private IEnumerator LoadUI()
		{
			string prefabKey = "Assets/Prefabs/UI/FishingCanvas.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			fishingCanvas = RodHandle.Result;
		}

		private void RemoveEffect()
		{
			if (rmeoveEffects.Value)
			{
				Effect component = EffectManager.GetComponent<Effect>();
				if ((Object)(object)component != (Object)null)
				{
					component.RemoveEffect();
					Object.Destroy((Object)(object)component);
				}
			}
		}

		public static bool IsGameplayScene()
		{
			string[] source = new string[6] { "Intro", "Bootstrap", "Main Menu", "Level 2-S", "Intermission1", "Intermission2" };
			return !source.Contains(SceneHelper.CurrentScene);
		}

		public void CreateJsonFolder()
		{
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "JSONFiles");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			else if (Directory.GetFiles(text).Length != 0)
			{
				Console.WriteLine("Video folder already exists and is not empty.");
				return;
			}
			string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
			string[] array = manifestResourceNames;
			foreach (string text2 in array)
			{
				if (!text2.EndsWith(".json"))
				{
					continue;
				}
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(text2);
				string path = Path.Combine(text, Path.GetFileName(text2));
				using FileStream destination = File.Create(path);
				stream.CopyTo(destination);
			}
			Console.WriteLine("Jsons copied to the folder successfully.");
		}

		public void CreateVideoFolder()
		{
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Videos");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			else if (Directory.GetFiles(text).Length != 0)
			{
				Console.WriteLine("Video folder already exists and is not empty.");
				return;
			}
			string[] manifestResourceNames = Assembly.GetExecutingAssembly().GetManifestResourceNames();
			string[] array = manifestResourceNames;
			foreach (string text2 in array)
			{
				if (!text2.EndsWith(".mp4"))
				{
					continue;
				}
				using Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(text2);
				string path = Path.Combine(text, Path.GetFileName(text2));
				using FileStream destination = File.Create(path);
				stream.CopyTo(destination);
			}
			Console.WriteLine("Videos copied to the folder successfully.");
		}

		private Transform GetChildything(GameObject clonedThing)
		{
			Transform val = clonedThing.transform.Find("ZombieFilth");
			Transform val2 = val.Find("Armature.001");
			Transform val3 = val2.Find("Bone001");
			Transform val4 = val3.Find("Spine_01");
			return val4.Find("TheEnemyObject");
		}

		private void Update()
		{
			if (!((Object)(object)ModUtils.GetPlayerTransform() == (Object)null) && ((Behaviour)ModUtils.GetPlayerTransform()).enabled && IsGameplayScene() && everyFewSeconds.Value)
			{
				timer -= Time.fixedDeltaTime;
				if (timer <= 0f)
				{
					UseRandomEventAndRemoveEffects();
					timer = AmountOfTime.Value;
				}
			}
		}

		public void UseRandomEventAndRemoveEffects()
		{
			RemoveEffect();
			UseRandomEvent();
		}

		public void UseRandomEvent()
		{
			int num = Random.Range(0, 51);
			Dictionary<int, ConfigEntry<bool>> dictionary = new Dictionary<int, ConfigEntry<bool>>
			{
				{ 0, YEETEvent },
				{ 1, TPEnemiesEvent },
				{ 2, RemoveWeaponEvent },
				{ 3, usePreviousWeaponEvent },
				{ 4, KaboomEvent },
				{ 5, DupeEnemyEvent },
				{ 6, BuffEnemyEvent },
				{ 7, giveRandomWeaponEvent },
				{ 8, ReverseGravityEvent },
				{ 9, KillRandomEnemyEvent },
				{ 10, KillAllEnemyEvent },
				{ 11, UseRandomInputEvent },
				{ 12, RemoveRandomObjectEvent },
				{ 13, AddRBRandomObjectEvent },
				{ 14, SpawnItemEvent },
				{ 15, SlowMotionEvent },
				{ 16, GiveDualWieldEvent },
				{ 17, SpawnRandomEnemyEvent },
				{ 18, LagEvent },
				{ 19, BlessthemAllEvent },
				{ 20, waerEvent },
				{ 21, noHealsEvent },
				{ 22, GetRodEvent },
				{ 23, TurnEnemyIntoPuppetEvent },
				{ 24, MoreTroubleEvent },
				{ 25, TeleportToEnemyEvent },
				{ 26, SwapPosEvent },
				{ 27, FastMotionEvent },
				{ 28, SwitchArmEvent },
				{ 29, RemoveStyleEvent },
				{ 30, DiesEvent },
				{ 31, FakeParryEvent },
				{ 32, SpawnAdEvent },
				{ 33, LoadCatEvent },
				{ 34, AlakablamEvent },
				{ 35, AirStrikeEvent },
				{ 36, DupeAllEnemyEvent },
				{ 37, RemoveStaminaEvent },
				{ 38, RemoveChargeEvent },
				{ 39, OpenRandomLaLinkEvent },
				{ 40, RemoveRandomObjectsEvent },
				{ 41, PixelizeScreenEvent },
				{ 42, AddRBRandomObjectsEvent },
				{ 43, GetTaskEvent },
				{ 44, MakeEnemyOutOfSomethingEvent },
				{ 45, InvisibleEnemiesEvent },
				{ 46, SchizophreniaUpdateEvent },
				{ 47, BulletsExplodeNowEvent },
				{ 48, BulletsAfraidEnemiesEvent },
				{ 49, ReadEvent },
				{ 50, VirtualInsanityEvent }
			};
			if (!dictionary.Any((KeyValuePair<int, ConfigEntry<bool>> pair) => pair.Value.Value))
			{
				return;
			}
			if (dictionary.ContainsKey(num) && dictionary[num].Value)
			{
				switch (num)
				{
				case 0:
					YEET();
					break;
				case 1:
					TPEnemies();
					break;
				case 2:
					RemoveWeapon();
					break;
				case 3:
					usePreviousWeapon();
					break;
				case 4:
					Kaboom();
					break;
				case 5:
					DupeEnemy();
					break;
				case 6:
					BuffEnemy();
					break;
				case 7:
					giveRandomWeapon();
					break;
				case 8:
					ReverseGravity();
					break;
				case 9:
					KillRandomEnemy();
					break;
				case 10:
					KillAllEnemy();
					break;
				case 11:
					UseRandomInput();
					break;
				case 12:
					RemoveRandomObject();
					break;
				case 13:
					AddRBRandomObject();
					break;
				case 14:
					SpawnItem();
					break;
				case 15:
					SlowMotion();
					break;
				case 16:
					GiveDualWield();
					break;
				case 17:
					SpawnRandomEnemy();
					break;
				case 18:
					Lag();
					break;
				case 19:
					BlessthemAll();
					break;
				case 20:
					waer();
					break;
				case 21:
					noHeals();
					break;
				case 22:
					GetRod();
					break;
				case 23:
					TurnEnemyIntoPuppet();
					break;
				case 24:
					MoreTrouble();
					break;
				case 25:
					TeleportToEnemy();
					break;
				case 26:
					SwapPos();
					break;
				case 27:
					FastMotion();
					break;
				case 28:
					SwitchArm();
					break;
				case 29:
					RemoveStyle();
					break;
				case 30:
					Dies();
					break;
				case 31:
					FakeParry();
					break;
				case 32:
					SpawnAd();
					break;
				case 33:
					LoadCat();
					break;
				case 34:
					Alakablam();
					break;
				case 35:
					AirStrike();
					break;
				case 36:
					DupeAllEnemy();
					break;
				case 37:
					RemoveStamina();
					break;
				case 38:
					RemoveCharge();
					break;
				case 39:
					OpenRandomLaLink();
					break;
				case 40:
					RemoveRandomObjects();
					break;
				case 41:
					PixelizeScreen();
					break;
				case 42:
					AddRBRandomObjects();
					break;
				case 43:
					GiveTask();
					break;
				case 44:
					makeEnemyOutOfSomething();
					break;
				case 45:
					InvisibleEnemies();
					break;
				case 46:
					SchizophreniaUpdate();
					break;
				case 47:
					BulletsExplodeNow();
					break;
				case 48:
					BulletsAfraidNow();
					break;
				case 49:
					ReadLol();
					break;
				case 50:
					VirtualInsanity();
					break;
				}
			}
			else
			{
				UseRandomEvent();
			}
		}

		private void AnnounceEvent(string message)
		{
			if (announceEvents.Value)
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage(message, "", "", 0, false);
			}
		}

		private void VirtualInsanity()
		{
			EffectManager.AddComponent<VirtualInsanityEffect>();
			AnnounceEvent("virtual insanity");
		}

		private void ReadLol()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("red");
			ItemIdentifier val2 = val.AddComponent<ItemIdentifier>();
			val2.pickUpSound = new GameObject();
			val2.itemType = (ItemType)4;
			val.AddComponent<Rigidbody>();
			val.AddComponent<CheckForScroller>();
			Readable obj = val.AddComponent<Readable>();
			Type typeFromHandle = typeof(Readable);
			FieldInfo field = typeFromHandle.GetField("content", BindingFlags.Instance | BindingFlags.NonPublic);
			if (field != null)
			{
				FieldInfo field2 = typeFromHandle.GetField("instantScan", BindingFlags.Instance | BindingFlags.NonPublic);
				if (field2 != null)
				{
					field2.SetValue(obj, true);
					List<string> list = new List<string> { "You like reading, right?", "Reading is fun!", "Books are cool!", "Are you a bookworm?", "Reading expands the mind.", "What's your favorite book genre?", "Reading is a great way to learn.", "Books take you on adventures." };
					field.SetValue(obj, list[Random.Range(0, list.Count)]);
					MonoSingleton<PlayerUtilities>.Instance.ForceHoldObject(val2);
				}
			}
		}

		private void BulletsAfraidNow()
		{
			EffectManager.AddComponent<BulletsAfraidEnemies>();
			AnnounceEvent("Bullets are afraid of enemies now");
		}

		private void BulletsExplodeNow()
		{
			EffectManager.AddComponent<ExplodingBulletsEffect>();
			AnnounceEvent("Bullets now explode");
		}

		private void SchizophreniaUpdate()
		{
			EffectManager.AddComponent<sSchizophreniaUpdateEffect>();
		}

		private void InvisibleEnemies()
		{
			EffectManager.AddComponent<InvisEnemies>();
			AnnounceEvent("Enemies are now invisible");
		}

		private void makeEnemyOutOfSomething()
		{
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_011b: 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_015b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
				list.RemoveAll((MeshRenderer x) => ((Object)x).name.Contains("Bloodstain"));
				GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject;
				List<SpawnableObject> list2 = Resources.FindObjectsOfTypeAll<SpawnableObject>().ToList();
				list2.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1);
				SpawnableObject val = list2[Random.Range(0, list2.Count)];
				GameObject val2 = Object.Instantiate<GameObject>(val.gameObject, gameObject.transform.position, val.gameObject.transform.rotation);
				Renderer[] componentsInChildren = ((Component)val2.transform).GetComponentsInChildren<Renderer>();
				foreach (Renderer val3 in componentsInChildren)
				{
					val3.enabled = false;
				}
				if ((Object)(object)val2.GetComponent<Renderer>() != (Object)null)
				{
					val2.GetComponent<Renderer>().enabled = false;
				}
				val2.transform.position = gameObject.transform.position;
				Transform transform = val2.transform;
				gameObject.transform.position = ((Component)transform).transform.position;
				gameObject.transform.parent = transform;
				gameObject.transform.localPosition = Vector3.zero;
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<Collider>()))
				{
					gameObject.GetComponent<Collider>().enabled = false;
				}
				if (Object.op_Implicit((Object)(object)gameObject.GetComponent<Rigidbody>()))
				{
					Object.Destroy((Object)(object)gameObject.GetComponent<Rigidbody>());
				}
				gameObject.transform.rotation = ((Component)transform).transform.rotation;
				gameObject.transform.localRotation = Quaternion.identity;
				gameObject.gameObject.transform.localPosition = Vector3.zero;
				Collider[] componentsInChildren2 = ((Component)gameObject.transform).GetComponentsInChildren<Collider>();
				foreach (Collider val4 in componentsInChildren2)
				{
					val4.enabled = false;
				}
				val2.GetComponent<EnemyIdentifier>().spawnIn = false;
				AnnounceEvent(((Object)gameObject).name + " hates you now");
			}
			catch (Exception ex)
			{
				AnnounceEvent(ex.Message);
			}
		}

		private void GiveTask()
		{
			switch (Random.Range(0, 2))
			{
			case 0:
			{
				Task task = TaskManager.Instance.Tasker.AddComponent<KillEnemyTask>();
				TaskManager.Instance.AddTask(task);
				break;
			}
			case 1:
			{
				Task task = TaskManager.Instance.Tasker.AddComponent<TestTask>();
				TaskManager.Instance.AddTask(task);
				break;
			}
			}
		}

		private void AddRBRandomObjects()
		{
			List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
			int value = maxAmountOfDeletedOjects.Value;
			int num = Random.Range(1, Mathf.Min(list.Count, value) + 1);
			list = list.Where(delegate(MeshRenderer obj)
			{
				//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)
				Scene sceneAt = SceneManager.GetSceneAt(0);
				return !((Scene)(ref sceneAt)).GetRootGameObjects().Contains(((Component)obj).gameObject);
			}).ToList();
			for (int i = 0; i < num; i++)
			{
				if (list.Count <= 0)
				{
					break;
				}
				GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject;
				gameObject.AddComponent<Rigidbody>();
			}
			AnnounceEvent(num + " objects have discovered gravity");
		}

		private void PixelizeScreen()
		{
			EffectManager.AddComponent<PixelReducer>();
			AnnounceEvent("go go gadget pixel reducer!");
		}

		private void RemoveRandomObjects()
		{
			List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
			int value = maxAmountOfDeletedOjects.Value;
			int num = Random.Range(1, Mathf.Min(list.Count, value) + 1);
			list = list.Where(delegate(MeshRenderer obj)
			{
				//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)
				Scene sceneAt = SceneManager.GetSceneAt(0);
				return !((Scene)(ref sceneAt)).GetRootGameObjects().Contains(((Component)obj).gameObject);
			}).ToList();
			for (int i = 0; i < num; i++)
			{
				if (list.Count <= 0)
				{
					break;
				}
				GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject;
				MeshRenderer component = gameObject.GetComponent<MeshRenderer>();
				Object.Destroy((Object)(object)gameObject);
				list.Remove(component);
			}
			AnnounceEvent("i removed " + num + " objects");
		}

		private void OpenRandomLaLink()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string text = Path.Combine(directoryName, "JSONFiles");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			if (!Directory.Exists(text))
			{
				Debug.LogError((object)("Folder path does not exist: " + text));
				return;
			}
			string[] files = Directory.GetFiles(text, "*.json");
			if (files.Length == 0)
			{
				CreateJsonFolder();
				return;
			}
			string text2 = File.ReadAllText(text + "/" + jsonFilePath);
			links = JsonConvert.DeserializeObject<List<LinkData>>(text2);
			OpenRandomLink();
		}

		private void OpenRandomLink()
		{
			if (links.Count > 0)
			{
				LinkData linkData = links[Random.Range(0, links.Count)];
				Application.OpenURL(linkData.link);
			}
			else
			{
				Debug.LogWarning((object)"No links found in the JSON file.");
			}
		}

		private void RemoveCharge()
		{
			AnnounceEvent("no charge?");
			MonoSingleton<WeaponCharges>.Instance.raicharge = 0f;
		}

		private void RemoveStamina()
		{
			AnnounceEvent("no stamina?");
			ModUtils.GetPlayerTransform().EmptyStamina();
		}

		private void DupeAllEnemy()
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("ever heard of mitosis?");
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			foreach (EnemyIdentifier item in list)
			{
				EnemyIdentifier val = Object.Instantiate<EnemyIdentifier>(item, ((Component)item).transform.position, ((Component)item).transform.rotation);
				((Component)val).transform.localScale = ((Component)item).transform.localScale;
			}
		}

		private void AirStrike()
		{
			//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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Expected O, but got Unknown
			AnnounceEvent("By the magic of the angels. I cast thee away");
			VirtueInsignia val = Resources.FindObjectsOfTypeAll<VirtueInsignia>()[0];
			NewMovement playerTransform = ModUtils.GetPlayerTransform();
			VirtueInsignia val2 = Object.Instantiate<VirtueInsignia>(val, ((Component)playerTransform).transform.position, Quaternion.identity);
			EnemyTarget target = new EnemyTarget(((Component)playerTransform).transform);
			val2.target = target;
		}

		private void Alakablam()
		{
			//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)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Expected O, but got Unknown
			AnnounceEvent("Alakablam");
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			VirtueInsignia val = Resources.FindObjectsOfTypeAll<VirtueInsignia>()[0];
			foreach (EnemyIdentifier item in list)
			{
				VirtueInsignia val2 = Object.Instantiate<VirtueInsignia>(val, ((Component)item).transform.position, Quaternion.identity);
				val2.windUpSpeedMultiplier = 5f;
				EnemyTarget target = new EnemyTarget(item);
				val2.target = target;
			}
		}

		private void LoadCat()
		{
			//IL_0024: 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: Expected O, but got Unknown
			AnnounceEvent("Spawn cat");
			GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
			val.transform.position = ((Component)ModUtils.GetPlayerTransform()).transform.position;
			val.AddComponent<Rigidbody>();
			catRenderer = val.GetComponent<Renderer>();
			Material material = new Material(unlitShader);
			catRenderer.material = material;
			((MonoBehaviour)this).StartCoroutine(LoadCatImage());
		}

		private IEnumerator LoadCatImage()
		{
			UnityWebRequest www = UnityWebRequest.Get(apiUrl);
			try
			{
				yield return www.SendWebRequest();
				if (www.isNetworkError || www.isHttpError)
				{
					Debug.LogError((object)("Failed to fetch cat image: " + www.error));
					yield break;
				}
				string jsonResponse = www.downloadHandler.text;
				((BaseUnityPlugin)this).Logger.LogInfo((object)jsonResponse);
				List<Root> images = JsonConvert.DeserializeObject<List<Root>>(jsonResponse);
				if (images != null && images.Count > 0)
				{
					string imageUrl = images[0].url;
					((MonoBehaviour)this).StartCoroutine(LoadImageTexture(imageUrl));
				}
				else
				{
					Debug.LogError((object)"No cat images found in the API response.");
				}
			}
			finally
			{
				((IDisposable)www)?.Dispose();
			}
		}

		private IEnumerator LoadImageTexture(string url)
		{
			UnityWebRequest www = UnityWebRequestTexture.GetTexture(url);
			try
			{
				yield return www.SendWebRequest();
				if (www.isNetworkError || www.isHttpError)
				{
					Debug.LogError((object)("Failed to fetch cat image texture: " + www.error));
					yield break;
				}
				Texture2D texture = DownloadHandlerTexture.GetContent(www);
				if ((Object)(object)texture != (Object)null)
				{
					catRenderer.material.mainTexture = (Texture)(object)texture;
					catRenderer.material.SetTexture("_MainTex", (Texture)(object)texture);
					float width = ((Texture)texture).width;
					float height = ((Texture)texture).height;
					float scaleFactor = 0.01f;
					((Component)catRenderer).gameObject.transform.localScale = new Vector3(width * scaleFactor, height * scaleFactor, 1f);
				}
				else
				{
					Debug.LogError((object)"Failed to load cat image texture.");
				}
			}
			finally
			{
				((IDisposable)www)?.Dispose();
			}
		}

		private void SpawnAd()
		{
			string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			string text = Path.Combine(directoryName, "Videos");
			if (!Directory.Exists(text))
			{
				Directory.CreateDirectory(text);
			}
			if (!Directory.Exists(text))
			{
				Debug.LogError((object)("Folder path does not exist: " + text));
				return;
			}
			string[] files = Directory.GetFiles(text, "*.mp4");
			LoadRandomVideo(files, text);
		}

		private void LoadRandomVideo(string[] videoFiles, string folderPath)
		{
			if (videoFiles.Length == 0)
			{
				Debug.LogError((object)("No mp4 files found in folder: " + folderPath));
				CreateVideoFolder();
				return;
			}
			string path = videoFiles[Random.Range(0, videoFiles.Length)];
			List<Canvas> source = ((Component)((Component)ModUtils.GetPlayerTransform()).transform).GetComponentsInChildren<Canvas>().ToList();
			Canvas canvas = source.First((Canvas x) => ((Object)x).name.ToLower() == "finishcanvas");
			LoadVideo(path, canvas);
		}

		private void LoadVideo(string path, Canvas canvas)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Expected O, but got Unknown
			//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_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_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0168: Unknown result type (might be due to invalid IL or missing references)
			//IL_017f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_0195: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Expected O, but got Unknown
			GameObject videoDisplayObject = new GameObject("VideoDisplay");
			videoDisplayObject.transform.SetParent(((Component)canvas).transform, false);
			RawImage val = videoDisplayObject.AddComponent<RawImage>();
			RectTransform component = ((Component)val).GetComponent<RectTransform>();
			Rect val2 = canvas.pixelRect;
			float width = ((Rect)(ref val2)).width;
			val2 = canvas.pixelRect;
			component.sizeDelta = new Vector2(width, ((Rect)(ref val2)).height);
			GameObject val3 = new GameObject("VideoPlayer");
			VideoPlayer val4 = val3.AddComponent<VideoPlayer>();
			val4.url = path;
			val2 = component.rect;
			int num = (int)((Rect)(ref val2)).width;
			val2 = component.rect;
			val4.targetTexture = new RenderTexture(num, (int)((Rect)(ref val2)).height, 0);
			val.texture = (Texture)(object)val4.targetTexture;
			val4.renderMode = (VideoRenderMode)2;
			val2 = canvas.pixelRect;
			float width2 = ((Rect)(ref val2)).width;
			val2 = canvas.pixelRect;
			float num2 = Mathf.Min(width2, ((Rect)(ref val2)).height);
			Debug.Log((object)"e");
			float num3 = Random.Range(100f, num2);
			float num4 = Random.Range(100f, num2);
			Debug.Log((object)"e");
			if (num4 > num2)
			{
				num4 = num2;
				num3 = num4;
			}
			Debug.Log((object)"e");
			val2 = canvas.pixelRect;
			float num5 = (0f - ((Rect)(ref val2)).width) / 2f;
			val2 = canvas.pixelRect;
			float num6 = Random.Range(num5, ((Rect)(ref val2)).width / 2f);
			val2 = canvas.pixelRect;
			float num7 = (0f - ((Rect)(ref val2)).height) / 2f;
			val2 = canvas.pixelRect;
			float num8 = Random.Range(num7, ((Rect)(ref val2)).height / 2f);
			component.sizeDelta = new Vector2(num3, num4);
			Debug.Log((object)"e");
			component.anchoredPosition = new Vector2(num6, num8);
			Debug.Log((object)"e");
			val4.loopPointReached += (EventHandler)delegate
			{
				OnVideoFinished(videoDisplayObject);
			};
			Debug.Log((object)"e");
			val4.Play();
			Debug.Log((object)"e");
		}

		private void OnVideoFinished(GameObject videoDisplayObject)
		{
			Object.Destroy((Object)(object)videoDisplayObject);
		}

		private void FakeParry()
		{
			MonoSingleton<TimeController>.Instance.ParryFlash();
		}

		private void Dies()
		{
			AnnounceEvent("DIE");
			ModUtils.GetPlayerTransform().GetHurt(int.MaxValue, false, 1f, false, false, 0.35f, false);
		}

		private void RemoveStyle()
		{
			AnnounceEvent("im gonna take some style points real quick");
			int num = Random.Range(0, MonoSingleton<StatsManager>.Instance.stylePoints);
			StatsManager instance = MonoSingleton<StatsManager>.Instance;
			instance.stylePoints -= num;
		}

		private void SwitchArm()
		{
			FistControl val = Object.FindObjectOfType<FistControl>();
			val.ScrollArm();
		}

		private void SwapPos()
		{
			List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
			GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject;
			GameObject gameObject2 = ((Component)list[Random.Range(0, list.Count)]).gameObject;
			((MonoBehaviour)this).StartCoroutine(SwapCoroutine(gameObject, gameObject2, AmountOfTime.Value));
			AnnounceEvent(((Object)gameObject).name + " and " + ((Object)gameObject2).name + " swapped places");
		}

		private IEnumerator SwapCoroutine(GameObject object1, GameObject object2, float swapDuration)
		{
			Vector3 startPos1 = object1.transform.position;
			Vector3 startPos2 = object2.transform.position;
			float timeElapsed = 0f;
			while (timeElapsed < swapDuration)
			{
				float t = timeElapsed / swapDuration;
				object1.transform.position = Vector3.Lerp(startPos1, startPos2, t);
				object2.transform.position = Vector3.Lerp(startPos2, startPos1, t);
				timeElapsed += Time.deltaTime;
				yield return null;
			}
			object1.transform.position = startPos2;
			object2.transform.position = startPos1;
		}

		private void TeleportToEnemy()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			EnemyIdentifier val = list[Random.Range(0, list.Count)];
			((Component)ModUtils.GetPlayerTransform()).transform.position = ((Component)val).transform.position;
			AnnounceEvent("teleports behind " + ((Object)((Component)val).gameObject).name);
		}

		private void MoreTrouble()
		{
			((MonoBehaviour)this).StopCoroutine("overTimeEvents");
			AnnounceEvent("prepare for trouble. And make it double!");
			((MonoBehaviour)this).StartCoroutine(overTimeEvents(2));
		}

		private IEnumerator overTimeEvents(int amount)
		{
			yield return (object)new WaitForSeconds(1.5f);
			for (int i = 0; i < amount; i++)
			{
				UseRandomEvent();
				yield return (object)new WaitForSeconds(0.5f);
			}
			timer = AmountOfTime.Value;
		}

		private void TurnEnemyIntoPuppet()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			EnemyIdentifier val = list[Random.Range(0, list.Count)];
			val.puppet = true;
			val.PuppetSpawn();
			val.dontCountAsKills = false;
			AnnounceEvent(((Object)((Component)val).gameObject).name + " is now a puppet");
		}

		private void GetRod()
		{
			//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)
			try
			{
				AnnounceEvent("its fishing time");
				if ((Object)(object)Object.FindObjectOfType<FishingHUD>() == (Object)null)
				{
					Object.Instantiate<GameObject>(fishingCanvas, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
				}
				GunSetter gs = Object.FindObjectOfType<GunSetter>();
				ModUtils.AttachWeapon(1, "", rot, gs);
			}
			catch (Exception ex)
			{
				AnnounceEvent(ex.Message);
			}
		}

		private void noHeals()
		{
			AnnounceEvent("no heals?");
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			foreach (EnemyIdentifier item in list)
			{
				item.Sandify(false);
			}
		}

		private void waer()
		{
			AnnounceEvent("hello how are you? i am under the water");
			EffectManager.AddComponent<aboohwaer>();
		}

		private void BlessthemAll()
		{
			AnnounceEvent("enemies now are protected by god");
			EffectManager.AddComponent<BlessAll>();
		}

		private void Lag()
		{
			AnnounceEvent("your ping is so high");
			EffectManager.AddComponent<Lagging>();
		}

		private void SpawnRandomEnemy()
		{
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			List<SpawnableObject> list = Resources.FindObjectsOfTypeAll<SpawnableObject>().ToList();
			list.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1);
			SpawnableObject val = list[Random.Range(0, list.Count)];
			Object.Instantiate<GameObject>(val.gameObject, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
			AnnounceEvent("spawned " + val.objectName);
		}

		private void GiveDualWield()
		{
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Invalid comparison between Unknown and I4
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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_016f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("its dual wielding time!!! *dual wields all over the place*");
			int num = Random.Range(1, 10);
			for (int i = 0; i < num; i++)
			{
				if (Object.op_Implicit((Object)(object)MonoSingleton<GunControl>.Instance))
				{
					MonoSingleton<CameraController>.Instance.CameraShake(0.35f);
					if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1)
					{
						MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(3);
						break;
					}
					GameObject val = new GameObject();
					val.transform.SetParent(((Component)MonoSingleton<GunControl>.Instance).transform, true);
					val.transform.localRotation = Quaternion.identity;
					DualWield[] componentsInChildren = ((Component)MonoSingleton<GunControl>.Instance).GetComponentsInChildren<DualWield>();
					if (componentsInChildren != null && componentsInChildren.Length % 2 == 0)
					{
						val.transform.localScale = new Vector3(-1f, 1f, 1f);
					}
					else
					{
						val.transform.localScale = Vector3.one;
					}
					if (componentsInChildren == null || componentsInChildren.Length == 0)
					{
						val.transform.localPosition = Vector3.zero;
					}
					else if (componentsInChildren.Length % 2 == 0)
					{
						val.transform.localPosition = new Vector3((float)(componentsInChildren.Length / 2) * -1.5f, 0f, 0f);
					}
					else
					{
						val.transform.localPosition = new Vector3((float)((componentsInChildren.Length + 1) / 2) * 1.5f, 0f, 0f);
					}
					DualWield val2 = val.AddComponent<DualWield>();
					val2.delay = 0.05f;
					val2.juiceAmount = 30f;
					if (componentsInChildren != null && componentsInChildren.Length != 0)
					{
						val2.delay += (float)componentsInChildren.Length / 20f;
					}
				}
			}
		}

		private void SlowMotion()
		{
			AnnounceEvent("wow this is slow");
			EffectManager.AddComponent<Slowmotion>();
		}

		private void FastMotion()
		{
			AnnounceEvent("wow this is Fast");
			EffectManager.AddComponent<Fastmotion>();
		}

		private void SpawnItem()
		{
			AnnounceEvent("Plush rain!!!!");
			EffectManager.AddComponent<PlushRain>();
		}

		private void AddRBRandomObject()
		{
			List<GameObject> list = Object.FindObjectsOfType<GameObject>().ToList();
			GameObject val = list[Random.Range(0, list.Count)];
			AnnounceEvent(((Object)val).name + " discovered gravity");
			val.AddComponent<Rigidbody>();
		}

		private void RemoveRandomObject()
		{
			List<GameObject> list = Object.FindObjectsOfType<GameObject>().ToList();
			GameObject val = list[Random.Range(0, list.Count)];
			AnnounceEvent("i removed something");
			Object.Destroy((Object)(object)val);
		}

		private void UseRandomInput()
		{
			AnnounceEvent("gonna fire your gun");
			GunControl val = Object.FindObjectOfType<GunControl>();
			GameObject currentWeapon = val.currentWeapon;
			if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent<Revolver>()))
			{
				Revolver component = currentWeapon.GetComponent<Revolver>();
				Type typeFromHandle = typeof(Revolver);
				MethodInfo method = typeFromHandle.GetMethod("Shoot", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method != null)
				{
					int num = Random.Range(1, 3);
					method.Invoke(component, new object[1] { num });
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Shoot method not found.");
				}
			}
			else if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent<Shotgun>()))
			{
				Shotgun component2 = currentWeapon.GetComponent<Shotgun>();
				Type typeFromHandle2 = typeof(Shotgun);
				MethodInfo method2 = typeFromHandle2.GetMethod("Shoot", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method2 != null)
				{
					method2.Invoke(component2, null);
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Shoot method not found.");
				}
			}
			else if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent<Nailgun>()))
			{
				Nailgun component3 = currentWeapon.GetComponent<Nailgun>();
				Type typeFromHandle3 = typeof(Nailgun);
				MethodInfo method3 = typeFromHandle3.GetMethod("Shoot", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method3 != null)
				{
					method3.Invoke(component3, null);
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Shoot method not found.");
				}
			}
			else if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent<RocketLauncher>()))
			{
				RocketLauncher component4 = currentWeapon.GetComponent<RocketLauncher>();
				Type typeFromHandle4 = typeof(RocketLauncher);
				MethodInfo method4 = typeFromHandle4.GetMethod("Shoot", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method4 != null)
				{
					method4.Invoke(component4, null);
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Shoot method not found.");
				}
			}
			else if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent<Railcannon>()))
			{
				Railcannon component5 = currentWeapon.GetComponent<Railcannon>();
				Type typeFromHandle5 = typeof(Railcannon);
				MethodInfo method5 = typeFromHandle5.GetMethod("Shoot", BindingFlags.Instance | BindingFlags.NonPublic);
				if (method5 != null)
				{
					method5.Invoke(component5, null);
				}
				else
				{
					((BaseUnityPlugin)this).Logger.LogInfo((object)"Shoot method not found.");
				}
			}
		}

		private void ReverseGravity()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Physics.gravity *= -1f;
			if (Physics.gravity.y > 0f)
			{
				AnnounceEvent("Why is my apple falling upwards");
			}
			else
			{
				AnnounceEvent("Why is my apple falling downwards");
			}
		}

		private void KillRandomEnemy()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			EnemyIdentifier val = list[Random.Range(0, list.Count)];
			AnnounceEvent("fuck you in particular " + ((Object)((Component)val).gameObject).name);
			val.InstaKill();
		}

		private void KillAllEnemy()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			foreach (EnemyIdentifier item in list)
			{
				item.InstaKill();
			}
			AnnounceEvent("DIE EVERYONE!");
		}

		private void giveRandomWeapon()
		{
			AnnounceEvent("Here let me choose for you");
			GunControl val = Object.FindObjectOfType<GunControl>();
			int num = Random.Range(0, val.slots.Count);
			val.SwitchWeapon(num, val.slots[num - 1], true, false, false);
		}

		private void BuffEnemy()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			EnemyIdentifier val = list[Random.Range(0, list.Count)];
			val.BuffAll();
			AnnounceEvent("\"will you lose?\" \"nah id win\" -" + ((Object)((Component)val).gameObject).name);
		}

		private void DupeEnemy()
		{
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.dead);
			EnemyIdentifier val = list[Random.Range(0, list.Count)];
			EnemyIdentifier val2 = Object.Instantiate<EnemyIdentifier>(val, ((Component)val).transform.position, ((Component)val).transform.rotation);
			((Component)val2).transform.localScale = ((Component)val).transform.localScale;
			AnnounceEvent("i added another " + ((object)(EnemyType)(ref val.enemyType)).ToString());
		}

		private void Kaboom()
		{
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("KABOOOOOOM");
			EnemyIdentifier[] array = Object.FindObjectsOfType<EnemyIdentifier>();
			List<ExplosionController> list = Resources.FindObjectsOfTypeAll<ExplosionController>().ToList();
			list.RemoveAll((ExplosionController x) => ((Object)((Component)x).gameObject).name.ToLower().Contains("fire"));
			EnemyIdentifier[] array2 = array;
			foreach (EnemyIdentifier val in array2)
			{
				ExplosionController val2 = list[Random.Range(0, list.Count)];
				Object.Instantiate<ExplosionController>(val2, ((Component)val).transform.position, Quaternion.identity);
			}
		}

		private void usePreviousWeapon()
		{
			AnnounceEvent("go back to the other weapon");
			GunControl val = Object.FindObjectOfType<GunControl>();
			val.SwitchWeapon(val.lastUsedSlot, val.slots[val.lastUsedSlot - 1], true, false, false);
		}

		private void RemoveWeapon()
		{
			AnnounceEvent("you dont need this right?");
			GunControl val = Object.FindObjectOfType<GunControl>();
			GameObject currentWeapon = val.currentWeapon;
			val.allWeapons.Remove(currentWeapon);
			val.slotDict.Remove(currentWeapon);
			Object.Destroy((Object)(object)currentWeapon);
		}

		private void TPEnemies()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("teleports behind you");
			EnemyIdentifier[] array = Object.FindObjectsOfType<EnemyIdentifier>();
			EnemyIdentifier[] array2 = array;
			foreach (EnemyIdentifier val in array2)
			{
				((Component)val).transform.position = ((Component)ModUtils.GetPlayerTransform()).transform.position;
			}
		}

		private void YEET()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("welcome to space :O");
			ModUtils.GetPlayerTransform().LaunchFromPoint(((Component)ModUtils.GetPlayerTransform()).transform.position, 50000000f, 1f);
		}
	}
}
namespace UltraEvents.Utils
{
	internal static class ModUtils
	{
		public static NewMovement GetPlayerTransform()
		{
			return MonoSingleton<NewMovement>.Instance;
		}

		public static void AttachWeapon(int tempSlot, string pPref, GameObject weapon, GunSetter gs)
		{
			bool flag = false;
			if (pPref != "")
			{
				flag = GameProgressSaver.CheckGear(pPref) != 0 && MonoSingleton<PrefsManager>.Instance.GetInt("weapon." + pPref, 0) != 0;
				if (!flag)
				{
					MonoSingleton<PrefsManager>.Instance.SetInt("weapon." + pPref, 1);
					if (!SceneHelper.IsPlayingCustom)
					{
						GameProgressSaver.AddGear(pPref);
					}
				}
			}
			MonoSingleton<GunControl>.Instance.noWeapons = false;
			if ((Object)(object)gs != (Object)null)
			{
				((Behaviour)gs).enabled = true;
				gs.ResetWeapons(false);
			}
			if (!flag)
			{
				for (int i = 0; i < MonoSingleton<GunControl>.Instance.slots[tempSlot].Count; i++)
				{
					if (((Object)MonoSingleton<GunControl>.Instance.slots[tempSlot][i]).name == ((Object)weapon).name + "(Clone)")
					{
						flag = true;
					}
				}
			}
			if (!flag)
			{
				GameObject item = Object.Instantiate<GameObject>(weapon, ((Component)MonoSingleton<GunControl>.Instance).transform);
				MonoSingleton<GunControl>.Instance.slots[tempSlot].Add(item);
				MonoSingleton<GunControl>.Instance.ForceWeapon(weapon, true);
				MonoSingleton<GunControl>.Instance.noWeapons = false;
				MonoSingleton<GunControl>.Instance.UpdateWeaponList(false);
			}
			else
			{
				if (!SceneHelper.IsPlayingCustom)
				{
					return;
				}
				for (int j = 0; j < MonoSingleton<GunControl>.Instance.slots[tempSlot].Count; j++)
				{
					if (((Object)MonoSingleton<GunControl>.Instance.slots[tempSlot][j]).name == ((Object)weapon).name + "(Clone)")
					{
						MonoSingleton<GunControl>.Instance.ForceWeapon(weapon, true);
						MonoSingleton<GunControl>.Instance.noWeapons = false;
						MonoSingleton<GunControl>.Instance.UpdateWeaponList(false);
					}
				}
			}
		}
	}
}
namespace UltraEvents.Patches
{
	[HarmonyPatch(typeof(Bonus), "OnTriggerEnter")]
	public class SecretPatch
	{
		[HarmonyPostfix]
		private static void post(ref bool ___activated, Collider other)
		{
			if (UltraEventsPlugin.OnSecretReceived.Value && ((Component)other).gameObject.CompareTag("Player") && !___activated)
			{
				UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects();
			}
		}
	}
	[HarmonyPatch(typeof(TimeController), "ParryFlash")]
	public class ParryPatch
	{
		public static void Postfix()
		{
			if (UltraEventsPlugin.OnParry.Value)
			{
				UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects();
			}
		}
	}
	[HarmonyPatch(typeof(EnemyIdentifier), "Death", new Type[] { })]
	public class EnemyDeathPatch
	{
		private static bool _isProcessing;

		public static void Postfix()
		{
			if (UltraEventsPlugin.OnEnemyDeath.Value)
			{
				UltraEventsPlugin.Log.LogInfo((object)_isProcessing);
				if (!_isProcessing)
				{
					((MonoBehaviour)UltraEventsPlugin.Instance).StartCoroutine(DelayedEvent());
				}
			}
		}

		private static IEnumerator DelayedEvent()
		{
			_isProcessing = true;
			yield return (object)new WaitForSecondsRealtime(0.1f);
			_isProcessing = false;
			UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects();
		}
	}
	[HarmonyPatch(typeof(NewMovement), "GetHurt")]
	public class HurtPlayerPatch
	{
		public static void Postfix()
		{
			if (UltraEventsPlugin.GetHurt.Value)
			{
				UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects();
			}
		}
	}
	[HarmonyPatch(typeof(StyleHUD), "AddPoints")]
	public class GetStylePatch
	{
		private static bool _isProcessing;

		public static void Postfix()
		{
			if (UltraEventsPlugin.GetStyle.Value)
			{
				UltraEventsPlugin.Log.LogInfo((object)_isProcessing);
				if (!_isProcessing)
				{
					((MonoBehaviour)UltraEventsPlugin.Instance).StartCoroutine(DelayedEvent());
				}
			}
		}

		private static IEnumerator DelayedEvent()
		{
			_isProcessing = true;
			yield return (object)new WaitForSecondsRealtime(0.1f);
			_isProcessing = false;
			UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects();
		}
	}
}
namespace UltraEvents.MonoBehaviours
{
	internal class BounceOffProjectiles : MonoBehaviour
	{
		private void Update()
		{
			//IL_0007: 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_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			RaycastHit[] array = Physics.SphereCastAll(((Component)this).transform.position, 10f, ((Component)this).transform.forward, 1f);
			if (array.Length == 0)
			{
				return;
			}
			RaycastHit[] array2 = array;
			for (int i = 0; i < array2.Length; i++)
			{
				RaycastHit val = array2[i];
				if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<Projectile>() != (Object)null && (Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null)
				{
					((RaycastHit)(ref val)).rigidbody.AddExplosionForce(50000f, ((Component)this).transform.position, 50f);
				}
				else if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<Magnet>() != (Object)null && (Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null)
				{
					((RaycastHit)(ref val)).rigidbody.AddExplosionForce(50000f, ((Component)this).transform.position, 50f);
				}
				else if ((Object)(object)((Component)((RaycastHit)(ref val)).collider).gameObject.GetComponent<Grenade>() != (Object)null && (Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null)
				{
					((RaycastHit)(ref val)).rigidbody.AddExplosionForce(50000f, ((Component)this).transform.position, 50f);
				}
			}
		}
	}
	public class Effect : MonoBehaviour
	{
		public virtual void RemoveEffect()
		{
		}
	}
	internal class MoveAndTurn : MonoBehaviour
	{
		private float moveSpeed = 0.5f;

		public float minAngle = 0f;

		public float maxAngle = 360f;

		private bool collided;

		public void Awake()
		{
			Rigidbody val = default(Rigidbody);
			if (((Component)this).gameObject.TryGetComponent<Rigidbody>(ref val))
			{
				val.constraints = (RigidbodyConstraints)126;
				if (((Component)this).gameObject.GetComponentsInChildren<MeshCollider>() != null || ((Component)this).gameObject.GetComponentsInChildren<MeshCollider>().Length != 0)
				{
					MeshCollider[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<MeshCollider>();
					MeshCollider[] array = componentsInChildren;
					foreach (MeshCollider val2 in array)
					{
						val2.convex = true;
					}
				}
			}
			else
			{
				val = ((Component)this).gameObject.AddComponent<Rigidbody>();
				val.constraints = (RigidbodyConstraints)126;
			}
		}

		public void FixedUpdate()
		{
			//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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			Vector3 forward = ((Component)this).transform.forward;
			forward.y = 0f;
			Transform transform = ((Component)this).transform;
			transform.position += forward * moveSpeed;
		}

		private void OnCollisionEnter(Collision collision)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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_0065: Unknown result type (might be due to invalid IL or missing references)
			if (!collided)
			{
				collided = true;
				float num = Random.Range(0f - maxAngle, maxAngle);
				Quaternion rotation = ((Component)this).transform.rotation;
				float z = ((Quaternion)(ref rotation)).eulerAngles.z;
				float num2 = Random.Range(0f - maxAngle, maxAngle);
				Quaternion rotation2 = Quaternion.Euler(num2, num, z);
				((Component)this).transform.rotation = rotation2;
			}
		}

		private void OnCollisionExit(Collision collision)
		{
			collided = false;
		}
	}
	internal class RemoveOnUnseen : MonoBehaviour
	{
		public GameObject theObject;

		public List<RemoveOnUnseen> unseens = new List<RemoveOnUnseen>();

		public bool TheisSeen = false;

		private void OnBecameInvisible()
		{
			Debug.Log((object)"hey im not here");
			bool flag = false;
			if (unseens != null || unseens.Count == 0)
			{
				TheisSeen = false;
				foreach (RemoveOnUnseen unseen in unseens)
				{
					flag = unseen.TheisSeen;
					if (flag)
					{
						break;
					}
				}
			}
			if (!flag)
			{
				if ((Object)(object)theObject == (Object)null)
				{
					Debug.LogWarning((object)"ruh roh raggy");
				}
				if ((Object)(object)theObject.GetComponent<EnemyIdentifier>() != (Object)null)
				{
					theObject.GetComponent<EnemyIdentifier>().InstaKill();
				}
				Object.Destroy((Object)(object)theObject);
			}
		}

		private void OnBecameVisible()
		{
			Debug.Log((object)"hey im here");
			TheisSeen = true;
		}
	}
	public abstract class Task : MonoBehaviour
	{
		private string _ToDo;

		public string WhatToDo;

		public float TimeToFinish = 5f;

		public virtual string ToDo
		{
			get
			{
				return _ToDo;
			}
			set
			{
				_ToDo = value;
			}
		}

		private void Awake()
		{
			WhatToDo = ToDo;
			((MonoBehaviour)this).Invoke("TheirAwake", 0.01f);
		}

		public virtual void TheirAwake()
		{
		}

		private void Update()
		{
			TimeToFinish -= Time.deltaTime;
			CheckIfWon();
			if (TimeToFinish <= 0f)
			{
				TimeRanOut();
			}
		}

		public virtual void CheckIfWon()
		{
		}

		public virtual void Won()
		{
			TaskManager.Instance.RemoveTask(this);
		}

		public virtual void TimeRanOut()
		{
			TaskManager.Instance.RemoveTask(this);
			MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Times up!!!!", "", "", 0, false);
		}
	}
	public class TaskManager : MonoBehaviour
	{
		public List<Task> tasks = new List<Task>();

		public GameObject Tasker;

		private GameObject tasksText;

		private TextMeshProUGUI text;

		public static TaskManager Instance { get; private set; }

		private void Awake()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			Instance = this;
			Tasker = new GameObject("tasker");
			Tasker.transform.parent = ((Component)this).transform;
			SceneManager.sceneLoaded += SceneManager_sceneLoaded;
		}

		private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
		{
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Expected O, but got Unknown
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			List<Canvas> source = Object.FindObjectsOfType<Canvas>().ToList();
			Canvas val = source.First((Canvas x) => ((Object)x).name.ToLower() == "canvas" && (Object)(object)((Component)x).GetComponent<HUDOptions>() != (Object)null);
			tasksText = new GameObject("tasksText");
			tasksText.transform.parent = ((Component)val).transform;
			tasksText.transform.localPosition = new Vector3(-527.5945f, 313f, 0f);
			tasksText.transform.localScale = Vector3.one;
			text = tasksText.AddComponent<TextMeshProUGUI>();
			((TMP_Text)text).alignment = (TextAlignmentOptions)513;
			((TMP_Text)text).text = "tasks:";
			((TMP_Text)text).fontSize = 63f;
			((TMP_Text)text).enableWordWrapping = false;
			tasksText.AddComponent<HudOpenEffect>();
			tasksText.SetActive(false);
		}

		public void AddTask(Task task)
		{
			TextMeshProUGUI obj = text;
			((TMP_Text)obj).text = ((TMP_Text)obj).text + "\n-" + task.ToDo;
			tasks.Add(task);
			tasksText.SetActive(true);
		}

		public void RemoveTask(Task task)
		{
			string text = ((TMP_Text)this.text).text;
			string whatToDo = task.WhatToDo;
			Debug.Log((object)whatToDo);
			string text2 = "\n-" + whatToDo;
			int num = text.IndexOf(text2);
			if (num != -1)
			{
				string text3 = text.Remove(num, text2.Length);
				((TMP_Text)this.text).text = text3;
				Debug.Log((object)("Modified Text: " + text3));
			}
			else
			{
				Debug.Log((object)"Pattern not found in the text.");
			}
			tasks.Remove(task);
			Object.Destroy((Object)(object)task);
			if (tasks.Count == 0)
			{
				tasksText.SetActive(false);
			}
		}

		public void ChangeToDo(string Prev, string New)
		{
			string text = ((TMP_Text)this.text).text;
			string text2 = "\n-" + Prev;
			int num = text.IndexOf(text2);
			if (num != -1)
			{
				string text3 = text.Substring(0, text.IndexOf(text2));
				string text4 = text.Substring(text.IndexOf(text2) + text2.Length);
				string text5 = text3 + "\n-" + New + text4;
				((TMP_Text)this.text).text = text5;
				Debug.Log((object)("Modified Text: " + text5));
			}
			else
			{
				Debug.Log((object)"Pattern not found in the text.");
			}
		}
	}
}
namespace UltraEvents.MonoBehaviours.Tasks
{
	public class KillEnemyTask : Task
	{
		private bool done = false;

		private int amount;

		public override string ToDo
		{
			get
			{
				return "Kill an enemy";
			}
			set
			{
				base.ToDo = value;
			}
		}

		public override void TheirAwake()
		{
			amount = MonoSingleton<StatsManager>.Instance.kills + 1;
			TimeToFinish = 15f;
			MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("you have 15 seconds to kill an enemy", "", "", 0, false);
			base.TheirAwake();
		}

		public override void CheckIfWon()
		{
			if (MonoSingleton<StatsManager>.Instance.kills >= amount)
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("YOU RECEIVE: EVERYONE DEAD", "", "", 0, false);
				foreach (EnemyIdentifier currentEnemy in MonoSingleton<EnemyTracker>.Instance.GetCurrentEnemies())
				{
					currentEnemy.InstaKill();
				}
				Won();
			}
			base.CheckIfWon();
		}

		public override void TimeRanOut()
		{
			//IL_0001: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			if (Physics.gravity.y < 0f)
			{
				Physics.gravity *= -1f;
			}
			else
			{
				List<SpawnableObject> list = Resources.FindObjectsOfTypeAll<SpawnableObject>().ToList();
				list.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1);
				SpawnableObject val = list[Random.Range(0, list.Count)];
				Object.Instantiate<GameObject>(val.gameObject, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
			}
			base.TimeRanOut();
		}
	}
	public class TestTask : Task
	{
		private bool done = false;

		private int amount;

		public override string ToDo
		{
			get
			{
				return "Get 50 Style";
			}
			set
			{
				base.ToDo = value;
			}
		}

		public override void TheirAwake()
		{
			amount = Random.Range(MonoSingleton<StatsManager>.Instance.stylePoints, MonoSingleton<StatsManager>.Instance.stylePoints + 1000);
			TaskManager.Instance.ChangeToDo("Get 50 Style", "Get " + amount + " style");
			WhatToDo = "Get " + amount + " style";
			TimeToFinish = 25f;
			MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("you have 25 seconds to get " + (amount - MonoSingleton<StatsManager>.Instance.stylePoints) + " style", "", "", 0, false);
			base.TheirAwake();
		}

		public override void CheckIfWon()
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Invalid comparison between Unknown and I4
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: Expected O, but got Unknown
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: 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_0175: Unknown result type (might be due to invalid IL or missing references)
			if (MonoSingleton<StatsManager>.Instance.stylePoints >= amount)
			{
				MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("YOU RECEIVE: DUAL WIELD", "", "", 0, false);
				int num = Random.Range(1, 15);
				for (int i = 0; i < num; i++)
				{
					if (Object.op_Implicit((Object)(object)MonoSingleton<GunControl>.Instance))
					{
						MonoSingleton<CameraController>.Instance.CameraShake(0.35f);
						if ((int)MonoSingleton<PlayerTracker>.Instance.playerType == 1)
						{
							MonoSingleton<PlatformerMovement>.Instance.AddExtraHit(3);
							return;
						}
						GameObject val = new GameObject();
						val.transform.SetParent(((Component)MonoSingleton<GunControl>.Instance).transform, true);
						val.transform.localRotation = Quaternion.identity;
						DualWield[] componentsInChildren = ((Component)MonoSingleton<GunControl>.Instance).GetComponentsInChildren<DualWield>();
						if (componentsInChildren != null && componentsInChildren.Length % 2 == 0)
						{
							val.transform.localScale = new Vector3(-1f, 1f, 1f);
						}
						else
						{
							val.transform.localScale = Vector3.one;
						}
						if (componentsInChildren == null || componentsInChildren.Length == 0)
						{
							val.transform.localPosition = Vector3.zero;
						}
						else if (componentsInChildren.Length % 2 == 0)
						{
							val.transform.localPosition = new Vector3((float)(componentsInChildren.Length / 2) * -1.5f, 0f, 0f);
						}
						else
						{
							val.transform.localPosition = new Vector3((float)((componentsInChildren.Length + 1) / 2) * 1.5f, 0f, 0f);
						}
						DualWield val2 = val.AddComponent<DualWield>();
						val2.delay = 0.05f;
						val2.juiceAmount = 30f;
						if (componentsInChildren != null && componentsInChildren.Length != 0)
						{
							val2.delay += (float)componentsInChildren.Length / 20f;
						}
					}
				}
				Won();
			}
			base.CheckIfWon();
		}

		public override void TimeRanOut()
		{
			ModUtils.GetPlayerTransform().GetHurt(int.MaxValue, false, 1f, false, false, 0.35f, false);
			base.TimeRanOut();
		}
	}
}
namespace UltraEvents.MonoBehaviours.Effects
{
	public class aboohwaer : Effect
	{
		private GameObject llewaer;

		private void Awake()
		{
			MakeWater();
		}

		public void MakeWater()
		{
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			llewaer = GameObject.CreatePrimitive((PrimitiveType)3);
			((Object)llewaer).name = "UT WATER!!!";
			llewaer.AddComponent<Rigidbody>();
			llewaer.GetComponent<Rigidbody>().isKinematic = true;
			llewaer.GetComponent<Collider>().isTrigger = true;
			llewaer.AddComponent<Water>();
			llewaer.GetComponent<Water>().bubblesParticle = new GameObject();
			llewaer.GetComponent<Water>().clr = new Color(0f, 0.5f, 1f);
			((Renderer)llewaer.GetComponent<MeshRenderer>()).enabled = false;
			llewaer.transform.localScale = Vector3.one * 1E+10f;
		}

		public override void RemoveEffect()
		{
			Object.Destroy((Object)(object)llewaer);
			base.RemoveEffect();
		}
	}
	public class BlessAll : Effect
	{
		private void Update()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => x.blessed);
			if (list.Count <= 0)
			{
				return;
			}
			foreach (EnemyIdentifier item in list)
			{
				item.Bless(false);
			}
		}

		public override void RemoveEffect()
		{
			List<EnemyIdentifier> list = Object.FindObjectsOfType<EnemyIdentifier>().ToList();
			list.RemoveAll((EnemyIdentifier x) => !x.blessed);
			if (list.Count > 0)
			{
				foreach (EnemyIdentifier item in list)
				{
					item.Unbless(false);
				}
			}
			base.RemoveEffect();
		}
	}
	public class BulletsAfraidEnemies : Effect
	{
		private List<EnemyIdentifier> enemiesIveDone = new List<EnemyIdentifier>();

		private void Update()
		{
			EnemyIdentifier[] array = Object.FindObjectsOfType<EnemyIdentifier>();
			EnemyIdentifier[] array2 = array;
			foreach (EnemyIdentifier val in array2)
			{
				if (!enemiesIveDone.Contains(val))
				{
					((Component)val).gameObject.AddComponent<BounceOffProjectiles>();
					enemiesIveDone.Add(val);
				}
			}
		}
	}
	internal class ExplodingBulletsEffect : Effect
	{
		private List<Projectile> projectilespo = new List<Projectile>();

		public void Update()
		{
			Projectile[] array = Object.FindObjectsOfType<Projectile>();
			Projectile[] array2 = array;
			foreach (Projectile val in array2)
			{
				if (!((Object)(object)val == (Object)null) && !projectilespo.Contains(val))
				{
					List<ExplosionController> list = Resources.FindObjectsOfTypeAll<ExplosionController>().ToList();
					list.RemoveAll((ExplosionController x) => ((Object)x).name.ToLower().Contains("fire"));
					ExplosionController val2 = list[Random.Range(0, list.Count)];
					val.explosionEffect = ((Component)val2).gameObject;
					projectilespo.Add(val);
				}
			}
		}
	}
	public class InvisEnemies : Effect
	{
		private void Update()
		{
			EnemyIdentifier[] array = Object.FindObjectsOfType<EnemyIdentifier>();
			EnemyIdentifier[] array2 = array;
			foreach (EnemyIdentifier val in array2)
			{
				Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren<Renderer>();
				Renderer[] array3 = componentsInChildren;
				foreach (Renderer val2 in array3)
				{
					val2.enabled = false;
				}
			}
		}

		public override void RemoveEffect()
		{
			EnemyIdentifier[] array = Object.FindObjectsOfType<EnemyIdentifier>();
			EnemyIdentifier[] array2 = array;
			foreach (EnemyIdentifier val in array2)
			{
				Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren<Renderer>();
				Renderer[] array3 = componentsInChildren;
				foreach (Renderer val2 in array3)
				{
					val2.enabled = true;
				}
			}
			base.RemoveEffect();
		}
	}
	public class Lagging : Effect
	{
		private bool isgud = true;

		private float seconds = 1f;

		private void Awake()
		{
			((MonoBehaviour)this).StartCoroutine("lag");
		}

		private IEnumerator lag()
		{
			while (isgud)
			{
				Vector3 pos = ((Component)ModUtils.GetPlayerTransform()).transform.position;
				yield return (object)new WaitForSeconds(seconds);
				((Component)ModUtils.GetPlayerTransform()).transform.position = pos;
				yield return (object)new WaitForSeconds(seconds);
			}
		}
	}
	internal class PixelReducer : Effect
	{
		private int NormalPixelization = 0;

		public void Awake()
		{
			NormalPixelization = MonoSingleton<PrefsManager>.Instance.GetInt("pixelization", 0);
			int num = Random.Range(0, 7);
			MonoSingleton<PrefsManager>.Instance.SetInt("pixelization", num);
			float num2 = 0f;
			switch (num)
			{
			case 0:
				num2 = 0f;
				break;
			case 1:
				num2 = 720f;
				break;
			case 2:
				num2 = 480f;
				break;
			case 3:
				num2 = 360f;
				break;
			case 4:
				num2 = 240f;
				break;
			case 5:
				num2 = 144f;
				break;
			case 6:
				num2 = 36f;
				break;
			}
			Shader.SetGlobalFloat("_ResY", num2);
			PostProcessV2_Handler instance = MonoSingleton<PostProcessV2_Handler>.Instance;
			if (Object.op_Implicit((Object)(object)instance))
			{
				instance.downscaleResolution = num2;
			}
			DownscaleChangeSprite[] array = Object.FindObjectsOfType<DownscaleChangeSprite>();
			for (int i = 0; i < array.Length; i++)
			{
				array[i].CheckScale();
			}
		}

		public override void RemoveEffect()
		{
			int normalPixelization = NormalPixelization;
			MonoSingleton<PrefsManager>.Instance.SetInt("pixelization", normalPixelization);
			float num = 0f;
			switch (normalPixelization)
			{
			case 0:
				num = 0f;
				break;
			case 1:
				num = 720f;
				break;
			case 2:
				num = 480f;
				break;
			case 3:
				num = 360f;
				break;
			case 4:
				num = 240f;
				break;
			case 5:
				num = 144f;
				break;
			case 6:
				num = 36f;
				break;
			}
			Shader.SetGlobalFloat("_ResY", num);
			PostProcessV2_Handler instance = MonoSingleton<PostProcessV2_Handler>.Instance;
			if (Object.op_Implicit((Object)(object)instance))
			{
				instance.downscaleResolution = num;
			}
			DownscaleChangeSprite[] array = Object.FindObjectsOfType<DownscaleChangeSprite>();
			for (int i = 0; i < array.Length; i++)
			{
				array[i].CheckScale();
			}
			base.RemoveEffect();
		}
	}
	public class PlushRain : Effect
	{
		private void Update()
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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_00a8: Unknown result type (might be due to invalid IL or missing references)
			List<GameObject> plushies = UltraEventsPlugin.plushies;
			plushies.RemoveAll((GameObject x) => !((Object)x).name.ToLower().Contains("plushie"));
			GameObject val = plushies[Random.Range(0, plushies.Count)];
			UltraEventsPlugin.Log.LogInfo((object)"aight im gonna paste a plushie");
			int num = 1 << LayerMask.NameToLayer("Environment");
			int num2 = 1 << LayerMask.NameToLayer("Outdoors");
			int num3 = num | num2;
			RaycastHit val2 = default(RaycastHit);
			if (Physics.Raycast(((Component)ModUtils.GetPlayerTransform()).transform.position, Vector3.up, ref val2, 50f, num3))
			{
				Object.Instantiate<GameObject>(val, ((RaycastHit)(ref val2)).point, Quaternion.identity);
			}
			else
			{
				Object.Instantiate<GameObject>(val, ((Component)ModUtils.GetPlayerTransform()).transform.position + Vector3.up * 50f, Quaternion.identity);
			}
		}
	}
	public class Fastmotion : Effect
	{
		private void Awake()
		{
			Time.timeScale = 2f;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 2f;
		}

		public override void RemoveEffect()
		{
			Time.timeScale = 1f;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			base.RemoveEffect();
		}
	}
	public class Slowmotion : Effect
	{
		private void Awake()
		{
			Time.timeScale = 0.3f;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 0.3f;
		}

		public override void RemoveEffect()
		{
			Time.timeScale = 1f;
			MonoSingleton<TimeController>.Instance.timeScaleModifier = 1f;
			base.RemoveEffect();
		}
	}
	internal class sSchizophreniaUpdateEffect : Effect
	{
		private HashSet<Renderer> alreadyDoneRenderers = new HashSet<Renderer>();

		private void Update()
		{
			OptimizeObjectType<EnemyIdentifier>();
			OptimizeObjectType<GoreSplatter>();
			OptimizeObjectType<ExplosionController>();
		}

		private void OptimizeObjectType<T>() where T : Component
		{
			T[] array = Object.FindObjectsOfType<T>();
			T[] array2 = array;
			foreach (T val in array2)
			{
				Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>();
				Renderer[] array3 = componentsInChildren;
				foreach (Renderer val2 in array3)
				{
					if (!alreadyDoneRenderers.Contains(val2))
					{
						RemoveOnUnseen removeOnUnseen = ((Component)val2).gameObject.AddComponent<RemoveOnUnseen>();
						removeOnUnseen.theObject = ((Component)val).gameObject;
						alreadyDoneRenderers.Add(val2);
					}
				}
			}
		}
	}
	internal class VirtualInsanityEffect : Effect
	{
		private List<MoveAndTurn> turns = new List<MoveAndTurn>();

		private void Awake()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			GameObject[] array = Resources.FindObjectsOfTypeAll<GameObject>();
			GameObject[] array2 = array;
			foreach (GameObject val in array2)
			{
				if (!(val.scene != SceneManager.GetActiveScene()) && ((val.layer == 8 && val.tag == "Untagged") || val.tag == "" || string.IsNullOrEmpty(((Object)val).name)) && !((Object)(object)val.GetComponent<Door>() != (Object)null) && !Object.op_Implicit((Object)(object)val.GetComponent<DoorBlocker>()) && !Object.op_Implicit((Object)(object)val.GetComponent<DoorController>()))
				{
					turns.Add(val.AddComponent<MoveAndTurn>());
				}
			}
		}

		public override void RemoveEffect()
		{
			base.RemoveEffect();
			foreach (MoveAndTurn turn in turns)
			{
				if ((Object)(object)((Component)turn).gameObject != (Object)null)
				{
					Object.Destroy((Object)(object)turn);
				}
			}
		}
	}
}