Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of Emergency Dice REPOED v1.1.0
RepoDice.dll
Decompiled 6 months ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using MoreUpgrades; using MoreUpgrades.Classes; using Newtonsoft.Json; using Photon.Pun; using REPOLib.Modules; using REPOLib.Objects.Sdk; using RepoDice; using RepoDice.Dice; using RepoDice.Effects; using RepoDice.Patches; using RepoDice.Visual; using TMPro; using Unity.Mathematics; using Unity.VisualScripting; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp-firstpass")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Autodesk.Fbx")] [assembly: IgnoresAccessChecksTo("Discord.Sdk")] [assembly: IgnoresAccessChecksTo("Domain_Reload")] [assembly: IgnoresAccessChecksTo("Facepunch.Steamworks.Win64")] [assembly: IgnoresAccessChecksTo("FbxBuildTestAssets")] [assembly: IgnoresAccessChecksTo("Klattersynth")] [assembly: IgnoresAccessChecksTo("MoreUpgrades")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonChat")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking.Utilities")] [assembly: IgnoresAccessChecksTo("PhotonVoice.API")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: IgnoresAccessChecksTo("PhotonVoice.PUN")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime")] [assembly: IgnoresAccessChecksTo("SingularityGroup.HotReload.Runtime.Public")] [assembly: IgnoresAccessChecksTo("Sirenix.OdinInspector.Attributes")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization.Config")] [assembly: IgnoresAccessChecksTo("Sirenix.Serialization")] [assembly: IgnoresAccessChecksTo("Sirenix.Utilities")] [assembly: IgnoresAccessChecksTo("Unity.AI.Navigation")] [assembly: IgnoresAccessChecksTo("Unity.Burst")] [assembly: IgnoresAccessChecksTo("Unity.Burst.Unsafe")] [assembly: IgnoresAccessChecksTo("Unity.Collections")] [assembly: IgnoresAccessChecksTo("Unity.Collections.LowLevel.ILSupport")] [assembly: IgnoresAccessChecksTo("Unity.Formats.Fbx.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem")] [assembly: IgnoresAccessChecksTo("Unity.InputSystem.ForUI")] [assembly: IgnoresAccessChecksTo("Unity.Mathematics")] [assembly: IgnoresAccessChecksTo("Unity.MemoryProfiler")] [assembly: IgnoresAccessChecksTo("Unity.Postprocessing.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.Profiling.Core")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.Core.ShaderLibrary")] [assembly: IgnoresAccessChecksTo("Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary")] [assembly: IgnoresAccessChecksTo("Unity.Splines")] [assembly: IgnoresAccessChecksTo("Unity.TextMeshPro")] [assembly: IgnoresAccessChecksTo("Unity.Timeline")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Antlr3.Runtime")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Core")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.Flow")] [assembly: IgnoresAccessChecksTo("Unity.VisualScripting.State")] [assembly: IgnoresAccessChecksTo("UnityEngine.ARModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.NVIDIAModule")] [assembly: IgnoresAccessChecksTo("UnityEngine.UI")] [assembly: IgnoresAccessChecksTo("websocket-sharp")] [assembly: AssemblyCompany("Slayer6409")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+526197b4302455a205b4e828a796ff4db1cbbd9b")] [assembly: AssemblyProduct("RepoDice")] [assembly: AssemblyTitle("RepoDice")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } public class CycleSigns : MonoBehaviour { private class DiceVisuals { public Sprite Sprite; public Color ModelColor; public Color EmissionColor; public float Emission; public DiceVisuals(Sprite sprite, Color color, Color emissionColor, float emission) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0018: Unknown result type (might be due to invalid IL or missing references) Sprite = sprite; ModelColor = color; EmissionColor = emissionColor; Emission = emission; } } public float CycleTime = 1f; private float CurrentTimer = 0f; private int CurrentSprite = 0; private bool Stop = false; private SpriteRenderer SignSpriteRenderer; private SpriteRenderer SignSpriteRenderer2; private SpriteRenderer SignSpriteRenderer3; private Renderer DiceRenderer; private List<DiceVisuals> Visuals = new List<DiceVisuals>(); private void Start() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) Visuals.Add(new DiceVisuals(global::RepoDice.RepoDice.WarningExclamation, Color.yellow, Color.yellow, 40f)); Visuals.Add(new DiceVisuals(global::RepoDice.RepoDice.WarningDeath, Color.red, Color.red, 100f)); Visuals.Add(new DiceVisuals(global::RepoDice.RepoDice.WarningLuck, Color.green, Color.green, 300f)); if (Misc.isGlitchOrConfig()) { Visuals.Add(new DiceVisuals(global::RepoDice.RepoDice.WarningGlitch, Color.magenta, Color.magenta, 300f)); } SignSpriteRenderer = ((Component)((Component)this).transform.Find("Emergency Sign")).gameObject.GetComponent<SpriteRenderer>(); SignSpriteRenderer2 = ((Component)((Component)this).transform.Find("Emergency Sign2")).gameObject.GetComponent<SpriteRenderer>(); DiceRenderer = ((Component)this).gameObject.GetComponent<Renderer>(); } private void Update() { if (!Stop) { CurrentTimer -= Time.deltaTime; if (CurrentTimer <= 0f) { CurrentTimer = CycleTime; CycleSprite(); } } } private void CycleSprite() { //IL_0095: 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_00dc: Unknown result type (might be due to invalid IL or missing references) CurrentSprite++; if (CurrentSprite >= Visuals.Count) { CurrentSprite = 0; } SignSpriteRenderer.sprite = Visuals[CurrentSprite].Sprite; SignSpriteRenderer2.sprite = Visuals[CurrentSprite].Sprite; DiceRenderer.material.SetColor("_Color", Visuals[CurrentSprite].ModelColor); DiceRenderer.material.SetColor("_EmissionColor", Visuals[CurrentSprite].EmissionColor * Visuals[CurrentSprite].Emission); } public void HideSigns() { Stop = true; ((Renderer)((Component)SignSpriteRenderer).GetComponent<SpriteRenderer>()).enabled = false; ((Renderer)((Component)SignSpriteRenderer2).GetComponent<SpriteRenderer>()).enabled = false; } } namespace RepoDice { public class DebugMenu : MonoBehaviour { public class RightClickHandler2 : MonoBehaviour, IPointerClickHandler, IEventSystemHandler { public string effectName; public string category; public bool fromSaint = false; public void OnPointerClick(PointerEventData eventData) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 if ((int)eventData.button == 1) { FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); switch (category) { case "Favorites": ToggleFavorite(effectName, favoriteData.Favorites); break; case "FavoriteScraps": ToggleFavorite(effectName, favoriteData.FavoriteScraps); break; case "FavoriteShopItems": ToggleFavorite(effectName, favoriteData.FavoriteShopItems); break; } FavoriteEffectManager.SaveFavorites(favoriteData); clearMainViewport(); switch (category) { case "Favorites": ShowSelectMenu(fromSaint); break; case "FavoriteScraps": spawnScrap(); break; case "FavoriteShopItems": spawnShopItems(); break; } } } private void ToggleFavorite(string name, List<string> favorites) { if (favorites.Contains(name)) { favorites.Remove(name); } else { favorites.Add(name); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action<CallbackContext> <>9__19_0; public static UnityAction <>9__19_2; public static UnityAction <>9__19_3; public static UnityAction <>9__19_4; public static UnityAction <>9__19_5; public static UnityAction <>9__20_0; public static UnityAction <>9__20_1; public static UnityAction <>9__20_2; public static Func<PlayerAvatar, string> <>9__21_0; public static Func<IGrouping<string, PlayerAvatar>, PlayerAvatar> <>9__21_1; public static Func<PlayerAvatar, string> <>9__21_2; public static UnityAction<bool> <>9__23_0; public static UnityAction<bool> <>9__23_1; public static UnityAction <>9__23_3; public static Action<CallbackContext> <>9__24_0; public static Func<IEffect, string> <>9__29_1; public static UnityAction <>9__31_0; public static UnityAction <>9__31_1; public static UnityAction <>9__31_2; public static UnityAction <>9__31_3; public static UnityAction <>9__31_4; public static Func<EnemySetup, string> <>9__32_0; public static Func<IGrouping<string, EnemySetup>, EnemySetup> <>9__32_1; public static Func<EnemySetup, string> <>9__32_3; public static Func<Item, string> <>9__33_0; public static Func<IGrouping<string, Item>, Item> <>9__33_1; public static Func<Item, string> <>9__33_3; public static UnityAction <>9__34_1; public static UnityAction <>9__34_0; public static UnityAction <>9__34_2; public static Func<KeyValuePair<string, AudioClip>, string> <>9__35_0; public static UnityAction <>9__37_0; public static Func<string, string> <>9__39_1; internal void <showDebugMenu>b__19_0(CallbackContext ctx) { CloseSelectMenu(); } internal void <showDebugMenu>b__19_2() { clearMainViewport(); ShowSelectMenu(); } internal void <showDebugMenu>b__19_3() { clearSubViewport(); spawnFunctions(); } internal void <showDebugMenu>b__19_4() { clearSubViewport(); playerFunctions(); } internal void <showDebugMenu>b__19_5() { clearSubViewport(); specialFunctions(isSpecial()); } internal void <playerFunctions>b__20_0() { clearMainViewport(); RevivePlayer(); } internal void <playerFunctions>b__20_1() { clearMainViewport(); TeleportPlayer(); } internal void <playerFunctions>b__20_2() { clearMainViewport(); TeleportPlayer(bring: true); } internal string <TeleportPlayer>b__21_0(PlayerAvatar x) { return x.playerName; } internal PlayerAvatar <TeleportPlayer>b__21_1(IGrouping<string, PlayerAvatar> g) { return g.First(); } internal string <TeleportPlayer>b__21_2(PlayerAvatar x) { return x.playerName; } internal void <setupButtons>b__23_0(bool isOn) { RepoDice.DebugMenuColorUsesPlayerColor.Value = isOn; } internal void <setupButtons>b__23_1(bool isOn) { RepoDice.DebugMenuClosesAfter.Value = !isOn; } internal void <setupButtons>b__23_3() { CloseSelectMenu(force: true); } internal void <ShowSelectEffectMenu>b__24_0(CallbackContext ctx) { CloseSelectMenu(); } internal string <getOrdered>b__29_1(IEffect effect) { return effect.Name; } internal void <spawnFunctions>b__31_0() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(Vector3.one); } internal void <spawnFunctions>b__31_1() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(new Vector3(2.5f, 2.5f, 2.5f)); } internal void <spawnFunctions>b__31_2() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(new Vector3(0.5f, 0.5f, 0.5f)); } internal void <spawnFunctions>b__31_3() { clearMainViewport(); spawnScrap(); } internal void <spawnFunctions>b__31_4() { clearMainViewport(); spawnShopItems(); } internal string <spawnEnemy>b__32_0(EnemySetup x) { return ((Object)x).name; } internal EnemySetup <spawnEnemy>b__32_1(IGrouping<string, EnemySetup> g) { return g.First(); } internal string <spawnEnemy>b__32_3(EnemySetup e) { return ((Object)e).name; } internal string <spawnShopItems>b__33_0(Item x) { return x.itemName; } internal Item <spawnShopItems>b__33_1(IGrouping<string, Item> g) { return g.First(); } internal string <spawnShopItems>b__33_3(Item s) { return s.itemName; } internal void <specialFunctions>b__34_1() { clearMainViewport(); ShowSoundMenu(); } internal void <specialFunctions>b__34_0() { clearMainViewport(); poiTeleports(); } internal void <specialFunctions>b__34_2() { clearMainViewport(); jail(); } internal string <ShowSoundMenu>b__35_0(KeyValuePair<string, AudioClip> x) { return x.Key; } internal void <poiTeleports>b__37_0() { //IL_003f: 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) ((MonoBehaviourPun)Networker.Instance).photonView.RPC("ForceTeleportRPC", (RpcTarget)0, new object[3] { PlayerAvatar.instance.photonView.ViewID, ((Component)LevelGenerator.Instance.LevelPathTruck).transform.position, ((Component)LevelGenerator.Instance.LevelPathTruck).transform.rotation }); CloseSelectMenu(); } internal string <spawnScrap>b__39_1(string s) { return s; } } public static Color mainColor = new Color(13f / 85f, 0f, 27f / 85f, 1f); public static Color ButtonColor = new Color(0.6430231f, 0.2783019f, 1f, 1f); public static Color TextColor = new Color(0.9607844f, 43f / 85f, 0.9803922f, 1f); public static Color FavoriteTextColor = new Color(0.9607844f, 0.2058824f, 0.2803922f, 1f); public static Color BackgroundColor = new Color(0.6039216f, 0.2392157f, 1f, 0.2f); public static Color AccentColor = new Color(0.6078432f, 0.2588235f, 0.9921569f, 0.4627451f); public static GameObject EffectMenu = null; public static bool ran; public static List<Image> backgroundImages = new List<Image>(); public static List<Image> accentImages = new List<Image>(); public static List<Image> buttonImages = new List<Image>(); public static List<TMP_Text> textElements = new List<TMP_Text>(); public static List<Text> textElements2 = new List<Text>(); public static Transform mainScrollContent; public static Transform subScrollContent; public static void SetupColors() { //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_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_0093: 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_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_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_00b0: 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_00b6: 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_00c0: 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_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_003e: 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) if (!RepoDice.DebugMenuColorUsesPlayerColor.Value) { if (!ColorUtility.TryParseHtmlString(RepoDice.DebugMenuColor.Value, ref mainColor)) { ColorUtility.TryParseHtmlString("#270051", ref mainColor); } BackgroundColor = mainColor; BackgroundColor.a = 0.46f; } else { mainColor = PlayerAvatar.instance.playerAvatarVisuals.color; BackgroundColor = PlayerAvatar.instance.playerAvatarVisuals.color; BackgroundColor.a = 0.46f; } (Color brighter, Color darker) tuple = ColorHelper.GenerateColors(mainColor); Color item = tuple.brighter; Color item2 = tuple.darker; ButtonColor = item; AccentColor = item2; TextColor = ColorHelper.GetReadableTextColor(mainColor); FavoriteTextColor = ColorHelper.GetEmphasisTextColor(mainColor); } public static void setupElements() { buttonImages.Add(RepoDice.DebugSubButtonPrefab.GetComponent<Image>()); buttonImages.Add(RepoDice.DebugMenuButtonPrefab.GetComponent<Image>()); textElements.Add(RepoDice.DebugSubButtonPrefab.GetComponentInChildren<TMP_Text>()); textElements.Add(RepoDice.DebugMenuButtonPrefab.GetComponentInChildren<TMP_Text>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/Scroll View/Scrollbar Vertical")).GetComponent<Image>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/ClearButton")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/TopPart")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/Image")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background")).GetComponent<Image>()); accentImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/Border")).GetComponent<Image>()); accentImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/Scroll View")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/TopPart/Border/Title")).GetComponent<TMP_Text>()); accentImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/TopPart/Border")).GetComponent<Image>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Select Effect")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Select Effect/Text (TMP)")).GetComponent<TMP_Text>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/ClearButton/Text (TMP)")).GetComponent<TMP_Text>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Spawn Menu")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Spawn Menu/Text (TMP)")).GetComponent<TMP_Text>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Player Functions")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Player Functions/Text (TMP)")).GetComponent<TMP_Text>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Special Functions")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Special Functions/Text (TMP)")).GetComponent<TMP_Text>()); buttonImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Grant Admin")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Grant Admin/Text (TMP)")).GetComponent<TMP_Text>()); accentImages.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Scroll View")).GetComponent<Image>()); textElements2.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/KeepOpen/Label")).GetComponent<Text>()); textElements2.Add(((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Bald/Label")).GetComponent<Text>()); textElements.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/ColorPlayer/Label")).GetComponent<TMP_Text>()); setupSelectElements(); ran = true; } public static void setupSelectElements() { buttonImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/Scroll View/Scrollbar Vertical")).GetComponent<Image>()); buttonImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/ClearButton")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/TopPart")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/Image")).GetComponent<Image>()); backgroundImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background")).GetComponent<Image>()); accentImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/Border")).GetComponent<Image>()); accentImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/Scroll View")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/TopPart/Border/Title")).GetComponent<TMP_Text>()); accentImages.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/TopPart/Border")).GetComponent<Image>()); textElements.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/ClearButton/Text (TMP)")).GetComponent<TMP_Text>()); textElements2.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Bald/Label")).GetComponent<Text>()); textElements.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/KeepOpen/Label")).GetComponent<TMP_Text>()); textElements.Add(((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/ColorPlayer/Label")).GetComponent<TMP_Text>()); } public static void setColors() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0041: 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_005b: 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_0075: 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_008f: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0182: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) ColorBlock colors = ((Selectable)((Component)RepoDice.DebugMenuPrefab.transform.Find("DebugMenu/Background/Scroll View/Scrollbar Vertical")).GetComponent<Scrollbar>()).colors; ColorBlock colors2 = ((Selectable)((Component)RepoDice.SelectMenuPrefab.transform.Find("DebugMenu/Background/Scroll View/Scrollbar Vertical")).GetComponent<Scrollbar>()).colors; ((ColorBlock)(ref colors)).normalColor = TextColor; ((ColorBlock)(ref colors)).highlightedColor = TextColor; ((ColorBlock)(ref colors)).pressedColor = TextColor; ((ColorBlock)(ref colors)).selectedColor = TextColor; ((ColorBlock)(ref colors2)).normalColor = TextColor; ((ColorBlock)(ref colors2)).highlightedColor = TextColor; ((ColorBlock)(ref colors2)).pressedColor = TextColor; ((ColorBlock)(ref colors2)).selectedColor = TextColor; foreach (Image buttonImage in buttonImages) { ((Graphic)buttonImage).color = ButtonColor; } foreach (TMP_Text textElement in textElements) { ((Graphic)textElement).color = TextColor; } foreach (Text item in textElements2) { ((Graphic)item).color = TextColor; } foreach (Image accentImage in accentImages) { ((Graphic)accentImage).color = AccentColor; } foreach (Image backgroundImage in backgroundImages) { ((Graphic)backgroundImage).color = BackgroundColor; } } public static void showDebugMenu() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Expected O, but got Unknown //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Expected O, but got Unknown //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Expected O, but got Unknown //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0359: Unknown result type (might be due to invalid IL or missing references) //IL_035f: Expected O, but got Unknown SetupColors(); if (!ran) { setupElements(); } if (ran) { setColors(); } if ((Object)(object)EffectMenu != (Object)null) { Object.Destroy((Object)(object)EffectMenu); EffectMenu = null; } InputAction val = new InputAction((string)null, (InputActionType)0, "<Keyboard>/escape", (string)null, (string)null, (string)null); val.performed += delegate { CloseSelectMenu(); }; val.Enable(); EffectMenu = Object.Instantiate<GameObject>(RepoDice.DebugMenuPrefab); Canvas component = EffectMenu.GetComponent<Canvas>(); component.renderMode = (RenderMode)0; component.overrideSorting = true; component.sortingOrder = 999; EffectMenu.transform.localPosition = Vector3.zero; EffectMenu.transform.localScale = Vector3.one; EffectMenu.transform.localRotation = Quaternion.identity; if ((Object)(object)EffectMenu == (Object)null) { Debug.LogError((object)"EffectMenu is null after instantiation!"); return; } subScrollContent = EffectMenu.transform.Find("DebugMenu/Scroll View/Viewport/Content"); mainScrollContent = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); TMP_InputField searchInput = ((Component)EffectMenu.transform.Find("DebugMenu/Background/SearchField")).GetComponent<TMP_InputField>(); ((UnityEvent<string>)(object)searchInput.onValueChanged).AddListener((UnityAction<string>)FilterItems); Button component2 = ((Component)EffectMenu.transform.Find("DebugMenu/Background/ClearButton")).GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { searchInput.text = ""; }); DebugMenuController debugMenuController = EffectMenu.AddComponent<DebugMenuController>(); debugMenuController.EffectMenu = EffectMenu; setupButtons(); Button component3 = ((Component)EffectMenu.transform.Find("DebugMenu/Select Effect")).GetComponent<Button>(); TMP_Text component4 = ((Component)EffectMenu.transform.Find("DebugMenu/Select Effect/Text (TMP)")).GetComponent<TMP_Text>(); ButtonClickedEvent onClick = component3.onClick; object obj = <>c.<>9__19_2; if (obj == null) { UnityAction val2 = delegate { clearMainViewport(); ShowSelectMenu(); }; <>c.<>9__19_2 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); Button component5 = ((Component)EffectMenu.transform.Find("DebugMenu/Spawn Menu")).GetComponent<Button>(); TMP_Text component6 = ((Component)EffectMenu.transform.Find("DebugMenu/Spawn Menu/Text (TMP)")).GetComponent<TMP_Text>(); ButtonClickedEvent onClick2 = component5.onClick; object obj2 = <>c.<>9__19_3; if (obj2 == null) { UnityAction val3 = delegate { clearSubViewport(); spawnFunctions(); }; <>c.<>9__19_3 = val3; obj2 = (object)val3; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); Button component7 = ((Component)EffectMenu.transform.Find("DebugMenu/Player Functions")).GetComponent<Button>(); TMP_Text component8 = ((Component)EffectMenu.transform.Find("DebugMenu/Player Functions/Text (TMP)")).GetComponent<TMP_Text>(); ButtonClickedEvent onClick3 = component7.onClick; object obj3 = <>c.<>9__19_4; if (obj3 == null) { UnityAction val4 = delegate { clearSubViewport(); playerFunctions(); }; <>c.<>9__19_4 = val4; obj3 = (object)val4; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); Button component9 = ((Component)EffectMenu.transform.Find("DebugMenu/Special Functions")).GetComponent<Button>(); ButtonClickedEvent onClick4 = component9.onClick; object obj4 = <>c.<>9__19_5; if (obj4 == null) { UnityAction val5 = delegate { clearSubViewport(); specialFunctions(isSpecial()); }; <>c.<>9__19_5 = val5; obj4 = (object)val5; } ((UnityEvent)onClick4).AddListener((UnityAction)obj4); Button component10 = ((Component)EffectMenu.transform.Find("DebugMenu/Grant Admin")).GetComponent<Button>(); Object.Destroy((Object)(object)((Component)component10).gameObject); Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; } public static void playerFunctions() { //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_006c: Expected O, but got Unknown //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Scroll View/Viewport/Content"); GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, val); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = "Revive Player"; Button component2 = val2.GetComponent<Button>(); ButtonClickedEvent onClick = component2.onClick; object obj = <>c.<>9__20_0; if (obj == null) { UnityAction val3 = delegate { clearMainViewport(); RevivePlayer(); }; <>c.<>9__20_0 = val3; obj = (object)val3; } ((UnityEvent)onClick).AddListener((UnityAction)obj); GameObject val4 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, val); TMP_Text component3 = ((Component)val4.transform.GetChild(0)).GetComponent<TMP_Text>(); component3.text = "Teleport to Player"; Button component4 = val4.GetComponent<Button>(); ButtonClickedEvent onClick2 = component4.onClick; object obj2 = <>c.<>9__20_1; if (obj2 == null) { UnityAction val5 = delegate { clearMainViewport(); TeleportPlayer(); }; <>c.<>9__20_1 = val5; obj2 = (object)val5; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); GameObject val6 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, val); TMP_Text component5 = ((Component)val6.transform.GetChild(0)).GetComponent<TMP_Text>(); component5.text = "Bring Player"; Button component6 = val6.GetComponent<Button>(); ButtonClickedEvent onClick3 = component6.onClick; object obj3 = <>c.<>9__20_2; if (obj3 == null) { UnityAction val7 = delegate { clearMainViewport(); TeleportPlayer(bring: true); }; <>c.<>9__20_2 = val7; obj3 = (object)val7; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); } public static void TeleportPlayer(bool bring = false) { //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); List<PlayerAvatar> source = SemiFunc.PlayerGetAll(); source = (from x in source group x by x.playerName into g select g.First() into x orderby x.playerName select x).ToList(); foreach (PlayerAvatar player in source) { if (player.playerHealth.health < 1) { continue; } GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, val); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = player.playerName ?? ""; Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0099: 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_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_006f: Unknown result type (might be due to invalid IL or missing references) CloseSelectMenu(); PlayerAvatar instance = PlayerAvatar.instance; if (instance.playerHealth.health <= 0 && bring) { Networker.Instance.ForceTeleportRPC(player.photonView.ViewID, ((Component)instance).transform.position + new Vector3(0f, 1f, 0f), ((Component)instance).transform.rotation); } else { Networker.Instance.ForceTeleportRPC(instance.photonView.ViewID, ((Component)player).transform.position + new Vector3(0f, 1f, 0f), ((Component)player).transform.rotation); } }); } } public static bool isSpecial() { if (PlayerAvatar.instance.steamID == RepoDice.slayerSteamID) { return true; } if (PlayerAvatar.instance.steamID == RepoDice.glitchSteamID) { return true; } if (PlayerAvatar.instance.steamID == RepoDice.lizzieSteamID) { return true; } return false; } public static void setupButtons(bool fromSaint = false) { //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown Toggle component = ((Component)EffectMenu.transform.Find("DebugMenu/ColorPlayer")).GetComponent<Toggle>(); component.isOn = RepoDice.DebugMenuColorUsesPlayerColor.Value; Toggle component2 = ((Component)EffectMenu.transform.Find("DebugMenu/KeepOpen")).GetComponent<Toggle>(); if (fromSaint) { ((Component)component2).gameObject.SetActive(false); } component2.isOn = !RepoDice.DebugMenuClosesAfter.Value; ((UnityEvent<bool>)(object)component.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn) { RepoDice.DebugMenuColorUsesPlayerColor.Value = isOn; }); if (((Component)component2).gameObject.activeInHierarchy) { ((UnityEvent<bool>)(object)component2.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn) { RepoDice.DebugMenuClosesAfter.Value = !isOn; }); } Toggle component3 = ((Component)EffectMenu.transform.Find("DebugMenu/Bald")).GetComponent<Toggle>(); component3.isOn = RepoDice.Bald.Value; GameObject BaldImage = ((Component)EffectMenu.transform.Find("DebugMenu/Background/Image")).gameObject; ((UnityEvent<bool>)(object)component3.onValueChanged).AddListener((UnityAction<bool>)delegate(bool isOn) { RepoDice.Bald.Value = isOn; BaldImage.SetActive(isOn); }); if (RepoDice.Bald.Value) { BaldImage.SetActive(true); } else { BaldImage.SetActive(false); } Button component4 = ((Component)EffectMenu.transform.Find("DebugMenu/CloseButton")).GetComponent<Button>(); ButtonClickedEvent onClick = component4.onClick; object obj = <>c.<>9__23_3; if (obj == null) { UnityAction val = delegate { CloseSelectMenu(force: true); }; <>c.<>9__23_3 = val; obj = (object)val; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } public static void ShowSelectEffectMenu(bool fromSaint = false) { //IL_0098: 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_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown SetupColors(); if (!ran) { setupElements(); } if (ran) { setColors(); } if ((Object)(object)EffectMenu != (Object)null) { Object.Destroy((Object)(object)EffectMenu); EffectMenu = null; } EffectMenu = Object.Instantiate<GameObject>(RepoDice.SelectMenuPrefab, (Transform)null, false); Canvas component = EffectMenu.GetComponent<Canvas>(); component.renderMode = (RenderMode)0; component.overrideSorting = true; component.sortingOrder = 999; EffectMenu.transform.localPosition = Vector3.zero; EffectMenu.transform.localScale = Vector3.one; EffectMenu.transform.localRotation = Quaternion.identity; mainScrollContent = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); InputAction val = new InputAction((string)null, (InputActionType)0, "<Keyboard>/escape", (string)null, (string)null, (string)null); val.performed += delegate { CloseSelectMenu(); }; val.Enable(); TMP_InputField searchInput = ((Component)EffectMenu.transform.Find("DebugMenu/Background/SearchField")).GetComponent<TMP_InputField>(); ((UnityEvent<string>)(object)searchInput.onValueChanged).AddListener((UnityAction<string>)FilterItems); Button component2 = ((Component)EffectMenu.transform.Find("DebugMenu/Background/ClearButton")).GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { searchInput.text = ""; }); if ((Object)(object)EffectMenu == (Object)null) { Debug.LogError((object)"EffectMenu is null after instantiation!"); return; } DebugMenuController debugMenuController = EffectMenu.AddComponent<DebugMenuController>(); debugMenuController.EffectMenu = EffectMenu; setupButtons(fromSaint); Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; ShowSelectMenu(fromSaint); } public static void CloseSelectMenu(bool force = false) { if ((RepoDice.DebugMenuClosesAfter.Value || force) && (Object)(object)EffectMenu != (Object)null) { Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; Object.Destroy((Object)(object)EffectMenu); } } private static void FilterItems(string searchText) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); foreach (Transform item in val) { Transform val2 = item; TextMeshProUGUI componentInChildren = ((Component)val2).GetComponentInChildren<TextMeshProUGUI>(); if (Object.op_Implicit((Object)(object)componentInChildren)) { bool active = string.IsNullOrEmpty(searchText) || ((TMP_Text)componentInChildren).text.ToLower().Contains(searchText.ToLower()); ((Component)val2).gameObject.SetActive(active); } } } public static void clearMainViewport() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); foreach (Transform item in val) { Transform val2 = item; Object.Destroy((Object)(object)((Component)val2).gameObject); } } public static void clearSubViewport() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Scroll View/Viewport/Content"); foreach (Transform item in val) { Transform val2 = item; Object.Destroy((Object)(object)((Component)val2).gameObject); } } public static List<IEffect> getOrdered() { List<IEffect> source = new List<IEffect>(DieBehaviour.AllowedEffects); if (Misc.GetLocalPlayer().steamID == RepoDice.slayerSteamID) { source = new List<IEffect>(DieBehaviour.AllEffects); } FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); List<string> favoriteEffectNames = favoriteData.Favorites; return source.OrderByDescending((IEffect effect) => favoriteEffectNames.Contains(effect.Name)).ThenBy<IEffect, string>((IEffect effect) => effect.Name, StringComparer.OrdinalIgnoreCase).ToList(); } public static void ShowSelectMenu(bool fromSaint = false) { //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); List<IEffect> ordered = getOrdered(); FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); List<string> favorites = favoriteData.Favorites; foreach (IEffect effect in ordered) { GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, val); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); bool flag = favorites.Contains(effect.Name); string text = (flag ? "*" : ""); component.text = $"{text} {effect.Name} [{effect.Outcome}] {text}"; ((Graphic)component).color = (flag ? FavoriteTextColor : TextColor); component.outlineWidth = 1f; if (component.text.Length > 20) { component.fontSize = 12f; } else { component.fontSize = 16f; } Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { CloseSelectMenu(fromSaint); if (SemiFunc.IsMasterClientOrSingleplayer()) { Networker.Instance.SelectEffectMenuRPC(fromSaint, PlayerAvatar.instance.photonView.ViewID, effect.Name); } else { ((MonoBehaviourPun)Networker.Instance).photonView.RPC("SelectEffectMenuRPC", (RpcTarget)2, new object[3] { fromSaint, PlayerAvatar.instance.photonView.ViewID, effect.Name }); } bool flag2 = false; string text2 = ""; }); RightClickHandler2 rightClickHandler = val2.AddComponent<RightClickHandler2>(); rightClickHandler.effectName = effect.Name; rightClickHandler.category = "Favorites"; rightClickHandler.fromSaint = fromSaint; } } public static void spawnFunctions() { //IL_0050: 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_005b: Expected O, but got Unknown //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_00bf: Expected O, but got Unknown //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_01e9: 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_01f4: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = "Spawn Enemy"; Button component2 = val.GetComponent<Button>(); ButtonClickedEvent onClick = component2.onClick; object obj = <>c.<>9__31_0; if (obj == null) { UnityAction val2 = delegate { //IL_0007: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(Vector3.one); }; <>c.<>9__31_0 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); GameObject val3 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component3 = ((Component)val3.transform.GetChild(0)).GetComponent<TMP_Text>(); component3.text = "Spawn BIG Enemy"; Button component4 = val3.GetComponent<Button>(); ButtonClickedEvent onClick2 = component4.onClick; object obj2 = <>c.<>9__31_1; if (obj2 == null) { UnityAction val4 = delegate { //IL_0016: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(new Vector3(2.5f, 2.5f, 2.5f)); }; <>c.<>9__31_1 = val4; obj2 = (object)val4; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); GameObject val5 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component5 = ((Component)val5.transform.GetChild(0)).GetComponent<TMP_Text>(); component5.text = "Spawn SMOL Enemy"; Button component6 = val5.GetComponent<Button>(); ButtonClickedEvent onClick3 = component6.onClick; object obj3 = <>c.<>9__31_2; if (obj3 == null) { UnityAction val6 = delegate { //IL_0016: Unknown result type (might be due to invalid IL or missing references) clearMainViewport(); spawnEnemy(new Vector3(0.5f, 0.5f, 0.5f)); }; <>c.<>9__31_2 = val6; obj3 = (object)val6; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); GameObject val7 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component7 = ((Component)val7.transform.GetChild(0)).GetComponent<TMP_Text>(); component7.text = "Spawn Valuable"; Button component8 = val7.GetComponent<Button>(); ButtonClickedEvent onClick4 = component8.onClick; object obj4 = <>c.<>9__31_3; if (obj4 == null) { UnityAction val8 = delegate { clearMainViewport(); spawnScrap(); }; <>c.<>9__31_3 = val8; obj4 = (object)val8; } ((UnityEvent)onClick4).AddListener((UnityAction)obj4); GameObject val9 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component9 = ((Component)val9.transform.GetChild(0)).GetComponent<TMP_Text>(); component9.text = "Spawn Shop Items"; Button component10 = val9.GetComponent<Button>(); ButtonClickedEvent onClick5 = component10.onClick; object obj5 = <>c.<>9__31_4; if (obj5 == null) { UnityAction val10 = delegate { clearMainViewport(); spawnShopItems(); }; <>c.<>9__31_4 = val10; obj5 = (object)val10; } ((UnityEvent)onClick5).AddListener((UnityAction)obj5); } public static void spawnEnemy(Vector3 size) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); List<string> favoriteEnemyNames = favoriteData.FavoriteEnemies; List<EnemySetup> list = (from x in Misc.getEnemies() group x by ((Object)x).name into g select g.First() into e orderby (!favoriteEnemyNames.Contains(((Object)e).name)) ? 1 : 0, ((Object)e).name select e).ToList(); foreach (EnemySetup enemy in list) { GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); bool flag = favoriteEnemyNames.Contains(((Object)enemy).name); string text = (flag ? "*" : ""); component.text = text + " " + ((Object)enemy).name; ((Graphic)component).color = (flag ? FavoriteTextColor : TextColor); Button component2 = val.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) CloseSelectMenu(); Vector3 val2 = ((Component)PlayerAvatar.instance).transform.position + ((Component)PlayerAvatar.instance).transform.forward; ((MonoBehaviourPun)Networker.Instance).photonView.RPC("SpawnAndScaleEnemy", (RpcTarget)2, new object[5] { ((Object)enemy).name, 1, val2, size, false }); }); RightClickHandler2 rightClickHandler = val.AddComponent<RightClickHandler2>(); rightClickHandler.effectName = ((Object)enemy).name; rightClickHandler.category = "FavoriteEnemies"; } } public static void spawnShopItems() { //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); List<string> favoriteShopItemNames = favoriteData.FavoriteShopItems; List<Item> source = (from x in StatsManager.instance.itemDictionary.Values.ToList() group x by x.itemName into g select g.First()).ToList(); source = (from s in source orderby (!favoriteShopItemNames.Contains(s.itemName)) ? 1 : 0, s.itemName select s).ToList(); foreach (Item item in source) { GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); bool flag = favoriteShopItemNames.Contains(item.itemName); string text = (flag ? "*" : ""); component.text = text + " " + item.itemName; ((Graphic)component).color = (flag ? FavoriteTextColor : TextColor); Button component2 = val.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) CloseSelectMenu(); Vector3 val2 = ((Component)PlayerAvatar.instance).transform.position + ((Component)PlayerAvatar.instance).transform.forward; ((MonoBehaviourPun)Networker.Instance).photonView.RPC("spawnItemRPC", (RpcTarget)2, new object[3] { item.itemName, val2, RepoDice.keepItems.Value }); }); RightClickHandler2 rightClickHandler = val.AddComponent<RightClickHandler2>(); rightClickHandler.effectName = item.itemName; rightClickHandler.category = "FavoriteShopItems"; } } public static void specialFunctions(bool special) { //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Expected O, but got Unknown if (special) { GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = "Play Sound"; Button component2 = val.GetComponent<Button>(); ButtonClickedEvent onClick = component2.onClick; object obj = <>c.<>9__34_1; if (obj == null) { UnityAction val2 = delegate { clearMainViewport(); ShowSoundMenu(); }; <>c.<>9__34_1 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); } GameObject val3 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component3 = ((Component)val3.transform.GetChild(0)).GetComponent<TMP_Text>(); component3.text = "POI Teleports"; Button component4 = val3.GetComponent<Button>(); ButtonClickedEvent onClick2 = component4.onClick; object obj2 = <>c.<>9__34_0; if (obj2 == null) { UnityAction val4 = delegate { clearMainViewport(); poiTeleports(); }; <>c.<>9__34_0 = val4; obj2 = (object)val4; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); if (!special) { return; } GameObject val5 = Object.Instantiate<GameObject>(RepoDice.DebugSubButtonPrefab, subScrollContent); TMP_Text component5 = ((Component)val5.transform.GetChild(0)).GetComponent<TMP_Text>(); component5.text = "Jail"; Button component6 = val5.GetComponent<Button>(); ButtonClickedEvent onClick3 = component6.onClick; object obj3 = <>c.<>9__34_2; if (obj3 == null) { UnityAction val6 = delegate { clearMainViewport(); jail(); }; <>c.<>9__34_2 = val6; obj3 = (object)val6; } ((UnityEvent)onClick3).AddListener((UnityAction)obj3); } public static void ShowSoundMenu() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); foreach (KeyValuePair<string, AudioClip> entry in RepoDice.sounds.OrderBy<KeyValuePair<string, AudioClip>, string>((KeyValuePair<string, AudioClip> x) => x.Key)) { GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, val); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = entry.Key; component.outlineWidth = 1f; if (component.text.Length > 20) { component.fontSize = 12f; } else { component.fontSize = 16f; } Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { CloseSelectMenu(); ((MonoBehaviourPun)Networker.Instance).photonView.RPC("playSoundForEveryone", (RpcTarget)0, new object[1] { entry.Key }); }); } } public static void RevivePlayer() { //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Expected O, but got Unknown Transform val = EffectMenu.transform.Find("DebugMenu/Background/Scroll View/Viewport/Content"); Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); int num = 0; foreach (PlayerAvatar player in list) { if (player.playerHealth.health <= 0) { num++; GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, val); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = player.playerName ?? ""; Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { clearMainViewport(); CloseSelectMenu(); RevivePlayer(); ((MonoBehaviourPun)Networker.Instance).photonView.RPC("reviveRPC", (RpcTarget)0, new object[1] { player.photonView.ViewID }); }); } } if (num == 0) { GameObject val3 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, val); TMP_Text component3 = ((Component)val3.transform.GetChild(0)).GetComponent<TMP_Text>(); component3.text = "No Dead Players"; } } public static void poiTeleports() { //IL_0050: 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_005b: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = "Ship"; Button component2 = val.GetComponent<Button>(); ButtonClickedEvent onClick = component2.onClick; object obj = <>c.<>9__37_0; if (obj == null) { UnityAction val2 = delegate { //IL_003f: 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) ((MonoBehaviourPun)Networker.Instance).photonView.RPC("ForceTeleportRPC", (RpcTarget)0, new object[3] { PlayerAvatar.instance.photonView.ViewID, ((Component)LevelGenerator.Instance.LevelPathTruck).transform.position, ((Component)LevelGenerator.Instance.LevelPathTruck).transform.rotation }); CloseSelectMenu(); }; <>c.<>9__37_0 = val2; obj = (object)val2; } ((UnityEvent)onClick).AddListener((UnityAction)obj); ExtractionPoint[] array = Object.FindObjectsByType<ExtractionPoint>((FindObjectsSortMode)0); ExtractionPoint[] array2 = array; foreach (ExtractionPoint entrance in array2) { GameObject val3 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component3 = ((Component)val3.transform.GetChild(0)).GetComponent<TMP_Text>(); component3.text = ((Object)entrance).name; Button component4 = val3.GetComponent<Button>(); ((UnityEvent)component4.onClick).AddListener((UnityAction)delegate { //IL_003b: 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) ((MonoBehaviourPun)Networker.Instance).photonView.RPC("ForceTeleportRPC", (RpcTarget)0, new object[3] { PlayerAvatar.instance.photonView.ViewID, ((Component)entrance).transform.position, ((Component)entrance).transform.rotation }); CloseSelectMenu(); }); } LevelPoint[] array3 = Object.FindObjectsByType<LevelPoint>((FindObjectsSortMode)0); LevelPoint[] array4 = array3; foreach (LevelPoint levelPoint in array4) { GameObject val4 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component5 = ((Component)val4.transform.GetChild(0)).GetComponent<TMP_Text>(); component5.text = ((Object)levelPoint).name; Button component6 = val4.GetComponent<Button>(); ((UnityEvent)component6.onClick).AddListener((UnityAction)delegate { //IL_003b: 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) ((MonoBehaviourPun)Networker.Instance).photonView.RPC("ForceTeleportRPC", (RpcTarget)0, new object[3] { PlayerAvatar.instance.photonView.ViewID, ((Component)levelPoint).transform.position, ((Component)levelPoint).transform.rotation }); CloseSelectMenu(); }); } } public static void jail() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown List<PlayerAvatar> list = SemiFunc.PlayerGetAll(); GameObject val = GameObject.Find("Shop Door"); if ((Object)(object)val == (Object)null) { return; } LevelPoint lp = ((Component)val.transform.parent).GetComponentInChildren<LevelPoint>(); foreach (PlayerAvatar player in list) { GameObject val2 = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component = ((Component)val2.transform.GetChild(0)).GetComponent<TMP_Text>(); component.text = player.playerName; Button component2 = val2.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0041: 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) ((MonoBehaviourPun)Networker.Instance).photonView.RPC("ForceTeleportRPC", (RpcTarget)0, new object[3] { player.photonView.ViewID, ((Component)lp).transform.position, ((Component)lp).transform.rotation }); CloseSelectMenu(); }); } } public static void spawnScrap() { //IL_012a: 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_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown FavoriteEffectManager.FavoriteData favoriteData = FavoriteEffectManager.LoadFavorites(); List<string> favoriteScrapNames = favoriteData.FavoriteScraps; if (Misc.valuablePrefabsByName.Count == 0) { Misc.CacheValuables(); } List<string> list = Misc.valuablePrefabsByName.Keys.ToList(); RepoDice.SuperLog(list.Count.ToString(), (LogLevel)16); list = (from s in list orderby (!favoriteScrapNames.Contains(s)) ? 1 : 0, s select s).ToList(); foreach (string scrap in list) { GameObject val = Object.Instantiate<GameObject>(RepoDice.DebugMenuButtonPrefab, mainScrollContent); TMP_Text component = ((Component)val.transform.GetChild(0)).GetComponent<TMP_Text>(); bool flag = favoriteScrapNames.Contains(scrap); string text = (flag ? "*" : ""); component.text = text + " " + scrap; ((Graphic)component).color = (flag ? FavoriteTextColor : TextColor); Button component2 = val.GetComponent<Button>(); ((UnityEvent)component2.onClick).AddListener((UnityAction)delegate { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) CloseSelectMenu(); Vector3 val2 = ((Component)PlayerAvatar.instance).transform.position + ((Component)PlayerAvatar.instance).transform.forward; ((MonoBehaviourPun)Networker.Instance).photonView.RPC("spawnValuable", (RpcTarget)2, new object[2] { scrap, val2 }); }); RightClickHandler2 rightClickHandler = val.AddComponent<RightClickHandler2>(); rightClickHandler.effectName = scrap; rightClickHandler.category = "FavoriteScraps"; } } } public static class FavoriteEffectManager { public class FavoriteData { public List<string> Favorites { get; set; } = new List<string>(); public List<string> FavoriteEnemies { get; set; } = new List<string>(); public List<string> FavoriteTraps { get; set; } = new List<string>(); public List<string> FavoriteScraps { get; set; } = new List<string>(); public List<string> FavoriteShopItems { get; set; } = new List<string>(); public List<string> FavoriteItems { get; set; } = new List<string>(); } private static readonly string directoryPath = Path.Combine(Application.persistentDataPath, "EmergencyDice"); private static readonly string filePath = Path.Combine(directoryPath, "Favorites.json"); public static FavoriteData LoadFavorites() { if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } if (!File.Exists(filePath)) { Debug.LogWarning((object)("Favorites file not found at " + filePath + ". Returning empty data.")); return new FavoriteData(); } try { string text = File.ReadAllText(filePath); return JsonConvert.DeserializeObject<FavoriteData>(text) ?? new FavoriteData(); } catch { Debug.LogError((object)("Failed to load favorites from " + filePath + ". Returning empty data.")); return new FavoriteData(); } } public static void SaveFavorites(FavoriteData favorites) { if (!Directory.Exists(directoryPath)) { Directory.CreateDirectory(directoryPath); } try { string contents = JsonConvert.SerializeObject((object)favorites, (Formatting)1); File.WriteAllText(filePath, contents); Debug.Log((object)("Favorites successfully saved to " + filePath)); } catch (Exception ex) { Debug.LogError((object)("Failed to save favorites to " + filePath + ". Error: " + ex.Message)); } } } public class DebugMenuController : MonoBehaviour { public GameObject EffectMenu; private InputAction escAction; private void Awake() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown escAction = new InputAction((string)null, (InputActionType)0, "<Keyboard>/escape", (string)null, (string)null, (string)null); escAction.performed += delegate { CloseMenu(); }; escAction.Enable(); } private void OnDestroy() { escAction.Disable(); } public void CloseMenu() { if ((Object)(object)EffectMenu != (Object)null) { Object.Destroy((Object)(object)EffectMenu); EffectMenu = null; Cursor.visible = false; Cursor.lockState = (CursorLockMode)1; } } } public class ColorHelper { public static string AppendTransparency(string hexColor, int percentage) { string text = ((int)Math.Round((double)percentage / 100.0 * 255.0)).ToString("X2"); return hexColor + text; } public static (Color brighter, Color darker) GenerateColors(Color primary) { //IL_0001: 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_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) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(primary, ref num, ref num2, ref num3); float num4 = Mathf.Clamp01(num3 + 0.3f); float num5 = Mathf.Clamp01(num3 * 0.5f); Color item = Color.HSVToRGB(num, num2, num4); Color item2 = Color.HSVToRGB(num, num2, num5); return (item, item2); } public static Color HexToColor(string hex) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) Color result = default(Color); if (ColorUtility.TryParseHtmlString(hex, ref result)) { return result; } throw new Exception("Invalid hex color"); } public static string ColorToHex(Color color) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) return "#" + ColorUtility.ToHtmlStringRGB(color); } public static Color GetEmphasisTextColor(Color background) { //IL_0001: 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_0056: Unknown result type (might be due to invalid IL or missing references) float num = default(float); float num2 = default(float); float num3 = default(float); Color.RGBToHSV(background, ref num, ref num2, ref num3); num = (num + 0.5f) % 1f; num2 = Mathf.Clamp01(num2 + 0.3f); num3 = ((num3 < 0.6f) ? 0.8f : Mathf.Clamp01(1f - num3 * 0.5f)); return Color.HSVToRGB(num, num2, num3); } public static Color GetReadableTextColor(Color background) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) float luminance = GetLuminance(background); return (luminance > 0.5f) ? HexToColor("#1a1100") : Color.white; } public static float GetLuminance(Color color) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) float num = Linearize(color.r); float num2 = Linearize(color.g); float num3 = Linearize(color.b); return 0.2126f * num + 0.7152f * num2 + 0.0722f * num3; } private static float Linearize(float channel) { return (channel <= 0.03928f) ? (channel / 12.92f) : Mathf.Pow((channel + 0.055f) / 1.055f, 2.4f); } } public class Misc : MonoBehaviour { public enum Size { tiny, small, medium, big, wide, tall, veryTall } public enum UpgradeType { health, energy, strength, jumps, speed, range } public static readonly Dictionary<Size, List<PrefabRef>> valuablePrefabsBySize = new Dictionary<Size, List<PrefabRef>>(); public static readonly Dictionary<string, PrefabRef> valuablePrefabsByName = new Dictionary<string, PrefabRef>(); private static List<EnemySetup> cachedEnemies = new List<EnemySetup>(); public static T GetRandomEnum<T>() where T : Enum { Array values = Enum.GetValues(typeof(T)); return (T)values.GetValue(Random.Range(0, values.Length)); } public static void CacheValuables() { valuablePrefabsBySize.Clear(); valuablePrefabsByName.Clear(); if ((Object)(object)RunManager.instance == (Object)null) { RepoDice.Logger.LogError((object)"Failed to cache LevelValuables. RunManager instance is null."); return; } foreach (Level level in RunManager.instance.levels) { foreach (LevelValuables valuablePreset in level.ValuablePresets) { try { Dictionary<Size, List<PrefabRef>> dictionary = new Dictionary<Size, List<PrefabRef>> { { Size.tiny, valuablePreset.tiny }, { Size.small, valuablePreset.small }, { Size.medium, valuablePreset.medium }, { Size.big, valuablePreset.big }, { Size.wide, valuablePreset.wide }, { Size.tall, valuablePreset.tall }, { Size.veryTall, valuablePreset.veryTall } }; foreach (KeyValuePair<Size, List<PrefabRef>> item in dictionary) { if (!valuablePrefabsBySize.TryGetValue(item.Key, out List<PrefabRef> value)) { value = new List<PrefabRef>(); valuablePrefabsBySize[item.Key] = value; } foreach (PrefabRef item2 in item.Value) { if (item2 != null) { RepoDice.SuperLog("Found Valuable Preset: " + item2.prefabName, (LogLevel)16); if (!value.Contains(item2)) { value.Add(item2); } string key = item2.prefabName.ToLower(); if (!valuablePrefabsByName.ContainsKey(key)) { valuablePrefabsByName[key] = item2; } } } } } catch (Exception ex) { RepoDice.Logger.LogWarning((object)("Exception while caching valuables: " + ex.Message)); } } } } public static PrefabRef? GetRandomValuable(Size? size = null) { if (valuablePrefabsBySize.Count == 0) { CacheValuables(); } if (size.HasValue) { if (valuablePrefabsBySize.TryGetValue(size.Value, out List<PrefabRef> value) && value.Count > 0) { return value[Random.Range(0, value.Count)]; } return null; } List<List<PrefabRef>> list = valuablePrefabsBySize.Values.Where((List<PrefabRef> l) => l.Count > 0).ToList(); if (list.Count == 0) { return null; } List<PrefabRef> list2 = list[Random.Range(0, list.Count)]; return list2[Random.Range(0, list2.Count)]; } public static List<PrefabRef>? getValuablesWithName(string name) { string name2 = name; if (valuablePrefabsByName.Count == 0) { CacheValuables(); } return valuablePrefabsByName.Values.Where((PrefabRef x) => x.prefabName.ToLower().Contains(name2.ToLower())).ToList(); } public static PrefabRef? GetValuableByName(string name) { if (valuablePrefabsByName.Count == 0) { CacheValuables(); } PrefabRef value; return valuablePrefabsByName.TryGetValue(name.ToLower(), out value) ? value : null; } public static List<PrefabRef> GetValuablesBySize(Size size) { if (valuablePrefabsBySize.Count == 0) { CacheValuables(); } List<PrefabRef> value; return valuablePrefabsBySize.TryGetValue(size, out value) ? value : new List<PrefabRef>(); } public static PlayerAvatar GetPlayerBySteamID(string id) { string id2 = id; PlayerAvatar val = GameDirector.instance.PlayerList.Find((PlayerAvatar x) => x.steamID == id2); if ((Object)(object)val == (Object)null) { return null; } return val; } public static bool IsValidGround(Vector3 position, float maxDropDistance = 5f, LayerMask? layerMask = null) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: 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_006b: Unknown result type (might be due to invalid IL or missing references) LayerMask val = (LayerMask)(((??)layerMask) ?? LayerMask.op_Implicit(-5)); if (!Physics.Raycast(position, Vector3.down, maxDropDistance, LayerMask.op_Implicit(val))) { return false; } List<PlayerAvatar> playerList = GameDirector.instance.PlayerList; foreach (PlayerAvatar item in playerList) { if (Vector3.Distance(((Component)item).transform.position, position) < 3f) { return false; } } return true; } public static PlayerAvatar GetLocalPlayer() { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if ((Object)(object)player.photonView != (Object)null && player.photonView.IsMine) { return player; } } RepoDice.Logger.LogWarning((object)"Local PlayerAvatar not found!"); return null; } public static bool isGlitchOrConfig() { if (SemiFunc.PlayerGetSteamID(PlayerAvatar.instance) == RepoDice.glitchSteamID || RepoDice.IWannaSeeWhatGlitchSees.Value) { return true; } return false; } public static PlayerAvatar GetRandomPlayer() { List<PlayerAvatar> playerList = GameDirector.instance.PlayerList; if (playerList == null || playerList.Count == 0) { return null; } int index = Random.Range(0, playerList.Count); return playerList[index]; } public static PlayerAvatar? GetRandomAlivePlayer() { List<PlayerAvatar> list = GameDirector.instance.PlayerList.Where((PlayerAvatar x) => (float)x.playerHealth.health > 0f).ToList(); if (list.Count == 0) { return null; } int index = Random.Range(0, list.Count); return list[index]; } public static void SpawnEnemy(string enemyName, int count, Vector3 position, bool isFreebird = false, bool isGlitchy = false, bool fromTry = false, bool hunterStuff = false) { //IL_0418: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0113: 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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: 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_0172: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: 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) string enemyName2 = enemyName; if (RepoDice.ExtendedLogging.Value) { foreach (EnemySetup enemy in getEnemies()) { RepoDice.SuperLog("Enemy Found: " + ((Object)enemy).name, (LogLevel)16); } } try { EnemySetup val = ((IEnumerable<EnemySetup>)getEnemies()).FirstOrDefault((Func<EnemySetup, bool>)((EnemySetup x) => ((Object)x).name == enemyName2)); if ((Object)(object)val == (Object)null) { val = ((IEnumerable<EnemySetup>)getEnemies()).FirstOrDefault((Func<EnemySetup, bool>)((EnemySetup x) => NameContains(x, enemyName2))); } if ((Object)(object)val == (Object)null) { RepoDice.SuperLog(enemyName2 + " not found!", (LogLevel)16); } if (!((Object)(object)val != (Object)null)) { return; } Vector3 val2 = position + Vector3.forward + Vector3.forward; int num = 0; bool flag = IsValidGround(val2); while (!flag) { num++; val2 = position + new Vector3((float)Random.Range(-3, 4), Random.Range(0.8f, 1.8f), (float)Random.Range(-3, 4)); flag = IsValidGround(val2); if (num > 5) { break; } } LevelPoint val3 = SemiFunc.LevelPointGet(position, 4f, 20f); if (!flag) { if ((Object)(object)val3 == (Object)null) { return; } val2 = ((Component)val3).transform.position; } for (int i = 0; i < count; i++) { List<EnemyParent> list = Enemies.SpawnEnemy(val, val2, Quaternion.identity, false); RepoDice.SuperLog($"Spawned {list.Count} enemies for '{enemyName2}'", (LogLevel)16); if (isFreebird) { foreach (EnemyParent item in list) { if (SemiFunc.IsMultiplayer()) { if (SemiFunc.IsMasterClient()) { Networker.Instance.makeFreebirdRpc(((MonoBehaviourPun)item).photonView.ViewID); continue; } ((MonoBehaviourPun)Networker.Instance).photonView.RPC("makeFreebirdRpc", (RpcTarget)1, new object[1] { ((MonoBehaviourPun)item).photonView.ViewID }); } else { Networker.Instance.makeFreebirdRpc(((MonoBehaviourPun)item).photonView.ViewID); } } } if (isGlitchy) { foreach (EnemyParent item2 in list) { ((MonoBehaviourPun)Networker.Instance).photonView.RPC("makeGlassRPC", (RpcTarget)0, new object[3] { ((MonoBehaviourPun)item2).photonView.ViewID, true, true }); } } if (!hunterStuff) { continue; } int shotsAtOnce = Random.Range(8, 15); foreach (EnemyParent item3 in list) { EnemyHunter componentInChildren = ((Component)item3).GetComponentInChildren<EnemyHunter>(); if ((Object)(object)componentInChildren != (Object)null) { FastShooterMono fastShooterMono = ComponentHolderProtocol.AddComponent<FastShooterMono>((Object)(object)((Component)componentInChildren).transform); fastShooterMono.hunter = componentInChildren; fastShooterMono.shotsAtOnce = shotsAtOnce; } else { RepoDice.SuperLog("Hunter " + ((Object)item3).name + " not found!", (LogLevel)16); } } } } catch (Exception ex) { if (!fromTry) { RepoDice.SuperLog("Error with spawning enemy, spawning Animal instead: " + ex, (LogLevel)2); SpawnEnemy("Animal", 1, position, isFreebird, isGlitchy, fromTry: true); } } } public static bool NameContains(EnemySetup enemySetup, string name) { if ((Object)(object)enemySetup == (Object)null) { return false; } if (LooseStringMatch(((Object)enemySetup).name, name)) { return true; } EnemyParent val = null; foreach (PrefabRef item in enemySetup.spawnObjects.Where((PrefabRef x) => x != null).Distinct()) { if (!item.Prefab.TryGetComponent<EnemyParent>(ref val)) { } } if ((Object)(object)val != (Object)null) { if (LooseStringMatch(val.enemyName, name)) { return true; } if (LooseStringMatch(((Object)((Component)val).gameObject).name, name)) { return true; } } return false; } public static void MakeGlass(Material mat, float alpha = 0.3f, bool fucky = false) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: 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_0107: Unknown result type (might be due to invalid IL or missing references) Color color = mat.color; if ((Object)(object)mat == (Object)(object)RepoDice.GlitchyMaterial) { return; } if (fucky) { Shader val = Shader.Find("Autodesk Interactive"); if ((Object)(object)val == (Object)null) { RepoDice.SuperLog("Autodesk Interactive shader not found!", (LogLevel)16); return; } mat.shader = val; } else { Shader val2 = Shader.Find("Standard"); if ((Object)(object)val2 == (Object)null) { RepoDice.SuperLog("Standard shader not found!", (LogLevel)16); return; } mat.shader = val2; } mat.SetFloat("_Mode", 3f); mat.SetInt("_SrcBlend", 5); mat.SetInt("_DstBlend", 10); mat.SetInt("_ZWrite", 0); mat.DisableKeyword("_ALPHATEST_ON"); mat.EnableKeyword("_ALPHABLEND_ON"); mat.DisableKeyword("_ALPHAPREMULTIPLY_ON"); mat.renderQueue = 3000; Color color2 = color; color2.a = alpha; mat.color = color2; } public static ReadOnlyCollection<EnemySetup> getEnemies() { if (cachedEnemies.Count == 0) { List<EnemySetup> list = new List<EnemySetup>(); list.AddRange(EnemyDirector.instance.enemiesDifficulty1); list.AddRange(EnemyDirector.instance.enemiesDifficulty2); list.AddRange(EnemyDirector.instance.enemiesDifficulty3); cachedEnemies = list; } return cachedEnemies.AsReadOnly(); } public static bool LooseStringMatch(string a, string b) { string text = RemoveWhitespace(a).ToLowerInvariant(); string text2 = RemoveWhitespace(b).ToLowerInvariant(); return text == text2; } private static string RemoveWhitespace(string input) { return new string(input.Where((char c) => !char.IsWhiteSpace(c)).ToArray()); } public static void SpawnAndScaleEnemy(string enemyName, int count, Vector3 position, Vector3 scale, bool isGlitchy = false) { //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: 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_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_012c: 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_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: 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_026d: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) string enemyName2 = enemyName; if (RepoDice.ExtendedLogging.Value) { foreach (EnemySetup enemy in getEnemies()) { RepoDice.SuperLog("Enemy Found: " + ((Object)enemy).name, (LogLevel)16); } } try { EnemySetup val = ((IEnumerable<EnemySetup>)getEnemies()).FirstOrDefault((Func<EnemySetup, bool>)((EnemySetup x) => ((Object)x).name == enemyName2)); if ((Object)(object)val == (Object)null) { val = ((IEnumerable<EnemySetup>)getEnemies()).FirstOrDefault((Func<EnemySetup, bool>)((EnemySetup x) => ((Object)x).name.Contains(enemyName2))); } if ((Object)(object)val == (Object)null) { RepoDice.SuperLog(enemyName2 + " not found!", (LogLevel)16); } if (!((Object)(object)val != (Object)null)) { return; } RepoDice.SuperLog("Spawning enemy: " + ((Object)val).name, (LogLevel)16); Vector3 val2 = position + Vector3.forward + Vector3.forward; int num = 0; bool flag = IsValidGround(val2); while (!flag) { num++; val2 = position + new Vector3((float)Random.Range(-3, 4), Random.Range(0.8f, 1.8f), (float)Random.Range(-3, 4)); flag = IsValidGround(val2); if (num > 5) { break; } } LevelPoint val3 = SemiFunc.LevelPointGet(position, 4f, 20f); if (!flag) { if ((Object)(object)val3 == (Object)null) { return; } val2 = ((Component)val3).transform.position; } for (int i = 0; i < count; i++) { List<EnemyParent> list = Enemies.SpawnEnemy(val, val2, Quaternion.identity, false); foreach (EnemyParent item in list) { PhotonView component = ((Component)item).GetComponent<PhotonView>(); if ((Object)(object)component != (Object)null && SemiFunc.IsMasterClientOrSingleplayer()) { if (SemiFunc.IsMultiplayer()) { ((MonoBehaviourPun)Networker.Instance).photonView.RPC("SetScale", (RpcTarget)1, new object[2] { component.ViewID, scale }); } Networker.Instance.SetScale(component.ViewID, scale); } } if (!isGlitchy) { continue; } foreach (EnemyParent item2 in list) { ((MonoBehaviourPun)Networker.Instance).photonView.RPC("makeGlassRPC", (RpcTarget)0, new object[3] { ((MonoBehaviourPun)item2).photonView.ViewID, true, true }); } } } catch (Exception ex) { RepoDice.SuperLog(ex.Message, (LogLevel)2); } } } public class Networker : MonoBehaviourPun { [CompilerGenerated] private sealed class <>c__DisplayClass10_0 { public PlayerAvatar player; internal bool <waitRevive>b__0() { return ((Behaviour)player.playerDeathHead).isActiveAndEnabled; } } [CompilerGenerated] private sealed class <DelayJumpscare>d__12 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public Networker <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <DelayJumpscare>d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(Random.Range(10f, 60f)); <>1__state = 1; return true; case 1: <>1__state = -1; <>4__this.photonView.RPC("doJumpscare", (RpcTarget)0, Array.Empty<object>()); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <delaySave>d__41 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject item; public Networker <>4__this; private ItemAttributes <attributes>5__1; private PhotonView <phtvw>5__2; private int <idx>5__3; private Exception <e>5__4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <delaySave>d__41(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <attributes>5__1 = null; <phtvw>5__2 = null; <e>5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; try { <attributes>5__1 = item.GetComponent<ItemAttributes>(); <phtvw>5__2 = item.GetComponent<PhotonView>(); RepoDice.SuperLog(<attributes>5__1.instanceName, (LogLevel)16); if (!StatsManager.instance.item.ContainsKey(<attributes>5__1.instanceName)) { <idx>5__3 = StatsManager.instance.GetIndexThatHoldsThisItemFromItemDictionary(<attributes>5__1.item.itemName); PunManager.instance.AddingItem(<attributes>5__1.instanceName, <idx>5__3, <phtvw>5__2.ViewID, <attributes>5__1); } StatsManager.instance.itemsPurchased[<attributes>5__1.item.itemName]++; StatsManager.instance.itemsPurchasedTotal[<attributes>5__1.item.itemName]++; <attributes>5__1 = null; <phtvw>5__2 = null; } catch (Exception ex) { <e>5__4 = ex; RepoDice.SuperLog(<e>5__4.Message, (LogLevel)2); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <waitRevive>d__10 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public PlayerAvatar player; public Networker <>4__this; private <>c__DisplayClass10_0 <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <waitRevive>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Expected O, but got Unknown //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>8__1 = new <>c__DisplayClass10_0(); <>8__1.player = player; <>2__current = (object)new WaitUntil((Func<bool>)(() => ((Behaviour)<>8__1.player.playerDeathHead).isActiveAndEnabled)); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; case 2: { <>1__state = -1; PlayerAvatar obj = <>8__1.player; if (obj != null) { obj.Revive(true); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Networker Instance; private PhotonView photonView; private List<string> upgrades = new List<string>(); private List<string> actualUpgradeList = new List<string>(); private void Awake() { if ((Object)(object)Instance != (Object)null && (Object)(object)Instance != (Object)(object)this) { RepoDice.S