using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using CompanyProtocols.Networking; using CompanyProtocols.TerminalPatches; using GameMecanicOverhaul; using GameNetcodeStuff; using HarmonyLib; using LethalNetworkAPI; using LethalReplacementCrew; using Microsoft.CodeAnalysis; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("LethalCompanyProtocols")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("LethalCompanyProtocols")] [assembly: AssemblyTitle("LethalCompanyProtocols")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } [HarmonyPatch(typeof(HUDManager))] public class ClockPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateClockFluidly() { if ((Object)(object)TimeOfDay.Instance == (Object)null || (Object)(object)HUDManager.Instance?.clockNumber == (Object)null || HUDManager.Instance.Clock.canvasGroup.alpha <= 0f) { return; } float normalizedTimeOfDay = TimeOfDay.Instance.normalizedTimeOfDay; int num = (int)(normalizedTimeOfDay * 1080f); int num2 = num / 60 + 6; int num3 = num % 60; if (num2 >= 24) { ((TMP_Text)HUDManager.Instance.clockNumber).text = "12:00 AM"; return; } string arg = ((num2 >= 12) ? "PM" : "AM"); int num4 = num2 % 12; if (num4 == 0) { num4 = 12; } ((TMP_Text)HUDManager.Instance.clockNumber).text = $"{num4}:{num3:00} {arg}"; } } [HarmonyPatch(typeof(StartOfRound), "ShipHasLeft")] public class EnemyCalculator { [HarmonyPrefix] private static void Prefix() { Plugin.IndoorEnemyNames.Clear(); Plugin.OutdoorEnemyNames.Clear(); EnemyAI[] array = Object.FindObjectsOfType(); EnemyAI[] array2 = array; foreach (EnemyAI val in array2) { if (!val.isEnemyDead) { string enemyName = val.enemyType.enemyName; if (val.isOutside) { Plugin.OutdoorEnemyNames.Add(enemyName); } else { Plugin.IndoorEnemyNames.Add(enemyName); } } } } } namespace CompanyProtocols.TerminalPatches { [HarmonyPatch(typeof(Terminal), "TextPostProcess")] public class TerminalDisplayPatch { [HarmonyPostfix] private static void Postfix(Terminal __instance, ref string __result) { //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Invalid comparison between Unknown and I4 //IL_0223: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrEmpty(__result) || Plugin.ChosenMoonNames == null || !__result.Contains("Welcome to the exomoons catalogue")) { return; } LandingTimeManager.GenerateLandingTimes(); StringBuilder stringBuilder = new StringBuilder(); stringBuilder.AppendLine("\n\n\n"); stringBuilder.AppendLine("[ COMPANY TARGETS - ASSIGNED MISSIONS ]"); stringBuilder.AppendLine("---------------------------------------------------\n"); IOrderedEnumerable orderedEnumerable = from m in __instance.moonsCatalogueList where Plugin.ChosenMoonNames.Contains(((Object)m).name) && !Plugin.VisitedMoonNames.Contains(((Object)m).name) orderby GetRiskScore(m.riskLevel) select m; if (!orderedEnumerable.Any()) { stringBuilder.AppendLine("ALL TARGETS CLEARED.\nNo further missions available."); } else { foreach (SelectableLevel item in orderedEnumerable) { string arg = "8.0h"; if (LandingTimeManager.MoonLandingTimes.TryGetValue(((Object)item).name, out MoonTimeData value)) { string text = ((value.Type == LandingTimeType.Early) ? "#00FFFF" : ((value.Type != LandingTimeType.Late) ? "#FFFFFF" : "#FFA500")); string text2 = LandingTimeManager.FormatTimeToClock(value.TargetHour); arg = "" + text2 + ""; } stringBuilder.AppendLine("> " + item.PlanetName.ToUpper() + ""); string arg2 = (((int)item.currentWeather != -1) ? "#FFFF00" : "#FFFFFF"); stringBuilder.AppendLine($"RISK: {item.riskLevel.PadRight(4)} | SCRAP: {item.minScrap}-{item.maxScrap} (${(int)CalculateMoonScrapAverage(item)})"); stringBuilder.AppendLine($"INFO: {item.currentWeather} ({arg})"); stringBuilder.AppendLine(" "); stringBuilder.AppendLine(""); } } stringBuilder.AppendLine("---------------------------------------------------"); stringBuilder.AppendLine("[ Type moon name to route the ship ]\n"); __result = stringBuilder.ToString(); } private static int GetRiskScore(string risk) { if (string.IsNullOrEmpty(risk)) { return 0; } if (risk.Contains("S")) { return 5; } if (risk.Contains("A")) { return 4; } if (risk.Contains("B")) { return 3; } if (risk.Contains("C")) { return 2; } if (risk.Contains("D")) { return 1; } return 1; } public static float CalculateMoonScrapAverage(SelectableLevel level) { if ((Object)(object)level == (Object)null || level.spawnableScrap == null || level.spawnableScrap.Count == 0) { return 0f; } float num = 0f; int num2 = 0; foreach (SpawnableItemWithRarity item in level.spawnableScrap) { num2 += item.rarity; } for (int i = 0; i < 500; i++) { int num3 = Random.Range(level.minScrap, level.maxScrap + 1); for (int j = 0; j < num3; j++) { num += GetWeightedRandomScrapValue(level.spawnableScrap, num2); } } return num / 500f; } private static float GetWeightedRandomScrapValue(List pool, int totalWeight) { int num = Random.Range(0, totalWeight); int num2 = 0; foreach (SpawnableItemWithRarity item in pool) { num2 += item.rarity; if (num < num2) { float num3 = Random.Range(item.spawnableItem.minValue, item.spawnableItem.maxValue); return num3 * 0.4f; } } return 0f; } } [HarmonyPatch(typeof(Terminal), "Start")] public class TerminalPricePatch { [HarmonyPostfix] private static void Postfix(Terminal __instance) { TerminalKeyword val = ((IEnumerable)__instance.terminalNodes.allKeywords).FirstOrDefault((Func)((TerminalKeyword k) => k.word == "route")); if (!((Object)(object)val != (Object)null)) { return; } CompatibleNoun[] compatibleNouns = val.compatibleNouns; foreach (CompatibleNoun val2 in compatibleNouns) { if (!((Object)(object)val2.result != (Object)null)) { continue; } val2.result.itemCost = 0; if (val2.result.terminalOptions == null) { continue; } CompatibleNoun[] terminalOptions = val2.result.terminalOptions; foreach (CompatibleNoun val3 in terminalOptions) { if ((Object)(object)val3.result != (Object)null) { val3.result.itemCost = 0; } } } } } } namespace CompanyProtocols.Networking { public class Networking { public LNetworkVariable ChosenMoonsVar; public LNetworkVariable VisitedMoonsVar; public LNetworkVariable MoonSeedsVar; public LNetworkMessage HudAlertMsg; public LNetworkMessage RequestSyncMsg; public LNetworkMessage SyncQuotaMsg; public static Networking Instance { get; private set; } public Networking() { Instance = this; Plugin.Log.LogInfo((object)"[GMO Networking] Starting Initialization..."); try { ChosenMoonsVar = LNetworkVariable.Connect("GMO_ChosenMoons", new string[0], (LNetworkVariableWritePerms)0, (Action)delegate(string[] oldVal, string[] newVal) { if (newVal != null) { Plugin.ChosenMoonNames.Clear(); Plugin.ChosenMoonNames = newVal.ToList(); } }); VisitedMoonsVar = LNetworkVariable.Connect("GMO_VisitedMoons", new string[0], (LNetworkVariableWritePerms)0, (Action)delegate(string[] oldVal, string[] newVal) { if (newVal != null) { Plugin.VisitedMoonNames.Clear(); Plugin.VisitedMoonNames = newVal.ToList(); } }); MoonSeedsVar = LNetworkVariable.Connect("GMO_MoonSeeds", new int[0], (LNetworkVariableWritePerms)0, (Action)delegate(int[] oldVal, int[] newVal) { if (newVal != null) { Plugin.MoonSeeds.Clear(); Plugin.MoonSeeds = newVal.ToList(); LandingTimeManager.GenerateLandingTimes(); } }); SyncQuotaMsg = LNetworkMessage.Connect("GMO_SyncQuota", (Action)null, (Action)null, (Action)null); Plugin.Log.LogInfo((object)"[GMO Networking] Variables connected."); HudAlertMsg = LNetworkMessage.Connect("GMO_HudAlert", (Action)null, (Action)null, (Action)null); RequestSyncMsg = LNetworkMessage.Connect("GMO_RequestSync", (Action)null, (Action)null, (Action)null); Plugin.Log.LogInfo((object)"[GMO Networking] Messages connected."); SyncQuotaMsg.OnClientReceived += delegate(int newQuota) { Plugin.Log.LogInfo((object)$"[GMO NetMsg] Syncing quota fulfilled: {newQuota}"); TimeOfDay.Instance.quotaFulfilled = newQuota; TimeOfDay.Instance.UpdateProfitQuotaCurrentTime(); }; HudAlertMsg.OnClientReceived += delegate(string moonName) { Plugin.Log.LogInfo((object)("[GMO NetMsg] Received HUD Alert for: " + moonName)); if ((Object)(object)HUDManager.Instance != (Object)null) { HUDManager.Instance.DisplayTip("DESTINATION CHANGED", "The Company deploys you on " + moonName + " !", true, false, "LC_Tip1"); } else { Plugin.Log.LogWarning((object)"[GMO NetMsg] HUDManager.Instance is NULL, cannot display alert."); } }; RequestSyncMsg.OnServerReceived += delegate(int val, ulong clientId) { Plugin.Log.LogInfo((object)$"[GMO NetMsg] Server received Sync Request from Client ID: {clientId}"); if ((Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsServer) { Plugin.Log.LogInfo((object)"[GMO NetMsg] Processing sync for client..."); ChosenMoonsVar.Value = Plugin.ChosenMoonNames.ToArray(); VisitedMoonsVar.Value = Plugin.VisitedMoonNames.ToArray(); MoonSeedsVar.Value = Plugin.MoonSeeds.ToArray(); } else { Plugin.Log.LogWarning((object)"[GMO NetMsg] RequestSync received but this peer is not the Server."); } }; Plugin.Log.LogInfo((object)"[GMO Networking] All handlers hooked successfully."); } catch (Exception ex) { Plugin.Log.LogError((object)("[GMO Networking] CRITICAL ERROR DURING INIT: " + ex.Message + "\n" + ex.StackTrace)); } } public static void Init() { if (Instance == null) { Plugin.Log.LogInfo((object)"[GMO Networking] Initializing Singleton..."); new Networking(); } } } [HarmonyPatch(typeof(StartOfRound))] public class NetworkLifeCycle { [HarmonyPatch("Start")] [HarmonyPrefix] public static void SyncOnStartHost(StartOfRound __instance) { if (NetworkManager.Singleton.IsConnectedClient) { Networking.Instance.RequestSyncMsg.SendServer((int)NetworkManager.Singleton.LocalClientId); } } } } namespace LethalReplacementCrew { [HarmonyPatch] public class ReplacementCrewHandler : MonoBehaviour { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Func <>9__11_0; public static Func <>9__11_1; public static Func <>9__12_0; public static Func <>9__12_1; public static Func <>9__15_0; public static Func <>9__15_1; public static HandleNamedMessageDelegate <>9__20_0; public static HandleNamedMessageDelegate <>9__20_1; internal bool b__11_0(Item item) { return item.isScrap && (Object)(object)item.spawnPrefab != (Object)null; } internal bool b__11_1(PlayerControllerB p) { return p.isPlayerControlled; } internal bool b__12_0(SpawnableEnemyWithRarity e) { return e.enemyType.enemyName.Contains("Masked"); } internal bool b__12_1(PlayerControllerB p) { return p.isPlayerControlled; } internal bool b__15_0(SpawnableEnemyWithRarity e) { return e.enemyType.enemyName.Contains("Masked"); } internal bool b__15_1(PlayerControllerB p) { return p.isPlayerControlled; } internal void b__20_0(ulong senderId, FastBufferReader reader) { //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) if (!NetworkManager.Singleton.IsServer) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Quaternion rot = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); SpawnFakeShipLocal(pos, rot); } } internal void b__20_1(ulong senderId, FastBufferReader reader) { if (!NetworkManager.Singleton.IsServer) { ShowIntrusionAlertLocal(); } } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject ship; public Rigidbody rb; public float delay; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)rb != (Object)null) { rb.isKinematic = true; rb.useGravity = false; Physics.SyncTransforms(); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private GameObject[] 5__1; private Transform 5__2; private Vector3 5__3; private Vector3 5__4; private Quaternion 5__5; private GameObject 5__6; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__1 = null; 5__2 = null; 5__6 = null; <>1__state = -2; } private bool MoveNext() { //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Expected O, but got Unknown //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = GameObject.FindGameObjectsWithTag("OutsideAINode"); if (5__1 == null || 5__1.Length == 0) { return false; } 5__2 = 5__1[Random.Range(0, 5__1.Length)].transform; 5__3 = 5__2.position; 5__4 = 5__3 + Vector3.up * heightOffset; SendAlertToAllClients(); 5__5 = Quaternion.Euler(0f, 5__2.eulerAngles.y, 0f); 5__6 = SpawnFakeShipLocal(5__4, 5__5); SyncShipToClients(5__4, 5__5); <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(10f); <>1__state = 2; return true; case 2: <>1__state = -1; SpawnScrapScattered(5__3, 8f); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 3; return true; case 3: <>1__state = -1; SpawnMaskedOnGround(5__3, 6f); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static float heightOffset = 40f; private const string SHIP_SPAWN_MESSAGE = "ReplacementCrew_SpawnShip"; private const string HUD_ALERT_MESSAGE = "ReplacementCrew_HUDAlert"; public static GameObject FakeShipPrefab = null; private static bool hasEventOccurredThisLevel = false; private static int lastCheckedHour = -1; [HarmonyPatch(typeof(RoundManager), "FinishGeneratingLevel")] [HarmonyPostfix] private static void ResetLevelStatus() { hasEventOccurredThisLevel = false; lastCheckedHour = -1; } [HarmonyPatch(typeof(TimeOfDay), "Update")] [HarmonyPostfix] private static void CheckTimeForEvent(TimeOfDay __instance) { if (!NetworkManager.Singleton.IsServer || hasEventOccurredThisLevel) { return; } if (StartOfRound.Instance.inShipPhase || (Object)(object)StartOfRound.Instance.currentLevel == (Object)null) { lastCheckedHour = -1; return; } float num = 7.85f; string name = ((Object)StartOfRound.Instance.currentLevel).name; if (LandingTimeManager.MoonLandingTimes.TryGetValue(name, out MoonTimeData value)) { num = value.TargetHour; } float num2 = 6f + __instance.normalizedTimeOfDay * 18f; int num3 = (int)num2; if (num2 >= num + 4f && num3 != lastCheckedHour && num3 % 2 == 0) { lastCheckedHour = num3; if (Random.value < 0.025f) { hasEventOccurredThisLevel = true; ((MonoBehaviour)RoundManager.Instance).StartCoroutine(ExecuteEventSequence()); } } } [IteratorStateMachine(typeof(d__8))] private static IEnumerator ExecuteEventSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0); } private static void ShowIntrusionAlertLocal() { EventHUDUtility.DisplayWarning("EMERGENCY ATMOSPHERIC ALERT", "UNIDENTIFIED VESSEL DETECTED\nINTRUSION IN LUNAR AIRSPACE", HUDManager.Instance.meteorShowerWarningAudio); } private static Vector3 GetGuaranteedNavMeshPosition(Vector3 center, float radius, int maxAttempts = 30) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: 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_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_0080: 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_0099: Unknown result type (might be due to invalid IL or missing references) NavMeshHit val3 = default(NavMeshHit); for (int i = 0; i < maxAttempts; i++) { Vector2 val = Random.insideUnitCircle * radius; Vector3 val2 = center + new Vector3(val.x, 0f, val.y); if (NavMesh.SamplePosition(val2, ref val3, 2f, -1)) { return ((NavMeshHit)(ref val3)).position; } } NavMeshHit val4 = default(NavMeshHit); if (NavMesh.SamplePosition(center, ref val4, 5f, -1)) { Debug.LogWarning((object)"[GMO] Fallback to snapped center for NavMesh."); return ((NavMeshHit)(ref val4)).position; } Debug.LogError((object)"[GMO] Impossible de trouver un point NavMesh, spawn forcé au point brut !"); return center; } private static void SpawnScrapScattered(Vector3 centerNodePos, float spawnRadius) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: 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_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer) { return; } List list = StartOfRound.Instance.allItemsList.itemsList.Where((Item item) => item.isScrap && (Object)(object)item.spawnPrefab != (Object)null).ToList(); if (list.Count == 0) { return; } int num = StartOfRound.Instance.allPlayerScripts.Count((PlayerControllerB p) => p.isPlayerControlled); int num2 = Random.Range(Mathf.Max(1, num / 2), num + 1); List list2 = new List(); List list3 = new List(); for (int i = 0; i < num2; i++) { Item val = list[Random.Range(0, list.Count)]; Vector3 guaranteedNavMeshPosition = GetGuaranteedNavMeshPosition(centerNodePos, spawnRadius); guaranteedNavMeshPosition += Vector3.up * 0.5f; GameObject val2 = Object.Instantiate(val.spawnPrefab, guaranteedNavMeshPosition, Quaternion.identity); NetworkObject component = val2.GetComponent(); if ((Object)(object)component != (Object)null) { component.Spawn(false); int num3 = (int)((float)Random.Range(val.minValue, val.maxValue) * 0.4f); GrabbableObject component2 = val2.GetComponent(); if ((Object)(object)component2 != (Object)null) { component2.targetFloorPosition = guaranteedNavMeshPosition - Vector3.up * 0.5f; component2.SetScrapValue(num3); list2.Add(NetworkObjectReference.op_Implicit(component)); list3.Add(num3); } } } if (list2.Count > 0) { RoundManager.Instance.SyncScrapValuesClientRpc(list2.ToArray(), list3.ToArray()); } } private static void SpawnMaskedOnGround(Vector3 centerNodePos, float spawnRadius) { //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (!NetworkManager.Singleton.IsServer) { return; } EnemyType val = ((IEnumerable)RoundManager.Instance.currentLevel.Enemies).FirstOrDefault((Func)((SpawnableEnemyWithRarity e) => e.enemyType.enemyName.Contains("Masked")))?.enemyType; if (!((Object)(object)val == (Object)null)) { int num = StartOfRound.Instance.allPlayerScripts.Count((PlayerControllerB p) => p.isPlayerControlled); for (int i = 0; i < num; i++) { Vector3 guaranteedNavMeshPosition = GetGuaranteedNavMeshPosition(centerNodePos, spawnRadius); RoundManager.Instance.SpawnEnemyGameObject(guaranteedNavMeshPosition, 0f, -1, val); } } } private static GameObject SpawnFakeShipLocal(Vector3 pos, Quaternion rot) { //IL_001b: 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) if ((Object)(object)FakeShipPrefab == (Object)null) { LoadAssets(); } GameObject val = Object.Instantiate(FakeShipPrefab, pos, rot); SetLayerRecursive(val, 8); Rigidbody component = val.GetComponent(); component.mass = 5000f; component.useGravity = true; component.isKinematic = false; component.collisionDetectionMode = (CollisionDetectionMode)1; GameObject val2 = GameObject.Find("Environment"); if ((Object)(object)val2 != (Object)null) { val.transform.SetParent(val2.transform); } ((MonoBehaviour)RoundManager.Instance).StartCoroutine(DisablePhysicsAfterDelay(val, component, 10f)); return val; } [IteratorStateMachine(typeof(d__14))] private static IEnumerator DisablePhysicsAfterDelay(GameObject ship, Rigidbody rb, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { ship = ship, rb = rb, delay = delay }; } private static void SpawnMaskedOnGround(Vector3 groundPos, Vector3 AINode) { //IL_0085: 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_00b3: 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_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) EnemyType val = ((IEnumerable)RoundManager.Instance.currentLevel.Enemies).FirstOrDefault((Func)((SpawnableEnemyWithRarity e) => e.enemyType.enemyName.Contains("Masked")))?.enemyType; if ((Object)(object)val == (Object)null) { return; } int num = StartOfRound.Instance.allPlayerScripts.Count((PlayerControllerB p) => p.isPlayerControlled); NavMeshHit val3 = default(NavMeshHit); for (int i = 0; i < num; i++) { Vector3 val2 = groundPos + new Vector3(Random.Range(-3f, 3f), 0f, Random.Range(-3f, 3f)); if (NavMesh.SamplePosition(val2, ref val3, 10f, -1)) { RoundManager.Instance.SpawnEnemyGameObject(((NavMeshHit)(ref val3)).position, 0f, -1, val); } else { RoundManager.Instance.SpawnEnemyGameObject(AINode, 0f, -1, val); } } } private static void SetLayerRecursive(GameObject obj, int newLayer) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown obj.layer = newLayer; foreach (Transform item in obj.transform) { Transform val = item; SetLayerRecursive(((Component)val).gameObject, newLayer); } } private static void SendAlertToAllClients() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) if (NetworkManager.Singleton.IsServer) { NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("ReplacementCrew_HUDAlert", new FastBufferWriter(0, (Allocator)2, -1), (NetworkDelivery)3); ShowIntrusionAlertLocal(); } } private static void SyncShipToClients(Vector3 pos, Quaternion rot) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(28, (Allocator)2, -1); ((FastBufferWriter)(ref val)).WriteValueSafe(ref pos); ((FastBufferWriter)(ref val)).WriteValueSafe(ref rot); NetworkManager.Singleton.CustomMessagingManager.SendNamedMessageToAll("ReplacementCrew_SpawnShip", val, (NetworkDelivery)3); } public static void LoadAssets() { string directoryName = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); AssetBundle val = AssetBundle.LoadFromFile(Path.Combine(directoryName, "fakeshipevent")); if ((Object)(object)val != (Object)null) { FakeShipPrefab = val.LoadAsset("FakeShip"); } } [HarmonyPatch(typeof(StartOfRound), "Start")] [HarmonyPostfix] private static void RegisterNetworkMessages() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown if ((Object)(object)NetworkManager.Singleton == (Object)null) { return; } CustomMessagingManager customMessagingManager = NetworkManager.Singleton.CustomMessagingManager; object obj = <>c.<>9__20_0; if (obj == null) { HandleNamedMessageDelegate val = delegate(ulong senderId, FastBufferReader reader) { //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) if (!NetworkManager.Singleton.IsServer) { Vector3 pos = default(Vector3); ((FastBufferReader)(ref reader)).ReadValueSafe(ref pos); Quaternion rot = default(Quaternion); ((FastBufferReader)(ref reader)).ReadValueSafe(ref rot); SpawnFakeShipLocal(pos, rot); } }; <>c.<>9__20_0 = val; obj = (object)val; } customMessagingManager.RegisterNamedMessageHandler("ReplacementCrew_SpawnShip", (HandleNamedMessageDelegate)obj); CustomMessagingManager customMessagingManager2 = NetworkManager.Singleton.CustomMessagingManager; object obj2 = <>c.<>9__20_1; if (obj2 == null) { HandleNamedMessageDelegate val2 = delegate { if (!NetworkManager.Singleton.IsServer) { ShowIntrusionAlertLocal(); } }; <>c.<>9__20_1 = val2; obj2 = (object)val2; } customMessagingManager2.RegisterNamedMessageHandler("ReplacementCrew_HUDAlert", (HandleNamedMessageDelegate)obj2); } } } namespace LethalCompanyProtocols { internal class LagFixer { [HarmonyPatch(typeof(StartOfRound), "StartGame")] [HarmonyPrefix] private static void SpeedUpLoading() { Application.backgroundLoadingPriority = (ThreadPriority)4; GC.Collect(); } [HarmonyPatch(typeof(RoundManager), "GenerateLevel")] [HarmonyPrefix] private static void PreGenerateLevel() { QualitySettings.asyncUploadBufferSize = 64; } } } namespace GameMecanicOverhaul { [HarmonyPatch(typeof(StartOfRound), "ArriveAtLevel")] public class AutoLandingPatch { [HarmonyPostfix] private static void Postfix(StartOfRound __instance) { if (NetworkManager.Singleton.IsServer && Plugin.IsDiverting) { __instance.StartGameServerRpc(); } } } [HarmonyPatch(typeof(EndRoundStatsPatch), "ReplaceEndGameScreen")] public class DayEndPatch { [HarmonyPrefix] private static void Prefix() { ScrapTracker.CalculateCollectedScrap(); Plugin.PlayersRegistry.Clear(); int num = 0; bool flag = false; PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts; foreach (PlayerControllerB val in allPlayerScripts) { if (!val.isPlayerControlled && !val.isPlayerDead) { continue; } bool flag2 = !val.isPlayerDead && (val.isInHangarShipRoom || val.isInElevator); if (flag2) { flag = true; } string causeOfDeath = "None"; if (val.isPlayerDead) { causeOfDeath = ((object)(CauseOfDeath)(ref val.causeOfDeath)).ToString(); } else if (!flag2) { causeOfDeath = "Abandoned"; } Plugin.PlayersRegistry[val.playerClientId] = new Plugin.PlayerData { PlayerName = val.playerUsername, IsAlive = flag2, Health = val.health, CauseOfDeath = causeOfDeath }; if (flag2) { continue; } if (val.isPlayerDead) { if ((Object)(object)val.deadBody == (Object)null || !val.deadBody.isInShip) { num++; } } else { num++; } } if (!flag) { Plugin.collectedScrapSurLune = 0; Plugin.collectedNB = 0; } Terminal val2 = Object.FindObjectOfType(); int num2 = (((Object)(object)val2 != (Object)null) ? val2.groupCredits : 0); int num3 = num2; for (int j = 0; j < num; j++) { num3 -= Mathf.CeilToInt((float)num3 * 0.2f); } Plugin.TeamsPenalty = num2 - num3; } } [HarmonyPatch(typeof(DeleteFileButton), "DeleteFile")] public class DeletePatch { [HarmonyPrefix] private static void Prefix(DeleteFileButton __instance) { int fileToDelete = __instance.fileToDelete; if (1 == 0) { } string text = fileToDelete switch { 0 => "LCSaveFile1", 1 => "LCSaveFile2", 2 => "LCSaveFile3", _ => "LCSaveFile1", }; if (1 == 0) { } string text2 = text; string path = Path.Combine(Application.persistentDataPath, text2 + "_gmo.txt"); try { if (File.Exists(path)) { File.Delete(path); } } catch (Exception ex) { Debug.LogError((object)("[GMO] Error deleting custom save files: " + ex.Message)); } } } [HarmonyPatch(typeof(GameNetworkManager))] public class DisconnectPatch { [HarmonyPatch("ResetGameValuesToDefault")] [HarmonyPostfix] public static void ResetVariablesOnDisconnect() { Plugin.CurrentRunMultiplier = 1f; Plugin.collectedScrapSurLune = 0; Plugin.totalScrapSurLune = 0; Plugin.TeamsPenalty = 0; Plugin.collectedNB = 0; Plugin.allNB = 0; Plugin.IsDiverting = false; Plugin.VisitedMoonNames.Clear(); Plugin.ChosenMoonNames.Clear(); Plugin.MoonSeeds.Clear(); LandingTimeManager.LandingTimePatch.IsTimeAppliedForToday = false; } } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public class EndRoundPatch { [HarmonyPrefix] public static void Prefix() { if (StartOfRound.Instance.currentLevelID != 3) { Plugin.VisitedMoonNames.Add(((Object)StartOfRound.Instance.currentLevel).name); LandingTimeManager.GenerateLandingTimes(); } } } [HarmonyPatch(typeof(HUDManager), "FillEndGameStats")] public class EndRoundStatsPatch { [HarmonyPrefix] public static bool ReplaceEndGameScreen(HUDManager __instance, EndOfGameStats stats) { if ((Object)(object)GMO_UIManager.Instance == (Object)null) { GMO_UIManager.Instance = ((Component)__instance).gameObject.AddComponent(); GMO_UIManager.Instance.Initialize(); } HUDManager.Instance.RemoveSpectateUI(); if (StartOfRound.Instance.currentLevelID != 3) { GMO_UIManager.Instance.ShowResults(stats); } return false; } } public static class EventHUDUtility { [CompilerGenerated] private sealed class d__8 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private float 5__1; private float 5__2; private float 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__1 = 0f; goto IL_0086; case 1: <>1__state = -1; goto IL_0086; case 2: <>1__state = -1; goto IL_0102; case 3: { <>1__state = -1; break; } IL_0086: if (5__1 < 0.2f) { 5__1 += Time.deltaTime; _canvasGroup.alpha = 5__1 / 0.2f; <>2__current = null; <>1__state = 1; return true; } 5__2 = 0f; goto IL_0102; IL_0102: if (5__2 < 8f) { 5__2 += Time.deltaTime; 5__3 = 0.75f + Mathf.Sin(Time.time * 10f) * 0.25f; ((TMP_Text)_titleText).alpha = 5__3; <>2__current = null; <>1__state = 2; return true; } 5__1 = 0f; break; } if (5__1 < 0.5f) { 5__1 += Time.deltaTime; _canvasGroup.alpha = 1f - 5__1 / 0.5f; <>2__current = null; <>1__state = 3; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static GameObject _warningCanvasObj; private static TextMeshProUGUI _titleText; private static TextMeshProUGUI _bodyText; private static CanvasGroup _canvasGroup; public static void DisplayWarning(string title, string body, AudioClip sfx = null) { if (!((Object)(object)HUDManager.Instance == (Object)null)) { if ((Object)(object)_warningCanvasObj == (Object)null) { BuildWarningUI(); } ((TMP_Text)_titleText).text = title; ((TMP_Text)_bodyText).text = body; if ((Object)(object)sfx != (Object)null && (Object)(object)HUDManager.Instance.UIAudio != (Object)null) { HUDManager.Instance.UIAudio.PlayOneShot(sfx, 1f); } ((MonoBehaviour)HUDManager.Instance).StartCoroutine(WarningAnimationSequence()); } } private static void BuildWarningUI() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0050: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_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_0140: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Expected O, but got Unknown //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Expected O, but got Unknown //IL_02cd: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Systems/UI/Canvas"); if (!((Object)(object)val == (Object)null)) { _warningCanvasObj = new GameObject("GMO_WarningUI"); _warningCanvasObj.transform.SetParent(val.transform, false); RectTransform val2 = _warningCanvasObj.AddComponent(); val2.anchorMin = Vector2.zero; val2.anchorMax = Vector2.one; val2.offsetMin = Vector2.zero; val2.offsetMax = Vector2.zero; _canvasGroup = _warningCanvasObj.AddComponent(); _canvasGroup.alpha = 0f; GameObject val3 = new GameObject("Background"); val3.transform.SetParent(_warningCanvasObj.transform, false); Image val4 = val3.AddComponent(); ((Graphic)val4).color = new Color(0f, 0f, 0f, 0.1f); RectTransform rectTransform = ((Graphic)val4).rectTransform; rectTransform.anchorMin = new Vector2(0f, 0.5f); rectTransform.anchorMax = new Vector2(1f, 0.5f); rectTransform.pivot = new Vector2(0.5f, 0.5f); rectTransform.sizeDelta = new Vector2(0f, 100f); VerticalLayoutGroup val5 = val3.AddComponent(); ((LayoutGroup)val5).childAlignment = (TextAnchor)4; ((HorizontalOrVerticalLayoutGroup)val5).childControlHeight = true; ((HorizontalOrVerticalLayoutGroup)val5).childControlWidth = true; ((HorizontalOrVerticalLayoutGroup)val5).childForceExpandHeight = false; ((HorizontalOrVerticalLayoutGroup)val5).childForceExpandWidth = true; ((LayoutGroup)val5).padding = new RectOffset(20, 20, 20, 20); ((HorizontalOrVerticalLayoutGroup)val5).spacing = 10f; ContentSizeFitter val6 = val3.AddComponent(); val6.verticalFit = (FitMode)2; TMP_FontAsset font = ((TMP_Text)HUDManager.Instance.controlTipLines[0]).font; GameObject val7 = new GameObject("TitleText"); val7.transform.SetParent(val3.transform, false); _titleText = val7.AddComponent(); ((TMP_Text)_titleText).font = font; ((TMP_Text)_titleText).fontSize = 38f; ((Graphic)_titleText).color = new Color(0.9f, 0f, 0f, 1f); ((TMP_Text)_titleText).alignment = (TextAlignmentOptions)514; ((TMP_Text)_titleText).characterSpacing = 8f; ((TMP_Text)_titleText).fontStyle = (FontStyles)1; ((TMP_Text)_titleText).enableWordWrapping = true; GameObject val8 = new GameObject("BodyText"); val8.transform.SetParent(val3.transform, false); _bodyText = val8.AddComponent(); ((TMP_Text)_bodyText).font = font; ((TMP_Text)_bodyText).fontSize = 18f; ((Graphic)_bodyText).color = new Color(0.8f, 0.8f, 0.8f, 0.9f); ((TMP_Text)_bodyText).alignment = (TextAlignmentOptions)514; ((TMP_Text)_bodyText).characterSpacing = 2f; ((TMP_Text)_bodyText).lineSpacing = 10f; ((TMP_Text)_bodyText).enableWordWrapping = true; } } private static void CreateSubtleLine(Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 sizeOffset) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0036: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("Line"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = new Color(0.8f, 0.1f, 0.1f, 0.3f); RectTransform rectTransform = ((Graphic)val2).rectTransform; rectTransform.anchorMin = anchorMin; rectTransform.anchorMax = anchorMax; rectTransform.sizeDelta = sizeOffset; } private static void CreateBorderLine(Transform parent, Vector2 anchorMin, Vector2 anchorMax, Vector2 sizeOffset) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown //IL_0036: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("BorderLine"); val.transform.SetParent(parent, false); Image val2 = val.AddComponent(); ((Graphic)val2).color = new Color(1f, 0f, 0f, 0.6f); RectTransform rectTransform = ((Graphic)val2).rectTransform; rectTransform.anchorMin = anchorMin; rectTransform.anchorMax = anchorMax; rectTransform.sizeDelta = sizeOffset; } [IteratorStateMachine(typeof(d__8))] private static IEnumerator WarningAnimationSequence() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0); } } public static class GMO_Animations { [CompilerGenerated] private sealed class d__0 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GMO_UIElements ui; public EndOfGameStats stats; public Action onComplete; private float 5__1; private float 5__2; private float 5__3; private int 5__4; private int 5__5; private string 5__6; private StringBuilder 5__7; private TMP_FontAsset 5__8; private IEnumerator <>s__9; private Transform 5__10; private IEnumerator <>s__11; private Transform 5__12; private IEnumerator <>s__13; private Transform 5__14; private Dictionary.Enumerator <>s__15; private KeyValuePair 5__16; private ulong 5__17; private Plugin.PlayerData 5__18; private string 5__19; private string 5__20; private bool 5__21; private List.Enumerator <>s__22; private string 5__23; private List.Enumerator <>s__24; private string 5__25; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { switch (<>1__state) { case -3: case 4: try { } finally { <>m__Finally1(); } break; case -4: case 5: try { } finally { <>m__Finally2(); } break; case -5: case 6: try { } finally { <>m__Finally3(); } break; } 5__6 = null; 5__7 = null; 5__8 = null; <>s__9 = null; 5__10 = null; <>s__11 = null; 5__12 = null; <>s__13 = null; 5__14 = null; <>s__15 = default(Dictionary.Enumerator); 5__16 = default(KeyValuePair); 5__18 = null; 5__19 = null; 5__20 = null; <>s__22 = default(List.Enumerator); 5__23 = null; <>s__24 = default(List.Enumerator); 5__25 = null; <>1__state = -2; } private bool MoveNext() { //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Expected O, but got Unknown //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_0808: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Expected O, but got Unknown //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08f9: Unknown result type (might be due to invalid IL or missing references) //IL_0903: Expected O, but got Unknown //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_0954: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Expected O, but got Unknown //IL_06fd: Unknown result type (might be due to invalid IL or missing references) //IL_0707: Expected O, but got Unknown //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; onComplete(obj: false); ((TMP_Text)ui.GeneralStatsText).text = ""; ((TMP_Text)ui.TitleText).text = "ESTABLISHING CONNECTION..."; <>s__9 = ui.PlayerListContent.GetEnumerator(); try { while (<>s__9.MoveNext()) { 5__10 = (Transform)<>s__9.Current; Object.Destroy((Object)(object)((Component)5__10).gameObject); 5__10 = null; } } finally { if (<>s__9 is IDisposable disposable) { disposable.Dispose(); } } <>s__9 = null; <>s__11 = ui.IndoorContent.GetEnumerator(); try { while (<>s__11.MoveNext()) { 5__12 = (Transform)<>s__11.Current; Object.Destroy((Object)(object)((Component)5__12).gameObject); 5__12 = null; } } finally { if (<>s__11 is IDisposable disposable2) { disposable2.Dispose(); } } <>s__11 = null; <>s__13 = ui.OutdoorContent.GetEnumerator(); try { while (<>s__13.MoveNext()) { 5__14 = (Transform)<>s__13.Current; Object.Destroy((Object)(object)((Component)5__14).gameObject); 5__14 = null; } } finally { if (<>s__13 is IDisposable disposable3) { disposable3.Dispose(); } } <>s__13 = null; ((TMP_Text)ui.IndoorTitle).text = "INDOOR (0)"; ((TMP_Text)ui.OutdoorTitle).text = "OUTDOOR (0)"; <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; case 1: <>1__state = -1; if (Plugin.EnableGameCoreOverhaul.Value) { ((TMP_Text)ui.TitleText).text = $"MISSION REPORT | {Plugin.ChosenMoonNames.Count + 1 - Plugin.VisitedMoonNames.Count} DAYS UNTIL DEADLINE"; } else { ((TMP_Text)ui.TitleText).text = $"MISSION REPORT | {Mathf.CeilToInt(TimeOfDay.Instance.timeUntilDeadline / TimeOfDay.Instance.totalTime)} DAYS UNTIL DEADLINE"; } HUDManager.Instance.HideHUD(true); ((Component)HUDManager.Instance.chatTextField).gameObject.SetActive(false); 5__1 = Plugin.totalScrapSurLune; 5__2 = Plugin.collectedScrapSurLune; 5__3 = ((5__1 > 0f) ? (5__2 / 5__1) : 0f); 5__4 = Plugin.collectedNB; 5__5 = Plugin.allNB; 5__6 = "D"; if (5__3 >= 0.95f) { 5__6 = "S"; } else if (5__3 > 0.75f) { 5__6 = "A"; } else if (5__3 > 0.5f) { 5__6 = "B"; } else if (5__3 > 0.25f) { 5__6 = "C"; } 5__7 = new StringBuilder(); 5__7.AppendLine("SECTOR: " + RoundManager.Instance.currentLevel.PlanetName); 5__7.AppendLine($"ITEMS RETRIEVED: {5__4} / {5__5}"); 5__7.AppendLine($"SCRAP COLLECTED: {5__2}$ / {5__1}$"); 5__7.AppendLine($"CREW EFFICIENCY: {5__3 * 100f:F0}%"); 5__7.AppendLine(""); 5__7.AppendLine(""); 5__7.AppendLine("GRADE: [ " + 5__6 + " ]"); 5__7.AppendLine(""); if (Plugin.TeamsPenalty > 0) { 5__7.AppendLine($"CASUALTY FINES: -{Plugin.TeamsPenalty}$"); } else { 5__7.AppendLine("CASUALTY FINES: NONE"); } <>2__current = Type(ui.GeneralStatsText, 5__7.ToString()); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.3f); <>1__state = 3; return true; case 3: <>1__state = -1; 5__8 = ((TMP_Text)HUDManager.Instance.weightCounter).font; <>s__15 = Plugin.PlayersRegistry.GetEnumerator(); <>1__state = -3; goto IL_073f; case 4: <>1__state = -3; 5__18 = null; 5__19 = null; 5__20 = null; 5__16 = default(KeyValuePair); goto IL_073f; case 5: <>1__state = -4; 5__23 = null; goto IL_0830; case 6: <>1__state = -5; 5__25 = null; goto IL_0921; case 7: { <>1__state = -1; ui.BtnObj.SetActive(true); onComplete(obj: true); return false; } IL_073f: if (<>s__15.MoveNext()) { 5__16 = <>s__15.Current; 5__17 = 5__16.Key; 5__18 = 5__16.Value; 5__19 = 5__18.PlayerName; 5__20 = "ACTIVE"; 5__21 = !5__18.IsAlive; if (5__21) { 5__20 = "DECEASED (" + 5__18.CauseOfDeath + ")"; } else if (5__18.Health <= 20) { 5__20 = $"CRITICAL ({5__18.Health}HP)"; } else if (5__18.Health <= 75) { 5__20 = $"INJURED ({5__18.Health}HP)"; } else { 5__20 = $"STABLE ({5__18.Health}HP)"; } ui.CreatePlayerRow(5__19, 5__20, 5__21, 5__8); <>2__current = (object)new WaitForSeconds(0.15f); <>1__state = 4; return true; } <>m__Finally1(); <>s__15 = default(Dictionary.Enumerator); ((TMP_Text)ui.IndoorTitle).text = $"INDOOR ({Plugin.IndoorEnemyNames.Count})"; <>s__22 = Plugin.IndoorEnemyNames.GetEnumerator(); <>1__state = -4; goto IL_0830; IL_0830: if (<>s__22.MoveNext()) { 5__23 = <>s__22.Current; ui.CreateSimpleRow(ui.IndoorContent, "> " + 5__23.ToUpper(), new Color(1f, 0.6f, 0f), 5__8); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 5; return true; } <>m__Finally2(); <>s__22 = default(List.Enumerator); ((TMP_Text)ui.OutdoorTitle).text = $"OUTDOOR ({Plugin.OutdoorEnemyNames.Count})"; <>s__24 = Plugin.OutdoorEnemyNames.GetEnumerator(); <>1__state = -5; goto IL_0921; IL_0921: if (<>s__24.MoveNext()) { 5__25 = <>s__24.Current; ui.CreateSimpleRow(ui.OutdoorContent, "> " + 5__25.ToUpper(), new Color(1f, 0.6f, 0f), 5__8); <>2__current = (object)new WaitForSeconds(0.05f); <>1__state = 6; return true; } <>m__Finally3(); <>s__24 = default(List.Enumerator); <>2__current = (object)new WaitForSeconds(3f); <>1__state = 7; return true; } } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>s__15).Dispose(); } private void <>m__Finally2() { <>1__state = -1; ((IDisposable)<>s__22).Dispose(); } private void <>m__Finally3() { <>1__state = -1; ((IDisposable)<>s__24).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__1 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public TextMeshProUGUI el; public string t; private int 5__1; private TMP_TextInfo 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (((TMP_Text)el).maxVisibleCharacters >= ((TMP_Text)el).textInfo.characterCount) { goto IL_00d8; } } else { <>1__state = -1; ((TMP_Text)el).text = t; ((TMP_Text)el).maxVisibleCharacters = 0; 5__1 = t.Length; 5__2 = ((TMP_Text)el).textInfo; } if (((TMP_Text)el).maxVisibleCharacters < 5__1) { TextMeshProUGUI obj = el; int maxVisibleCharacters = ((TMP_Text)obj).maxVisibleCharacters; ((TMP_Text)obj).maxVisibleCharacters = maxVisibleCharacters + 1; <>2__current = (object)new WaitForSeconds(0.01f); <>1__state = 1; return true; } goto IL_00d8; IL_00d8: ((TMP_Text)el).maxVisibleCharacters = 99999; return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] public static IEnumerator TerminalSequence(GMO_UIElements ui, EndOfGameStats stats, Action onComplete) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { ui = ui, stats = stats, onComplete = onComplete }; } [IteratorStateMachine(typeof(d__1))] private static IEnumerator Type(TextMeshProUGUI el, string t) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { el = el, t = t }; } } public class GMO_UIElements { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static UnityAction <>9__13_0; internal void b__13_0() { GMO_UIManager.Instance.OnContinueClicked(); } } public GameObject CanvasObj = null; public GameObject BtnObj = null; public TextMeshProUGUI TitleText = null; public TextMeshProUGUI GeneralStatsText = null; public Transform PlayerListContent = null; public Transform IndoorContent = null; public Transform OutdoorContent = null; public TextMeshProUGUI IndoorTitle = null; public TextMeshProUGUI OutdoorTitle = null; private Color _cBlack05 = new Color(0f, 0f, 0f, 0.5f); private Color _cOrange05 = new Color(1f, 0.45f, 0.05f, 0.5f); private Color _cOrangeFull = new Color(1f, 0.45f, 0.05f, 1f); private Color _cRed = new Color(0.8f, 0.1f, 0.1f, 1f); public void BuildUI(Transform parent) { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_006c: 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_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_013e: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: 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_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027f: 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_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02e1: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0346: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0382: Unknown result type (might be due to invalid IL or missing references) //IL_038e: Unknown result type (might be due to invalid IL or missing references) //IL_03b0: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Expected O, but got Unknown //IL_03f9: Unknown result type (might be due to invalid IL or missing references) //IL_0401: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) //IL_0430: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_046d: Unknown result type (might be due to invalid IL or missing references) //IL_0473: Expected O, but got Unknown TMP_FontAsset font = ((TMP_Text)HUDManager.Instance.weightCounter).font; CanvasObj = new GameObject("GMO_MissionReport"); Canvas val = CanvasObj.AddComponent(); val.renderMode = (RenderMode)0; val.sortingOrder = 9999; CanvasObj.AddComponent(); CanvasScaler val2 = CanvasObj.AddComponent(); val2.uiScaleMode = (ScaleMode)1; val2.referenceResolution = new Vector2(1920f, 1080f); val2.matchWidthOrHeight = 0.5f; Image val3 = new GameObject("GlobalBackground").AddComponent(); ((Component)val3).transform.SetParent(CanvasObj.transform, false); ((Graphic)val3).color = _cBlack05; ((Graphic)val3).raycastTarget = true; Stretch(((Graphic)val3).rectTransform); GameObject val4 = new GameObject("TerminalFrame"); val4.transform.SetParent(CanvasObj.transform, false); Image val5 = val4.AddComponent(); ((Graphic)val5).color = _cOrange05; ((Graphic)val5).raycastTarget = false; RectTransform rectTransform = ((Graphic)val5).rectTransform; rectTransform.anchorMin = new Vector2(0.1f, 0.1f); rectTransform.anchorMax = new Vector2(0.9f, 0.9f); Vector2 val7 = (rectTransform.offsetMin = (rectTransform.offsetMax = Vector2.zero)); TitleText = CreateTxt("Title", val4.transform, font, 50, new Vector2(0f, -50f)); ((TMP_Text)TitleText).rectTransform.anchorMin = new Vector2(0f, 1f); ((TMP_Text)TitleText).rectTransform.anchorMax = new Vector2(1f, 1f); ((TMP_Text)TitleText).rectTransform.pivot = new Vector2(0.5f, 1f); ((TMP_Text)TitleText).text = "MISSION REPORT"; ((Graphic)TitleText).color = Color.white; ((TMP_Text)TitleText).alignment = (TextAlignmentOptions)514; GeneralStatsText = CreateTxt("Stats", val4.transform, font, 26, new Vector2(40f, -120f)); ((TMP_Text)GeneralStatsText).rectTransform.anchorMin = new Vector2(0f, 1f); ((TMP_Text)GeneralStatsText).rectTransform.anchorMax = new Vector2(0.6f, 1f); ((TMP_Text)GeneralStatsText).rectTransform.pivot = new Vector2(0f, 1f); ((TMP_Text)GeneralStatsText).alignment = (TextAlignmentOptions)257; ((Graphic)GeneralStatsText).color = Color.white; ((TMP_Text)GeneralStatsText).rectTransform.sizeDelta = new Vector2(0f, 250f); float num = 0.12f; float num2 = 0.45f; CreateColumn(val4.transform, "Crew", new Vector2(0.05f, num), new Vector2(0.33f, num2), "CREW STATUS", out PlayerListContent, out TextMeshProUGUI _); CreateColumn(val4.transform, "Indoor", new Vector2(0.35f, num), new Vector2(0.64f, num2), "INDOOR (0)", out IndoorContent, out IndoorTitle); CreateColumn(val4.transform, "Outdoor", new Vector2(0.66f, num), new Vector2(0.95f, num2), "OUTDOOR (0)", out OutdoorContent, out OutdoorTitle); BtnObj = new GameObject("ActionBtn"); BtnObj.transform.SetParent(CanvasObj.transform, false); RectTransform val8 = BtnObj.AddComponent(); ((Vector2)(ref val7))..ctor(0.5f, 0.15f); val8.anchorMax = val7; val8.anchorMin = val7; val8.sizeDelta = new Vector2(300f, 40f); Image val9 = BtnObj.AddComponent(); ((Graphic)val9).color = _cOrangeFull; ((Graphic)val9).raycastTarget = true; ButtonClickedEvent onClick = BtnObj.AddComponent