using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("CGRetry")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+be27bc9df1cf25fb67601fa30b662497fc307cf3")] [assembly: AssemblyProduct("CGRetry")] [assembly: AssemblyTitle("CGRetry")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace CGR { [BepInPlugin("51.CGRetry", "CGRetry", "1.0.0")] internal class Plugin : BaseUnityPlugin { private class ConfigManager { public static ConfigEntry retryStartRank; public static ConfigEntry retryStartupTime; public static void Initialize(ConfigFile file) { retryStartRank = file.Bind("Options", "Retry Start Rank", 6, "The rank you get at the start of a retried wave\n0: Destructive\n1: Chaotic\n2: Brutal\n3: Anarchic\n4: Supreme\n5: SSadistic\n6: SSShitstorm\n7: ULTRAKILL"); retryStartupTime = file.Bind("Options", "Retry Startup Time", 1f, "How long you wait before the retried wave reloads"); } } private class RNG { private static Random rng = new Random(); public static void SetSeed(int seed) { rng = new Random(seed); } public static int RangeInt(int min, int max) { return rng.Next(min, max); } public static float RangeFloat(float min, float max) { return (float)(rng.NextDouble() * (double)(max - min) + (double)min); } } private class DialogManager { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__4_0; public static UnityAction <>9__4_1; public static UnityAction <>9__4_2; internal void b__4_0() { } internal void b__4_1() { RetryWave(); SetMouseVisibility(show: false); } internal void b__4_2() { hasRefusedRetryOnDeath = true; FinalCyberRank val = Object.FindObjectOfType(); ((MonoBehaviour)val).StopAllCoroutines(); val.Appear(); } } public static GameObject pauseMenu; private static GameObject quitDialog; public static GameObject gameOverDialog; public static GameObject retryDialog; public static void Initialize() { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Expected O, but got Unknown //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_015c: Expected O, but got Unknown if ((Object)(object)MonoSingleton.Instance == (Object)null) { return; } pauseMenu = MonoSingleton.Instance.pauseMenu; if ((Object)(object)MonoSingleton.Instance.pauseMenu == (Object)null) { return; } Transform parent = pauseMenu.transform.parent; GameObject val = null; for (int i = 0; i < parent.childCount; i++) { GameObject gameObject = ((Component)parent.GetChild(i)).gameObject; if (((Object)gameObject).name == "PauseMenuDialogs") { val = gameObject; } } if ((Object)(object)val == (Object)null) { return; } quitDialog = ((Component)val.transform.Find("Quit Confirm")).gameObject; UnityAction val2 = RetryWave; object obj = <>c.<>9__4_0; if (obj == null) { UnityAction val3 = delegate { }; <>c.<>9__4_0 = val3; obj = (object)val3; } retryDialog = CloneDialog("Retry Confirm", "RETRY", "CANCEL", "Are you sure you want to\nRETRY this wave?", val2, (UnityAction)obj); object obj2 = <>c.<>9__4_1; if (obj2 == null) { UnityAction val4 = delegate { RetryWave(); SetMouseVisibility(show: false); }; <>c.<>9__4_1 = val4; obj2 = (object)val4; } object obj3 = <>c.<>9__4_2; if (obj3 == null) { UnityAction val5 = delegate { hasRefusedRetryOnDeath = true; FinalCyberRank val6 = Object.FindObjectOfType(); ((MonoBehaviour)val6).StopAllCoroutines(); val6.Appear(); }; <>c.<>9__4_2 = val5; obj3 = (object)val5; } gameOverDialog = CloneDialog("Game Over Confirm", "RETRY", "NO", "Do you want to\nRETRY this wave?", (UnityAction)obj2, (UnityAction)obj3); } public static void ShowDialog(GameObject dialog) { SetMouseVisibility(show: true); dialog.GetComponent().ShowDialog(); } private static void SetMouseVisibility(bool show) { Cursor.visible = show; Cursor.lockState = (CursorLockMode)((!show) ? 1 : 0); } public static GameObject CloneDialog(string name, string confirmText, string cancelText, string text, UnityAction confirmEvent, UnityAction cancelEvent) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown GameObject dialog = Object.Instantiate(quitDialog, quitDialog.transform.parent); ((Object)dialog).name = name; Transform val = dialog.transform.Find("Panel"); GameObject gameObject = ((Component)val.Find("Cancel")).gameObject; Button component = gameObject.GetComponent