using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BRCPlus.Patches; using BRCPlus.Phone; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using CommonAPI.Phone; using HarmonyLib; using Reptile; using Reptile.Phone; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.Playables; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("BRCPlus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BRCPlus")] [assembly: AssemblyTitle("BRCPlus")] [assembly: AssemblyVersion("1.0.0.0")] namespace BRCPlus { public class BRCPlusNotification : MonoBehaviour { private GameObject _canvasGo; private TextMeshProUGUI _label; private Coroutine _hideCoroutine; public static BRCPlusNotification Instance { get; private set; } private void Awake() { Instance = this; } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } private void EnsureCreated() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00fc: 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) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)_canvasGo != (Object)null)) { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { UIManager uIManager = instance.UIManager; obj = ((uIManager != null) ? ((Component)uIManager).transform : null); } Transform val = (Transform)obj; if (!((Object)(object)val == (Object)null)) { _canvasGo = new GameObject("BRCPlus_Notification"); _canvasGo.transform.SetParent(val, false); _canvasGo.SetActive(false); Canvas obj2 = _canvasGo.AddComponent(); obj2.renderMode = (RenderMode)0; obj2.sortingOrder = 200; _canvasGo.AddComponent(); _canvasGo.AddComponent(); GameObject val2 = new GameObject("NotificationLabel"); val2.transform.SetParent(_canvasGo.transform, false); _label = val2.AddComponent(); ((TMP_Text)_label).text = ""; ((TMP_Text)_label).fontSize = 22f; ((Graphic)_label).color = new Color(0f, 1f, 0f); ((TMP_Text)_label).alignment = (TextAlignmentOptions)260; ((TMP_Text)_label).enableWordWrapping = true; RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(1f, 1f); component.anchorMax = new Vector2(1f, 1f); component.pivot = new Vector2(1f, 1f); component.sizeDelta = new Vector2(600f, 160f); component.anchoredPosition = new Vector2(-16f, -10f); } } } public void ShowMessage(string message) { EnsureCreated(); if (!((Object)(object)_canvasGo == (Object)null) && !((Object)(object)_label == (Object)null)) { if (_hideCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_hideCoroutine); } ((TMP_Text)_label).text = message; _canvasGo.SetActive(true); _hideCoroutine = ((MonoBehaviour)this).StartCoroutine(HideAfterDelay(4f)); } } private IEnumerator HideAfterDelay(float seconds) { yield return (object)new WaitForSecondsRealtime(seconds); _hideCoroutine = null; if ((Object)(object)_canvasGo != (Object)null) { _canvasGo.SetActive(false); } if ((Object)(object)_label != (Object)null) { ((TMP_Text)_label).text = ""; } } } [BepInPlugin("com.brcplus", "BRC Plus", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class BRCPlusPlugin : BaseUnityPlugin { private static string _pluginFolder; public static readonly string[] SprayModeOptions = new string[2] { "Normal", "Quick" }; public static readonly string[] PlayerSizeOptions = new string[5] { "Normal", "Small", "Big", "Huge", "EXTRA HUGE" }; public static readonly string[] GravityOptions = new string[3] { "Normal", "Low", "High" }; private Harmony _harmony; public static readonly string[] SkipCutsceneModeOptions = new string[3] { "Normal", "Force button", "Auto Skip" }; public static readonly string[] GoonModeOptions = new string[2] { "Normal", "Auto" }; public static ConfigEntry DisableHeat { get; private set; } public static ConfigEntry GodMode { get; private set; } public static ConfigEntry MaxScores { get; private set; } public static ConfigEntry InstaKillMode { get; private set; } public static ConfigEntry MaxMultiplier { get; private set; } public static ConfigEntry InfiniteBoost { get; private set; } public static ConfigEntry AlwaysInSpeedZone { get; private set; } public static ConfigEntry InfiniteAirDash { get; private set; } public static ConfigEntry GoonMode { get; private set; } public static ConfigEntry LockStoredSpeed { get; private set; } public static ConfigEntry ConfigForcedStoredSpeed { get; private set; } public static ConfigEntry UseStoredSpeedInConfig { get; private set; } public static ConfigEntry SprayMode { get; private set; } public static ConfigEntry GetBoostsFromGraffiti { get; private set; } public static ConfigEntry UIVisible_HealthBar { get; private set; } public static ConfigEntry UIVisible_BoostBar { get; private set; } public static ConfigEntry UIVisible_Score { get; private set; } public static ConfigEntry UIVisible_Rep { get; private set; } public static ConfigEntry UIVisible_Combo { get; private set; } public static ConfigEntry UIVisible_ShowGainingBoostsAnim { get; private set; } public static ConfigEntry PlayerSize { get; private set; } public static ConfigEntry Gravity { get; private set; } public static ConfigEntry SkipCutsceneMode { get; private set; } public static ConfigEntry ShowGraffiti { get; private set; } public static ConfigEntry EnabledDebugMenu { get; private set; } public static ConfigEntry SnailDrop { get; private set; } public static ConfigEntry SnailDropSpeed { get; private set; } public static ConfigEntry SnailLaunch { get; private set; } public static ConfigEntry SnailLaunchSpeed { get; private set; } public static ConfigEntry SnailDash { get; private set; } public static ConfigEntry SnailDashSpeed { get; private set; } public static ConfigEntry SnailDashKey { get; private set; } public static ConfigEntry SnailReverse { get; private set; } public static ConfigEntry SnailReverseSpeed { get; private set; } public static ConfigEntry SnailReverseKey { get; private set; } public static ConfigEntry SnailClip { get; private set; } public static ConfigEntry CanAlwaysBoost { get; private set; } public static ConfigEntry Grinds { get; private set; } public static ConfigEntry Wallruns { get; private set; } public static ConfigEntry VertRamps { get; private set; } public static ConfigEntry AmbientManagerFix { get; private set; } public static ConfigEntry NPCRepScanFix { get; private set; } public static ConfigEntry SkipPlayerAudio { get; private set; } public static ConfigEntry InvisiblePlayer { get; private set; } public static ConfigEntry InvisibleStyle { get; private set; } public static ConfigEntry InvisiblePhone { get; private set; } public static ConfigEntry InvisibleSpraycan { get; private set; } public static ConfigEntry PhoneSize { get; private set; } public static ConfigEntry SpraycanSize { get; private set; } public static ConfigEntry OtherCharactersSize { get; private set; } private void Awake() { //IL_0696: Unknown result type (might be due to invalid IL or missing references) //IL_06a0: Expected O, but got Unknown //IL_06b2: Unknown result type (might be due to invalid IL or missing references) //IL_06bc: Expected O, but got Unknown //IL_06c6: Unknown result type (might be due to invalid IL or missing references) //IL_06cb: Unknown result type (might be due to invalid IL or missing references) //IL_06d7: Expected O, but got Unknown //IL_06dc: Unknown result type (might be due to invalid IL or missing references) //IL_06e1: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Expected O, but got Unknown _pluginFolder = Path.GetDirectoryName(((BaseUnityPlugin)this).Info.Location); DisableHeat = ((BaseUnityPlugin)this).Config.Bind("Heat", "DisableHeat", false, "When true, disables the entire heat/wanted system (no stars, no police chases from crimes)."); GodMode = ((BaseUnityPlugin)this).Config.Bind("Toggles", "GodMode", false, "When true, the player's health cannot go down (invulnerable to damage)."); MaxScores = ((BaseUnityPlugin)this).Config.Bind("Cheats", "MaxScores", false, "When true, every trick adds 99,000,000 to the trick score."); InstaKillMode = ((BaseUnityPlugin)this).Config.Bind("Cheats", "InstaKillMode", false, "When true, any hit kills an enemy instantly regardless of their HP."); MaxMultiplier = ((BaseUnityPlugin)this).Config.Bind("Cheats", "MaxMultiplier", false, "When true, each multiplier increment adds 99 instead of 1."); InfiniteBoost = ((BaseUnityPlugin)this).Config.Bind("Toggles", "Infinite Boost", false, "When true, the player's boost is always kept at maximum so they never lose boost."); AlwaysInSpeedZone = ((BaseUnityPlugin)this).Config.Bind("Toggles", "Always In Speed Zone", false, "When true, the game always treats the player as being in a speed zone (e.g. for slide/vert tricks)."); InfiniteAirDash = ((BaseUnityPlugin)this).Config.Bind("Toggles", "Infinite Air Dash", false, "When true, you can air dash any number of times in the air without landing first (normally only once per air time)."); GoonMode = ((BaseUnityPlugin)this).Config.Bind("Movement", "GoonMode", "Normal", "Goon Mode: Normal = default. Auto = always trigger edge boost when touching any wall run."); LockStoredSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "LockStoredSpeed", false, "When true, the wall run stored speed (used when you run off or jump) cannot change and stays at its current value."); ConfigForcedStoredSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "ConfigForcedStoredSpeed", 600, "Stored speed used when 'Use Stored Speed In Config' is enabled. Enter as a whole number (e.g. 600, 700). A decimal is applied before the last digit (600 = 60.0 speed) to match how other mods display it."); UseStoredSpeedInConfig = ((BaseUnityPlugin)this).Config.Bind("Movement", "UseStoredSpeedInConfig", false, "When true, wall run stored speed is always forced to the ConfigForcedStoredSpeed value."); SprayMode = ((BaseUnityPlugin)this).Config.Bind("Graffiti", "SprayMode", "Normal", "Spray mode: Normal = full minigame. Quick = paint instantly when you start."); GetBoostsFromGraffiti = ((BaseUnityPlugin)this).Config.Bind("Graffiti", "GetBoostsFromGraffiti", true, "When true, spraying graffiti (new pieces) fills your boost meter. When false, no boost is given from graffiti."); NormalizeSprayModeConfig(); string text = "UI Options"; UIVisible_HealthBar = ((BaseUnityPlugin)this).Config.Bind(text, "Health Bar", true, "Show the health bar."); UIVisible_BoostBar = ((BaseUnityPlugin)this).Config.Bind(text, "Boost Bar", true, "Show the boost/charge bar."); UIVisible_Score = ((BaseUnityPlugin)this).Config.Bind(text, "Score", true, "Show the score display."); UIVisible_Rep = ((BaseUnityPlugin)this).Config.Bind(text, "Rep", true, "Show the rep display."); UIVisible_Combo = ((BaseUnityPlugin)this).Config.Bind(text, "Combo", true, "Show the combo mascot and combo UI."); UIVisible_ShowGainingBoostsAnim = ((BaseUnityPlugin)this).Config.Bind(text, "Show Gaining Boosts Anim", true, "Show the gaining boost animation (flying icons when you gain boost)."); string text2 = "Fun"; PlayerSize = ((BaseUnityPlugin)this).Config.Bind(text2, "Player Size", "Normal", "Player scale: Normal, Small, or Big."); Gravity = ((BaseUnityPlugin)this).Config.Bind(text2, "Gravity", "Normal", "Gravity: Normal (default), Low (floaty), or High (heavy)."); SkipCutsceneMode = ((BaseUnityPlugin)this).Config.Bind("Toggles", "SkipCutsceneMode", "Normal", "Cutscene skip: Normal = default behaviour. Force button = skip button always available. Auto Skip = skip all cutscenes automatically."); ShowGraffiti = ((BaseUnityPlugin)this).Config.Bind("Hide Objects", "ShowGraffiti", true, "When true, graffiti spots are visible and work as normal. When false, all graffiti spots on the stage are disabled on load (saves some performance)."); EnabledDebugMenu = ((BaseUnityPlugin)this).Config.Bind("Debug", "EnabledDebugMenu", false, "When true, enables the game's debug menu (toggle in-game). Requires restart to take effect."); SnailDrop = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailDrop", false, "When true, enables the Snail Drop mechanic."); SnailDropSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailDropSpeed", 20f, "The amount of extra downward speed added when Snail Drop activates."); SnailLaunch = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailLaunch", false, "When true, pressing the Phone Down button while the phone is closed converts all speed into upward speed and adds extra units."); SnailLaunchSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailLaunchSpeed", 20f, "The amount of extra upward speed added when Snail Launch activates."); SnailDash = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailDash", false, "When true, pressing R converts all current speed to forward speed and adds extra units."); SnailDashSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailDashSpeed", 20f, "The amount of extra forward speed added when Snail Dash activates."); SnailDashKey = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailDashKey", (KeyCode)99, "The key that triggers Snail Dash."); SnailReverse = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailReverse", false, "When true, enables the Snail Reverse mechanic."); SnailReverseSpeed = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailReverseSpeed", 20f, "The amount of extra backward speed added when Snail Reverse activates."); SnailReverseKey = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailReverseKey", (KeyCode)122, "The key that triggers Snail Reverse."); SnailClip = ((BaseUnityPlugin)this).Config.Bind("Movement", "SnailClip", false, "When true, holding the Spray input disables player collision until Spray is released."); CanAlwaysBoost = ((BaseUnityPlugin)this).Config.Bind("Movement", "CanAlwaysBoost", false, "When true, the player can always boost in the air without needing to land or touch a grind/wallrun first."); Grinds = ((BaseUnityPlugin)this).Config.Bind("Movement", "Grinds", true, "When true, grind rails work normally. When false, the player cannot attach to grind rails."); Wallruns = ((BaseUnityPlugin)this).Config.Bind("Movement", "Wallruns", true, "When true, wall runs work normally. When false, the player cannot attach to wall run lines."); VertRamps = ((BaseUnityPlugin)this).Config.Bind("Movement", "VertRamps", true, "When true, vert ramps work normally. When false, the vert ramp system is disabled and hitting a ramp does nothing."); AmbientManagerFix = ((BaseUnityPlugin)this).Config.Bind("Optimization Patches", "AmbientManagerFix", false, "When true, replaces the per-frame AnimationCurve allocation in AmbientManager with a Mathf.SmoothStep calculation, reducing GC pressure during ambient zone transitions."); NPCRepScanFix = ((BaseUnityPlugin)this).Config.Bind("Optimization Patches", "NPCRepScanFix", false, "When true, throttles the per-frame NPC and GameplayEvent REP requirement scan in WorldHandler to run once every 60 frames instead of every frame."); SkipPlayerAudio = ((BaseUnityPlugin)this).Config.Bind("Optimization Patches", "SkipPlayerAudio", false, "When true, skips UpdateMoveStyleMovementAudio entirely, disabling the player character's movement audio loop."); InvisiblePlayer = ((BaseUnityPlugin)this).Config.Bind("Fun", "Invisible Player", false, "When true, hides the player's mesh."); InvisibleStyle = ((BaseUnityPlugin)this).Config.Bind("Fun", "Invisible Style", false, "When true, hides the player's move style mesh (skateboard, skates, BMX)."); InvisiblePhone = ((BaseUnityPlugin)this).Config.Bind("Fun", "Invisible Phone", false, "When true, hides the player's phone mesh."); InvisibleSpraycan = ((BaseUnityPlugin)this).Config.Bind("Fun", "Invisible Spraycan", false, "When true, hides the player's spraycan mesh."); PhoneSize = ((BaseUnityPlugin)this).Config.Bind("Fun", "Phone Size", "Normal", "Phone mesh scale: Normal, Small, Big, Huge, EXTRA HUGE."); SpraycanSize = ((BaseUnityPlugin)this).Config.Bind("Fun", "Spraycan Size", "Normal", "Spraycan mesh scale: Normal, Small, Big, Huge, EXTRA HUGE."); OtherCharactersSize = ((BaseUnityPlugin)this).Config.Bind("Fun", "Other Characters Size", "Normal", "NPC scale: Normal, Small, Big, Huge, EXTRA HUGE."); NormalizePlayerSizeConfig(); NormalizeGravityConfig(); NormalizeSkipCutsceneModeConfig(); NormalizeGoonModeConfig(); _harmony = new Harmony("com.brcplus"); _harmony.PatchAll(); StageManager.OnStagePostInitialization += new OnStageInitializedDelegate(OnStagePostInitialization); AppBRCPlus.Initialize(); GameObject val = new GameObject("BRCPlus_Notification"); val.AddComponent(); Object.DontDestroyOnLoad((Object)val); GameObject val2 = new GameObject("BRCPlus_Timer"); val2.AddComponent(); Object.DontDestroyOnLoad((Object)val2); } private void OnDestroy() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown StageManager.OnStagePostInitialization -= new OnStageInitializedDelegate(OnStagePostInitialization); Harmony harmony = _harmony; if (harmony != null) { harmony.UnpatchSelf(); } } private static void OnStagePostInitialization() { PropDisguiseManager.InvalidateCache(); ConfigEntry showGraffiti = ShowGraffiti; if (showGraffiti != null && !showGraffiti.Value) { WorldHandler instance = WorldHandler.instance; if (((instance == null) ? null : instance.SceneObjectsRegister?.grafSpots) != null) { foreach (GraffitiSpot grafSpot in instance.SceneObjectsRegister.grafSpots) { if ((Object)(object)grafSpot != (Object)null && (Object)(object)((Component)grafSpot).gameObject != (Object)null) { ((Component)grafSpot).gameObject.SetActive(false); } } } } ConfigEntry invisiblePlayer = InvisiblePlayer; if (invisiblePlayer != null && invisiblePlayer.Value) { WorldHandler instance2 = WorldHandler.instance; ApplyInvisibleTo((instance2 != null) ? instance2.GetCurrentPlayer() : null); } ConfigEntry invisibleStyle = InvisibleStyle; if (invisibleStyle != null && invisibleStyle.Value) { WorldHandler instance3 = WorldHandler.instance; ApplyInvisibleStyleTo((instance3 != null) ? instance3.GetCurrentPlayer() : null); } ConfigEntry invisiblePhone = InvisiblePhone; if (invisiblePhone != null && invisiblePhone.Value) { WorldHandler instance4 = WorldHandler.instance; ApplyInvisiblePhoneTo((instance4 != null) ? instance4.GetCurrentPlayer() : null); } ConfigEntry invisibleSpraycan = InvisibleSpraycan; if (invisibleSpraycan != null && invisibleSpraycan.Value) { WorldHandler instance5 = WorldHandler.instance; ApplyInvisibleSpraycanTo((instance5 != null) ? instance5.GetCurrentPlayer() : null); } WorldHandler instance6 = WorldHandler.instance; ApplyPhoneSizeTo((instance6 != null) ? instance6.GetCurrentPlayer() : null); WorldHandler instance7 = WorldHandler.instance; ApplySpraycanSizeTo((instance7 != null) ? instance7.GetCurrentPlayer() : null); ApplyOtherCharactersSizeTo(); } internal static void NormalizeSprayModeConfig() { if (SprayMode != null) { string value = SprayMode.Value; if (value != "Normal" && value != "Quick") { SprayMode.Value = "Normal"; } } } internal static void NormalizePlayerSizeConfig() { if (PlayerSize != null) { string value = PlayerSize.Value; if (value != "Normal" && value != "Small" && value != "Big" && value != "Huge" && value != "EXTRA HUGE") { PlayerSize.Value = "Normal"; } } } public static void ApplyPlayerSizeTo(Player player) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player == (Object)null) && PlayerSize != null) { float num = PlayerSize.Value switch { "EXTRA HUGE" => 6f, "Huge" => 3f, "Big" => 1.5f, "Small" => 0.5f, _ => 1f, }; ((Component)player).transform.localScale = new Vector3(num, num, num); } } public static void ApplyInvisibleTo(Player player) { if ((Object)(object)player == (Object)null) { return; } CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if (!((Object)(object)value == (Object)null)) { SkinnedMeshRenderer mainRenderer = value.mainRenderer; if ((Object)(object)mainRenderer != (Object)null) { ((Renderer)mainRenderer).enabled = !(InvisiblePlayer?.Value ?? false); } } } public static void ApplyInvisibleStyleTo(Player player) { bool hide; if (!((Object)(object)player == (Object)null)) { CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if (!((Object)(object)value == (Object)null)) { hide = InvisibleStyle?.Value ?? false; PlayerMoveStyleProps moveStyleProps = value.moveStyleProps; SetRenderers(moveStyleProps.skateboard); SetRenderers(moveStyleProps.specialSkateBoard); SetRenderers(moveStyleProps.skateL); SetRenderers(moveStyleProps.skateR); SetRenderers(moveStyleProps.bmxFrame); SetRenderers(moveStyleProps.bmxHandlebars); SetRenderers(moveStyleProps.bmxWheelF); SetRenderers(moveStyleProps.bmxWheelR); SetRenderers(moveStyleProps.bmxGear); SetRenderers(moveStyleProps.bmxPedalL); SetRenderers(moveStyleProps.bmxPedalR); } } void SetRenderers(GameObject go) { if (!((Object)(object)go == (Object)null)) { Renderer[] componentsInChildren = go.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = !hide; } } } } public static void ApplyInvisiblePhoneTo(Player player) { if ((Object)(object)player == (Object)null) { return; } CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if ((Object)(object)value == (Object)null) { return; } object value2 = Traverse.Create((object)value).Field("VFX").GetValue(); if (value2 == null) { return; } GameObject value3 = Traverse.Create(value2).Field("phone").GetValue(); if (!((Object)(object)value3 == (Object)null)) { Renderer[] componentsInChildren = value3.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = !(InvisiblePhone?.Value ?? false); } } } public static void ApplyInvisibleSpraycanTo(Player player) { if ((Object)(object)player == (Object)null) { return; } CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if ((Object)(object)value == (Object)null) { return; } object value2 = Traverse.Create((object)value).Field("VFX").GetValue(); if (value2 == null) { return; } GameObject value3 = Traverse.Create(value2).Field("spraycan").GetValue(); if (!((Object)(object)value3 == (Object)null)) { Renderer[] componentsInChildren = value3.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].enabled = !(InvisibleSpraycan?.Value ?? false); } } } public static void ApplyPhoneSizeTo(Player player) { //IL_00dc: 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) if ((Object)(object)player == (Object)null) { return; } CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if ((Object)(object)value == (Object)null) { return; } object value2 = Traverse.Create((object)value).Field("VFX").GetValue(); if (value2 != null) { GameObject value3 = Traverse.Create(value2).Field("phone").GetValue(); if (!((Object)(object)value3 == (Object)null)) { string obj = PhoneSize?.Value ?? "Normal"; value3.transform.localScale = Vector3.one * obj switch { "EXTRA HUGE" => 6f, "Huge" => 3f, "Big" => 1.5f, "Small" => 0.5f, _ => 1f, }; } } } public static void ApplySpraycanSizeTo(Player player) { //IL_00dc: 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) if ((Object)(object)player == (Object)null) { return; } CharacterVisual value = Traverse.Create((object)player).Field("characterVisual").GetValue(); if ((Object)(object)value == (Object)null) { return; } object value2 = Traverse.Create((object)value).Field("VFX").GetValue(); if (value2 != null) { GameObject value3 = Traverse.Create(value2).Field("spraycan").GetValue(); if (!((Object)(object)value3 == (Object)null)) { string obj = SpraycanSize?.Value ?? "Normal"; value3.transform.localScale = Vector3.one * obj switch { "EXTRA HUGE" => 6f, "Huge" => 3f, "Big" => 1.5f, "Small" => 0.5f, _ => 1f, }; } } } public static void ApplyOtherCharactersSizeTo() { //IL_00c2: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; if (((instance == null) ? null : instance.SceneObjectsRegister?.NPCs) == null) { return; } float num = (OtherCharactersSize?.Value ?? "Normal") switch { "EXTRA HUGE" => 6f, "Huge" => 3f, "Big" => 1.5f, "Small" => 0.5f, _ => 1f, }; foreach (NPC nPC in instance.SceneObjectsRegister.NPCs) { if ((Object)(object)nPC != (Object)null) { ((Component)nPC).transform.localScale = new Vector3(num, num, num); } } } internal static void NormalizeGravityConfig() { if (Gravity != null) { string value = Gravity.Value; if (value != "Normal" && value != "Low" && value != "High") { Gravity.Value = "Normal"; } } } internal static void NormalizeSkipCutsceneModeConfig() { if (SkipCutsceneMode != null) { string value = SkipCutsceneMode.Value; if (Array.IndexOf(SkipCutsceneModeOptions, value) < 0) { SkipCutsceneMode.Value = "Normal"; } } } internal static void NormalizeGoonModeConfig() { if (GoonMode == null) { return; } string value = GoonMode.Value; switch (value) { case "Disabled": case "False": case "false": GoonMode.Value = "Normal"; return; case "Enabled": case "True": case "true": GoonMode.Value = "Auto"; return; } if (Array.IndexOf(GoonModeOptions, value) < 0) { GoonMode.Value = "Normal"; } } public static string GetAppIconPath(string filename) { if (!string.IsNullOrEmpty(_pluginFolder)) { return Path.Combine(_pluginFolder, filename); } return null; } } public static class PluginInfo { public const string PLUGIN_GUID = "com.brcplus"; public const string PLUGIN_NAME = "BRC Plus"; public const string PLUGIN_VERSION = "1.0.0"; } public class BRCPlusTimer : MonoBehaviour { private GameObject _canvasGo; private TextMeshProUGUI _label; private Coroutine _clearCoroutine; private float _startTime; private float _finalTime; public static BRCPlusTimer Instance { get; private set; } public bool IsRunning { get; private set; } private void Awake() { Instance = this; } private void OnDestroy() { if ((Object)(object)Instance == (Object)(object)this) { Instance = null; } } private void Update() { if (IsRunning && !((Object)(object)_label == (Object)null)) { ((TMP_Text)_label).text = FormatTime(Time.realtimeSinceStartup - _startTime); } } private void EnsureCreated() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Expected O, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: 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_017c: 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 (!((Object)(object)_canvasGo != (Object)null)) { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { UIManager uIManager = instance.UIManager; obj = ((uIManager != null) ? ((Component)uIManager).transform : null); } Transform val = (Transform)obj; if (!((Object)(object)val == (Object)null)) { _canvasGo = new GameObject("BRCPlus_Timer"); _canvasGo.transform.SetParent(val, false); Canvas obj2 = _canvasGo.AddComponent(); obj2.renderMode = (RenderMode)0; obj2.sortingOrder = 210; _canvasGo.AddComponent(); _canvasGo.AddComponent(); GameObject val2 = new GameObject("TimerLabel"); val2.transform.SetParent(_canvasGo.transform, false); _label = val2.AddComponent(); ((TMP_Text)_label).text = "00:00.000"; ((TMP_Text)_label).fontSize = 34f; ((Graphic)_label).color = Color.white; ((TMP_Text)_label).alignment = (TextAlignmentOptions)258; ((TMP_Text)_label).enableWordWrapping = false; ((TMP_Text)_label).outlineWidth = 0.2f; ((TMP_Text)_label).outlineColor = Color32.op_Implicit(Color.black); RectTransform component = val2.GetComponent(); component.anchorMin = new Vector2(0.5f, 1f); component.anchorMax = new Vector2(0.5f, 1f); component.pivot = new Vector2(0.5f, 1f); component.sizeDelta = new Vector2(400f, 80f); component.anchoredPosition = new Vector2(0f, -16f); _canvasGo.SetActive(false); } } } public void StartTimer() { EnsureCreated(); if (!((Object)(object)_canvasGo == (Object)null) && !((Object)(object)_label == (Object)null)) { if (_clearCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_clearCoroutine); _clearCoroutine = null; } _startTime = Time.realtimeSinceStartup; _finalTime = 0f; IsRunning = true; ((TMP_Text)_label).text = FormatTime(0f); _canvasGo.SetActive(true); } } public void EndTimer() { if (IsRunning) { EnsureCreated(); _finalTime = Time.realtimeSinceStartup - _startTime; IsRunning = false; if ((Object)(object)_label != (Object)null) { ((TMP_Text)_label).text = FormatTime(_finalTime); } if ((Object)(object)_canvasGo != (Object)null) { _canvasGo.SetActive(true); } if (_clearCoroutine != null) { ((MonoBehaviour)this).StopCoroutine(_clearCoroutine); } _clearCoroutine = ((MonoBehaviour)this).StartCoroutine(ClearAfterDelay(10f)); } } private IEnumerator ClearAfterDelay(float seconds) { yield return (object)new WaitForSecondsRealtime(seconds); _clearCoroutine = null; if ((Object)(object)_canvasGo != (Object)null) { _canvasGo.SetActive(false); } if ((Object)(object)_label != (Object)null) { ((TMP_Text)_label).text = ""; } } private static string FormatTime(float seconds) { if (seconds < 0f) { seconds = 0f; } int num = Mathf.FloorToInt(seconds / 60f); int num2 = Mathf.FloorToInt(seconds % 60f); int num3 = Mathf.FloorToInt((seconds - Mathf.Floor(seconds)) * 1000f); return $"{num:00}:{num2:00}.{num3:000}"; } } public class GameDebugBridge : AGameDebug { private UIManager _uiManager; private bool _menuCreated; public override bool IsShowingDebugMenu { get { DebugMenuController value = Traverse.Create((object)_uiManager).Field("debugMenuUIRoot").GetValue(); if ((Object)(object)value != (Object)null) { return ((AMenuController)value).IsEnabled; } return false; } } public GameDebugBridge(BaseModule baseModule, SaveManager saveManager, GameInput gameInput, UIManager uIManager) : base(baseModule, saveManager, gameInput, uIManager) { _uiManager = uIManager; } protected override void InitializeFPSCounter() { } protected override void UpdateKeyboardInput() { if (base.baseModule.IsPlayingInStage) { base.gameInput.EnableControllerMap(3, 0); } if (base.gameInput.GetButtonNew(40, 0)) { ((AGameDebug)this).ToggleDebugMenu(); } } protected override void UpdateJoystickInput() { if (base.baseModule.IsPlayingInStage) { base.gameInput.EnableControllerMap(3, 0); } if (base.gameInput.GetButtonNew(40, 0)) { ((AGameDebug)this).ToggleDebugMenu(); } } public override void ToggleDebugMenu() { DebugMenuController val = Traverse.Create((object)_uiManager).Field("debugMenuUIRoot").GetValue(); if ((Object)(object)val != (Object)null && ((AMenuController)val).IsEnabled) { _uiManager.PopCurrentMenu(); if (base.baseModule.IsInGamePaused) { base.baseModule.UnPauseGame((PauseType)64); } return; } if ((Object)(object)val == (Object)null && (Object)(object)_uiManager.debugUIPrefab != (Object)null && !_menuCreated) { _menuCreated = true; GameObject obj = Object.Instantiate(_uiManager.debugUIPrefab); obj.transform.SetParent(((Component)_uiManager).transform, false); DebugMenuController componentInChildren = obj.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.InitDebugMenu((AGameDebug)(object)this, base.baseModule, base.saveManager, _uiManager); Traverse.Create((object)_uiManager).Field("debugMenuUIRoot").SetValue((object)componentInChildren); val = componentInChildren; } } if ((Object)(object)val != (Object)null && !((AMenuController)val).IsEnabled) { base.baseModule.PauseGame((PauseType)64); ((Component)val).gameObject.SetActive(true); ((AMenuController)val).Activate(); _uiManager.PushNewMenu((IUIMenuController)(object)val); _uiManager.ForceFocusOnTopMenu(); } } public override void ToggleFPSCounter() { } public override void CycleFPSCounterPreset() { } public override void RestartStage() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.baseModule != (Object)null && base.baseModule.StageManager != null) { base.baseModule.SwitchStage(base.baseModule.CurrentStage); } } public override void SelectStage(Stage stage) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)base.baseModule != (Object)null) { base.baseModule.SwitchStage(stage); } } public override void CycleQualitySettings() { } public override void UpdateLocalizationLanguage(SystemLanguage systemLanguage) { } } public static class PropDisguiseManager { private static Dictionary _propByIndex = new Dictionary(); private static Dictionary _playerDisguises = new Dictionary(); private static bool _cacheReady = false; public static void InvalidateCache() { _cacheReady = false; _propByIndex.Clear(); } private static int HashString(string s) { return s.GetHashCode(); } private static string GetHierarchyPath(GameObject go) { string text = ((Object)go).name; Transform val = go.transform; while ((Object)(object)val.parent != (Object)null) { val = val.parent; text = ((Object)val).name + "/" + text; } return text; } private static int GenerateGameObjectID(GameObject obj) { return HashString(GetHierarchyPath(obj) + "$" + obj.transform.GetSiblingIndex()); } private static void CacheProps() { if (_cacheReady) { return; } _cacheReady = true; _propByIndex.Clear(); Junk[] array = Object.FindObjectsOfType(); foreach (Junk val in array) { StageChunk componentInParent = ((Component)val).GetComponentInParent(); JunkStageHandler componentInParent2 = ((Component)val).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) || !((Object)(object)componentInParent2 == (Object)null)) { int key = GenerateGameObjectID(((Component)val).gameObject); _propByIndex[key] = ((Component)val).gameObject; } } StreetLife[] array2 = Object.FindObjectsOfType(); foreach (StreetLife val2 in array2) { if (!((Object)(object)((Component)val2).GetComponentInParent() == (Object)null) && !((Object)(object)((Component)val2).GetComponent() != (Object)null)) { int key2 = GenerateGameObjectID(((Component)val2).gameObject); _propByIndex[key2] = ((Component)val2).gameObject; } } } public static List<(int id, string label)> GetPropsForMenu() { CacheProps(); List<(int, string)> list = new List<(int, string)>(); foreach (KeyValuePair item in _propByIndex) { if (!((Object)(object)item.Value == (Object)null)) { list.Add((item.Key, ((Object)item.Value).name)); } } return list; } public static GameObject GetPropSourceById(int id) { CacheProps(); if (!_propByIndex.TryGetValue(id, out var value)) { return null; } return value; } public static int? GetNearestPropId(Player player) { //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_006c: 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) //IL_0083: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { return null; } CacheProps(); if (_propByIndex.Count == 0) { return null; } Vector3 position = ((Component)player).transform.position; int value = 0; float num = float.MaxValue; bool flag = true; foreach (KeyValuePair item in _propByIndex) { if (!((Object)(object)item.Value == (Object)null)) { Vector3 val = position - item.Value.transform.position; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (flag || sqrMagnitude < num) { flag = false; num = sqrMagnitude; value = item.Key; } } } if (!flag) { return value; } return null; } public static bool HasDisguise(Player player) { if ((Object)(object)player == (Object)null) { return false; } CleanupNullDisguises(); if (_playerDisguises.TryGetValue(player, out (GameObject, int) value)) { return (Object)(object)value.Item1 != (Object)null; } return false; } private static void CleanupNullDisguises() { List list = new List(); foreach (KeyValuePair playerDisguise in _playerDisguises) { if ((Object)(object)playerDisguise.Value.Item1 == (Object)null) { list.Add(playerDisguise.Key); } } foreach (Player item in list) { _playerDisguises.Remove(item); } } private static void SetPlayerVisualVisible(Player player, bool visible) { Transform value = Traverse.Create((object)player).Field("visualTf").GetValue(); if ((Object)(object)value != (Object)null && (Object)(object)((Component)value).gameObject != (Object)null) { ((Component)value).gameObject.SetActive(visible); } } private static void AutoAdjustProp(GameObject disguise, Player player) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: 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_002e: 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_0044: 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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_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_0082: 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_009a: 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_00a9: 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_00be: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_00ee: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0112: 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_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0204: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) Renderer componentInChildren = disguise.GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } Bounds localBounds = componentInChildren.localBounds; Vector3[] array = (Vector3[])(object)new Vector3[8] { new Vector3(((Bounds)(ref localBounds)).min.x, ((Bounds)(ref localBounds)).min.y, ((Bounds)(ref localBounds)).min.z), new Vector3(((Bounds)(ref localBounds)).min.x, ((Bounds)(ref localBounds)).min.y, ((Bounds)(ref localBounds)).max.z), new Vector3(((Bounds)(ref localBounds)).min.x, ((Bounds)(ref localBounds)).max.y, ((Bounds)(ref localBounds)).max.z), new Vector3(((Bounds)(ref localBounds)).min.x, ((Bounds)(ref localBounds)).max.y, ((Bounds)(ref localBounds)).min.z), new Vector3(((Bounds)(ref localBounds)).max.x, ((Bounds)(ref localBounds)).max.y, ((Bounds)(ref localBounds)).max.z), new Vector3(((Bounds)(ref localBounds)).max.x, ((Bounds)(ref localBounds)).max.y, ((Bounds)(ref localBounds)).min.z), new Vector3(((Bounds)(ref localBounds)).max.x, ((Bounds)(ref localBounds)).min.y, ((Bounds)(ref localBounds)).min.z), new Vector3(((Bounds)(ref localBounds)).max.x, ((Bounds)(ref localBounds)).min.y, ((Bounds)(ref localBounds)).max.z) }; Vector3 val = Vector3.zero; float num = float.MaxValue; for (int i = 0; i < array.Length; i++) { Vector3 val2 = ((Component)componentInChildren).transform.TransformPoint(array[i]); Vector3 val3 = ((Component)player).transform.InverseTransformPoint(val2); val += val3; if (val3.y < num) { num = val3.y; } } val /= (float)array.Length; val.y = num; disguise.transform.localPosition = -val; } public static bool ApplyDisguise(Player player, int disguiseId) { //IL_00de: 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_0112: 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) if ((Object)(object)player == (Object)null) { return false; } CacheProps(); if (!_propByIndex.TryGetValue(disguiseId, out var value) || (Object)(object)value == (Object)null) { return false; } RemoveDisguise(player); SetPlayerVisualVisible(player, visible: false); GameObject val = Object.Instantiate(value); val.SetActive(true); bool flag = false; Junk component = val.GetComponent(); if ((Object)(object)component != (Object)null) { Object.Destroy((Object)(object)component); flag = true; } Rigidbody component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.Destroy((Object)(object)component2); } StreetLife component3 = val.GetComponent(); if ((Object)(object)component3 != (Object)null) { Animator component4 = val.GetComponent(); if ((Object)(object)component4 != (Object)null) { int num = Animator.StringToHash(((object)(IdleAnimation)(ref component3.idleAnimation)).ToString()); component4.Play(num, 0); } Object.Destroy((Object)(object)component3); } val.transform.SetParent(((Component)player).transform); val.transform.SetLocalPositionAndRotation(Vector3.zero, Quaternion.identity); if (flag) { val.transform.rotation = value.transform.rotation; } val.transform.localScale = value.transform.localScale; if ((Object)(object)WorldHandler.instance != (Object)null && (Object)(object)WorldHandler.instance.GetCurrentPlayer() == (Object)(object)player) { if ((Object)(object)component3 == (Object)null) { AutoAdjustProp(val, player); } val.layer = 15; Collider[] componentsInChildren = val.GetComponentsInChildren(); foreach (Collider val2 in componentsInChildren) { if ((Object)(object)val2 != (Object)null) { Object.Destroy((Object)(object)val2); } } } _playerDisguises[player] = (val, disguiseId); return true; } public static bool RemoveDisguise(Player player) { if ((Object)(object)player == (Object)null) { return false; } CleanupNullDisguises(); if (!_playerDisguises.TryGetValue(player, out (GameObject, int) value)) { return false; } _playerDisguises.Remove(player); if ((Object)(object)value.Item1 != (Object)null) { Object.Destroy((Object)(object)value.Item1); } SetPlayerVisualVisible(player, visible: true); return true; } } public static class MyPluginInfo { public const string PLUGIN_GUID = "BRCPlus"; public const string PLUGIN_NAME = "BRCPlus"; public const string PLUGIN_VERSION = "1.0.0"; } } namespace BRCPlus.Phone { public class AppBRCPlus : CustomApp { private static List _spawnedObjects = new List(); private static readonly List<(BasicEnemy enemy, bool destroyOnRemove)> SpawnedEnemies = new List<(BasicEnemy, bool)>(); private static Mesh _cubeMesh; private const int SaveFilesSlotCount = 3; private static readonly Characters[] _spawnableCharacters = ((Characters[])Enum.GetValues(typeof(Characters))).Where((Characters c) => (int)c != -1 && (int)c != 26).ToArray(); private static readonly (string Label, Stage Stage)[] TravelableMaps = new(string, Stage)[8] { ("Hideout", (Stage)5), ("Police Station", (Stage)8), ("Versum Hill", (Stage)4), ("Millennium Mall", (Stage)6), ("Mataan", (Stage)7), ("Pyramid Island", (Stage)9), ("Millennium Square", (Stage)11), ("Brink Terminal", (Stage)12) }; public static void RemoveAllSpawnedObjects() { foreach (GameObject spawnedObject in _spawnedObjects) { if ((Object)(object)spawnedObject != (Object)null) { Object.Destroy((Object)(object)spawnedObject); } } _spawnedObjects.Clear(); } private static void RemoveMostRecentSpawnedObject() { if (_spawnedObjects.Count != 0) { int index = _spawnedObjects.Count - 1; GameObject val = _spawnedObjects[index]; _spawnedObjects.RemoveAt(index); if ((Object)(object)val != (Object)null) { Object.Destroy((Object)(object)val); } } } private static void SetLayerRecursively(GameObject go, int layer) { if (!((Object)(object)go == (Object)null)) { go.layer = layer; for (int i = 0; i < go.transform.childCount; i++) { SetLayerRecursively(((Component)go.transform.GetChild(i)).gameObject, layer); } } } private static bool TransformContainsDescendant(Transform parent, Transform descendant) { Transform val = descendant; while ((Object)(object)val != (Object)null) { if ((Object)(object)val == (Object)(object)parent) { return true; } val = val.parent; } return false; } private static Transform GetWallrunCloneRoot(WallrunLine line) { if ((Object)(object)line == (Object)null) { return null; } Transform transform = ((Component)line).transform; Transform node = line.node0; Transform node2 = line.node1; if ((Object)(object)node == (Object)null || (Object)(object)node2 == (Object)null) { return transform; } Transform val = transform; while ((Object)(object)val != (Object)null) { if (TransformContainsDescendant(val, node) && TransformContainsDescendant(val, node2)) { return val; } val = val.parent; } return transform; } private static void SpawnWallrunInFrontOfPlayer() { //IL_0044: 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_004e: 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_0057: 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_007d: 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_0088: 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_0092: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: 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_0076: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null) { return; } WallrunLine val2 = Object.FindObjectOfType(true); if ((Object)(object)val2 == (Object)null) { return; } Transform wallrunCloneRoot = GetWallrunCloneRoot(val2); if (!((Object)(object)wallrunCloneRoot == (Object)null)) { Vector3 val3 = Vector3.ProjectOnPlane(val.tf.forward, Vector3.up); Vector3 val4 = ((Vector3)(ref val3)).normalized; if (((Vector3)(ref val4)).sqrMagnitude < 0.01f) { val4 = val.tf.forward; } Vector3 position = val.tf.position + val4 * 5f; GameObject val5 = Object.Instantiate(((Component)wallrunCloneRoot).gameObject); val5.transform.position = position; val5.transform.rotation = Quaternion.LookRotation(-val4); SetLayerRecursively(val5, 0); WallrunLine componentInChildren = val5.GetComponentInChildren(true); if ((Object)(object)componentInChildren != (Object)null) { ((Component)componentInChildren).gameObject.layer = 13; componentInChildren.attachedWallrunLine0 = null; componentInChildren.attachedWallrunLine1 = null; } RemoveAllMeshRenderersFrom(val5); AddGreyBoxVisualToWallrunClone(val5); val5.SetActive(true); _spawnedObjects.Add(val5); } } private static void SpawnWallrunCubeInFrontOfPlayer() { //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_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) //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_006f: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Expected O, but got Unknown //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //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_00d2: Unknown result type (might be due to invalid IL or missing references) //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_00df: 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_00e7: 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_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: 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_0109: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: 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_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012b: 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_0133: 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_013b: 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_0145: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0162: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: 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: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0274: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Expected O, but got Unknown //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null) { return; } Vector3 val2 = Vector3.ProjectOnPlane(val.tf.forward, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.forward; } val2 = Vector3.Cross(Vector3.up, val3); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val4 = val.tf.position + val3 * 7f + Vector3.up * 1.5f; GameObject val5 = new GameObject("BRCPlus_WallrunCube"); val5.transform.position = val4; Transform[] array = (Transform[])(object)new Transform[4]; float num = 4f; Vector3[] array2 = (Vector3[])(object)new Vector3[4] { val4 + val3 * num + normalized * num, val4 - val3 * num + normalized * num, val4 - val3 * num - normalized * num, val4 + val3 * num - normalized * num }; for (int i = 0; i < array.Length; i++) { Transform transform = new GameObject("WallrunCubeNode" + i).transform; transform.SetParent(val5.transform, true); transform.position = array2[i]; array[i] = transform; } WallrunLine[] array3 = (WallrunLine[])(object)new WallrunLine[4]; for (int j = 0; j < array3.Length; j++) { Transform val6 = array[j]; Transform val7 = array[(j + 1) % array.Length]; val2 = val7.position - val6.position; Vector3 normalized2 = ((Vector3)(ref val2)).normalized; Vector3 val8 = (val6.position + val7.position) * 0.5f; val2 = Vector3.ProjectOnPlane(val4 - val8, Vector3.up); Vector3 val9 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val9)).sqrMagnitude < 0.01f) { val2 = Vector3.Cross(Vector3.up, normalized2); val9 = -((Vector3)(ref val2)).normalized; } GameObject val10 = new GameObject("WallrunCubeLine" + j); val10.transform.SetParent(val5.transform, true); val10.transform.position = val8; val10.transform.rotation = Quaternion.LookRotation(val9, Vector3.up); val10.layer = 13; BoxCollider obj = val10.AddComponent(); obj.size = new Vector3(6.8f, 5f, 0.35f); obj.center = Vector3.zero; ((Collider)obj).isTrigger = false; WallrunLine val11 = val10.AddComponent(); val11.node0 = val6; val11.node1 = val7; array3[j] = val11; AddGreyBoxVisualToWallrunClone(val10); } for (int k = 0; k < array3.Length; k++) { array3[k].attachedWallrunLine0 = array3[(k + array3.Length - 1) % array3.Length]; array3[k].attachedWallrunLine1 = array3[(k + 1) % array3.Length]; } RebuildWallrunFamily(array3); val5.SetActive(true); _spawnedObjects.Add(val5); } private static void SpawnBlockInFrontOfPlayer() { //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_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) //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_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) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_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_007e: 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_008a: Expected O, but got Unknown //IL_0090: 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_009d: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null) { return; } Vector3 val2 = Vector3.ProjectOnPlane(val.tf.forward, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.forward; } Vector3 position = val.tf.position + val3 * 6f + Vector3.up * 1.5f; GameObject val4 = new GameObject("BRCPlus_Block"); val4.transform.position = position; val4.transform.rotation = Quaternion.LookRotation(val3); Mesh cubeMesh = GetCubeMesh(); if ((Object)(object)cubeMesh != (Object)null) { val4.AddComponent().sharedMesh = cubeMesh; MeshRenderer val5 = val4.AddComponent(); Shader val6 = Shader.Find("Standard"); if ((Object)(object)val6 != (Object)null) { Material val7 = new Material(val6); val7.color = new Color(0.45f, 0.45f, 0.45f); ((Renderer)val5).sharedMaterial = val7; } } val4.transform.localScale = new Vector3(4f, 3f, 4f); val4.AddComponent().size = Vector3.one; SetLayerRecursively(val4, 0); val4.SetActive(true); _spawnedObjects.Add(val4); } private static void SpawnSlopedWallrunInFrontOfPlayer(bool upward) { //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_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) //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_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005e: 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_006e: Unknown result type (might be due to invalid IL or missing references) //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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0092: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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_00bc: 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) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: 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_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: 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) //IL_0123: 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_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017d: 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_0189: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Expected O, but got Unknown WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if (!((Object)(object)val == (Object)null)) { Vector3 val2 = Vector3.ProjectOnPlane(val.tf.forward, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.forward; } val2 = Vector3.Cross(Vector3.up, val3); Vector3 normalized = ((Vector3)(ref val2)).normalized; Vector3 val4 = val.tf.position + val3 * 6f + Vector3.up * 2f; val2 = normalized + Vector3.up * (upward ? 0.7f : (-0.7f)); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; Vector3 val5 = -val3; GameObject val6 = new GameObject(upward ? "BRCPlus_UpWallrun" : "BRCPlus_DownWallrun"); val6.transform.position = val4; Transform transform = new GameObject("WallrunNode0").transform; transform.SetParent(val6.transform, true); transform.position = val4 - normalized2 * 4f; Transform transform2 = new GameObject("WallrunNode1").transform; transform2.SetParent(val6.transform, true); transform2.position = val4 + normalized2 * 4f; GameObject val7 = new GameObject(upward ? "UpWallrunLine" : "DownWallrunLine"); val7.transform.SetParent(val6.transform, true); val7.transform.position = val4; val7.transform.rotation = Quaternion.LookRotation(val5, Vector3.up); val7.layer = 13; BoxCollider obj = val7.AddComponent(); obj.size = new Vector3(8f, 5f, 0.35f); obj.center = Vector3.zero; ((Collider)obj).isTrigger = false; WallrunLine obj2 = val7.AddComponent(); obj2.node0 = transform; obj2.node1 = transform2; AddGreyBoxVisualToWallrunClone(val7); val6.SetActive(true); _spawnedObjects.Add(val6); } } private static void RebuildWallrunFamily(WallrunLine[] lines) { if (lines == null || lines.Length == 0) { return; } List value = new List(); lines[0].AddBrothersToFamily(ref value); foreach (WallrunLine val in lines) { if ((Object)(object)val != (Object)null) { Traverse.Create((object)val).Field("wallrunLines").SetValue((object)value); } } } private static void RemoveAllMeshRenderersFrom(GameObject root) { if ((Object)(object)root == (Object)null) { return; } MeshRenderer[] componentsInChildren = root.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { if ((Object)(object)componentsInChildren[i] != (Object)null) { Object.Destroy((Object)(object)componentsInChildren[i]); } } } private static Mesh GetCubeMesh() { if ((Object)(object)_cubeMesh != (Object)null) { return _cubeMesh; } GameObject obj = GameObject.CreatePrimitive((PrimitiveType)3); MeshFilter component = obj.GetComponent(); if ((Object)(object)component != (Object)null) { _cubeMesh = component.sharedMesh; } Object.Destroy((Object)(object)obj); return _cubeMesh; } private static void AddGreyBoxVisualToWallrunClone(GameObject cloneGo) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0093: 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_00a0: 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) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_0062: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) BoxCollider componentInChildren = cloneGo.GetComponentInChildren(true); Collider val = (Collider)(object)componentInChildren; if ((Object)(object)val == (Object)null) { val = cloneGo.GetComponentInChildren(true); } if ((Object)(object)val == (Object)null) { return; } Mesh cubeMesh = GetCubeMesh(); if (!((Object)(object)cubeMesh == (Object)null)) { GameObject val2 = new GameObject("WallrunVisual"); val2.transform.SetParent(((Component)val).transform, false); if ((Object)(object)componentInChildren != (Object)null) { val2.transform.localPosition = componentInChildren.center; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = componentInChildren.size; } else { Bounds bounds = val.bounds; Vector3 lossyScale = ((Component)val).transform.lossyScale; val2.transform.localPosition = Vector3.zero; val2.transform.localRotation = Quaternion.identity; val2.transform.localScale = new Vector3((lossyScale.x > 0.001f) ? (((Bounds)(ref bounds)).size.x / lossyScale.x) : ((Bounds)(ref bounds)).size.x, (lossyScale.y > 0.001f) ? (((Bounds)(ref bounds)).size.y / lossyScale.y) : ((Bounds)(ref bounds)).size.y, (lossyScale.z > 0.001f) ? (((Bounds)(ref bounds)).size.z / lossyScale.z) : ((Bounds)(ref bounds)).size.z); } val2.AddComponent().sharedMesh = cubeMesh; MeshRenderer val3 = val2.AddComponent(); Shader val4 = Shader.Find("Standard"); if ((Object)(object)val4 != (Object)null) { Material val5 = new Material(val4); val5.color = new Color(0.45f, 0.45f, 0.45f); ((Renderer)val3).sharedMaterial = val5; } SetLayerRecursively(val2, 0); } } public static void Initialize() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0062: 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) Sprite val = null; string appIconPath = BRCPlusPlugin.GetAppIconPath("AppIcon.png"); if (!string.IsNullOrEmpty(appIconPath) && File.Exists(appIconPath)) { try { byte[] array = File.ReadAllBytes(appIconPath); Texture2D val2 = new Texture2D(2, 2); if (ImageConversion.LoadImage(val2, array)) { ((Texture)val2).wrapMode = (TextureWrapMode)1; ((Texture)val2).filterMode = (FilterMode)1; val2.Apply(); val = Sprite.Create(val2, new Rect(0f, 0f, (float)((Texture)val2).width, (float)((Texture)val2).height), new Vector2(0.5f, 0.5f)); } } catch { } } if ((Object)(object)val != (Object)null) { PhoneAPI.RegisterApp("BRC Plus", val); } else { PhoneAPI.RegisterApp("BRC Plus", (Sprite)null); } } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("BRC Plus", 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); PopulateButtons(); } public override void OnAppEnable() { ((App)this).OnAppEnable(); PopulateButtons(); } private void PopulateButtons() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Fun"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowFunMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Toggles"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowTogglesMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Maps"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(ShowMapsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Map Chunks"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(ShowLocationsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Map Options"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(ShowMapOptionsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Movement"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(ShowMovementMenu)); base.ScrollView.AddButton((PhoneButton)(object)val6); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("Characters"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, new Action(ShowCharactersMenu)); base.ScrollView.AddButton((PhoneButton)(object)val7); SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton("Graffiti"); ((PhoneButton)val8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val8).OnConfirm, new Action(ShowGraffitiMenu)); base.ScrollView.AddButton((PhoneButton)(object)val8); SimplePhoneButton val9 = PhoneUIUtility.CreateSimpleButton("Enemy"); ((PhoneButton)val9).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val9).OnConfirm, new Action(ShowEnemyMenu)); base.ScrollView.AddButton((PhoneButton)(object)val9); SimplePhoneButton val10 = PhoneUIUtility.CreateSimpleButton("Heat"); ((PhoneButton)val10).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val10).OnConfirm, new Action(ShowHeatMenu)); base.ScrollView.AddButton((PhoneButton)(object)val10); SimplePhoneButton val11 = PhoneUIUtility.CreateSimpleButton("Optimize"); ((PhoneButton)val11).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val11).OnConfirm, new Action(ShowOptimizeMenu)); base.ScrollView.AddButton((PhoneButton)(object)val11); SimplePhoneButton val12 = PhoneUIUtility.CreateSimpleButton("UI Options"); ((PhoneButton)val12).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val12).OnConfirm, new Action(ShowUIOptionsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val12); SimplePhoneButton val13 = PhoneUIUtility.CreateSimpleButton("Cut Scenes"); ((PhoneButton)val13).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val13).OnConfirm, new Action(ShowCutScenesMenu)); base.ScrollView.AddButton((PhoneButton)(object)val13); SimplePhoneButton val14 = PhoneUIUtility.CreateSimpleButton("Save Files"); ((PhoneButton)val14).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val14).OnConfirm, new Action(ShowSaveFilesMenu)); base.ScrollView.AddButton((PhoneButton)(object)val14); SimplePhoneButton val15 = PhoneUIUtility.CreateSimpleButton("Cheats"); ((PhoneButton)val15).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val15).OnConfirm, new Action(ShowCheatsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val15); } private void ShowMapOptionsMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Reset High Score"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ResetHighScore)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Spray All Graffiti Spots"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(SprayAllGraffitiSpots)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Unlock Robo Posts"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(UnlockRoboPosts)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Get Collectibles"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(GetAllCollectables)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Reload Map"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(ReloadMap)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val6); } private void ReloadMap() { Core instance = Core.Instance; if ((Object)(object)((instance != null) ? instance.BaseModule : null) == (Object)null) { return; } BaseModule baseModule = instance.BaseModule; if (baseModule.IsLoading || !baseModule.IsPlayingInStage) { return; } StageManager stageManager = baseModule.StageManager; if (stageManager != null) { if (baseModule.IsInGamePaused) { baseModule.UnPauseGame((PauseType)65535); } ((App)this).MyPhone.TurnOff(true); stageManager.RestartStage(); } } private static void ResetHighScore() { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { SaveManager saveManager = instance.SaveManager; if (saveManager == null) { obj = null; } else { SaveSlotData currentSaveSlot = saveManager.CurrentSaveSlot; obj = ((currentSaveSlot != null) ? currentSaveSlot.GetCurrentStageProgress() : null); } } StageProgress val = (StageProgress)obj; if (val != null) { val.highestCombo = 0f; Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("High score reset!"); } } private void ShowCheatsMenu() { base.ScrollView.RemoveAllButtons(); bool flag = BRCPlusPlugin.GodMode?.Value ?? false; SimplePhoneButton godModeCheatsBtn = PhoneUIUtility.CreateSimpleButton("God Mode: " + (flag ? "On" : "Off")); SimplePhoneButton obj = godModeCheatsBtn; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { if (BRCPlusPlugin.GodMode != null) { BRCPlusPlugin.GodMode.Value = !BRCPlusPlugin.GodMode.Value; ((TMP_Text)godModeCheatsBtn.Label).text = "God Mode: " + (BRCPlusPlugin.GodMode.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)godModeCheatsBtn); bool flag2 = BRCPlusPlugin.MaxScores?.Value ?? false; SimplePhoneButton maxScoresBtn = PhoneUIUtility.CreateSimpleButton("Max Scores: " + (flag2 ? "On" : "Off")); SimplePhoneButton obj2 = maxScoresBtn; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.MaxScores != null) { BRCPlusPlugin.MaxScores.Value = !BRCPlusPlugin.MaxScores.Value; ((TMP_Text)maxScoresBtn.Label).text = "Max Scores: " + (BRCPlusPlugin.MaxScores.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)maxScoresBtn); bool flag3 = BRCPlusPlugin.InstaKillMode?.Value ?? false; SimplePhoneButton instaKillBtn = PhoneUIUtility.CreateSimpleButton("Insta Kill Mode: " + (flag3 ? "On" : "Off")); SimplePhoneButton obj3 = instaKillBtn; ((PhoneButton)obj3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InstaKillMode != null) { BRCPlusPlugin.InstaKillMode.Value = !BRCPlusPlugin.InstaKillMode.Value; ((TMP_Text)instaKillBtn.Label).text = "Insta Kill Mode: " + (BRCPlusPlugin.InstaKillMode.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)instaKillBtn); bool flag4 = BRCPlusPlugin.MaxMultiplier?.Value ?? false; SimplePhoneButton maxMultiplierBtn = PhoneUIUtility.CreateSimpleButton("Max Multiplier: " + (flag4 ? "On" : "Off")); SimplePhoneButton obj4 = maxMultiplierBtn; ((PhoneButton)obj4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.MaxMultiplier != null) { BRCPlusPlugin.MaxMultiplier.Value = !BRCPlusPlugin.MaxMultiplier.Value; ((TMP_Text)maxMultiplierBtn.Label).text = "Max Multiplier: " + (BRCPlusPlugin.MaxMultiplier.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)maxMultiplierBtn); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Spray All Graffiti Spots"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(SprayAllGraffitiSpots)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Unlock All Characters"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(UnlockAllCharacters)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Unlock All Music"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(UnlockAllMusic)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Unlock All Graffiti"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(UnlockAllGraffiti)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Unlock All Dances"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(UnlockAllDances)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Unlock All Outfits"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(UnlockAllOutfits)); base.ScrollView.AddButton((PhoneButton)(object)val6); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("Unlock All Move Style Skins"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, new Action(UnlockAllMoveStyleSkins)); base.ScrollView.AddButton((PhoneButton)(object)val7); SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton("Get Collectibles"); ((PhoneButton)val8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val8).OnConfirm, new Action(GetAllCollectables)); base.ScrollView.AddButton((PhoneButton)(object)val8); SimplePhoneButton val9 = PhoneUIUtility.CreateSimpleButton("Unlock Robo Posts"); ((PhoneButton)val9).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val9).OnConfirm, new Action(UnlockRoboPosts)); base.ScrollView.AddButton((PhoneButton)(object)val9); SimplePhoneButton val10 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val10).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val10).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val10); } private static void UnlockAllCharacters() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Invalid comparison between Unknown and I4 //IL_004f: Unknown result type (might be due to invalid IL or missing references) Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { SaveManager saveManager = instance.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; if (val == null) { return; } foreach (Characters value in Enum.GetValues(typeof(Characters))) { if ((int)value != -1 && (int)value != 26) { val.UnlockCharacter(value); } } BRCPlusNotification.Instance?.ShowMessage("All characters unlocked!"); } private static void UnlockAllMusic() { WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { APlatform platform = instance2.Platform; obj = ((platform != null) ? platform.User : null); } AUser val2 = (AUser)obj; if (val2 == null) { return; } Phone value = Traverse.Create((object)val).Field("phone").GetValue(); if ((Object)(object)value == (Object)null) { return; } AppMusicPlayer appInstance = value.GetAppInstance(); if ((Object)(object)appInstance == (Object)null) { return; } AUnlockable[] unlockables = ((App)appInstance).Unlockables; if (unlockables == null) { return; } AUnlockable[] array = unlockables; foreach (AUnlockable val3 in array) { if (!((Object)(object)val3 == (Object)null)) { UnlockableSaveData unlockableSaveDataFor = val2.GetUnlockableSaveDataFor(val3); if (unlockableSaveDataFor != null) { unlockableSaveDataFor.IsUnlocked = true; } } } Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("All music unlocked!"); } private static void UnlockAllDances() { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { SaveManager saveManager = instance.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; if (val != null) { for (int i = 0; i < 6; i++) { val.UnlockDance(i); } Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("All dances unlocked!"); } } private static void UnlockAllOutfits() { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { APlatform platform = instance.Platform; obj = ((platform != null) ? platform.User : null); } AUser val = (AUser)obj; if (val == null) { return; } CharacterSelectUI val2 = Object.FindObjectOfType(true); if ((Object)(object)val2 == (Object)null) { return; } OutfitUnlockable[] value = Traverse.Create((object)val2).Field("outfitUnlockables").GetValue(); if (value == null) { return; } OutfitUnlockable[] array = value; foreach (OutfitUnlockable val3 in array) { if (!((Object)(object)val3 == (Object)null)) { val.GetUnlockableSaveDataFor((AUnlockable)(object)val3).IsUnlocked = true; } } Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("All outfits unlocked!"); } private static void UnlockAllMoveStyleSkins() { Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { APlatform platform = instance.Platform; obj = ((platform != null) ? platform.User : null); } AUser val = (AUser)obj; if (val == null) { return; } StyleSwitchMenu val2 = Object.FindObjectOfType(true); if ((Object)(object)val2 == (Object)null) { return; } Traverse val3 = Traverse.Create((object)val2); MoveStyleSkin[][] array = new MoveStyleSkin[3][] { val3.Field("skateboardUnlockables").GetValue(), val3.Field("bmxUnlockables").GetValue(), val3.Field("rollerSkatesUnlockables").GetValue() }; foreach (MoveStyleSkin[] array2 in array) { if (array2 == null) { continue; } MoveStyleSkin[] array3 = array2; foreach (MoveStyleSkin val4 in array3) { if (!((Object)(object)val4 == (Object)null)) { val.GetUnlockableSaveDataFor((AUnlockable)(object)val4).IsUnlocked = true; } } } Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("All move style skins unlocked!"); } private static void UnlockAllGraffiti() { WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { APlatform platform = instance2.Platform; obj = ((platform != null) ? platform.User : null); } AUser val2 = (AUser)obj; if (val2 == null) { return; } Phone value = Traverse.Create((object)val).Field("phone").GetValue(); if ((Object)(object)value == (Object)null) { return; } AppGraffiti appInstance = value.GetAppInstance(); if ((Object)(object)appInstance == (Object)null) { return; } AUnlockable[] unlockables = ((App)appInstance).Unlockables; if (unlockables == null) { return; } AUnlockable[] array = unlockables; foreach (AUnlockable val3 in array) { if (!((Object)(object)val3 == (Object)null)) { UnlockableSaveData unlockableSaveDataFor = val2.GetUnlockableSaveDataFor(val3); if (unlockableSaveDataFor != null) { unlockableSaveDataFor.IsUnlocked = true; } } } Core.Instance.SaveManager.SaveCurrentSaveSlot(); BRCPlusNotification.Instance?.ShowMessage("All graffiti unlocked!"); } private static void GetAllCollectables() { WorldHandler instance = WorldHandler.instance; if (((instance == null) ? null : instance.SceneObjectsRegister?.gameplayEvents) == null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return; } int num = 0; foreach (GameplayEvent gameplayEvent in instance.SceneObjectsRegister.gameplayEvents) { Collectable val = (Collectable)(object)((gameplayEvent is Collectable) ? gameplayEvent : null); if (!((Object)(object)val == (Object)null) && !Traverse.Create((object)val).Field("pickedUp").GetValue()) { val.PickupCollectable(currentPlayer); num++; } } BRCPlusNotification.Instance?.ShowMessage((num > 0) ? string.Format("Collected {0} collectable{1}!", num, (num == 1) ? "" : "s") : "No collectables found."); } private static void UnlockRoboPosts() { ComboMascotSystem[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { BRCPlusNotification.Instance?.ShowMessage("No robo posts found in this map."); return; } int num = 0; ComboMascotSystem[] array2 = array; foreach (ComboMascotSystem val in array2) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.door1 == (Object)null) && val.door1.isActive) { val.SetState((State)3); num++; } } BRCPlusNotification.Instance?.ShowMessage((num > 0) ? string.Format("Unlocked {0} robo post{1}!", num, (num == 1) ? "" : "s") : "All robo posts already unlocked."); } private static bool ShouldSkipSpot(GraffitiSpot spot) { if (((UnityEventBase)spot.OnFinish).GetPersistentEventCount() > 0) { return true; } GraffitiSpotFinisher val = (GraffitiSpotFinisher)(object)((spot is GraffitiSpotFinisher) ? spot : null); if (val == null) { return false; } Traverse val2 = Traverse.Create((object)val); if (val2.Field("enemyExtension").GetValue() != null) { return true; } if (val2.Field("enemyDamager").GetValue() != null) { return true; } if (val2.Field("encounter").GetValue() != null) { return true; } return false; } private static void SprayAllGraffitiSpots() { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_00ad: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Invalid comparison between Unknown and I4 //IL_00d7: 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_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Invalid comparison between Unknown and I4 //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Invalid comparison between Unknown and I4 WorldHandler instance = WorldHandler.instance; if (((instance == null) ? null : instance.SceneObjectsRegister?.grafSpots) == null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return; } Characters val = (Characters)(GraffitiPatch.Player_character?.GetValue(currentPlayer) ?? ((object)(Characters)12)); int num = 0; foreach (GraffitiSpot grafSpot in instance.SceneObjectsRegister.grafSpots) { if ((Object)(object)grafSpot == (Object)null) { continue; } if (ShouldSkipSpot(grafSpot)) { num++; } else { if ((int)Traverse.Create((object)grafSpot).Field("state").GetValue() == 2 && (int)grafSpot.topCrew == 1) { continue; } GraffitiArtInfo graffitiArtInfoPublic = GraffitiPatch.GetGraffitiArtInfoPublic(grafSpot); if ((Object)(object)graffitiArtInfoPublic == (Object)null) { continue; } GraffitiArt val2 = null; if ((int)grafSpot.size == 0) { val2 = graffitiArtInfoPublic.FindByCharacter(val); } else { List list = graffitiArtInfoPublic.FindBySize(grafSpot.size); if (list != null && list.Count > 0) { val2 = list[0]; } if (val2 == null) { val2 = graffitiArtInfoPublic.FindByCharacter(val); } } if (val2 != null) { bool flag = (int)grafSpot.bottomCrew == 1 || (int)grafSpot.bottomCrew == 7; GraffitiPatch.GraffitiSpot_Paint?.Invoke(grafSpot, new object[3] { (object)(Crew)1, val2, currentPlayer }); grafSpot.GiveRep(true, flag); grafSpot.SetLastPlayer(currentPlayer); grafSpot.SetState((GraffitiState)2); GraffitiPatch.GraffitiSpot_SpawnRep?.Invoke(grafSpot, null); } } } string text = "All graffiti spots in this map sprayed!"; if (num > 0) { text = text + "\n" + num + " story related spot" + ((num == 1) ? " was" : "s were") + " skipped."; } BRCPlusNotification.Instance?.ShowMessage(text); } private static List<(string label, Func getter)> GetCutsceneEntries() { return new List<(string, Func)> { ("Police 0 Stars", () => GetPoliceCutscene(0)), ("Police 1 Star", () => GetPoliceCutscene(1)), ("Police 2 Stars", () => GetPoliceCutscene(2)), ("Police 3 Stars", () => GetPoliceCutscene(3)), ("Police 4 Stars", () => GetPoliceCutscene(4)), ("Police 5 Stars", () => GetPoliceCutscene(5)), ("Police 6 Stars", () => GetPoliceCutscene(6)), ("Combo Mascot Open Door", delegate { ComboMascotSystem val2 = Object.FindObjectOfType(); return (!((Object)(object)val2 != (Object)null)) ? null : val2.openDoorSequence; }), ("Public Toilet", delegate { PublicToilet val = Object.FindObjectOfType(); return (!((Object)(object)val != (Object)null)) ? null : Traverse.Create((object)val).Field("sequence").GetValue(); }) }; } private static PlayableDirector GetPoliceCutscene(int stars) { PoliceCutscenes val = Object.FindObjectOfType(); if ((Object)(object)val == (Object)null) { return null; } string text = "cutsceneFor" + stars + "Stars"; return Traverse.Create((object)val).Field(text).GetValue(); } private void ShowCutScenesMenu() { base.ScrollView.RemoveAllButtons(); BRCPlusPlugin.NormalizeSkipCutsceneModeConfig(); string text = BRCPlusPlugin.SkipCutsceneMode?.Value ?? "Normal"; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Skip Cut Scene Mode: " + text); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SkipCutsceneMode != null) { string[] skipCutsceneModeOptions = BRCPlusPlugin.SkipCutsceneModeOptions; int num = Array.IndexOf(skipCutsceneModeOptions, BRCPlusPlugin.SkipCutsceneMode.Value); num = ((num >= 0) ? (num + 1) : 0) % skipCutsceneModeOptions.Length; BRCPlusPlugin.SkipCutsceneMode.Value = skipCutsceneModeOptions[num]; ShowCutScenesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); foreach (var cutsceneEntry in GetCutsceneEntries()) { string item = cutsceneEntry.label; Func getter = cutsceneEntry.getter; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton(item); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { PlayableDirector val4 = getter(); if (!((Object)(object)val4 == (Object)null) && !((Object)(object)SequenceHandler.instance == (Object)null)) { SequenceHandler.instance.StartEnteringSequence(val4, (GameplayEvent)null, true, true, true, true, true, (ProgressObject)null, true, false, (Battle)null, false); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); } SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val3); } private void ShowSaveFilesMenu() { base.ScrollView.RemoveAllButtons(); Core instance = Core.Instance; SaveManager saveManager = ((instance != null) ? instance.SaveManager : null); BaseModule baseModule = ((instance != null) ? instance.BaseModule : null); if (saveManager == null || (Object)(object)baseModule == (Object)null) { SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Save data unavailable"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val2); return; } for (int i = 0; i < 3; i++) { SaveSlotData saveSlotData = saveManager.GetSaveSlotData(i); int slot = i; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton(GetSaveSlotButtonLabel(i + 1, saveSlotData, instance.Localizer)); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { LoadIntoSaveSlot(slot, saveManager, baseModule); }); base.ScrollView.AddButton((PhoneButton)(object)val3); } SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val4); } private static string GetSaveSlotButtonLabel(int displayNumber, SaveSlotData data, IGameTextLocalizer localizer) { //IL_0015: 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_0020: Expected I4, but got Unknown //IL_0028: 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_003c: Unknown result type (might be due to invalid IL or missing references) if (data == null) { return $"Save {displayNumber} (Empty)"; } int num = (int)Story.GetObjectiveInfo(data).chapter; object obj = ((localizer != null) ? localizer.GetStageName(data.CurrentStage) : null); if (obj == null) { Stage currentStage = data.CurrentStage; obj = ((object)(Stage)(ref currentStage)).ToString(); } string arg = (string)obj; return $"Save {displayNumber} - Chapter {num} ({arg})"; } private void LoadIntoSaveSlot(int slotId, SaveManager saveManager, BaseModule baseModule) { //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_0038: 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) if (baseModule.IsLoading || !saveManager.IsSaveSlotOccupied(slotId)) { return; } SaveSlotData currentSaveSlot = saveManager.CurrentSaveSlot; if (currentSaveSlot != null && currentSaveSlot.saveSlotId == slotId) { Stage currentStage = saveManager.CurrentSaveSlot.CurrentStage; if (baseModule.CurrentStage == currentStage) { return; } } ((MonoBehaviour)baseModule).StartCoroutine(LoadIntoSaveSlotAtEndOfFrame(slotId, saveManager, baseModule)); } private static IEnumerator LoadIntoSaveSlotAtEndOfFrame(int slotId, SaveManager saveManager, BaseModule baseModule) { yield return (object)new WaitForEndOfFrame(); if (!baseModule.IsLoading && saveManager.IsSaveSlotOccupied(slotId)) { saveManager.SaveBeforeStageExit(); saveManager.SetCurrentSaveSlot(slotId); SaveSlotData currentSaveSlot = saveManager.CurrentSaveSlot; Stage val = (Stage)((currentSaveSlot == null) ? 5 : ((int)currentSaveSlot.CurrentStage)); if (baseModule.IsInGamePaused) { baseModule.UnPauseGame((PauseType)65535); } baseModule.SwitchStage(val); } } private void ShowFunMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Become A Prop"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowPropsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Spawn Something"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowSpawnSomethingMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); BRCPlusPlugin.NormalizeGravityConfig(); string text = BRCPlusPlugin.Gravity?.Value ?? "Normal"; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Gravity: " + text); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.Gravity != null) { string[] gravityOptions = BRCPlusPlugin.GravityOptions; int num = Array.IndexOf(gravityOptions, BRCPlusPlugin.Gravity.Value); num = ((num >= 0) ? (num + 1) : 0) % gravityOptions.Length; BRCPlusPlugin.Gravity.Value = gravityOptions[num]; ShowFunMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Size Options"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(ShowSizeOptionsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Invisible Options"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(ShowInvisibleOptionsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val6); } private void ShowSizeOptionsMenu() { base.ScrollView.RemoveAllButtons(); BRCPlusPlugin.NormalizePlayerSizeConfig(); string text = BRCPlusPlugin.PlayerSize?.Value ?? "Normal"; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Player Size: " + text); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.PlayerSize != null) { string[] playerSizeOptions4 = BRCPlusPlugin.PlayerSizeOptions; int num4 = Array.IndexOf(playerSizeOptions4, BRCPlusPlugin.PlayerSize.Value); num4 = ((num4 >= 0) ? (num4 + 1) : 0) % playerSizeOptions4.Length; BRCPlusPlugin.PlayerSize.Value = playerSizeOptions4[num4]; WorldHandler instance3 = WorldHandler.instance; BRCPlusPlugin.ApplyPlayerSizeTo((instance3 != null) ? instance3.GetCurrentPlayer() : null); ShowSizeOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); string text2 = BRCPlusPlugin.PhoneSize?.Value ?? "Normal"; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Phone Size: " + text2); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.PhoneSize != null) { string[] playerSizeOptions3 = BRCPlusPlugin.PlayerSizeOptions; int num3 = Array.IndexOf(playerSizeOptions3, BRCPlusPlugin.PhoneSize.Value); num3 = ((num3 >= 0) ? (num3 + 1) : 0) % playerSizeOptions3.Length; BRCPlusPlugin.PhoneSize.Value = playerSizeOptions3[num3]; WorldHandler instance2 = WorldHandler.instance; BRCPlusPlugin.ApplyPhoneSizeTo((instance2 != null) ? instance2.GetCurrentPlayer() : null); ShowSizeOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); string text3 = BRCPlusPlugin.SpraycanSize?.Value ?? "Normal"; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Spraycan Size: " + text3); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SpraycanSize != null) { string[] playerSizeOptions2 = BRCPlusPlugin.PlayerSizeOptions; int num2 = Array.IndexOf(playerSizeOptions2, BRCPlusPlugin.SpraycanSize.Value); num2 = ((num2 >= 0) ? (num2 + 1) : 0) % playerSizeOptions2.Length; BRCPlusPlugin.SpraycanSize.Value = playerSizeOptions2[num2]; WorldHandler instance = WorldHandler.instance; BRCPlusPlugin.ApplySpraycanSizeTo((instance != null) ? instance.GetCurrentPlayer() : null); ShowSizeOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); string text4 = BRCPlusPlugin.OtherCharactersSize?.Value ?? "Normal"; SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Other Characters Size: " + text4); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.OtherCharactersSize != null) { string[] playerSizeOptions = BRCPlusPlugin.PlayerSizeOptions; int num = Array.IndexOf(playerSizeOptions, BRCPlusPlugin.OtherCharactersSize.Value); num = ((num >= 0) ? (num + 1) : 0) % playerSizeOptions.Length; BRCPlusPlugin.OtherCharactersSize.Value = playerSizeOptions[num]; BRCPlusPlugin.ApplyOtherCharactersSizeTo(); ShowSizeOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(ShowFunMenu)); base.ScrollView.AddButton((PhoneButton)(object)val5); } private void ShowInvisibleOptionsMenu() { base.ScrollView.RemoveAllButtons(); bool flag = BRCPlusPlugin.InvisiblePlayer?.Value ?? false; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Invisible Player: " + (flag ? "On" : "Off")); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InvisiblePlayer != null) { BRCPlusPlugin.InvisiblePlayer.Value = !BRCPlusPlugin.InvisiblePlayer.Value; WorldHandler instance4 = WorldHandler.instance; BRCPlusPlugin.ApplyInvisibleTo((instance4 != null) ? instance4.GetCurrentPlayer() : null); ShowInvisibleOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); bool flag2 = BRCPlusPlugin.InvisibleStyle?.Value ?? false; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Invisible Style: " + (flag2 ? "On" : "Off")); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InvisibleStyle != null) { BRCPlusPlugin.InvisibleStyle.Value = !BRCPlusPlugin.InvisibleStyle.Value; WorldHandler instance3 = WorldHandler.instance; BRCPlusPlugin.ApplyInvisibleStyleTo((instance3 != null) ? instance3.GetCurrentPlayer() : null); ShowInvisibleOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); bool flag3 = BRCPlusPlugin.InvisiblePhone?.Value ?? false; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Invisible Phone: " + (flag3 ? "On" : "Off")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InvisiblePhone != null) { BRCPlusPlugin.InvisiblePhone.Value = !BRCPlusPlugin.InvisiblePhone.Value; WorldHandler instance2 = WorldHandler.instance; BRCPlusPlugin.ApplyInvisiblePhoneTo((instance2 != null) ? instance2.GetCurrentPlayer() : null); ShowInvisibleOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); bool flag4 = BRCPlusPlugin.InvisibleSpraycan?.Value ?? false; SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Invisible Spraycan: " + (flag4 ? "On" : "Off")); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InvisibleSpraycan != null) { BRCPlusPlugin.InvisibleSpraycan.Value = !BRCPlusPlugin.InvisibleSpraycan.Value; WorldHandler instance = WorldHandler.instance; BRCPlusPlugin.ApplyInvisibleSpraycanTo((instance != null) ? instance.GetCurrentPlayer() : null); ShowInvisibleOptionsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(ShowFunMenu)); base.ScrollView.AddButton((PhoneButton)(object)val5); } private void ShowSpawnSomethingMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Remove Recent Object"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { RemoveMostRecentSpawnedObject(); ShowSpawnSomethingMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Remove Spawned Objects"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { RemoveAllSpawnedObjects(); ShowSpawnSomethingMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Spawn Props"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(ShowSpawnPropsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Spawn Character"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(ShowSpawnNPCMenu)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Spawn Wallrun"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(SpawnWallrunInFrontOfPlayer)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Spawn WallRun Cube"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(SpawnWallrunCubeInFrontOfPlayer)); base.ScrollView.AddButton((PhoneButton)(object)val6); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("Spawn Block"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, new Action(SpawnBlockInFrontOfPlayer)); base.ScrollView.AddButton((PhoneButton)(object)val7); SimplePhoneButton val8 = PhoneUIUtility.CreateSimpleButton("Spawn Sideways Wallrun"); ((PhoneButton)val8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val8).OnConfirm, (Action)delegate { SpawnSlopedWallrunInFrontOfPlayer(upward: true); }); base.ScrollView.AddButton((PhoneButton)(object)val8); SimplePhoneButton val9 = PhoneUIUtility.CreateSimpleButton("Spawn Vending Machine"); ((PhoneButton)val9).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val9).OnConfirm, (Action)delegate { //IL_0033: 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_003d: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0096: 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_00a4: 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_0065: 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) WorldHandler instance2 = WorldHandler.instance; Player val17 = ((instance2 != null) ? instance2.GetCurrentPlayer() : null); if (!((Object)(object)val17 == (Object)null)) { VendingMachine val18 = Object.FindObjectOfType(true); if (!((Object)(object)val18 == (Object)null)) { Vector3 val19 = Vector3.ProjectOnPlane(val17.tf.forward, Vector3.up); Vector3 val20 = ((Vector3)(ref val19)).normalized; if (((Vector3)(ref val20)).sqrMagnitude < 0.01f) { val20 = val17.tf.forward; } Vector3 position2 = val17.tf.position + val20 * 3f; GameObject val21 = Object.Instantiate(((Component)val18).gameObject); val21.transform.position = position2; val21.transform.rotation = Quaternion.LookRotation(val20); BreakableObject[] componentsInChildren = val21.GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.Destroy((Object)(object)componentsInChildren[i]); } BoxCollider component = val21.GetComponent(); if ((Object)(object)component != (Object)null && ((Collider)component).isTrigger) { BoxCollider obj = val21.AddComponent(); obj.center = component.center; obj.size = component.size; ((Collider)obj).isTrigger = false; } SetLayerRecursively(val21, 0); val21.SetActive(true); _spawnedObjects.Add(val21); } } }); base.ScrollView.AddButton((PhoneButton)(object)val9); SimplePhoneButton val10 = PhoneUIUtility.CreateSimpleButton("Spawn Car"); ((PhoneButton)val10).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val10).OnConfirm, (Action)delegate { //IL_0033: 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_003d: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_0096: 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_00a4: 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_0065: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; Player val12 = ((instance != null) ? instance.GetCurrentPlayer() : null); if (!((Object)(object)val12 == (Object)null)) { Car val13 = Object.FindObjectOfType(true); if (!((Object)(object)val13 == (Object)null)) { Vector3 val14 = Vector3.ProjectOnPlane(val12.tf.forward, Vector3.up); Vector3 val15 = ((Vector3)(ref val14)).normalized; if (((Vector3)(ref val15)).sqrMagnitude < 0.01f) { val15 = val12.tf.forward; } Vector3 position = val12.tf.position + val15 * 3f; GameObject val16 = Object.Instantiate(((Component)val13).gameObject); val16.transform.position = position; val16.transform.rotation = Quaternion.LookRotation(val15); SetLayerRecursively(val16, 0); val16.SetActive(true); _spawnedObjects.Add(val16); } } }); base.ScrollView.AddButton((PhoneButton)(object)val10); SimplePhoneButton val11 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val11).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val11).OnConfirm, new Action(ShowFunMenu)); base.ScrollView.AddButton((PhoneButton)(object)val11); } private void ShowSpawnNPCMenu() { //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) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); Characters[] spawnableCharacters = _spawnableCharacters; foreach (Characters val in spawnableCharacters) { Characters c = val; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton(GetCharacterDisplayName(c)); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { //IL_0024: 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_0054: 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) //IL_005e: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_0093: 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_009d: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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) WorldHandler instance = WorldHandler.instance; Player val4 = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val4 == (Object)null) { return; } try { CharacterVisual val5 = val4.CharacterConstructor.CreateNewCharacterVisual(c, val4.animatorController, false, 0f); if (!((Object)(object)val5 == (Object)null)) { Vector3 val6 = Vector3.ProjectOnPlane(val4.tf.forward, Vector3.up); Vector3 val7 = ((Vector3)(ref val6)).normalized; if (((Vector3)(ref val7)).sqrMagnitude < 0.01f) { val7 = val4.tf.forward; } Vector3 position = val4.tf.position + val7 * 3f; ((Component)val5).gameObject.SetActive(true); ((Component)val5).transform.position = position; ((Component)val5).transform.rotation = Quaternion.LookRotation(val7); _spawnedObjects.Add(((Component)val5).gameObject); } } catch { } }); base.ScrollView.AddButton((PhoneButton)(object)val2); } SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(ShowSpawnSomethingMenu)); base.ScrollView.AddButton((PhoneButton)(object)val3); } private void ShowSpawnPropsMenu() { base.ScrollView.RemoveAllButtons(); foreach (var item3 in PropDisguiseManager.GetPropsForMenu()) { int item = item3.id; string item2 = item3.label; int propId = item; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(item2); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { //IL_0038: 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_0042: 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_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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: 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_0086: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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) WorldHandler instance = WorldHandler.instance; Player val3 = ((instance != null) ? instance.GetCurrentPlayer() : null); if (!((Object)(object)val3 == (Object)null)) { GameObject propSourceById = PropDisguiseManager.GetPropSourceById(propId); if (!((Object)(object)propSourceById == (Object)null)) { Vector3 val4 = Vector3.ProjectOnPlane(val3.tf.forward, Vector3.up); Vector3 val5 = ((Vector3)(ref val4)).normalized; if (((Vector3)(ref val5)).sqrMagnitude < 0.01f) { val5 = val3.tf.forward; } Vector3 position = val3.tf.position + val5 * 3f; GameObject val6 = Object.Instantiate(propSourceById); val6.SetActive(true); val6.transform.position = position; val6.transform.rotation = propSourceById.transform.rotation; _spawnedObjects.Add(val6); } } }); base.ScrollView.AddButton((PhoneButton)(object)val); } SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowSpawnSomethingMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void ShowPropsMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Turn Into Nearest Prop"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { WorldHandler instance2 = WorldHandler.instance; Player val6 = ((instance2 != null) ? instance2.GetCurrentPlayer() : null); if (!((Object)(object)val6 == (Object)null)) { int? nearestPropId = PropDisguiseManager.GetNearestPropId(val6); if (nearestPropId.HasValue) { PropDisguiseManager.ApplyDisguise(val6, nearestPropId.Value); } } }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Remove Prop"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { WorldHandler instance = WorldHandler.instance; Player val5 = ((instance != null) ? instance.GetCurrentPlayer() : null); if (!((Object)(object)val5 == (Object)null) && PropDisguiseManager.HasDisguise(val5)) { PropDisguiseManager.RemoveDisguise(val5); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Props in this map"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(ShowPropsInThisMapMenu)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(ShowFunMenu)); base.ScrollView.AddButton((PhoneButton)(object)val4); } private void ShowPropsInThisMapMenu() { base.ScrollView.RemoveAllButtons(); foreach (var item3 in PropDisguiseManager.GetPropsForMenu()) { int item = item3.id; string item2 = item3.label; int propId = item; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(item2); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { WorldHandler instance = WorldHandler.instance; Player val3 = ((instance != null) ? instance.GetCurrentPlayer() : null); if (!((Object)(object)val3 == (Object)null)) { PropDisguiseManager.ApplyDisguise(val3, propId); } }); base.ScrollView.AddButton((PhoneButton)(object)val); } SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowPropsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void ShowMapsMenu() { //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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); (string, Stage)[] travelableMaps = TravelableMaps; for (int i = 0; i < travelableMaps.Length; i++) { (string, Stage) tuple = travelableMaps[i]; string item = tuple.Item1; Stage item2 = tuple.Item2; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(item); Stage stageToLoad = item2; ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) TravelToStage(stageToLoad); }); base.ScrollView.AddButton((PhoneButton)(object)val); } SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void TravelToStage(Stage stage) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) Core instance = Core.Instance; if ((Object)(object)((instance != null) ? instance.BaseModule : null) == (Object)null) { return; } BaseModule baseModule = instance.BaseModule; if (baseModule.IsLoading) { return; } StageManager stageManager = baseModule.StageManager; if (stageManager != null) { if (baseModule.IsInGamePaused) { baseModule.UnPauseGame((PauseType)65535); } stageManager.ExitCurrentStage(stage, (Stage)(-1)); } } private void ShowGraffitiMenu() { base.ScrollView.RemoveAllButtons(); BRCPlusPlugin.NormalizeSprayModeConfig(); string text = BRCPlusPlugin.SprayMode?.Value ?? "Normal"; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Spray Mode: " + text); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SprayMode != null) { string[] sprayModeOptions = BRCPlusPlugin.SprayModeOptions; int num = Array.IndexOf(sprayModeOptions, BRCPlusPlugin.SprayMode.Value); num = ((num >= 0) ? (num + 1) : 0) % sprayModeOptions.Length; BRCPlusPlugin.SprayMode.Value = sprayModeOptions[num]; ShowGraffitiMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); bool flag = BRCPlusPlugin.GetBoostsFromGraffiti?.Value ?? true; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Get Boosts From Graffiti: " + (flag ? "On" : "Off")); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.GetBoostsFromGraffiti != null) { BRCPlusPlugin.GetBoostsFromGraffiti.Value = !BRCPlusPlugin.GetBoostsFromGraffiti.Value; ShowGraffitiMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); bool flag2 = BRCPlusPlugin.ShowGraffiti?.Value ?? true; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Show Graffiti: " + (flag2 ? "True" : "False")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.ShowGraffiti != null) { BRCPlusPlugin.ShowGraffiti.Value = !BRCPlusPlugin.ShowGraffiti.Value; ShowGraffitiMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val4); } private void ShowHeatMenu() { base.ScrollView.RemoveAllButtons(); bool flag = BRCPlusPlugin.DisableHeat?.Value ?? false; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Disable Heat: " + (flag ? "On" : "Off")); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.DisableHeat != null) { BRCPlusPlugin.DisableHeat.Value = !BRCPlusPlugin.DisableHeat.Value; ShowHeatMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Add Heat"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(AddHeat)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Remove Heat"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(RemoveHeat)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val4); } private void ShowEnemyMenu() { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00dc: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Remove All Enemies"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(RemoveAllSpawnedEnemies)); base.ScrollView.AddButton((PhoneButton)(object)val); (EnemyType, string)[] array = new(EnemyType, string)[6] { ((EnemyType)0, "Basic Cop"), ((EnemyType)1, "Shield Cop"), ((EnemyType)2, "Sniper Cop"), ((EnemyType)3, "Turret"), ((EnemyType)4, "Copter"), ((EnemyType)5, "Tank Walker") }; for (int i = 0; i < array.Length; i++) { (EnemyType, string) tuple = array[i]; EnemyType item = tuple.Item1; string item2 = tuple.Item2; EnemyType type = item; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Spawn " + item2); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) TrySpawnEnemyInFrontOfPlayer(type); }); base.ScrollView.AddButton((PhoneButton)(object)val2); } SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val3); } private void ShowLocationsMenu() { //IL_015a: 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_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val); return; } List stageChunks = instance.SceneObjectsRegister.stageChunks; if (stageChunks == null || stageChunks.Count == 0) { SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("No chunks in this stage"); base.ScrollView.AddButton((PhoneButton)(object)val2); } else { for (int i = 0; i < stageChunks.Count; i++) { StageChunk chunk = stageChunks[i]; if (!((Object)(object)chunk == (Object)null)) { SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton(string.IsNullOrEmpty(((Object)chunk).name) ? ("Chunk " + (i + 1)) : ((Object)chunk).name); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { TeleportToChunk(chunk); }); base.ScrollView.AddButton((PhoneButton)(object)val3); } } } Core instance2 = Core.Instance; if (instance2 != null) { BaseModule baseModule = instance2.BaseModule; if (((baseModule != null) ? new Stage?(baseModule.CurrentStage) : null) == (Stage?)8) { SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Cut Scene"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { //IL_0030: 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) WorldHandler instance3 = WorldHandler.instance; Player val6 = ((instance3 != null) ? instance3.GetCurrentPlayer() : null); if (!((Object)(object)val6 == (Object)null)) { WorldHandler.instance.PlaceCurrentPlayerAt(new Vector3(4197.5f, 19.6f, -192f), ((Component)val6).transform.rotation, true); } }); base.ScrollView.AddButton((PhoneButton)(object)val4); } } SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val5); } private static void TeleportToChunk(StageChunk chunk) { //IL_006b: 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_0077: 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_0086: 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_008f: 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_00a5: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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) //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) if ((Object)(object)chunk == (Object)null) { return; } WorldHandler instance = WorldHandler.instance; if (!((Object)(object)instance == (Object)null) && !((Object)(object)instance.GetCurrentPlayer() == (Object)null)) { BoxCollider[] value = Traverse.Create((object)chunk).Field("colliders").GetValue(); Vector3 val; if (value != null && value.Length != 0 && (Object)(object)value[0] != (Object)null) { Bounds bounds = ((Collider)value[0]).bounds; val = ((Bounds)(ref bounds)).center; } else { val = ((Component)chunk).transform.position; } Vector3 val2 = Vector3.ProjectOnPlane(((Component)chunk).transform.forward, Vector3.up); Vector3 val3 = ((Vector3)(ref val2)).normalized; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Vector3.forward; } Quaternion val4 = Quaternion.LookRotation(val3); instance.PlaceCurrentPlayerAt(val, val4, true); } } private static bool TrySpawnEnemyInFrontOfPlayer(EnemyType targetType) { //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_0033: 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_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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006d: 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_0077: 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_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) //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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Invalid comparison between I4 and Unknown //IL_019d: 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_01cf: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return false; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return false; } Vector3 val = Vector3.ProjectOnPlane(currentPlayer.tf.forward, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = currentPlayer.tf.forward; } Vector3 val3 = currentPlayer.tf.position + val2 * 3f + Vector3.up * 0.5f; Quaternion val4 = Quaternion.LookRotation(currentPlayer.tf.position - val3); BasicEnemySpawner[] array = Object.FindObjectsOfType(); foreach (BasicEnemySpawner val5 in array) { EnemyType[] spawnableEnemyTypes = val5.SpawnableEnemyTypes; if (spawnableEnemyTypes == null) { continue; } for (int j = 0; j < spawnableEnemyTypes.Length; j++) { if ((int)spawnableEnemyTypes[j] != (int)targetType) { continue; } Traverse obj = Traverse.Create((object)val5); GameObject[] value = obj.Field("spawnableEnemies").GetValue(); PoolableInstantiator value2 = obj.Field("poolableInstantiator").GetValue(); List value3 = obj.Field("enemies").GetValue>(); if (value == null || j >= value.Length || (Object)(object)value2 == (Object)null || value3 == null) { continue; } GameObject val6 = value[j]; PoolableObjectToName val7 = null; for (int k = 0; k < value3.Count; k++) { if (value3[k].name == ((Object)val6).name) { val7 = value3[k]; break; } } if (val7 == null) { continue; } IPoolable poolableFromPoolOrInstantiate = value2.GetPoolableFromPoolOrInstantiate(val7); if (poolableFromPoolOrInstantiate == null) { continue; } poolableFromPoolOrInstantiate.InitPoolable(val3, val4); BasicEnemy val8 = (BasicEnemy)(object)((poolableFromPoolOrInstantiate is BasicEnemy) ? poolableFromPoolOrInstantiate : null); if ((Object)(object)val8 != (Object)null) { val8.InitFromSpawn((Battle)null); CopterCop val9 = (CopterCop)(object)((val8 is CopterCop) ? val8 : null); if (val9 != null) { val9.SetSpawnDestination(val3); } SpawnedEnemies.Add((val8, false)); } return true; } } return false; } private static void RemoveAllSpawnedEnemies() { foreach (var (val, flag) in SpawnedEnemies) { if (!((Object)(object)val == (Object)null)) { val.StandDown(false); if (flag) { Object.Destroy((Object)(object)((Component)val).gameObject); } } } SpawnedEnemies.Clear(); } private void ShowCharactersMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Base Characters"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowBaseCharactersMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Swap Outfit"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(SwapOutfit)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Swap Style"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(SwapStyle)); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Random Character"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(RandomCharacter)); base.ScrollView.AddButton((PhoneButton)(object)val4); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Random Outfit"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(RandomOutfit)); base.ScrollView.AddButton((PhoneButton)(object)val5); SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Full Random"); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, new Action(FullRandom)); base.ScrollView.AddButton((PhoneButton)(object)val6); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val7); } private static void SwapStyle() { //IL_004c: 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_0053: 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_0066: 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_007d: 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_006f: Invalid comparison between Unknown and I4 //IL_007f: 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_0086: 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_009e: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Invalid comparison between Unknown and I4 WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null || GetPlayerIsAI(currentPlayer)) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { SaveManager saveManager = instance2.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; if (val == null) { return; } Characters playerCharacter = GetPlayerCharacter(currentPlayer); CharacterProgress characterProgress = val.GetCharacterProgress(playerCharacter); if (characterProgress != null) { MoveStyle val2 = GetPlayerMoveStyleEquipped(currentPlayer); if ((int)val2 == 0 || (int)val2 == 4 || (int)val2 == 5) { val2 = characterProgress.moveStyle; } MoveStyle nextMoveStyleInCycle = GetNextMoveStyleInCycle(val2); currentPlayer.SetCurrentMoveStyleEquipped(nextMoveStyleInCycle, true, true); currentPlayer.SwitchToEquippedMovestyle(true, false, true, true); characterProgress.moveStyle = nextMoveStyleInCycle; Core.Instance.SaveManager.SaveCurrentSaveSlot(); } } private static MoveStyle GetNextMoveStyleInCycle(MoveStyle current) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Expected I4, but got Unknown return (MoveStyle)((current - 1) switch { 1 => 3, 2 => 1, 0 => 2, _ => 2, }); } private static MoveStyle GetPlayerMoveStyleEquipped(Player player) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return Traverse.Create((object)player).Field("moveStyleEquipped").GetValue(); } private static List GetAvailableCharacters() { //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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Invalid comparison between Unknown and I4 //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Invalid comparison between Unknown and I4 //IL_0032: 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_007e: 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_008b: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (Characters value in Enum.GetValues(typeof(Characters))) { if ((int)value != -1 && (int)value != 26 && IsBaseCharacterAvailable(value)) { list.Add(value); } } Dictionary dictionary = TryGetCustomCharactersListFromCharacterSwapApp(); if (dictionary != null) { foreach (int key in dictionary.Keys) { Characters item = (Characters)key; if (!list.Contains(item)) { list.Add(item); } } } return list; } private static Dictionary TryGetCustomCharactersListFromCharacterSwapApp() { try { if (Chainloader.PluginInfos == null) { return null; } bool flag = false; foreach (KeyValuePair pluginInfo in Chainloader.PluginInfos) { PluginInfo value = pluginInfo.Value; object obj; if (value == null) { obj = null; } else { BepInPlugin metadata = value.Metadata; obj = ((metadata != null) ? metadata.GUID : null); } if (obj == null) { obj = ""; } if (((string)obj).IndexOf("CharacterSwapApp", StringComparison.OrdinalIgnoreCase) >= 0) { flag = true; break; } } if (!flag) { return null; } Type type = null; Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (int i = 0; i < assemblies.Length; i++) { type = assemblies[i].GetType("CharacterSwapApp.AppCharacterSwapList"); if (type != null) { break; } } if (type == null) { return null; } MethodInfo method = type.GetMethod("ListOfCustomCharacters", BindingFlags.Static | BindingFlags.Public); if (method == null) { return null; } if (method.Invoke(null, null) is Dictionary dictionary && dictionary.Count > 0) { return dictionary; } return null; } catch { return null; } } private static void RandomCharacter() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) List availableCharacters = GetAvailableCharacters(); if (availableCharacters == null || availableCharacters.Count == 0) { return; } WorldHandler instance = WorldHandler.instance; if (!((Object)(object)instance == (Object)null)) { Player currentPlayer = instance.GetCurrentPlayer(); if (!((Object)(object)currentPlayer == (Object)null) && !GetPlayerIsAI(currentPlayer)) { SwapToCharacter(availableCharacters[Random.Range(0, availableCharacters.Count)]); } } } private static void RandomOutfit() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_0053: 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) WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null || GetPlayerIsAI(currentPlayer)) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { SaveManager saveManager = instance2.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; if (val == null) { return; } Characters playerCharacter = GetPlayerCharacter(currentPlayer); CharacterProgress characterProgress = val.GetCharacterProgress(playerCharacter); if (characterProgress == null) { return; } int num = Random.Range(0, 4); try { currentPlayer.SetOutfit(num); instance.SetNPCOutfit(playerCharacter, num); characterProgress.outfit = num; Core.Instance.SaveManager.SaveCurrentSaveSlot(); } catch (NoOutfitException) { try { currentPlayer.SetOutfit(0); instance.SetNPCOutfit(playerCharacter, 0); characterProgress.outfit = 0; Core.Instance.SaveManager.SaveCurrentSaveSlot(); } catch (NoOutfitException) { } } } private static void FullRandom() { RandomCharacter(); RandomOutfit(); } private static void SwapOutfit() { //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0044: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { SaveManager saveManager = instance2.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; if (val == null) { return; } Characters playerCharacter = GetPlayerCharacter(currentPlayer); CharacterProgress characterProgress = val.GetCharacterProgress(playerCharacter); if (characterProgress == null) { return; } int num = (characterProgress.outfit + 1) % 4; try { currentPlayer.SetOutfit(num); instance.SetNPCOutfit(playerCharacter, num); Core.Instance.SaveManager.SaveCurrentSaveSlot(); } catch (NoOutfitException) { try { currentPlayer.SetOutfit(0); instance.SetNPCOutfit(playerCharacter, 0); characterProgress.outfit = 0; Core.Instance.SaveManager.SaveCurrentSaveSlot(); } catch (NoOutfitException) { } } } private static Characters GetPlayerCharacter(Player player) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) return Traverse.Create((object)player).Field("character").GetValue(); } private static bool GetPlayerIsAI(Player player) { return Traverse.Create((object)player).Field("isAI").GetValue(); } private static CharacterVisual GetPlayerCharacterVisual(Player player) { return Traverse.Create((object)player).Field("characterVisual").GetValue(); } private static bool IsBaseCharacterAvailable(Characters c) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)c != 17 && (int)c != 18) { return true; } Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { APlatform platform = instance.Platform; obj = ((platform != null) ? platform.DownloadableContent : null); } if (obj == null || (Object)(object)instance.BaseModule == (Object)null) { return false; } object value = Traverse.Create((object)instance.BaseModule).Field("characterDownloadableContent").GetValue(); if (value == null) { return false; } return instance.Platform.DownloadableContent.IsDownloadableContentUnlocked((DownloadableContentItem)((value is DownloadableContentItem) ? value : null)); } private void ShowBaseCharactersMenu() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: 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) //IL_0036: Invalid comparison between Unknown and I4 //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Invalid comparison between Unknown and I4 //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0046: 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_004d: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); foreach (Characters value in Enum.GetValues(typeof(Characters))) { if ((int)value != -1 && (int)value != 26 && IsBaseCharacterAvailable(value)) { Characters character = value; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton(GetCharacterDisplayName(character)); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { //IL_0001: Unknown result type (might be due to invalid IL or missing references) SwapToCharacter(character); }); base.ScrollView.AddButton((PhoneButton)(object)val2); } } SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(ShowCharactersMenu)); base.ScrollView.AddButton((PhoneButton)(object)val3); } private static string GetCharacterDisplayName(Characters c) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { IGameTextLocalizer localizer = instance.Localizer; obj = ((localizer != null) ? localizer.GetCharacterName(c) : null); } string text = (string)obj; if (!string.IsNullOrEmpty(text)) { return text; } string text2 = ((object)(Characters)(ref c)).ToString(); if (string.IsNullOrEmpty(text2)) { return text2; } string text3 = char.ToUpperInvariant(text2[0]).ToString(); for (int i = 1; i < text2.Length; i++) { text3 = ((!char.IsUpper(text2[i])) ? (text3 + text2[i]) : (text3 + " " + text2[i])); } return text3; } private static void SwapToCharacter(Characters character) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0074: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return; } Core instance2 = Core.Instance; object obj; if (instance2 == null) { obj = null; } else { SaveManager saveManager = instance2.SaveManager; obj = ((saveManager != null) ? saveManager.CurrentSaveSlot : null); } SaveSlotData val = (SaveSlotData)obj; int num = 0; MoveStyle val2 = (MoveStyle)2; if (val != null) { CharacterProgress characterProgress = val.GetCharacterProgress(character); if (characterProgress != null) { num = characterProgress.outfit; val2 = characterProgress.moveStyle; } } currentPlayer.SetCharacter(character, num); currentPlayer.InitVisual(); currentPlayer.SetCurrentMoveStyleEquipped(val2, true, true); } private void ShowMovementMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Goons"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowGoonsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); bool flag = BRCPlusPlugin.InfiniteBoost?.Value ?? false; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Infinite Boost: " + (flag ? "On" : "Off")); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InfiniteBoost != null) { BRCPlusPlugin.InfiniteBoost.Value = !BRCPlusPlugin.InfiniteBoost.Value; ShowMovementMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); bool flag2 = BRCPlusPlugin.CanAlwaysBoost?.Value ?? false; SimplePhoneButton canAlwaysBoostBtn = PhoneUIUtility.CreateSimpleButton("Can Always Boost: " + (flag2 ? "On" : "Off")); SimplePhoneButton obj = canAlwaysBoostBtn; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { if (BRCPlusPlugin.CanAlwaysBoost != null) { BRCPlusPlugin.CanAlwaysBoost.Value = !BRCPlusPlugin.CanAlwaysBoost.Value; ((TMP_Text)canAlwaysBoostBtn.Label).text = "Can Always Boost: " + (BRCPlusPlugin.CanAlwaysBoost.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)canAlwaysBoostBtn); bool flag3 = BRCPlusPlugin.InfiniteAirDash?.Value ?? false; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Infinite Air Dash: " + (flag3 ? "On" : "Off")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.InfiniteAirDash != null) { BRCPlusPlugin.InfiniteAirDash.Value = !BRCPlusPlugin.InfiniteAirDash.Value; ShowMovementMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); bool flag4 = BRCPlusPlugin.AlwaysInSpeedZone?.Value ?? false; SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Always In Speed Zone: " + (flag4 ? "On" : "Off")); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.AlwaysInSpeedZone != null) { BRCPlusPlugin.AlwaysInSpeedZone.Value = !BRCPlusPlugin.AlwaysInSpeedZone.Value; ShowMovementMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val4); bool flag5 = BRCPlusPlugin.Grinds?.Value ?? true; SimplePhoneButton grindsBtn = PhoneUIUtility.CreateSimpleButton("Grinds: " + (flag5 ? "On" : "Off")); SimplePhoneButton obj2 = grindsBtn; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.Grinds != null) { BRCPlusPlugin.Grinds.Value = !BRCPlusPlugin.Grinds.Value; ((TMP_Text)grindsBtn.Label).text = "Grinds: " + (BRCPlusPlugin.Grinds.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)grindsBtn); bool flag6 = BRCPlusPlugin.Wallruns?.Value ?? true; SimplePhoneButton wallrunsBtn = PhoneUIUtility.CreateSimpleButton("Wallruns: " + (flag6 ? "On" : "Off")); SimplePhoneButton obj3 = wallrunsBtn; ((PhoneButton)obj3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.Wallruns != null) { BRCPlusPlugin.Wallruns.Value = !BRCPlusPlugin.Wallruns.Value; ((TMP_Text)wallrunsBtn.Label).text = "Wallruns: " + (BRCPlusPlugin.Wallruns.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)wallrunsBtn); bool flag7 = BRCPlusPlugin.VertRamps?.Value ?? true; SimplePhoneButton vertRampsBtn = PhoneUIUtility.CreateSimpleButton("Vert Ramps: " + (flag7 ? "On" : "Off")); SimplePhoneButton obj4 = vertRampsBtn; ((PhoneButton)obj4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.VertRamps != null) { BRCPlusPlugin.VertRamps.Value = !BRCPlusPlugin.VertRamps.Value; ((TMP_Text)vertRampsBtn.Label).text = "Vert Ramps: " + (BRCPlusPlugin.VertRamps.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)vertRampsBtn); bool flag8 = BRCPlusPlugin.SnailDrop?.Value ?? false; SimplePhoneButton snailDropBtn = PhoneUIUtility.CreateSimpleButton("Snail Drop: " + (flag8 ? "On" : "Off")); SimplePhoneButton obj5 = snailDropBtn; ((PhoneButton)obj5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj5).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDrop != null) { BRCPlusPlugin.SnailDrop.Value = !BRCPlusPlugin.SnailDrop.Value; ((TMP_Text)snailDropBtn.Label).text = "Snail Drop: " + (BRCPlusPlugin.SnailDrop.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)snailDropBtn); float num = BRCPlusPlugin.SnailDropSpeed?.Value ?? 20f; SimplePhoneButton snailDropSpeedUpBtn = PhoneUIUtility.CreateSimpleButton("Snail Drop Speed: " + num + " (+)"); SimplePhoneButton obj6 = snailDropSpeedUpBtn; ((PhoneButton)obj6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj6).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDropSpeed != null) { ConfigEntry snailDropSpeed = BRCPlusPlugin.SnailDropSpeed; snailDropSpeed.Value += 1f; ((TMP_Text)snailDropSpeedUpBtn.Label).text = "Snail Drop Speed: " + BRCPlusPlugin.SnailDropSpeed.Value + " (+)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailDropSpeedUpBtn); SimplePhoneButton snailDropSpeedDownBtn = PhoneUIUtility.CreateSimpleButton("Snail Drop Speed: " + num + " (-)"); SimplePhoneButton obj7 = snailDropSpeedDownBtn; ((PhoneButton)obj7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj7).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDropSpeed != null) { BRCPlusPlugin.SnailDropSpeed.Value = Mathf.Max(0f, BRCPlusPlugin.SnailDropSpeed.Value - 1f); ((TMP_Text)snailDropSpeedDownBtn.Label).text = "Snail Drop Speed: " + BRCPlusPlugin.SnailDropSpeed.Value + " (-)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailDropSpeedDownBtn); bool flag9 = BRCPlusPlugin.SnailLaunch?.Value ?? false; SimplePhoneButton snailLaunchBtn = PhoneUIUtility.CreateSimpleButton("Snail Launch: " + (flag9 ? "On" : "Off")); SimplePhoneButton obj8 = snailLaunchBtn; ((PhoneButton)obj8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj8).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailLaunch != null) { BRCPlusPlugin.SnailLaunch.Value = !BRCPlusPlugin.SnailLaunch.Value; ((TMP_Text)snailLaunchBtn.Label).text = "Snail Launch: " + (BRCPlusPlugin.SnailLaunch.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)snailLaunchBtn); float num2 = BRCPlusPlugin.SnailLaunchSpeed?.Value ?? 20f; SimplePhoneButton snailLaunchSpeedUpBtn = PhoneUIUtility.CreateSimpleButton("Snail Launch Speed: " + num2 + " (+)"); SimplePhoneButton obj9 = snailLaunchSpeedUpBtn; ((PhoneButton)obj9).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj9).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailLaunchSpeed != null) { ConfigEntry snailLaunchSpeed = BRCPlusPlugin.SnailLaunchSpeed; snailLaunchSpeed.Value += 1f; ((TMP_Text)snailLaunchSpeedUpBtn.Label).text = "Snail Launch Speed: " + BRCPlusPlugin.SnailLaunchSpeed.Value + " (+)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailLaunchSpeedUpBtn); SimplePhoneButton snailLaunchSpeedDownBtn = PhoneUIUtility.CreateSimpleButton("Snail Launch Speed: " + num2 + " (-)"); SimplePhoneButton obj10 = snailLaunchSpeedDownBtn; ((PhoneButton)obj10).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj10).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailLaunchSpeed != null) { BRCPlusPlugin.SnailLaunchSpeed.Value = Mathf.Max(0f, BRCPlusPlugin.SnailLaunchSpeed.Value - 1f); ((TMP_Text)snailLaunchSpeedDownBtn.Label).text = "Snail Launch Speed: " + BRCPlusPlugin.SnailLaunchSpeed.Value + " (-)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailLaunchSpeedDownBtn); bool flag10 = BRCPlusPlugin.SnailDash?.Value ?? false; SimplePhoneButton snailDashBtn = PhoneUIUtility.CreateSimpleButton("Snail Dash: " + (flag10 ? "On" : "Off")); SimplePhoneButton obj11 = snailDashBtn; ((PhoneButton)obj11).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj11).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDash != null) { BRCPlusPlugin.SnailDash.Value = !BRCPlusPlugin.SnailDash.Value; ((TMP_Text)snailDashBtn.Label).text = "Snail Dash: " + (BRCPlusPlugin.SnailDash.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)snailDashBtn); float num3 = BRCPlusPlugin.SnailDashSpeed?.Value ?? 20f; SimplePhoneButton snailDashSpeedUpBtn = PhoneUIUtility.CreateSimpleButton("Snail Dash Speed: " + num3 + " (+)"); SimplePhoneButton obj12 = snailDashSpeedUpBtn; ((PhoneButton)obj12).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj12).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDashSpeed != null) { ConfigEntry snailDashSpeed = BRCPlusPlugin.SnailDashSpeed; snailDashSpeed.Value += 1f; ((TMP_Text)snailDashSpeedUpBtn.Label).text = "Snail Dash Speed: " + BRCPlusPlugin.SnailDashSpeed.Value + " (+)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailDashSpeedUpBtn); SimplePhoneButton snailDashSpeedDownBtn = PhoneUIUtility.CreateSimpleButton("Snail Dash Speed: " + num3 + " (-)"); SimplePhoneButton obj13 = snailDashSpeedDownBtn; ((PhoneButton)obj13).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj13).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailDashSpeed != null) { BRCPlusPlugin.SnailDashSpeed.Value = Mathf.Max(0f, BRCPlusPlugin.SnailDashSpeed.Value - 1f); ((TMP_Text)snailDashSpeedDownBtn.Label).text = "Snail Dash Speed: " + BRCPlusPlugin.SnailDashSpeed.Value + " (-)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailDashSpeedDownBtn); bool flag11 = BRCPlusPlugin.SnailReverse?.Value ?? false; SimplePhoneButton snailReverseBtn = PhoneUIUtility.CreateSimpleButton("Snail Reverse: " + (flag11 ? "On" : "Off")); SimplePhoneButton obj14 = snailReverseBtn; ((PhoneButton)obj14).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj14).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailReverse != null) { BRCPlusPlugin.SnailReverse.Value = !BRCPlusPlugin.SnailReverse.Value; ((TMP_Text)snailReverseBtn.Label).text = "Snail Reverse: " + (BRCPlusPlugin.SnailReverse.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)snailReverseBtn); float num4 = BRCPlusPlugin.SnailReverseSpeed?.Value ?? 20f; SimplePhoneButton snailReverseSpeedUpBtn = PhoneUIUtility.CreateSimpleButton("Snail Reverse Speed: " + num4 + " (+)"); SimplePhoneButton obj15 = snailReverseSpeedUpBtn; ((PhoneButton)obj15).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj15).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailReverseSpeed != null) { ConfigEntry snailReverseSpeed = BRCPlusPlugin.SnailReverseSpeed; snailReverseSpeed.Value += 1f; ((TMP_Text)snailReverseSpeedUpBtn.Label).text = "Snail Reverse Speed: " + BRCPlusPlugin.SnailReverseSpeed.Value + " (+)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailReverseSpeedUpBtn); SimplePhoneButton snailReverseSpeedDownBtn = PhoneUIUtility.CreateSimpleButton("Snail Reverse Speed: " + num4 + " (-)"); SimplePhoneButton obj16 = snailReverseSpeedDownBtn; ((PhoneButton)obj16).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj16).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailReverseSpeed != null) { BRCPlusPlugin.SnailReverseSpeed.Value = Mathf.Max(0f, BRCPlusPlugin.SnailReverseSpeed.Value - 1f); ((TMP_Text)snailReverseSpeedDownBtn.Label).text = "Snail Reverse Speed: " + BRCPlusPlugin.SnailReverseSpeed.Value + " (-)"; } }); base.ScrollView.AddButton((PhoneButton)(object)snailReverseSpeedDownBtn); bool flag12 = BRCPlusPlugin.SnailClip?.Value ?? false; SimplePhoneButton snailClipBtn = PhoneUIUtility.CreateSimpleButton("Snail Clip: " + (flag12 ? "On" : "Off")); SimplePhoneButton obj17 = snailClipBtn; ((PhoneButton)obj17).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj17).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SnailClip != null) { BRCPlusPlugin.SnailClip.Value = !BRCPlusPlugin.SnailClip.Value; ((TMP_Text)snailClipBtn.Label).text = "Snail Clip: " + (BRCPlusPlugin.SnailClip.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)snailClipBtn); SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val5); } private void ShowGoonsMenu() { base.ScrollView.RemoveAllButtons(); string text = BRCPlusPlugin.GoonMode?.Value ?? "Normal"; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Goon Mode: " + text); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.GoonMode != null) { string[] goonModeOptions = BRCPlusPlugin.GoonModeOptions; int num = Array.IndexOf(goonModeOptions, BRCPlusPlugin.GoonMode.Value); num = ((num >= 0) ? (num + 1) : 0) % goonModeOptions.Length; BRCPlusPlugin.GoonMode.Value = goonModeOptions[num]; ShowGoonsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); bool flag = BRCPlusPlugin.UseStoredSpeedInConfig?.Value ?? false; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Use Stored Speed In Config: " + (flag ? "On" : "Off")); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.UseStoredSpeedInConfig != null) { BRCPlusPlugin.UseStoredSpeedInConfig.Value = !BRCPlusPlugin.UseStoredSpeedInConfig.Value; ShowGoonsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); bool flag2 = BRCPlusPlugin.LockStoredSpeed?.Value ?? false; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Lock Stored Speed: " + (flag2 ? "On" : "Off")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.LockStoredSpeed != null) { BRCPlusPlugin.LockStoredSpeed.Value = !BRCPlusPlugin.LockStoredSpeed.Value; ShowGoonsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, new Action(ShowMovementMenu)); base.ScrollView.AddButton((PhoneButton)(object)val4); } private void ShowTogglesMenu() { base.ScrollView.RemoveAllButtons(); BRCPlusTimer instance = BRCPlusTimer.Instance; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton((instance != null && instance.IsRunning) ? "End Timer" : "Start Timer"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { BRCPlusTimer instance2 = BRCPlusTimer.Instance; if (!((Object)(object)instance2 == (Object)null)) { if (instance2.IsRunning) { instance2.EndTimer(); } else { instance2.StartTimer(); } ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); BRCPlusPlugin.NormalizeSprayModeConfig(); string text = BRCPlusPlugin.SprayMode?.Value ?? "Normal"; SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Spray Mode: " + text); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SprayMode != null) { string[] sprayModeOptions = BRCPlusPlugin.SprayModeOptions; int num2 = Array.IndexOf(sprayModeOptions, BRCPlusPlugin.SprayMode.Value); num2 = ((num2 >= 0) ? (num2 + 1) : 0) % sprayModeOptions.Length; BRCPlusPlugin.SprayMode.Value = sprayModeOptions[num2]; ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val2); bool flag = BRCPlusPlugin.DisableHeat?.Value ?? false; SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Disable Heat: " + (flag ? "On" : "Off")); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.DisableHeat != null) { BRCPlusPlugin.DisableHeat.Value = !BRCPlusPlugin.DisableHeat.Value; ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val3); bool flag2 = BRCPlusPlugin.GodMode?.Value ?? false; SimplePhoneButton val4 = PhoneUIUtility.CreateSimpleButton("God Mode: " + (flag2 ? "On" : "Off")); ((PhoneButton)val4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val4).OnConfirm, (Action)delegate { if (BRCPlusPlugin.GodMode != null) { BRCPlusPlugin.GodMode.Value = !BRCPlusPlugin.GodMode.Value; ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val4); BRCPlusPlugin.NormalizeSkipCutsceneModeConfig(); string text2 = BRCPlusPlugin.SkipCutsceneMode?.Value ?? "Normal"; SimplePhoneButton val5 = PhoneUIUtility.CreateSimpleButton("Skip Cut Scene Mode: " + text2); ((PhoneButton)val5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val5).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SkipCutsceneMode != null) { string[] skipCutsceneModeOptions = BRCPlusPlugin.SkipCutsceneModeOptions; int num = Array.IndexOf(skipCutsceneModeOptions, BRCPlusPlugin.SkipCutsceneMode.Value); num = ((num >= 0) ? (num + 1) : 0) % skipCutsceneModeOptions.Length; BRCPlusPlugin.SkipCutsceneMode.Value = skipCutsceneModeOptions[num]; ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val5); bool flag3 = BRCPlusPlugin.GetBoostsFromGraffiti?.Value ?? true; SimplePhoneButton val6 = PhoneUIUtility.CreateSimpleButton("Get Boosts From Graffiti: " + (flag3 ? "On" : "Off")); ((PhoneButton)val6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val6).OnConfirm, (Action)delegate { if (BRCPlusPlugin.GetBoostsFromGraffiti != null) { BRCPlusPlugin.GetBoostsFromGraffiti.Value = !BRCPlusPlugin.GetBoostsFromGraffiti.Value; ShowTogglesMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val6); SimplePhoneButton val7 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val7).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val7); } private void ShowOptimizeMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Patches"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowOptimizePatchesMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Hide Objects"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowHideObjectsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); SimplePhoneButton val3 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val3).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val3); } private void ShowOptimizePatchesMenu() { base.ScrollView.RemoveAllButtons(); bool flag = BRCPlusPlugin.AmbientManagerFix?.Value ?? false; SimplePhoneButton ambientFixBtn = PhoneUIUtility.CreateSimpleButton("AmbientManager Fix: " + (flag ? "On" : "Off")); SimplePhoneButton obj = ambientFixBtn; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { if (BRCPlusPlugin.AmbientManagerFix != null) { BRCPlusPlugin.AmbientManagerFix.Value = !BRCPlusPlugin.AmbientManagerFix.Value; ((TMP_Text)ambientFixBtn.Label).text = "AmbientManager Fix: " + (BRCPlusPlugin.AmbientManagerFix.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)ambientFixBtn); bool flag2 = BRCPlusPlugin.NPCRepScanFix?.Value ?? false; SimplePhoneButton npcRepScanFixBtn = PhoneUIUtility.CreateSimpleButton("NPC/Rep Scan Fix: " + (flag2 ? "On" : "Off")); SimplePhoneButton obj2 = npcRepScanFixBtn; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { if (BRCPlusPlugin.NPCRepScanFix != null) { BRCPlusPlugin.NPCRepScanFix.Value = !BRCPlusPlugin.NPCRepScanFix.Value; ((TMP_Text)npcRepScanFixBtn.Label).text = "NPC/Rep Scan Fix: " + (BRCPlusPlugin.NPCRepScanFix.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)npcRepScanFixBtn); bool flag3 = BRCPlusPlugin.SkipPlayerAudio?.Value ?? false; SimplePhoneButton skipPlayerAudioBtn = PhoneUIUtility.CreateSimpleButton("Skip Player Audio: " + (flag3 ? "On" : "Off")); SimplePhoneButton obj3 = skipPlayerAudioBtn; ((PhoneButton)obj3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj3).OnConfirm, (Action)delegate { if (BRCPlusPlugin.SkipPlayerAudio != null) { BRCPlusPlugin.SkipPlayerAudio.Value = !BRCPlusPlugin.SkipPlayerAudio.Value; ((TMP_Text)skipPlayerAudioBtn.Label).text = "Skip Player Audio: " + (BRCPlusPlugin.SkipPlayerAudio.Value ? "On" : "Off"); } }); base.ScrollView.AddButton((PhoneButton)(object)skipPlayerAudioBtn); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowOptimizeMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); } private void ShowHideObjectsMenu() { base.ScrollView.RemoveAllButtons(); bool flag = BRCPlusPlugin.ShowGraffiti?.Value ?? true; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Show Graffiti: " + (flag ? "True" : "False")); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (BRCPlusPlugin.ShowGraffiti != null) { BRCPlusPlugin.ShowGraffiti.Value = !BRCPlusPlugin.ShowGraffiti.Value; ShowHideObjectsMenu(); } }); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(ShowOptimizeMenu)); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void ShowUIOptionsMenu() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Visible"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowUIVisibleMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); SimplePhoneButton val2 = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val2).OnConfirm, new Action(PopulateButtons)); base.ScrollView.AddButton((PhoneButton)(object)val2); } private void ShowUIVisibleMenu() { base.ScrollView.RemoveAllButtons(); AddUIVisibleToggle("Health Bar", BRCPlusPlugin.UIVisible_HealthBar); AddUIVisibleToggle("Boost Bar", BRCPlusPlugin.UIVisible_BoostBar); AddUIVisibleToggle("Score", BRCPlusPlugin.UIVisible_Score); AddUIVisibleToggle("Rep", BRCPlusPlugin.UIVisible_Rep); AddUIVisibleToggle("Combo", BRCPlusPlugin.UIVisible_Combo); AddUIVisibleToggle("Show Gaining Boosts Anim", BRCPlusPlugin.UIVisible_ShowGainingBoostsAnim); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Back"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, new Action(ShowUIOptionsMenu)); base.ScrollView.AddButton((PhoneButton)(object)val); } private void AddUIVisibleToggle(string label, ConfigEntry config) { if (config != null) { bool value = config.Value; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(label + ": " + (value ? "Visible" : "Hidden")); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { config.Value = !config.Value; ShowUIVisibleMenu(); }); base.ScrollView.AddButton((PhoneButton)(object)val); } } private void AddHeat() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return; } WantedManager instance = WantedManager.instance; if (!((Object)(object)instance == (Object)null)) { int num = Mathf.Min((instance.Wanted ? instance.WantedStars : 0) + 1, 7); instance.SetDebugStarAmount(num); if (num >= 1 && !instance.Wanted) { typeof(WantedManager).GetMethod("MakePlayerWanted", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(instance, new object[1] { (object)(Crime)0 }); } } } private void RemoveHeat() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return; } WantedManager instance = WantedManager.instance; if (!((Object)(object)instance == (Object)null) && instance.Wanted) { if (instance.WantedStars <= 1) { instance.StopPlayerWantedStatus(true); } else { typeof(WantedManager).GetMethod("DecreaseStars", BindingFlags.Instance | BindingFlags.NonPublic)?.Invoke(instance, null); } } } } } namespace BRCPlus.Patches { [HarmonyPatch(typeof(AirDashAbility))] [HarmonyPatch("OnStartAbility")] internal static class AirDashOnStartAbilityPatch { public static void Postfix(AirDashAbility __instance) { ConfigEntry infiniteAirDash = BRCPlusPlugin.InfiniteAirDash; if (infiniteAirDash != null && infiniteAirDash.Value) { __instance.haveAirDash = true; } } } [HarmonyPatch(typeof(AmbientManager), "Update")] internal static class AmbientManagerUpdatePatch { private static readonly AnimationCurve _easeInOutCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f); public static IEnumerable Transpiler(IEnumerable instructions) { //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Expected O, but got Unknown List list = new List(instructions); MethodInfo method = typeof(AnimationCurve).GetMethod("EaseInOut", new Type[4] { typeof(float), typeof(float), typeof(float), typeof(float) }); MethodInfo method2 = typeof(AnimationCurve).GetMethod("Evaluate", new Type[1] { typeof(float) }); MethodInfo method3 = typeof(AmbientManagerUpdatePatch).GetMethod("EvaluateCurve", BindingFlags.Static | BindingFlags.Public); if (method == null || method2 == null || method3 == null) { return list; } for (int i = 4; i < list.Count; i++) { if (list[i].opcode != OpCodes.Call || !(list[i].operand is MethodInfo methodInfo) || methodInfo != method || list[i - 4].opcode != OpCodes.Ldc_R4 || list[i - 3].opcode != OpCodes.Ldc_R4 || list[i - 2].opcode != OpCodes.Ldc_R4 || list[i - 1].opcode != OpCodes.Ldc_R4) { continue; } list.RemoveRange(i - 4, 5); for (int j = i - 4; j < list.Count; j++) { if (list[j].operand is MethodInfo methodInfo2 && methodInfo2 == method2) { list[j] = new CodeInstruction(OpCodes.Call, (object)method3); break; } } break; } return list; } public static float EvaluateCurve(float t) { ConfigEntry ambientManagerFix = BRCPlusPlugin.AmbientManagerFix; if (ambientManagerFix != null && ambientManagerFix.Value) { return Mathf.SmoothStep(0f, 1f, t); } return _easeInOutCurve.Evaluate(t); } } [HarmonyPatch(typeof(CameraModeLock), "FindEnemy")] internal static class CameraModeLockFindEnemyPatch { public static bool Prefix(ref BasicEnemy __result) { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat == null || !disableHeat.Value) { return true; } __result = null; return false; } } [HarmonyPatch(typeof(CameraModeLock), "FindEnemyFromCur")] internal static class CameraModeLockFindEnemyFromCurPatch { public static bool Prefix(ref BasicEnemy __result) { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat == null || !disableHeat.Value) { return true; } __result = null; return false; } } [HarmonyPatch(typeof(BoostAbility), "OnStartAbility")] internal static class CanAlwaysBoostPatch { public static void Postfix(BoostAbility __instance) { ConfigEntry canAlwaysBoost = BRCPlusPlugin.CanAlwaysBoost; if (canAlwaysBoost != null && canAlwaysBoost.Value) { __instance.haveAirStartBoost = true; } } } [HarmonyPatch(typeof(APlatform))] [HarmonyPatch("CreateDebugInstanceForPlatform")] internal static class APlatformCreateDebugInstanceForPlatformPatch { public static bool Prefix(BaseModule baseModule, SaveManager saveManager, GameInput gameInput, UIManager uIManager, ref AGameDebug __result) { ConfigEntry enabledDebugMenu = BRCPlusPlugin.EnabledDebugMenu; if (enabledDebugMenu == null || !enabledDebugMenu.Value) { return true; } __result = (AGameDebug)(object)new GameDebugBridge(baseModule, saveManager, gameInput, uIManager); return false; } } [HarmonyPatch(typeof(Player))] internal static class GraffitiPatch { private const BindingFlags InstanceAny = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic; private static readonly PropertyInfo GraffitiSpot_GraffitiArtInfo = typeof(GraffitiSpot).GetProperty("GraffitiArtInfo", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); internal static readonly MethodInfo GraffitiSpot_Paint = typeof(GraffitiSpot).GetMethod("Paint", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[3] { typeof(Crew), typeof(GraffitiArt), typeof(Player) }, null); internal static readonly MethodInfo GraffitiSpot_SpawnRep = typeof(GraffitiSpot).GetMethod("SpawnRep", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, Type.EmptyTypes, null); internal static readonly FieldInfo Player_character = typeof(Player).GetField("character", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_ability = typeof(Player).GetField("ability", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_danceAbility = typeof(Player).GetField("danceAbility", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_isAI = typeof(Player).GetField("isAI", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_audioManager = typeof(Player).GetField("audioManager", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_newSpraycan = typeof(Player).GetField("newSpraycan", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_newGraffitiBonusMulti = typeof(Player).GetField("newGraffitiBonusMulti", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_playerAchievements = typeof(Player).GetField("playerAchievements", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly PropertyInfo Player_sprayButtonNew = typeof(Player).GetProperty("sprayButtonNew", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo Player_graffitiSpotsAvailable = typeof(Player).GetField("graffitiSpotsAvailable", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly FieldInfo WorldHandler_currentEncounter = typeof(WorldHandler).GetField("currentEncounter", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private static readonly MethodInfo AudioManager_PlaySfxGameplay = typeof(AudioManager).GetMethod("PlaySfxGameplay", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[3] { typeof(SfxCollectionID), typeof(AudioClipID), typeof(float) }, null); private static readonly List _unlockedGraffitiBuffer = new List(); private static bool _suppressGraffitiBoost; private static float _savedBoostCharge; private static GraffitiArtInfo GetGraffitiArtInfo(GraffitiSpot spot) { object? obj = GraffitiSpot_GraffitiArtInfo?.GetValue(spot); return (GraffitiArtInfo)((obj is GraffitiArtInfo) ? obj : null); } internal static GraffitiArtInfo GetGraffitiArtInfoPublic(GraffitiSpot spot) { object? obj = GraffitiSpot_GraffitiArtInfo?.GetValue(spot); return (GraffitiArtInfo)((obj is GraffitiArtInfo) ? obj : null); } private static GraffitiArt GetGraffitiArtForSpot(GraffitiSpot spot, Player player) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_003d: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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) GraffitiArtInfo graffitiArtInfo = GetGraffitiArtInfo(spot); if ((Object)(object)graffitiArtInfo == (Object)null) { return null; } Characters val2 = (Characters)((!(Player_character?.GetValue(player) is Characters val)) ? 12 : ((int)val)); if ((int)spot.size == 0) { return graffitiArtInfo.FindByCharacter(val2); } List list = graffitiArtInfo.FindBySize(spot.size); if (list == null || list.Count == 0) { return null; } Core instance = Core.Instance; object obj; if (instance == null) { obj = null; } else { APlatform platform = instance.Platform; obj = ((platform != null) ? platform.User : null); } AUser val3 = (AUser)obj; _unlockedGraffitiBuffer.Clear(); for (int i = 0; i < list.Count; i++) { GraffitiArt val4 = list[i]; if ((Object)(object)val4?.unlockable != (Object)null && val3 != null && val3.GetUnlockableSaveDataFor((AUnlockable)(object)val4.unlockable).IsUnlocked) { _unlockedGraffitiBuffer.Add(val4); } } if (_unlockedGraffitiBuffer.Count == 0) { return graffitiArtInfo.FindByCharacter(val2); } return _unlockedGraffitiBuffer[Random.Range(0, _unlockedGraffitiBuffer.Count)]; } [HarmonyAfter(new string[] { "BombRushMP.Plugin" })] [HarmonyPrefix] [HarmonyPatch("StartGraffitiMode")] private static bool StartGraffitiMode_Prefix(Player __instance, GraffitiSpot graffitiSpot) { //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Expected I4, but got Unknown //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected I4, but got Unknown //IL_02ee: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Expected I4, but got Unknown //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Invalid comparison between Unknown and I4 //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Invalid comparison between Unknown and I4 //IL_00d6: Unknown result type (might be due to invalid IL or missing references) if ((BRCPlusPlugin.SprayMode?.Value ?? "Normal") != "Quick") { return true; } if (__instance.IsBusyWithSequence() || __instance.IsDead()) { return true; } if (Player_ability?.GetValue(__instance) == Player_danceAbility?.GetValue(__instance)) { return true; } if (Player_isAI != null && (bool)Player_isAI.GetValue(__instance)) { return true; } GraffitiArt graffitiArtForSpot = GetGraffitiArtForSpot(graffitiSpot, __instance); if (graffitiArtForSpot == null) { return true; } TrickType val = (TrickType)16; GraffitiSize size = graffitiSpot.size; switch (size - 1) { case 0: val = (TrickType)17; break; case 1: val = (TrickType)18; break; case 2: val = (TrickType)19; break; } bool flag = (int)graffitiSpot.bottomCrew == 1 || (int)graffitiSpot.bottomCrew == 7; __instance.DoTrick(val, graffitiArtForSpot.title, 0); GraffitiSpot_Paint?.Invoke(graffitiSpot, new object[3] { (object)(Crew)1, graffitiArtForSpot, __instance }); graffitiSpot.GiveRep(false, flag); graffitiSpot.SetLastPlayer(__instance); graffitiSpot.SetState((GraffitiState)2); GraffitiSpot_SpawnRep?.Invoke(graffitiSpot, null); try { __instance.PlayVoice((AudioClipID)498, (VoicePriority)2, true); } catch { } try { object obj2 = Player_audioManager?.GetValue(__instance); if (obj2 != null) { AudioManager_PlaySfxGameplay?.Invoke(obj2, new object[3] { (object)(SfxCollectionID)13, (object)(AudioClipID)559, 0f }); } } catch { } __instance.RemoveGraffitiSlash(); try { __instance.CreateGraffitiFinishEffect(((Component)graffitiSpot).transform, graffitiSpot.size); } catch { } WorldHandler instance = WorldHandler.instance; object obj5 = ((!((Object)(object)instance != (Object)null)) ? null : WorldHandler_currentEncounter?.GetValue(instance)); if (((UnityEventBase)graffitiSpot.OnFinish).GetPersistentEventCount() == 0 && obj5 == null && graffitiSpot.reportAsCrime) { size = graffitiSpot.size; switch ((int)size) { case 0: { WantedManager instance5 = WantedManager.instance; if (instance5 != null) { instance5.CrimePerpetrated((Crime)0, false); } break; } case 1: { WantedManager instance3 = WantedManager.instance; if (instance3 != null) { instance3.CrimePerpetrated((Crime)1, false); } break; } case 2: { WantedManager instance4 = WantedManager.instance; if (instance4 != null) { instance4.CrimePerpetrated((Crime)2, false); } break; } case 3: { WantedManager instance2 = WantedManager.instance; if (instance2 != null) { instance2.CrimePerpetrated((Crime)3, false); } break; } } } __instance.RegainAirMobility(); Player_newSpraycan?.SetValue(__instance, true); ConfigEntry getBoostsFromGraffiti = BRCPlusPlugin.GetBoostsFromGraffiti; if (getBoostsFromGraffiti != null && getBoostsFromGraffiti.Value && ((Player_newGraffitiBonusMulti != null) ? ((int)Player_newGraffitiBonusMulti.GetValue(__instance)) : 0) > 1) { if (__instance.IsBusyWithSequence()) { __instance.AddBoostCharge(Pickup.boostChargeValue * (float)graffitiSpot.size * 10f); } else { ((MonoBehaviour)__instance).StartCoroutine(__instance.GiveBoostStack(((Component)graffitiSpot).transform, graffitiSpot.size * 10)); } } Core instance6 = Core.Instance; if (instance6 != null) { APlatform platform = instance6.Platform; if (((platform != null) ? new bool?(platform.HasAchievementsSupport) : null) == true) { object? obj6 = Player_playerAchievements?.GetValue(__instance); object? obj7 = ((obj6 is PlayerAchievements) ? obj6 : null); if (obj7 != null) { ((PlayerAchievements)obj7).CheckStageGraffitiAchievement(); } } } return false; } [HarmonyAfter(new string[] { "BombRushMP.Plugin" })] [HarmonyPrefix] [HarmonyPatch("CheckAvailableGraffitiSpots")] private static bool CheckAvailableGraffitiSpots_Prefix(Player __instance) { if (BRCPlusPlugin.SprayMode?.Value != "Quick") { return true; } if (!(Player_sprayButtonNew != null) || !(bool)Player_sprayButtonNew.GetValue(__instance)) { if (Player_graffitiSpotsAvailable?.GetValue(__instance) is List list) { list.Clear(); } return false; } return true; } private static IEnumerator ClearSuppressAfterDelay(float seconds) { yield return (object)new WaitForSeconds(seconds); _suppressGraffitiBoost = false; } [HarmonyPrefix] [HarmonyPatch("EndGraffitiMode")] private static void EndGraffitiMode_Prefix(Player __instance) { _savedBoostCharge = __instance.boostCharge; _suppressGraffitiBoost = !(BRCPlusPlugin.GetBoostsFromGraffiti?.Value ?? true); } [HarmonyPostfix] [HarmonyPatch("EndGraffitiMode")] private static void EndGraffitiMode_Postfix(Player __instance) { if (_suppressGraffitiBoost) { __instance.boostCharge = _savedBoostCharge; ((MonoBehaviour)__instance).StartCoroutine(ClearSuppressAfterDelay(1f)); } } [HarmonyPostfix] [HarmonyPatch("GiveBoostStack")] private static void GiveBoostStack_Postfix(ref IEnumerator __result) { if (_suppressGraffitiBoost) { __result = EmptyBoostStack(); } } private static IEnumerator EmptyBoostStack() { yield break; } } [HarmonyPatch(typeof(GrindAbility), "CanSetToLine")] internal static class GrindPatch { public static bool Prefix(ref bool __result) { ConfigEntry grinds = BRCPlusPlugin.Grinds; if (grinds != null && !grinds.Value) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(BasicEnemy), "ReceiveDamage")] internal static class InstaKillPatch { [HarmonyPrefix] private static void Prefix(BasicEnemy __instance, ref int damage) { ConfigEntry instaKillMode = BRCPlusPlugin.InstaKillMode; if (instaKillMode != null && instaKillMode.Value) { damage = Traverse.Create((object)__instance).Field("HP").GetValue(); if (damage <= 0) { damage = 1; } } } } [HarmonyPatch(typeof(Player), "AddScoreMultiplier")] internal static class MaxMultiplierPatch { [HarmonyPrefix] private static bool Prefix(Player __instance) { ConfigEntry maxMultiplier = BRCPlusPlugin.MaxMultiplier; if (maxMultiplier == null || !maxMultiplier.Value) { return true; } __instance.PlayVoice((AudioClipID)487, (VoicePriority)1, true); Traverse.Create((object)__instance).Field("scoreMultiplier").SetValue((object)(Traverse.Create((object)__instance).Field("scoreMultiplier").GetValue() + 9999f)); return false; } } [HarmonyPatch(typeof(Player), "DoTrick")] internal static class MaxScoresPatch { public static void Postfix(Player __instance) { ConfigEntry maxScores = BRCPlusPlugin.MaxScores; if (maxScores == null || !maxScores.Value) { return; } Traverse val = Traverse.Create((object)__instance); int value = val.Field("currentTrickPoints").GetValue(); if (value > 0) { int num = 99000000 - value; if (num > 0) { float value2 = val.Field("scoreFactor").GetValue(); float value3 = val.Field("baseScore").GetValue(); val.Field("baseScore").SetValue((object)(value3 + (float)(int)((float)num * value2))); } } } } [HarmonyPatch(typeof(Phone))] [HarmonyPatch("OpenCloseHandeling")] internal static class PhoneOpenCloseHandelingPatch { public static bool Prefix(Phone __instance) { Traverse val = Traverse.Create((object)__instance); if (Convert.ToInt32(val.Field("state").GetValue()) == 2) { return true; } ConfigEntry snailDrop = BRCPlusPlugin.SnailDrop; if (snailDrop == null || !snailDrop.Value) { ConfigEntry snailLaunch = BRCPlusPlugin.SnailLaunch; if (snailLaunch == null || !snailLaunch.Value) { return true; } } Core instance = Core.Instance; if (((instance != null) ? instance.GameInput : null) == null) { return true; } if (!instance.GameInput.IsPlayerControllerJoystick(0)) { return true; } Player value = val.Field("player").GetValue(); if ((Object)(object)value == (Object)null || value.TreatPlayerAsSortaGrounded()) { return true; } GameInput value2 = val.Field("gameInput").GetValue(); if (value2 == null) { return true; } if (!value2.GetButtonNew(21, 0) && !value2.GetButtonNew(29, 0) && !value2.GetButtonNew(57, 0)) { return true; } return false; } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("PickupVisualization")] internal static class PlayerPickupVisualizationPatch { public static bool Prefix(Vector3 pickupPosition, PickUpType pickupType, bool worldPos, ref PickupDisplay __result) { //IL_0015: 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_001a: Invalid comparison between Unknown and I4 //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Invalid comparison between Unknown and I4 ConfigEntry uIVisible_ShowGainingBoostsAnim = BRCPlusPlugin.UIVisible_ShowGainingBoostsAnim; if (uIVisible_ShowGainingBoostsAnim == null || uIVisible_ShowGainingBoostsAnim.Value) { return true; } if ((int)pickupType != 0 && (int)pickupType != 1 && (int)pickupType != 6) { return true; } __result = null; return false; } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("ChangeHP")] internal static class PlayerChangeHPPatch { public static bool Prefix(int dmg) { ConfigEntry godMode = BRCPlusPlugin.GodMode; if (godMode != null && godMode.Value && dmg > 0) { return false; } return true; } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("AddBoostCharge")] internal static class PlayerAddBoostChargePatch { public static bool Prefix(Player __instance) { ConfigEntry infiniteBoost = BRCPlusPlugin.InfiniteBoost; if (infiniteBoost == null || !infiniteBoost.Value) { return true; } float value = Traverse.Create((object)__instance).Field("maxBoostCharge").GetValue(); __instance.boostCharge = value; return false; } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("Init")] internal static class PlayerInitPatch { public static void Postfix(Player __instance) { BRCPlusPlugin.ApplyPlayerSizeTo(__instance); } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("UpdateBoostpack")] internal static class PlayerUpdateBoostpackPatch { private static Player _cachedPlayer; private static float _cachedMaxBoostCharge; public static void Postfix(Player __instance) { ConfigEntry infiniteBoost = BRCPlusPlugin.InfiniteBoost; if (infiniteBoost != null && infiniteBoost.Value) { if ((Object)(object)__instance != (Object)(object)_cachedPlayer) { _cachedPlayer = __instance; _cachedMaxBoostCharge = Traverse.Create((object)__instance).Field("maxBoostCharge").GetValue(); } __instance.boostCharge = _cachedMaxBoostCharge; } } } [HarmonyPatch(typeof(Player), "SaveNavMeshPosition")] internal static class PlayerSaveNavMeshPositionPatch { public static bool Prefix() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return false; } return true; } } [HarmonyPatch(typeof(Player), "UpdateMoveStyleMovementAudio")] internal static class PlayerUpdateMoveStyleMovementAudioPatch { public static bool Prefix() { ConfigEntry skipPlayerAudio = BRCPlusPlugin.SkipPlayerAudio; if (skipPlayerAudio != null && skipPlayerAudio.Value) { return false; } return true; } } [HarmonyPatch(typeof(SequenceHandler))] internal static class SequenceHandlerPatch { private static readonly int SkipState_NOT_SKIPPABLE = 0; private static readonly int SkipState_IDLE = 1; private static Type _skipStateType; private static Type GetSkipStateType() { if (_skipStateType != null) { return _skipStateType; } _skipStateType = typeof(SequenceHandler).GetNestedType("SkipState", BindingFlags.Public | BindingFlags.NonPublic); return _skipStateType; } private static object SkipStateIdle() { Type skipStateType = GetSkipStateType(); if (!(skipStateType != null)) { return SkipState_IDLE; } return Enum.ToObject(skipStateType, SkipState_IDLE); } [HarmonyPostfix] [HarmonyPatch("StartEnteringSequence")] private static void StartEnteringSequence_Postfix(SequenceHandler __instance) { if (!(BRCPlusPlugin.SkipCutsceneMode?.Value != "Force button")) { Traverse obj = Traverse.Create((object)__instance); obj.Field("skipTextActiveState").SetValue(SkipStateIdle()); obj.Field("skipStartTimer").SetValue((object)0.5f); obj.Field("disabledExit").SetValue((object)false); } } [HarmonyPrefix] [HarmonyPatch("UpdateSequenceHandler")] private static void UpdateSequenceHandler_Prefix(SequenceHandler __instance) { string text = BRCPlusPlugin.SkipCutsceneMode?.Value ?? "Normal"; if (text == "Normal") { return; } WorldHandler instance = WorldHandler.instance; Player val = ((instance != null) ? instance.GetCurrentPlayer() : null); if ((Object)(object)val == (Object)null || (int)Traverse.Create((object)val).Field("sequenceState").GetValue() != 1) { return; } Traverse val2 = Traverse.Create((object)__instance); int num = Convert.ToInt32(val2.Field("skipTextActiveState").GetValue()); if (text == "Force button") { if (num == SkipState_NOT_SKIPPABLE) { val2.Field("skipTextActiveState").SetValue(SkipStateIdle()); } val2.Field("disabledExit").SetValue((object)false); } else if (text == "Auto Skip" && val2.Field("exitSequenceRoutine").GetValue() == null) { __instance.ExitCurrentSequence(); } } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("FixedUpdatePlayer")] internal static class SnailClipPatch { private static readonly HashSet ClippedPlayers = new HashSet(); public static void Postfix(Player __instance) { if ((Object)(object)__instance?.motor == (Object)null) { return; } ConfigEntry snailClip = BRCPlusPlugin.SnailClip; bool num = snailClip != null && snailClip.Value && __instance.sprayButtonHeld; bool flag = ClippedPlayers.Contains(__instance); if (num) { if (!flag && __instance.motor.CollisionIsOn()) { __instance.motor.HaveCollision(false); ClippedPlayers.Add(__instance); } } else if (flag) { __instance.motor.HaveCollision(true); ClippedPlayers.Remove(__instance); } } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("FixedUpdatePlayer")] internal static class SnailDashPatch { public static void Postfix(Player __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0077: 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_0086: 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_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00a8: Unknown result type (might be due to invalid IL or missing references) ConfigEntry snailDash = BRCPlusPlugin.SnailDash; if (snailDash == null || !snailDash.Value) { return; } ConfigEntry snailDashKey = BRCPlusPlugin.SnailDashKey; if (Input.GetKeyDown((KeyCode)((snailDashKey == null) ? 99 : ((int)snailDashKey.Value)))) { float num = BRCPlusPlugin.SnailDashSpeed?.Value ?? 20f; if (float.IsNaN(num) || float.IsInfinity(num)) { num = 20f; } Vector3 val = __instance.motor.velocity; float magnitude = ((Vector3)(ref val)).magnitude; val = Vector3.ProjectOnPlane(__instance.tf.forward, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = __instance.tf.forward; } __instance.SetVelocity(val2 * (magnitude + num)); __instance.DoTrick((TrickType)4, "Snail Dash", 0); } } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("FixedUpdatePlayer")] internal static class SnailDropPatch { public static void Postfix(Player __instance) { //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_0078: Unknown result type (might be due to invalid IL or missing references) ConfigEntry snailDrop = BRCPlusPlugin.SnailDrop; if (snailDrop != null && snailDrop.Value && __instance.danceButtonNew && !__instance.TreatPlayerAsSortaGrounded()) { float num = BRCPlusPlugin.SnailDropSpeed?.Value ?? 20f; if (float.IsNaN(num) || float.IsInfinity(num)) { num = 20f; } Vector3 velocity = __instance.motor.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; __instance.SetVelocity(new Vector3(0f, 0f - (magnitude + num), 0f)); __instance.DoTrick((TrickType)4, "Snail Drop", 0); } } } [HarmonyPatch(typeof(MovementMotor), "LimitFallSpeed")] internal static class SnailDropFallSpeedCapPatch { public static bool Prefix() { ConfigEntry snailDrop = BRCPlusPlugin.SnailDrop; if (snailDrop == null) { return true; } return !snailDrop.Value; } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("FixedUpdatePlayer")] internal static class SnailLaunchPatch { public static void Postfix(Player __instance) { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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) ConfigEntry snailLaunch = BRCPlusPlugin.SnailLaunch; if (snailLaunch == null || !snailLaunch.Value || __instance.TreatPlayerAsSortaGrounded()) { return; } Phone value = Traverse.Create((object)__instance).Field("phone").GetValue(); if ((!((Object)(object)value != (Object)null) || !value.IsOn) && Core.Instance.GameInput.GetButtonNew(56, 0)) { float num = BRCPlusPlugin.SnailLaunchSpeed?.Value ?? 20f; if (float.IsNaN(num) || float.IsInfinity(num)) { num = 20f; } Vector3 velocity = __instance.motor.velocity; float magnitude = ((Vector3)(ref velocity)).magnitude; __instance.SetVelocity(new Vector3(0f, magnitude + num, 0f)); __instance.DoTrick((TrickType)4, "Snail Launch", 0); } } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("FixedUpdatePlayer")] internal static class SnailReversePatch { public static void Postfix(Player __instance) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_0077: 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_0086: 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_00aa: 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_00a3: 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) ConfigEntry snailReverse = BRCPlusPlugin.SnailReverse; if (snailReverse == null || !snailReverse.Value) { return; } ConfigEntry snailReverseKey = BRCPlusPlugin.SnailReverseKey; if (Input.GetKeyDown((KeyCode)((snailReverseKey == null) ? 122 : ((int)snailReverseKey.Value)))) { float num = BRCPlusPlugin.SnailReverseSpeed?.Value ?? 20f; if (float.IsNaN(num) || float.IsInfinity(num)) { num = 20f; } Vector3 val = __instance.motor.velocity; float magnitude = ((Vector3)(ref val)).magnitude; val = Vector3.ProjectOnPlane(__instance.tf.forward, Vector3.up); Vector3 val2 = ((Vector3)(ref val)).normalized; if (((Vector3)(ref val2)).sqrMagnitude < 0.01f) { val2 = __instance.tf.forward; } __instance.SetVelocity(-val2 * (magnitude + num)); __instance.DoTrick((TrickType)4, "Snail Reverse", 0); } } } [HarmonyPatch(typeof(Player))] [HarmonyPatch("UpdateUIDisplay")] internal static class PlayerUpdateUIDisplayPatch { private static string _appliedGravity; private static Player _gravityPlayer; private static void ApplyGravityIfChanged(Player player) { string text = BRCPlusPlugin.Gravity?.Value ?? "Normal"; if (!((Object)(object)player.motor == (Object)null) && (!(text == _appliedGravity) || !((Object)(object)player == (Object)(object)_gravityPlayer))) { _appliedGravity = text; _gravityPlayer = player; if (text == "Low") { player.motor.gravity = 10f; player.motor.gravityUp = 4f; } else if (text == "High") { player.motor.gravity = 45f; player.motor.gravityUp = 18f; } } } private static void SetActive(object componentOrGo, bool active) { if (componentOrGo == null) { return; } GameObject val = (GameObject)((componentOrGo is GameObject) ? componentOrGo : null); if (val != null) { val.SetActive(active); return; } Component val2 = (Component)((componentOrGo is Component) ? componentOrGo : null); if (val2 != null && (Object)(object)val2.gameObject != (Object)null) { val2.gameObject.SetActive(active); } } private static bool SkipUIVisibilityCheck() { ConfigEntry uIVisible_HealthBar = BRCPlusPlugin.UIVisible_HealthBar; if (uIVisible_HealthBar == null || uIVisible_HealthBar.Value) { ConfigEntry uIVisible_BoostBar = BRCPlusPlugin.UIVisible_BoostBar; if (uIVisible_BoostBar == null || uIVisible_BoostBar.Value) { ConfigEntry uIVisible_Score = BRCPlusPlugin.UIVisible_Score; if (uIVisible_Score == null || uIVisible_Score.Value) { ConfigEntry uIVisible_Rep = BRCPlusPlugin.UIVisible_Rep; if (uIVisible_Rep == null || uIVisible_Rep.Value) { return BRCPlusPlugin.UIVisible_Combo?.Value ?? true; } } } } return false; } public static void Postfix(Player __instance) { ConfigEntry alwaysInSpeedZone = BRCPlusPlugin.AlwaysInSpeedZone; if (alwaysInSpeedZone != null && alwaysInSpeedZone.Value) { Traverse.Create((object)__instance).Field("inSpeedZone").SetValue((object)true); } ApplyGravityIfChanged(__instance); if (SkipUIVisibilityCheck()) { return; } object value = Traverse.Create((object)__instance).Field("ui").GetValue(); if (value == null) { return; } Traverse val = Traverse.Create(value); ConfigEntry uIVisible_HealthBar = BRCPlusPlugin.UIVisible_HealthBar; if (uIVisible_HealthBar != null && !uIVisible_HealthBar.Value) { SetActive(val.Field("healthBarGroup").GetValue(), active: false); } if (BRCPlusPlugin.UIVisible_BoostBar != null) { object value2 = val.Field("chargeBar").GetValue(); Component val2 = (Component)((value2 is Component) ? value2 : null); if (val2 != null && (Object)(object)val2.transform != (Object)null) { Transform parent = val2.transform.parent; Transform val3 = (((Object)(object)parent != (Object)null) ? parent.parent : null); (((Object)(object)val3 != (Object)null) ? ((Component)val3).gameObject : (((Object)(object)parent != (Object)null) ? ((Component)parent).gameObject : val2.gameObject)).SetActive(BRCPlusPlugin.UIVisible_BoostBar.Value); } } bool active = BRCPlusPlugin.UIVisible_Score?.Value ?? true; SetActive(val.Field("scoreCalcLabel").GetValue(), active); ConfigEntry uIVisible_Rep = BRCPlusPlugin.UIVisible_Rep; if (uIVisible_Rep != null && !uIVisible_Rep.Value) { SetActive(val.Field("repGroup").GetValue(), active: false); } if (BRCPlusPlugin.UIVisible_Combo != null) { bool value3 = BRCPlusPlugin.UIVisible_Combo.Value; SetActive(val.Field("currentTrickTransform").GetValue(), value3); SetActive(val.Field("scoreTrickLabel").GetValue(), value3); SetActive(val.Field("scoreMultiplierLabel").GetValue(), value3); SetActive(val.Field("trickNameLabel").GetValue(), value3); SetActive(val.Field("tricksInComboLabel").GetValue(), value3); SetActive(val.Field("comboTimeOutBar").GetValue(), value3); SetActive(val.Field("comboTimeOutBackdrop").GetValue(), value3); if (!value3) { SetActive(val.Field("comboMascotLabel").GetValue(), active: false); SetActive(val.Field("comboMascotIcon").GetValue(), active: false); } } } } [HarmonyPatch(typeof(Player), "CheckVert")] internal static class VertRampPatch { public static bool Prefix() { ConfigEntry vertRamps = BRCPlusPlugin.VertRamps; if (vertRamps != null && !vertRamps.Value) { return false; } return true; } } [HarmonyPatch(typeof(Player), "CanStartWallrun")] internal static class PlayerCanStartWallrunPatch { public static bool Prefix(ref bool __result) { ConfigEntry wallruns = BRCPlusPlugin.Wallruns; if (wallruns != null && !wallruns.Value) { __result = false; return false; } return true; } } [HarmonyPatch(typeof(WallrunLineAbility))] [HarmonyPatch("OnStartAbility")] internal static class WallrunLineAbilityOnStartAbilityPatch { public static void Postfix(WallrunLineAbility __instance) { if ((BRCPlusPlugin.GoonMode?.Value ?? "Normal") == "Auto") { Traverse.Create((object)__instance).Field("journey").SetValue((object)0.99f); ((Ability)__instance).p.DoTrick((TrickType)10, "Auto Goon", 0); return; } bool num = BRCPlusPlugin.LockStoredSpeed?.Value ?? false; bool flag = BRCPlusPlugin.UseStoredSpeedInConfig?.Value ?? false; if (num || flag) { ((Ability)__instance).p.DoTrick((TrickType)10, "Locked Goon", 0); } } } [HarmonyPatch(typeof(WallrunLineAbility))] [HarmonyPatch("RunOff")] internal static class WallrunLineAbilityRunOffPatch { internal static float? StoredSpeedOverride; public static void Postfix(WallrunLineAbility __instance, Vector3 direction) { //IL_0023: 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_002b: 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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) if (StoredSpeedOverride.HasValue) { float value = StoredSpeedOverride.Value; StoredSpeedOverride = null; Vector3 velocity = direction * value + __instance.wallrunFaceNormal * 1f; ((Ability)__instance).p.SetVelocity(velocity); } } } [HarmonyPatch(typeof(WallrunLineAbility))] [HarmonyPatch("Jump")] internal static class WallrunLineAbilityJumpPatch { public static void Postfix(WallrunLineAbility __instance) { //IL_0024: 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_0033: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: 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_0064: 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_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_007e: 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) if (WallrunLineAbilityRunOffPatch.StoredSpeedOverride.HasValue) { float value = WallrunLineAbilityRunOffPatch.StoredSpeedOverride.Value; WallrunLineAbilityRunOffPatch.StoredSpeedOverride = null; Vector3 val = Vector3.ProjectOnPlane(__instance.dirToNextNode, Vector3.up); float num = ((Ability)__instance).p.jumpSpeed + ((Ability)__instance).p.bonusJumpSpeedWallrun; Vector3 velocity = ((Vector3)(ref val)).normalized * value + num * Vector3.up + __instance.wallrunFaceNormal * 1f; ((Ability)__instance).p.SetVelocity(velocity); } } } [HarmonyPatch(typeof(WallrunLineAbility))] [HarmonyPatch("FixedUpdateAbility")] internal static class WallrunLineAbilityFixedUpdatePatch { private static float _savedLastSpeed; public static void Prefix(WallrunLineAbility __instance) { ConfigEntry lockStoredSpeed = BRCPlusPlugin.LockStoredSpeed; if (lockStoredSpeed != null && lockStoredSpeed.Value) { _savedLastSpeed = Traverse.Create((object)__instance).Field("lastSpeed").GetValue(); } } public static void Postfix(WallrunLineAbility __instance) { Traverse val = Traverse.Create((object)__instance); ConfigEntry useStoredSpeedInConfig = BRCPlusPlugin.UseStoredSpeedInConfig; if (useStoredSpeedInConfig != null && useStoredSpeedInConfig.Value) { val.Field("lastSpeed").SetValue((object)((float)(BRCPlusPlugin.ConfigForcedStoredSpeed?.Value ?? 600) / 10f)); } ConfigEntry lockStoredSpeed = BRCPlusPlugin.LockStoredSpeed; if (lockStoredSpeed != null && lockStoredSpeed.Value) { val.Field("lastSpeed").SetValue((object)_savedLastSpeed); } } } [HarmonyPatch(typeof(WantedManager))] [HarmonyPatch("CrimePerpetrated")] internal static class WantedManagerCrimePerpetratedPatch { public static bool Prefix() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return false; } return true; } } [HarmonyPatch(typeof(WantedManager))] [HarmonyPatch("ManageHeat")] internal static class WantedManagerManageHeatPatch { public static bool Prefix() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return false; } return true; } } [HarmonyPatch(typeof(WorldHandler), "ArbiterCombat")] internal static class WorldHandlerArbiterCombatPatch { public static bool Prefix() { ConfigEntry disableHeat = BRCPlusPlugin.DisableHeat; if (disableHeat != null && disableHeat.Value) { return false; } return true; } } [HarmonyPatch(typeof(WorldHandler), "UpdateWorldHandler")] internal static class WorldHandlerUpdateWorldHandlerPatch { private static int _frameCounter; public static IEnumerable Transpiler(IEnumerable instructions) { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Expected O, but got Unknown //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown List list = new List(instructions); MethodInfo method = typeof(Player).GetMethod("IsBusyWithSequence", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo method2 = typeof(WorldHandlerUpdateWorldHandlerPatch).GetMethod("ShouldRunRepScan", BindingFlags.Static | BindingFlags.Public); if (method == null || method2 == null) { return list; } for (int i = 0; i < list.Count - 1; i++) { if (list[i].operand is MethodInfo methodInfo && methodInfo == method) { CodeInstruction val = list[i + 1]; if (val.opcode == OpCodes.Brtrue || val.opcode == OpCodes.Brtrue_S) { list.Insert(i + 2, new CodeInstruction(OpCodes.Brfalse, val.operand)); list.Insert(i + 2, new CodeInstruction(OpCodes.Call, (object)method2)); } break; } } return list; } public static bool ShouldRunRepScan() { ConfigEntry nPCRepScanFix = BRCPlusPlugin.NPCRepScanFix; if (nPCRepScanFix == null || !nPCRepScanFix.Value) { return true; } _frameCounter++; if (_frameCounter >= 60) { _frameCounter = 0; return true; } return false; } } }