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 <Name>k__BackingField;
public string Name => <Name>k__BackingField;
public ExtensionMarkerAttribute(string name)
{
<Name>k__BackingField = name;
}
}
}
namespace BossRush
{
public static class BossrushManager
{
public static bool IsBossrushActive;
public static bool NoTeleports;
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(bool noTeleports = false)
{
IsBossrushActive = true;
NoTeleports = noTeleports;
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_0090: 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)
Canvas val = Builder.Canvas();
Image image = 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);
image.SetDefaultImage();
TMP_Text val2 = Builder.Text(((Component)val).gameObject, new Vector2(25f, -500f), new Vector2(200f, 100f), "Hi im text lmao", 26f, (TextAlignmentOptions)257);
((Component)val2).gameObject.AddComponent<BossrushUI>();
}
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("<b>BOSSRUSH BEATEN!\n{0}</b>\n\nTIME: <color=yellow>{1}</color>\nKILLS: <color=yellow>{2}</color>\nSTYLE: <color=yellow>{3}</color>\nRESTARTS: <color=red>{4}</color>\n{5}", GetDifficulty(), text, Kills, Style, Restarts, CheatsUsed ? "<color=#4C99E6>CHEATED</color>\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<FlashLmao>();
AudioSource val5 = ((Component)canvas).gameObject.AddComponent<AudioSource>();
val5.clip = BundleLoader.bundle.LoadAsset<AudioClip>("BeatBossrush");
val5.Play();
((UnityEvent)val3.onClick).AddListener((UnityAction)delegate
{
((Component)canvas).gameObject.SetActive(false);
});
}
public static string GetDifficulty()
{
return MonoSingleton<PrefsManager>.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<Image>();
}
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<TMP_Text>();
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<color=yellow>" + text + "</color>\n" + (BossrushManager.CheatsUsed ? "<color=#4C99E6>CHEATS</color>\n" : $"<color=red>{BossrushManager.Restarts}</color>");
CheckForCheats();
}
public void CheckForCheats()
{
if (MonoSingleton<CheatsController>.Instance.cheatsEnabled || MonoSingleton<StatsManager>.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<NewMovement>.Instance.cc;
PhysicsExtensions.SetCustomGravityMode(MonoSingleton<NewMovement>.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<NewMovement>.Instance).transform.position = pos;
MonoSingleton<NewMovement>.Instance.rb.position = pos;
MonoSingleton<NewMovement>.Instance.rb.velocity = Vector3.zero;
((Component)MonoSingleton<NewMovement>.Instance).transform.eulerAngles = rot;
cc.ResetCamera(rot.y, rot.x);
cc.ApplyRotations(false);
MonoSingleton<StatsManager>.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_0397: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
//IL_0625: Unknown result type (might be due to invalid IL or missing references)
//IL_0639: Unknown result type (might be due to invalid IL or missing references)
//IL_068b: Unknown result type (might be due to invalid IL or missing references)
//IL_069f: Unknown result type (might be due to invalid IL or missing references)
//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
//IL_05d3: Unknown result type (might be due to invalid IL or missing references)
//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
//IL_0544: Unknown result type (might be due to invalid IL or missing references)
//IL_0558: Unknown result type (might be due to invalid IL or missing references)
//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0411: Unknown result type (might be due to invalid IL or missing references)
//IL_042b: Unknown result type (might be due to invalid IL or missing references)
//IL_043f: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03de: Unknown result type (might be due to invalid IL or missing references)
//IL_057c: Unknown result type (might be due to invalid IL or missing references)
//IL_0590: Unknown result type (might be due to invalid IL or missing references)
//IL_0464: Unknown result type (might be due to invalid IL or missing references)
//IL_0478: Unknown result type (might be due to invalid IL or missing references)
//IL_065b: Unknown result type (might be due to invalid IL or missing references)
//IL_066f: Unknown result type (might be due to invalid IL or missing references)
//IL_0364: Unknown result type (might be due to invalid IL or missing references)
//IL_0378: Unknown result type (might be due to invalid IL or missing references)
//IL_049c: Unknown result type (might be due to invalid IL or missing references)
//IL_04b0: Unknown result type (might be due to invalid IL or missing references)
//IL_04bb: Unknown result type (might be due to invalid IL or missing references)
//IL_04c0: Unknown result type (might be due to invalid IL or missing references)
if (!BossrushManager.IsBossrushActive || BossrushManager.NoTeleports)
{
return;
}
Scene activeScene;
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":
{
TeleportTo(new Vector3(8f, -13f, 1147.5f), new Vector3(0f, 0f, 0f));
activeScene = SceneManager.GetActiveScene();
Transform val = ((IEnumerable<GameObject>)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func<GameObject, bool>)((GameObject x) => ((Object)x).name == "7 - Boss Arena")).transform.Find("7 Nonstuff/Speakers");
((Component)val.Find("Activator 1")).gameObject.SetActive(true);
((Component)val.Find("Activator 1/Activator 2")).gameObject.SetActive(true);
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, 180f, 0f));
activeScene = SceneManager.GetActiveScene();
((IEnumerable<GameObject>)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func<GameObject, bool>)((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<NewMovement>.Instance) && !MonoSingleton<NewMovement>.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<StatsManager>.Instance.kills;
BossrushManager.Style += MonoSingleton<StatsManager>.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.10")]
public class Plugin : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Func<GameObject, bool> <>9__5_0;
public static UnityAction <>9__5_2;
public static UnityAction <>9__5_3;
public static UnityAction <>9__5_5;
internal bool <SpawnBossrushButton>b__5_0(GameObject x)
{
return ((Object)x).name == "Canvas";
}
internal void <SpawnBossrushButton>b__5_2()
{
BossrushManager.StartBossrush();
}
internal void <SpawnBossrushButton>b__5_3()
{
BossrushManager.StartBossrush(noTeleports: true);
}
internal void <SpawnBossrushButton>b__5_5()
{
Application.OpenURL("https://duviz.xyz");
}
}
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_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)
//IL_009e: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Expected O, but got Unknown
GameObject val = BundleLoader.bundle.LoadAsset<GameObject>("BossrushButton");
Scene activeScene = SceneManager.GetActiveScene();
Transform val2 = ((IEnumerable<GameObject>)((Scene)(ref activeScene)).GetRootGameObjects()).FirstOrDefault((Func<GameObject, bool>)((GameObject x) => ((Object)x).name == "Canvas")).transform.Find("Main Menu (1)/LeftSide");
GameObject val3 = Object.Instantiate<GameObject>(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;
GameObject c = null;
UnityAction val11 = default(UnityAction);
((UnityEvent)val3.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: 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_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_022b: Unknown result type (might be due to invalid IL or missing references)
//IL_0279: Unknown result type (might be due to invalid IL or missing references)
//IL_0288: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_0339: Unknown result type (might be due to invalid IL or missing references)
//IL_0348: Unknown result type (might be due to invalid IL or missing references)
//IL_03b6: Unknown result type (might be due to invalid IL or missing references)
//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
//IL_03c1: Expected O, but got Unknown
//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
//IL_03e6: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Expected O, but got Unknown
//IL_040b: Unknown result type (might be due to invalid IL or missing references)
//IL_0410: Unknown result type (might be due to invalid IL or missing references)
//IL_0413: Expected O, but got Unknown
//IL_0418: Expected O, but got Unknown
//IL_043b: Unknown result type (might be due to invalid IL or missing references)
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_0446: Expected O, but got Unknown
if (!((Object)(object)c != (Object)null))
{
c = ((Component)Builder.Canvas()).gameObject;
int num = 300;
Image image = Builder.Image(c, new Vector2((float)num, (float)(-num)), new Vector2((float)(1920 - num * 2), (float)(1080 - num * 2)), (Color?)new Color(1f, 1f, 1f, 1f), (Vector2?)null, (Vector2?)null, (Vector2?)null);
image.SetDefaultImage();
Builder.Text(c, new Vector2((float)(num + 5), (float)(-num - 5)), new Vector2((float)(1920 - num * 2 - 5), (float)(1080 - num * 2 - 5)), "BOSSRUSH", 50f, (TextAlignmentOptions)258);
Builder.Text(c, new Vector2((float)(num + 5), (float)(-num - 5)), new Vector2((float)(1920 - num * 2 - 5), (float)(1080 - num * 2 - 5)), "\n\nThis gamemode will make you go through every boss level in the game, there are teleports to avoid you from having to do the start of every level, but you can disable them to get more kills and style!\n<b>Good luck.</b>", 30f, (TextAlignmentOptions)258);
Button val4 = Builder.Button(c, new Vector2((float)((1920 - num * 2) / 2 + num - 100 - 110), (float)(-1080 + num + 65)), new Vector2(200f, 50f), "Start", 30f, (TextAlignmentOptions)514);
Button val5 = Builder.Button(c, new Vector2((float)((1920 - num * 2) / 2 + num - 100 + 110), (float)(-1080 + num + 65)), new Vector2(200f, 50f), "Start\n(no teleports)", 20f, (TextAlignmentOptions)514);
Button val6 = Builder.Button(c, new Vector2((float)(num + 10), (float)(-1080 + num + 45)), new Vector2(150f, 30f), "Close", 30f, (TextAlignmentOptions)514);
Button val7 = Builder.Button(c, new Vector2((float)(1920 - num - 10 - 50), (float)(-1080 + num + 65)), new Vector2(50f, 50f), "", 30f, (TextAlignmentOptions)514);
Image val8 = Builder.Image(((Component)val7).gameObject, new Vector2(5f, -5f), new Vector2(40f, 40f));
((Graphic)val8).raycastTarget = false;
val8.sprite = BundleLoader.bundle.LoadAsset<Sprite>("www");
ButtonClickedEvent onClick = val4.onClick;
object obj = <>c.<>9__5_2;
if (obj == null)
{
UnityAction val9 = delegate
{
BossrushManager.StartBossrush();
};
<>c.<>9__5_2 = val9;
obj = (object)val9;
}
((UnityEvent)onClick).AddListener((UnityAction)obj);
ButtonClickedEvent onClick2 = val5.onClick;
object obj2 = <>c.<>9__5_3;
if (obj2 == null)
{
UnityAction val10 = delegate
{
BossrushManager.StartBossrush(noTeleports: true);
};
<>c.<>9__5_3 = val10;
obj2 = (object)val10;
}
((UnityEvent)onClick2).AddListener((UnityAction)obj2);
ButtonClickedEvent onClick3 = val6.onClick;
UnityAction obj3 = val11;
if (obj3 == null)
{
UnityAction val12 = delegate
{
Object.Destroy((Object)(object)c);
};
UnityAction val13 = val12;
val11 = val12;
obj3 = val13;
}
((UnityEvent)onClick3).AddListener(obj3);
ButtonClickedEvent onClick4 = val7.onClick;
object obj4 = <>c.<>9__5_5;
if (obj4 == null)
{
UnityAction val14 = delegate
{
Application.OpenURL("https://duviz.xyz");
};
<>c.<>9__5_5 = val14;
obj4 = (object)val14;
}
((UnityEvent)onClick4).AddListener((UnityAction)obj4);
}
});
}
public static T Ass<T>(string path)
{
return AssHelper.Ass<T>(path);
}
public static void LogInfo(object msg)
{
((BaseUnityPlugin)instance).Logger.LogInfo(msg);
}
public static void LogWarning(object msg)
{
((BaseUnityPlugin)instance).Logger.LogWarning(msg);
}
public static void LogError(object msg)
{
((BaseUnityPlugin)instance).Logger.LogError(msg);
}
}
public class PluginInfo
{
public const string GUID = "duviz.BossRush";
public const string Name = "BossRush";
public const string Version = "0.1.10";
}
}
namespace BossRush.UI
{
public static class Builder
{
private static TMP_FontAsset _font;
private static Sprite _image;
public static TMP_FontAsset font
{
get
{
if (!Object.op_Implicit((Object)(object)_font))
{
LoadFont();
}
return _font;
}
}
public static Sprite image
{
get
{
if (!Object.op_Implicit((Object)(object)_image))
{
LoadImage();
}
return _image;
}
}
public static void LoadFont()
{
_font = Plugin.Ass<TMP_FontAsset>("Assets/Fonts/VCR_OSD_MONO_UI.asset");
}
public static void LoadImage()
{
_image = BundleLoader.bundle.LoadAsset<Sprite>("Button");
}
public static Canvas Canvas(float width = 1920f, float height = 1080f)
{
//IL_0006: 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_001d: Expected O, but got Unknown
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("RuntimeCanvas")
{
layer = LayerMask.NameToLayer("UI")
};
Canvas val2 = val.AddComponent<Canvas>();
val2.renderMode = (RenderMode)0;
val2.pixelPerfect = true;
val2.sortingOrder = 10000;
CanvasScaler val3 = val.AddComponent<CanvasScaler>();
val3.uiScaleMode = (ScaleMode)1;
val3.referenceResolution = new Vector2(width, height);
val3.screenMatchMode = (ScreenMatchMode)2;
val.AddComponent<GraphicRaycaster>();
Plugin.LogInfo("Canvas created!");
return val2;
}
public static TMP_Text Text(GameObject container, Vector2 position, Vector2 sizeDelta, string defaultText = "Ella jura", float size = 20f, TextAlignmentOptions alignment = (TextAlignmentOptions)257, Color? color = null, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_009c: 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)
//IL_00a8: 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_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: 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)
GameObject val = new GameObject("Text");
val.transform.SetParent(container.transform, false);
RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
orAddComponent.anchoredPosition = position;
orAddComponent.sizeDelta = sizeDelta;
TMP_Text val2 = (TMP_Text)(object)val.AddComponent<TextMeshProUGUI>();
val2.text = defaultText;
val2.font = font;
val2.fontSize = size;
val2.alignment = alignment;
((Graphic)val2).raycastTarget = false;
((Graphic)val2).color = (Color)(((??)color) ?? Color.white);
return val2;
}
public static Button Button(GameObject container, Vector2 position, Vector2 sizeDelta, string defaultText = "Ella jura", float size = 20f, TextAlignmentOptions alignment = (TextAlignmentOptions)257, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0047: 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)
//IL_0073: 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_009f: 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_00ab: 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_00c2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
//IL_010b: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0114: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("Button");
val.transform.SetParent(container.transform, false);
RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
orAddComponent.anchoredPosition = position;
orAddComponent.sizeDelta = sizeDelta;
Button val2 = val.AddComponent<Button>();
Image targetGraphic = Image(val, Vector2.zero, sizeDelta);
targetGraphic.SetDefaultImage();
((Selectable)val2).targetGraphic = (Graphic)(object)targetGraphic;
Text(val, Vector2.zero, sizeDelta, defaultText, size, alignment);
return val2;
}
public static Image Image(GameObject container, Vector2 position, Vector2 sizeDelta, Color? color = null, Vector2? anchorMin = null, Vector2? anchorMax = null, Vector2? pivot = null)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: 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_009c: 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)
//IL_00a8: 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_00e3: 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)
GameObject val = new GameObject("Image");
val.transform.SetParent(container.transform, false);
RectTransform orAddComponent = GameObjectExtensions.GetOrAddComponent<RectTransform>(val);
orAddComponent.anchorMin = (Vector2)(((??)anchorMin) ?? new Vector2(0f, 1f));
orAddComponent.anchorMax = (Vector2)(((??)anchorMax) ?? new Vector2(0f, 1f));
orAddComponent.pivot = (Vector2)(((??)pivot) ?? new Vector2(0f, 1f));
orAddComponent.anchoredPosition = position;
orAddComponent.sizeDelta = sizeDelta;
Image val2 = val.AddComponent<Image>();
((Graphic)val2).color = (Color)(((??)color) ?? new Color(1f, 1f, 1f));
return val2;
}
}
}
namespace BossRush.Helpers
{
public static class AssHelper
{
[SpecialName]
public sealed class <G>$34505F560D9EACF86A87F3ED1F85E448
{
[SpecialName]
public static class <M>$69FE22D2D9367C6033D7C9FA04F1ABE9
{
}
[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
public int Occurrences(char lookUp)
{
throw new NotSupportedException();
}
[ExtensionMarker("<M>$69FE22D2D9367C6033D7C9FA04F1ABE9")]
public IEnumerable<int> Occurences(char lookUp)
{
throw new NotSupportedException();
}
}
private static List<string> cache_PrefabKeys = null;
public static Dictionary<string, object> CachedAddressableAssets = new Dictionary<string, object>();
public static IResourceLocator MainAddressablesLocator => Addressables.ResourceLocators.FirstOrDefault((Func<IResourceLocator, bool>)((IResourceLocator loc) => loc.LocatorId == "AddressablesMainContentCatalog"));
public static IEnumerable<object> GetAddressableKeys()
{
IResourceLocator mainAddressablesLocator = MainAddressablesLocator;
return ((mainAddressablesLocator != null) ? mainAddressablesLocator.Keys : null) ?? Array.Empty<object>();
}
public static List<string> GetPrefabAddressableKeys(Func<string, bool> Search = null)
{
if (cache_PrefabKeys != null)
{
return cache_PrefabKeys.Where(Search).ToList();
}
List<string> list = new List<string>();
IList<IResourceLocation> list2 = default(IList<IResourceLocation>);
foreach (object addressableKey in GetAddressableKeys())
{
if (MainAddressablesLocator.Locate(addressableKey, typeof(GameObject), ref list2) && !list.Contains(list2[0].PrimaryKey))
{
list.Add(list2[0].PrimaryKey);
}
}
list.Sort();
cache_PrefabKeys = list;
return list.Where(Search).ToList();
}
public static T Ass<T>(string key)
{
//IL_0030: 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)
if (CachedAddressableAssets.TryGetValue(key + typeof(T).Name, out var value))
{
return (T)value;
}
T val = Addressables.LoadAssetAsync<T>((object)key).WaitForCompletion();
if (val != null)
{
CachedAddressableAssets.Add(key + typeof(T).Name, val);
}
else
{
Plugin.LogError("Failed to load asset: " + key);
}
return val;
}
public static int Occurrences(this string str, char lookUp)
{
int num = 0;
foreach (char c in str)
{
if (c == lookUp)
{
num++;
}
}
return num;
}
public static IEnumerable<int> Occurences(this string str, char lookUp)
{
for (int i = 0; i < str.Length; i++)
{
if (str[i] == lookUp)
{
yield return i;
}
}
}
}
public static class BundleLoader
{
public static AssetBundle bundle { get; private set; }
public static void LoadBundle(string path)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
string text = "BossRush." + path;
using Stream stream = executingAssembly.GetManifestResourceStream(text);
if (stream == null)
{
Plugin.LogError("Bundle not found: " + text);
return;
}
using MemoryStream memoryStream = new MemoryStream();
stream.CopyTo(memoryStream);
UnloadBundle();
bundle = AssetBundle.LoadFromMemory(memoryStream.ToArray());
}
public static void UnloadBundle()
{
AssetBundle obj = bundle;
if (obj != null)
{
obj.Unload(false);
}
}
}
public static class Extensions
{
[SpecialName]
public sealed class <G>$D50C47355EFA71DA0F6DB3230FE5D4AD
{
[SpecialName]
public static class <M>$D68147830E85447C80ED888358DB7BFB
{
}
[ExtensionMarker("<M>$D68147830E85447C80ED888358DB7BFB")]
public void ApplyDefaults()
{
throw new NotSupportedException();
}
}
[SpecialName]
public sealed class <G>$5E80EE1F91F68F4C0C8D9D82C38C5E67
{
[SpecialName]
public static class <M>$24BC8566157842FEB6EA2D06D7BBA5FC
{
}
[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
public RectTransform rectTransform
{
[ExtensionMarker("<M>$24BC8566157842FEB6EA2D06D7BBA5FC")]
get
{
throw new NotSupportedException();
}
}
}
[SpecialName]
public sealed class <G>$AE24F2F30FEF6BDD044A9DBDB83F9DF9
{
[SpecialName]
public static class <M>$76F9146EE2A3247F018248F398E20D88
{
}
[ExtensionMarker("<M>$76F9146EE2A3247F018248F398E20D88")]
public void SetDefaultImage(float ppu = 1f)
{
throw new NotSupportedException();
}
}
public static void ApplyDefaults(this RectTransform rect)
{
//IL_000c: 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)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
rect.anchorMin = new Vector2(0f, 1f);
rect.anchorMax = new Vector2(0f, 1f);
rect.pivot = new Vector2(0f, 1f);
}
public static RectTransform get_rectTransform(GameObject obj)
{
return obj.GetComponent<RectTransform>();
}
public static void SetDefaultImage(this Image image, float ppu = 1f)
{
image.sprite = Builder.image;
image.type = (Type)1;
image.pixelsPerUnitMultiplier = ppu;
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}