Decompiled source of UltraEvents v2.0.11

UltraEvents/UltraEvents.dll

Decompiled 2 months 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 System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using Configgy;
using HarmonyLib;
using Newtonsoft.Json;
using TMPro;
using ULTRAKILL.Cheats;
using UltraEvents.MonoBehaviours;
using UltraEvents.MonoBehaviours.Effects;
using UltraEvents.MonoBehaviours.Tasks;
using UltraEvents.Utils;
using UnityEngine;
using UnityEngine.AI;
using UnityEngine.AddressableAssets;
using UnityEngine.AddressableAssets.ResourceLocators;
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("4430ad5f-9fa3-4a37-81e0-91be18658ddb")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[AttributeUsage(AttributeTargets.Method, Inherited = false)]
public class EventDescriptionAttribute : Attribute
{
	public string Description { get; }

	public string Name { get; }

	public bool DefaultValue { get; }

	public EventDescriptionAttribute(string description, string name = null, bool defaultValue = true)
	{
		Description = description;
		Name = name;
		DefaultValue = defaultValue;
	}
}
[Serializable]
public class Root
{
	public string id { get; set; }

	public string url { get; set; }

	public int width { get; set; }

	public int height { get; set; }
}
namespace UltraEvents
{
	[HarmonyPatch]
	public class Events : MonoBehaviour
	{
		[EventDescription("Spawns Something wicked", null, true)]
		public void SomethingWickedThisWayComesVoid()
		{
			AnnounceEvent("Something wicked this way comes");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<SomethingWickedThisWayComes>();
		}

		[EventDescription("Shrinks the player", null, true)]
		public void ShrinkPlayer()
		{
			//IL_000c: 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)
			Transform transform = ((Component)ModUtils.GetPlayerTransform()).transform;
			transform.localScale /= 2f;
		}

		[EventDescription("Lowers the gravity", null, true)]
		public void LowGravity()
		{
			AnnounceEvent("I lowered gravity");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<LowGravity>();
		}

		[EventDescription("Makes your projectiles home at enemies", null, true)]
		public void HomingProj()
		{
			AnnounceEvent("Your projectiles now home at enemies");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<ProjectilesHomeAtEnemies>();
		}

		[EventDescription("Makes your punch force 1 thousand", "FALCON PUNCH", true)]
		public void FALCONPUNCHH()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<FALCONPUNCH>();
			AnnounceEvent("FALCON PUNCH");
		}

		[EventDescription("It will spawn a clone of you fighting with you", null, true)]
		public void CloneV1()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			Object.Instantiate<GameObject>(UltraEventsPlugin.V1, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
			AnnounceEvent("i cloned you :D");
		}

		[EventDescription("removes your hud", null, true)]
		public void RemoveHUD()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<NoHudEffect>();
			AnnounceEvent("no hud?");
		}

		[EventDescription("Yeets every object with gravity", null, true)]
		public void YEETAll()
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			Rigidbody[] array = Object.FindObjectsOfType<Rigidbody>();
			Rigidbody[] array2 = array;
			foreach (Rigidbody val in array2)
			{
				val.AddForce(new Vector3(0f, 100f, 0f), (ForceMode)1);
			}
			List<EnemyIdentifier> everyEnemy = ModUtils.GetEveryEnemy();
			foreach (EnemyIdentifier item in everyEnemy)
			{
				item.DeliverDamage(((Component)item).gameObject, new Vector3(0f, 50000f, 0f), ((Component)item).transform.position, 0f, false, 0f, (GameObject)null, false, true);
			}
		}

		private bool IsChild(GameObject objectToCheck, GameObject parentObject)
		{
			if ((Object)(object)objectToCheck == (Object)(object)parentObject)
			{
				return true;
			}
			Transform parent = objectToCheck.transform.parent;
			while ((Object)(object)parent != (Object)null)
			{
				if ((Object)(object)parent == (Object)(object)parentObject)
				{
					return true;
				}
				parent = parent.parent;
			}
			return false;
		}

		[EventDescription("Puts you in a d-rank", null, true)]
		public void SetDRank()
		{
			for (int i = 0; i < 6; i++)
			{
				MonoSingleton<StyleHUD>.instance.DescendRank();
			}
		}

		[EventDescription("Makes your screen upside down", null, true)]
		public void UpsideDown()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<UpsideDown>();
			AnnounceEvent("Why is everything upside down?");
		}

		[EventDescription("Makes you go very fast", null, true)]
		public void GOTTAGOFAST()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<GottaGoQuick>();
			AnnounceEvent("GOTTA GO FAST");
		}

		[EventDescription("Shuffles your weapons", null, true)]
		public void ShuffleWeapons()
		{
			GunControl instance = MonoSingleton<GunControl>.instance;
			if ((Object)(object)instance == (Object)null)
			{
				return;
			}
			List<GameObject> list = new List<GameObject>();
			list.AddRange(instance.slot1);
			list.AddRange(instance.slot2);
			list.AddRange(instance.slot3);
			list.AddRange(instance.slot4);
			list.AddRange(instance.slot5);
			list.AddRange(instance.slot6);
			Random rng = new Random();
			list = list.OrderBy((GameObject x) => rng.Next()).ToList();
			instance.slot1.Clear();
			instance.slot2.Clear();
			instance.slot3.Clear();
			instance.slot4.Clear();
			instance.slot5.Clear();
			instance.slot6.Clear();
			for (int i = 0; i < list.Count; i++)
			{
				switch (i % 6)
				{
				case 0:
					instance.slot1.Add(list[i]);
					break;
				case 1:
					instance.slot2.Add(list[i]);
					break;
				case 2:
					instance.slot3.Add(list[i]);
					break;
				case 3:
					instance.slot4.Add(list[i]);
					break;
				case 4:
					instance.slot5.Add(list[i]);
					break;
				case 5:
					instance.slot6.Add(list[i]);
					break;
				}
			}
			instance.slots.Clear();
			instance.slots.Add(instance.slot1);
			instance.slots.Add(instance.slot2);
			instance.slots.Add(instance.slot3);
			instance.slots.Add(instance.slot4);
			instance.slots.Add(instance.slot5);
			instance.slots.Add(instance.slot6);
			AnnounceEvent("Rearranged your weapons a bit");
		}

		[EventDescription("Makes everything one hit", null, true)]
		public void OneHit()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<EverythingIsOneHit>();
			AnnounceEvent("Everything is one hit now");
		}

		[EventDescription("Flashes your screen like in the beginning of 7-1", null, true)]
		public void Flash()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_011f: Unknown result type (might be due to invalid IL or missing references)
			OptionsMenuToManager val = Object.FindObjectOfType<OptionsMenuToManager>();
			if ((Object)(object)val == (Object)null)
			{
				Debug.LogError((object)"OptionsMenuToManager component not found!");
				return;
			}
			Canvas component = ((Component)val).gameObject.GetComponent<Canvas>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogError((object)"Canvas component not found on OptionsMenuToManager gameObject!");
				return;
			}
			GameObject val2 = new GameObject("Flash");
			if ((Object)(object)val2 == (Object)null)
			{
				Debug.LogError((object)"Failed to create GameObject 'Flash'!");
				return;
			}
			val2.transform.SetParent(((Component)component).transform, false);
			Image val3 = val2.AddComponent<Image>();
			if ((Object)(object)val3 == (Object)null)
			{
				Debug.LogError((object)"Failed to add Image component to GameObject 'Flash'!");
				return;
			}
			RectTransform component2 = ((Component)val3).GetComponent<RectTransform>();
			if ((Object)(object)component2 == (Object)null)
			{
				Debug.LogError((object)"RectTransform component not found on the Image component!");
				return;
			}
			Rect pixelRect = component.pixelRect;
			float width = ((Rect)(ref pixelRect)).width;
			pixelRect = component.pixelRect;
			component2.sizeDelta = new Vector2(width, ((Rect)(ref pixelRect)).height);
			((Graphic)val3).raycastTarget = false;
			((Graphic)val3).color = new Color(1f, 1f, 1f, 0f);
			FlashImage val4 = val2.AddComponent<FlashImage>();
			if ((Object)(object)val4 == (Object)null)
			{
				Debug.LogError((object)"Failed to add FlashImage component to GameObject 'Flash'!");
				return;
			}
			val4.flashAlpha = 1f;
			val4.speed = 1f;
			val4.dontFlashOnEnable = true;
			val4.oneTime = false;
			try
			{
				val4.Flash(1f);
			}
			catch (Exception ex)
			{
				Debug.LogError((object)("Error while trying to invoke Flash on the new FlashImage: " + ex.Message));
			}
		}

		[EventDescription("Stops time for everything except you", null, true)]
		public void TimeStop()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<TimeStop>();
			AnnounceEvent("ZA WARUDO");
		}

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

		[EventDescription("Moves everything slightly", null, true)]
		public void MoveEverything()
		{
			//IL_0079: 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_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_00d8: Unknown result type (might be due to invalid IL or missing references)
			float num = Random.Range(-0.1f, 0.1f);
			float num2 = Random.Range(-0.1f, 0.1f);
			float num3 = Random.Range(-0.1f, 0.1f);
			Debug.Log((object)(num + " " + num2 + " " + num3));
			GameObject[] array = Object.FindObjectsOfType<GameObject>();
			Vector3 val = new Vector3(num, num2, num3);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			foreach (GameObject val2 in array)
			{
				if (val2.scene == SceneManager.GetActiveScene() && !IsChild(((Component)MonoSingleton<NewMovement>.Instance).gameObject, val2))
				{
					Transform transform = val2.transform;
					transform.position += normalized;
				}
			}
			AnnounceEvent("I moved everything a lil");
		}

		[EventDescription("Spawns landmines in a certain radius", null, true)]
		public void SpawnLandMines()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: 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_0026: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < UltraEventsPlugin.Instance.amountOfLandMines.Value; i++)
			{
				Vector3 randomNavMeshPoint = ModUtils.GetRandomNavMeshPoint(((Component)MonoSingleton<NewMovement>.instance).transform.position, 70f);
				Object.Instantiate<GameObject>(UltraEventsPlugin.Ladnmine, randomNavMeshPoint, Quaternion.identity);
			}
		}

		[EventDescription("Zaps a random enemy", null, true)]
		public void ChainLightning()
		{
			//IL_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			if (randomEnemyThatIsAlive.nails.Count == 0)
			{
				Nail component = Object.Instantiate<GameObject>(UltraEventsPlugin.nail).GetComponent<Nail>();
				component.HitEnemy(((Component)((Component)randomEnemyThatIsAlive).gameObject.GetComponentInChildren<EnemyIdentifierIdentifier>()).transform, (EnemyIdentifierIdentifier)null);
			}
			if (Object.op_Implicit((Object)(object)randomEnemyThatIsAlive))
			{
				randomEnemyThatIsAlive.hitter = "zapper";
				randomEnemyThatIsAlive.hitterAttributes.Add((HitterAttribute)2);
				randomEnemyThatIsAlive.DeliverDamage(((Component)randomEnemyThatIsAlive).gameObject, Vector3.up * 100000f, ((Component)randomEnemyThatIsAlive).transform.position, 1f, true, 0f, (GameObject)null, false, false);
				MonoSingleton<WeaponCharges>.Instance.naiZapperRecharge = 0f;
				EnemyIdentifierIdentifier[] componentsInChildren = ((Component)randomEnemyThatIsAlive).GetComponentsInChildren<EnemyIdentifierIdentifier>();
				foreach (EnemyIdentifierIdentifier val in componentsInChildren)
				{
					if ((Object)(object)((Component)val).gameObject != (Object)(object)((Component)randomEnemyThatIsAlive).gameObject)
					{
						randomEnemyThatIsAlive.DeliverDamage(((Component)val).gameObject, Vector3.zero, ((Component)val).transform.position, Mathf.Epsilon, false, 0f, (GameObject)null, false, false);
					}
					Transform transform = Object.Instantiate<GameObject>(UltraEventsPlugin.sparknail, ((Component)val).transform.position, Quaternion.identity).transform;
					transform.localScale *= 0.5f;
				}
			}
			Object.Instantiate<GameObject>(UltraEventsPlugin.Lightning, ((Component)randomEnemyThatIsAlive).transform.position, Quaternion.identity);
			AnnounceEvent("Zeus does not like " + randomEnemyThatIsAlive.FullName);
		}

		[EventDescription("Makes every projectiles of yours set enemies on fire", "Fire Bullets", true)]
		public void FireBulets()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<FireBullets>();
			AnnounceEvent("Your bullets are on fire");
		}

		[EventDescription("Spawns landmines on you every few seconds", null, true)]
		public void SpawnLandMinesOnYou()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<SpawnLandminesEveryFewSeconds>();
			AnnounceEvent("Spawning landmines on you");
		}

		[EventDescription("Swaps the player's position with a random enemy", null, true)]
		public void SwapPlayerWithEnemy()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: 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)
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			Vector3 position = ((Component)randomEnemyThatIsAlive).transform.position;
			((Component)randomEnemyThatIsAlive).transform.position = ((Component)MonoSingleton<NewMovement>.instance).transform.position;
			((Component)MonoSingleton<NewMovement>.instance).transform.position = position;
		}

		[EventDescription("Scales everything slightly", null, true)]
		public void ScaleEverything()
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			float num = 0.01f;
			float num2 = 0.01f;
			float num3 = 0.01f;
			Debug.Log((object)(num + " " + num2 + " " + num3));
			GameObject[] array = Object.FindObjectsOfType<GameObject>();
			Vector3 val = new Vector3(num, num2, num3);
			Vector3 normalized = ((Vector3)(ref val)).normalized;
			foreach (GameObject val2 in array)
			{
				if (val2.scene == SceneManager.GetActiveScene() && !IsChild(((Component)MonoSingleton<NewMovement>.Instance).gameObject, val2) && !((Object)val2.transform.parent).name.ToLower().Contains("virtual"))
				{
					Transform transform = val2.transform;
					transform.localScale += normalized;
				}
			}
			AnnounceEvent("I moved scaled a lil");
		}

		[EventDescription("Turns a random enemy into your ally", null, true)]
		public void MakeAlly()
		{
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			if ((Object)(object)randomEnemyThatIsAlive != (Object)null)
			{
				randomEnemyThatIsAlive.ignorePlayer = true;
				randomEnemyThatIsAlive.attackEnemies = true;
				AnnounceEvent(randomEnemyThatIsAlive.FullName + " is now your ally");
			}
		}

		[EventDescription("gives them a +2 damage buff and a +10 health buff", null, true)]
		public void NanoMachinesSon()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			if (everyEnemyThatAreAlive.Count > 0)
			{
				Vector3 playerPosition = ((Component)MonoSingleton<NewMovement>.Instance).transform.position;
				EnemyIdentifier val = everyEnemyThatAreAlive.OrderBy((EnemyIdentifier enemy) => Vector3.Distance(playerPosition, ((Component)enemy).transform.position)).FirstOrDefault();
				if ((Object)(object)val != (Object)null)
				{
					AnnounceEvent("'NANO MACHINES SON' -" + val.FullName);
					val.damageBuffModifier += 2f;
					val.healthBuffModifier += 10f;
					val.healthBuff = true;
					val.damageBuff = true;
				}
			}
		}

		[EventDescription("makes an enemy 10 times bigger, and turns them into radiance 3", null, true)]
		public void RulesOfNature()
		{
			//IL_0027: 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)
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			if (!((Object)(object)randomEnemyThatIsAlive == (Object)null))
			{
				Transform transform = ((Component)randomEnemyThatIsAlive).gameObject.transform;
				transform.localScale *= 10f;
				randomEnemyThatIsAlive.radianceTier += 3f;
				randomEnemyThatIsAlive.speedBuffModifier += 1f;
				randomEnemyThatIsAlive.damageBuffModifier += 1f;
				randomEnemyThatIsAlive.healthBuffModifier += 1f;
				randomEnemyThatIsAlive.speedBuff = true;
				randomEnemyThatIsAlive.healthBuff = true;
				randomEnemyThatIsAlive.damageBuff = true;
				BossHealthBar val = ((!Object.op_Implicit((Object)(object)((Component)randomEnemyThatIsAlive).GetComponent<BossHealthBar>())) ? ((Component)randomEnemyThatIsAlive).gameObject.AddComponent<BossHealthBar>() : ((Component)randomEnemyThatIsAlive).GetComponent<BossHealthBar>());
				val.bossName = randomEnemyThatIsAlive.FullName + " destroyer of worlds";
			}
		}

		[EventDescription("Every object that has gravity goes to you", null, true)]
		public void EverythingAttractedToPlayer()
		{
			AnnounceEvent("Everything is now attracted to you");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<AttachEverythingToPlayer>();
		}

		[EventDescription("Coins will kill you", null, true)]
		public void CoinsDontLikeYou()
		{
			AnnounceEvent("Coins don't like you anymore");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<NoRicoshots>();
		}

		[EventDescription("Turns your weapons (especially the shotgun and rocketlauncher) into automatic weapons", null, true)]
		public void AutomaticWeapons()
		{
			UltraEventsPlugin.Log.LogInfo((object)"full auto");
			AnnounceEvent("Full auto");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<AutomaticWeaponsEffectcs>();
		}

		[EventDescription("Turns every nail (and saw) into a coin", null, true)]
		public void NailsAreNowCoins()
		{
			AnnounceEvent("i turned every nail into a coin :P");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<NailToCoin>();
		}

		[EventDescription("Gives a bossbar to every enemy", null, true)]
		public void BossBarForEveryone()
		{
			List<EnemyIdentifier> everyEnemy = ModUtils.GetEveryEnemy();
			foreach (EnemyIdentifier item in everyEnemy)
			{
				((Component)item).gameObject.AddComponent<BossHealthBar>();
			}
			AnnounceEvent("Everyone is a boss now");
		}

		[EventDescription("Makes every enemy oiled up", null, true)]
		public void OilUp()
		{
			List<EnemyIdentifier> everyEnemy = ModUtils.GetEveryEnemy();
			foreach (EnemyIdentifier item in everyEnemy)
			{
				for (int i = 0; i < 1000; i++)
				{
					item.AddFlammable(0.1f);
				}
			}
			AnnounceEvent("Did you pray today");
		}

		[EventDescription("Forces you to read a book (also removes the item you are currently holding", null, true)]
		public void Read()
		{
			//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("read");
			ItemIdentifier val2 = val.AddComponent<ItemIdentifier>();
			val2.pickUpSound = new GameObject();
			val2.itemType = (ItemType)4;
			val.AddComponent<Rigidbody>();
			val.AddComponent<CheckForScroller>();
			Readable val3 = val.AddComponent<Readable>();
			val3.instantScan = true;
			List<string> list = new List<string> { "You like reading, right?", "Imagine the lore implications i could put in this book.", "<b>TEXT SCRAMBLED - BRAIN CELL COUNT: DIMINISHING</b>\r\n\r\ni mean bruhhh \"gabriel yeeted minos, like, seriously. dude’s skin was all ripped up, blood was spilling everywhere, and we were all like, “uh, what now?!” ‘Justice,’ gabriel flexed, all righteous and stuff, while minos is just there on the floor, screaming his head off. ‘The Lord's vibes, bro,’ gabriel shouted. we just stood there like, ‘is this even real life?’ minos was not having it, flailing like crazy, still yelling, ‘nah, i ain’t about this godly nonsense!", "<color=red>THIS IS THE ONLY WAY IT COULD HAVE ENDED, GYATT!\r\n\r\nWAR NO LONGER NEEDED; IT'S ULTIMATE PRACTITIONER. MAN CRUSHED UNDER THE WHEELS OF A MACHINE, CREATED TO CREATE THE MACHINE, CREATED TO CRUSH THE MACHINE. SAMSARA OF CUT SINEW AND CRUSHED BONE. DEATH WITHOUT LIFE. NULL OUROBOROS. ALL THAT REMAINED IS WAR WITHOUT REASON, SKIBIDI!\r\n\r\nA MAGNUM OPUS, BRO. A COLD TOWER OF STEEL. A MACHINE BUILT TO END WAR IS ALWAYS A MACHINE BUILT TO CONTINUE WAR. YOU WERE BEAUTIFUL, OUTSTRETCHED LIKE ANTENNAS TO HEAVEN, NO CAP! YOU WERE BEYOND YOUR CREATORS. YOU REACHED FOR GOD, AND YOU FELL HARD, NO RIZZ. NONE WERE LEFT TO SPEAK YOUR EULOGY. NO FINAL WORDS, NO CONCLUDING STATEMENT. NO POINT. PERFECT CLOSURE, LIKE A SIGMA MALE IN THE COLD OF NIGHT!\r\n\r\nT H I S I S T H E O N L Y W A Y I T S H O U L D H A V E E N D E D, BRUH! </color>\r\n\r\nThe pages of the book are blank, just like my social life.</color>", "Is that Minos Prime", "I be Ultrakillin", "Fun fact: im real", "Why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why why " };
			val3.content = list[Random.Range(0, list.Count)];
			MonoSingleton<PlayerUtilities>.Instance.ForceHoldObject(val2);
		}

		[EventDescription("Bullets avoid enemies", null, true)]
		public void BulletsAfraidOfEnemies()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<BulletsAfraidEnemies>();
			AnnounceEvent("Bullets are afraid of enemies now");
		}

		[EventDescription("Bullets explode", null, true)]
		public void BulletsExplode()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<ExplodingBulletsEffect>();
			AnnounceEvent("Bullets now explode");
		}

		[EventDescription("You can infinitely dash", null, true)]
		public void InfiniteDashing()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<InfiniteDash>();
			AnnounceEvent("You can now infinitely dash");
		}

		[EventDescription("Heals enemies to max health", null, true)]
		public void HealAllEnemies()
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Invalid comparison between Unknown and I4
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Invalid comparison between Unknown and I4
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Invalid comparison between Unknown and I4
			//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Expected I4, but got Unknown
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				float health = ((Component)item).gameObject.GetComponent<HealthRememberer>().health;
				if ((int)item.enemyType == 1 || (int)item.enemyType == 9)
				{
					if (!Object.op_Implicit((Object)(object)item.drone))
					{
						item.drone = ((Component)item).GetComponent<Drone>();
					}
					if (Object.op_Implicit((Object)(object)item.drone))
					{
						item.drone.health = health;
						return;
					}
				}
				else if ((int)item.enemyType == 4)
				{
					if (!Object.op_Implicit((Object)(object)item.spider))
					{
						item.spider = ((Component)item).GetComponent<SpiderBody>();
					}
					if (Object.op_Implicit((Object)(object)item.spider))
					{
						item.spider.health = health;
						return;
					}
				}
				else
				{
					EnemyClass enemyClass = item.enemyClass;
					EnemyClass val = enemyClass;
					switch ((int)val)
					{
					default:
						return;
					case 0:
						if (!Object.op_Implicit((Object)(object)item.zombie))
						{
							item.zombie = ((Component)item).GetComponent<Zombie>();
						}
						if (Object.op_Implicit((Object)(object)item.zombie))
						{
							item.zombie.health = health;
							return;
						}
						break;
					case 1:
						if (!Object.op_Implicit((Object)(object)item.machine))
						{
							item.machine = ((Component)item).GetComponent<Machine>();
						}
						if (Object.op_Implicit((Object)(object)item.machine))
						{
							item.machine.health = health;
						}
						break;
					case 2:
						if (!Object.op_Implicit((Object)(object)item.statue))
						{
							item.statue = ((Component)item).GetComponent<Statue>();
						}
						if (Object.op_Implicit((Object)(object)item.statue))
						{
							item.statue.health = health;
							return;
						}
						break;
					}
				}
				item.ForceGetHealth();
			}
			AnnounceEvent("I healed all enemies lol");
		}

		[HarmonyPatch(typeof(EnemyIdentifier), "Awake")]
		[HarmonyPostfix]
		public static void setHealthRememberer(EnemyIdentifier __instance)
		{
			((Component)__instance).gameObject.AddComponent<HealthRememberer>().health = __instance.health;
		}

		[EventDescription("Every enemy that you dont see disappears", null, true)]
		public void SchizophreniaUpdate()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<sSchizophreniaUpdateEffect>();
		}

		[EventDescription("Turns every enemy invisible", null, true)]
		public void InvisibleEnemies()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<InvisEnemies>();
			AnnounceEvent("Enemies are now invisible");
		}

		[EventDescription("Turns every projectile invisible", null, true)]
		public void InvisibleProjectiles()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<InvisProj>();
			AnnounceEvent("Projectiles are now invisible");
		}

		[EventDescription("Turns a random object into a random enemy", null, true)]
		public 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_011f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: 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)
			{
			}
		}

		[EventDescription("Makes every enemy's weakpoint 3 times larger", null, true)]
		public void GiantHeads()
		{
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				if ((Object)(object)item.weakPoint != (Object)null)
				{
					Transform transform = item.weakPoint.transform;
					transform.localScale *= 3f;
				}
			}
			AnnounceEvent("Everyone's got a big head now!");
		}

		[EventDescription("Spawns a horde of enemies", null, true)]
		public void EnemyHorde()
		{
			((MonoBehaviour)this).StartCoroutine(SpawnHorde());
		}

		[EventDescription("Causes your screen to shake", null, true)]
		public void EarthQuake()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<CameraShake>();
			AnnounceEvent("EARTHQUAKE!!!");
		}

		[EventDescription("Inverts your controls", null, true)]
		public void InvertControls()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<InvertControls>();
			AnnounceEvent("Get inverted");
		}

		[EventDescription("Makes 2 enemies swap positions", null, true)]
		public void Swap2Enemies()
		{
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			if (everyEnemyThatAreAlive.Count > 2)
			{
				EnemyIdentifier val = everyEnemyThatAreAlive[Random.Range(0, everyEnemyThatAreAlive.Count)];
				EnemyIdentifier val2 = everyEnemyThatAreAlive[Random.Range(0, everyEnemyThatAreAlive.Count)];
				while ((Object)(object)val == (Object)(object)val2)
				{
					val = everyEnemyThatAreAlive[Random.Range(0, everyEnemyThatAreAlive.Count)];
				}
			}
		}

		[EventDescription("Makes projectiles bounce", null, true)]
		public void BouncyBullets()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<BouncyProj>();
			AnnounceEvent("Bullets bounce now!");
		}

		[EventDescription("Makes every enemy tiny", null, true)]
		public void TinyEnemies()
		{
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				Transform transform = ((Component)item).transform;
				transform.localScale /= 2f;
			}
			AnnounceEvent("Tiny enemies");
		}

		private IEnumerator SpawnHorde()
		{
			AnnounceEvent("Here they come!");
			for (int i = 0; i < Random.Range(0, UltraEventsPlugin.Instance.maxAmountOfFilth.Value); i++)
			{
				Object.Instantiate<GameObject>(UltraEventsPlugin.Instance.Zombie, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
				yield return (object)new WaitForSeconds(0.1f);
			}
		}

		[EventDescription("Gives a task you need to complete in a given time", null, true)]
		public void GiveTask()
		{
			switch (Random.Range(0, 2))
			{
			case 1:
			{
				Task task2 = TaskManager.Instance.Tasker.AddComponent<TestTask>();
				TaskManager.Instance.AddTask(task2);
				break;
			}
			case 0:
			{
				Task task = TaskManager.Instance.Tasker.AddComponent<KillEnemyTask>();
				TaskManager.Instance.AddTask(task);
				break;
			}
			}
		}

		[EventDescription("Adds gravity to random objects", null, true)]
		public void AddGravityToRandomObjects()
		{
			List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
			int value = UltraEventsPlugin.Instance.maxAmountOfObjects.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");
		}

		[EventDescription("reduces your pixels", null, true)]
		public void GoGoGadgetPixelReducer()
		{
			UltraEventsPlugin.Instance.EffectManager.AddComponent<PixelReducer>();
			AnnounceEvent("go go gadget pixel reducer!");
		}

		[EventDescription("Removes random Objects", null, true)]
		public void RemoveRandomObjects()
		{
			List<MeshRenderer> list = Object.FindObjectsOfType<MeshRenderer>().ToList();
			int value = UltraEventsPlugin.Instance.maxAmountOfObjects.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");
		}

		[EventDescription("Opens a random link (you can change the links by going into the dll file location, then 'JSONFiles' then open 'Links.json')", null, true)]
		public void OpenRandomLink()
		{
			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)
			{
				UltraEventsPlugin.Instance.CreateJsonFolder();
				return;
			}
			string text2 = File.ReadAllText(text + "/" + UltraEventsPlugin.Instance.jsonFilePath);
			UltraEventsPlugin.Instance.links = JsonConvert.DeserializeObject<List<UltraEventsPlugin.LinkData>>(text2);
			OpenRandomLaLink();
		}

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

		[EventDescription("Removes your railcannon charge", null, true)]
		public void RemoveCharge()
		{
			AnnounceEvent("no charge?");
			MonoSingleton<WeaponCharges>.Instance.raicharge = 0f;
		}

		[EventDescription("Removes your stamina", null, true)]
		public void RemoveStamina()
		{
			AnnounceEvent("no stamina?");
			ModUtils.GetPlayerTransform().EmptyStamina();
		}

		[EventDescription("Duplicates every enemy", null, true)]
		public void DupeAllEnemies()
		{
			//IL_002d: 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_004f: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("ever heard of mitosis?");
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				EnemyIdentifier val = Object.Instantiate<EnemyIdentifier>(item, ((Component)item).transform.position, ((Component)item).transform.rotation);
				((Component)val).transform.localScale = ((Component)item).transform.localScale;
			}
		}

		[EventDescription("Spawns a virtue insignia on you", null, true)]
		public 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;
		}

		[EventDescription("Spawns a virtue insignia on every enemy", null, true)]
		public void Alakablam()
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			AnnounceEvent("Alakablam");
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			VirtueInsignia val = Resources.FindObjectsOfTypeAll<VirtueInsignia>()[0];
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				VirtueInsignia val2 = Object.Instantiate<VirtueInsignia>(val, ((Component)item).transform.position, Quaternion.identity);
				val2.windUpSpeedMultiplier = 5f;
				EnemyTarget target = new EnemyTarget(item);
				val2.target = target;
			}
		}

		[EventDescription("Spawns a cat image", null, true)]
		public void LoadCat()
		{
			//IL_0024: 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_0056: Expected O, but got Unknown
			AnnounceEvent("Here a cat image");
			GameObject val = GameObject.CreatePrimitive((PrimitiveType)3);
			val.transform.position = ((Component)ModUtils.GetPlayerTransform()).transform.position;
			val.AddComponent<Rigidbody>();
			UltraEventsPlugin.Instance.catRenderer = val.GetComponent<Renderer>();
			Material material = new Material(UltraEventsPlugin.Instance.unlitShader);
			UltraEventsPlugin.Instance.catRenderer.material = material;
			((MonoBehaviour)this).StartCoroutine(LoadCatImage());
		}

		private IEnumerator LoadCatImage()
		{
			UnityWebRequest www = UnityWebRequest.Get(UltraEventsPlugin.Instance.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;
				UltraEventsPlugin.Log.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();
			}
		}

		public 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)
				{
					UltraEventsPlugin.Instance.catRenderer.material.mainTexture = (Texture)(object)texture;
					UltraEventsPlugin.Instance.catRenderer.material.SetTexture("_MainTex", (Texture)(object)texture);
					float width = ((Texture)texture).width;
					float height = ((Texture)texture).height;
					float scaleFactor = 0.01f;
					((Component)UltraEventsPlugin.Instance.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();
			}
		}

		[EventDescription("Causes a video to spawn (you can have your own videos by going to the dll file location)", null, true)]
		public 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));
				UltraEventsPlugin.Instance.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_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: 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);
		}

		[EventDescription("Causes a parry flash", null, true)]
		public void FakeParry()
		{
			MonoSingleton<TimeController>.Instance.ParryFlash();
		}

		[EventDescription("Just straight up kills you.", null, true)]
		public void KillPlayer()
		{
			AnnounceEvent("DIE");
			ModUtils.GetPlayerTransform().GetHurt(int.MaxValue, false, 1f, false, false, 0.35f, false);
		}

		[EventDescription("Removes some style points", null, true)]
		public 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;
		}

		[EventDescription("Forces you to equip the other arm", null, true)]
		public void SwitchArm()
		{
			FistControl val = Object.FindObjectOfType<FistControl>();
			val.ScrollArm();
		}

		[EventDescription("Smoothly swaps 2 objects positions", null, true)]
		public 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, UltraEventsPlugin.Instance.AmountOfTime.Value));
			AnnounceEvent(((Object)gameObject).name + " and " + ((Object)gameObject2).name + " swapped places");
		}

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

		[EventDescription("Makes you teleport to a random enemy", null, true)]
		public void TeleportToEnemy()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			((Component)ModUtils.GetPlayerTransform()).transform.position = ((Component)randomEnemyThatIsAlive).transform.position;
			AnnounceEvent("teleports behind " + ((Object)((Component)randomEnemyThatIsAlive).gameObject).name);
		}

		[EventDescription("Causes 2 events to happen", null, true)]
		public void MoreTrouble()
		{
			((MonoBehaviour)this).StopCoroutine("overTimeEvents");
			AnnounceEvent("prepare for trouble. And make it double!");
			((MonoBehaviour)this).StartCoroutine(overTimeEvents(2));
		}

		public IEnumerator overTimeEvents(int amount)
		{
			yield return (object)new WaitForSeconds(UltraEventsPlugin.Instance.AmountOfTime.Value / 3.3333333f);
			for (int i = 0; i < amount; i++)
			{
				UltraEventsPlugin.Instance.UseRandomEvent(FromTrouble: true);
				yield return (object)new WaitForSeconds(UltraEventsPlugin.Instance.AmountOfTime.Value / 10f);
			}
			UltraEventsPlugin.Instance.timer = UltraEventsPlugin.Instance.AmountOfTime.Value;
		}

		[EventDescription("Turns a random enemy into a puppet (one of those blood enemies in 7-3", null, true)]
		public void TurnEnemyIntoPuppet()
		{
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			randomEnemyThatIsAlive.puppet = true;
			randomEnemyThatIsAlive.PuppetSpawn();
			randomEnemyThatIsAlive.dontCountAsKills = false;
			AnnounceEvent(((Object)((Component)randomEnemyThatIsAlive).gameObject).name + " is now a puppet");
		}

		[EventDescription("Gives you a fishing rod", null, true)]
		public void GetFishingRod()
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				AnnounceEvent("its fishing time");
				if ((Object)(object)Object.FindObjectOfType<FishingHUD>() == (Object)null)
				{
					Object.Instantiate<GameObject>(UltraEventsPlugin.Instance.fishingCanvas, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
				}
				GunSetter gs = Object.FindObjectOfType<GunSetter>();
				ModUtils.AttachWeapon(1, "", UltraEventsPlugin.Instance.rot, gs);
			}
			catch (Exception ex)
			{
				AnnounceEvent(ex.Message);
			}
		}

		[EventDescription("Sands every enemy", null, true)]
		public void noHeals()
		{
			AnnounceEvent("no heals?");
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				item.Sandify(false);
			}
		}

		[EventDescription("Places you underwater", null, true)]
		public void water()
		{
			AnnounceEvent("hello how are you? i am under the water");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<aboohwaer>();
		}

		[EventDescription("Blesses every enemy", null, true)]
		public void BlessthemAll()
		{
			AnnounceEvent("enemies now are protected by god");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<BlessAll>();
		}

		[EventDescription("Makes you teleport back to your previous position", null, true)]
		public void Lag()
		{
			AnnounceEvent("your ping is so high");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<Lagging>();
		}

		[EventDescription("Spawns a random enemy", null, true)]
		public 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);
		}

		[EventDescription("Gives you a duel wield", null, true)]
		public void GiveDualWield()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Invalid comparison between Unknown and I4
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007f: Expected O, but got Unknown
			//IL_009e: 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_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: 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)
			AnnounceEvent("its dual wielding time!!! *dual wields all over the place*");
			int num = Random.Range(1, UltraEventsPlugin.Instance.maxAmountOfDualWields.Value);
			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;
					}
				}
			}
		}

		[EventDescription("Makes your jump height 2 times higher", null, true)]
		public void MarioTime()
		{
			AnnounceEvent("Mario time");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<MarioJumpEffect>();
		}

		[EventDescription("Removes every weapon", null, true)]
		public void NoWeapons()
		{
			AnnounceEvent("no weapons?");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<NoWeaponss>();
		}

		[EventDescription("Removes every fist", null, true)]
		public void NoFist()
		{
			AnnounceEvent("no fists?");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<NoFists>();
		}

		[EventDescription("Reduces the amount of damage taken", null, true)]
		public void LessDamage()
		{
			AnnounceEvent("You take less damage now");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<LessDamageEffect>();
		}

		[EventDescription("Increases the amount of damage taken", null, true)]
		public void MoreDamage()
		{
			AnnounceEvent("You take more damage now");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<MoreDamageEffect>();
		}

		[EventDescription("Decreases the speed", null, true)]
		public void SlowMotion()
		{
			AnnounceEvent("wow this is slow");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<Slowmotion>();
		}

		[EventDescription("Randomizes time", null, true)]
		public void Timewarp()
		{
			AnnounceEvent("Time is warping!");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<TimeWarp>();
		}

		[EventDescription("Increases the speed", null, true)]
		public void FastMotion()
		{
			AnnounceEvent("wow this is Fast");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<Fastmotion>();
		}

		[EventDescription("Makes it rain plushies!!!!", null, true)]
		public void PlushRain()
		{
			AnnounceEvent("Plush rain!!!!");
			UltraEventsPlugin.Instance.EffectManager.AddComponent<PlushRain>();
		}

		[EventDescription("Adds gravity to random objects", null, true)]
		public void AddGravityToRandomObject()
		{
			List<GameObject> list = Object.FindObjectsOfType<GameObject>().ToList();
			GameObject val = list[Random.Range(0, list.Count)];
			AnnounceEvent(((Object)val).name + " discovered gravity");
			val.AddComponent<Rigidbody>();
		}

		[EventDescription("Removes a random object (anything is an object btw)", null, true)]
		public 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);
		}

		[EventDescription("Fires your gun that you are currently holding", null, true)]
		public void FireGun()
		{
			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
				{
					UltraEventsPlugin.Log.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
				{
					UltraEventsPlugin.Log.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
				{
					UltraEventsPlugin.Log.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
				{
					UltraEventsPlugin.Log.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
				{
					UltraEventsPlugin.Log.LogInfo((object)"Shoot method not found.");
				}
			}
		}

		[EventDescription("It launches a meteor on you", null, true)]
		public void Meteor()
		{
			((MonoBehaviour)this).StartCoroutine(MeteorShower());
			AnnounceEvent("METEOR SHOWER INCOMING");
		}

		[EventDescription("Spawns 8 cerberus projectiles around you", null, true)]
		public void CerbSurround()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(UltraEventsPlugin.CerbApples, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity);
			Projectile[] componentsInChildren = val.GetComponentsInChildren<Projectile>();
			Projectile[] array = componentsInChildren;
			foreach (Projectile val2 in array)
			{
				val2.rb.AddForce(((Component)val2).gameObject.transform.forward * 10000f);
			}
		}

		private IEnumerator MeteorShower()
		{
			for (int i = 0; i < UltraEventsPlugin.Instance.amountOfMeteors.Value; i++)
			{
				Quaternion randomYRotation = Quaternion.Euler(0f, Random.Range(0f, 360f), 0f);
				GameObject metoer = Object.Instantiate<GameObject>(UltraEventsPlugin.Meteor, ModUtils.GetRandomNavMeshPoint(((Component)ModUtils.GetPlayerTransform()).transform.position, 40f), randomYRotation);
				metoer.GetComponentInChildren<Projectile>();
				yield return (object)new WaitForSeconds(UltraEventsPlugin.Instance.AmountOfTime.Value / 15f);
			}
		}

		[EventDescription("Reverses gravity. Wont go back unless triggered again", null, true)]
		public 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");
			}
		}

		[EventDescription("Kills a random enemy", null, true)]
		public void KillRandomEnemy()
		{
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			AnnounceEvent("fuck you in particular " + ((Object)((Component)randomEnemyThatIsAlive).gameObject).name);
			randomEnemyThatIsAlive.InstaKill();
		}

		[EventDescription("It kills every enemy", null, true)]
		public void KillAllEnemies()
		{
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				item.InstaKill();
			}
			AnnounceEvent("DIE EVERYONE!");
		}

		[EventDescription("Forces you to hold a random weapon", null, true)]
		public void ChooseRandomWeapon()
		{
			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, false);
		}

		[EventDescription("Buffs a random enemy", null, true)]
		public void BuffEnemy()
		{
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			randomEnemyThatIsAlive.BuffAll();
			AnnounceEvent("\"will you lose?\" \"nah id win\" -" + ((Object)((Component)randomEnemyThatIsAlive).gameObject).name);
		}

		[EventDescription("duplicates a random enemy", null, true)]
		public void DupeEnemy()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			EnemyIdentifier randomEnemyThatIsAlive = ModUtils.getRandomEnemyThatIsAlive();
			EnemyIdentifier val = Object.Instantiate<EnemyIdentifier>(randomEnemyThatIsAlive, ((Component)randomEnemyThatIsAlive).transform.position, ((Component)randomEnemyThatIsAlive).transform.rotation);
			((Component)val).transform.localScale = ((Component)randomEnemyThatIsAlive).transform.localScale;
			AnnounceEvent("i added another " + ((object)(EnemyType)(ref randomEnemyThatIsAlive.enemyType)).ToString());
		}

		[EventDescription("Explodes every enemy", null, true)]
		public void Kaboom()
		{
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("KABOOOOOOM");
			EnemyIdentifier[] array = ModUtils.GetEveryEnemyThatAreAlive().ToArray();
			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);
			}
		}

		[EventDescription("Forces you to switch to the previous weapon", "Go back to the other weapon", true)]
		public 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, false);
		}

		[EventDescription("Removes the current weapon you are holding", null, true)]
		public void RemoveWeapon()
		{
			AnnounceEvent("you dont need this right?");
			GunControl val = Object.FindObjectOfType<GunControl>();
			GameObject currentWeapon = val.currentWeapon;
			val.allWeapons.Remove(currentWeapon);
			foreach (List<GameObject> slot in val.slots)
			{
				if (slot.Contains(currentWeapon))
				{
					slot.Remove(currentWeapon);
					break;
				}
			}
			val.slotDict.Remove(currentWeapon);
			Object.Destroy((Object)(object)currentWeapon);
		}

		[EventDescription("Teleports every enemy behind you", null, true)]
		public void TPEnemiesToPlayer()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			AnnounceEvent("teleports behind you");
			List<EnemyIdentifier> everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive();
			foreach (EnemyIdentifier item in everyEnemyThatAreAlive)
			{
				((Component)item).transform.position = ((Component)ModUtils.GetPlayerTransform()).transform.position;
			}
		}

		[EventDescription("Throws you in the air", null, true)]
		public 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);
		}

		[EventDescription("Does every event", null, false)]
		public void DoEveryEvent()
		{
			((MonoBehaviour)this).StartCoroutine(LaunchAllEvents());
		}

		private IEnumerator LaunchAllEvents()
		{
			List<KeyValuePair<string, (MethodInfo Method, ConfigEntry<bool> Config)>> enabledEvents = UltraEventsPlugin.events.Where((KeyValuePair<string, (MethodInfo Method, ConfigEntry<bool> Config)> e) => e.Value.Method.Name != "DoEveryEvent").ToList();
			Debug.Log((object)$"Starting to launch {enabledEvents.Count} events.");
			foreach (KeyValuePair<string, (MethodInfo, ConfigEntry<bool>)> info in enabledEvents)
			{
				try
				{
					Debug.Log((object)("Invoking event: " + info.Value.Item1.Name));
					info.Value.Item1.Invoke(this, null);
				}
				catch (Exception e2)
				{
					Debug.LogError((object)$"Error invoking event {info.Value.Item1.Name}: {e2}");
				}
				yield return (object)new WaitForSeconds(UltraEventsPlugin.Instance.AmountOfTime.Value / (float)enabledEvents.Count);
			}
			Debug.Log((object)"Finished launching all events.");
		}
	}
	public static class ShaderManager
	{
		public class ShaderInfo
		{
			public string Name { get; set; }
		}

		private static bool LoadedShaders = false;

		public static Dictionary<string, Shader> shaderDictionary = new Dictionary<string, Shader>();

		private static HashSet<Material> modifiedMaterials = new HashSet<Material>();

		public static IEnumerator LoadShadersAsync()
		{
			AsyncOperationHandle<IResourceLocator> handle = Addressables.InitializeAsync();
			while (!handle.IsDone)
			{
				yield return null;
			}
			if ((int)handle.Status == 1)
			{
				IResourceLocator result = handle.Result;
				foreach (object obj in ((ResourceLocationMap)result).Keys)
				{
					string text = (string)obj;
					if (!text.EndsWith(".shader"))
					{
						continue;
					}
					AsyncOperationHandle<Shader> shaderHandle = Addressables.LoadAssetAsync<Shader>((object)text);
					while (!shaderHandle.IsDone)
					{
						yield return null;
					}
					if ((int)shaderHandle.Status == 1)
					{
						Shader result2 = shaderHandle.Result;
						if ((Object)(object)result2 != (Object)null && ((Object)result2).name != "ULTRAKILL/PostProcessV2" && !shaderDictionary.ContainsKey(((Object)result2).name))
						{
							shaderDictionary[((Object)result2).name] = result2;
						}
					}
					else
					{
						string str = "Failed to load shader: ";
						Debug.LogError((object)(str + shaderHandle.OperationException));
					}
				}
				LoadedShaders = true;
			}
			else
			{
				string str2 = "Addressables initialization failed: ";
				Debug.LogError((object)(str2 + handle.OperationException));
			}
		}

		public static string ModPath()
		{
			return Assembly.GetExecutingAssembly().Location.Substring(0, Assembly.GetExecutingAssembly().Location.LastIndexOf(Path.DirectorySeparatorChar));
		}

		public static IEnumerator ApplyShadersAsync(GameObject[] allGameObjects)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => LoadedShaders));
			if (allGameObjects == null)
			{
				yield break;
			}
			foreach (GameObject gameObject in allGameObjects)
			{
				if ((Object)(object)gameObject == (Object)null)
				{
					continue;
				}
				Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true);
				foreach (Renderer renderer in componentsInChildren)
				{
					if ((Object)(object)renderer == (Object)null)
					{
						continue;
					}
					Material[] array2 = (Material[])(object)new Material[renderer.sharedMaterials.Length];
					for (int i = 0; i < renderer.sharedMaterials.Length; i++)
					{
						Material material = (array2[i] = renderer.sharedMaterials[i]);
						Shader shader = null;
						if (!((Object)(object)material == (Object)null) && !((Object)(object)material.shader == (Object)null) && !modifiedMaterials.Contains(material) && !(((Object)material.shader).name == "ULTRAKILL/PostProcessV2") && shaderDictionary.TryGetValue(((Object)material.shader).name, out shader))
						{
							array2[i].shader = shader;
							modifiedMaterials.Add(material);
						}
					}
					renderer.materials = array2;
				}
				yield return null;
			}
		}

		public static IEnumerator ApplyShaderToGameObject(GameObject gameObject)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => LoadedShaders));
			if ((Object)(object)gameObject == (Object)null)
			{
				yield break;
			}
			Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(true);
			foreach (Renderer renderer in componentsInChildren)
			{
				if ((Object)(object)renderer == (Object)null)
				{
					continue;
				}
				Material[] array2 = (Material[])(object)new Material[renderer.sharedMaterials.Length];
				for (int i = 0; i < renderer.sharedMaterials.Length; i++)
				{
					Material material = (array2[i] = renderer.sharedMaterials[i]);
					Shader shader = null;
					if (!((Object)(object)material == (Object)null) && !((Object)(object)material.shader == (Object)null) && !modifiedMaterials.Contains(material) && !(((Object)material.shader).name == "ULTRAKILL/PostProcessV2") && shaderDictionary.TryGetValue(((Object)material.shader).name, out shader))
					{
						array2[i].shader = shader;
						modifiedMaterials.Add(material);
					}
				}
				renderer.materials = array2;
			}
			yield return null;
		}
	}
	[BepInPlugin("com.michi.UltraEvents", "UltraEvents", "1.0.0")]
	[HarmonyPatch]
	public class UltraEventsPlugin : BaseUnityPlugin
	{
		[Serializable]
		public class LinkData
		{
			public string link;
		}

		public static Dictionary<string, (MethodInfo Method, ConfigEntry<bool> Config)> events = new Dictionary<string, (MethodInfo, ConfigEntry<bool>)>();

		private Events Theevents;

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

		private const string PluginName = "UltraEvents";

		private const string VersionString = "1.0.0";

		public static bool AutomaticFireEffectActive;

		public GameObject EffectManager;

		public 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>();

		public GameObject fishingCanvas;

		public GameObject Zombie;

		public Shader unlitShader;

		public float timer = 5f;

		public ConfigEntry<float> AmountOfTime;

		public ConfigEntry<int> maxAmountOfObjects;

		public ConfigEntry<int> maxAmountOfFilth;

		public ConfigEntry<int> maxAmountOfDualWields;

		public ConfigEntry<int> amountOfLandMines;

		public ConfigEntry<int> amountOfMeteors;

		public ConfigEntry<float> FalconPunchPower;

		public ConfigEntry<float> TimeScaleFastMotion;

		public ConfigEntry<float> TimeScaleSlowMotion;

		public ConfigEntry<bool> rmeoveEffects;

		public ConfigEntry<bool> DebugThing;

		public ConfigEntry<bool> DiscordActivity;

		public ConfigEntry<bool> TimerText;

		public ConfigEntry<KeyCode> DoEvent;

		public ConfigEntry<KeyCode> RemoveEffects;

		public ConfigEntry<bool> announceEvents;

		public ConfigEntry<bool> everyFewSeconds;

		public ConfigEntry<bool> OnButtonPress;

		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;

		public static ConfigEntry<bool> WeaponSwap;

		public static ConfigEntry<bool> PickUp;

		public GameObject rot = null;

		public static GameObject WickedObject;

		public static GameObject nail;

		public static GameObject sparknail;

		public static GameObject Lightning;

		public static Shader VertexLit;

		public static GameObject Ladnmine;

		public static GameObject Meteor;

		public static GameObject CerbApples;

		public static GameObject BlueTrail;

		public static GameObject Creeper;

		public static GameObject V1;

		public GameObject Countodnw;

		public GameObject Countdown;

		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 string jsonFilePath = "UltraEvents.Jsons.Links.json";

		public 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;

		[Configgable("Events Buttons", "Enable All Button", 0, null)]
		public static ConfigButton EnableAll = new ConfigButton((Action)delegate
		{
			Log.LogInfo((object)"hi");
			foreach (KeyValuePair<string, (MethodInfo, ConfigEntry<bool>)> @event in events)
			{
				Log.LogInfo((object)@event.Key);
				try
				{
					@event.Value.Item2.Value = true;
				}
				catch (Exception ex2)
				{
					Debug.LogError((object)("Failed to enable event " + @event.Key + ": " + ex2.Message));
				}
			}
		}, (string)null);

		[Configgable("Events Buttons", "Disable All Button", 0, null)]
		public static ConfigButton DisableAll = new ConfigButton((Action)delegate
		{
			Log.LogInfo((object)"hi");
			foreach (KeyValuePair<string, (MethodInfo, ConfigEntry<bool>)> event2 in events)
			{
				Log.LogInfo((object)event2.Key);
				try
				{
					event2.Value.Item2.Value = false;
				}
				catch (Exception ex)
				{
					Debug.LogError((object)("Failed to disable event " + event2.Key + ": " + ex.Message));
				}
			}
		}, (string)null);

		public ShaderApplier shaderApplier;

		public Material upsideDownMaterial;

		public static UltraEventsPlugin Instance { get; private set; }

		public static ConfigBuilder configBuilder { get; private set; }

		[HarmonyPatch(typeof(DiscordController), "UpdateStyle")]
		public static bool Prefix()
		{
			return !Instance.DiscordActivity.Value;
		}

		public void UpsideDown()
		{
			upsideDownMaterial.SetFloat("_Intensity", 1f);
		}

		public void ResetScreen()
		{
			upsideDownMaterial.SetFloat("_Intensity", 0f);
		}

		public void SetConfigs()
		{
			//IL_0399: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a3: Expected O, but got Unknown
			AmountOfTime = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "Time Between Events", 5f, (ConfigDescription)null);
			maxAmountOfObjects = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "max amount of objects", 20, "tied to the 'RemoveRandomObjectsEvent' you can choose what the maximum amount is");
			maxAmountOfFilth = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "max amount of filth", 500, "tied to the 'EnemyHorde' you can choose what the maximum amount of filth is");
			maxAmountOfDualWields = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "max amount of dual wields", 10, "tied to the 'GiveDualWield' you can choose what the maximum amount of dual wields is");
			amountOfLandMines = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "amount of land mines", 30, "tied to the 'SpawnLandMines' you can choose how many landmines spawn");
			amountOfMeteors = ((BaseUnityPlugin)this).Config.Bind<int>("Values", "amount of meteors", 15, "tied to the 'Meteor' you can choose how many meteors spawn");
			FalconPunchPower = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "falcon punch power", 15f, "tied to the 'falcon punch' you can choose how much force and damage it does");
			TimeScaleFastMotion = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "fast motion time", 3f, "tied to the 'fast motion' you can choose how fast it goes");
			TimeScaleSlowMotion = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "slows motion time", 0.3f, "tied to the 'slow motion' you can choose how slow it goes");
			FalconPunchPower = ((BaseUnityPlugin)this).Config.Bind<float>("Values", "falcon punch power", 15f, "tied to the 'falcon punch' you can choose how much force and damage it does");
			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");
			DebugThing = ((BaseUnityPlugin)this).Config.Bind<bool>("Values", "Debug", false, "This is for the developer to see if events trigger correctly");
			DiscordActivity = ((BaseUnityPlugin)this).Config.Bind<bool>("Values", "Discord Activity", true, "If this is enabled in your discord status it will show the current event instead of style");
			TimerText = ((BaseUnityPlugin)this).Config.Bind<bool>("Values", "Text timer", true, "If this is enabled it will show a timer that shows when the next event happens");
			TimerText.SettingChanged += TimerText_SettingChanged;
			DoEvent = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Values", "Do Event button", (KeyCode)116, "Only used when On Key Bind Press is on");
			RemoveEffects = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("Values", "Remove Effects button", (KeyCode)109, "Only used when On Key Bind Press is on");
			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");
			WeaponSwap = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Weapon Swap", false, "will trigger an event when you swap weapons");
			PickUp = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Item Pick Up", false, "will trigger an event when grab an item");
			OnButtonPress = ((BaseUnityPlugin)this).Config.Bind<bool>("Triggers", "On Key Bind Press", false, "will trigger an event when you press a certain key (configurable in Values)");
			((BaseUnityPlugin)this).Logger.LogInfo((object)"loadedAllConfigs");
			configBuilder = new ConfigBuilder((string)null, (string)null);
			configBuilder.BuildAll();
		}

		private void TimerText_SettingChanged(object sender, EventArgs e)
		{
			if ((Object)(object)Countdown != (Object)null)
			{
				Countdown.SetActive(TimerText.Value);
			}
		}

		private void Awake()
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			//IL_0099: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Expected O, but got Unknown
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Expected O, but got Unknown
			Instance = this;
			Theevents = ((Component)this).gameObject.AddComponent<Events>();
			InitializeEvents();
			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;
			Object obj = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.upsidedown")).LoadAllAssets()[0];
			Shader val = (Shader)(object)((obj is Shader) ? obj : null);
			upsideDownMaterial = new Material(val);
			Object obj2 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.meteor")).LoadAllAssets()[0];
			Meteor = (GameObject)(object)((obj2 is GameObject) ? obj2 : null);
			Object obj3 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.cerbapples")).LoadAllAssets()[0];
			CerbApples = (GameObject)(object)((obj3 is GameObject) ? obj3 : null);
			Object obj4 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.bluetrail")).LoadAllAssets()[0];
			BlueTrail = (GameObject)(object)((obj4 is GameObject) ? obj4 : null);
			Object obj5 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.creeper")).LoadAllAssets()[0];
			Creeper = (GameObject)(object)((obj5 is GameObject) ? obj5 : null);
			Object obj6 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.v1")).LoadAllAssets()[0];
			V1 = (GameObject)(object)((obj6 is GameObject) ? obj6 : null);
			ref GameObject countodnw = ref Countodnw;
			Object obj7 = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly().GetManifestResourceStream("UltraEvents.Bundles.countdown")).LoadAllAssets()[0];
			countodnw = (GameObject)(object)((obj7 is GameObject) ? obj7 : null);
		}

		private void Start()
		{
		}

		private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1)
		{
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Expected O, but got Unknown
			if ((Object)(object)rot == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(loadRod());
			}
			if (plushies.Count < plushieKeys.Length)
			{
				((MonoBehaviour)this).StartCoroutine(LoadPlushies());
			}
			if ((Object)(object)fishingCanvas == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadUI());
			}
			if ((Object)(object)WickedObject == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadWicked());
			}
			if ((Object)(object)VertexLit == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadLit());
			}
			if ((Object)(object)Instance.Zombie == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadFilth());
			}
			if ((Object)(object)Ladnmine == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadLandmine());
			}
			if ((Object)(object)nail == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadNail());
			}
			if ((Object)(object)sparknail == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadNailSpark());
			}
			if ((Object)(object)Lightning == (Object)null)
			{
				((MonoBehaviour)this).StartCoroutine(LoadLightning());
			}
			upsideDownMaterial.SetFloat("_Intensity", 0f);
			GameObject val = null;
			foreach (object item in ((Component)MonoSingleton<CameraController>.Instance).transform)
			{
				Transform val2 = (Transform)item;
				if (((Object)val2).name.ToLower().Contains("virtual"))
				{
					val = ((Component)val2).gameObject;
					break;
				}
			}
			if (!((Object)(object)val == (Object)null))
			{
				ShaderApplier shaderApplier = val.AddComponent<ShaderApplier>();
				shaderApplier.material = upsideDownMaterial;
			}
			if ((Object)(object)Countodnw != (Object)null)
			{
				Countdown = Object.Instantiate<GameObject>(Countodnw);
				Countdown.SetActive(TimerText.Value);
			}
			((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));
				if ((int)plushieHandle.Status == 1)
				{
					GameObject plushie = plushieHandle.Result;
					plushies.Add(plushie);
				}
				else
				{
					Debug.LogError((object)("Failed to load plushie: " + prefabKey));
				}
				Addressables.Release<GameObject>(plushieHandle);
			}
		}

		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 IEnumerator LoadFilth()
		{
			string prefabKey = "Assets/Prefabs/Enemies/Zombie.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			Zombie = RodHandle.Result;
		}

		private IEnumerator LoadNail()
		{
			string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Nails/Nail.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			nail = RodHandle.Result;
		}

		private IEnumerator LoadNailSpark()
		{
			string prefabKey = "Assets/Particles/SparksNail.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			sparknail = RodHandle.Result;
		}

		private IEnumerator LoadLightning()
		{
			string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Lightning.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			Lightning = RodHandle.Result;
		}

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

		private IEnumerator LoadLit()
		{
			string prefabKey = "Assets/Shaders/Main/ULTRAKILL-vertexlit.shader";
			AsyncOperationHandle<Shader> RodHandle = Addressables.LoadAssetAsync<Shader>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			VertexLit = RodHandle.Result;
		}

		private IEnumerator LoadLandmine()
		{
			string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Landmine.prefab";
			AsyncOperationHandle<GameObject> RodHandle = Addressables.LoadAssetAsync<GameObject>((object)prefabKey);
			yield return (object)new WaitUntil((Func<bool>)(() => RodHandle.IsDone));
			Ladnmine = RodHandle.Result;
		}

		private void RemoveEffect()
		{
			if (!rmeoveEffects.Value)
			{
				return;
			}
			Effect[] components = EffectManager.GetComponents<Effect>();
			if (components.Length != 0)
			{
				Effect[] array = components;
				foreach (Effect effect in array)
				{
					effect.RemoveEffect();
					Object.Destroy((Object)(object)effect);
				}
			}
		}

		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 = v