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.Events; 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 bool requiresEnemies { get; } public EventDescriptionAttribute(string description, string name = null, bool defaultValue = true, bool requiresEnemies = false) { Description = description; Name = name; DefaultValue = defaultValue; this.requiresEnemies = requiresEnemies; } } [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, false)] public void SomethingWickedThisWayComesVoid() { AnnounceEvent("Something wicked this way comes"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Shrinks the player", null, true, false)] public void ShrinkPlayer() { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) AnnounceEvent("You're tiny now"); Transform transform = ((Component)ModUtils.GetPlayerTransform()).transform; transform.localScale /= 2f; } [EventDescription("Lowers the gravity", null, true, false)] public void LowGravity() { AnnounceEvent("I lowered gravity"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Makes your projectiles home at enemies", null, true, false)] public void HomingProj() { AnnounceEvent("Your projectiles now home at enemies"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Makes your punch force 1 thousand", "FALCON PUNCH", true, false)] public void FALCONPUNCHH() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("FALCON PUNCH"); } [EventDescription("It will spawn a clone of you fighting with you", null, true, false)] 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(UltraEventsPlugin.V1, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity); AnnounceEvent("i cloned you :D"); } [EventDescription("removes your hud", null, true, false)] public void RemoveHUD() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("no hud?"); } [EventDescription("Yeets every object with gravity", null, true, 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[] array2 = array; foreach (Rigidbody val in array2) { val.AddForce(new Vector3(0f, 100f, 0f), (ForceMode)1); } List 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, false)] public void SetDRank() { for (int i = 0; i < 6; i++) { MonoSingleton.instance.DescendRank(); } } [EventDescription("Makes your screen upside down", null, true, false)] public void UpsideDown() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Why is everything upside down?"); } [EventDescription("Makes you go very fast", null, true, false)] public void GOTTAGOFAST() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("GOTTA GO FAST"); } [EventDescription("Shuffles your weapons", null, true, false)] public void ShuffleWeapons() { GunControl instance = MonoSingleton.instance; if ((Object)(object)instance == (Object)null) { return; } List list = new List(); 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 num = 0; num < list.Count; num++) { switch (num % 6) { case 0: instance.slot1.Add(list[num]); break; case 1: instance.slot2.Add(list[num]); break; case 2: instance.slot3.Add(list[num]); break; case 3: instance.slot4.Add(list[num]); break; case 4: instance.slot5.Add(list[num]); break; case 5: instance.slot6.Add(list[num]); 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, false)] public void OneHit() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Everything is one hit now"); } [EventDescription("Flashes your screen like in the beginning of 7-1", null, true, false)] 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(); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"OptionsMenuToManager component not found!"); return; } Canvas component = ((Component)val).gameObject.GetComponent(); 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(); if ((Object)(object)val3 == (Object)null) { Debug.LogError((object)"Failed to add Image component to GameObject 'Flash'!"); return; } RectTransform component2 = ((Component)val3).GetComponent(); 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(); 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, false)] public void TimeStop() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("ZA WARUDO"); } [EventDescription("Sends you to a random level", null, true, false)] public void RandomLevel() { string[] array = new string[37] { "Level 0-1", "Level 0-2", "Level 0-3", "Level 0-4", "Level 0-5", "Level 1-1", "Level 1-2", "Level 1-3", "Level 1-4", "Level 2-1", "Level 2-2", "Level 2-3", "Level 2-4", "Level 3-1", "Level 3-2", "Level 4-1", "Level 4-2", "Level 4-3", "Level 4-4", "Level 5-1", "Level 5-2", "Level 5-3", "Level 5-4", "Level 6-1", "Level 6-2", "Level 7-1", "Level 7-2", "Level 7-3", "Level 7-4", "Level 8-1", "Level 8-2", "Level 8-3", "Level 8-4", "Level 0-E", "Level 1-E", "Level P-1", "Level P-2" }; string text = array[Random.Range(0, array.Length)]; AnnounceEvent("Don't like this mission, go to " + text.Replace("Level ", "") + " instead"); ((MonoBehaviour)this).StartCoroutine(delay(text)); } private IEnumerator delay(string randomLevel) { yield return (object)new WaitForSeconds(0.8f); SceneHelper.LoadScene(randomLevel, false); } private void AnnounceEvent(string message) { if (UltraEventsPlugin.Instance.announceEvents.Value) { MonoSingleton.Instance.SendHudMessage(message, "", "", 0, false, false, true); } } [EventDescription("Moves everything slightly", null, true, false)] 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(); 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.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, false)] 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.instance).transform.position, 70f); Object.Instantiate(UltraEventsPlugin.Ladnmine, randomNavMeshPoint, Quaternion.identity); } } [EventDescription("When you move, keep moving in that direction until you hit a wall", null, true, false)] public void ConstantMove() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Constantly movin"); } [EventDescription("Zaps a random enemy", null, true, 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(UltraEventsPlugin.nail).GetComponent(); component.HitEnemy(((Component)((Component)randomEnemyThatIsAlive).gameObject.GetComponentInChildren()).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.Instance.naiZapperRecharge = 0f; EnemyIdentifierIdentifier[] componentsInChildren = ((Component)randomEnemyThatIsAlive).GetComponentsInChildren(); 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(UltraEventsPlugin.sparknail, ((Component)val).transform.position, Quaternion.identity).transform; transform.localScale *= 0.5f; } } Object.Instantiate(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, false)] public void FireBulets() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Your bullets are on fire"); } [EventDescription("Spawns landmines on you every few seconds", null, true, false)] public void SpawnLandMinesOnYou() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Spawning landmines on you"); } [EventDescription("Swaps the player's position with a random enemy", null, true, 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.instance).transform.position; ((Component)MonoSingleton.instance).transform.position = position; AnnounceEvent("You swapped positions with " + randomEnemyThatIsAlive.FullName); } [EventDescription("Scales everything slightly", null, true, false)] 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(); 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.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, 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, 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 everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); if (everyEnemyThatAreAlive.Count > 0) { Vector3 playerPosition = ((Component)MonoSingleton.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, 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())) ? ((Component)randomEnemyThatIsAlive).gameObject.AddComponent() : ((Component)randomEnemyThatIsAlive).GetComponent()); val.bossName = randomEnemyThatIsAlive.FullName + " destroyer of worlds"; } } [EventDescription("Every object that has gravity goes to you", null, true, false)] public void EverythingAttractedToPlayer() { AnnounceEvent("Everything is now attracted to you"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Coins will kill you", null, true, false)] public void CoinsDontLikeYou() { AnnounceEvent("Coins don't like you anymore"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Turns your weapons (especially the shotgun and rocketlauncher) into automatic weapons", null, true, false)] public void AutomaticWeapons() { UltraEventsPlugin.Log.LogInfo((object)"full auto"); AnnounceEvent("Full auto"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Turns every nail (and saw) into a coin", null, true, false)] public void NailsAreNowCoins() { AnnounceEvent("i turned every nail into a coin :P"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Gives a bossbar to every enemy", null, true, true)] public void BossBarForEveryone() { List everyEnemy = ModUtils.GetEveryEnemy(); foreach (EnemyIdentifier item in everyEnemy) { ((Component)item).gameObject.AddComponent(); } AnnounceEvent("Everyone is a boss now"); } [EventDescription("Makes every enemy oiled up", null, true, true)] public void OilUp() { List 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, false)] 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(); val2.pickUpSound = new GameObject(); val2.itemType = (ItemType)4; val.AddComponent(); val.AddComponent(); Readable val3 = val.AddComponent(); val3.instantScan = true; List list = new List { "You like reading, right?", "Imagine the lore implications i could put in this book.", "TEXT SCRAMBLED - BRAIN CELL COUNT: DIMINISHING\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!", "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! \r\n\r\nThe pages of the book are blank, just like my social life.", "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 ", "My goodness! Is it 4:30? I am supposed to be having a back, sack and crack!", "Isaac and his mother lived alone in a small house on a hill. Isaac kept to himself - drawing pictures and playing with his toys as his mom watched Christian broadcasts on the television. Life was simple and they were both happy. That was, until the day Isaac's mom heard a voice from above. \"Your son has become corrupted by sin. He needs to be saved.\" \"I will do my best to save him, my Lord,\" Isaac's mother replied, rushing into Isaac's room, removing all that was evil from his life. Again, the voice called to her. \"Isaac's soul is still corrupt. He needs to be cut off from all that is evil in this world and confess his sins.\" \"I will follow your instructions, Lord. I have faith in Thee,\" Isaac's mother replied, as she locked Isaac in his room away from the evils of the world. One last time, Isaac's mom heard the voice of God calling to her. \"You've done as I've asked, but I still question your devotion to Me. To prove your faith, I will ask one more thing of you.\" \"Yes, Lord. Anything,\" Isaac's mother begged. \"To prove your love and devotion, I require a sacrifice. Your son, Isaac, will be this sacrifice. Go into his room and end his life, as an offering to Me to prove you love Me above all else.\" \"Yes, Lord,\" she replied, grabbing a butcher's knife from the kitchen. Isaac, watching through a crack in his door, trembled in fear. Scrambling around his room to find a hiding place, he noticed a trapdoor to the basement, hidden under his rug. Without hesitation, he flung open the hatch, just as his mother burst through his door, and threw himself down into the unknown depths below.", "Insert a reference to a popular game or movie or any sort of media here", "GAY", "bapanada", "Aaaay Huuundaaaaaaa!", "Doma! Doma! Doma-doma-doma!", "No...", "Your dad's my best friend", "No no no", "They're eating my flesh!" }; val3.content = list[Random.Range(0, list.Count)]; MonoSingleton.Instance.ForceHoldObject(val2); } [EventDescription("Bullets avoid enemies", null, true, false)] public void BulletsAfraidOfEnemies() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Bullets are afraid of enemies now"); } [EventDescription("Bullets explode", null, true, false)] public void BulletsExplode() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Bullets now explode"); } [EventDescription("You can infinitely dash", null, true, false)] public void InfiniteDashing() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("You can now infinitely dash"); } [EventDescription("Heals enemies to max health", null, true, true)] public void HealAllEnemies() { List everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); foreach (EnemyIdentifier item in everyEnemyThatAreAlive) { Enemy val = FindEnemyComponent(((Component)item).gameObject); if ((Object)(object)val != (Object)null) { val.health = val.originalHealth; item.health = val.originalHealth; } item.ForceGetHealth(); } AnnounceEvent("I healed all enemies lol"); } public static Enemy FindEnemyComponent(GameObject obj) { if ((Object)(object)obj == (Object)null) { return null; } Enemy component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { return component; } component = obj.GetComponentInChildren(true); if ((Object)(object)component != (Object)null) { return component; } return obj.GetComponentInParent(); } [EventDescription("Every enemy that you dont see disappears", null, true, false)] public void SchizophreniaUpdate() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Turns every enemy invisible", null, true, false)] public void InvisibleEnemies() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Enemies are now invisible"); } [EventDescription("Turns every projectile invisible", null, true, false)] public void InvisibleProjectiles() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Projectiles are now invisible"); } [EventDescription("Turns a random object into a random enemy", null, true, false)] 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 list = Object.FindObjectsOfType().ToList(); list.RemoveAll((MeshRenderer x) => ((Object)x).name.Contains("Bloodstain")); GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject; List list2 = Resources.FindObjectsOfTypeAll().ToList(); list2.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1); SpawnableObject val = list2[Random.Range(0, list2.Count)]; GameObject val2 = Object.Instantiate(val.gameObject, gameObject.transform.position, val.gameObject.transform.rotation); Renderer[] componentsInChildren = ((Component)val2.transform).GetComponentsInChildren(); foreach (Renderer val3 in componentsInChildren) { val3.enabled = false; } if ((Object)(object)val2.GetComponent() != (Object)null) { val2.GetComponent().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())) { gameObject.GetComponent().enabled = false; } if (Object.op_Implicit((Object)(object)gameObject.GetComponent())) { Object.Destroy((Object)(object)gameObject.GetComponent()); } gameObject.transform.rotation = ((Component)transform).transform.rotation; gameObject.transform.localRotation = Quaternion.identity; gameObject.gameObject.transform.localPosition = Vector3.zero; Collider[] componentsInChildren2 = ((Component)gameObject.transform).GetComponentsInChildren(); foreach (Collider val4 in componentsInChildren2) { val4.enabled = false; } val2.GetComponent().spawnIn = false; AnnounceEvent(((Object)gameObject).name + " hates you now"); } catch (Exception) { } } [EventDescription("Makes every enemy's weakpoint 3 times larger", null, true, 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 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, false)] public void EnemyHorde() { ((MonoBehaviour)this).StartCoroutine(SpawnHorde()); } [EventDescription("Causes your screen to shake", null, true, false)] public void EarthQuake() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("EARTHQUAKE!!!"); } [EventDescription("Inverts your controls", null, true, false)] public void InvertControls() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Get inverted"); } [EventDescription("Makes 2 enemies swap positions", null, true, true)] public void Swap2Enemies() { List 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)]; } AnnounceEvent(val.FullName + " swapped places with " + val2.FullName); } } [EventDescription("Makes projectiles bounce", null, true, false)] public void BouncyBullets() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("Bullets bounce now!"); } [EventDescription("Makes every enemy tiny", null, true, 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 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(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, false)] public void GiveTask() { switch (Random.Range(0, 2)) { case 1: { Task task2 = TaskManager.Instance.Tasker.AddComponent(); TaskManager.Instance.AddTask(task2); break; } case 0: { Task task = TaskManager.Instance.Tasker.AddComponent(); TaskManager.Instance.AddTask(task); break; } } } [EventDescription("Adds gravity to random objects", null, true, false)] public void AddGravityToRandomObjects() { List list = Object.FindObjectsOfType().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 num2 = 0; num2 < num; num2++) { if (list.Count <= 0) { break; } GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject; gameObject.AddComponent(); } AnnounceEvent(num + " objects have discovered gravity"); } [EventDescription("reduces your pixels", null, true, false)] public void GoGoGadgetPixelReducer() { UltraEventsPlugin.Instance.EffectManager.AddComponent(); AnnounceEvent("go go gadget pixel reducer!"); } [EventDescription("Removes random Objects", null, true, false)] public void RemoveRandomObjects() { List list = Object.FindObjectsOfType().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 num2 = 0; num2 < num; num2++) { if (list.Count <= 0) { break; } GameObject gameObject = ((Component)list[Random.Range(0, list.Count)]).gameObject; MeshRenderer component = gameObject.GetComponent(); 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, false)] 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>(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, false)] public void RemoveCharge() { AnnounceEvent("no charge?"); MonoSingleton.Instance.raicharge = 0f; } [EventDescription("Removes your stamina", null, true, false)] public void RemoveStamina() { AnnounceEvent("no stamina?"); ModUtils.GetPlayerTransform().EmptyStamina(); } [EventDescription("Duplicates every enemy", null, true, 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 everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); foreach (EnemyIdentifier item in everyEnemyThatAreAlive) { EnemyIdentifier val = Object.Instantiate(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, false)] 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()[0]; NewMovement playerTransform = ModUtils.GetPlayerTransform(); VirtueInsignia val2 = Object.Instantiate(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, 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 everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); VirtueInsignia val = Resources.FindObjectsOfTypeAll()[0]; foreach (EnemyIdentifier item in everyEnemyThatAreAlive) { VirtueInsignia val2 = Object.Instantiate(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, false)] 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(); UltraEventsPlugin.Instance.catRenderer = val.GetComponent(); 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 images = JsonConvert.DeserializeObject>(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, false)] 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 source = ((Component)((Component)ModUtils.GetPlayerTransform()).transform).GetComponentsInChildren().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(); RectTransform component = ((Component)val).GetComponent(); 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(); 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, false)] public void FakeParry() { MonoSingleton.Instance.ParryFlash(); } [EventDescription("Just straight up kills you.", null, true, false)] public void KillPlayer() { AnnounceEvent("DIE"); ModUtils.GetPlayerTransform().GetHurt(int.MaxValue, false, 1f, false, false, 0.35f, false); } [EventDescription("Removes some style points", null, true, false)] public void RemoveStyle() { AnnounceEvent("im gonna take some style points real quick"); int num = Random.Range(0, MonoSingleton.Instance.stylePoints); StatsManager instance = MonoSingleton.Instance; instance.stylePoints -= num; } [EventDescription("Forces you to equip the other arm", null, true, false)] public void SwitchArm() { FistControl val = Object.FindObjectOfType(); val.ScrollArm(); } [EventDescription("Smoothly swaps 2 objects positions", null, true, false)] public void SwapPos() { List list = Object.FindObjectsOfType().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, 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, false)] 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, 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, false)] 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() == (Object)null) { Object.Instantiate(UltraEventsPlugin.Instance.fishingCanvas, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity); } GunSetter gs = Object.FindObjectOfType(); ModUtils.AttachWeapon(1, "", UltraEventsPlugin.Instance.rot, gs); } catch (Exception ex) { AnnounceEvent(ex.Message); } } [EventDescription("Sands every enemy", null, true, true)] public void noHeals() { AnnounceEvent("no heals?"); List everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); foreach (EnemyIdentifier item in everyEnemyThatAreAlive) { item.Sandify(false); } } [EventDescription("Places you underwater", null, true, false)] public void water() { AnnounceEvent("hello how are you? i am under the water"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Blesses every enemy", null, true, false)] public void BlessthemAll() { AnnounceEvent("enemies now are protected by god"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Makes you teleport back to your previous position", null, true, false)] public void Lag() { AnnounceEvent("your ping is so high"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Spawns a random enemy", null, true, false)] 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 list = Resources.FindObjectsOfTypeAll().ToList(); list.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1); SpawnableObject val = list[Random.Range(0, list.Count)]; Object.Instantiate(val.gameObject, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity); AnnounceEvent("spawned " + val.objectName); } [EventDescription("Gives you a duel wield", null, true, false)] 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.Instance)) { MonoSingleton.Instance.CameraShake(0.35f); if ((int)MonoSingleton.Instance.playerType == 1) { MonoSingleton.Instance.AddExtraHit(3); break; } GameObject val = new GameObject(); val.transform.SetParent(((Component)MonoSingleton.Instance).transform, true); val.transform.localRotation = Quaternion.identity; DualWield[] componentsInChildren = ((Component)MonoSingleton.Instance).GetComponentsInChildren(); 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(); 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, false)] public void MarioTime() { AnnounceEvent("Mario time"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Removes every weapon", null, true, false)] public void NoWeapons() { AnnounceEvent("no weapons?"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Removes every fist", null, true, false)] public void NoFist() { AnnounceEvent("no fists?"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Reduces the amount of damage taken", null, true, false)] public void LessDamage() { AnnounceEvent("You take less damage now"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Increases the amount of damage taken", null, true, false)] public void MoreDamage() { AnnounceEvent("You take more damage now"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Decreases the speed", null, true, false)] public void SlowMotion() { AnnounceEvent("wow this is slow"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Randomizes time", null, true, false)] public void Timewarp() { AnnounceEvent("Time is warping!"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Increases the speed", null, true, false)] public void FastMotion() { AnnounceEvent("wow this is Fast"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Makes it rain plushies!!!!", null, true, false)] public void PlushRain() { AnnounceEvent("Plush rain!!!!"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Adds gravity to random objects", null, true, false)] public void AddGravityToRandomObject() { List list = Object.FindObjectsOfType().ToList(); GameObject val = list[Random.Range(0, list.Count)]; AnnounceEvent(((Object)val).name + " discovered gravity"); val.AddComponent(); } [EventDescription("Removes a random object (anything is an object btw)", null, true, false)] public void RemoveRandomObject() { List list = Object.FindObjectsOfType().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, false)] public void FireGun() { AnnounceEvent("gonna fire your gun"); GunControl val = Object.FindObjectOfType(); GameObject currentWeapon = val.currentWeapon; if (Object.op_Implicit((Object)(object)currentWeapon.GetComponent())) { Revolver component = currentWeapon.GetComponent(); 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 component2 = currentWeapon.GetComponent(); 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 component3 = currentWeapon.GetComponent(); 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 component4 = currentWeapon.GetComponent(); 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 component5 = currentWeapon.GetComponent(); 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, false)] public void Meteor() { ((MonoBehaviour)this).StartCoroutine(MeteorShower()); AnnounceEvent("METEOR SHOWER INCOMING"); } [EventDescription("Spawns 8 cerberus projectiles around you", null, true, false)] 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(UltraEventsPlugin.CerbApples, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity); Projectile[] componentsInChildren = val.GetComponentsInChildren(); 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(UltraEventsPlugin.Meteor, ModUtils.GetRandomNavMeshPoint(((Component)ModUtils.GetPlayerTransform()).transform.position, 40f), randomYRotation); metoer.GetComponentInChildren(); yield return (object)new WaitForSeconds(UltraEventsPlugin.Instance.AmountOfTime.Value / 15f); } } [EventDescription("Reverses gravity. Wont go back unless triggered again", null, true, false)] 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, 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, true)] public void KillAllEnemies() { List everyEnemyThatAreAlive = ModUtils.GetEveryEnemyThatAreAlive(); foreach (EnemyIdentifier item in everyEnemyThatAreAlive) { item.InstaKill(); } AnnounceEvent("DIE EVERYONE!"); } [EventDescription("Forces you to hold a random weapon", null, true, false)] public void ChooseRandomWeapon() { AnnounceEvent("Here let me choose for you"); GunControl val = Object.FindObjectOfType(); int num = Random.Range(0, val.slots.Count); val.SwitchWeapon(num, (int?)Random.Range(0, 2), false, false, false); } [EventDescription("Buffs a random enemy", null, true, 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, 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(randomEnemyThatIsAlive, ((Component)randomEnemyThatIsAlive).transform.position, ((Component)randomEnemyThatIsAlive).transform.rotation); ((Component)val).transform.localScale = ((Component)randomEnemyThatIsAlive).transform.localScale; AnnounceEvent("i added another " + ((object)Unsafe.As(ref randomEnemyThatIsAlive.enemyType)/*cast due to .constrained prefix*/).ToString()); } [EventDescription("Explodes every enemy", null, true, 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 list = Resources.FindObjectsOfTypeAll().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(val2, ((Component)val).transform.position, Quaternion.identity); } } [EventDescription("Forces you to switch to the previous weapon", "Go back to the other weapon", true, false)] public void usePreviousWeapon() { AnnounceEvent("go back to the other weapon"); GunControl val = Object.FindObjectOfType(); if (val.slots[val.lastSlotIndex - 1] != null) { val.SwitchWeapon(val.lastSlotIndex, (int?)val.lastVariationIndex, false, false, false); } } [EventDescription("Makes your screen glitchy", null, true, false)] public void GlitchyScreen() { AnnounceEvent("Glitching"); UltraEventsPlugin.Instance.EffectManager.AddComponent(); } [EventDescription("Does a simon says", null, true, false)] public void SimonSays() { Type randomMonoBehaviourFromNamespace = GetRandomMonoBehaviourFromNamespace("UltraEvents.MonoBehaviours.SimonSays.Says"); if (randomMonoBehaviourFromNamespace != null) { Debug.Log((object)("Selected MonoBehaviour: " + randomMonoBehaviourFromNamespace.Name)); ((Component)UltraEventsPlugin.Instance).gameObject.AddComponent(randomMonoBehaviourFromNamespace); } else { Debug.Log((object)"No MonoBehaviours found in the namespace."); } } private Type GetRandomMonoBehaviourFromNamespace(string targetNamespace) { Type[] types = Assembly.GetExecutingAssembly().GetTypes(); Type[] array = types.Where((Type t) => t.IsClass && !t.IsAbstract && t.IsSubclassOf(typeof(MonoBehaviour)) && t.Namespace == targetNamespace).ToArray(); return (array.Length != 0) ? array[Random.Range(0, array.Length)] : null; } [EventDescription("Spawns an idol on every enemy", null, true, false)] public void SpawnIdolOnEnemies() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) AnnounceEvent("Idols to every enemy!"); List currentEnemies = MonoSingleton.Instance.GetCurrentEnemies(); foreach (EnemyIdentifier item in currentEnemies) { Object.Instantiate(UltraEventsPlugin.Idol, ((Component)item).transform.position, Quaternion.identity); } } [EventDescription("Removes the current weapon you are holding", null, true, false)] public void RemoveWeapon() { AnnounceEvent("you dont need this right?"); GunControl val = Object.FindObjectOfType(); GameObject currentWeapon = val.currentWeapon; val.allWeapons.Remove(currentWeapon); foreach (List 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, true)] public void TPEnemiesToPlayer() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) AnnounceEvent("teleports behind you"); List 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, false)] 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, false)] public void DoEveryEvent() { ((MonoBehaviour)this).StartCoroutine(LaunchAllEvents()); } private IEnumerator LaunchAllEvents() { List Config)>> enabledEvents = UltraEventsPlugin.events.Where((KeyValuePair Config)> e) => e.Value.Method.Name != "DoEveryEvent").ToList(); Debug.Log((object)$"Starting to launch {enabledEvents.Count} events."); foreach (KeyValuePair)> info in enabledEvents) { try { Debug.Log((object)("Invoking event: " + info.Value.Item1.Name)); info.Value.Item1.Invoke(this, null); } catch (Exception arg) { Debug.LogError((object)$"Error invoking event {info.Value.Item1.Name}: {arg}"); } 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 shaderDictionary = new Dictionary(); private static HashSet modifiedMaterials = new HashSet(); public static IEnumerator LoadShadersAsync() { AsyncOperationHandle 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 shaderHandle = Addressables.LoadAssetAsync((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)(() => LoadedShaders)); if (allGameObjects == null) { yield break; } foreach (GameObject gameObject in allGameObjects) { if ((Object)(object)gameObject == (Object)null) { continue; } Renderer[] componentsInChildren = gameObject.GetComponentsInChildren(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)(() => LoadedShaders)); if ((Object)(object)gameObject == (Object)null) { yield break; } Renderer[] componentsInChildren = gameObject.GetComponentsInChildren(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 Config)> events = new Dictionary)>(); 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 plushies = new List(); public GameObject fishingCanvas; public GameObject Zombie; public Shader unlitShader; public float timer = 5f; public ConfigEntry AmountOfTime; public ConfigEntry maxAmountOfObjects; public ConfigEntry maxAmountOfFilth; public ConfigEntry maxAmountOfDualWields; public ConfigEntry amountOfLandMines; public ConfigEntry amountOfMeteors; public ConfigEntry FalconPunchPower; public ConfigEntry TimeScaleFastMotion; public ConfigEntry TimeScaleSlowMotion; public ConfigEntry rmeoveEffects; public ConfigEntry DebugThing; public ConfigEntry DiscordActivity; public ConfigEntry TimerText; public ConfigEntry DoEvent; public ConfigEntry RemoveEffects; public ConfigEntry announceEvents; public ConfigEntry everyFewSeconds; public ConfigEntry OnButtonPress; public static ConfigEntry OnSecretReceived; public static ConfigEntry OnParry; public static ConfigEntry OnEnemyDeath; public static ConfigEntry GetHurt; public static ConfigEntry GetStyle; public static ConfigEntry WeaponSwap; public static ConfigEntry 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; public static GameObject Idol; private string[] plushieKeys = new string[35] { "DevPlushie (Jacob)", "DevPlushie (Mako)", "DevPlushie (HEALTH - Jake)", "DevPlushie (Dalia)", "DevPlushie", "DevPlushie (Jericho)", "DevPlushie (Meganeko)", "DevPlushie (Tucker)", "DevPlushie (BigRock)", "DevPlushie (King Gizzard)", "DevPlushie (Dawg)", "DevPlushie (Sam)", "Mandy Levitating", "DevPlushie (Cameron)", "DevPlushie (FlyingDog)", "DevPlushie (Gianni)", "DevPlushie (Salad)", "DevPlushie (Mandy)", "DevPlushie (Joy)", "DevPlushie (Weyte)", "DevPlushie (Zombie)", "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 links = new List(); 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)> @event in events) { Log.LogInfo((object)@event.Key); try { if (!(@event.Key == "DoEveryEvent")) { @event.Value.Item2.Value = true; } } catch (Exception ex) { Debug.LogError((object)("Failed to enable event " + @event.Key + ": " + ex.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)> 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("Values", "Time Between Events", 5f, (ConfigDescription)null); maxAmountOfObjects = ((BaseUnityPlugin)this).Config.Bind("Values", "max amount of objects", 20, "tied to the 'RemoveRandomObjectsEvent' you can choose what the maximum amount is"); maxAmountOfFilth = ((BaseUnityPlugin)this).Config.Bind("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("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("Values", "amount of land mines", 30, "tied to the 'SpawnLandMines' you can choose how many landmines spawn"); amountOfMeteors = ((BaseUnityPlugin)this).Config.Bind("Values", "amount of meteors", 15, "tied to the 'Meteor' you can choose how many meteors spawn"); FalconPunchPower = ((BaseUnityPlugin)this).Config.Bind("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("Values", "fast motion time", 3f, "tied to the 'fast motion' you can choose how fast it goes"); TimeScaleSlowMotion = ((BaseUnityPlugin)this).Config.Bind("Values", "slows motion time", 0.3f, "tied to the 'slow motion' you can choose how slow it goes"); FalconPunchPower = ((BaseUnityPlugin)this).Config.Bind("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("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("Values", "announce events", true, "when this is disabled it wont announce what event itll activate no more"); everyFewSeconds = ((BaseUnityPlugin)this).Config.Bind("Triggers", "every few seconds", true, "every few seconds an event will trigger"); DebugThing = ((BaseUnityPlugin)this).Config.Bind("Values", "Debug", false, "This is for the developer to see if events trigger correctly"); DiscordActivity = ((BaseUnityPlugin)this).Config.Bind("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("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("Values", "Do Event button", (KeyCode)116, "Only used when On Key Bind Press is on"); RemoveEffects = ((BaseUnityPlugin)this).Config.Bind("Values", "Remove Effects button", (KeyCode)109, "Only used when On Key Bind Press is on"); OnSecretReceived = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Secret Found", false, "will trigger an event when you find a secret"); OnParry = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Parry", false, "will trigger an event when you parry"); OnEnemyDeath = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Enemy Death", false, "will trigger an event when you kill an enemy"); GetHurt = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Get Hurt", false, "will trigger an event when you receive damage"); GetStyle = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Get Style", false, "will trigger an event when you receive Style"); WeaponSwap = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Weapon Swap", false, "will trigger an event when you swap weapons"); PickUp = ((BaseUnityPlugin)this).Config.Bind("Triggers", "On Item Pick Up", false, "will trigger an event when grab an item"); OnButtonPress = ((BaseUnityPlugin)this).Config.Bind("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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Expected O, but got Unknown ((Object)((Component)this).gameObject).hideFlags = (HideFlags)4; Instance = this; Theevents = ((Component)this).gameObject.AddComponent(); 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(); Assembly executingAssembly = Assembly.GetExecutingAssembly(); ((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: UltraEvents, VersionString: 1.0.0 is loading..."); Harmony.PatchAll(); unlitShader = Addressables.LoadAssetAsync((object)"Assets/Shaders/Main/ULTRAKILL-unlit.shader").WaitForCompletion(); SceneManager.sceneLoaded -= SceneManager_sceneLoaded; 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_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown if ((Object)(object)this == (Object)null) { return; } 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()); } if ((Object)(object)Idol == (Object)null) { ((MonoBehaviour)this).StartCoroutine(LoadIdol()); } upsideDownMaterial.SetFloat("_Intensity", 0f); GameObject val = null; foreach (object item in ((Component)MonoSingleton.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.material = upsideDownMaterial; } if ((Object)(object)Countodnw != (Object)null) { Countdown = Object.Instantiate(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 plushieHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => 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(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 RodHandle = Addressables.LoadAssetAsync((object)prefabKey); ((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd"); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); ((BaseUnityPlugin)this).Logger.LogInfo((object)"rooddddd"); if ((int)RodHandle.Status == 1 && (Object)(object)RodHandle.Result != (Object)null) { rot = RodHandle.Result; } else { ((BaseUnityPlugin)this).Logger.LogError((object)("Failed to load fishing rod: " + ((object)RodHandle.Status/*cast due to .constrained prefix*/).ToString())); } } private IEnumerator LoadUI() { string prefabKey = "Assets/Prefabs/UI/FishingCanvas.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); fishingCanvas = RodHandle.Result; } private IEnumerator LoadIdol() { string prefabKey = "Assets/Prefabs/Enemies/Idol.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); Idol = RodHandle.Result; } private IEnumerator LoadFilth() { string prefabKey = "Assets/Prefabs/Enemies/Zombie.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); Zombie = RodHandle.Result; } private IEnumerator LoadNail() { string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Nails/Nail.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); nail = RodHandle.Result; } private IEnumerator LoadNailSpark() { string prefabKey = "Assets/Particles/SparksNail.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); sparknail = RodHandle.Result; } private IEnumerator LoadLightning() { string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion Lightning.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); Lightning = RodHandle.Result; } private IEnumerator LoadWicked() { string prefabKey = "Assets/Prefabs/Enemies/Wicked.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); WickedObject = RodHandle.Result; } private IEnumerator LoadLit() { string prefabKey = "Assets/Shaders/Main/ULTRAKILL-vertexlit.shader"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); VertexLit = RodHandle.Result; } private IEnumerator LoadLandmine() { string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Landmine.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); Ladnmine = RodHandle.Result; } private void RemoveEffect() { if (!rmeoveEffects.Value) { return; } Effect[] components = EffectManager.GetComponents(); 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 = val2.Find("Bone001"); Transform val4 = val3.Find("Spine_01"); return val4.Find("TheEnemyObject"); } private void FixedUpdate() { NewMovement playerTransform = ModUtils.GetPlayerTransform(); if (!((Object)(object)playerTransform == (Object)null) && ((Behaviour)playerTransform).enabled && IsGameplayScene()) { HandleCountdownEvent(); HandleInputEvents(); } } private void HandleCountdownEvent() { if (everyFewSeconds.Value) { timer -= Time.fixedDeltaTime; if ((Object)(object)Countdown != (Object)null) { int num = Mathf.FloorToInt(timer); float num2 = timer - (float)num; string text = string.Format("{0}{1}", num, num2.ToString(".00")); TextMeshProUGUI component = ((Component)Countdown.transform.Find("Countdown").Find("EventCountdown")).GetComponent(); ((TMP_Text)component).text = text; } if (timer <= 0f) { UseRandomEventAndRemoveEffects(); timer = AmountOfTime.Value; } } } private void HandleInputEvents() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (OnButtonPress.Value) { if (Input.GetKeyDown(DoEvent.Value)) { UseRandomEventAndRemoveEffects(); } if (Input.GetKeyDown(RemoveEffects.Value)) { RemoveEffect(); } } } public void UseRandomEventAndRemoveEffects() { RemoveEffect(); UseRandomEvent(FromTrouble: false); } private void InitializeEvents() { IEnumerable enumerable = from m in typeof(Events).GetMethods(BindingFlags.Instance | BindingFlags.Public) where m.GetParameters().Length == 0 && m.DeclaringType == typeof(Events) select m; foreach (MethodInfo item2 in enumerable) { string text = item2.Name; bool flag = true; EventDescriptionAttribute customAttribute = item2.GetCustomAttribute(); string text2 = ((customAttribute != null) ? customAttribute.Description : ("Enable or disable the " + text)); if (customAttribute != null) { text = ((customAttribute.Name != null) ? customAttribute.Name : item2.Name); flag = customAttribute.DefaultValue; } ConfigEntry item = ((BaseUnityPlugin)this).Config.Bind("Events", text, flag, text2); events[text] = (item2, item); } Debug.Log((object)events.Count); } public void UseRandomEvent(bool FromTrouble) { List)>> list = events.Where(delegate(KeyValuePair Config)> e) { bool value = e.Value.Config.Value; bool flag = !(e.Value.Method.Name == "DoEveryEvent") || !FromTrouble; return value && flag; }).ToList(); if (list.Count == 0) { Console.WriteLine("No events are enabled."); return; } KeyValuePair)> keyValuePair = list[Random.Range(0, list.Count)]; if (keyValuePair.Value.Item1.GetCustomAttribute().requiresEnemies && ModUtils.GetEveryEnemy().Count <= 0) { UseRandomEvent(FromTrouble: false); return; } Console.WriteLine("Triggering event: " + keyValuePair.Key); if (DebugThing.Value) { MonoSingleton.instance.SendHudMessage("Triggering event: " + keyValuePair.Key, "", "", 0, false, false, true); } if (DiscordActivity.Value) { DiscordController.Instance.cachedActivity.Details = "Current Active Event: " + keyValuePair.Key; DiscordController.Instance.SendActivity(); } keyValuePair.Value.Item1.Invoke(Theevents, null); } } } namespace UltraEvents.Utils { internal static class ModUtils { public static NewMovement GetPlayerTransform() { return MonoSingleton.Instance; } public static List GetEveryEnemy() { List list = Object.FindObjectsOfType().ToList(); return (list != null) ? list : new List(); } public static List GetEveryEnemyThatAreAlive() { List everyEnemy = GetEveryEnemy(); if (everyEnemy == null || everyEnemy.Count == 0) { return new List(); } everyEnemy.RemoveAll((EnemyIdentifier x) => (Object)(object)x == (Object)null || x.dead); return everyEnemy; } public static EnemyIdentifier getRandomEnemy() { List everyEnemy = GetEveryEnemy(); if (everyEnemy == null || everyEnemy.Count == 0) { return null; } return everyEnemy[Random.Range(0, everyEnemy.Count)]; } public static EnemyIdentifier getRandomEnemyThatIsAlive() { List everyEnemyThatAreAlive = GetEveryEnemyThatAreAlive(); if (everyEnemyThatAreAlive == null || everyEnemyThatAreAlive.Count == 0) { return null; } return everyEnemyThatAreAlive[Random.Range(0, everyEnemyThatAreAlive.Count)]; } public static Vector3 GetRandomNavMeshPoint(Vector3 origin, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) Vector3 val = Random.insideUnitSphere * radius; val += origin; NavMeshHit val2 = default(NavMeshHit); if (NavMesh.SamplePosition(val, ref val2, radius, -1)) { return ((NavMeshHit)(ref val2)).position; } return origin; } public static List GetEverythingOfType(Predicate matchThing = null) where T : Object { List list = Resources.FindObjectsOfTypeAll().ToList(); if (matchThing != null) { list.RemoveAll(matchThing); } return list; } public static void AttachWeapon(int tempSlot, string pPref, GameObject weapon, GunSetter gs) { bool flag = false; if (pPref != "") { flag = GameProgressSaver.CheckGear(pPref) != 0 && MonoSingleton.Instance.GetInt("weapon." + pPref, 0) != 0; if (!flag) { MonoSingleton.Instance.SetInt("weapon." + pPref, 1); if (!SceneHelper.IsPlayingCustom) { GameProgressSaver.AddGear(pPref); } } } MonoSingleton.Instance.noWeapons = false; if ((Object)(object)gs != (Object)null) { ((Behaviour)gs).enabled = true; gs.ResetWeapons(false); } if (!flag) { for (int i = 0; i < MonoSingleton.Instance.slots[tempSlot].Count; i++) { if (((Object)MonoSingleton.Instance.slots[tempSlot][i]).name == ((Object)weapon).name + "(Clone)") { flag = true; } } } if (!flag) { GameObject item = Object.Instantiate(weapon, ((Component)MonoSingleton.Instance).transform); MonoSingleton.Instance.slots[tempSlot].Add(item); MonoSingleton.Instance.ForceWeapon(weapon, true); MonoSingleton.Instance.noWeapons = false; MonoSingleton.Instance.UpdateWeaponList(false); } else { if (!SceneHelper.IsPlayingCustom) { return; } for (int j = 0; j < MonoSingleton.Instance.slots[tempSlot].Count; j++) { if (((Object)MonoSingleton.Instance.slots[tempSlot][j]).name == ((Object)weapon).name + "(Clone)") { MonoSingleton.Instance.ForceWeapon(weapon, true); MonoSingleton.Instance.noWeapons = false; MonoSingleton.Instance.UpdateWeaponList(false); } } } } } } namespace UltraEvents.Patches { [HarmonyPatch(typeof(Revolver), "Update")] internal class AutoFire { public static bool Prefix(ref Revolver __instance) { if (!UltraEventsPlugin.AutomaticFireEffectActive) { return true; } __instance.ReadyGun(); return true; } } [HarmonyPatch(typeof(Shotgun), "Update")] internal class AutoFireShot { public static bool Prefix(ref Shotgun __instance) { if (!UltraEventsPlugin.AutomaticFireEffectActive) { return true; } __instance.ReadyGun(); return true; } } [HarmonyPatch(typeof(EnemyIdentifier), "Start")] public class EnemyDeathPatch { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__0_0; internal void b__0_0() { if (UltraEventsPlugin.OnEnemyDeath.Value) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } public static void Postfix(EnemyIdentifier __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown UnityEvent onDeath = __instance.onDeath; object obj = <>c.<>9__0_0; if (obj == null) { UnityAction val = delegate { if (UltraEventsPlugin.OnEnemyDeath.Value) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } }; <>c.<>9__0_0 = val; obj = (object)val; } onDeath.AddListener((UnityAction)obj); } } [HarmonyPatch(typeof(StyleHUD), "AddPoints")] public class GetStylePatch { private static bool _isProcessing; public static void Postfix() { if (UltraEventsPlugin.GetStyle.Value) { UltraEventsPlugin.Log.LogInfo((object)_isProcessing); if (!_isProcessing) { ((MonoBehaviour)UltraEventsPlugin.Instance).StartCoroutine(DelayedEvent()); } } } private static IEnumerator DelayedEvent() { _isProcessing = true; yield return (object)new WaitForSecondsRealtime(0.1f); _isProcessing = false; UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } [HarmonyPatch(typeof(NewMovement), "GetHurt")] public class HurtPlayerPatch { public static void Postfix(int damage) { if (UltraEventsPlugin.GetHurt.Value && damage > 0) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } [HarmonyPatch(typeof(ItemIdentifier), "PickUp")] public class OnPickUpTrigger { public static void Postfix() { if (UltraEventsPlugin.PickUp.Value) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } [HarmonyPatch(typeof(GunControl))] internal class OnWeaponSwapTrigger { [HarmonyPatch("SwitchWeapon")] public static void Postfix() { if (UltraEventsPlugin.WeaponSwap.Value) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } [HarmonyPatch(typeof(TimeController), "ParryFlash")] public class ParryPatch { public static void Postfix() { if (UltraEventsPlugin.OnParry.Value) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } [HarmonyPatch(typeof(Bonus), "OnTriggerEnter")] public class SecretPatch { [HarmonyPostfix] private static void post(ref bool ___activated, Collider other) { if (UltraEventsPlugin.OnSecretReceived.Value && ((Component)other).gameObject.CompareTag("Player") && !___activated) { UltraEventsPlugin.Instance.UseRandomEventAndRemoveEffects(); } } } } namespace UltraEvents.MonoBehaviours { internal class BounceOffProjectiles : MonoBehaviour { [SerializeField] private float bounceRadius = 10f; [SerializeField] private float bounceForce = 50000f; [SerializeField] private float maxDistance = 1f; private void Update() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_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_009b: Unknown result type (might be due to invalid IL or missing references) RaycastHit[] array = Physics.SphereCastAll(((Component)this).transform.position, bounceRadius, ((Component)this).transform.forward, maxDistance); RaycastHit[] array2 = array; Projectile val2 = default(Projectile); Magnet val3 = default(Magnet); Grenade val4 = default(Grenade); for (int i = 0; i < array2.Length; i++) { RaycastHit val = array2[i]; if ((Object)(object)((RaycastHit)(ref val)).rigidbody != (Object)null && (((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val2) || ((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val3) || ((Component)((RaycastHit)(ref val)).collider).TryGetComponent(ref val4))) { ((RaycastHit)(ref val)).rigidbody.AddExplosionForce(bounceForce, ((Component)this).transform.position, bounceRadius); } } } } public class Effect : MonoBehaviour { public virtual void RemoveEffect() { } } internal class HealthRememberer : MonoBehaviour { public float health; } internal class MoveAndTurn : MonoBehaviour { private float moveSpeed = 0.5f; public float minAngle = 0f; public float maxAngle = 360f; private bool collided; public void Awake() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) Rigidbody val = default(Rigidbody); if (((Component)this).gameObject.TryGetComponent(ref val)) { val.constraints = (RigidbodyConstraints)126; if (((Component)this).gameObject.GetComponentsInChildren() != null || ((Component)this).gameObject.GetComponentsInChildren().Length != 0) { MeshCollider[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren(); MeshCollider[] array = componentsInChildren; foreach (MeshCollider val2 in array) { val2.convex = true; } } } else { val = ((Component)this).gameObject.AddComponent(); Rigidbody obj = val; Rigidbody obj2 = val; RigidbodyConstraints constraints = (RigidbodyConstraints)126; obj2.constraints = (RigidbodyConstraints)126; obj.constraints = constraints; } } public void FixedUpdate() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) Vector3 forward = ((Component)this).transform.forward; forward.y = 0f; Transform transform = ((Component)this).transform; transform.position += forward * moveSpeed; } private void OnCollisionEnter(Collision collision) { //IL_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) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!collided) { collided = true; float num = Random.Range(0f - maxAngle, maxAngle); Quaternion rotation = ((Component)this).transform.rotation; float z = ((Quaternion)(ref rotation)).eulerAngles.z; float num2 = Random.Range(0f - maxAngle, maxAngle); Quaternion rotation2 = Quaternion.Euler(num2, num, z); ((Component)this).transform.rotation = rotation2; } } private void OnCollisionExit(Collision collision) { collided = false; } } internal class RemoveOnUnseen : MonoBehaviour { public GameObject theObject; public List unseens = new List(); public bool TheisSeen = false; private void OnBecameInvisible() { bool flag = false; if (unseens != null || unseens.Count == 0) { TheisSeen = false; foreach (RemoveOnUnseen unseen in unseens) { flag = unseen.TheisSeen; if (flag) { break; } } } if (!flag) { if ((Object)(object)theObject == (Object)null) { Debug.LogWarning((object)"ruh roh raggy"); } if ((Object)(object)theObject.GetComponent() != (Object)null) { theObject.GetComponent().InstaKill(); } Object.Destroy((Object)(object)theObject); } } private void OnBecameVisible() { TheisSeen = true; } } public class ShaderApplier : MonoBehaviour { public Material material; private void OnRenderImage(RenderTexture src, RenderTexture dest) { Graphics.Blit((Texture)(object)src, dest, material); } } public abstract class Task : MonoBehaviour { private string _ToDo; public string WhatToDo; public float TimeToFinish = 5f; public virtual string ToDo { get { return _ToDo; } set { _ToDo = value; } } private void Awake() { WhatToDo = ToDo; ((MonoBehaviour)this).Invoke("TheirAwake", 0.01f); } public virtual void TheirAwake() { } private void Update() { TimeToFinish -= Time.deltaTime; CheckIfWon(); if (TimeToFinish <= 0f) { TimeRanOut(); } } public virtual void CheckIfWon() { } public virtual void Won() { TaskManager.Instance.RemoveTask(this); } public virtual void TimeRanOut() { TaskManager.Instance.RemoveTask(this); MonoSingleton.Instance.SendHudMessage("Times up!!!!", "", "", 0, false, false, true); } } public class TaskManager : MonoBehaviour { public List tasks = new List(); public GameObject Tasker; private GameObject tasksText; private TextMeshProUGUI text; public static TaskManager Instance { get; private set; } private void Awake() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown Instance = this; Tasker = new GameObject("tasker"); Tasker.transform.parent = ((Component)this).transform; SceneManager.sceneLoaded += SceneManager_sceneLoaded; } private void SceneManager_sceneLoaded(Scene arg0, LoadSceneMode arg1) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) List source = Object.FindObjectsOfType().ToList(); Canvas val = source.First((Canvas x) => ((Object)x).name.ToLower() == "canvas"); tasksText = new GameObject("tasksText"); tasksText.transform.parent = ((Component)val).transform; tasksText.transform.localPosition = new Vector3(-527.5945f, 313f, 0f); tasksText.transform.localScale = Vector3.one; text = tasksText.AddComponent(); ((TMP_Text)text).alignment = (TextAlignmentOptions)513; ((TMP_Text)text).text = "tasks:"; ((TMP_Text)text).fontSize = 63f; ((TMP_Text)text).enableWordWrapping = false; tasksText.AddComponent(); tasksText.SetActive(false); } public void AddTask(Task task) { TextMeshProUGUI val = text; ((TMP_Text)val).text = ((TMP_Text)val).text + "\n-" + task.ToDo; tasks.Add(task); tasksText.SetActive(true); } public void RemoveTask(Task task) { string text = ((TMP_Text)this.text).text; string whatToDo = task.WhatToDo; Debug.Log((object)whatToDo); string text2 = "\n-" + whatToDo; int num = text.IndexOf(text2); if (num != -1) { string text3 = text.Remove(num, text2.Length); ((TMP_Text)this.text).text = text3; Debug.Log((object)("Modified Text: " + text3)); } else { Debug.Log((object)"Pattern not found in the text."); } tasks.Remove(task); Object.Destroy((Object)(object)task); if (tasks.Count == 0) { tasksText.SetActive(false); } } public void ChangeToDo(string Prev, string New) { string text = ((TMP_Text)this.text).text; string text2 = "\n-" + Prev; int num = text.IndexOf(text2); if (num != -1) { string text3 = text.Substring(0, text.IndexOf(text2)); string text4 = text.Substring(text.IndexOf(text2) + text2.Length); string text5 = text3 + "\n-" + New + text4; ((TMP_Text)this.text).text = text5; Debug.Log((object)("Modified Text: " + text5)); } else { Debug.Log((object)"Pattern not found in the text."); } } } } namespace UltraEvents.MonoBehaviours.Tasks { public class KillEnemyTask : Task { private bool done = false; private int amount; public override string ToDo { get { return "Kill an enemy"; } set { base.ToDo = value; } } public override void TheirAwake() { amount = MonoSingleton.Instance.kills + 1; TimeToFinish = 15f; MonoSingleton.Instance.SendHudMessage("you have 15 seconds to kill an enemy", "", "", 0, false, false, true); base.TheirAwake(); } public override void CheckIfWon() { if (MonoSingleton.Instance.kills >= amount) { MonoSingleton.Instance.SendHudMessage("YOU RECEIVE: EVERYONE DEAD", "", "", 0, false, false, true); foreach (EnemyIdentifier currentEnemy in MonoSingleton.Instance.GetCurrentEnemies()) { currentEnemy.InstaKill(); } Won(); } base.CheckIfWon(); } public override void TimeRanOut() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (Physics.gravity.y < 0f) { Physics.gravity *= -1f; } else { List list = Resources.FindObjectsOfTypeAll().ToList(); list.RemoveAll((SpawnableObject x) => (int)x.spawnableObjectType != 1); SpawnableObject val = list[Random.Range(0, list.Count)]; Object.Instantiate(val.gameObject, ((Component)ModUtils.GetPlayerTransform()).transform.position, Quaternion.identity); } base.TimeRanOut(); } } public class TestTask : Task { private bool done = false; private int amount; public override string ToDo { get { return "Get 50 Style"; } set { base.ToDo = value; } } public override void TheirAwake() { amount = Random.Range(MonoSingleton.Instance.stylePoints, MonoSingleton.Instance.stylePoints + 1000); TaskManager.Instance.ChangeToDo("Get 50 Style", "Get " + amount + " style"); WhatToDo = "Get " + amount + " style"; TimeToFinish = 25f; MonoSingleton.Instance.SendHudMessage("you have 25 seconds to get " + (amount - MonoSingleton.Instance.stylePoints) + " style", "", "", 0, false, false, true); base.TheirAwake(); } public override void CheckIfWon() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) if (MonoSingleton.Instance.stylePoints >= amount) { MonoSingleton.Instance.SendHudMessage("YOU RECEIVE: DUAL WIELD", "", "", 0, false, false, true); int num = Random.Range(1, 15); for (int i = 0; i < num; i++) { if (Object.op_Implicit((Object)(object)MonoSingleton.Instance)) { MonoSingleton.Instance.CameraShake(0.35f); if ((int)MonoSingleton.Instance.playerType == 1) { MonoSingleton.Instance.AddExtraHit(3); return; } GameObject val = new GameObject(); val.transform.SetParent(((Component)MonoSingleton.Instance).transform, true); val.transform.localRotation = Quaternion.identity; DualWield[] componentsInChildren = ((Component)MonoSingleton.Instance).GetComponentsInChildren(); 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(); val2.delay = 0.05f; val2.juiceAmount = 30f; if (componentsInChildren != null && componentsInChildren.Length != 0) { val2.delay += (float)componentsInChildren.Length / 20f; } } } Won(); } base.CheckIfWon(); } public override void TimeRanOut() { ModUtils.GetPlayerTransform().GetHurt(int.MaxValue, false, 1f, false, false, 0.35f, false); base.TimeRanOut(); } } } namespace UltraEvents.MonoBehaviours.SimonSays { internal class SimonSaysIt : MonoBehaviour { protected bool simonSaidIt; protected bool playerResponded; public float timeLimit = 5f; private Coroutine timerCoroutine; private float currentTimer; public virtual string task => "STANDARD TEXT"; protected virtual void Start() { simonSaidIt = Random.Range(0, 100) > 50; StartTimer(); } protected void StartTimer() { if (timerCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(timerCoroutine); } currentTimer = timeLimit; timerCoroutine = ((MonoBehaviour)this).StartCoroutine(TimerCountdown()); } private void Update() { if (checkIfDone()) { playerResponded = true; } } public virtual bool checkIfDone() { return false; } private IEnumerator TimerCountdown() { while (currentTimer > 0f && !playerResponded) { yield return null; currentTimer -= Time.deltaTime; } if (!playerResponded) { if (!simonSaidIt) { DidIt(); } else { Fail(); } } else if (simonSaidIt) { DidIt(); } else { Fail(); } } public virtual void DidIt() { Object.Destroy((Object)(object)this); } public virtual void Fail() { MonoSingleton.Instance.SendHudMessage("You failed Simon Says!", "", "", 0, false, false, true); MonoSingleton.Instance.GetHurt(100000, false, 1f, false, false, 0.35f, false); Debug.Log((object)"You failed Simon Says!"); Object.Destroy((Object)(object)this); } public void SimonSaysCommand(bool didSimonSayIt) { simonSaidIt = didSimonSayIt; playerResponded = false; StartTimer(); } private void OnGUI() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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_0022: Expected O, but got Unknown //IL_007f: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 24, alignment = (TextAnchor)1 }; string text = (simonSaidIt ? $"Simon Says: {task}, {currentTimer:F1}" : $"Do: {task}, {currentTimer:F1}"); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 20f, (float)Screen.width, 50f); GUI.Label(val2, text, val); } } } namespace UltraEvents.MonoBehaviours.SimonSays.Says { internal class Dash : SimonSaysIt { public override string task => "Dash"; public override bool checkIfDone() { if (MonoSingleton.Instance.InputSource.Dodge.WasPerformedThisFrame) { return true; } return false; } } internal class Shoot : SimonSaysIt { public override string task => "Shoot"; public override bool checkIfDone() { if (MonoSingleton.Instance.InputSource.Fire1.IsPressed || MonoSingleton.Instance.InputSource.Fire2.IsPressed) { return true; } return false; } } internal class SwapWeapons : SimonSaysIt { public static bool checking; public override string task => "Swap your weapon"; private void Awake() { checking = true; } public override bool checkIfDone() { if (OnWeaponSwap.swapped) { OnWeaponSwap.swapped = false; checking = false; return true; } return false; } } [HarmonyPatch(typeof(GunControl))] public class OnWeaponSwap { public static bool swapped; [HarmonyPatch("SwitchWeapon")] public static void Postfix() { if (SwapWeapons.checking) { swapped = true; } } } internal class KillAnEnemy : SimonSaysIt { public int amountOfEnemiesAlive = 0; public override string task => "Kill an enemy"; public override bool checkIfDone() { List currentEnemies = MonoSingleton.Instance.GetCurrentEnemies(); if (currentEnemies.Count > amountOfEnemiesAlive) { amountOfEnemiesAlive = currentEnemies.Count; } if (currentEnemies.Count < amountOfEnemiesAlive) { return true; } return false; } } } namespace UltraEvents.MonoBehaviours.Effects { public class aboohwaer : Effect { private GameObject llewaer; private void Awake() { MakeWater(); } public void MakeWater() { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) llewaer = GameObject.CreatePrimitive((PrimitiveType)3); ((Object)llewaer).name = "UE WATER!!!"; llewaer.AddComponent(); llewaer.GetComponent().isKinematic = true; llewaer.GetComponent().isTrigger = true; llewaer.AddComponent(); llewaer.GetComponent().clr = new Color(0f, 0.5f, 1f); ((Renderer)llewaer.GetComponent()).enabled = false; llewaer.transform.localScale = Vector3.one * 1E+10f; } public override void RemoveEffect() { Object.Destroy((Object)(object)llewaer); base.RemoveEffect(); } } public class AttachEverythingToPlayer : Effect { public float speed = 25f; public int maxAttachedObjects = UltraEventsPlugin.Instance.maxAmountOfObjects.Value; private List attachedObjects = new List(); private void FixedUpdate() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) Rigidbody[] array = Object.FindObjectsOfType(); Rigidbody[] array2 = array; foreach (Rigidbody val in array2) { if ((Object)(object)val != (Object)(object)MonoSingleton.Instance.rb) { if (!attachedObjects.Contains(val) && attachedObjects.Count < maxAttachedObjects) { attachedObjects.Add(val); } if (attachedObjects.Contains(val)) { Vector3 val2 = ((Component)MonoSingleton.Instance).transform.position - ((Component)val).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; val.velocity = normalized * speed; } } } attachedObjects.RemoveAll((Rigidbody item) => (Object)(object)item == (Object)null); } } public class AutomaticWeaponsEffectcs : Effect { private void Start() { UltraEventsPlugin.AutomaticFireEffectActive = true; RocketLauncher[] array = Resources.FindObjectsOfTypeAll(); RocketLauncher[] array2 = array; foreach (RocketLauncher val in array2) { val.rateOfFire = 0.01f; } } public override void RemoveEffect() { UltraEventsPlugin.AutomaticFireEffectActive = false; RocketLauncher[] array = Resources.FindObjectsOfTypeAll(); RocketLauncher[] array2 = array; foreach (RocketLauncher val in array2) { val.rateOfFire = 0.25f; } } } public class BlessAll : Effect { private void Update() { List list = Object.FindObjectsOfType().ToList(); list.RemoveAll((EnemyIdentifier x) => x.blessed); if (list.Count <= 0) { return; } foreach (EnemyIdentifier item in list) { item.Bless(false); } } public override void RemoveEffect() { List list = Object.FindObjectsOfType().ToList(); list.RemoveAll((EnemyIdentifier x) => !x.blessed); if (list.Count > 0) { foreach (EnemyIdentifier item in list) { item.Unbless(false); } } base.RemoveEffect(); } } [HarmonyPatch(typeof(Projectile), "Collided")] internal class BouncyProj : Effect { private static bool active; private void Start() { active = true; } public override void RemoveEffect() { base.RemoveEffect(); active = false; } [HarmonyPrefix] public static bool Prefix(Projectile __instance, Collider other) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) if (!active) { return true; } if (IsEnemyOrPlayer(other)) { return true; } Vector3 val = Vector3.Reflect(__instance.rb.velocity, ((Component)other).transform.up); __instance.rb.velocity = val; ((Component)__instance).transform.rotation = Quaternion.LookRotation(val); return true; } private static bool IsEnemyOrPlayer(Collider other) { if (((Component)other).gameObject.CompareTag("Player")) { return true; } EnemyIdentifierIdentifier val = default(EnemyIdentifierIdentifier); if (((Component)other).gameObject.TryGetComponent(ref val)) { return true; } return false; } } public class BulletsAfraidEnemies : Effect { private HashSet enemiesProcessed = new HashSet(); private List addedComponents = new List(); private void Update() { EnemyIdentifier[] array = Object.FindObjectsOfType(); EnemyIdentifier[] array2 = array; foreach (EnemyIdentifier val in array2) { if (!enemiesProcessed.Contains(val) && !val.dead) { BounceOffProjectiles item = ((Component)val).gameObject.AddComponent(); addedComponents.Add(item); enemiesProcessed.Add(val); } } } public override void RemoveEffect() { foreach (BounceOffProjectiles addedComponent in addedComponents) { if ((Object)(object)addedComponent != (Object)null) { Object.Destroy((Object)(object)addedComponent); } } addedComponents.Clear(); enemiesProcessed.Clear(); base.RemoveEffect(); } } [HarmonyPatch(typeof(CameraController))] internal class CameraShake : Effect { private static bool IsActive; private void Start() { MonoSingleton.instance.cameraShaking = 50f; IsActive = true; } private void Update() { MonoSingleton.instance.cameraShaking = 50f; } public override void RemoveEffect() { IsActive = false; MonoSingleton.instance.StopShake(); } [HarmonyPatch("StopShake")] public static bool Prefix() { return !IsActive; } } public class ConstantMovement : Effect { [Header("Movement")] [SerializeField] private float moveSpeed = 5f; [Header("Wall Detection")] [SerializeField] private LayerMask wallLayer; [SerializeField] private float characterRadius = 0.4f; [SerializeField] private float skinWidth = 0.05f; private bool isLocked = false; private Vector3 lockedDirection; private void Awake() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) wallLayer = LayerMaskDefaults.Get((LMD)1); moveSpeed = MonoSingleton.Instance.walkSpeed; MonoSingleton.Instance.walkSpeed = 0f; } private void Update() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) if (!isLocked) { Vector2 val = MonoSingleton.Instance.InputSource.Move.ReadValue(); if (((Vector2)(ref val)).sqrMagnitude > 0.01f) { Vector3 val2 = new Vector3(val.x, 0f, val.y); Vector3 normalized = ((Vector3)(ref val2)).normalized; lockedDirection = normalized; isLocked = true; } } else { MoveLocked(); } } private void MoveLocked() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) Transform transform = ((Component)MonoSingleton.Instance).transform; float num = moveSpeed / 2f * Time.deltaTime; RaycastHit val = default(RaycastHit); if (Physics.SphereCast(transform.position, characterRadius, lockedDirection, ref val, num + skinWidth, LayerMask.op_Implicit(wallLayer))) { float num2 = Mathf.Max(0f, ((RaycastHit)(ref val)).distance - skinWidth); transform.position += lockedDirection * num2; isLocked = false; } else { transform.position += lockedDirection * num; } } public override void RemoveEffect() { isLocked = false; MonoSingleton.Instance.walkSpeed = moveSpeed; base.RemoveEffect(); } } [HarmonyPatch] internal class EverythingIsOneHit : Effect { public static bool IsActive; private void Start() { IsActive = true; } public override void RemoveEffect() { IsActive = false; } [HarmonyPatch(typeof(NewMovement), "GetHurt")] public static bool Prefix(ref int damage, bool invincible, float scoreLossMultiplier = 1f, bool explosion = false, bool instablack = false, float hardDamageMultiplier = 0.35f, bool ignoreInvincibility = false) { if (!IsActive) { return true; } damage = 500000; return true; } [HarmonyPatch(typeof(EnemyIdentifier), "DeliverDamage")] [HarmonyPrefix] public static bool PrefixENemy(EnemyIdentifier __instance, ref float multiplier) { if (!IsActive) { return true; } multiplier = 50000000f; return true; } } [HarmonyPatch(typeof(Projectile), "Start")] internal class ExplodingBulletsEffect : Effect { private static List explosions; private static bool IsActive; private void Start() { IsActive = true; explosions = ModUtils.GetEverythingOfType((Predicate)((ExplosionController x) => ((Object)x).name.ToLower().Contains("fire"))); } public override void RemoveEffect() { IsActive = false; base.RemoveEffect(); } public static bool Prefix(Projectile __instance) { if (!IsActive) { return true; } __instance.explosionEffect = ((Component)explosions[Random.Range(0, explosions.Count)]).gameObject; return true; } } internal class FALCONPUNCH : Effect { private List punches = new List(); private void Start() { punches = ModUtils.GetEverythingOfType((Predicate)null); } private void Update() { foreach (Punch punch in punches) { punch.force = UltraEventsPlugin.Instance.FalconPunchPower.Value * 100f; punch.damage = UltraEventsPlugin.Instance.FalconPunchPower.Value; } } public override void RemoveEffect() { //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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Invalid comparison between Unknown and I4 foreach (Punch punch in punches) { FistType type = punch.type; if ((int)type == 0) { punch.damage = 1f; punch.force = 25f; return; } if ((int)type != 1) { return; } punch.force = 100f; punch.damage = 2.5f; } base.RemoveEffect(); } } public class Fastmotion : Effect { private void Awake() { Time.timeScale = UltraEventsPlugin.Instance.TimeScaleFastMotion.Value; MonoSingleton.Instance.timeScaleModifier = UltraEventsPlugin.Instance.TimeScaleFastMotion.Value; } public override void RemoveEffect() { Time.timeScale = 1f; MonoSingleton.Instance.timeScaleModifier = 1f; base.RemoveEffect(); } } [HarmonyPatch] internal class FireBullets : Effect { private static bool IsActive; public void Start() { IsActive = true; } public override void RemoveEffect() { IsActive = false; base.RemoveEffect(); } [HarmonyPatch(typeof(Projectile), "Collided")] public static void Postfix(Projectile __instance, Collider other) { if (IsActive && ((Component)other).gameObject.GetComponentsInChildren() != null) { Flammable[] componentsInChildren = ((Component)other).gameObject.GetComponentsInChildren(); foreach (Flammable val in componentsInChildren) { val.Burn(4f, false); } } } } internal class GottaGoQuick : Effect { private GameObject trail; private void Start() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) NewMovement instance = MonoSingleton.instance; instance.walkSpeed *= 5f; trail = Object.Instantiate(UltraEventsPlugin.BlueTrail, ((Component)MonoSingleton.instance).transform.position, Quaternion.identity); trail.transform.parent = ((Component)MonoSingleton.instance).transform; } public override void RemoveEffect() { if (!((Object)(object)trail == (Object)null)) { NewMovement instance = MonoSingleton.instance; instance.walkSpeed /= 5f; Object.Destroy((Object)(object)trail); } } } internal class InfiniteDash : Effect { private void Update() { MonoSingleton.instance.boostCharge = 300f; } } [HarmonyPatch] internal class InvertControls : Effect { private static bool IsActive; private void Start() { IsActive = true; } public override void RemoveEffect() { IsActive = false; } private static MethodBase TargetMethod() { return typeof(InputActionState).GetMethod("ReadValue").MakeGenericMethod(typeof(Vector2)); } private static void Postfix(ref Vector2 __result, InputActionState __instance) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (IsActive && !(__instance.Action.name != "Move")) { __result = new Vector2(0f - __result.x, 0f - __result.y); } } } public class InvisProj : Effect { private void Update() { Projectile[] array = Object.FindObjectsOfType(); Projectile[] array2 = array; foreach (Projectile val in array2) { Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren(); Renderer[] array3 = componentsInChildren; foreach (Renderer val2 in array3) { val2.enabled = false; } } } public override void RemoveEffect() { Projectile[] array = Object.FindObjectsOfType(); Projectile[] array2 = array; foreach (Projectile val in array2) { Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren(); Renderer[] array3 = componentsInChildren; foreach (Renderer val2 in array3) { val2.enabled = true; } } base.RemoveEffect(); } } public class InvisEnemies : Effect { private void Update() { EnemyIdentifier[] array = Object.FindObjectsOfType(); EnemyIdentifier[] array2 = array; foreach (EnemyIdentifier val in array2) { Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren(); Renderer[] array3 = componentsInChildren; foreach (Renderer val2 in array3) { val2.enabled = false; } } } public override void RemoveEffect() { EnemyIdentifier[] array = Object.FindObjectsOfType(); EnemyIdentifier[] array2 = array; foreach (EnemyIdentifier val in array2) { Renderer[] componentsInChildren = ((Component)val).gameObject.GetComponentsInChildren(); Renderer[] array3 = componentsInChildren; foreach (Renderer val2 in array3) { val2.enabled = true; } } base.RemoveEffect(); } } public class Lagging : Effect { private class PositionSnapshot { public Vector3 position; public Vector3 velocity; public float timeStamp; public float boostCharge; public int health; public WeaponCharges weaponCharges; public PositionSnapshot(Transform transform, Rigidbody rb, float boost, int hp) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0050: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Expected O, but got Unknown position = transform.position; velocity = rb.velocity; timeStamp = Time.time; boostCharge = boost; health = hp; weaponCharges = new WeaponCharges { raicharge = MonoSingleton.instance.raicharge, naiAmmo = MonoSingleton.instance.naiAmmo, rev0charge = MonoSingleton.instance.rev0charge, rev1charge = MonoSingleton.instance.rev1charge, rev2charge = MonoSingleton.instance.rev2charge, rocketCannonballCharge = MonoSingleton.instance.rocketCannonballCharge, rocketFreezeTime = MonoSingleton.instance.rocketFreezeTime, rocketNapalmFuel = MonoSingleton.instance.rocketNapalmFuel }; } } private Queue positionBuffer; private bool isEnabled = true; private float maxBufferTime = 2f; private float minStutterDuration = 0.2f; private float maxStutterDuration = 0.8f; private float minTimeBetweenStutters = 0.5f; private float maxTimeBetweenStutters = 2f; private float stutterChance = 0.7f; private float catchupChance = 0.3f; private void Awake() { positionBuffer = new Queue(); ((MonoBehaviour)this).StartCoroutine("lag"); } private IEnumerator lag() { float nextStutterTime = 0f; while (isEnabled) { NewMovement playerTransform = ModUtils.GetPlayerTransform(); positionBuffer.Enqueue(new PositionSnapshot(((Component)playerTransform).transform, playerTransform.rb, playerTransform.boostCharge, playerTransform.hp)); while (positionBuffer.Count > 0 && Time.time - positionBuffer.Peek().timeStamp > maxBufferTime) { positionBuffer.Dequeue(); } if (Time.time >= nextStutterTime) { float stutterDuration = Random.Range(minStutterDuration, maxStutterDuration); yield return ((MonoBehaviour)this).StartCoroutine(CreateLagSpike(stutterDuration)); nextStutterTime = Time.time + Random.Range(minTimeBetweenStutters, maxTimeBetweenStutters); } yield return null; } } private IEnumerator CreateLagSpike(float duration) { if (positionBuffer.Count < 2) { yield break; } float startTime = Time.time; PositionSnapshot oldestSnapshot = positionBuffer.Peek(); NewMovement playerTransform = ModUtils.GetPlayerTransform(); NewMovement newMovement = ((Component)playerTransform).GetComponent(); Vector3 originalPosition = ((Component)playerTransform).transform.position; Vector3 originalVelocity = playerTransform.rb.velocity; float originalBoostCharge = newMovement.boostCharge; while (Time.time - startTime < duration) { if (Random.value < stutterChance) { ((Component)playerTransform).transform.position = oldestSnapshot.position; playerTransform.rb.velocity = oldestSnapshot.velocity; newMovement.boostCharge = oldestSnapshot.boostCharge; MonoSingleton.instance.raicharge = oldestSnapshot.weaponCharges.raicharge; MonoSingleton.instance.naiAmmo = oldestSnapshot.weaponCharges.naiAmmo; MonoSingleton.instance.rev0charge = oldestSnapshot.weaponCharges.rev0charge; MonoSingleton.instance.rev1charge = oldestSnapshot.weaponCharges.rev1charge; MonoSingleton.instance.rev2charge = oldestSnapshot.weaponCharges.rev2charge; MonoSingleton.instance.rocketCannonballCharge = oldestSnapshot.weaponCharges.rocketCannonballCharge; MonoSingleton.instance.rocketFreezeTime = oldestSnapshot.weaponCharges.rocketFreezeTime; MonoSingleton.instance.rocketNapalmFuel = oldestSnapshot.weaponCharges.rocketNapalmFuel; int healthDiff = oldestSnapshot.health - playerTransform.hp; if (healthDiff < 0) { playerTransform.GetHurt(Mathf.Abs(healthDiff), false, 1f, false, false, 0.35f, false); } else if (healthDiff > 0) { playerTransform.GetHealth(healthDiff, true, false, true); } yield return (object)new WaitForSeconds(Random.Range(0.05f, 0.15f)); } if (Random.value < catchupChance) { ((Component)playerTransform).transform.position = originalPosition; playerTransform.rb.velocity = originalVelocity; newMovement.boostCharge = originalBoostCharge; yield return (object)new WaitForSeconds(Random.Range(0.02f, 0.08f)); } yield return null; } } } internal class MarioJumpEffect : Effect { private void Start() { NewMovement instance = MonoSingleton.instance; instance.jumpPower *= 2f; } public override void RemoveEffect() { if (MonoSingleton.instance.jumpPower != 90f) { NewMovement instance = MonoSingleton.instance; instance.jumpPower /= 2f; base.RemoveEffect(); } } } [HarmonyPatch(typeof(NewMovement), "GetHurt")] internal class MoreDamageEffect : Effect { private static bool actived; private void Start() { actived = true; } public override void RemoveEffect() { actived = false; base.RemoveEffect(); } public static bool Prefix(ref int damage) { if (!actived) { return true; } damage *= 2; return true; } } [HarmonyPatch(typeof(NewMovement), "GetHurt")] internal class LessDamageEffect : Effect { private static bool actived; private void Start() { actived = true; } public override void RemoveEffect() { actived = false; base.RemoveEffect(); } public static bool Prefix(ref int damage) { if (!actived) { return true; } damage /= 2; return true; } } internal class LowGravity : Effect { private void Start() { //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) Physics.gravity /= 2f; } public override void RemoveEffect() { //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) Physics.gravity *= 2f; base.RemoveEffect(); } } [HarmonyPatch(typeof(Nail), "Start")] public class NailToCoin : Effect { private static bool IsActive; private static GameObject lecoin; private void Start() { IsActive = true; ((MonoBehaviour)this).StartCoroutine(GetCoin()); } private IEnumerator GetCoin() { string prefabKey = "Assets/Prefabs/Attacks and Projectiles/Coin.prefab"; AsyncOperationHandle RodHandle = Addressables.LoadAssetAsync((object)prefabKey); yield return (object)new WaitUntil((Func)(() => RodHandle.IsDone)); lecoin = RodHandle.Result; } public override void RemoveEffect() { IsActive = false; base.RemoveEffect(); } public static bool Prefix(Nail __instance) { //IL_001c: 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_0040: Unknown result type (might be due to invalid IL or missing references) if (!IsActive) { return true; } GameObject val = Object.Instantiate(lecoin, ((Component)__instance).transform.position, ((Component)__instance).transform.rotation); Rigidbody component = val.GetComponent(); component.velocity = __instance.rb.velocity; Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } } internal class NoHudEffect : Effect { private void Start() { ((Component)HudController.Instance).gameObject.SetActive(false); } public override void RemoveEffect() { ((Component)HudController.Instance).gameObject.SetActive(true); base.RemoveEffect(); } } public class NoRicoshots : Effect { private void Update() { Coin[] array = Object.FindObjectsOfType(); Coin[] array2 = array; foreach (Coin val in array2) { if (!val.shot) { val.shot = true; val.EnemyReflect(); } } } } internal class NoFists : Effect { private void Start() { if ((Object)(object)MonoSingleton.Instance == (Object)null) { ((Component)this).gameObject.AddComponent(); } MonoSingleton.Instance.NoFist(); } public override void RemoveEffect() { MonoSingleton.Instance.YesFist(); } } internal class NoWeaponss : Effect { private void Start() { if ((Object)(object)MonoSingleton.instance == (Object)null) { ((Component)this).gameObject.AddComponent(); } MonoSingleton.instance.NoWeapon(); } public override void RemoveEffect() { MonoSingleton.instance.YesWeapon(); } } internal class PixelReducer : Effect { private int NormalPixelization = 0; public void Awake() { NormalPixelization = MonoSingleton.Instance.GetInt("pixelization", 0); int num = Random.Range(0, 7); MonoSingleton.Instance.SetInt("pixelization", num); float num2 = 0f; switch (num) { case 0: num2 = 0f; break; case 1: num2 = 720f; break; case 2: num2 = 480f; break; case 3: num2 = 360f; break; case 4: num2 = 240f; break; case 5: num2 = 144f; break; case 6: num2 = 36f; break; } Shader.SetGlobalFloat("_ResY", num2); PostProcessV2_Handler instance = MonoSingleton.Instance; if (Object.op_Implicit((Object)(object)instance)) { instance.downscaleResolution = num2; } DownscaleChangeSprite[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { array[i].CheckScale(); } } public override void RemoveEffect() { int normalPixelization = NormalPixelization; MonoSingleton.Instance.SetInt("pixelization", normalPixelization); float num = 0f; switch (normalPixelization) { case 0: num = 0f; break; case 1: num = 720f; break; case 2: num = 480f; break; case 3: num = 360f; break; case 4: num = 240f; break; case 5: num = 144f; break; case 6: num = 36f; break; } Shader.SetGlobalFloat("_ResY", num); PostProcessV2_Handler instance = MonoSingleton.Instance; if (Object.op_Implicit((Object)(object)instance)) { instance.downscaleResolution = num; } DownscaleChangeSprite[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { array[i].CheckScale(); } base.RemoveEffect(); } } public class PlushRain : Effect { private void Update() { //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) if (!MonoSingleton.Instance.paused) { List plushies = UltraEventsPlugin.plushies; plushies.RemoveAll((GameObject x) => !((Object)x).name.ToLower().Contains("plushie")); GameObject val = plushies[Random.Range(0, plushies.Count)]; int num = 1 << LayerMask.NameToLayer("Environment"); int num2 = 1 << LayerMask.NameToLayer("Outdoors"); int num3 = num | num2; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(((Component)ModUtils.GetPlayerTransform()).transform.position, Vector3.up, ref val2, 50f, num3)) { Object.Instantiate(val, ((RaycastHit)(ref val2)).point, Quaternion.identity); } else { Object.Instantiate(val, ((Component)ModUtils.GetPlayerTransform()).transform.position + Vector3.up * 50f, Quaternion.identity); } } } } [HarmonyPatch(typeof(Projectile), "Start")] internal class ProjectilesHomeAtEnemies : Effect { private static bool active; private void Start() { active = true; } public override void RemoveEffect() { active = false; base.RemoveEffect(); } public static bool Prefix(Projectile __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown if (!active || !__instance.playerBullet) { return true; } __instance.homingType = (HomingType)4; __instance.target = new EnemyTarget(ModUtils.getRandomEnemyThatIsAlive()); return true; } } internal class ScreenDistortion : Effect { public void Awake() { ScreenDistortionField val = ((Component)MonoSingleton.Instance).gameObject.AddComponent(); val.distance = 5000f; } public override void RemoveEffect() { base.RemoveEffect(); Object.Destroy((Object)(object)((Component)MonoSingleton.Instance).gameObject.GetComponent()); } } public class Slowmotion : Effect { private void Awake() { Time.timeScale = UltraEventsPlugin.Instance.TimeScaleSlowMotion.Value; MonoSingleton.Instance.timeScaleModifier = UltraEventsPlugin.Instance.TimeScaleSlowMotion.Value; } public override void RemoveEffect() { Time.timeScale = 1f; MonoSingleton.Instance.timeScaleModifier = 1f; base.RemoveEffect(); } } public class SomethingWickedThisWayComes : Effect { private GameObject spawnedWicked; private DisableEnemySpawns spawns; private Color originalAmbientLight; private bool originalFog; private float originalFogDensity; private Color originalFogColor; private Dictionary instances = new Dictionary(); private Light flashLight; private bool effectActive = false; private HashSet lightsChecked = new HashSet(); private void Start() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e1: 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_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011a: 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_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) originalAmbientLight = RenderSettings.ambientLight; originalFog = RenderSettings.fog; originalFogDensity = RenderSettings.fogDensity; originalFogColor = RenderSettings.fogColor; BeginEffect(); spawns = new DisableEnemySpawns(); spawns.Enable(MonoSingleton.Instance); Transform transform = ((Component)Object.FindObjectOfType()).transform; EnemyIdentifier[] array = Object.FindObjectsOfType(); EnemyIdentifier[] array2 = array; foreach (EnemyIdentifier val in array2) { val.InstaKill(); } if ((Object)(object)transform == (Object)null) { transform = ((Component)Object.FindObjectOfType()).transform; } Vector3 val2 = new Vector3(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)); Vector3 normalized = ((Vector3)(ref val2)).normalized; RaycastHit val3 = default(RaycastHit); Physics.Raycast(((Component)MonoSingleton.Instance).transform.position + normalized * (float)Random.Range(10, 10), Vector3.down, ref val3, 25f, LayerMask.op_Implicit(LayerMaskDefaults.Get((LMD)1))); Vector3 point = ((RaycastHit)(ref val3)).point; spawnedWicked = Object.Instantiate(UltraEventsPlugin.WickedObject, point, UltraEventsPlugin.WickedObject.transform.rotation); spawnedWicked.GetComponent().patrolPoints = (Transform[])(object)new Transform[1]; spawnedWicked.GetComponent().patrolPoints[0] = ((Component)MonoSingleton.Instance).transform; } public void BeginEffect() { effectActive = true; flashLight = ((Component)MonoSingleton.Instance).gameObject.AddComponent(); flashLight.type = (LightType)0; flashLight.range = 30f; flashLight.spotAngle = 80f; flashLight.intensity = 2f; SlowTickGetLights(); } private void SlowTickGetLights() { Light[] array = Resources.FindObjectsOfTypeAll(); for (int i = 0; i < array.Length; i++) { ProcessLight(array[i]); } ((MonoBehaviour)this).Invoke("SlowTickGetLights", 5f); } private void LateUpdate() { //IL_007f: Unknown result type (might be due to invalid IL or missing references) if (!effectActive) { return; } List list = instances.Keys.ToList(); for (int i = 0; i < list.Count; i++) { if (!((Object)(object)list[i] == (Object)null) && !((Object)(object)list[i] == (Object)null)) { ((Behaviour)list[i]).enabled = false; RenderSettings.ambientLight = Color.black; RenderSettings.fog = false; } } } public bool CanBeginEffect() { return true; } private void ProcessLight(Light light) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Invalid comparison between Unknown and I4 if (!lightsChecked.Contains(((Object)light).GetInstanceID())) { lightsChecked.Add(((Object)light).GetInstanceID()); if ((((Object)light).hideFlags & 8) == 0 && (((Object)light).hideFlags & 0x2F) <= 0 && (!((Object)(object)light == (Object)(object)flashLight) || !((Behaviour)light).enabled)) { instances.Add(light, ((Behaviour)light).enabled); } } } public override void RemoveEffect() { //IL_008e: 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) effectActive = false; if ((Object)(object)flashLight != (Object)null) { Object.Destroy((Object)(object)flashLight); flashLight = null; } List list = instances.Keys.ToList(); for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i] != (Object)null) { ((Behaviour)list[i]).enabled = instances[list[i]]; } } RenderSettings.ambientLight = originalAmbientLight; RenderSettings.fog = originalFog; RenderSettings.fogDensity = originalFogDensity; RenderSettings.fogColor = originalFogColor; instances.Clear(); lightsChecked.Clear(); spawns.Disable(); ((MonoBehaviour)this).CancelInvoke("SlowTickGetLights"); Object.Destroy((Object)(object)spawnedWicked); } } public class SpawnLandminesEveryFewSeconds : Effect { private float AmountOfLandmines; private void Start() { AmountOfLandmines = Random.Range(10, 30); ((MonoBehaviour)this).StartCoroutine(spawnLandmines()); } private IEnumerator spawnLandmines() { while (true) { Object.Instantiate(UltraEventsPlugin.Ladnmine, ((Component)MonoSingleton.instance).transform.position, Quaternion.identity); yield return (object)new WaitForSecondsRealtime(UltraEventsPlugin.Instance.AmountOfTime.Value / AmountOfLandmines); } } public override void RemoveEffect() { ((MonoBehaviour)this).StopAllCoroutines(); } } internal class sSchizophreniaUpdateEffect : Effect { private HashSet alreadyDoneRenderers = new HashSet(); private List activeRemoveComponents = new List(); private List enemyCache = new List(); private List goreCache = new List(); private List explosionCache = new List(); private void Start() { CacheObjects(); } private void CacheObjects() { enemyCache.AddRange(Resources.FindObjectsOfTypeAll()); goreCache.AddRange(Resources.FindObjectsOfTypeAll()); explosionCache.AddRange(Resources.FindObjectsOfTypeAll()); } private void Update() { OptimizeObjectType(enemyCache); OptimizeObjectType(goreCache); OptimizeObjectType(explosionCache); } private void OptimizeObjectType(List cache) where T : Component { foreach (T item in cache) { if ((Object)(object)item == (Object)null) { continue; } Renderer[] componentsInChildren = ((Component)item).GetComponentsInChildren(true); Renderer[] array = componentsInChildren; foreach (Renderer val in array) { if (!alreadyDoneRenderers.Contains(val)) { RemoveOnUnseen removeOnUnseen = ((Component)val).gameObject.AddComponent(); removeOnUnseen.theObject = ((Component)item).gameObject; activeRemoveComponents.Add(removeOnUnseen); alreadyDoneRenderers.Add(val); } } } } public override void RemoveEffect() { foreach (RemoveOnUnseen activeRemoveComponent in activeRemoveComponents) { if ((Object)(object)activeRemoveComponent != (Object)null) { Object.Destroy((Object)(object)activeRemoveComponent); } } activeRemoveComponents.Clear(); alreadyDoneRenderers.Clear(); } } internal class TimeStop : Effect { private struct AnimatorState { public Animator animator; public float speed; } private struct RigidbodyState { public Vector3 velocity; public Vector3 angularVelocity; public bool wasKinematic; } public static bool IsActive; private List pausedAnimators = new List(); private Dictionary rbs = new Dictionary(); public Harmony Harmony; private void Start() { IsActive = true; } private void Update() { if (IsActive) { ApplyTimeStop(); } } private void ApplyTimeStop() { //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_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_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_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) Rigidbody[] array = Object.FindObjectsOfType(); Rigidbody[] array2 = array; foreach (Rigidbody val in array2) { if ((Object)(object)val != (Object)null && (Object)(object)val != (Object)(object)MonoSingleton.Instance?.rb) { if (rbs.ContainsKey(val) && val.isKinematic) { rbs[val] = new RigidbodyState { velocity = rbs[val].velocity, angularVelocity = rbs[val].angularVelocity, wasKinematic = rbs[val].wasKinematic }; } else { rbs[val] = new RigidbodyState { velocity = val.velocity, angularVelocity = val.angularVelocity, wasKinematic = val.isKinematic }; } val.isKinematic = true; } } ParticleSystem[] array3 = Object.FindObjectsOfType(); for (int j = 0; j < array3.Length; j++) { if (array3[j].isPlaying) { ParticleSystem obj = array3[j]; if (obj != null) { obj.Pause(); } } } NewMovement instance = MonoSingleton.Instance; Animator[] array4 = Object.FindObjectsOfType(); foreach (Animator val2 in array4) { if (!((Object)(object)val2 == (Object)null) && !ShouldSkipAnimator(val2, instance) && !ContainsAnimator(pausedAnimators, val2)) { pausedAnimators.Add(new AnimatorState { animator = val2, speed = val2.speed }); val2.speed = 0f; } } NavMeshAgent[] array5 = Object.FindObjectsOfType(); NavMeshAgent[] array6 = array5; foreach (NavMeshAgent val3 in array6) { if ((Object)(object)val3 != (Object)null && val3.isOnNavMesh) { val3.isStopped = true; } } } private void ResetTimeStop() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair rb in rbs) { Rigidbody key = rb.Key; RigidbodyState value = rb.Value; if ((Object)(object)key != (Object)null && (Object)(object)key != (Object)(object)MonoSingleton.Instance?.rb) { key.velocity = value.velocity; key.angularVelocity = value.angularVelocity; key.isKinematic = value.wasKinematic; } } rbs.Clear(); ParticleSystem[] array = Object.FindObjectsOfType(); foreach (ParticleSystem val in array) { if ((Object)(object)val != (Object)null) { MainModule main = val.main; if ((!((MainModule)(ref main)).loop || !val.isStopped) && val.isPaused) { val.Play(); } } } for (int j = 0; j < pausedAnimators.Count; j++) { if ((Object)(object)pausedAnimators[j].animator != (Object)null) { pausedAnimators[j].animator.speed = pausedAnimators[j].speed; } } pausedAnimators.Clear(); NavMeshAgent[] array2 = Object.FindObjectsOfType(); NavMeshAgent[] array3 = array2; foreach (NavMeshAgent val2 in array3) { if ((Object)(object)val2 != (Object)null && val2.isOnNavMesh) { val2.isStopped = false; } } } public override void RemoveEffect() { ResetTimeStop(); IsActive = false; } private bool ShouldSkipAnimator(Animator animator, NewMovement newMovement) { if ((Object)(object)newMovement?.punch?.currentPunch?.anim == (Object)(object)animator) { return true; } GunControl instance = MonoSingleton.instance; if ((Object)(object)instance?.currentWeapon != (Object)null) { Animator componentInChildren = instance.currentWeapon.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)(object)animator) { return true; } } return false; } private bool ContainsAnimator(List list, Animator animator) { for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i].animator == (Object)(object)animator) { return true; } } return false; } } [HarmonyPatch(typeof(Explosion), "FixedUpdate")] public class StopExplosion { public static bool Prefix() { return !TimeStop.IsActive; } } [HarmonyPatch(typeof(TimeBomb), "Update")] public class StopMagnet { public static bool Prefix() { return !TimeStop.IsActive; } } [HarmonyPatch(typeof(PhysicalShockwave))] public class PhysicalShockwavePatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartPostfix(PhysicalShockwave __instance) { if (__instance.fading) { ((MonoBehaviour)__instance).StartCoroutine(TimeStopCoroutine((MonoBehaviour)(object)__instance, (Action)__instance.GetDestroyed, __instance.speed / 10f)); } } [HarmonyPatch("Update")] [HarmonyPrefix] public static bool UpdatePrefix(PhysicalShockwave __instance) { //IL_001d: 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_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) if (!TimeStop.IsActive) { ((Component)__instance).transform.localScale = new Vector3(((Component)__instance).transform.localScale.x + Time.deltaTime * __instance.speed, ((Component)__instance).transform.localScale.y, ((Component)__instance).transform.localScale.z + Time.deltaTime * __instance.speed); if (!__instance.fading && (((Component)__instance).transform.localScale.x > __instance.maxSize || ((Component)__instance).transform.localScale.z > __instance.maxSize)) { __instance.fading = true; ScaleNFade[] componentsInChildren = ((Component)__instance).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = true; } ((MonoBehaviour)__instance).StartCoroutine(TimeStopCoroutine((MonoBehaviour)(object)__instance, (Action)__instance.GetDestroyed, __instance.speed / 10f)); } } return false; } private static IEnumerator TimeStopCoroutine(MonoBehaviour instance, Action action, float delay) { float elapsedTime = 0f; while (elapsedTime < delay) { if (!TimeStop.IsActive) { elapsedTime += Time.deltaTime; } yield return null; } action(); } } [HarmonyPatch(typeof(Countdown), "Update")] public class StopCountdown { public static bool Prefix() { return !TimeStop.IsActive; } } [HarmonyPatch(typeof(Vector3), "MoveTowards")] public class StopMoveTowards { public static bool Prefix(ref Vector3 __result, Vector3 current, Vector3 target, float maxDistanceDelta) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (TimeStop.IsActive) { __result = current; return false; } return true; } } [HarmonyPatch(typeof(Quaternion), "RotateTowards")] public class StopMoveTowardsQuaternion { public static bool Prefix(ref Quaternion __result, Quaternion from, Quaternion to, float maxDegreesDelta) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (TimeStop.IsActive) { __result = from; return false; } return true; } } [HarmonyPatch(typeof(Nail), "Start")] public class SawbladeStartPatch { [HarmonyPrefix] public static bool Prefix(Nail __instance) { ((MonoBehaviour)__instance).StartCoroutine(ModifiedStart(__instance)); return false; } private static IEnumerator ModifiedStart(Nail instance) { if (instance.sawblade) { instance.removeTimeMultiplier = 3f; } if (instance.magnets.Count == 0) { yield return TimeStopCoroutine((MonoBehaviour)(object)instance, delegate { instance.RemoveTime(); }, 5f * instance.removeTimeMultiplier); } yield return TimeStopCoroutine((MonoBehaviour)(object)instance, delegate { instance.MasterRemoveTime(); }, 60f); instance.startPosition = ((Component)instance).transform.position; yield return TimeStopCoroutine((MonoBehaviour)(object)instance, delegate { instance.SlowUpdate(); }, 2f); } private static IEnumerator TimeStopCoroutine(MonoBehaviour instance, Action action, float delay) { float elapsedTime = 0f; while (elapsedTime < delay) { if (!TimeStop.IsActive) { elapsedTime += Time.deltaTime; } yield return null; } action(); } } [HarmonyPatch(typeof(RevolverBeam), "Update")] public class StopBeamDisappear { public static bool Prefix() { return !TimeStop.IsActive; } } [HarmonyPatch(typeof(EnemyIdentifier))] public class EnemyBehaviorPatch { [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] public static void AttackEnemiesPostfix(ref bool __result) { if (TimeStop.IsActive) { __result = false; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] public static void IgnorePlayerPostfix(ref bool __result) { if (TimeStop.IsActive) { __result = true; } } } [HarmonyPatch(typeof(RemoveOnTime))] public class RemoveOnTimePatch { [HarmonyPatch("Start")] [HarmonyPostfix] public static void StartPostfix(RemoveOnTime __instance) { if (__instance.useAudioLength) { ((MonoBehaviour)__instance).StartCoroutine(RemoveCoroutine(__instance)); return; } ((MonoBehaviour)__instance).CancelInvoke("Remove"); ((MonoBehaviour)__instance).StartCoroutine(RemoveCoroutine(__instance)); } private static IEnumerator RemoveCoroutine(RemoveOnTime instance) { float elapsedTime = 0f; float targetTime; if (instance.useAudioLength) { AudioSource audioSource = ((Component)instance).GetComponent(); targetTime = audioSource.clip.length * audioSource.pitch; } else { targetTime = instance.time + Random.Range(0f - instance.randomizer, instance.randomizer); } while (elapsedTime < targetTime) { if (!TimeStop.IsActive) { elapsedTime += Time.deltaTime; } yield return null; } ((Component)instance).SendMessage("Remove"); } [HarmonyPatch("Remove")] [HarmonyPrefix] public static bool RemovePrefix(RemoveOnTime __instance) { if (__instance.affectedByNoCooldowns && NoWeaponCooldown.NoCooldown) { ((MonoBehaviour)__instance).StartCoroutine(RemoveCoroutine(__instance)); return false; } return true; } } internal class TimeWarp : Effect { private bool isWarpActive = true; private void Start() { ((MonoBehaviour)this).StartCoroutine(TimeWarpRoutine()); } private IEnumerator TimeWarpRoutine() { while (isWarpActive) { float time = Random.Range(0f, 3f); float delay = Random.Range(0f, 1.5f); Time.timeScale = time; MonoSingleton.Instance.timeScaleModifier = time; yield return (object)new WaitForSecondsRealtime(delay); } } public void Update() { } public override void RemoveEffect() { isWarpActive = false; ((MonoBehaviour)this).StopCoroutine(TimeWarpRoutine()); Time.timeScale = 1f; MonoSingleton.Instance.timeScaleModifier = 1f; base.RemoveEffect(); } } internal class UpsideDown : Effect { private void Start() { UltraEventsPlugin.Instance.UpsideDown(); } public override void RemoveEffect() { UltraEventsPlugin.Instance.ResetScreen(); } } internal class VirtualInsanityEffect : Effect { private List turns = new List(); private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) GameObject[] array = Resources.FindObjectsOfTypeAll(); GameObject[] array2 = array; foreach (GameObject val in array2) { if (!(val.scene != SceneManager.GetActiveScene()) && ((val.layer == 8 && val.tag == "Untagged") || val.tag == "" || string.IsNullOrEmpty(((Object)val).name)) && !((Object)(object)val.GetComponent() != (Object)null) && !Object.op_Implicit((Object)(object)val.GetComponent()) && !Object.op_Implicit((Object)(object)val.GetComponent())) { turns.Add(val.AddComponent()); } } } public override void RemoveEffect() { base.RemoveEffect(); foreach (MoveAndTurn turn in turns) { if ((Object)(object)((Component)turn).gameObject != (Object)null) { Object.Destroy((Object)(object)turn); } } } } }