using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BossRush.Helpers; using BossRush.UI; using HarmonyLib; using Microsoft.CodeAnalysis; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.AddressableAssets.ResourceLocators; using UnityEngine.Events; using UnityEngine.ResourceManagement.ResourceLocations; 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: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class ExtensionMarkerAttribute : Attribute { private readonly string k__BackingField; public string Name => k__BackingField; public ExtensionMarkerAttribute(string name) { k__BackingField = name; } } } namespace BossRush { public static class BossrushManager { public static bool IsBossrushActive; public static bool IsBossrushFinished; public static bool CheatsUsed; public static float Timer; public static int Restarts; public static int Kills; public static int Style; public static int Completes; public static bool IsBananaDifficulty; public static void StartBossrush() { IsBossrushActive = true; IsBossrushFinished = false; CheatsUsed = false; Timer = 0f; Restarts = 0; Kills = 0; Style = 0; Completes = 0; SceneHelper.LoadScene("Level 0-1", false); } public static void SceneLoad(string scene) { if (IsBossrushActive) { UpdateBossrushUI(); } if (IsBossrushFinished && scene == "Main Menu") { IsBossrushFinished = false; CreateEndUI(); } } public static void UpdateBossrushUI() { CreateBossrushUI(); } public static void EndBossrush() { IsBossrushActive = false; } public static void FinishBossrush() { IsBossrushFinished = true; IsBossrushActive = false; SceneHelper.LoadScene("Main Menu", false); } public static void CreateBossrushUI() { //IL_0021: 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) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) Canvas val = Builder.Canvas(); Image val2 = Builder.Image(((Component)val).gameObject, new Vector2(25f, -500f), new Vector2(200f, 100f), (Color?)new Color(0f, 0f, 0f, 0.2f), (Vector2?)null, (Vector2?)null, (Vector2?)null); TMP_Text val3 = Builder.Text(((Component)val).gameObject, new Vector2(25f, -500f), new Vector2(200f, 100f), "Hi im text lmao", 26f, (TextAlignmentOptions)257); ((Component)val3).gameObject.AddComponent(); } public static void CreateEndUI() { //IL_0078: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown float num = Timer; float num2 = 0f; while (num >= 60f) { num -= 60f; num2 += 1f; } string text = num2 + ":" + num.ToString("00.000"); Canvas canvas = Builder.Canvas(); Image val = Builder.Image(((Component)canvas).gameObject, default(Vector2), new Vector2(1920f, 1080f), (Color?)new Color(0f, 0f, 0f, 0.98f), (Vector2?)null, (Vector2?)null, (Vector2?)null); TMP_Text val2 = Builder.Text(((Component)canvas).gameObject, new Vector2(0f, 0f), new Vector2(1920f, 1080f), string.Format("BOSSRUSH BEATEN!\n{0}\n\nTIME: {1}\nKILLS: {2}\nSTYLE: {3}\nRESTARTS: {4}\n{5}", GetDifficulty(), text, Kills, Style, Restarts, CheatsUsed ? "CHEATED\n" : ""), 50f, (TextAlignmentOptions)514); Button val3 = Builder.Button(((Component)canvas).gameObject, new Vector2(860f, -980f), new Vector2(200f, 70f), "Yay!", 40f, (TextAlignmentOptions)514); Image val4 = Builder.Image(((Component)canvas).gameObject, default(Vector2), new Vector2(1920f, 1080f), (Color?)new Color(1f, 1f, 1f, 1f), (Vector2?)null, (Vector2?)null, (Vector2?)null); ((Component)val4).gameObject.AddComponent(); AudioSource val5 = ((Component)canvas).gameObject.AddComponent(); val5.clip = BundleLoader.bundle.LoadAsset("BeatBossrush"); val5.Play(); ((UnityEvent)val3.onClick).AddListener((UnityAction)delegate { ((Component)canvas).gameObject.SetActive(false); }); } public static string GetDifficulty() { return MonoSingleton.Instance.GetInt("difficulty", 0) switch { 0 => "Lenient", 1 => "Harmless", 2 => "Standard", 3 => "Violent", 4 => "Brutal", 5 => IsBananaDifficulty ? "Banana" : "UKMD", 19 => "Billion", _ => "Error", }; } } public class FlashLmao : MonoBehaviour { private Image image; private float tt = 0f; public void Start() { image = ((Component)this).GetComponent(); } public void Update() { //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_0036: 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_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_0055: 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) Color color = ((Graphic)image).color; float deltaTime = Time.deltaTime; tt += deltaTime; if (!(tt < 0.1f)) { ((Color)(ref color))..ctor(color.r, color.g, color.b, color.a - deltaTime); if (color.a <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } else { ((Graphic)image).color = color; } } } } public class BossrushUI : MonoBehaviour { private TMP_Text text; private string s; private string d; public void Start() { text = ((Component)this).GetComponent(); s = SceneHelper.CurrentScene; d = BossrushManager.GetDifficulty(); } public void Update() { float num = BossrushManager.Timer; float num2 = 0f; while (num >= 60f) { num -= 60f; num2 += 1f; } string text = num2 + ":" + num.ToString("00.000"); this.text.text = s + "\n" + d + "\n" + text + "\n" + (BossrushManager.CheatsUsed ? "CHEATS\n" : $"{BossrushManager.Restarts}"); CheckForCheats(); } public void CheckForCheats() { if (MonoSingleton.Instance.cheatsEnabled || MonoSingleton.Instance.majorUsed) { BossrushManager.CheatsUsed = true; } } } [HarmonyPatch] public static class Patches { public static void TeleportTo(Vector3 pos, Vector3 rot) { //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_0029: 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_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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) CameraController cc = MonoSingleton.Instance.cc; PhysicsExtensions.SetCustomGravityMode(MonoSingleton.Instance.rb, false); cc.gravityRotation = Quaternion.identity; Vector3 gravity = Physics.gravity; cc.gravityVec = ((Vector3)(ref gravity)).normalized; cc.rotationOffset = Quaternion.identity; cc.transitionRotationZ = 0f; cc.transitionRotationZSmooth = 0f; cc.tiltRotationZ = 0f; cc.tiltRotationZSmooth = 0f; ((Component)MonoSingleton.Instance).transform.position = pos; MonoSingleton.Instance.rb.position = pos; MonoSingleton.Instance.rb.velocity = Vector3.zero; ((Component)MonoSingleton.Instance).transform.eulerAngles = rot; cc.ResetCamera(rot.y, rot.x); cc.ApplyRotations(false); MonoSingleton.Instance.seconds = 50000f; } public static void TeleportToDelayed(Vector3 pos, Vector3 rot, int f) { //IL_0006: 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) ((MonoBehaviour)Plugin.instance).StartCoroutine(TeleportToDelayedIE(pos, rot, f)); } public static IEnumerator TeleportToDelayedIE(Vector3 pos, Vector3 rot, int f = 0) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_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) for (int i = 0; i < f; i++) { yield return null; } TeleportTo(pos, rot); } [HarmonyPatch(typeof(StatsManager), "StartTimer")] [HarmonyPostfix] public static void StartTimer(StatsManager __instance) { //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_055d: Unknown result type (might be due to invalid IL or missing references) //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_05c3: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_0500: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) if (!BossrushManager.IsBossrushActive) { return; } switch (SceneHelper.CurrentScene) { case "Level 0-1": TeleportTo(new Vector3(202f, 54.5f, 453.8f), new Vector3(0f, 180f, 0f)); break; case "Level 0-3": TeleportTo(new Vector3(-16.5f, 71.5f, 315f), new Vector3(0f, 270f, 0f)); break; case "Level 0-5": TeleportTo(new Vector3(131.75f, -4.5f, 382f), new Vector3(0f, 90f, 0f)); break; case "Level 1-3": TeleportTo(new Vector3(0f, -9f, 391f), new Vector3(0f, 90f, 0f)); TeleportToDelayed(new Vector3(0f, -9f, 405f), new Vector3(0f, 0f, 0f), 1); break; case "Level 1-4": break; case "Level 2-4": TeleportTo(new Vector3(60f, -18.5f, 359.7f), new Vector3(0f, 180f, 0f)); break; case "Level 3-2": break; case "Level 4-2": break; case "Level 4-4": break; case "Level 5-2": TeleportTo(new Vector3(52.5f, -1.5f, 940.3f), new Vector3(0f, 0f, 0f)); break; case "Level 5-4": break; case "Level 6-1": TeleportTo(new Vector3(168.5f, -163.5f, -159f), new Vector3(0f, 180f, 0f)); break; case "Level 6-2": break; case "Level 7-1": { TeleportTo(new Vector3(-242.5f, -112.5f, -329f), new Vector3(0f, 0f, 0f)); Scene activeScene = SceneManager.GetActiveScene(); ((IEnumerable)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func)((GameObject x) => ((Object)x).name == "Third Section")).SetActive(true); break; } case "Level 7-4": break; case "Level 8-2": TeleportTo(new Vector3(422.15f, 81.5f, 519.75f), new Vector3(0f, 0f, 0f)); break; case "Level 8-4": break; case "Level P-1": break; case "Level P-2": break; case "Level 0-E": TeleportTo(new Vector3(0f, -8.5f, 360f), new Vector3(0f, 0f, 0f)); break; case "Level 1-E": TeleportTo(new Vector3(345.75f, 36.5f, 454.75f), new Vector3(0f, 0f, 0f)); break; } } [HarmonyPatch(typeof(NewMovement), "GetHurt")] [HarmonyPostfix] public static void Damage(NewMovement __instance) { if (__instance.dead && BossrushManager.IsBossrushActive) { BossrushManager.Restarts++; } } [HarmonyPatch(typeof(NewMovement), "Respawn")] [HarmonyPrefix] public static void Respawn(NewMovement __instance) { if (!__instance.dead && BossrushManager.IsBossrushActive) { BossrushManager.Restarts++; } } [HarmonyPatch(typeof(SceneHelper), "LoadSceneAsync")] [HarmonyPrefix] public static void LoadScene(string sceneName, SceneHelper __instance) { if (!(sceneName != SceneHelper.CurrentScene) && Object.op_Implicit((Object)(object)MonoSingleton.Instance) && !MonoSingleton.Instance.dead && BossrushManager.IsBossrushActive) { BossrushManager.Restarts++; } } [HarmonyPostfix] [HarmonyPatch(typeof(StatsManager), "Update")] public static void StatsManager_Update_Prefix(StatsManager __instance) { if (__instance.timer) { BossrushManager.Timer += Time.deltaTime * GameStateManager.Instance.TimerModifier; } } [HarmonyPrefix] [HarmonyPatch(typeof(FinalRank), "LevelChange")] public static bool LevelChange_Prefix(FinalRank __instance) { if (BossrushManager.IsBossrushActive) { BossrushManager.Kills += MonoSingleton.Instance.kills; BossrushManager.Style += MonoSingleton.Instance.stylePoints; BossrushManager.Completes++; switch (SceneHelper.CurrentScene) { case "Level 0-1": SceneHelper.LoadScene("Level 0-3", false); break; case "Level 0-3": SceneHelper.LoadScene("Level 0-5", false); break; case "Level 0-5": SceneHelper.LoadScene("Level 1-3", false); break; case "Level 1-3": SceneHelper.LoadScene("Level 1-4", false); break; case "Level 1-4": SceneHelper.LoadScene("Level 2-4", false); break; case "Level 2-4": SceneHelper.LoadScene("Level 3-2", false); break; case "Level 3-2": SceneHelper.LoadScene("Level 4-2", false); break; case "Level 4-2": SceneHelper.LoadScene("Level 4-4", false); break; case "Level 4-4": SceneHelper.LoadScene("Level 5-2", false); break; case "Level 5-2": SceneHelper.LoadScene("Level 5-4", false); break; case "Level 5-4": SceneHelper.LoadScene("Level 6-1", false); break; case "Level 6-1": SceneHelper.LoadScene("Level 6-2", false); break; case "Level 6-2": SceneHelper.LoadScene("Level 7-1", false); break; case "Level 7-1": SceneHelper.LoadScene("Level 7-4", false); break; case "Level 7-4": SceneHelper.LoadScene("Level 8-2", false); break; case "Level 8-2": SceneHelper.LoadScene("Level 8-4", false); break; case "Level 8-4": SceneHelper.LoadScene("Level P-1", false); break; case "Level P-1": SceneHelper.LoadScene("Level P-2", false); break; case "Level P-2": SceneHelper.LoadScene("Level 0-E", false); break; case "Level 0-E": SceneHelper.LoadScene("Level 1-E", false); break; case "Level 1-E": BossrushManager.FinishBossrush(); break; default: return true; } return false; } return true; } } [BepInPlugin("duviz.BossRush", "BossRush", "0.1.4")] public class Plugin : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__5_0; public static UnityAction <>9__5_1; internal bool b__5_0(GameObject x) { return ((Object)x).name == "Canvas"; } internal void b__5_1() { BossrushManager.StartBossrush(); } } public static Plugin instance; public static ConfigFile config; public void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) instance = this; ((Object)((Component)this).gameObject).hideFlags = (HideFlags)61; config = ((BaseUnityPlugin)this).Config; new Harmony("duviz.BossRush").PatchAll(); BundleLoader.LoadBundle("Assets.bossrush.bundle"); } public void Start() { Builder.LoadFont(); SceneManager.sceneLoaded += delegate { OnSceneLoad(SceneHelper.CurrentScene); }; BossrushManager.IsBananaDifficulty = Chainloader.PluginInfos.ContainsKey("com.banana.BananaDifficulty"); } public void OnSceneLoad(string scene) { if (scene == "Main Menu") { BossrushManager.EndBossrush(); SpawnBossrushButton(); } BossrushManager.SceneLoad(scene); } public void SpawnBossrushButton() { //IL_0011: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown GameObject val = BundleLoader.bundle.LoadAsset("BossrushButton"); Scene activeScene = SceneManager.GetActiveScene(); Transform val2 = ((IEnumerable)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func)((GameObject x) => ((Object)x).name == "Canvas")).transform.Find("Main Menu (1)/LeftSide"); GameObject val3 = Object.Instantiate(val, val2); Vector2 anchoredPosition = default(Vector2); ((Vector2)(ref anchoredPosition))..ctor(410f, -205f); if (Chainloader.PluginInfos.ContainsKey("com.github.end-4.titleScreenQuickAccess")) { ((Vector2)(ref anchoredPosition))..ctor(410f, -430f); } Extensions.get_rectTransform(val3).anchoredPosition = anchoredPosition; ButtonClickedEvent onClick = val3.GetComponent