Decompiled source of Chaos Mod v1.1.2
plugins/ChaosMod/ChaosMod.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using BepInEx; using ChaosMod.Events; using ChaosMod.UI; using HarmonyLib; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("ChaosMod")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("ChaosMod")] [assembly: AssemblyCopyright("Copyright © 2026")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("8da1cd7b-300c-4747-ac63-98141c78df4b")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8.1", FrameworkDisplayName = ".NET Framework 4.8.1")] [assembly: AssemblyVersion("1.0.0.0")] namespace ChaosMod { [BepInPlugin("nachariah.whiteknuckle.chaosmod", "ChaosMod", "1.1.2")] public class Plugin : BaseUnityPlugin { public const string pluginGuid = "nachariah.whiteknuckle.chaosmod"; public const string pluginVersion = "1.1.2"; private void Awake() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((BaseUnityPlugin)this).Logger.LogInfo((object)"[ChaosMod] Patching..."); Harmony val = new Harmony("nachariah.whiteknuckle.chaosmod"); val.PatchAll(); EventManager.LoadBundle(); EventManager.FillList(); SceneManager.sceneLoaded += OnSceneLoaded; } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (((Scene)(ref scene)).name == "Game-Main") { CommandConsole.hasCheated = true; CL_GameManager.gamemode.allowAchievements = false; CL_GameManager.gamemode.allowCheatedScores = false; Main.GameStart(); if ((Object)(object)EntityHolder.buddy == (Object)null) { EntityHolder.SetVariables(); } } else if (((Scene)(ref scene)).name == "Main-Menu") { ChaosUI.CreateMainMenuText(); } } } public static class Main { private static bool active = false; public static bool hardMode = false; private static float timeMax = 5f; private static float timeLeft; public static void MainUpdate() { if (active) { float num = Time.deltaTime; if (ChaosSettings.easyMode) { num /= 2f; } if (hardMode) { timeLeft -= num * 3f; } else { timeLeft -= num; } if (timeLeft < 0f) { EventManager.RandomEvent(); timeLeft = timeMax; } float timer = timeLeft / timeMax; ChaosUI.instance.SetTimer(timer); } } private static void StartChaos() { EventManager.FillList(); hardMode = CL_GameManager.IsHardmode(); timeLeft = timeMax; ChaosUI.ShowUI(); active = true; } public static void GameStart() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (active) { active = false; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Game-Main") { StartChaos(); } } } public static class ChaosSettings { public static bool easyMode; public static float loggerYOffset; public static float chaosVolume = 1f; public static Dictionary<string, bool> eventEnabled = new Dictionary<string, bool>(); public static void Load() { easyMode = PlayerPrefs.GetInt("Chaos_EasyMode", 0) == 1; loggerYOffset = PlayerPrefs.GetFloat("Chaos_LoggerYOffset", 0f); chaosVolume = PlayerPrefs.GetFloat("Chaos_Volume", 1f); foreach (string item in eventEnabled.Keys.ToList()) { eventEnabled[item] = PlayerPrefs.GetInt("Chaos_Event_" + item, 1) == 1; } } public static void Save() { PlayerPrefs.SetInt("Chaos_EasyMode", easyMode ? 1 : 0); PlayerPrefs.SetFloat("Chaos_LoggerYOffset", loggerYOffset); PlayerPrefs.SetFloat("Chaos_Volume", chaosVolume); foreach (KeyValuePair<string, bool> item in eventEnabled) { PlayerPrefs.SetInt("Chaos_Event_" + item.Key, item.Value ? 1 : 0); } PlayerPrefs.Save(); } } } namespace ChaosMod.UI { public class ChaosUI : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action<bool> <>9__16_0; public static UnityAction <>9__16_3; public static UnityAction <>9__16_4; internal void <CreateOptionsPanel>b__16_0(bool v) { ChaosSettings.easyMode = v; ChaosSettings.Save(); } internal void <CreateOptionsPanel>b__16_3() { ChaosUIHelpers.SetAllToggles(value: true); ChaosSettings.Save(); } internal void <CreateOptionsPanel>b__16_4() { ChaosUIHelpers.SetAllToggles(value: false); ChaosSettings.Save(); } } public static ChaosUI instance; public TMP_FontAsset ticketingFont = null; private GameObject canvasObj; private RectTransform bgRect; private RectTransform fillRect; private RectTransform listRoot; private readonly List<EventEntry> entries = new List<EventEntry>(); public static List<Toggle> EventToggles = new List<Toggle>(); public static void ShowUI() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown if ((Object)(object)instance == (Object)null) { GameObject val = new GameObject("ChaosTimer"); instance = val.AddComponent<ChaosUI>(); instance.CreateUI(); } } private void CreateUI() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0093: 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_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Expected O, but got Unknown //IL_0252: 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_0288: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) canvasObj = new GameObject(); canvasObj.transform.parent = ((Component)this).transform; Canvas val = canvasObj.AddComponent<Canvas>(); val.renderMode = (RenderMode)0; val.sortingOrder = 999; canvasObj.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1; GameObject val2 = new GameObject("Background"); val2.transform.parent = canvasObj.transform; Image val3 = val2.AddComponent<Image>(); ((Graphic)val3).color = new Color(0f, 0f, 0f, 0.3f); bgRect = ((Graphic)val3).rectTransform; bgRect.anchorMin = Vector2.zero; bgRect.anchorMax = Vector2.right; bgRect.pivot = Vector2.right / 2f; bgRect.sizeDelta = new Vector2(0f, 4f); bgRect.anchoredPosition = new Vector2(0f, 0f); GameObject val4 = new GameObject("Background"); val4.transform.parent = val2.transform; Image val5 = val4.AddComponent<Image>(); ((Graphic)val5).color = new Color(1f, 1f, 1f, 0.6f); val5.type = (Type)3; val5.fillMethod = (FillMethod)0; val5.fillOrigin = 0; val5.fillAmount = 0f; fillRect = ((Graphic)val5).rectTransform; fillRect.anchorMin = Vector2.zero; fillRect.anchorMax = Vector2.up; fillRect.pivot = Vector2.up / 2f; RectTransform obj = fillRect; Rect rect = bgRect.rect; obj.sizeDelta = new Vector2(((Rect)(ref rect)).width, 0f); fillRect.anchoredPosition = Vector2.zero; GameObject val6 = new GameObject("EventList"); val6.transform.SetParent(canvasObj.transform, false); listRoot = val6.AddComponent<RectTransform>(); listRoot.anchorMin = new Vector2(1f, 0f); listRoot.anchorMax = new Vector2(1f, 0f); listRoot.pivot = new Vector2(1f, 0f); listRoot.sizeDelta = new Vector2(100f, 0f); listRoot.anchoredPosition = new Vector2(-4f, 25f); ticketingFont = FindTicketingFont(); } public void SetTimer(float value) { //IL_0032: 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_004e: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)fillRect == (Object)null) && !((Object)(object)bgRect == (Object)null)) { value = Mathf.Clamp01(value); Rect rect = bgRect.rect; float width = ((Rect)(ref rect)).width; fillRect.sizeDelta = new Vector2(width * value, 0f); } } public void AddEntry(string name, float time) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown if (!((Object)(object)listRoot == (Object)null)) { GameObject val = new GameObject(name); val.transform.SetParent((Transform)(object)listRoot, false); EventEntry eventEntry = val.AddComponent<EventEntry>(); eventEntry.Wake(name, time, this); entries.Insert(0, eventEntry); RepositionEntries(); } } public void RemoveEntry(EventEntry entry) { if (entries.Remove(entry)) { RepositionEntries(); } } private void RepositionEntries() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) float num = ChaosSettings.loggerYOffset; for (int i = 0; i < entries.Count; i++) { entries[i].SetTargetPosition(new Vector2(0f, num)); num += entries[i].Height + 6f; } } private static TMP_FontAsset FindTicketingFont() { TMP_FontAsset[] array = Resources.FindObjectsOfTypeAll<TMP_FontAsset>(); foreach (TMP_FontAsset val in array) { if (((Object)val).name == "Ticketing SDF") { return val; } } Debug.LogWarning((object)"[Chaos - UI] Ticketing SDF font not found"); return null; } public static void CreateMainMenuText() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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: Expected O, but got Unknown GameObject val = new GameObject("ChaosMainMenuUI"); Canvas val2 = val.AddComponent<Canvas>(); val2.renderMode = (RenderMode)0; val2.sortingOrder = 999; val.AddComponent<CanvasScaler>().uiScaleMode = (ScaleMode)1; val.AddComponent<GraphicRaycaster>(); TMP_FontAsset font = FindTicketingFont(); CreateText(val.transform, "CHAOS MOD v1.1.2", font, 14f, (TextAlignmentOptions)260, new Vector2(1f, 1f), new Vector2(-5f, -30f), new Vector2(250f, 30f)); Button val3 = CreateButton(val.transform, "Chaos Options", font, new Vector2(1f, 0f), new Vector2(-120f, 10f), new Vector2(80f, 16f)); GameObject panel = CreateOptionsPanel(val.transform, font); panel.SetActive(false); ((UnityEvent)val3.onClick).AddListener((UnityAction)delegate { panel.SetActive(!panel.activeSelf); }); } private static GameObject CreateOptionsPanel(Transform parent, TMP_FontAsset font) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_0202: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02de: Unknown result type (might be due to invalid IL or missing references) //IL_02ed: Unknown result type (might be due to invalid IL or missing references) //IL_0330: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Unknown result type (might be due to invalid IL or missing references) //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_0443: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Expected O, but got Unknown //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Expected O, but got Unknown GameObject val = new GameObject("ChaosOptionsPanel"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent<Image>(); ((Graphic)val2).color = new Color(0f, 0f, 0f, 0.75f); RectTransform rectTransform = ((Graphic)val2).rectTransform; Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(1f, 0f); rectTransform.anchorMax = val3; rectTransform.anchorMin = val3; rectTransform.pivot = new Vector2(1f, 0f); rectTransform.sizeDelta = new Vector2(360f, 420f); rectTransform.anchoredPosition = new Vector2(-10f, 30f); CreateToggle(val.transform, "Easy Mode", font, new Vector2(10f, -12.5f), new Vector2(330f, 20f), ChaosSettings.easyMode, delegate(bool v) { ChaosSettings.easyMode = v; ChaosSettings.Save(); }); TMP_Text vLabel = CreateText(val.transform, $"Chaos Volume: {Mathf.RoundToInt(ChaosSettings.chaosVolume * 100f)}%", font, 11f, (TextAlignmentOptions)513, new Vector2(0f, 1f), new Vector2(10f, -35f), new Vector2(240f, 18f)); CreateSlider(val.transform, new Vector2(10f, -55f), new Vector2(330f, 8f), 0f, 1f, ChaosSettings.chaosVolume, delegate(float v) { ChaosSettings.chaosVolume = v; ChaosSettings.Save(); vLabel.text = $"Chaos Volume: {Mathf.RoundToInt(v * 100f)}%"; }); TMP_Text yLabel = CreateText(val.transform, $"Logger Vertical Offset: {ChaosSettings.loggerYOffset}px", font, 11f, (TextAlignmentOptions)513, new Vector2(0f, 1f), new Vector2(10f, -70f), new Vector2(200f, 18f)); CreateSlider(val.transform, new Vector2(10f, -90f), new Vector2(330f, 8f), 0f, 400f, ChaosSettings.loggerYOffset, delegate(float v) { ChaosSettings.loggerYOffset = v; yLabel.text = $"Logger Vertical Offset: {v}px"; ChaosSettings.Save(); }); CreateText(val.transform, "Enabled Events:", font, 11f, (TextAlignmentOptions)513, new Vector2(0f, 1f), new Vector2(10f, -110f), new Vector2(200f, 18f)); RectTransform content; ScrollRect val4 = CreateScrollRect(val.transform, new Vector2(10f, 60f), new Vector2(340f, 230f), out content); EventToggles.Clear(); CreateBlankToggle((Transform)(object)content, "", Vector2.zero, new Vector2(320f, 18f)); foreach (string key in ChaosSettings.eventEnabled.Keys) { string eventName = key; Toggle item = CreateToggle((Transform)(object)content, eventName, font, Vector2.zero, new Vector2(320f, 15f), ChaosSettings.eventEnabled[eventName], delegate(bool v) { ChaosSettings.eventEnabled[eventName] = v; ChaosSettings.Save(); }); EventToggles.Add(item); } CreateBlankToggle((Transform)(object)content, "", Vector2.zero, new Vector2(320f, 18f)); Button val5 = CreateButton(val.transform, "Enable All", font, new Vector2(0f, 0f), new Vector2(10f, 10f), new Vector2(150f, 28f)); ButtonClickedEvent onClick = val5.onClick; object obj = <>c.<>9__16_3; if (obj == null) { UnityAction val6 = delegate { ChaosUIHelpers.SetAllToggles(value: true); ChaosSettings.Save(); }; <>c.<>9__16_3 = val6; obj = (object)val6; } ((UnityEvent)onClick).AddListener((UnityAction)obj); Button val7 = CreateButton(val.transform, "Disable All", font, new Vector2(1f, 0f), new Vector2(-10f, 10f), new Vector2(150f, 28f)); ButtonClickedEvent onClick2 = val7.onClick; object obj2 = <>c.<>9__16_4; if (obj2 == null) { UnityAction val8 = delegate { ChaosUIHelpers.SetAllToggles(value: false); ChaosSettings.Save(); }; <>c.<>9__16_4 = val8; obj2 = (object)val8; } ((UnityEvent)onClick2).AddListener((UnityAction)obj2); return val; } public static TMP_Text CreateText(Transform parent, string text, TMP_FontAsset font, float size, TextAlignmentOptions alignment, Vector2 anchor, Vector2 pos, Vector2 dimensions) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0035: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Text"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); Vector2 anchorMin = (val2.anchorMax = anchor); val2.anchorMin = anchorMin; val2.pivot = anchor; val2.anchoredPosition = pos; val2.sizeDelta = dimensions; TMP_Text val4 = (TMP_Text)(object)val.AddComponent<TextMeshProUGUI>(); val4.text = text; val4.font = font; val4.fontSize = size; val4.alignment = alignment; ((Graphic)val4).color = Color.white; return val4; } private static Button CreateButton(Transform parent, string text, TMP_FontAsset font, Vector2 anchor, Vector2 pos, Vector2 size) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Expected O, but got Unknown //IL_0032: 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) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(text); val.transform.SetParent(parent, false); Image val2 = val.AddComponent<Image>(); ((Graphic)val2).color = new Color(1f, 1f, 1f, 0.1f); Button result = val.AddComponent<Button>(); RectTransform rectTransform = ((Graphic)val2).rectTransform; Vector2 anchorMin = (rectTransform.anchorMax = anchor); rectTransform.anchorMin = anchorMin; rectTransform.pivot = anchor; rectTransform.anchoredPosition = pos; rectTransform.sizeDelta = size; CreateText(val.transform, text, font, 12f, (TextAlignmentOptions)514, new Vector2(0.5f, 0.5f), Vector2.zero, size); return result; } private static void CreateLabel(Transform parent, string text, TMP_FontAsset font, ref float y) { //IL_0018: 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_0033: Unknown result type (might be due to invalid IL or missing references) CreateText(parent, text, font, 12f, (TextAlignmentOptions)513, new Vector2(0f, 1f), new Vector2(10f, y), new Vector2(300f, 20f)); y -= 20f; } public static Toggle CreateBlankToggle(Transform parent, string label, Vector2 pos, Vector2 size) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(label + "_Toggle"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0f, 1f); val2.anchoredPosition = pos; val2.sizeDelta = size; Toggle result = val.AddComponent<Toggle>(); GameObject val4 = new GameObject("Background"); val4.transform.SetParent(val.transform, false); Image val5 = val4.AddComponent<Image>(); ((Graphic)val5).color = new Color(1f, 1f, 1f, 0f); RectTransform rectTransform = ((Graphic)val5).rectTransform; ((Vector2)(ref val3))..ctor(0f, 0.5f); rectTransform.anchorMax = val3; rectTransform.anchorMin = val3; rectTransform.pivot = new Vector2(0f, 0.5f); rectTransform.sizeDelta = new Vector2(14f, 14f); rectTransform.anchoredPosition = new Vector2(4f, 0f); return result; } public static Toggle CreateToggle(Transform parent, string label, TMP_FontAsset font, Vector2 pos, Vector2 size, bool initialValue, Action<bool> onChanged) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: 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_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject(label + "_Toggle"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0f, 1f); val2.anchoredPosition = pos; val2.sizeDelta = size; Toggle val4 = val.AddComponent<Toggle>(); GameObject val5 = new GameObject("Background"); val5.transform.SetParent(val.transform, false); Image val6 = val5.AddComponent<Image>(); ((Graphic)val6).color = new Color(1f, 1f, 1f, 0.2f); RectTransform rectTransform = ((Graphic)val6).rectTransform; ((Vector2)(ref val3))..ctor(0f, 0.5f); rectTransform.anchorMax = val3; rectTransform.anchorMin = val3; rectTransform.pivot = new Vector2(0f, 0.5f); rectTransform.sizeDelta = new Vector2(14f, 14f); rectTransform.anchoredPosition = new Vector2(4f, 0f); GameObject val7 = new GameObject("Checkmark"); val7.transform.SetParent(val5.transform, false); Image val8 = val7.AddComponent<Image>(); ((Graphic)val8).color = Color.white; RectTransform rectTransform2 = ((Graphic)val8).rectTransform; rectTransform2.anchorMin = Vector2.zero; rectTransform2.anchorMax = Vector2.one; val3 = (rectTransform2.offsetMin = (rectTransform2.offsetMax = Vector2.zero)); CreateText(val.transform, label, font, 10f, (TextAlignmentOptions)513, new Vector2(0f, 0.5f), new Vector2(24f, 0f), new Vector2(size.x - 24f, size.y)); ((Selectable)val4).targetGraphic = (Graphic)(object)val6; val4.graphic = (Graphic)(object)val8; val4.isOn = initialValue; ((UnityEvent<bool>)(object)val4.onValueChanged).AddListener((UnityAction<bool>)delegate(bool v) { onChanged(v); }); return val4; } public static ScrollRect CreateScrollRect(Transform parent, Vector2 pos, Vector2 size, out RectTransform content) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0034: 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_004f: 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_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("ScrollRect"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 0f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0f, 0f); val2.anchoredPosition = pos; val2.sizeDelta = size; GameObject val4 = new GameObject("Viewport"); val4.transform.SetParent(val.transform, false); RectTransform val5 = val4.AddComponent<RectTransform>(); val5.anchorMin = Vector2.zero; val5.anchorMax = Vector2.one; val3 = (val5.offsetMin = (val5.offsetMax = Vector2.zero)); val4.AddComponent<RectMask2D>(); GameObject val7 = new GameObject("Content"); val7.transform.SetParent(val4.transform, false); content = val7.AddComponent<RectTransform>(); content.anchorMin = new Vector2(0f, 1f); content.anchorMax = new Vector2(1f, 1f); content.pivot = new Vector2(0.5f, 1f); content.anchoredPosition = Vector2.zero; content.sizeDelta = Vector2.zero; VerticalLayoutGroup val8 = val7.AddComponent<VerticalLayoutGroup>(); ((HorizontalOrVerticalLayoutGroup)val8).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val8).childForceExpandHeight = false; ((HorizontalOrVerticalLayoutGroup)val8).spacing = 15f; ContentSizeFitter val9 = val7.AddComponent<ContentSizeFitter>(); val9.verticalFit = (FitMode)2; ScrollRect val10 = val.AddComponent<ScrollRect>(); val10.viewport = val5; val10.content = content; val10.horizontal = false; return val10; } public static Slider CreateSlider(Transform parent, Vector2 pos, Vector2 size, float min, float max, float value, Action<float> onChanged) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00ef: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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_0150: 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_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Expected O, but got Unknown //IL_0194: 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_01b5: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Slider"); val.transform.SetParent(parent, false); RectTransform val2 = val.AddComponent<RectTransform>(); Vector2 val3 = default(Vector2); ((Vector2)(ref val3))..ctor(0f, 1f); val2.anchorMax = val3; val2.anchorMin = val3; val2.pivot = new Vector2(0f, 1f); val2.anchoredPosition = pos; val2.sizeDelta = size; Slider val4 = val.AddComponent<Slider>(); val4.minValue = min; val4.maxValue = max; val4.value = value; ((UnityEvent<float>)(object)val4.onValueChanged).AddListener((UnityAction<float>)delegate(float v) { onChanged(v); }); Image val5 = val.AddComponent<Image>(); ((Graphic)val5).color = new Color(1f, 1f, 1f, 0.15f); ((Selectable)val4).targetGraphic = (Graphic)(object)val5; GameObject val6 = new GameObject("Fill"); val6.transform.SetParent(val.transform, false); Image val7 = val6.AddComponent<Image>(); ((Graphic)val7).color = Color.white; RectTransform rectTransform = ((Graphic)val7).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = new Vector2(0f, 1f); val3 = (rectTransform.offsetMin = (rectTransform.offsetMax = Vector2.zero)); val4.fillRect = rectTransform; GameObject val9 = new GameObject("Handle"); val9.transform.SetParent(val.transform, false); Image val10 = val9.AddComponent<Image>(); ((Graphic)val10).color = Color.white; RectTransform rectTransform2 = ((Graphic)val10).rectTransform; rectTransform2.sizeDelta = new Vector2(10f, size.y); val4.handleRect = rectTransform2; return val4; } } internal static class ChaosUIHelpers { public static void SetAllToggles(bool value) { foreach (Toggle eventToggle in ChaosUI.EventToggles) { eventToggle.SetIsOnWithoutNotify(value); ((UnityEvent<bool>)(object)eventToggle.onValueChanged).Invoke(value); } } } public class EventEntry : MonoBehaviour { private ChaosUI owner; private RectTransform rect; private RectTransform timerFill; private TextMeshProUGUI label; private bool awake = false; private float timeLeft = 20f; private float eventTimer = 0f; private float eventTimerMax = 0f; private Vector2 targetPos; private float height = 18f; public float Height => height; public void Wake(string name, float time, ChaosUI ownerUI) { owner = ownerUI; awake = true; eventTimerMax = time; eventTimer = time; CreateEntryUI(name); } private void CreateEntryUI(string name) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: 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_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_014d: 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_0179: Expected O, but got Unknown //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) rect = ((Component)this).gameObject.AddComponent<RectTransform>(); rect.anchorMin = Vector2.one; rect.anchorMax = Vector2.one; rect.pivot = Vector2.one; rect.sizeDelta = new Vector2(350f, height); rect.anchoredPosition = Vector2.zero; GameObject val = new GameObject("Text"); val.transform.SetParent(((Component)this).transform, false); label = val.AddComponent<TextMeshProUGUI>(); ((TMP_Text)label).text = name; if ((Object)(object)owner.ticketingFont != (Object)null) { ((TMP_Text)label).font = owner.ticketingFont; } ((TMP_Text)label).fontSize = 10f; ((TMP_Text)label).alignment = (TextAlignmentOptions)4100; ((Graphic)label).color = Color.white; RectTransform rectTransform = ((TMP_Text)label).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.offsetMin = new Vector2(6f, 2f); rectTransform.offsetMax = new Vector2(-12f, -2f); if (eventTimerMax > 0f) { GameObject val2 = new GameObject("Timer"); val2.transform.SetParent(((Component)this).transform, false); Image val3 = val2.AddComponent<Image>(); ((Graphic)val3).color = new Color(0f, 0f, 0f, 0.6f); RectTransform rectTransform2 = ((Graphic)val3).rectTransform; rectTransform2.anchorMin = Vector2.right; rectTransform2.anchorMax = Vector2.one; rectTransform2.pivot = new Vector2(1f, 0.5f); rectTransform2.sizeDelta = new Vector2(8f, 0f); rectTransform2.anchoredPosition = new Vector2(-2f, 0f); GameObject val4 = new GameObject("Fill"); val4.transform.SetParent(val2.transform, false); Image val5 = val4.AddComponent<Image>(); ((Graphic)val5).color = new Color(1f, 1f, 1f, 0.6f); timerFill = ((Graphic)val5).rectTransform; timerFill.anchorMin = Vector2.zero; timerFill.anchorMax = Vector2.right; timerFill.pivot = Vector2.right / 2f; RectTransform obj = timerFill; Rect val6 = rectTransform2.rect; obj.sizeDelta = new Vector2(0f, ((Rect)(ref val6)).height); timerFill.anchoredPosition = Vector2.zero; } } public void SetTargetPosition(Vector2 pos) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) targetPos = pos; } private void Update() { //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: 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) if (awake) { if (timeLeft > 0f) { timeLeft -= Time.deltaTime; } if (eventTimer > 0f) { eventTimer -= Time.deltaTime; } if ((Object)(object)timerFill != (Object)null && eventTimerMax > 0f) { float num = Mathf.Clamp01(eventTimer / eventTimerMax); Rect val = rect.rect; float num2 = ((Rect)(ref val)).height; timerFill.sizeDelta = new Vector2(0f, num2 * num); } rect.anchoredPosition = Vector2.Lerp(rect.anchoredPosition, targetPos, Time.deltaTime * 12f); if (timeLeft <= 0f && eventTimer <= 0f) { owner.RemoveEntry(this); Object.Destroy((Object)(object)((Component)this).gameObject); } } } } } namespace ChaosMod.Patches { [HarmonyPatch(typeof(ENT_Player), "Update")] public static class ENT_Player_Update_Patch { [HarmonyPostfix] private static void Postfix(ENT_Player __instance) { Main.MainUpdate(); } } [HarmonyPatch(typeof(ENT_Player), "OnControllerColliderHit")] public static class ENT_Player_Hit_Patch { [HarmonyPostfix] private static void Postfix(ENT_Player __instance, ControllerColliderHit hit) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Expected O, but got Unknown //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown if ((Object)(object)hit.gameObject.GetComponent<PirateAI>() != (Object)null) { DeathType val = new DeathType(); val.deathText = "DEAD MEN TELL NO TALES"; CL_GameManager.gMan.deathTypes[0] = val; EventManager.PlayAudio((AudioClip)EventManager.prefabs["ShipCollide"], 0.85f); ((GameEntity)__instance).Kill(""); } else if ((Object)(object)hit.gameObject.GetComponent<TrainAI>() != (Object)null) { DeathType val2 = new DeathType(); val2.deathText = "TOO MUCH OLD SPICE"; CL_GameManager.gMan.deathTypes[0] = val2; EventManager.PlayAudio((AudioClip)EventManager.prefabs["TrainHit"], 0.75f, 0.9f); ((GameEntity)__instance).Kill(""); } else if ((Object)(object)hit.gameObject.GetComponent<ShrekAI>() != (Object)null) { Vector3 val3 = ((Component)__instance).transform.position - hit.transform.position; ((GameEntity)__instance).AddForce(((Vector3)(ref val3)).normalized * 20f, ""); if (((GameEntity)__instance).health - 1f <= 0f) { DeathType val4 = new DeathType(); val4.deathText = "SHREKT"; CL_GameManager.gMan.deathTypes[0] = val4; EventManager.PlayAudio((AudioClip)EventManager.prefabs["ShipCollide"], 0.8f); ((GameEntity)__instance).Kill(""); } else { ((GameEntity)__instance).Damage(1f, ""); } } } } } namespace ChaosMod.Events { public class EventManager : MonoBehaviour { private static readonly List<Event> Events = new List<Event>(); public static Dictionary<string, Object> prefabs = new Dictionary<string, Object>(); public static AssetBundle chaosBundle = null; public static void FillList() { Events.Clear(); Events.Add(default(Event).SetEntry("Perk Overdose", 0f, PerkOverdose)); Events.Add(default(Event).SetEntry("Bloodbug Infestation", 0f, BloodbugHorde)); Events.Add(default(Event).SetEntry("House M.D.", 30f, SpawnHouseMD)); Events.Add(default(Event).SetEntry("Random Perk", 0f, RandomPerk)); Events.Add(default(Event).SetEntry("Random Item", 0f, RandomItem)); Events.Add(default(Event).SetEntry("You are playing in IRON KNUCKLE mode. No perks for you!", 0f, IronKnuckle)); Events.Add(default(Event).SetEntry("Jumpscare!", 0f, Jumpscare)); Events.Add(default(Event).SetEntry("It's Turbo Time!", 0f, TurboTime)); Events.Add(default(Event).SetEntry("FEAST MODE ACTIVATED", 20f, FeastMode)); Events.Add(default(Event).SetEntry("Roach Rain", 20f, SkyDiamonds)); Events.Add(default(Event).SetEntry("Yarr Harr", 0f, PirateShip)); Events.Add(default(Event).SetEntry("Yahoo!", 0f, PlayerLaunch)); Events.Add(default(Event).SetEntry("Will you be my buddy?", 0f, SpawnBuddies)); Events.Add(default(Event).SetEntry("Moving Day", 0f, SpawnFurniture)); Events.Add(default(Event).SetEntry("Old Spice Train", 0f, OldSpiceTrain)); Events.Add(default(Event).SetEntry("Advertisement", 4f, JoeBiden)); Events.Add(default(Event).SetEntry("The Red Carpet", 0f, RedCarpet)); Events.Add(default(Event).SetEntry("Prop Magnet", 0f, PropMagnet)); Events.Add(default(Event).SetEntry("Spawn Shrek", 0f, SpawnShrek)); Events.Add(default(Event).SetEntry("Spawn a Face", 0f, SpawnFace)); Events.Add(default(Event).SetEntry("Gift Rain", 10f, HappyBirthday)); Events.Add(default(Event).SetEntry("BBQ CHICKEN ALERT", 12f, BBQChickenAlert)); Events.Add(default(Event).SetEntry("Double Event!", 0f, DoubleRandomEvent)); foreach (Event @event in Events) { if (!ChaosSettings.eventEnabled.ContainsKey(@event.name)) { ChaosSettings.eventEnabled.Add(@event.name, value: true); } } ChaosSettings.Load(); } public static void RandomEvent(bool ignoreDouble = false) { if ((Object)(object)chaosBundle == (Object)null) { LoadBundle(); } if (Events.Count == 0) { FillList(); } bool value; List<Event> list = Events.Where((Event e) => ChaosSettings.eventEnabled.TryGetValue(e.name, out value) && value).ToList(); if (list.Count != 0) { int num = list.Count; if (ignoreDouble) { num--; } Event @event = list[Random.Range(0, num)]; ChaosUI.instance.AddEntry(@event.name, @event.time); @event.action?.Invoke(); } } public static void LoadBundle() { string location = Assembly.GetExecutingAssembly().Location; string directoryName = Path.GetDirectoryName(location); string text = Path.Combine(directoryName, "chaosassets"); if (!File.Exists(text)) { Debug.LogError((object)("[ChaosMod] AssetBundle not found: " + text)); return; } chaosBundle = AssetBundle.LoadFromFile(text); if ((Object)(object)chaosBundle == (Object)null) { Debug.LogError((object)"[ChaosMod] Failed to load ChaosMod AssetBundle - Make sure it's in the same folder as the .dll file and it's named 'chaosassets'"); return; } Debug.Log((object)"[ChaosMod] AssetBundle Loaded!"); prefabs["House"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("House"); prefabs["Jumpscare"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("Jumpscare"); prefabs["TurboTime"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("TurboTime"); prefabs["FeastMode"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("FeastMode"); prefabs["SkyDiamonds"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("SkyDiamonds"); prefabs["PirateShip"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("PirateShip"); prefabs["ShipCollide"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("ShipCollide"); prefabs["Yahoo"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("Yahoo"); prefabs["Train"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("Train"); prefabs["OldSpice1"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice1"); prefabs["OldSpice2"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice2"); prefabs["OldSpice3"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("OldSpice3"); prefabs["TrainHit"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("TrainHit"); prefabs["JoeBiden"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("JoeBiden"); prefabs["BDay"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("BDay"); prefabs["BBQChicken"] = (Object)(object)chaosBundle.LoadAsset<AudioClip>("BBQChickenAudio"); prefabs["BBQChickenPlatform"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("BBQChickenPlatform"); prefabs["Shrek"] = (Object)(object)chaosBundle.LoadAsset<GameObject>("Shrek"); } public static void PlayAudio(AudioClip clip, float distortion = 0f, float volume = 1f) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)clip == (Object)null)) { GameObject val = new GameObject(((Object)clip).name); val.transform.position = ((Component)ENT_Player.playerObject).transform.position; AudioSource val2 = val.AddComponent<AudioSource>(); val2.clip = clip; val2.volume = volume * ChaosSettings.chaosVolume; if (distortion > 0f) { AudioDistortionFilter val3 = val.AddComponent<AudioDistortionFilter>(); val3.distortionLevel = distortion; } val2.Play(); Object.Destroy((Object)(object)val, clip.length); } } private static void PerkOverdose() { Perk val = CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets.Count)]; for (int i = 0; i < 10; i++) { ENT_Player.GetPlayer().AddPerk(val, 1); } } private static void BloodbugHorde() { for (int i = 0; i < 10; i++) { CL_GameManager.gMan.SpawnEntity(new string[1] { "denizen_bloodbug" }); } } private static void SpawnHouseMD() { //IL_0010: 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_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["House"], ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 10f, Quaternion.identity); Shader val2 = Shader.Find("Unlit/Unlit Transparent Color"); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)"[ChaosMod] Could not find game shader!"); return; } Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(); foreach (Renderer val3 in componentsInChildren) { Material[] materials = val3.materials; foreach (Material val4 in materials) { val4.shader = val2; } } AudioSource component = val.GetComponent<AudioSource>(); component.volume *= ChaosSettings.chaosVolume; ((Component)component).gameObject.AddComponent<AudioDistortionFilter>().distortionLevel = 0.1f; val.AddComponent<HouseAI>(); } private static void RandomPerk() { ENT_Player.GetPlayer().AddPerk(CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().perkAssets.Count)], 1); } private static void RandomItem() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) Object.Instantiate<GameObject>(CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[Random.Range(0, CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs.Count)], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity); } private static void IronKnuckle() { ENT_Player.GetPlayer().RemoveAllPerks(); } private static void Jumpscare() { //IL_0010: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0036: 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) GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["Jumpscare"], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity); Transform transform = val.transform; transform.localScale *= 6f; AudioSource componentInChildren = ((Component)val.transform).GetComponentInChildren<AudioSource>(); componentInChildren.volume *= ChaosSettings.chaosVolume; VideoPlayer componentInChildren2 = val.GetComponentInChildren<VideoPlayer>(); componentInChildren2.Play(); Renderer component = val.GetComponent<Renderer>(); component.material.shader = chaosBundle.LoadAsset<Shader>("VideoOverlay"); val.AddComponent<VideoOverlayThinker>(); Object.Destroy((Object)(object)val, 0.25f); } private static void TurboTime() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) PlayAudio((AudioClip)prefabs["TurboTime"], 0.1f); ((GameEntity)ENT_Player.playerObject).AddForce(Vector3.up * 30f, ""); } private static void FeastMode() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown PlayAudio((AudioClip)prefabs["FeastMode"], 0.05f); GameObject val = new GameObject(); val.AddComponent<FeastModeThinker>(); } private static void SkyDiamonds() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown PlayAudio((AudioClip)prefabs["SkyDiamonds"], 0.05f); GameObject val = new GameObject(); val.AddComponent<RoachRain>(); } private static void PirateShip() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["PirateShip"]); val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + Vector3.up * 400f; AudioSource component = val.GetComponent<AudioSource>(); component.volume *= ChaosSettings.chaosVolume; val.GetComponent<AudioDistortionFilter>().distortionLevel = 0.9f; val.AddComponent<PirateAI>(); GameObject gameObject = ((Component)val.transform.GetChild(0)).gameObject; IndicatorThinker indicatorThinker = gameObject.AddComponent<IndicatorThinker>(); Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(true); Renderer[] array = componentsInChildren; foreach (Renderer val2 in array) { Material[] materials = val2.materials; foreach (Material val3 in materials) { val3.EnableKeyword("_EMISSION"); val3.SetColor("_EmissionColor", Color.white * 0.75f); } } } private static void PlayerLaunch() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0034: 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) //IL_004d: 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) PlayAudio((AudioClip)prefabs["Yahoo"], 0.2f); ((GameEntity)ENT_Player.playerObject).AddForce(((Component)ENT_Player.GetPlayer()).transform.forward * 7f + Vector3.up * 2f, ""); } private static void SpawnBuddies() { //IL_000b: 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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)ENT_Player.GetPlayer()).transform.position; if ((Object)(object)EntityHolder.buddy == (Object)null) { EntityHolder.SetVariables(); } float num = 6f; if (Main.hardMode) { num = 15f; } for (int i = 0; (float)i < num; i++) { GameObject val = Object.Instantiate<GameObject>(EntityHolder.buddy, ((Component)CL_EventManager.currentLevel).transform); float num2 = 2f; if (Random.value > 0.5f) { num2 = 0f - num2; } val.transform.position = position + new Vector3(Random.Range(-3f, 3f), num2, Random.Range(-3f, 3f)); } } private static void SpawnFurniture() { //IL_00c1: 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_00d4: Unknown result type (might be due to invalid IL or missing references) if (EntityHolder.propList.Count == 0) { EntityHolder.SetVariables(); } float num = 15f; if (Main.hardMode) { num = 30f; } for (int i = 0; (float)i < num; i++) { GameObject val = Object.Instantiate<GameObject>(EntityHolder.propList[Random.Range(0, EntityHolder.propList.Count)], ((Component)CL_EventManager.currentLevel).transform); float num2 = Random.Range(1f, 3f); float num3 = Random.Range(1f, 3f); if (Random.value > 0.5f) { num2 = 0f - num2; } if (Random.value > 0.5f) { num3 = 0f - num3; } val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + new Vector3(num2, 0f, num3); } } private static void OldSpiceTrain() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["Train"]); Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 normalized = ((Vector2)(ref insideUnitCircle)).normalized; Vector3 val2 = new Vector3(normalized.x, 0f, normalized.y); Vector3 normalized2 = ((Vector3)(ref val2)).normalized; val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + Vector3.up / 2f + normalized2 * 200f; val.transform.rotation = Quaternion.LookRotation(-normalized2, Vector3.up) * Quaternion.Euler(-90f, 0f, 0f); Renderer[] components = ((Component)val.transform).GetComponents<Renderer>(); Renderer[] array = components; foreach (Renderer val3 in array) { Material[] materials = val3.materials; foreach (Material val4 in materials) { val4.EnableKeyword("_EMISSION"); val4.SetColor("_EmissionColor", Color.red * 1f); } } AudioSource component = val.GetComponent<AudioSource>(); component.volume *= ChaosSettings.chaosVolume; component.clip = (AudioClip)prefabs["OldSpice" + Random.Range(1, 4)]; val.AddComponent<AudioDistortionFilter>().distortionLevel = 0.85f; component.Play(); val.AddComponent<TrainAI>(); GameObject gameObject = ((Component)val.transform.GetChild(0)).gameObject; gameObject.AddComponent<LookAtCamera>(); GameObject gameObject2 = ((Component)val.transform.GetChild(1)).gameObject; IndicatorThinker indicatorThinker = gameObject2.AddComponent<IndicatorThinker>(); indicatorThinker.baseScale = 0.002f; indicatorThinker.disappearingDistance = 40f; Shader shader = Shader.Find("Unlit/Unlit Transparent Color"); Renderer[] componentsInChildren = gameObject.GetComponentsInChildren<Renderer>(); foreach (Renderer val5 in componentsInChildren) { Material[] materials2 = val5.materials; foreach (Material val6 in materials2) { val6.shader = shader; } } } private static void JoeBiden() { //IL_0010: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_0036: 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) GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["JoeBiden"], ((Component)ENT_Player.playerObject).transform.position, Quaternion.identity); Transform transform = val.transform; transform.localScale *= 5f; AudioSource componentInChildren = val.GetComponentInChildren<AudioSource>(); componentInChildren.volume *= ChaosSettings.chaosVolume; VideoPlayer componentInChildren2 = val.GetComponentInChildren<VideoPlayer>(); componentInChildren2.Play(); Renderer component = val.GetComponent<Renderer>(); component.material.shader = chaosBundle.LoadAsset<Shader>("VideoOverlay"); val.AddComponent<VideoOverlayThinker>(); Object.Destroy((Object)(object)val, 4f); } private static void RedCarpet() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)EntityHolder.explosiveRoach == (Object)null) { EntityHolder.SetVariables(); } Transform transform = ((Component)ENT_Player.GetPlayer()).transform; int num = 3; if (Main.hardMode) { num = 4; } for (float num2 = -num; num2 < (float)num; num2 += 1f) { for (float num3 = -num; num3 < (float)num; num3 += 1f) { Object.Instantiate<GameObject>(EntityHolder.explosiveRoach, transform.position + transform.forward + new Vector3(num2 / (float)num, -0.5f, num3 / (float)num), Quaternion.identity, ((Component)CL_EventManager.currentLevel).transform); } } } private static void HappyBirthday() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown PlayAudio((AudioClip)prefabs["BDay"], 0.1f); GameObject val = new GameObject(); val.AddComponent<GiftRain>(); } private static void BBQChickenAlert() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown PlayAudio((AudioClip)prefabs["BBQChicken"], 0.65f); GameObject val = new GameObject(); val.AddComponent<BBQChickenThinker>(); } private static void DoubleRandomEvent() { RandomEvent(ignoreDouble: true); RandomEvent(ignoreDouble: true); } private static void SpawnFace() { //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_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)EntityHolder.face == (Object)null) { EntityHolder.SetVariables(); } GameObject val = Object.Instantiate<GameObject>(EntityHolder.face); val.transform.position = ((Component)ENT_Player.GetPlayer()).transform.position + Vector3.down * 30f; } private static void SpawnShrek() { //IL_0010: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown GameObject val = Object.Instantiate<GameObject>((GameObject)prefabs["Shrek"], ((Component)Camera.main).transform.position + Vector3.down * 15f, Quaternion.identity); Shader val2 = Shader.Find("Unlit/Unlit Transparent Color"); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)"[ChaosMod] Could not find game shader!"); return; } Renderer[] componentsInChildren = val.GetComponentsInChildren<Renderer>(); foreach (Renderer val3 in componentsInChildren) { Material[] materials = val3.materials; foreach (Material val4 in materials) { val4.shader = val2; } } AudioSource component = val.GetComponent<AudioSource>(); component.volume *= ChaosSettings.chaosVolume; ((Component)component).gameObject.GetComponent<AudioDistortionFilter>().distortionLevel = 0.6f; val.AddComponent<ShrekAI>(); } private static void PropMagnet() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: 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_006a: Unknown result type (might be due to invalid IL or missing references) List<CL_Prop> list = Object.FindObjectsByType<CL_Prop>((FindObjectsSortMode)0).ToList(); foreach (CL_Prop item in list) { Rigidbody component = ((Component)((Component)item).transform).GetComponent<Rigidbody>(); if ((Object)(object)component != (Object)null) { component.AddForce((((Component)ENT_Player.GetPlayer()).transform.position - ((Component)item).transform.position) * 150f * component.mass); } } } } public struct Event { public string name; public float time; public Action action; public Event SetEntry(string name, float time, Action action) { this.name = name; this.time = time; this.action = action; return this; } } public class HouseAI : MonoBehaviour { private float timeLeft = 30f; private void Update() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_006d: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.position; ((Vector3)(ref val)).Normalize(); ((Component)this).transform.rotation = Quaternion.LookRotation(val, Vector3.up) * Quaternion.Euler(90f, 0f, 0f); if (Main.hardMode) { val *= 3f; } Transform transform = ((Component)this).transform; transform.position += val * 3f * Mathf.Clamp(Vector3.Distance(((Component)this).transform.position, ((Component)Camera.main).transform.position) / 20f, 1f, 10f) * Time.deltaTime; timeLeft -= Time.deltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class VideoOverlayThinker : MonoBehaviour { private void LateUpdate() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)Camera.main == (Object)null)) { ((Component)this).transform.position = ((Component)Camera.main).transform.position + ((Component)Camera.main).transform.forward * 8f; Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.position; ((Component)this).transform.rotation = Quaternion.LookRotation(((Vector3)(ref val)).normalized, Vector3.up) * Quaternion.Euler(90f, 0f, 0f); } } } public class FeastModeThinker : MonoBehaviour { private float timeLeft = 20f; private float nextTick = 20f; private static Transform player; private static GameObject beans; private static GameObject bar; private static GameObject cookie; private void Awake() { if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).gameObject.transform; } if (!((Object)(object)beans == (Object)null) && !((Object)(object)bar == (Object)null)) { return; } for (int i = 0; i < CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs.Count; i++) { if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]).name.ToLower() == "item_beans") { beans = CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]; } else if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]).name.ToLower() == "item_food_bar") { bar = CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]; } else if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]).name.ToLower() == "item_food_cookie") { cookie = CL_AssetManager.GetFullCombinedAssetDatabase().itemPrefabs[i]; } } } private void Update() { if (nextTick >= timeLeft) { DropFood(); nextTick -= 0.35f; } timeLeft -= Time.deltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } private void DropFood() { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) GameObject val = beans; float value = Random.value; if (value > 0.8f) { val = bar; } else if (value > 0.7f) { val = cookie; } GameObject val2 = Object.Instantiate<GameObject>(val); val2.transform.position = player.position + new Vector3(Random.Range(-2f, 2f), -1f, Random.Range(-2f, 2f)); val2.transform.parent = ((Component)CL_EventManager.currentLevel).transform; } } public class RoachRain : MonoBehaviour { private float timeLeft = 20f; private float nextTick = 20f; private static Transform player; private static GameObject roach; private void Awake() { if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).gameObject.transform; } if (!((Object)(object)roach == (Object)null)) { return; } for (int i = 0; i < CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs.Count; i++) { if (((Object)CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs[i]).name.ToLower() == "denizen_roach_platinum") { roach = CL_AssetManager.GetFullCombinedAssetDatabase().entityPrefabs[i]; break; } } } private void Update() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (nextTick >= timeLeft) { GameObject val = Object.Instantiate<GameObject>(roach); val.transform.position = player.position + new Vector3(Random.Range(-5f, 5f), 8f, Random.Range(-5f, 5f)); val.transform.parent = ((Component)CL_EventManager.currentLevel).transform; nextTick -= 0.15f; } timeLeft -= Time.deltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class PirateAI : MonoBehaviour { public static Transform player; private bool pDead = false; private AudioSource song = null; private void Awake() { if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).transform; } song = ((Component)this).gameObject.GetComponent<AudioSource>(); } private void Update() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Expected O, but got Unknown //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) if (Main.hardMode) { Transform transform = ((Component)this).transform; transform.position -= Vector3.up * 50f * Time.deltaTime; } else { Transform transform2 = ((Component)this).transform; transform2.position -= Vector3.up * 30f * Time.deltaTime; } float num = player.position.y - ((Component)this).transform.position.y; if (Vector3.Distance(player.position, ((Component)this).transform.position) < 2.5f && !pDead) { pDead = true; DeathType val = new DeathType(); val.deathText = "DEAD MEN TELL NO TALES"; CL_GameManager.gMan.deathTypes[0] = val; ((GameEntity)ENT_Player.GetPlayer()).Kill(""); EventManager.PlayAudio((AudioClip)EventManager.prefabs["ShipCollide"], 0.85f); } if (num < -50f) { ((Component)this).transform.position = new Vector3(player.position.x, ((Component)this).transform.position.y, player.position.z); } if (num > 400f && (Object)(object)song != (Object)null && song.volume > 0f) { AudioSource obj = song; obj.volume -= Time.deltaTime / 4f; } if (num > 800f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class TrainAI : MonoBehaviour { private static Transform player; private AudioSource song = null; private Vector3 dir = Vector3.up; private bool pDead = false; private bool passed = false; private void Awake() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).transform; } song = ((Component)((Component)this).transform).GetComponent<AudioSource>(); Vector3 val = player.position + Vector3.up / 2f - ((Component)this).transform.position; dir = ((Vector3)(ref val)).normalized; } private void Update() { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_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_0021: 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_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Expected O, but got Unknown //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) if (Main.hardMode) { Transform transform = ((Component)this).transform; transform.position += dir * 75f * Time.deltaTime; } else { Transform transform2 = ((Component)this).transform; transform2.position += dir * 50f * Time.deltaTime; } ((Component)this).transform.rotation = Quaternion.LookRotation(dir, Vector3.up) * Quaternion.Euler(-90f, 0f, 0f); float num = Vector3.Distance(((Component)this).transform.position, player.position + Vector3.up / 2f); if (!pDead && !passed) { ((Component)((Component)this).transform).GetComponent<AudioDistortionFilter>().distortionLevel = Mathf.Clamp(num / 1000f, 0f, 0.2f) + 0.75f; } if (Vector3.Distance(((Component)this).transform.position + Vector3.up / 2f, player.position) < 1.5f && !pDead && !((GameEntity)ENT_Player.GetPlayer()).IsDead()) { pDead = true; DeathType val = new DeathType(); val.deathText = "TOO MUCH OLD SPICE"; CL_GameManager.gMan.deathTypes[0] = val; EventManager.PlayAudio((AudioClip)EventManager.prefabs["TrainHit"], 0.75f, 0.9f); song.volume = 0.75f; ((GameEntity)ENT_Player.GetPlayer()).Kill(""); } if (num > 40f && !passed) { Vector3 val2 = player.position + Vector3.up / 2f - ((Component)this).transform.position; val2.y /= 2f; dir = ((Vector3)(ref val2)).normalized; } else { passed = true; } if (num > 40f && passed && (Object)(object)song != (Object)null && song.volume > 0f) { AudioDistortionFilter component = ((Component)((Component)this).transform).GetComponent<AudioDistortionFilter>(); component.distortionLevel -= Time.deltaTime / 5f; } if (num > 600f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class LookAtCamera : MonoBehaviour { private void Update() { //IL_0011: 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_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_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) ((Component)this).transform.rotation = Quaternion.LookRotation(((Component)Camera.main).transform.position - ((Component)this).transform.position, Vector3.up) * Quaternion.Euler(90f, 0f, 0f); } } public class GiftRain : MonoBehaviour { private float timeLeft = 10f; private float nextTick = 10f; private static Transform player; private void Awake() { if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).gameObject.transform; } if (EntityHolder.giftList.Count == 0) { EntityHolder.SetVariables(); } } private void Update() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (nextTick >= timeLeft) { GameObject val = Object.Instantiate<GameObject>(EntityHolder.giftList[Random.Range(0, EntityHolder.giftList.Count)]); val.transform.position = player.position + new Vector3(Random.Range(-5f, 5f), 8f, Random.Range(-5f, 5f)); val.transform.parent = ((Component)CL_EventManager.currentLevel).transform; nextTick -= 0.35f; } timeLeft -= Time.deltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class BBQChickenThinker : MonoBehaviour { private float waitTime = 3f; private float timeLeft = 9f; private float nextTick = 9f; private static Transform player; private List<GameObject> platforms = new List<GameObject>(); private static Shader matShader; private void Awake() { if ((Object)(object)player == (Object)null) { player = ((Component)ENT_Player.GetPlayer()).gameObject.transform; } if ((Object)(object)matShader == (Object)null) { matShader = Shader.Find("Unlit/Unlit Transparent Color"); } } private void Update() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (waitTime > 0f) { waitTime -= Time.deltaTime; return; } if (nextTick >= timeLeft) { Vector2 insideUnitCircle = Random.insideUnitCircle; Vector2 val = ((Vector2)(ref insideUnitCircle)).normalized * 3f; GameObject val2 = Object.Instantiate<GameObject>((GameObject)EventManager.prefabs["BBQChickenPlatform"]); val2.transform.position = player.position + new Vector3(val.x, Random.Range(-2f, 6f), val.y); val2.AddComponent<LookAtCamera>(); platforms.Add(val2); Renderer[] componentsInChildren = val2.GetComponentsInChildren<Renderer>(); foreach (Renderer val3 in componentsInChildren) { Material[] materials = val3.materials; foreach (Material val4 in materials) { val4.shader = matShader; } } nextTick -= 0.2f; } timeLeft -= Time.deltaTime; if (!(timeLeft <= 0f)) { return; } foreach (GameObject platform in platforms) { Object.Destroy((Object)(object)platform); } Object.Destroy((Object)(object)((Component)this).gameObject); } } public class ShrekAI : MonoBehaviour { private float timeLeft = 25f; private Vector3 moveDir = Vector3.zero; private void Update() { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) Vector3 val = ((Component)Camera.main).transform.position - ((Component)this).transform.position; ((Vector3)(ref val)).Normalize(); ((Component)this).transform.rotation = Quaternion.LookRotation(val, Vector3.up) * Quaternion.Euler(90f, 0f, 0f); if (Main.hardMode) { moveDir = Vector3.Lerp(moveDir, val, Time.deltaTime * 1.5f); } else { moveDir = Vector3.Lerp(moveDir, val, Time.deltaTime / 1.5f); } float num = 12f; if (Main.hardMode) { num = 15f; } Transform transform = ((Component)this).transform; transform.position += moveDir * num * Time.deltaTime; timeLeft -= Time.deltaTime; if (timeLeft <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } public class IndicatorThinker : MonoBehaviour { public float baseScale = 1f; public float disappearingDistance = 25f; private Vector3 pLast = Vector3.zero; 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) pLast = ((Component)Camera.main).transform.position; } private void Update() { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0012: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_00b7: Unknown result type (might be due to invalid IL or missing references) pLast = Vector3.Lerp(pLast, ((Component)Camera.main).transform.position, 0.2f); ((Component)this).transform.rotation = Quaternion.LookRotation(pLast - ((Component)this).transform.position, Vector3.up) * Quaternion.Euler(90f, 0f, 0f); float num = Vector3.Distance(((Component)this).transform.position, ((Component)Camera.main).transform.position); ((Compon