using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using LevelScaling.LevelStats; using LevelScaling.Menu; using LevelScaling.Patches; using MenuLib; using MenuLib.MonoBehaviors; using Photon.Pun; using Photon.Realtime; using TMPro; using UnityEngine; using UnityEngine.UI; using UnityEngine.Video; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: AssemblyTitle("LevelScaling")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("LevelScaling")] [assembly: AssemblyCopyright("Copyright © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("94187d6e-952a-4336-b083-0210fe153e6f")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace LevelScaling { public class ChallengeManager { public enum ChallengeType { None, LightsOut, HighQuota, LargeMap, EnemyRush, FragileValuables, IncreasedDamage, HiddenInformation, FoggyLevel, TimeAttack, OverOvercharge, NoMap, DangerZone, SharedDurability } public class Challenge { public ChallengeType type; public string name; public string info; public int Weight => type switch { ChallengeType.LightsOut => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_LightsOut), ChallengeType.HighQuota => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_HighQuota), ChallengeType.LargeMap => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_LargeMap), ChallengeType.FoggyLevel => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_FoggyLevel), ChallengeType.IncreasedDamage => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_IncreasedDamage), ChallengeType.FragileValuables => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_FragileValuables), ChallengeType.OverOvercharge => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_OverOvercharge), ChallengeType.NoMap => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_NoMap), ChallengeType.EnemyRush => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_EnemyRush), ChallengeType.HiddenInformation => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_HiddenInformation), ChallengeType.DangerZone => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_DangerZone), ChallengeType.SharedDurability => Helpers.GetConfig(Plugin.ChallengeChanceMultiplier_SharedDurability), _ => 0, }; public int StartingLevel => type switch { ChallengeType.LightsOut => Helpers.GetConfig(Plugin.ChallengeStartingLevel_LightsOut), ChallengeType.HighQuota => Helpers.GetConfig(Plugin.ChallengeStartingLevel_HighQuota), ChallengeType.LargeMap => Helpers.GetConfig(Plugin.ChallengeStartingLevel_LargeMap), ChallengeType.FoggyLevel => Helpers.GetConfig(Plugin.ChallengeStartingLevel_FoggyLevel), ChallengeType.IncreasedDamage => Helpers.GetConfig(Plugin.ChallengeStartingLevel_IncreasedDamage), ChallengeType.FragileValuables => Helpers.GetConfig(Plugin.ChallengeStartingLevel_FragileValuables), ChallengeType.OverOvercharge => Helpers.GetConfig(Plugin.ChallengeStartingLevel_OverOvercharge), ChallengeType.NoMap => Helpers.GetConfig(Plugin.ChallengeStartingLevel_NoMap), ChallengeType.EnemyRush => Helpers.GetConfig(Plugin.ChallengeStartingLevel_EnemyRush), ChallengeType.HiddenInformation => Helpers.GetConfig(Plugin.ChallengeStartingLevel_HiddenInformation), ChallengeType.DangerZone => Helpers.GetConfig(Plugin.ChallengeStartingLevel_DangerZone), ChallengeType.SharedDurability => Helpers.GetConfig(Plugin.ChallengeStartingLevel_SharedDurability), _ => 0, }; public Challenge(ChallengeType type, string name, string info) { this.type = type; this.name = name; this.info = info; } } public static List currentChallenges = new List(); public static List _blacklistedChallenges = new List(); public static ChallengeType forceChallenge = ChallengeType.None; public static Dictionary challengesDofD = new Dictionary { { "currentSeed", 1 }, { "lastChallengeLevel", -1 }, { "lastChallengeType", -1 } }; public static readonly List allChallenges = new List { new Challenge(ChallengeType.LightsOut, "Lights Out", "The level's lights have stopped working,
you'll be stuck in the dark."), new Challenge(ChallengeType.HighQuota, "Overtime", "Taxman is requiring extra effort for this level.
Your quotas will be significantly higher."), new Challenge(ChallengeType.LargeMap, "Enlarged Level", "This level's layout is much larger than normal.
Remember to use your map."), new Challenge(ChallengeType.FoggyLevel, "Dense Fog", "There's lots of heavy fog on this level.
Visibility will be low, tread carefully."), new Challenge(ChallengeType.IncreasedDamage, "Increased Damage", "All incoming damage for both Semibots and enemies
will be greatly increased. Be careful."), new Challenge(ChallengeType.FragileValuables, "Fragile Valuables", "All valuables are very fragile, regardless of how they
look on the outside. Each valuable will be priced higher."), new Challenge(ChallengeType.OverOvercharge, "Over-Overcharge", "Overcharge will build up from holding valuables too.
Pay close attention and don't explode yourself."), new Challenge(ChallengeType.NoMap, "Broken Map", "Your map is disabled, however Semibots will naturally
regenerate health slowly; up to the health they started the level with."), new Challenge(ChallengeType.EnemyRush, "Enemy Rush", "There are many more enemies than usual on this level,
but enemies are lighter, and have significantly reduced health."), new Challenge(ChallengeType.HiddenInformation, "Hidden Information", "This level's size and length are randomized, and some important
information will be obstructed for the duration of the level."), new Challenge(ChallengeType.DangerZone, "Danger Zone", "Semibots will take damage over time, gradually speeding up the longer
you spend on the level. Damaging enemies heals all Semibots."), new Challenge(ChallengeType.SharedDurability, "Shared Durability", "A portion of damage valuables take is instead given to Semibots. More value
lost, more damage given. Extractions will heal Semibots based on value extracted.") }; public static int CurrentSeed { get { if (!challengesDofD.ContainsKey("currentSeed")) { challengesDofD.Add("currentSeed", 1); } return challengesDofD["currentSeed"]; } set { if (!challengesDofD.ContainsKey("currentSeed")) { challengesDofD.Add("currentSeed", value); } else { challengesDofD["currentSeed"] = value; } } } public static int LastChallengeLevel { get { if (!challengesDofD.ContainsKey("lastChallengeLevel")) { challengesDofD.Add("lastChallengeLevel", -1); } return challengesDofD["lastChallengeLevel"]; } set { if (!challengesDofD.ContainsKey("lastChallengeLevel")) { challengesDofD.Add("lastChallengeLevel", value); } else { challengesDofD["lastChallengeLevel"] = value; } } } public static int LastChallengeType { get { if (!challengesDofD.ContainsKey("lastChallengeType")) { challengesDofD.Add("lastChallengeType", -1); } return challengesDofD["lastChallengeType"]; } set { if (!challengesDofD.ContainsKey("lastChallengeType")) { challengesDofD.Add("lastChallengeType", value); } else { challengesDofD["lastChallengeType"] = value; } } } public static bool IsChallengeActive() { if (currentChallenges.Count > 0) { return Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.None; } return false; } public static bool IsChallengeActive(ChallengeType challenge) { if (currentChallenges.Contains(challenge)) { return Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.None; } return false; } public static Challenge GetChallenge(ChallengeType challenge) { foreach (Challenge allChallenge in allChallenges) { if (allChallenge.type == challenge) { return allChallenge; } } return new Challenge(ChallengeType.None, "????????", "Unknown challenge - can't get any info. Sorry!"); } public static void DetermineChallengeForLevel(int level, int initialSeed) { //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer() || Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || (!MalfunctionManager.IsMalfunctionActive() && Helpers.GetConfig(Plugin.ChallengeChanceMultiplier) <= 0f)) { return; } int num = initialSeed + level; Random random = new Random(num); int num2 = Mathf.Max(0, level - Mathf.Max(1, LastChallengeLevel) - 1); float num3 = SwaggiFunc.DetermineChallengeChance(level); float num4 = Mathf.Clamp((float)num2 * 4f, 0f, 20f); float num5 = num3 + num4; if (num2 >= 3 && level >= 10) { num5 += 5f; if (num2 >= 5) { num5 += 7f; } } if (level >= 5 && LastChallengeLevel == -1) { num5 += 15f; if (level >= 7) { num5 += 20f; } } num5 *= (MalfunctionManager.IsMalfunctionActive() ? 1f : Helpers.GetConfig(Plugin.ChallengeChanceMultiplier)); float num6 = (float)random.Next(0, 1000) / 10f; bool flag = SemiFunc.RunIsShop() || SemiFunc.RunIsTutorial() || SemiFunc.RunIsArena() || SemiFunc.RunIsLobby() || SemiFunc.RunIsLobbyMenu(); bool flag2 = level <= 3 || (level <= 20 && level % 5 == 0 && Helpers.GetConfig(Plugin.ChallengeDisableMoonPhase)); bool flag3 = num6 >= num5; bool flag4 = LastChallengeLevel == level - 1 && random.Next(0, 100) >= 5; bool flag5 = MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.QuotaDifficulty) || Helpers.GetConfig(Plugin.ChallengeGuarantee); if (Plugin.DeepLog) { Helpers.DeepLog($"[ChallengeManager] seed: {num}\n" + $"base chance = {num3:0.0}%\n" + $"consecutive bonus = {num4:0.0}%\n" + $"final chance = {num5:0.0}%\n" + "---\n" + $"passes chance = {!flag3} ({num6:0.0} < {num5:0.0}%) ({Helpers.GetConfig(Plugin.ChallengeChanceMultiplier):0.00}x)\n" + $"passes level type = {!flag} ({RunManager.instance.levelCurrent.NarrativeName})\n" + $"passes level num = {!flag2} ({level})\n" + $"passes last level = {!flag4} ({LastChallengeLevel} == {level - 1})\n"); } if (flag || (!flag5 && forceChallenge == ChallengeType.None && (flag2 || flag3 || flag4))) { if (GameManager.Multiplayer()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("SyncChallengeRPC", (RpcTarget)0, new object[1] { 0 }); } } } else { LevelStatsSyncing.instance?.SyncChallengeRPC(0); } return; } int num7 = 0; int num8 = 0; int num9 = 0; List list = new List(); foreach (Challenge allChallenge in allChallenges) { if ((flag5 || ((Helpers.GetConfig(Plugin.ChallengeDisableLevelRequirements) || LevelGeneratorPatch.CurrentLevel >= allChallenge.StartingLevel) && allChallenge.type != (ChallengeType)LastChallengeType)) && (allChallenge.type != ChallengeType.OverOvercharge || SemiFunc.MoonLevel() >= 2) && ((allChallenge.type != ChallengeType.SharedDurability && allChallenge.type != ChallengeType.FragileValuables) || !MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) && !_blacklistedChallenges.Contains(allChallenge.type)) { list.Add(allChallenge); num9 += allChallenge.Weight; } } int num10 = random.Next(0, num9); foreach (Challenge item in list) { num8 += item.Weight; if (num8 > num10) { num7 = (int)item.type; break; } } if (forceChallenge != 0) { num7 = (int)forceChallenge; } forceChallenge = ChallengeType.None; LastChallengeLevel = level; LastChallengeType = num7; if (GameManager.Multiplayer()) { LevelStatsSyncing instance2 = LevelStatsSyncing.instance; if (instance2 != null) { PhotonView photonView2 = instance2.photonView; if (photonView2 != null) { photonView2.RPC("SyncChallengeRPC", (RpcTarget)0, new object[1] { num7 }); } } } else { LevelStatsSyncing.instance?.SyncChallengeRPC(num7); } } public static void SetupChallenges(ChallengeType challenge) { currentChallenges.Clear(); if (Plugin.DeepLog) { Helpers.DeepLog($"[ChallengeManager] selected challenge: {challenge}"); } if (challenge != 0) { currentChallenges.Add(challenge); } } } public class Helpers { public static PlayerChatBoxState truckScreenState = (PlayerChatBoxState)0; private static readonly Dictionary difficultyColors = new Dictionary { { 2147483639, new Color(0f, 0f, 0f) }, { 999, new Color(0f, 0f, 0f) }, { 100, new Color(0.2f, 0.2f, 0.2f) }, { 90, new Color(0f, 1f, 0.5f) }, { 80, new Color(0f, 1f, 1f) }, { 70, new Color(0f, 0.5f, 1f) }, { 60, new Color(0f, 0f, 1f) }, { 50, new Color(0.5f, 0f, 1f) }, { 40, new Color(1f, 0f, 1f) }, { 30, new Color(1f, 0f, 0.5f) }, { 20, new Color(1f, 0f, 0f) }, { 15, new Color(1f, 0.5f, 0f) }, { 10, new Color(1f, 1f, 0f) }, { 5, new Color(0.5f, 1f, 0f) }, { 1, new Color(0f, 1f, 0f) } }; public static int PlayerCount => GameDirector.instance.PlayerList.Count; public static bool TruckStarting => (int)truckScreenState == 3; public static bool TruckLeaving { get { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 if ((int)truckScreenState != 2) { return TruckStarting; } return true; } } public static int CurrentLevel => LevelGeneratorPatch.CurrentLevel; public static ExtractionPoint ExtractionPointCurrent => RoundDirector.instance.extractionPointCurrent; public static int ExtractionHaulGoal => RoundDirector.instance.extractionHaulGoal; public static bool AllExtractionPointsCompleted => RoundDirector.instance.allExtractionPointsCompleted; public static void DebugForceLoadLevel(int level, ChallengeManager.ChallengeType forcedChallenge = ChallengeManager.ChallengeType.None) { RunManager.instance.levelsCompleted = level - 1; ChallengeManager.forceChallenge = forcedChallenge; RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)1); } public static string TimeToString(float seconds) { seconds = Mathf.Clamp(seconds, 0f, 360000f); int num = (int)(seconds * 1000f) % 1000; int num2 = (int)seconds % 60; int num3 = (int)(seconds / 60f) % 60; int num4 = (int)(seconds / 3600f); return $"{num4:00}:{num3:00}:{num2:00}.{num:000}"; } public static Color GetDifficultyColor(int level) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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) //IL_0048: 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_0089: 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) Color val = Color.black; int num = 0; foreach (KeyValuePair difficultyColor in difficultyColors) { if (level >= difficultyColor.Key) { float num2 = (float)(level - difficultyColor.Key) / (float)(num - difficultyColor.Key); return Color.Lerp(difficultyColor.Value, val, num2); } val = difficultyColor.Value; num = difficultyColor.Key; } return new Color(0f, 0f, 0f); } public static string ColoredText(string text, Color color) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) string text2 = ColorUtility.ToHtmlStringRGB(color); return ColoredText(text, "#" + text2); } public static string ColoredText(string text, string hexColor) { return "" + text + ""; } public static string PlusMinus(int number) { if (number < 0) { return number.ToString(); } if (number > 0) { return $"+{number}"; } return $"±{number}"; } public static string PlusMinus(float number) { if (number < 0f) { return $"{number:0.00}"; } if (number > 0f) { return $"+{number:0.00}"; } return $"±{number:0.00}"; } public static float RoundTo100(float original) { return Mathf.Round(original / 100f) * 100f; } public static void DeepLog(string log) { if (Plugin.DeepLogging.Value) { Plugin.loggy.LogDebug((object)log); } } public static float RGDM1(int level) { return Mathf.Clamp01(((float)level - 1f) / 9f); } public static float RGDM2(int level) { return Mathf.Clamp01(((float)level - 10f) / 10f); } public static float RGDM3(int level) { return Mathf.Clamp01(((float)level - 20f) / 10f); } public static T GetConfig(ConfigEntry config) { return (T)(MalfunctionManager.IsMalfunctionActive() ? ((ConfigEntryBase)config).DefaultValue : ((object)config.Value)); } public static bool AllPlayersDead() { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!player.isDisabled) { return false; } } return true; } public static int GetIntFromDict(Dictionary dict, int level) { return (int)GetFloatFromDict(dict, level); } public static float GetFloatFromDict(Dictionary dict, int level) { if (dict.Count == 0) { return 0f; } if (dict.Count == 1 || level <= dict.First().Key) { return dict.First().Value; } if (level >= dict.Last().Key) { return dict.Last().Value; } int num = 0; float num2 = 0f; foreach (KeyValuePair item in dict) { if (level == item.Key) { float value = item.Value; DeepLog($"Dict: returning value {value} - lv={num2} kv={item.Value} / ll={num} kl={item.Key} / lerp={level}"); return value; } if (level < item.Key) { float num3 = Mathf.Lerp(num2, item.Value, Mathf.InverseLerp((float)num, (float)item.Key, (float)level)); DeepLog($"Dict: returning value {num3} - lv={num2} kv={item.Value} / ll={num} kl={item.Key} / lerp={level}"); return num3; } num = item.Key; num2 = item.Value; } return 0f; } public static float GetFloatFromConfig(ConfigEntry config, int level) { return GetFloatFromDict(ExtractDictFromConfig(config), level); } public static int GetIntFromConfig(ConfigEntry config, int level) { return GetIntFromDict(ExtractDictFromConfig(config), level); } public static Dictionary ExtractDictFromConfig(ConfigEntry config) { if (ExtractDictFromString(config.Value, out var outDict)) { return outDict; } Plugin.loggy.LogError((object)("An error occurred trying to parse value for " + ((ConfigEntryBase)config).Definition.Section + "/" + ((ConfigEntryBase)config).Definition.Key + ". There will probably be a relevant error above. The default value will be used instead.")); if (ExtractDictFromString((string)((ConfigEntryBase)config).DefaultValue, out var outDict2)) { return outDict2; } Plugin.loggy.LogError((object)("An error occurred trying to parse the DEFAULT VALUE for " + ((ConfigEntryBase)config).Definition.Section + "/" + ((ConfigEntryBase)config).Definition.Key + ", that's pretty bad :(")); return null; } public static bool ExtractDictFromString(string dict, out Dictionary outDict) { outDict = new Dictionary(); string[] array = dict.Replace(" ", "").Split(new char[1] { ',' }); if (array.Length == 0) { Plugin.loggy.LogError((object)"There are no values in string dictionary."); return false; } int num = 0; for (int i = 0; i < array.Length; i++) { string text = array[i]; if (string.IsNullOrEmpty(text)) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} was empty, skipping over it."); continue; } if (!text.Contains(":")) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} had no colon (:) to separate key and value, skipping over it."); continue; } string[] array2 = text.Split(new char[1] { ':' }); if (array2.Length != 2) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} was not a length of 2 (indicating multiple colons), skipping over it."); continue; } if (string.IsNullOrEmpty(array2[0])) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} has an empty key, skipping over it."); continue; } if (string.IsNullOrEmpty(array2[1])) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} has an empty value, skipping over it."); continue; } if (!int.TryParse(array2[0], NumberStyles.Integer, new CultureInfo("en-US"), out var result)) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - could not parse int for \"{array2[0]}\", skipping over it."); continue; } if (!float.TryParse(array2[1], NumberStyles.Float, new CultureInfo("en-US"), out var result2)) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - could not parse float for \"{array2[1]}\", skipping over it."); continue; } if (result == num) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - key ({result}) is a duplicate, skipping over it."); continue; } if (result < num) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - key ({result}) is lower the previous one ({num}), skipping over it."); continue; } if (result2 > 1000000f) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - value is larger than 1 million, it will be clamped."); result2 = 1000000f; } if (result2 < 0f) { Plugin.loggy.LogWarning((object)$"String dictionary item at index {i} - value is less than 0, it will be clamped."); result2 = 0f; } outDict.Add(result, result2); } if (outDict.Count == 0) { Plugin.loggy.LogError((object)"Dictionary was empty after parsing."); return false; } return true; } } public class MalfunctionManager { public enum MalfunctionType { None, QuotaDifficulty, LowMapValue, RandomLevelSize, SingleExtraction, RandomValuableValue, E10_10_10, MaxModeEasy, MaxMode, Soulstealers } public class Malfunction { public MalfunctionType type; public string name; public string[] infoLines; public Malfunction(MalfunctionType type, string name, string info) { this.type = type; this.name = name; infoLines = info.Split(new char[1] { '/' }); } } [CompilerGenerated] private sealed class d__46 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__46(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_00de: 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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) if (<>1__state != 0) { return false; } <>1__state = -1; _solitude_ShownWarning = byte.MaxValue; if ((Object)(object)Helpers.ExtractionPointCurrent == (Object)null) { return false; } if (!SemiFunc.IsMasterClientOrSingleplayer() || _solitudeCompletedSequence || _solitudeGameOverSequence) { return false; } if (SolitudeQuotaMet) { if (GameManager.Multiplayer() && SemiFunc.IsMasterClient()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("Solitude_CompleteRPC", (RpcTarget)0, Array.Empty()); } } return false; } LevelStatsSyncing.instance?.Solitude_CompleteRPC(); return false; } if (GameManager.Multiplayer() && SemiFunc.IsMasterClient()) { LevelStatsSyncing instance2 = LevelStatsSyncing.instance; if (instance2 != null) { PhotonView photonView2 = instance2.photonView; if (photonView2 != null) { photonView2.RPC("Solitude_KillSelfRPC", (RpcTarget)0, Array.Empty()); } } return false; } LevelStatsSyncing.instance?.Solitude_KillSelfRPC(); 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 bool malfunctionSetThisSave = false; public static List _whitelistedMalfunctions = new List(); public static MalfunctionType selectedMalfunction = MalfunctionType.None; public static MalfunctionType activeMalfunction = MalfunctionType.None; public static readonly Dictionary bestMalfunctionLevels = new Dictionary(); public static readonly List allMalfunctions = new List { new Malfunction(MalfunctionType.QuotaDifficulty, "Perfectionist", "• Quota difficulty starts at 0.7/• Difficulty will rise linearly/• Caps at 0.99 at Level 20/• Challenges appear every level"), new Malfunction(MalfunctionType.LowMapValue, "Sparsity", "• All maps have 3x less value/• Valuable limit is significantly lower/• Levels are larger/• Levels have less extraction points"), new Malfunction(MalfunctionType.RandomLevelSize, "Oscillation", "• Each map is either very tiny or super large/• Map size does not scale with level number/• Map size is determined randomly every level/• +2% walk speed & stamina regen speed per module explored/ *Resets every level"), new Malfunction(MalfunctionType.SingleExtraction, "Solitude", "• There is only one extraction point every level/• All maps are 20% smaller/• Valuables in the extraction point will not have gravity/• Quotas have two \"stages\", completing stage 2 will extract immediately/• Extraction will occur automatically after a set time, immediately lose if/if you don't meet the stage 1 quota at the time limit./• Time starts at 5 min, then +5 min at each moon phase/• -1 sec per $500 broken during a level/• -10 sec (permanently) per additional team member (up to -60)/• +15 sec per orb dropped from an enemy/• +5 sec per enemy killed/• Players are auto-revived if there's at least 1:30 on the clock/• -75 sec per player revived"), new Malfunction(MalfunctionType.RandomValuableValue, "Arbitrarity", "• Valuable values are randomized/• Small valuables are more likely to be cheap & vice versa/• Each valuable's mass is randomized/• Any valuable size can appear on any level/• Enemy strength breakpoints are randomized"), new Malfunction(MalfunctionType.E10_10_10, "Formidable", "• Level 1 will have zero enemies/• 1 enemy of each tier is added every 2nd level/• Caps at 10 enemies per tier at Level 20/• Enemies have half health/• Enemies cannot be grabstunned outside Enemy Rush/• Players take 50% less damage"), new Malfunction(MalfunctionType.Soulstealers, "Soulstealers", "• All valuables are $30 or less and explode when broken/• Heavier valuables create a stronger explosion/• Enemy orbs are unlimited and worth 50% more/• All enemies will drop orbs even if they normally don't/• All enemies will respawn 5x faster/• Enemies will immediately respawn after each extraction/• Players will now be revived when brought near soul orbs/ • The larger the orb, the faster the respawn/ • If the orb breaks early, the respawn is cancelled/ • Extraction points will no longer revive players/ • When the respawn completes, the orb is destroyed/• Enemies gain +10% max health every 5 levels (up to +100%)"), new Malfunction(MalfunctionType.MaxModeEasy, "Grandmaster", "• All settings are overtuned/• Scaling is linear from level 1 to 100/• Good luck."), new Malfunction(MalfunctionType.MaxMode, "Max Mode", "• All settings are maxed out, no exceptions/• Each level is the same, no difficulty scaling/• Not meant to be possible./• Your game might lag.") }; public static ParticleScriptExplosion soulstealerExplosion; public static Dictionary solitudeDeathTimers = new Dictionary(); public static int solitudeRevives = 0; public static int _lastSolitudeSecondsRemoved = 0; public static byte _solitude_ShownWarning = 0; public static Coroutine _solitude_timesUpSequence; public static bool _solitudeGameOverSequence = false; public static bool _solitudeCompletedSequence = false; public static float SolitudeTimeLimitSeconds { get { int num = GameDirector.instance.PlayerList.Count switch { 1 => 0, 2 => -10, 3 => -20, 4 => -30, 5 => -40, _ => -60, }; float num2 = Mathf.Clamp(Mathf.Floor((float)Helpers.CurrentLevel / 5f) + 1f, 1f, 5f); return (300f + (float)num) * num2; } } public static int SolitudeSecondsRemovedBroken => (int)(LevelStatsManager.totalValueBroken / 500f); public static int SolitudeSecondsAddedOrbs => LevelStatsManager.enemyKills * 15; public static int SolitudeSecondsAddedKills => LevelStatsManager.enemyKillsRaw * 5; public static int SolitudeSecondsRemovedRevives => solitudeRevives * 75; public static float SolitudeTimeRemainingSeconds => Mathf.Clamp(SolitudeTimeLimitSeconds - LevelStatsManager.thisLevelTime - (float)SolitudeSecondsRemovedBroken - (float)SolitudeSecondsRemovedRevives + (float)SolitudeSecondsAddedOrbs + (float)SolitudeSecondsAddedKills, 0f, 5999f); public static int SolitudeRequiredQuota { get { float num = Mathf.Lerp(0.25f, 0.7f, Mathf.InverseLerp(1f, 20f, (float)Helpers.CurrentLevel)); return (int)((float)Helpers.ExtractionHaulGoal * num); } } public static bool SolitudeQuotaMet => Traverse.Create((object)Helpers.ExtractionPointCurrent).Field("haulCurrent").GetValue() >= SolitudeRequiredQuota; public static void Setup() { _whitelistedMalfunctions.Clear(); _whitelistedMalfunctions.Add(MalfunctionType.RandomValuableValue); _whitelistedMalfunctions.Add(MalfunctionType.RandomLevelSize); _whitelistedMalfunctions.Add(MalfunctionType.QuotaDifficulty); _whitelistedMalfunctions.Add(MalfunctionType.LowMapValue); _whitelistedMalfunctions.Add(MalfunctionType.SingleExtraction); if (!Plugin.Compatibility_SpawnConfig) { _whitelistedMalfunctions.Add(MalfunctionType.E10_10_10); _whitelistedMalfunctions.Add(MalfunctionType.Soulstealers); _whitelistedMalfunctions.Add(MalfunctionType.MaxModeEasy); _whitelistedMalfunctions.Add(MalfunctionType.MaxMode); } } public static bool IsMalfunctionActive() { if (activeMalfunction != 0 && SemiFunc.RunIsLevel()) { return Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.None; } return false; } public static bool IsMalfunctionActive(MalfunctionType type) { if (activeMalfunction == type && SemiFunc.RunIsLevel()) { return Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.None; } return false; } public static Malfunction GetMalfunction(MalfunctionType type) { foreach (Malfunction allMalfunction in allMalfunctions) { if (allMalfunction.type == type) { return allMalfunction; } } return new Malfunction(MalfunctionType.None, "????????", "N/A"); } public static void SelectMalfunction(MalfunctionType type) { selectedMalfunction = type; if (SemiFunc.IsMainMenu()) { SetMalfunction(type); } else if (SemiFunc.RunIsLobbyMenu() && SemiFunc.IsMasterClientOrSingleplayer()) { SyncMalfunction(type); } } public static void SyncMalfunction() { if (SemiFunc.IsMasterClientOrSingleplayer()) { SyncMalfunction(activeMalfunction); } } public static void SyncMalfunction(MalfunctionType type) { //IL_0053: 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) if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } if (GameManager.Multiplayer()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { instance.photonView.RPC("SyncMalfunctionRPC", (RpcTarget)0, new object[1] { (int)type }); } } else { LevelStatsSyncing.instance?.SyncMalfunctionRPC((int)type); } } public static void SetMalfunction(MalfunctionType type, bool withNotification = false) { //IL_0097: 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_0058: 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) if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { selectedMalfunction = MalfunctionType.None; return; } if (activeMalfunction != type && withNotification) { string text = GetMalfunction(type).name.ToUpper(); if (type == MalfunctionType.None) { SwaggiFunc.DisplayBigMessage("MALFUNCTION DISABLED", "{!}", 3f, new Color(0.5f, 0.5f, 0.5f), Color.red); } else { SwaggiFunc.DisplayBigMessage("" + text + "\nMALFUNCTION ACTIVE!", "{!}", 3f, new Color(0.5f, 0f, 1f), Color.red); } } activeMalfunction = type; } public static void SetMalfunctionBestLevel(MalfunctionType type, int level, bool allowBelow = false, bool force = false) { if (!force && Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { return; } if (bestMalfunctionLevels.ContainsKey(type)) { int value = level; if (!allowBelow) { value = Mathf.Max(level, bestMalfunctionLevels[type]); } bestMalfunctionLevels[type] = value; } else { bestMalfunctionLevels.Add(type, level); } } public static int GetMalfunctionBestLevel(MalfunctionType type) { if (bestMalfunctionLevels.ContainsKey(type)) { return bestMalfunctionLevels[type]; } return 0; } public static bool IsLevelLargeMap(int level, bool withoutRandomness = false) { if (withoutRandomness) { return level % 2 == 0; } if (level == 1) { return false; } return new Random(ChallengeManager.CurrentSeed + 88266 + level).Next(0, 2) == 1; } public static int Formidable_EnemiesThisLevel(int level) { return Mathf.Clamp(level / 2, 0, 10); } public static void Solitude_HandleTimer() { //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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Invalid comparison between Unknown and I4 //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 //IL_004e: 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_00af: Invalid comparison between Unknown and I4 //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Invalid comparison between Unknown and I4 //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Invalid comparison between Unknown and I4 //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Invalid comparison between Unknown and I4 //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Invalid comparison between Unknown and I4 //IL_0183: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel() || Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || !IsMalfunctionActive(MalfunctionType.SingleExtraction)) { return; } Solitude_HandleDeadPlayers(); ExtractionPoint extractionPointCurrent = Helpers.ExtractionPointCurrent; if ((Object)(object)extractionPointCurrent == (Object)null) { return; } State currentState = extractionPointCurrent.currentState; if (SolitudeTimeRemainingSeconds <= 0f && _solitude_ShownWarning < 100) { Solitude_TimerOut(currentState); } if (_solitude_ShownWarning < 100) { if ((int)currentState == 2 || (int)currentState == 3) { extractionPointCurrent.haulGoal = Mathf.Max(SolitudeRequiredQuota + 1, LevelStatsManager.RemainingTotalMapValue); } if ((int)currentState == 4 || (int)currentState == 6) { int haulCurrent = extractionPointCurrent.haulCurrent; extractionPointCurrent.haulGoal = Mathf.Max(extractionPointCurrent.haulGoal, haulCurrent); RoundDirector.instance.extractionHaulGoal = haulCurrent; } } if ((int)currentState == 6 || (int)currentState == 9 || (int)currentState == 7) { return; } if (_lastSolitudeSecondsRemoved != SolitudeSecondsRemovedBroken) { GoalUIPatch.FlashRed(); _lastSolitudeSecondsRemoved = SolitudeSecondsRemovedBroken; } int num = Mathf.CeilToInt(SolitudeTimeRemainingSeconds); if (SolitudeTimeRemainingSeconds <= 10f && _solitude_ShownWarning < 20 - num) { if (num == 1) { SwaggiFunc.DisplayBigMessage($"{num} SECOND LEFT!", "{clock}", 1f, Color.red, Color.yellow); } else { SwaggiFunc.DisplayBigMessage($"{num} SECONDS LEFT!", "{clock}", 1f, Color.red, Color.yellow); } _solitude_ShownWarning = (byte)(20 - num); } else if (SolitudeTimeRemainingSeconds <= 60f && _solitude_ShownWarning <= 2) { SwaggiFunc.DisplayBigMessage("1 MINUTE LEFT!", "{clock}", 4f, Color.red, Color.yellow); _solitude_ShownWarning = 3; } else if (SolitudeTimeRemainingSeconds <= 300f && _solitude_ShownWarning <= 1) { if (SolitudeTimeLimitSeconds > 300f) { SwaggiFunc.DisplayBigMessage("5 MINUTES LEFT!", "{clock}", 4f, Color.yellow, Color.white); } _solitude_ShownWarning = 2; } else if (SolitudeTimeRemainingSeconds <= 600f && _solitude_ShownWarning <= 0) { if (SolitudeTimeLimitSeconds > 600f) { SwaggiFunc.DisplayBigMessage("10 MINUTES LEFT!", "{clock}", 4f, Color.yellow, Color.white); } _solitude_ShownWarning = 1; } } public static void Solitude_TimerOut(State state) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Invalid comparison between Unknown and I4 //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (_solitude_ShownWarning >= 100) { return; } if ((int)state != 2) { if ((int)state != 6) { SwaggiFunc.DisplayBigMessage("EXTRACTION STALLED", "{clock}", 0.2f, Color.red, Color.yellow); } return; } _solitude_ShownWarning = 100; if (GameManager.Multiplayer() && SemiFunc.IsMasterClient()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("Solitude_TimesUpSequenceRPC", (RpcTarget)0, Array.Empty()); } } } else { LevelStatsSyncing.instance?.Solitude_TimesUpSequenceRPC(); } } [IteratorStateMachine(typeof(d__46))] public static IEnumerator Solitude_TimesUp() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__46(0); } public static void Solitude_KillSelf() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) SwaggiFunc.DisplayBigMessage("NOT ENOUGH VALUABLES,\nTRY HARDER NEXT TIME.", "{!}", 4f, Color.white, Color.red); if (!PlayerAvatar.instance.isDisabled) { PlayerAvatar.instance.PlayerDeath(-1); } } public static bool Solitude_ShouldRevivePlayer() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Invalid comparison between Unknown and I4 if (Helpers.AllExtractionPointsCompleted) { return false; } ExtractionPoint extractionPointCurrent = Helpers.ExtractionPointCurrent; if ((Object)(object)extractionPointCurrent != (Object)null) { if (_solitudeGameOverSequence) { return false; } if (_solitudeCompletedSequence) { return true; } if ((int)extractionPointCurrent.currentState != 2) { return true; } return SolitudeTimeRemainingSeconds > 90f; } return false; } public static void Solitude_RevivePlayer(PlayerAvatar player) { //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_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)player.playerDeathHead == (Object)null || !player.isDisabled || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } Helpers.DeepLog("[Solitude] Reviving player!"); PhysGrabObject physGrabObject = player.playerDeathHead.physGrabObject; if (solitudeDeathTimers[player] < 40f) { if (physGrabObject.playerGrabbing.Count > 0) { return; } Vector3 velocity = physGrabObject.rb.velocity; if (((Vector3)(ref velocity)).magnitude > 0.01f) { return; } } player.Revive(false); if (GameManager.Multiplayer() && SemiFunc.IsMasterClient()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("Solitude_PlayerRevivedRPC", (RpcTarget)0, Array.Empty()); } } } else { LevelStatsSyncing.instance?.Solitude_PlayerRevivedRPC(); } } private static void Solitude_HandleDeadPlayers() { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!player.isDisabled) { if (solitudeDeathTimers.ContainsKey(player)) { solitudeDeathTimers.Remove(player); } } else if (!solitudeDeathTimers.ContainsKey(player)) { solitudeDeathTimers.Add(player, 0f); } } foreach (PlayerAvatar item in solitudeDeathTimers.Keys.ToList()) { if (solitudeDeathTimers[item] >= 10f) { Solitude_RevivePlayer(item); } } if (!Solitude_ShouldRevivePlayer() || Helpers.AllExtractionPointsCompleted) { return; } foreach (PlayerAvatar item2 in solitudeDeathTimers.Keys.ToList()) { solitudeDeathTimers[item2] += Time.deltaTime; } } } [HarmonyPatch(typeof(ExtractionPoint))] internal class ExtractionPointPatch { private static int TotalMapValueAtStartOfRound; [HarmonyPatch("HaulGoalSet")] [HarmonyPrefix] private static void HaulGoalSetPrefix(ref int value) { if (SemiFunc.RunIsShop()) { return; } int haulGoalMax = RoundDirector.instance.haulGoalMax; int extractionPoints = RoundDirector.instance.extractionPoints; int extractionPointsCompleted = RoundDirector.instance.extractionPointsCompleted; if (extractionPointsCompleted == 0) { TotalMapValueAtStartOfRound = haulGoalMax; } float num = 1f; if (Helpers.GetConfig(Plugin.Modify_HaulGoal) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Client) { num = SwaggiFunc.DetermineBaseQuotaDifficulty(Helpers.CurrentLevel); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { num *= 1.2f; } } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HighQuota)) { float num2 = Mathf.Abs(1f - num); num += Mathf.Clamp(num2 / 2f, 0.05f, 0.4f); } if (Helpers.GetConfig(Plugin.Modify_HaulGoal)) { value = SwaggiFunc.DetermineQuota(extractionPointsCompleted, extractionPoints, TotalMapValueAtStartOfRound, num); } else { value = Mathf.RoundToInt((float)value * num); } if (Plugin.DeepLog) { Helpers.DeepLog("[ExtractionPoint HaulGoalSet]\n" + $"total map value = {haulGoalMax:n0}\n" + $"extractions = {extractionPoints} / {extractionPointsCompleted}\n" + $"difficulty = {num:0.000}\n" + $"final quota = {value:n0}"); } } [HarmonyPatch("ActivateTheFirstExtractionPointAutomaticallyWhenAPlayerLeaveTruck")] [HarmonyPostfix] private static void ActivateTheFirstExtractionPointAutomaticallyWhenAPlayerLeaveTruckP() { LevelStatsManager.firstExtractionOpenedThisLevel = true; } private static bool CosmeticBoxInExtraction() { foreach (CosmeticWorldObject cosmeticWorldObject in RoundDirector.instance.cosmeticWorldObjects) { if (Object.op_Implicit((Object)(object)cosmeticWorldObject) && cosmeticWorldObject.inExtraction) { return true; } } return false; } [HarmonyPatch("DestroyTheFirstPhysObjectsInHaulList")] [HarmonyPrefix] private static void DestroyTheFirstPhysObjectsInHaulListP() { if (!SemiFunc.IsMasterClientOrSingleplayer() || CosmeticBoxInExtraction() || RoundDirector.instance.dollarHaulList.Count == 0 || !Object.op_Implicit((Object)(object)RoundDirector.instance.dollarHaulList[0])) { return; } ValuableObject component = RoundDirector.instance.dollarHaulList[0].GetComponent(); SurplusValuable component2 = RoundDirector.instance.dollarHaulList[0].GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (!component.discovered) { LevelStatsManager.nonDiscoveredValuablesBroken++; } SwaggiFunc.SharedDurability_HealAllPlayers(component.dollarValueCurrent, component.dollarValueCurrent >= 10000f); if (!Object.op_Implicit((Object)(object)component2)) { LevelStatsManager.AddValueExtracted(component.dollarValueCurrent); RunStatsManager.instance.totalValueExtracted += component.dollarValueCurrent; } } } [HarmonyPatch("DestroyAllPhysObjectsInHaulList")] [HarmonyPrefix] private static void DestroyAllPhysObjectsInHaulListP() { GlobalStatsManager.AddExtractionCompleted(); float num = 0f; foreach (ItemValuableBox valuableBoxHaul in RoundDirector.instance.valuableBoxHaulList) { if (Object.op_Implicit((Object)(object)valuableBoxHaul)) { LevelStatsManager.AddValueExtracted(valuableBoxHaul.ExtractionValue); num += valuableBoxHaul.ExtractionValue; } } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return; } foreach (GameObject dollarHaul in RoundDirector.instance.dollarHaulList) { ValuableObject component = dollarHaul.GetComponent(); SurplusValuable component2 = dollarHaul.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if (!component.discovered) { LevelStatsManager.nonDiscoveredValuablesBroken++; } num += component.dollarValueCurrent; if (!Object.op_Implicit((Object)(object)component2)) { LevelStatsManager.AddValueExtracted(component.dollarValueCurrent); } } } SwaggiFunc.SharedDurability_HealAllPlayers(num, forceHealEffect: true); if (SemiFunc.RunIsLevel()) { RunStatsManager.instance.extractionPointsCompleted++; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { foreach (PlayerAvatar item in MalfunctionManager.solitudeDeathTimers.Keys.ToList()) { MalfunctionManager.solitudeDeathTimers[item] = 999f; } } if (!MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { return; } foreach (EnemyParent item2 in EnemyDirector.instance.enemiesSpawned) { item2.DespawnedTimerSet(Random.Range(5f, 65f), true); } } [HarmonyPatch("SpawnTaxReturn")] [HarmonyPrefix] private static void SpawnTaxReturnP() { int extractionPointSurplus = RoundDirector.instance.extractionPointSurplus; if (extractionPointSurplus > 0) { RunStatsManager.instance.largestSurplusValue = Mathf.Max(extractionPointSurplus, RunStatsManager.instance.largestSurplusValue); GlobalStatsManager.SetLargestSurplusValue(extractionPointSurplus); } } [HarmonyPatch("SetHaulText")] [HarmonyPostfix] private static void SetHaulTextP(ref ExtractionPoint __instance, ref bool ___isShop, ref float ___haulBarTargetScale) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && !___isShop) { ((TMP_Text)__instance.haulGoalScreen).text = "$?????"; ___haulBarTargetScale = 1f; __instance.SetEmojiScreen("", false); } } [HarmonyPatch("CancelExtraction")] [HarmonyPrefix] private static bool CancelExtractionP(ref ExtractionPoint __instance, ref int ___haulCurrent) { if (!MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { return true; } if (!SemiFunc.RunIsLevel()) { return true; } if (MalfunctionManager._solitude_ShownWarning != byte.MaxValue) { return true; } int currentHaul = RoundDirector.instance.currentHaul; RoundDirector.instance.extractionHaulGoal = currentHaul; __instance.haulGoal = currentHaul; ___haulCurrent = currentHaul; return false; } } [HarmonyPatch(typeof(LevelGenerator))] internal class LevelGeneratorPatch { public static int modulesSpawned; public static int modulesTotal; public static int CurrentLevel => RunManager.instance.levelsCompleted + 1; public static int CurrentModCount => LevelGenerator.Instance.ModuleAmount; public static int CurrentExtCount => LevelGenerator.Instance.ExtractionAmount; [HarmonyPatch("GenerateDone")] [HarmonyPostfix] private static void GenerateDoneP() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown if (!((Object)(object)MalfunctionManager.soulstealerExplosion != (Object)null)) { ParticleScriptExplosion component = Resources.Load("Items/Item Grenade Explosive").GetComponent(); GameObject val = new GameObject("LS_PSE"); Object.DontDestroyOnLoad((Object)val); ParticleScriptExplosion obj = val.AddComponent(); obj.explosionPrefab = component.explosionPrefab; obj.explosionPreset = component.explosionPreset; MalfunctionManager.soulstealerExplosion = obj; } } [HarmonyPatch("SpawnModule")] [HarmonyPostfix] private static void SpawnModuleP() { modulesSpawned++; } [HarmonyPatch("ModuleGeneration")] [HarmonyPrefix] private static void ModuleGenerationP(ref LevelGenerator __instance) { modulesTotal = 0; for (int i = 0; i < __instance.LevelWidth; i++) { for (int j = 0; j < __instance.LevelHeight; j++) { if (__instance.LevelGrid[i, j].active) { modulesTotal++; } } } } private static int GetNewModuleCount() { if (!SemiFunc.RunIsLevel()) { return CurrentModCount; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { return Random.Range(5, 9); } int num = CurrentModCount; if (Helpers.GetConfig(Plugin.Modify_ModuleCount) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Client) { num = SwaggiFunc.DetermineNumberOfModules(CurrentLevel, GameDirector.instance.PlayerList.Count, RunManager.instance.levelCurrent.NarrativeName); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LargeMap)) { num += Mathf.Clamp(Mathf.RoundToInt((float)num * 0.4f), 6, 12); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { num = Mathf.Max(3, Mathf.CeilToInt((float)num / 2.33f)); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { num = Mathf.Max(3, Mathf.RoundToInt((float)num * 0.9f)); } if (Plugin.DeepLog) { Helpers.DeepLog($"[ModuleCount] {num}"); } return num; } private static int GetNewExtractionCount() { if (!SemiFunc.RunIsLevel()) { return CurrentExtCount; } int num = CurrentExtCount; if (Helpers.GetConfig(Plugin.Modify_ExtractionCount) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Client) { num = SwaggiFunc.DetermineNumberOfExtractions(CurrentLevel, GameDirector.instance.PlayerList.Count); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { num = Random.Range(1, 3); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LargeMap)) { num++; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { num = 0; } if (Plugin.DeepLog) { Helpers.DeepLog($"[ExtractionCount] {num}"); } return num; } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable TileGenerationTranspiler(IEnumerable inst) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Expected O, but got Unknown //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_0232: Expected O, but got Unknown List list = new List(inst); if (list.Count <= 20) { Plugin.loggy.LogError((object)"Less than 20 instructions were found in TileGeneration, this is abnormal."); return list; } int num = -1; for (int i = 3; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == AccessTools.Field(typeof(LevelGenerator), "ModuleAmount") && list[i + 1].opcode == OpCodes.Ldc_I4_3) { num = i - 3; break; } } if (num == -1) { Plugin.loggy.LogError((object)"Never found an insertion point for ModuleCount, unable to patch TileGeneration."); return list; } int num2 = -1; for (int j = 1; j < list.Count - 1; j++) { if (list[j].opcode == OpCodes.Ldarg_0 && list[j + 1].opcode == OpCodes.Ldc_I4_M1 && list[j + 4].opcode == OpCodes.Ldfld && (FieldInfo)list[j + 4].operand == AccessTools.Field(typeof(LevelGenerator), "ExtractionAmount")) { num2 = j - 1; break; } } if (num2 == -1) { Plugin.loggy.LogError((object)"Never found an insertion point for ExtractionCount, unable to patch TileGeneration."); return list; } List collection = new List { new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelGeneratorPatch), "GetNewModuleCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ModuleAmount")) }; List collection2 = new List { new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelGeneratorPatch), "GetNewExtractionCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ExtractionAmount")) }; list.InsertRange(num2, collection2); list.InsertRange(num, collection); return list; } [HarmonyPatch("Generate")] [HarmonyPrefix] private static void GenerateP() { modulesSpawned = 0; } } [BepInPlugin("Swaggies.LevelScaling", "LevelScaling", "1.3.6")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public enum ExtractedUIDisplayType { AlwaysTotalMapValue, AlwaysCurrentMapValue, Alternate } public enum FoundUIDisplayType { AlwaysTotal, AlwaysCurrent, Alternate } public enum HaulGoalRoundingOptions { RoundToOne, RoundToTen, RoundToHundred, RoundToThousand } public enum CompatibilityMode { Client, Host, None } public enum StatsUIShowOptions { DontDisplay, OnlyInLevel, OnlyInShop, LevelAndShop } public enum StatsUIValueOptions { DontDisplay, CurrentOnly, CurrentAndTotal } public enum StatsUISpriteOptions { OnlyText, OnlySprites, TextAndSprites } private const string _guid = "Swaggies.LevelScaling"; private const string _name = "LevelScaling"; public const string _ver = "1.3.6"; private readonly Harmony harmony = new Harmony("Swaggies.LevelScaling"); public static ManualLogSource loggy; public static bool LevelSimulationDisabled; public static bool Compatibility_SpawnConfig; public static bool MenuLibInstalled; public static ConfigEntry StatsUIShow_Base; public static ConfigEntry StatsUIShow_Map; public static ConfigEntry StatsUIShow_EndOfLevel; public static ConfigEntry StatsUIShow_Shop; public static ConfigEntry StatsUI_Flash; public static ConfigEntry StatsUI_UseSprites; public static ConfigEntry StatsUIShow_ExtractedUI; public static ConfigEntry StatsUIShow_FoundUI; public static ConfigEntry StatsUIShow_CosmeticsUI; public static ConfigEntry StatsUIDisplay_Challenge; public static ConfigEntry StatsUIDisplay_Malfunction; public static ConfigEntry StatsUIDisplay_Time; public static ConfigEntry StatsUIDisplay_Deaths; public static ConfigEntry StatsUIDisplay_OrbDrops; public static ConfigEntry StatsUIDisplay_Extracted; public static ConfigEntry StatsUIDisplay_Broken; public static ConfigEntry StatsUIDisplay_Found; public static ConfigEntry StatsUIDisplay_Explored; public static ConfigEntry StatsUIDisplay_Cosmetics; public static ConfigEntry StatsUI_YOffset; public static ConfigEntry StatsUI_LevelUI_XOffset; public static ConfigEntry StatsUI_LevelUI_YOffset; public static ConfigEntry StatsUI_LevelUI_Hide; public static ConfigEntry LSCompatibilityMode; public static ConfigEntry DetailedLoadingScreen; public static ConfigEntry ShowMenuButton_MainMenu; public static ConfigEntry ShowMenuButton_PauseScreen; public static ConfigEntry ShowMenuButton_LobbyMenu; public static ConfigEntry ShowVersionOnMainMenu; public static ConfigEntry DisableLevelSimulationMenu; public static ConfigEntry DeepLogging; public static ConfigEntry ChallengeGuarantee; public static ConfigEntry ChallengeDisableMoonPhase; public static ConfigEntry ChallengeChanceMultiplier; public static ConfigEntry ChallengeDisableLevelRequirements; public static ConfigEntry ChallengeTutorials; public static ConfigEntry ChallengeChanceMultiplier_LightsOut; public static ConfigEntry ChallengeChanceMultiplier_HighQuota; public static ConfigEntry ChallengeChanceMultiplier_LargeMap; public static ConfigEntry ChallengeChanceMultiplier_FoggyLevel; public static ConfigEntry ChallengeChanceMultiplier_IncreasedDamage; public static ConfigEntry ChallengeChanceMultiplier_FragileValuables; public static ConfigEntry ChallengeChanceMultiplier_OverOvercharge; public static ConfigEntry ChallengeChanceMultiplier_NoMap; public static ConfigEntry ChallengeChanceMultiplier_EnemyRush; public static ConfigEntry ChallengeChanceMultiplier_HiddenInformation; public static ConfigEntry ChallengeChanceMultiplier_DangerZone; public static ConfigEntry ChallengeChanceMultiplier_SharedDurability; public static ConfigEntry ChallengeStartingLevel_LightsOut; public static ConfigEntry ChallengeStartingLevel_HighQuota; public static ConfigEntry ChallengeStartingLevel_LargeMap; public static ConfigEntry ChallengeStartingLevel_FoggyLevel; public static ConfigEntry ChallengeStartingLevel_IncreasedDamage; public static ConfigEntry ChallengeStartingLevel_FragileValuables; public static ConfigEntry ChallengeStartingLevel_OverOvercharge; public static ConfigEntry ChallengeStartingLevel_NoMap; public static ConfigEntry ChallengeStartingLevel_EnemyRush; public static ConfigEntry ChallengeStartingLevel_HiddenInformation; public static ConfigEntry ChallengeStartingLevel_DangerZone; public static ConfigEntry ChallengeStartingLevel_SharedDurability; public static ConfigEntry Modify_ModuleCount; public static ConfigEntry ModuleCountDict; public static ConfigEntry ModuleCount_RandomMin; public static ConfigEntry ModuleCount_RandomMax; public static ConfigEntry ModuleCount_PerPlayer; public static ConfigEntry ModuleCount_PerPlayerMax; public static ConfigEntry ModuleCountMultiplier_HeadmanManor; public static ConfigEntry ModuleCountMultiplier_McJannekStation; public static ConfigEntry ModuleCountMultiplier_SwiftbroomAcademy; public static ConfigEntry ModuleCountMultiplier_MuseumOfHumanArt; public static ConfigEntry Modify_ExtractionCount; public static ConfigEntry ExtractionCountDict; public static ConfigEntry ExtractionCount_RandomMin; public static ConfigEntry ExtractionCount_RandomMax; public static ConfigEntry ExtractionCount_PerPlayer; public static ConfigEntry ExtractionCount_PerPlayerMax; public static ConfigEntry Modify_HaulGoal; public static ConfigEntry HaulGoalDict; public static ConfigEntry HaulGoal_ExtractionModifier; public static ConfigEntry HaulGoal_RoundingOptions; public static ConfigEntry Modify_TotalMapValue; public static ConfigEntry TotalMapValueDict; public static ConfigEntry TotalMapValue_RandomMin; public static ConfigEntry TotalMapValue_RandomMax; public static ConfigEntry TotalMapValue_PerPlayer; public static ConfigEntry TotalMapValue_PerPlayerMax; public static ConfigEntry Modify_Enemies; public static ConfigEntry EnemyTier1Dict; public static ConfigEntry EnemyTier2Dict; public static ConfigEntry EnemyTier3Dict; public static ConfigEntry Modify_EnemyHealth; public static ConfigEntry EnemyHealthDict; public static ConfigEntry EnemyHealth_PerPlayer; public static ConfigEntry EnemyHealth_PerPlayerMax; public static bool DeepLog => DeepLogging.Value; private void Awake() { loggy = Logger.CreateLogSource("Swaggies.LevelScaling"); CreateConfig(); if (DisableLevelSimulationMenu.Value) { LevelSimulationDisabled = true; loggy.LogMessage((object)"Level Simulation menu disabled."); } foreach (string key in Chainloader.PluginInfos.Keys) { if (!(key == "Index154.SpawnConfig")) { if (key == "nickklmao.menulib") { MenuLibInstalled = true; } } else { Compatibility_SpawnConfig = true; } } if (Compatibility_SpawnConfig) { loggy.LogWarning((object)"Warning! Some Challenges and Malfunctions will be disabled as SpawnConfig is installed."); ChallengeManager._blacklistedChallenges.Add(ChallengeManager.ChallengeType.EnemyRush); } if (!MenuLibInstalled) { loggy.LogWarning((object)"Warning! MenuLib is not installed - some features such as Level Simulation and Malfunctions (as host) cannot be used."); LevelSimulationDisabled = true; } harmony.PatchAll(Assembly.GetExecutingAssembly()); loggy.LogMessage((object)"LevelScaling's up and runnin' on 1.3.6"); GlobalStatsManager.LoadGlobalStats(); MalfunctionManager.Setup(); } private void CreateConfig() { CreateStatsUIConfig(); CreateMiscConfig(); CreateChallengeConfig(); CreateModuleConfig(); CreateExtractionConfig(); CreateHaulGoalConfig(); CreateTotalMapValueConfig(); CreateEnemyAmountsConfig(); CreateEnemyHealthMultiplierConfig(); } private void CreateStatsUIConfig() { //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Expected O, but got Unknown //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0307: Expected O, but got Unknown StatsUIShow_Base = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show always", false, "Whether the level stats are always displayed on screen (applies when changed)"); StatsUIShow_Map = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show when map is open", true, "Whether the level stats are displayed with the map open (if not, they will be hidden with the map open, overriding other settings) (applies when changed)"); StatsUIShow_EndOfLevel = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show at end of level", true, "Whether the level stats will be shown at the end of a level (will override Always Show and Show With Map) (applies when changed)"); StatsUIShow_Shop = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show in shop", false, "Whether the level stats are shown in the shop at all (requires Show Always or Show With Map) (applies when changed)"); StatsUI_Flash = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Flash on value change", true, "Make stats pop out by flashing them if their value changes (applies when changed)"); StatsUI_UseSprites = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Label Display Type", StatsUISpriteOptions.OnlyText, "Whether to display text, icons, or both as the orange text labels on the stats UI (applies when changed)"); StatsUIShow_ExtractedUI = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Extracted Value Display Type", ExtractedUIDisplayType.Alternate, "If the \"extracted value\" stats displays the total map value, or current remaining map value (taking broken valuables into account). Set to Alternate for automatically swapping between them every few seconds in-game (applies when changed)"); StatsUIShow_FoundUI = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Found Amount Display Type", FoundUIDisplayType.Alternate, "If the \"found valuables\" stat displays the total amount, or current remaining amount (subtracting broken valuables that have not been found yet). Set to Alternate for automatically swapping between them every few seconds in-game (applies when changed)"); StatsUIShow_CosmeticsUI = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Cosmetic Boxes Display Type", FoundUIDisplayType.AlwaysCurrent, "If the \"cosmetic boxes\" stat displays the total amount, or current remaining amount (subtracting broken boxes from total boxes spawned). Set to Alternate for automatically swapping between them every few seconds in-game (applies when changed)"); StatsUIDisplay_Malfunction = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Active Malfunction", StatsUIShowOptions.LevelAndShop, "Whether to display the active malfunction on the UI (applies when changed)"); StatsUIDisplay_Challenge = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Active Challenge", StatsUIShowOptions.LevelAndShop, "Whether to display the active challenge on the UI (applies when changed)"); StatsUIDisplay_Time = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Level Timer", StatsUIShowOptions.LevelAndShop, "Whether to display the level stopwatch on the UI (applies when changed)"); StatsUIDisplay_Deaths = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Death Count", StatsUIShowOptions.OnlyInShop, "Whether to display the number of deaths on the UI (applies when changed)"); StatsUIDisplay_OrbDrops = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Orb Drops Count", true, "Whether to display the number of orbs dropped from killed enemies on the UI (applies when changed)"); StatsUIDisplay_Extracted = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Value Extracted", StatsUIValueOptions.CurrentAndTotal, "Whether to display the amount of value extracted on the UI (applies when changed)"); StatsUIDisplay_Broken = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Value Broken", true, "Whether to display the amount of value broken on the UI (applies when changed)"); StatsUIDisplay_Found = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Valuables Found", StatsUIValueOptions.CurrentAndTotal, "Whether to display the number of valuables found on the UI (applies when changed)"); StatsUIDisplay_Explored = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Modules Explored", StatsUIValueOptions.CurrentAndTotal, "Whether to display the number of modules explored on the UI (applies when changed)"); StatsUIDisplay_Cosmetics = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Display Cosmetics Collected", StatsUIValueOptions.DontDisplay, "Whether to display the number of cosmetic boxes extracted on the UI (applies when changed)"); StatsUI_YOffset = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Y Offset", 80, new ConfigDescription("Change where to display the stats UI vertically (applies when stats ui is loaded)", (AcceptableValueBase)(object)new AcceptableValueRange(-150, 150), Array.Empty())); StatsUI_LevelUI_XOffset = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Level UI X Offset", 0, new ConfigDescription("Adjust the X offset for the vanilla Level Number UI so it doesn't overlap with the Level Stats UI (applies when stats ui is loaded)", (AcceptableValueBase)(object)new AcceptableValueRange(-350, 150), Array.Empty())); StatsUI_LevelUI_YOffset = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Level UI Y Offset", 0, new ConfigDescription("Adjust the Y offset for the vanilla Level Number UI so it doesn't overlap with the Level Stats UI (applies when stats ui is loaded)", (AcceptableValueBase)(object)new AcceptableValueRange(-350, 150), Array.Empty())); StatsUI_LevelUI_Hide = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Hide Level UI Completely", true, "Prevents the Level Number UI from showing up completely (applies when changed)"); } private void CreateMiscConfig() { LSCompatibilityMode = ((BaseUnityPlugin)this).Config.Bind("Misc", "Compatibility Mode", CompatibilityMode.None, "NONE - All LevelScaling features are enabled.\nHOST - All networked features (such as Malfunctions and Challenges) are disabled, but patched host-only features (like adjusting map value or module counts) are still enabled.\nCLIENT - All features that are not client-sided are disabled."); DetailedLoadingScreen = ((BaseUnityPlugin)this).Config.Bind("Misc", "Detailed loading screen", false, "Whether to show what the game is actively doing whilst loading a new level. (applies when changed) (HOST ONLY)"); ShowMenuButton_MainMenu = ((BaseUnityPlugin)this).Config.Bind("Misc", "Show Level Scaling button (Main Menu)", true, "Whether to show Level Scaling's menu button on the Main Menu. REQUIRES MENULIB. (applies when the main menu is loaded)"); ShowMenuButton_LobbyMenu = ((BaseUnityPlugin)this).Config.Bind("Misc", "Show Level Scaling button (Lobby Menu)", true, "Whether to show Level Scaling's menu button on the multiplayer Lobby Menu. REQUIRES MENULIB. (applies when the game initially starts up)"); ShowMenuButton_PauseScreen = ((BaseUnityPlugin)this).Config.Bind("Misc", "Show Level Scaling button (Pause Menu)", true, "Whether to show Level Scaling's menu button on the pause screen in-game. REQUIRES MENULIB. (applies when the game initially starts up)"); ShowVersionOnMainMenu = ((BaseUnityPlugin)this).Config.Bind("Misc", "Show Mod Version on Main Menu", true, "Whether to show Level Scaling's current version next to REPO's version in the main menu. (applies when the main menu is loaded)"); DisableLevelSimulationMenu = ((BaseUnityPlugin)this).Config.Bind("Misc", "Disable Level Simulation Menu", false, "Whether to disable the Level Simulation button (in case you want to prevent spoilers or something). (applies when the game initially starts up)"); DeepLogging = ((BaseUnityPlugin)this).Config.Bind("Misc", "Deep logging", false, "When enabled, Level Scaling will log a lot of information relating to the changes and patches that the mod makes. This will FLOOD your log file and likely lag your game a bit, but may help with debugging stuff. Keep this off if you're just using Level Scaling normally. (applies when changed)"); } private void CreateChallengeConfig() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Expected O, but got Unknown //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Expected O, but got Unknown //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Expected O, but got Unknown //IL_01ad: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Expected O, but got Unknown //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Expected O, but got Unknown //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Expected O, but got Unknown //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Expected O, but got Unknown //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Expected O, but got Unknown //IL_02df: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Expected O, but got Unknown //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Expected O, but got Unknown //IL_0344: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Expected O, but got Unknown //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Expected O, but got Unknown //IL_03a9: Unknown result type (might be due to invalid IL or missing references) //IL_03b3: Expected O, but got Unknown //IL_03dc: Unknown result type (might be due to invalid IL or missing references) //IL_03e6: Expected O, but got Unknown //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0418: Expected O, but got Unknown //IL_0441: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Expected O, but got Unknown //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_047e: Expected O, but got Unknown //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04b0: Expected O, but got Unknown //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04e3: Expected O, but got Unknown //IL_050c: Unknown result type (might be due to invalid IL or missing references) //IL_0516: Expected O, but got Unknown //IL_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0548: Expected O, but got Unknown //IL_0571: Unknown result type (might be due to invalid IL or missing references) //IL_057b: Expected O, but got Unknown ChallengeChanceMultiplier = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Chance multiplier", 0f, new ConfigDescription("Adjust the multiplier for the chance of a challenge level appearing. Set to 0 to disable challenges completely. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 3f), Array.Empty())); ChallengeGuarantee = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Guaranteed challenge levels", false, "Guarantees that every level will be a challenge level. Make sure Chance Multiplier is ABOVE 0. (applies before the start of each level) (HOST ONLY)"); ChallengeDisableMoonPhase = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Prevent on new moon phases", true, "When enabled, challenge levels cannot appear on levels when the moon phase switches. (applies before the start of each level) (HOST ONLY)"); ChallengeDisableLevelRequirements = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Disable level requirements", false, "When enabled, any challenge level can appear on any level number. (applies before the start of each level) (HOST ONLY)"); ChallengeTutorials = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Show tutorials", true, "When a challenge appears, info about it will be shown at the start of the level. (applies when changed)"); ChallengeChanceMultiplier_LightsOut = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Lights Out Weight", 30, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_HighQuota = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Overtime Weight", 50, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_LargeMap = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Enlarged Level Weight", 20, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_FoggyLevel = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Dense Fog Weight", 20, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_IncreasedDamage = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Increased Damage Weight", 30, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_FragileValuables = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Fragile Valuables Weight", 50, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_OverOvercharge = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Over-Overcharge Weight", 50, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_NoMap = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Broken Map Weight", 40, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_EnemyRush = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Enemy Rush Weight", 35, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_HiddenInformation = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Hidden Information Weight", 15, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_DangerZone = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Danger Zone Weight", 20, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeChanceMultiplier_SharedDurability = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Shared Durability Weight", 15, new ConfigDescription("Adjust the chance for this challenge to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); ChallengeStartingLevel_LightsOut = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Lights Out Starting Level", 3, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_HighQuota = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Overtime Starting Level", 7, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_LargeMap = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Enlarged Level Starting Level", 12, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_FoggyLevel = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Dense Fog Starting Level", 15, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_IncreasedDamage = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Increased Damage Starting Level", 5, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_FragileValuables = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Fragile Valuables Starting Level", 15, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_OverOvercharge = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Over-Overcharge Starting Level", 10, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_NoMap = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Broken Map Starting Level", 7, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_EnemyRush = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Enemy Rush Starting Level", 10, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_HiddenInformation = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Hidden Information Starting Level", 10, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_DangerZone = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Danger Zone Starting Level", 5, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ChallengeStartingLevel_SharedDurability = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Shared Durability Starting Level", 12, new ConfigDescription("Adjust which level this challenge can begin to appear. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); } private void CreateModuleConfig() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Expected O, but got Unknown //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Expected O, but got Unknown //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01fd: Expected O, but got Unknown Modify_ModuleCount = ((BaseUnityPlugin)this).Config.Bind("Modules", "Modify Module Count", true, "Whether Level Scaling should apply its progressive module counts for levels. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies at the start of each level) (HOST ONLY)"); ModuleCountDict = ((BaseUnityPlugin)this).Config.Bind("Modules", "Module Counts", "1:5,6:10,10:10,15:15", "Number of modules at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); ModuleCount_RandomMin = ((BaseUnityPlugin)this).Config.Bind("Modules", "Random Min", 0, new ConfigDescription("Minimum number of modules to randomly add to the base amount on each level. Negative numbers can make the map smaller. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-10, 10), Array.Empty())); ModuleCount_RandomMax = ((BaseUnityPlugin)this).Config.Bind("Modules", "Random Max", 0, new ConfigDescription("Maximum number of modules to randomly add to the base amount on each level. Negative numbers can make the map smaller. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-10, 10), Array.Empty())); ModuleCount_PerPlayer = ((BaseUnityPlugin)this).Config.Bind("Modules", "Modules Added Per Player", 0, new ConfigDescription("Number of added modules per player in the lobby. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-3, 3), Array.Empty())); ModuleCount_PerPlayerMax = ((BaseUnityPlugin)this).Config.Bind("Modules", "Accounted Players", 6, new ConfigDescription("Maximum number of players to account for when adding modules per player. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 9), Array.Empty())); ModuleCountMultiplier_HeadmanManor = ((BaseUnityPlugin)this).Config.Bind("Modules", "Multiplier - Headman Manor", 1f, new ConfigDescription("Module count multiplier for this specific level type. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); ModuleCountMultiplier_McJannekStation = ((BaseUnityPlugin)this).Config.Bind("Modules", "Multiplier - McJannek Station", 1f, new ConfigDescription("Module count multiplier for this specific level type. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); ModuleCountMultiplier_SwiftbroomAcademy = ((BaseUnityPlugin)this).Config.Bind("Modules", "Multiplier - Swiftbroom Academy", 1f, new ConfigDescription("Module count multiplier for this specific level type. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); ModuleCountMultiplier_MuseumOfHumanArt = ((BaseUnityPlugin)this).Config.Bind("Modules", "Multiplier - Museum Of Human Art", 1f, new ConfigDescription("Module count multiplier for this specific level type. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 2f), Array.Empty())); } private void CreateExtractionConfig() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown Modify_ExtractionCount = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Modify Extraction Count", true, "Whether Level Scaling should apply its progressive extraction counts for levels. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies at the start of each level) (HOST ONLY)"); ExtractionCountDict = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Extraction Counts", "1:1,2:2,4:3,6:4,15:5", "Number of extraction points at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); ExtractionCount_RandomMin = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Random Min", 0, new ConfigDescription("Minimum number of extractions to randomly add to the base amount on each level. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-5, 5), Array.Empty())); ExtractionCount_RandomMax = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Random Max", 0, new ConfigDescription("Maximum number of extractions to randomly add to the base amount on each level. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-5, 5), Array.Empty())); ExtractionCount_PerPlayer = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Added Per Player", 0, new ConfigDescription("Number of added extractions per player in the lobby. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(-3, 3), Array.Empty())); ExtractionCount_PerPlayerMax = ((BaseUnityPlugin)this).Config.Bind("Extractions", "Accounted Players", 3, new ConfigDescription("Maximum number of players to account for when adding extractions per player. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 5), Array.Empty())); } private void CreateHaulGoalConfig() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown Modify_HaulGoal = ((BaseUnityPlugin)this).Config.Bind("Haul Goal", "Modify Haul Goal", true, "Whether Level Scaling should apply its progressive quotas for extraction points in levels. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies when an extraction point is activated) (HOST ONLY)"); HaulGoalDict = ((BaseUnityPlugin)this).Config.Bind("Haul Goal", "Quota Difficulties", "1:0.28,2:0.420101553,3:0.421830773,4:0.425167978,5:0.430773318,6:0.439784467,7:0.454010934,8:0.473036349,9:0.486191958,10:0.4895968,11:0.510999858,12:0.531999946,13:0.553,14:0.573999941,15:0.595,16:0.616,17:0.637,18:0.658000052,19:0.679,20:0.7", "Quota difficulty at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated. (applies when an extraction point is activated) (HOST ONLY)"); HaulGoal_ExtractionModifier = ((BaseUnityPlugin)this).Config.Bind("Haul Goal", "Extraction Index Modifier", 0f, new ConfigDescription("Reduces the quota for earlier extraction points, raising it per extraction until it reaches the base value for the final extraction. (example: with this value set to 0.1, on a map with 4 extractions, the extraction modifier in order is as follows: 0.7x, 0.8x, 0.9x, then finally 1.0x; if set to 0.15, it would instead be: 0.55x, 0.7x, 0.85x, then 1.0x) (applies when an extraction point is activated) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 0.3f), Array.Empty())); HaulGoal_RoundingOptions = ((BaseUnityPlugin)this).Config.Bind("Haul Goal", "Placement Rounding Options", HaulGoalRoundingOptions.RoundToOne, "Which digit placement to round to (1s, 10s, 100s, 1000s). (applies when an extraction point is activated) (HOST ONLY)"); } private void CreateTotalMapValueConfig() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Expected O, but got Unknown //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown Modify_TotalMapValue = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Modify Total Map Value", true, "Whether Level Scaling should apply its progressive map values for levels. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies at the start of each level) (HOST ONLY)"); TotalMapValueDict = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Total Map Values ($K)", "1:30,10:180,20:250", "Total map value (in thousands of dollars) at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); TotalMapValue_RandomMin = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Random Multiplier Min", 1f, new ConfigDescription("Minimum random multiplier to total map value. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 1.5f), Array.Empty())); TotalMapValue_RandomMax = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Random Multiplier Max", 1f, new ConfigDescription("Maximum random multiplier to total map value. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 1.5f), Array.Empty())); TotalMapValue_PerPlayer = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Added Per Player", 0f, new ConfigDescription("Per-player modifier for total map value. (0.1 = +10% per player) (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 0.25f), Array.Empty())); TotalMapValue_PerPlayerMax = ((BaseUnityPlugin)this).Config.Bind("Total Map Value", "Accounted Players", 6, new ConfigDescription("Maximum number of players to account for when adding map value per player. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 9), Array.Empty())); } private void CreateEnemyAmountsConfig() { Modify_Enemies = ((BaseUnityPlugin)this).Config.Bind("Enemy Amounts", "Modify Enemy Amounts", true, "Whether Level Scaling should modify the number of enemies. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies at the start of each level) (HOST ONLY)"); EnemyTier1Dict = ((BaseUnityPlugin)this).Config.Bind("Enemy Amounts", "Tier 1 Enemies", "1:1,6:2,20:3", "Number of tier 1 enemies at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); EnemyTier2Dict = ((BaseUnityPlugin)this).Config.Bind("Enemy Amounts", "Tier 2 Enemies", "1:0,3:1,6:2,9:3,20:4", "Number of tier 2 enemies at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); EnemyTier3Dict = ((BaseUnityPlugin)this).Config.Bind("Enemy Amounts", "Tier 3 Enemies", "1:1,6:2,10:3,20:4", "Number of tier 3 enemies at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); } private void CreateEnemyHealthMultiplierConfig() { //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown Modify_EnemyHealth = ((BaseUnityPlugin)this).Config.Bind("Enemy Health", "Modify Enemy Health", false, "Whether Level Scaling should modify the amount of health that enemies have. If disabled, vanilla behaviour will take over, and all of the following config options will be ignored. (applies at the start of each level) (HOST ONLY)"); EnemyHealthDict = ((BaseUnityPlugin)this).Config.Bind("Enemy Health", "Health Percentages", "1:100", "Enemy health percentages at any given level. List of values that follow the format \"level:amount\", separated by commas. Values between gaps will be interpolated and rounded down. (applies at the start of each level) (HOST ONLY)"); EnemyHealth_PerPlayer = ((BaseUnityPlugin)this).Config.Bind("Enemy Health", "Added Per Player", 0, new ConfigDescription("Percentage of health to add per extra player in the lobby. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(0, 150), Array.Empty())); EnemyHealth_PerPlayerMax = ((BaseUnityPlugin)this).Config.Bind("Enemy Health", "Accounted Players", 6, new ConfigDescription("Maximum number of players to account for when adding enemy health per player. (applies at the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 9), Array.Empty())); } } [HarmonyPatch(typeof(ValuableDirector))] internal class ValuableDirectorPatch { [CompilerGenerated] private sealed class <>c__DisplayClass33_0 { public ValuableDirector director; internal bool b__0() { return director.setupComplete; } } [CompilerGenerated] private sealed class d__33 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ValuableDirector director; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__33(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitUntil((Func)new <>c__DisplayClass33_0 { director = director }.b__0); <>1__state = 1; return true; case 1: <>1__state = -1; Helpers.DeepLog("[ValuableDirector] SetupHost Postfix ------------"); DeepLogValuableAmounts(); 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 factor = 1f; private static readonly Dictionary _amountSpawned = new Dictionary { { (Type)0, 0 }, { (Type)1, 0 }, { (Type)2, 0 }, { (Type)3, 0 }, { (Type)4, 0 }, { (Type)5, 0 }, { (Type)6, 0 } }; public static int _amountSpawnedTotal = 0; private static int TotalMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("totalMaxAmount").GetValue(); private static int TinyMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("tinyMaxAmount").GetValue(); private static int SmallMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("smallMaxAmount").GetValue(); private static int MediumMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("mediumMaxAmount").GetValue(); private static int BigMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("bigMaxAmount").GetValue(); private static int WideMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("wideMaxAmount").GetValue(); private static int TallMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("tallMaxAmount").GetValue(); private static int VeryTallMaxAmount => Traverse.Create((object)ValuableDirector.instance).Field("veryTallMaxAmount").GetValue(); public static float TotalMaxValue => Traverse.Create((object)ValuableDirector.instance).Field("totalMaxValue").GetValue(); private static float NewValueCount() { float num = TotalMaxValue; factor = 1f; if (SemiFunc.RunIsLevel()) { if (Helpers.GetConfig(Plugin.Modify_TotalMapValue) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Client) { num = SwaggiFunc.DetermineMapValue(LevelGeneratorPatch.CurrentLevel, GameDirector.instance.PlayerList.Count); factor = Mathf.Clamp(num / TotalMaxValue, 1f, 10f); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HighQuota)) { num *= 1.4f; } } return num; } private static int MultiplyItemCount(int inAmount, Type type) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Expected I4, but got Unknown //IL_0027: 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) if (!Helpers.GetConfig(Plugin.Modify_TotalMapValue)) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HighQuota)) { return Mathf.RoundToInt((float)inAmount * 1.5f); } Helpers.DeepLog($"[MultiplyItemCount / {type}] out: {inAmount}"); return inAmount; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomValuableValue)) { inAmount = Mathf.Max(inAmount, 100); } float num = 1f; switch ((int)type) { case 0: num = 2.5f; break; case 1: num = 2f; break; case 2: num = 1.75f; break; case 3: num = 1.5f; break; case 4: num = 1.25f; break; case 5: num = 1.1f; break; case 6: num = 1.1f; break; } float num2 = num; if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.LowMapValue)) { num2 *= 0.75f; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HighQuota)) { num2 *= 1.5f; } int num3 = Mathf.RoundToInt((float)inAmount * num2 * factor); num3 = Mathf.Min(num3, (int)(80f * num)); Helpers.DeepLog($"[MultiplyItemCount / {type}] in: {inAmount}; mul: {num2:0.00}x; fac: {factor:0.00}x; out: {num3}"); return num3; } private static int NewTotalItemCount() { return 700; } private static int NewTinyItemCount() { return MultiplyItemCount(TinyMaxAmount, (Type)0); } private static int NewSmallItemCount() { return MultiplyItemCount(SmallMaxAmount, (Type)1); } private static int NewMediumItemCount() { return MultiplyItemCount(MediumMaxAmount, (Type)2); } private static int NewBigItemCount() { return MultiplyItemCount(BigMaxAmount, (Type)3); } private static int NewWideItemCount() { return MultiplyItemCount(WideMaxAmount, (Type)4); } private static int NewTallItemCount() { return MultiplyItemCount(TallMaxAmount, (Type)5); } private static int NewVeryTallItemCount() { return MultiplyItemCount(VeryTallMaxAmount, (Type)6); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable SetupHostTranspiler(IEnumerable inst) { //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Expected O, but got Unknown //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Expected O, but got Unknown //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Expected O, but got Unknown //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Expected O, but got Unknown //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Expected O, but got Unknown //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Expected O, but got Unknown //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Expected O, but got Unknown //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Expected O, but got Unknown //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Expected O, but got Unknown //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Expected O, but got Unknown //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028c: Expected O, but got Unknown //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Expected O, but got Unknown //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Expected O, but got Unknown //IL_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_02e7: Expected O, but got Unknown //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Expected O, but got Unknown //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Expected O, but got Unknown //IL_0338: Unknown result type (might be due to invalid IL or missing references) //IL_0342: Expected O, but got Unknown //IL_035c: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Expected O, but got Unknown //IL_036d: Unknown result type (might be due to invalid IL or missing references) //IL_0377: Expected O, but got Unknown //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Expected O, but got Unknown //IL_03b7: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Expected O, but got Unknown //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Expected O, but got Unknown //IL_03ee: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Expected O, but got Unknown //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Expected O, but got Unknown List list = new List(inst); if (list.Count <= 20) { Plugin.loggy.LogError((object)"Less than 20 instructions were found in SetupHost, this is abnormal, refusing to patch."); return list; } int num = -1; for (int i = 1; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Stfld && (FieldInfo)list[i].operand == AccessTools.Field(typeof(ValuableDirector), "veryTallMaxAmount") && list[i + 1].opcode == OpCodes.Call && (MethodInfo)list[i + 1].operand == AccessTools.Method(typeof(SemiFunc), "RunIsArena", (Type[])null, (Type[])null)) { num = i; break; } } if (num == -1) { Plugin.loggy.LogError((object)"Never found an insertion point, unable to patch SetupHost."); return list; } List collection = new List { new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewValueCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "totalMaxValue")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewTotalItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "totalMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewSmallItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "smallMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewMediumItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "mediumMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewBigItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "bigMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewWideItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "wideMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewVeryTallItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "veryTallMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewTallItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "tallMaxAmount")), new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(ValuableDirectorPatch), "NewTinyItemCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(ValuableDirector), "tinyMaxAmount")) }; list.InsertRange(num, collection); Plugin.loggy.LogDebug((object)"Successfully patched ValuableDirector.SetupHost"); return list; } private static void DeepLogValuableAmounts() { if (Plugin.DeepLog) { Helpers.DeepLog($"[ValuableDirector tiny] {_amountSpawned[(Type)0]} / {TinyMaxAmount}"); Helpers.DeepLog($"[ValuableDirector small] {_amountSpawned[(Type)1]} / {SmallMaxAmount}"); Helpers.DeepLog($"[ValuableDirector medium] {_amountSpawned[(Type)2]} / {MediumMaxAmount}"); Helpers.DeepLog($"[ValuableDirector big] {_amountSpawned[(Type)3]} / {BigMaxAmount}"); Helpers.DeepLog($"[ValuableDirector wide] {_amountSpawned[(Type)4]} / {WideMaxAmount}"); Helpers.DeepLog($"[ValuableDirector tall] {_amountSpawned[(Type)5]} / {TallMaxAmount}"); Helpers.DeepLog($"[ValuableDirector veryTall] {_amountSpawned[(Type)6]} / {VeryTallMaxAmount}"); Helpers.DeepLog($"[ValuableDirector total] {_amountSpawnedTotal} / {TotalMaxAmount}"); } } [HarmonyPatch("SetupHost")] [HarmonyPrefix] private static void SetupHostPre() { _amountSpawned.Clear(); _amountSpawned[(Type)0] = 0; _amountSpawned[(Type)1] = 0; _amountSpawned[(Type)2] = 0; _amountSpawned[(Type)3] = 0; _amountSpawned[(Type)4] = 0; _amountSpawned[(Type)5] = 0; _amountSpawned[(Type)6] = 0; _amountSpawnedTotal = 0; } [HarmonyPatch("SetupHost")] [HarmonyPostfix] private static void SetupHostP(ref ValuableDirector __instance) { if (Plugin.DeepLog) { ((MonoBehaviour)__instance).StartCoroutine(DeepLogValuableAmounts(__instance)); } } [IteratorStateMachine(typeof(d__33))] private static IEnumerator DeepLogValuableAmounts(ValuableDirector director) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__33(0) { director = director }; } [HarmonyPatch("SpawnValuable")] [HarmonyPostfix] private static void SpawnP(ref ValuableVolume _volume) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000e: 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) _amountSpawned[_volume.VolumeType]++; _amountSpawnedTotal++; } [HarmonyPatch("VolumesAndSwitchReadyRPC")] [HarmonyPostfix] private static void VolumesAndSwitchReadyRPCP(ref ValuableDirector __instance) { if (!MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { return; } ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val in array) { if (!((Object)(object)val == (Object)null)) { PhysGrabObjectImpactDetector component = ((Component)val).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.fragility = 100f; component.durability = 0f; } } } } } public class SemiSprites { public const string Smile = ""; public const string Extraction = ""; public const string Valuable = ""; public const string Kill = ""; public const string Death = ""; public const string Surplus = ""; public const string Broken = ""; public const string Explored = ""; public const string Challenge = ""; public const string Money = ""; public const string Quota = ""; public const string Enemy = ""; public const string EnemyHealth = ""; public const string Malfunction = ""; public const string Time = ""; public const string Void = ""; public const string Cosmetic = ""; } public class SoulstealersDeathHeadManager : MonoBehaviour { public static int managersIndex = 8626260; public static List managers = new List(); public const float SMALL_ORB_DISTANCE = 4f; public const float MEDIUM_ORB_DISTANCE = 5f; public const float LARGE_ORB_DISTANCE = 6f; public PlayerDeathHead deathHead; public PlayerAvatar playerAvatar; public ValuableObject nearestOrb; public bool isSelf; public float nearestOrbDistance = 999f; public short foundNearestOrbTier = -1; public float findOrbCooldown = 1.25f; public float reviveTimer = -1f; public bool reset; public PhotonView view; public void Setup(int viewId, bool self) { view = ((Component)this).gameObject.AddComponent(); view.ViewID = viewId; deathHead = ((Component)this).GetComponent(); playerAvatar = deathHead.playerAvatar; isSelf = self; Reset(); managers.Add(this); } public void Reset() { foundNearestOrbTier = -1; nearestOrbDistance = 999f; nearestOrb = null; findOrbCooldown = 1.25f; reviveTimer = -1f; reset = true; } private void Update() { if (!Object.op_Implicit((Object)(object)deathHead) || !playerAvatar.isDisabled) { if (!reset) { SendReset(); } return; } reset = false; findOrbCooldown -= Time.deltaTime; if (SemiFunc.IsMasterClientOrSingleplayer() && findOrbCooldown <= 0f) { FindOrb(); } RespawnLogic(); } private void SendReset() { //IL_0029: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { view.RPC("OnReviveRPC", (RpcTarget)0, Array.Empty()); } else { OnReviveRPC(); } } } public float GetReqDist(short tier) { float num = 3f; switch (tier) { case 1: num = 4f; break; case 2: num = 5f; break; case 3: num = 6f; break; } if (Helpers.AllPlayersDead()) { return num * 2f; } return num; } public void DestroyLinkedSoulOrb() { if (Object.op_Implicit((Object)(object)nearestOrb)) { nearestOrb.physGrabObject.impactDetector.DestroyObject(true); } } private void RespawnLogic() { //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (foundNearestOrbTier != -1) { reviveTimer = Mathf.Max(0f, reviveTimer - Time.deltaTime); Helpers.DeepLog($"ReviveTimer = {reviveTimer:0.000}s / isSelf = {isSelf}"); if (isSelf) { ItemInfoExtraUI.instance.ItemInfoText($"REVIVING IN {Mathf.CeilToInt(reviveTimer)}...", Color.green); } if (SemiFunc.IsMasterClientOrSingleplayer() && reviveTimer <= 0f && !nearestOrb.physGrabObject.impactDetector.destroyDisable) { DestroyLinkedSoulOrb(); playerAvatar.Revive(false); SendReset(); } } } private void FindOrb() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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) findOrbCooldown = 0.5f; Collider[] array = Physics.OverlapSphere(((Component)deathHead).transform.position, 10f, LayerMask.GetMask(new string[1] { "PhysGrabObject" })); float num = 10.67f; short num2 = -1; ValuableObject val = null; Collider[] array2 = array; for (int i = 0; i < array2.Length; i++) { ValuableObject componentInParent = ((Component)array2[i]).GetComponentInParent(); if (!Object.op_Implicit((Object)(object)componentInParent) || (Object)(object)((Component)componentInParent).GetComponent() == (Object)null || (Object)(object)componentInParent == (Object)(object)nearestOrb || componentInParent.physGrabObject.dead) { continue; } float num3 = Vector3.Distance(((Component)deathHead).transform.position, ((Component)componentInParent).transform.position); if (!(num3 > num) && (!((Object)(object)nearestOrb != (Object)null) || !(num3 > nearestOrbDistance))) { short num4 = 3; if (((Object)componentInParent).name.Contains("Medium")) { num4 = 2; } if (((Object)componentInParent).name.Contains("Small")) { num4 = 1; } if ((num2 <= 0 || num4 <= num2) && (foundNearestOrbTier <= 0 || num4 <= foundNearestOrbTier) && !(num3 > GetReqDist(num4))) { val = componentInParent; num2 = num4; num = num3; } } } if (foundNearestOrbTier == -1 && num2 != -1) { nearestOrb = val; nearestOrbDistance = num; SetFoundValuable(num2); } else if (foundNearestOrbTier > 0 && num2 > foundNearestOrbTier) { nearestOrb = null; nearestOrbDistance = 999f; SetFoundValuable(-1); } else if (Object.op_Implicit((Object)(object)nearestOrb) && (Vector3.Distance(((Component)nearestOrb).transform.position, ((Component)deathHead).transform.position) > GetReqDist(foundNearestOrbTier) || nearestOrb.physGrabObject.dead)) { nearestOrb = null; nearestOrbDistance = 999f; SetFoundValuable(-1); } } private void SetRespawnTimerFromTier(short tier) { switch (tier) { case 1: reviveTimer = 8.5f; break; case 2: reviveTimer = 6f; break; case 3: reviveTimer = 3.3f; break; default: reviveTimer = -1f; break; } Helpers.DeepLog($"set respawn timer to {reviveTimer}"); } private void SetFoundValuable(short tier) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (GameManager.Multiplayer()) { view.RPC("SetFoundValuableRPC", (RpcTarget)0, new object[1] { tier }); } else { SetFoundValuableRPC(tier); } } [PunRPC] public void SetFoundValuableRPC(short found, PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { CompareTier(found); foundNearestOrbTier = found; SetRespawnTimerFromTier(found); Helpers.DeepLog($"Synced found orb tier to {found}"); } } private void CompareTier(short newTier) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) Helpers.DeepLog($"Compare tier: {foundNearestOrbTier} / {newTier}"); if (newTier == -1 && foundNearestOrbTier != -1) { FlashDeathHeadEyesRed(); if (isSelf) { ItemInfoExtraUI.instance.ItemInfoText("LOST SOUL ORB ENERGY...", Color.red); } } else if (newTier > 0 && foundNearestOrbTier == -1) { FlashDeathHeadEyesGreen(); } } private void FlashDeathHeadEyesRed() { //IL_003e: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { deathHead.photonView.RPC("FlashEyeRPC", (RpcTarget)0, new object[1] { 0 }); } else { deathHead.FlashEyeRPC(0, default(PhotonMessageInfo)); } } } private void FlashDeathHeadEyesGreen() { //IL_003e: 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) if (SemiFunc.IsMasterClientOrSingleplayer()) { if (GameManager.Multiplayer()) { deathHead.photonView.RPC("FlashEyeRPC", (RpcTarget)0, new object[1] { 1 }); } else { deathHead.FlashEyeRPC(1, default(PhotonMessageInfo)); } } } [PunRPC] public void OnReviveRPC(PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Reset(); Helpers.DeepLog("Reset request."); } } } internal class SwaggiFunc { [CompilerGenerated] private sealed class <>c__DisplayClass17_0 { public float _bigMessageTimer; public string message; public string emoji; public float size; public Color main; public Color flash; } public static string es3Password = "Why would you want to cheat?... :o It's no fun. :') :'D"; public static float SharedDurability_overheal = 0f; private static float SharedDurability_lastHealTime = 0f; private static Coroutine _bigMessageCoroutine = null; public static int DetermineNumberOfModules(int level, int playerCount, string levelName, bool withoutRandomness = false) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomLevelSize)) { if (MalfunctionManager.IsLevelLargeMap(level, withoutRandomness)) { if (Random.Range(0, 2) != 0) { return Random.Range(16, 25); } return Random.Range(13, 19); } if (Random.Range(0, 10) != 0) { return Random.Range(3, 7); } return Random.Range(2, 5); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return (int)Mathf.Lerp(16f, 32f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { return 35; } if (withoutRandomness && (!Helpers.GetConfig(Plugin.Modify_ModuleCount) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client)) { int num = Mathf.Min(5 + level - 1, 10); if (level >= 11) { num += Mathf.Min(level - 10, 5); } return num; } int intFromConfig = Helpers.GetIntFromConfig(Plugin.ModuleCountDict, level); int num2 = 0; if (playerCount > 1) { for (int i = 1; i < Mathf.Min(playerCount, Helpers.GetConfig(Plugin.ModuleCount_PerPlayerMax)); i++) { num2 += Helpers.GetConfig(Plugin.ModuleCount_PerPlayer); } } int num3 = Helpers.GetConfig(Plugin.ModuleCount_RandomMin); int num4 = Mathf.Max(Helpers.GetConfig(Plugin.ModuleCount_RandomMin), Helpers.GetConfig(Plugin.ModuleCount_RandomMax)); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.LowMapValue)) { num3 = 1; num4 = 3; } int num5 = Random.Range(num3, num4 + 1); if (withoutRandomness) { num5 = (int)Mathf.Lerp((float)num3, (float)num4, 0.5f); } float num6 = 1f; switch (levelName.ToLower()) { case "headman manor": num6 = Helpers.GetConfig(Plugin.ModuleCountMultiplier_HeadmanManor); break; case "mcjannek station": num6 = Helpers.GetConfig(Plugin.ModuleCountMultiplier_McJannekStation); break; case "swiftbroom academy": num6 = Helpers.GetConfig(Plugin.ModuleCountMultiplier_SwiftbroomAcademy); break; case "museum of human art": num6 = Helpers.GetConfig(Plugin.ModuleCountMultiplier_MuseumOfHumanArt); break; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { num6 *= 0.8f; } int num7 = Mathf.RoundToInt((float)(intFromConfig + num2 + num5) * num6); if (num7 < 3) { Plugin.loggy.LogWarning((object)$"Module count of {num7} is less than 3, it will be clamped."); num7 = 3; } if (num7 > 32) { Plugin.loggy.LogWarning((object)$"Module count of {num7} is larger than 32, it will be clamped."); num7 = 32; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineNumberOfModules]\n" + $"base amount = {intFromConfig}\n" + $"player bonus = {num2} ({Helpers.GetConfig(Plugin.ModuleCount_PerPlayer)}/pl)\n" + $"random = {num5} ({num3}..{num4})\n" + $"level mul. = {num6:0.00}x ({levelName})\n" + $"final = {num7}"); } return num7; } public static int DetermineNumberOfExtractions(int level, int playerCount, bool withoutRandomness = false) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomLevelSize)) { if (MalfunctionManager.IsLevelLargeMap(level, withoutRandomness)) { if (Random.Range(0, 10) != 0) { return Random.Range(4, 10); } return Random.Range(3, 6); } return Random.Range(0, 2); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return (int)Mathf.Lerp(4f, 11f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { return 11; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { return 0; } if (withoutRandomness && (!Helpers.GetConfig(Plugin.Modify_ExtractionCount) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client)) { int num = DetermineNumberOfModules(level, playerCount, "none", withoutRandomness: true); if (num >= 15) { return 4; } if (num >= 10) { return 3; } if (num >= 8) { return 2; } if (num >= 6) { return 1; } return 0; } int intFromConfig = Helpers.GetIntFromConfig(Plugin.ExtractionCountDict, level); int num2 = 0; if (playerCount > 1) { for (int i = 1; i < Mathf.Min(playerCount, Helpers.GetConfig(Plugin.ExtractionCount_PerPlayerMax)); i++) { num2 += Helpers.GetConfig(Plugin.ExtractionCount_PerPlayer); } } int config = Helpers.GetConfig(Plugin.ExtractionCount_RandomMin); int config2 = Helpers.GetConfig(Plugin.ExtractionCount_RandomMax); int num3 = Random.Range(config, Mathf.Max(config, config2) + 1); if (withoutRandomness) { num3 = (int)Mathf.Lerp((float)config, (float)config2, 0.5f); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.LowMapValue)) { num3--; } int num4 = Mathf.RoundToInt((float)(intFromConfig + num2 + num3)); if (num4 < 1) { Plugin.loggy.LogWarning((object)$"Extraction point count of {num4} is less than 1, it will be clamped."); num4 = 1; } if (num4 > 15) { Plugin.loggy.LogWarning((object)$"Extraction point count of {num4} is larger than 15, it will be clamped."); num4 = 15; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineNumberOfExtractions]\n" + $"base amount = {intFromConfig}\n" + $"player bonus = {num2} ({Helpers.GetConfig(Plugin.ExtractionCount_PerPlayer)}/pl)\n" + $"random = {num3} ({config}..{config2})\n" + $"final = {num4}"); } return num4 - 1; } public static float DetermineBaseQuotaDifficulty(int level, bool withoutRandomness = false) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.QuotaDifficulty)) { return Mathf.Lerp(0.7f, 0.99f, Mathf.InverseLerp(1f, 20f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return Mathf.Lerp(0.67f, 0.95f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { return 0.99f; } if (withoutRandomness && (!Helpers.GetConfig(Plugin.Modify_HaulGoal) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client)) { if (Helpers.RGDM2(level) > 0f) { return 0.7f * RoundDirector.instance.haulGoalCurve2.Evaluate(Helpers.RGDM2(level)); } return 0.7f * RoundDirector.instance.haulGoalCurve1.Evaluate(Helpers.RGDM1(level)); } float num = Helpers.GetFloatFromConfig(Plugin.HaulGoalDict, level); if (num < 0.1f) { Plugin.loggy.LogWarning((object)$"Quota difficulty of {num} is less than 0.10, it will be clamped."); num = 0.1f; } if (num > 2f) { Plugin.loggy.LogWarning((object)$"Quota difficulty of {num} is larger than 2.00, it will be clamped."); num = 2f; } return num; } public static int DetermineQuota(int extractionsCompleted, int totalExtractions, float totalMapValue, float difficulty) { int num = totalExtractions - extractionsCompleted - 1; float num2 = 1f - Mathf.Clamp(Helpers.GetConfig(Plugin.HaulGoal_ExtractionModifier) * (float)num, 0f, 0.9f); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { num2 = 1f - Mathf.Clamp(0.0125f * (float)num, 0f, 0.1f); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { totalMapValue *= 1000f; } float num3 = totalMapValue * difficulty / (float)totalExtractions; float num4 = num3 * num2; int num5 = 1; switch (Helpers.GetConfig(Plugin.HaulGoal_RoundingOptions)) { case Plugin.HaulGoalRoundingOptions.RoundToTen: num5 = 10; break; case Plugin.HaulGoalRoundingOptions.RoundToHundred: num5 = 100; break; case Plugin.HaulGoalRoundingOptions.RoundToThousand: num5 = 1000; break; } int num6 = Mathf.RoundToInt(num4 * (float)num5) / num5; if (num6 < 1000) { Plugin.loggy.LogWarning((object)$"Haul goal of ${num6:n0} is less than 1000, it will be clamped."); num6 = 1000; } if (num6 > (int)totalMapValue) { Plugin.loggy.LogWarning((object)$"Haul goal of ${num6:n0} is larger than the total map value (${(int)totalMapValue:n0}), it will be clamped."); num6 = (int)totalMapValue; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineQuota]\n" + $"index = {num}\n" + $"index modifier = {num2:0.000}x\n" + $"base amount = {num3:0.0} ({num4:0.0})\n" + $"after rounding = {num6:n0}"); } return num6; } public static float DetermineMapValue(int level, int playerCount, bool withoutRandomness = false) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return (int)Mathf.Lerp(200f, 550f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { return 550f; } if (withoutRandomness && (!Helpers.GetConfig(Plugin.Modify_TotalMapValue) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client)) { if (Helpers.RGDM2(level) > 0f && !SemiFunc.RunIsArena()) { return Mathf.RoundToInt(ValuableDirector.instance.totalMaxValueCurve2.Evaluate(Helpers.RGDM2(level))); } return Mathf.RoundToInt(ValuableDirector.instance.totalMaxValueCurve1.Evaluate(Helpers.RGDM1(level))); } int num = Helpers.GetIntFromConfig(Plugin.TotalMapValueDict, level); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.LowMapValue)) { num /= 3; } float num2 = 1f; if (playerCount > 1) { for (int i = 1; i < Mathf.Min(playerCount, Helpers.GetConfig(Plugin.TotalMapValue_PerPlayerMax)); i++) { num2 += Helpers.GetConfig(Plugin.TotalMapValue_PerPlayer); } } float config = Helpers.GetConfig(Plugin.TotalMapValue_RandomMin); float config2 = Helpers.GetConfig(Plugin.TotalMapValue_RandomMax); float num3 = Random.Range(config, Mathf.Max(config, config2)); if (withoutRandomness) { num3 = Mathf.Lerp(config, config2, 0.5f); } int num4 = Mathf.RoundToInt((float)num * num2 * num3); if (num4 < 10) { Plugin.loggy.LogWarning((object)$"Total map value of ${num4}K is less than $10K, it will be clamped."); num4 = 10; } if (num4 > 999) { Plugin.loggy.LogWarning((object)$"Total map value of ${num4}K is larger than $999K, it will be clamped."); num4 = 999; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineMapValue]\n" + $"base amount = ${num}K\n" + $"player bonus = {num2:0.00}x (+{Helpers.GetConfig(Plugin.TotalMapValue_PerPlayer):0.00}x/pl)\n" + $"random = {num3}x ({config}..{config2})\n" + $"final = ${num4}K"); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { return (float)num4 / 1000f; } return num4; } public static int DetermineEnemiesOfTier(int level, int tier, int originalAmount = -1) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10)) { return MalfunctionManager.Formidable_EnemiesThisLevel(level); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return (int)Mathf.Lerp(1f, 10f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { return 10; } if (!Helpers.GetConfig(Plugin.Modify_Enemies) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client) { if (originalAmount != -1) { return originalAmount; } AnimationCurve val = EnemyDirector.instance.amountCurve1_1; float num = Helpers.RGDM2(level); switch (tier) { case 1: val = ((num > 0f) ? EnemyDirector.instance.amountCurve1_2 : EnemyDirector.instance.amountCurve1_1); break; case 2: val = ((num > 0f) ? EnemyDirector.instance.amountCurve2_2 : EnemyDirector.instance.amountCurve2_1); break; case 3: val = ((num > 0f) ? EnemyDirector.instance.amountCurve3_2 : EnemyDirector.instance.amountCurve3_1); break; } if (num > 0f) { return (int)val.Evaluate(num); } return (int)val.Evaluate(Helpers.RGDM1(level)); } ConfigEntry config = Plugin.EnemyTier1Dict; if (tier == 2) { config = Plugin.EnemyTier2Dict; } if (tier == 3) { config = Plugin.EnemyTier3Dict; } int num2 = Helpers.GetIntFromConfig(config, level); if (num2 < 0) { Plugin.loggy.LogWarning((object)$"Enemy number of {num2} is less than 0, it will be clamped."); num2 = 0; } if (num2 > 15) { Plugin.loggy.LogWarning((object)$"Enemy number of {num2} is larger than 15, it will be clamped."); num2 = 15; } Helpers.DeepLog($"[DetermineT{tier}Enemies] {num2}"); return num2; } public static int DetermineT1Enemies(int level, int originalAmount = -1) { return DetermineEnemiesOfTier(level, 1, originalAmount); } public static int DetermineT2Enemies(int level, int originalAmount = -1) { return DetermineEnemiesOfTier(level, 2, originalAmount); } public static int DetermineT3Enemies(int level, int originalAmount = -1) { return DetermineEnemiesOfTier(level, 3, originalAmount); } public static int DetermineEnemyHealthPercentage(int level, int playerCount) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10)) { return 50; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { return 100; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { return Mathf.Clamp(100 + level / 5 * 10, 100, 200); } if (!Helpers.GetConfig(Plugin.Modify_EnemyHealth) || Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.Client) { return 100; } int intFromConfig = Helpers.GetIntFromConfig(Plugin.EnemyHealthDict, level); int num = 0; if (playerCount > 1) { for (int i = 1; i < Mathf.Min(playerCount, Helpers.GetConfig(Plugin.EnemyHealth_PerPlayerMax)); i++) { num += Helpers.GetConfig(Plugin.EnemyHealth_PerPlayer); } } int num2 = Mathf.RoundToInt((float)intFromConfig * 5f) / 5; if (num2 < 50) { Plugin.loggy.LogWarning((object)$"Enemy health percentage of {num2}% is less than 50%, it will be clamped."); num2 = 50; } if (num2 > 1000) { Plugin.loggy.LogWarning((object)$"Enemy health percentage of {num2}% is larger than 1000%, it will be clamped."); num2 = 1000; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineEnemyHealthPercentage]\n" + $"base amount = {intFromConfig:0.0}\n" + $"player bonus = {num} ({Helpers.GetConfig(Plugin.EnemyHealth_PerPlayer)}/pl)\n" + $"final = {num2}"); } return num2; } public static float DetermineChallengeChance(int levelNumber, bool includeChanceModifiers = false) { float num = Mathf.Clamp(2.5f * Mathf.Sqrt(1.5f * (float)Mathf.Clamp(levelNumber - 3, 1, 100)), 0f, 30f); float num2 = (MalfunctionManager.IsMalfunctionActive() ? 1f : Helpers.GetConfig(Plugin.ChallengeChanceMultiplier)); if (includeChanceModifiers) { num = Mathf.Clamp(num * num2, 0f, 100f); if (levelNumber <= 3 || num2 == 0f) { num = 0f; } if (levelNumber % 5 == 0 && levelNumber <= 20 && Helpers.GetConfig(Plugin.ChallengeDisableMoonPhase)) { num = 0f; } if (Helpers.GetConfig(Plugin.ChallengeGuarantee)) { num = 100f; } if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { num = 0f; } } return num; } public static void SharedDurability_DamageAllPlayers(float valueLost, List targets) { //IL_0156: Unknown result type (might be due to invalid IL or missing references) if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { return; } List list = new List(); foreach (PlayerAvatar target in targets) { list.Add(target); } int num = Mathf.RoundToInt(Mathf.Min(valueLost, 500f) / 20f); if (valueLost > 500f) { num += Mathf.RoundToInt(Mathf.Min(valueLost - 500f, 500f) / 40f); } if (valueLost > 1500f) { num += Mathf.RoundToInt(Mathf.Min(valueLost - 1500f, 4900f) / 100f); } if (GameDirector.instance.PlayerList.Count == 2) { num = Mathf.CeilToInt((float)num * 0.8f); } if (GameDirector.instance.PlayerList.Count == 1) { num = Mathf.CeilToInt((float)num * 0.6f); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { num = Mathf.CeilToInt((float)num * 0.8f); } list.RemoveAll((PlayerAvatar m) => Traverse.Create((object)m).Field("isDisabled").GetValue()); int num2 = Mathf.Clamp(Mathf.CeilToInt((float)num / (float)list.Count), 1, 100); foreach (PlayerAvatar item in list) { item.playerHealth.HurtOther(num2, Vector3.zero, true, -1, false); } } public static void SharedDurability_HealAllPlayers(float value, bool forceHealEffect) { if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || !SemiFunc.IsMasterClientOrSingleplayer() || !ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.SharedDurability)) { return; } int num = (int)(value / 1000f); SharedDurability_overheal += value % 1000f; while (SharedDurability_overheal >= 1000f) { num++; SharedDurability_overheal -= 1000f; } if (num == 0) { return; } bool flag = forceHealEffect || Time.realtimeSinceStartup - SharedDurability_lastHealTime >= 0.5f; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!Traverse.Create((object)player).Field("isDisabled").GetValue()) { player.playerHealth.HealOther(num, flag); } } if (flag) { SharedDurability_lastHealTime = Time.realtimeSinceStartup; } } public static void DisplayBigMessage(string message, string emoji, float time, Color main, Color flash, float size = 25f) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) <>c__DisplayClass17_0 CS$<>8__locals0 = new <>c__DisplayClass17_0(); CS$<>8__locals0.message = message; CS$<>8__locals0.emoji = emoji; CS$<>8__locals0.size = size; CS$<>8__locals0.main = main; CS$<>8__locals0.flash = flash; CS$<>8__locals0._bigMessageTimer = time; if (Object.op_Implicit((Object)(object)BigMessageUI.instance)) { if (_bigMessageCoroutine != null) { ((MonoBehaviour)BigMessageUI.instance).StopCoroutine(_bigMessageCoroutine); } _bigMessageCoroutine = ((MonoBehaviour)BigMessageUI.instance).StartCoroutine(BigMessage()); } [IteratorStateMachine(typeof(<>c__DisplayClass17_0.<g__BigMessage|0>d))] IEnumerator BigMessage() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <>c__DisplayClass17_0.<g__BigMessage|0>d(0) { <>4__this = CS$<>8__locals0 }; } } public static void Soulstealers_SpawnExplosion(Vector3 breakPosition, float itemMass) { //IL_0116: Unknown result type (might be due to invalid IL or missing references) if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers) && !((Object)(object)MalfunctionManager.soulstealerExplosion == (Object)null)) { itemMass = Mathf.Clamp(itemMass, 0.5f, 8f); float num = 0.5f; int num2 = 5; int num3 = 10; float num4 = 0.9f; if (itemMass >= 1f) { num = 0.75f; num2 = 10; num3 = 20; num4 = 1f; } if (itemMass >= 2f) { num = 1f; num2 = 15; num3 = 40; num4 = 1f; } if (itemMass >= 3f) { num = 1.25f; num2 = 20; num3 = 60; num4 = 1.1f; } if (itemMass >= 4f) { num = 1.4f; num2 = 30; num3 = 75; num4 = 1.15f; } if (itemMass >= 5f) { num = 1.5f; num2 = 40; num3 = 90; num4 = 1.2f; } if (itemMass >= 6f) { num = 1.67f; num2 = 50; num3 = 120; num4 = 1.25f; } if (itemMass >= 7f) { num = 2f; num2 = 60; num3 = 150; num4 = 1.35f; } if (itemMass >= 8f) { num = 2.5f; num2 = 80; num3 = 250; num4 = 1.5f; } MalfunctionManager.soulstealerExplosion.Spawn(breakPosition, num, num2, num3, num4, false, false, 1f); } } public static void OnObjectExtracted(PhysGrabObject obj) { } } } namespace LevelScaling.Patches { [HarmonyPatch(typeof(BuildName))] internal class BuildNamePatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref BuildName __instance) { if (Plugin.ShowVersionOnMainMenu.Value) { TextMeshProUGUI component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { ((TMP_Text)component).text = ((TMP_Text)component).text + " (LS 1.3.6)"; } } } } [HarmonyPatch(typeof(ClownTrap))] internal class ClownTrapPatch { [HarmonyPatch("TrapStop")] [HarmonyPostfix] private static void TrapStopP(ref ClownTrap __instance) { if (SemiFunc.RunIsLevel()) { ValuableObject component = ((Component)__instance).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { LevelStatsManager.AddValueBroken(component.dollarValueCurrent); } } } } [HarmonyPatch(typeof(CosmeticWorldObject))] internal class CosmeticWorldObjectPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void Start() { LevelStatsManager.AddCosmeticBoxSpawn(); } [HarmonyPatch("ExtractRPC")] [HarmonyPostfix] private static void ExtractRPC(ref CosmeticWorldObject __instance, ref PhotonMessageInfo _info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info) && __instance.inExtraction) { LevelStatsManager.AddCosmeticBoxExtracted(); } } } [HarmonyPatch(typeof(EnemyDirector))] internal class EnemyDirectorPatch { private static int EnemiesT1 => EnemyDirector.instance.amountCurve1Value; private static int EnemiesT2 => EnemyDirector.instance.amountCurve2Value; private static int EnemiesT3 => EnemyDirector.instance.amountCurve3Value; private static int GetEnemies(Difficulty difficulty, int amount) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected I4, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) int num = 0; float num2 = 1f; switch ((int)difficulty) { case 0: num = SwaggiFunc.DetermineT1Enemies(LevelGeneratorPatch.CurrentLevel, amount); num2 = 1.55f; break; case 1: num = SwaggiFunc.DetermineT2Enemies(LevelGeneratorPatch.CurrentLevel, amount); num2 = 1.33f; break; case 2: num = SwaggiFunc.DetermineT3Enemies(LevelGeneratorPatch.CurrentLevel, amount); num2 = 1.17f; break; } if (Plugin.LSCompatibilityMode.Value == Plugin.CompatibilityMode.None && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush)) { num = Mathf.RoundToInt((float)num * num2) + 1; } Helpers.DeepLog($"[GetEnemies] tier: {difficulty} / amount: {num} ({amount})"); return num; } private static int NewEnemiesT1() { return GetEnemies((Difficulty)0, EnemiesT1); } private static int NewEnemiesT2() { return GetEnemies((Difficulty)1, EnemiesT2); } private static int NewEnemiesT3() { return GetEnemies((Difficulty)2, EnemiesT3); } [HarmonyPatch("AmountSetup")] [HarmonyTranspiler] private static IEnumerable AmountSetupTranspiler(IEnumerable inst) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Expected O, but got Unknown //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Expected O, but got Unknown //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Expected O, but got Unknown //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Expected O, but got Unknown //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Expected O, but got Unknown List list = new List(inst); if (list.Count <= 20) { Plugin.loggy.LogError((object)"Less than 20 instructions were found in AmountSetup, this is abnormal, refusing to patch."); return list; } int num = -1; for (int i = 1; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Ldfld && (FieldInfo)list[i].operand == AccessTools.Field(typeof(EnemyDirector), "enemyListCurrent")) { num = i + 2; break; } } if (num == -1) { Plugin.loggy.LogError((object)"Never found an insertion point, unable to patch AmountSetup."); return list; } List collection = new List { new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(EnemyDirectorPatch), "NewEnemiesT1", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(EnemyDirector), "amountCurve1Value")), new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(EnemyDirectorPatch), "NewEnemiesT2", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(EnemyDirector), "amountCurve2Value")), new CodeInstruction(OpCodes.Ldarg_0, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(EnemyDirectorPatch), "NewEnemiesT3", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(EnemyDirector), "amountCurve3Value")) }; list.InsertRange(num, collection); Plugin.loggy.LogDebug((object)"Successfully patched EnemyDirector.AmountSetup"); return list; } } [HarmonyPatch(typeof(EnemyHealth))] internal class EnemyHealthPatch { private static float playerRewardLastHealTime; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref EnemyHealth __instance) { float num = (float)SwaggiFunc.DetermineEnemyHealthPercentage(LevelGeneratorPatch.CurrentLevel, GameDirector.instance.PlayerList.Count) / 100f; if (num != 1f) { __instance.healthCurrent = Mathf.RoundToInt((float)__instance.healthCurrent * num); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { __instance.spawnValuable = true; __instance.spawnValuableMax = int.MaxValue; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { EnemyHealth obj = __instance; obj.healthCurrent /= 2; } } [HarmonyPatch("OnSpawn")] [HarmonyPostfix] private static void OnSpawnP(ref EnemyHealth __instance) { float num = (float)SwaggiFunc.DetermineEnemyHealthPercentage(LevelGeneratorPatch.CurrentLevel, GameDirector.instance.PlayerList.Count) / 100f; if (num != 1f) { __instance.healthCurrent = Mathf.RoundToInt((float)__instance.healthCurrent * num); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { EnemyHealth obj = __instance; obj.healthCurrent /= 2; } } [HarmonyPatch("Hurt")] [HarmonyPrefix] private static void HurtP(ref EnemyHealth __instance, ref int _damage) { int num = (int)((float)_damage * (1f - Mathf.Min(__instance.damageResistance, 1f))); if (__instance.healthCurrent - num <= 0) { EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { GlobalStatsManager.AddEnemyDamageDealt(componentInParent.enemyName, num); } } if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { return; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.DangerZone) && SemiFunc.IsMasterClientOrSingleplayer() && !Helpers.TruckLeaving) { bool flag = _damage >= __instance.healthCurrent; int num2 = Mathf.Min(_damage, __instance.healthCurrent); int num3 = Mathf.Clamp(Mathf.RoundToInt((float)(num2 / Mathf.Max(2, GameDirector.instance.PlayerList.Count))), 1, 500); bool flag2 = num3 >= 10 || Time.realtimeSinceStartup - playerRewardLastHealTime >= 0.5f; if (Plugin.DeepLog) { Helpers.DeepLog("[DangerZone] enemy damage\n" + $"revive players = {flag}\n" + $"damage dealt = {num2}\n" + $"player heal = {num3}"); } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Traverse.Create((object)player).Field("isDisabled").GetValue()) { if (flag) { player.Revive(false); } } else { player.playerHealth.HealOther(num3, flag2); } } if (flag2) { playerRewardLastHealTime = Time.realtimeSinceStartup; } } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { _damage = Mathf.CeilToInt((float)_damage * 1.33f); } Helpers.DeepLog($"[EnemyHurt Prefix] dmg: {_damage} / hp: {__instance.healthCurrent}"); } [HarmonyPatch("HurtRPC")] [HarmonyPostfix] private static void HurtRPCP(ref EnemyHealth __instance, ref int _damage) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { EnemyHealth obj = __instance; obj.healthCurrent -= _damage; } EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { GlobalStatsManager.AddEnemyDamageDealt(componentInParent.enemyName, _damage); Helpers.DeepLog($"[EnemyHurt Postfix] {componentInParent.enemyName} - dmg: {_damage} / hp: {__instance.healthCurrent}"); } } [HarmonyPatch("DeathRPC")] [HarmonyPostfix] private static void DeathRPCP(ref EnemyHealth __instance, ref PhotonMessageInfo _info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } int num = Mathf.Max(__instance.healthCurrent, 0); LevelStatsManager.AddEnemyKillRaw(); EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null)) { GlobalStatsManager.AddEnemyKilled(componentInParent.enemyName); if (num > 0) { GlobalStatsManager.AddEnemyDamageDealt(componentInParent.enemyName, num); } } } } [HarmonyPatch(typeof(EnemyParent))] internal class EnemyParentPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref EnemyParent __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { EnemyParent obj = __instance; obj.DespawnedTimeMin /= 5f; EnemyParent obj2 = __instance; obj2.DespawnedTimeMax /= 5f; } } [HarmonyPatch("Despawn")] [HarmonyPrefix] private static void DespawnP(ref EnemyParent __instance) { if (__instance.Enemy.HasHealth && __instance.Enemy.Health.healthCurrent <= 0 && SemiFunc.IsMasterClientOrSingleplayer()) { RunStatsManager.instance.enemyKills++; } } } [HarmonyPatch(typeof(EnemyRigidbody))] internal class EnemyRigidbodyPatch { private static readonly Dictionary grabForcesOriginal = new Dictionary(); [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref EnemyRigidbody __instance) { if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { GrabForce grabForceNeeded = __instance.grabForceNeeded; if (!grabForcesOriginal.ContainsKey(grabForceNeeded)) { grabForcesOriginal.Add(grabForceNeeded, grabForceNeeded.amount); } else { grabForceNeeded.amount = grabForcesOriginal[grabForceNeeded]; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomValuableValue) && grabForceNeeded.amount != 999999f && grabForceNeeded.amount > 0.1f) { grabForceNeeded.amount = Random.Range(8f, 21f); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush)) { grabForceNeeded.amount = grabForcesOriginal[grabForceNeeded] * 0.75f; } else if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10) && grabForceNeeded.amount > 0.1f) { grabForceNeeded.amount = 999999f; } Helpers.DeepLog($"[GrabForce] og: {grabForcesOriginal[grabForceNeeded]} / new: {grabForceNeeded.amount}"); } } } [HarmonyPatch(typeof(EnemyTickAnim))] internal class EnemyTickAnimPatch { [HarmonyPatch("OnHealthChanged")] [HarmonyPostfix] private static void OnHealthChangedP(ref EnemyTickAnim __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { __instance.enemy.Health.spawnValuable = true; } } } [HarmonyPatch(typeof(EnemyValuable))] internal class EnemyValuablePatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP() { LevelStatsManager.AddEnemyKill(); } } [HarmonyPatch(typeof(EnergyUI))] internal class EnergyUIPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref TextMeshProUGUI ___Text, ref TextMeshProUGUI ___textEnergyMax, ref Vector3 ___maxEnergyBasePosition) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)___Text) && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { ((TMP_Text)___textEnergyMax).transform.localPosition = ___maxEnergyBasePosition; ((TMP_Text)___Text).text = "??"; } } } [HarmonyPatch(typeof(EnvironmentDirector))] internal class EnvironmentDirectorPatch { private static float fogMultiplier = 1f; private static float currentFogMultiplier = 1f; private static float originalFogStartDistance = 0f; private static float originalFogEndDistance = 0f; private static float FogMultiplier => fogMultiplier * currentFogMultiplier; [HarmonyPatch("Setup")] [HarmonyPostfix] private static void SetupP(ref Camera ___MainCamera) { if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { originalFogEndDistance = RenderSettings.fogEndDistance; originalFogStartDistance = RenderSettings.fogStartDistance; fogMultiplier = 1f; currentFogMultiplier = 1f; if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut)) { fogMultiplier = (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel) ? 0.9f : 0.75f); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { currentFogMultiplier = 0.3f; } SetValues(___MainCamera); } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref Camera ___MainCamera, ref bool ___SetupDone) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel) && ___SetupDone && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { currentFogMultiplier = 0.3f + (1f + Mathf.Sin(LevelStatsManager.thisLevelTime / -15f)) * 0.125f; SetValues(___MainCamera); } } private static void SetValues(Camera mainCamera) { RenderSettings.fogStartDistance = originalFogStartDistance * FogMultiplier; RenderSettings.fogEndDistance = originalFogEndDistance * FogMultiplier; mainCamera.farClipPlane = RenderSettings.fogEndDistance + 1f; } } [HarmonyPatch(typeof(GameDirector))] internal class GameDirectorPatch { [CompilerGenerated] private sealed class d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; LevelStatsUI.instance.hideTime = 12f; 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 VideoClip cache; private static VideoClip Clip { get { if ((Object)(object)cache == (Object)null) { VideoClip[] array = Resources.FindObjectsOfTypeAll(); foreach (VideoClip val in array) { if (((Object)val).name == "Video Overlay") { cache = val; break; } } } return cache; } } [HarmonyPatch("gameStateStart")] [HarmonyPostfix] private static void gameStateStartP(ref float ___gameStateTimer) { if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && !(___gameStateTimer > 0f) && SemiFunc.RunIsLevel() && ChallengeManager.currentChallenges.Count != 0) { if (SemiFunc.IsMasterClientOrSingleplayer()) { RunStatsManager.instance.challengesCompleted += ChallengeManager.currentChallenges.Count; } GlobalStatsManager.AddChallengesCompleted(ChallengeManager.currentChallenges.Count); GlobalStatsManager._challengesSetLevelName = RunManager.instance.levelCurrent.NarrativeName; GlobalStatsManager._challengesSetAmount = ChallengeManager.currentChallenges.Count; if (Plugin.ChallengeTutorials.Value) { ChallengeManager.Challenge challenge = ChallengeManager.GetChallenge(ChallengeManager.currentChallenges[0]); string name = challenge.name; string info = challenge.info; TutorialDirector.instance.delayBeforeTip = 1.5f; TutorialDirector.instance.showTipTimer = 12f; TutorialDirector.instance.showTipTime = 12f; TutorialUI.instance.SetTipPage(Clip, "" + name + ": " + info + "
", false); ((MonoBehaviour)GameDirector.instance).StartCoroutine(HideStatsCoroutine()); } } } [IteratorStateMachine(typeof(d__4))] private static IEnumerator HideStatsCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0); } } [HarmonyPatch(typeof(GoalUI))] internal class GoalUIPatch { private static TMP_SpriteAsset _spriteAsset; public static TMP_SpriteAsset SpriteAsset { get { if (Object.op_Implicit((Object)(object)_spriteAsset)) { return _spriteAsset; } _spriteAsset = ((TMP_Text)BigMessageUI.instance.emojiText).spriteAsset; return _spriteAsset; } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref GoalUI __instance, ref TextMeshProUGUI ___Text) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { if ((Helpers.CurrentLevel == 1 && LevelStatsManager.thisLevelTime < 120f && MalfunctionManager.SolitudeTimeRemainingSeconds > 120f) || !LevelStatsManager.firstExtractionOpenedThisLevel) { ((TMP_Text)___Text).text = ""; ((SemiUI)__instance).Hide(); } else if (Helpers.AllExtractionPointsCompleted) { ((TMP_Text)___Text).spriteAsset = SpriteAsset; ((TMP_Text)___Text).text = " COMPLETE"; ((SemiUI)__instance).Hide(); } else { int num = Mathf.CeilToInt(MalfunctionManager.SolitudeTimeRemainingSeconds); int num2 = Mathf.FloorToInt((float)(num / 60)); ((TMP_Text)___Text).text = $"{num2:00}:{num % 60:00} PATIENCE"; } } } public static void FlashRed() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) ((SemiUI)GoalUI.instance).SemiUISpringShakeY(12f, 10f, 0.2f); ((SemiUI)GoalUI.instance).SemiUISpringScale(0.3f, 0.5f, 0.3f); ((SemiUI)GoalUI.instance).SemiUITextFlashColor(Color.red, 0.3f); } public static void FlashGreen() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) ((SemiUI)GoalUI.instance).SemiUISpringShakeY(15f, 10f, 0.2f); ((SemiUI)GoalUI.instance).SemiUISpringScale(0.5f, 0.5f, 0.3f); ((SemiUI)GoalUI.instance).SemiUITextFlashColor(Color.green, 0.3f); } } [HarmonyPatch(typeof(HaulUI))] internal class HaulUIPatch { public static float Solitude_GoalSwitchTimer; public static bool Solitude_GoalSwitch; [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref HaulUI __instance, ref TextMeshProUGUI ___Text, ref int ___currentHaulValue) { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) if (Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || !SemiFunc.RunIsLevel()) { return; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { ((TMP_Text)___Text).spriteAsset = GoalUIPatch.SpriteAsset; ExtractionPoint extractionPointCurrent = Helpers.ExtractionPointCurrent; if ((Object)(object)extractionPointCurrent == (Object)null) { return; } int haulGoal = extractionPointCurrent.haulGoal; if (haulGoal == 0) { return; } float num = ((___currentHaulValue >= MalfunctionManager.SolitudeRequiredQuota) ? 1f : 0f); string text = (Solitude_GoalSwitch ? "" : ""); Solitude_GoalSwitchTimer = Mathf.MoveTowards(Solitude_GoalSwitchTimer, num, Time.deltaTime); if (Solitude_GoalSwitchTimer == 1f && !Solitude_GoalSwitch) { Solitude_GoalSwitch = true; ((SemiUI)__instance).SemiUISpringShakeY(10f, 10f, 0.3f); ((SemiUI)__instance).SemiUISpringScale(0.05f, 5f, 0.2f); ((SemiUI)__instance).SemiUITextFlashColor(Color.yellow, 0.3f); } if (Solitude_GoalSwitchTimer == 0f && Solitude_GoalSwitch) { Solitude_GoalSwitch = false; ((SemiUI)__instance).SemiUISpringShakeY(10f, 10f, 0.3f); ((SemiUI)__instance).SemiUISpringScale(0.05f, 5f, 0.2f); ((SemiUI)__instance).SemiUITextFlashColor(Color.blue, 0.3f); } string text2 = "$"; string oldValue = text2 + "" + SemiFunc.DollarGetString(Helpers.ExtractionHaulGoal); string newValue = (Solitude_GoalSwitch ? (text2 + "" + SemiFunc.DollarGetString(haulGoal) + " " + text) : (text2 + SemiFunc.DollarGetString(MalfunctionManager.SolitudeRequiredQuota) + " " + text)); ((TMP_Text)___Text).text = ((TMP_Text)___Text).text.Replace(oldValue, newValue); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { string text3 = "$"; string oldValue2 = text3 + SemiFunc.DollarGetString(Mathf.Max(0, ___currentHaulValue)); ((TMP_Text)___Text).text = ((TMP_Text)___Text).text.Replace(oldValue2, text3 + "?????"); } } } [HarmonyPatch(typeof(HealthUI))] internal class HealthUIPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref TextMeshProUGUI ___Text) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && Object.op_Implicit((Object)(object)___Text)) { ((TMP_Text)___Text).text = "???"; } } } [HarmonyPatch(typeof(ItemValuableBox))] internal class ItemValuableBoxPatch { public static List absorbingObjects = new List(); [HarmonyPatch("DestroyEffect")] [HarmonyPostfix] private static void DestroyEffect(ref ItemValuableBox __instance) { if (__instance.CurrentValue > 0f) { LevelStatsManager.AddValueBroken(__instance.CurrentValue); } } [HarmonyPatch("StartAbsorbLocal")] [HarmonyPrefix] private static void StartAbsorbLocal(ref PhysGrabObject target) { absorbingObjects.Add(target); SurplusValuable component = ((Component)target).GetComponent(); ValuableObject component2 = ((Component)target).GetComponent(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component2)) { LevelStatsManager.AddValueExtracted(0f - component2.dollarValueCurrent); } } } [HarmonyPatch(typeof(LevelUI))] internal class LevelUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void Start(ref LevelUI __instance) { //IL_0003: 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_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) LevelUI obj = __instance; ((SemiUI)obj).showPosition = ((SemiUI)obj).showPosition + new Vector2((float)Plugin.StatsUI_LevelUI_XOffset.Value, (float)Plugin.StatsUI_LevelUI_YOffset.Value); } [HarmonyPatch("Update")] [HarmonyPrefix] private static void Update(ref LevelUI __instance) { if (Plugin.StatsUI_LevelUI_Hide.Value) { ((SemiUI)__instance).Hide(); ((SemiUI)__instance).showTimer = 0f; } } } [HarmonyPatch(typeof(LightManager))] internal class LightManagerPatch { [HarmonyPatch("Update")] [HarmonyPostfix] private static void SetupP(ref LightManager __instance, ref bool ___turnOffLights, ref bool ___turningOffLights, ref bool ___turningOffEmissions) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Invalid comparison between Unknown and I4 if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut) && (int)GameDirector.instance.currentState == 2 && Object.op_Implicit((Object)(object)PlayerAvatar.instance) && !___turnOffLights) { ((MonoBehaviour)__instance).StopAllCoroutines(); ___turningOffLights = true; ((MonoBehaviour)__instance).StartCoroutine(__instance.TurnOffLights()); ___turningOffEmissions = true; ((MonoBehaviour)__instance).StartCoroutine(__instance.TurnOffEmissions()); ___turnOffLights = true; } } } [HarmonyPatch(typeof(LoadingUI))] internal class LoadingUIPatch { private static TextMeshProUGUI loadingText; [HarmonyPatch("LevelAnimationStart")] [HarmonyPostfix] private static void LevelAnimationStartP(ref LoadingUI __instance) { if (ChallengeManager.currentChallenges.Count == 0) { return; } string text = ""; for (int i = 0; i < ChallengeManager.currentChallenges.Count; i++) { text += ChallengeManager.GetChallenge(ChallengeManager.currentChallenges[i]).name; if (i != ChallengeManager.currentChallenges.Count - 1) { text += " + "; } } text = text.ToUpper(); ((TMP_Text)__instance.levelNumberText).text = "CHALLENGE LEVEL: " + text + ""; ((TMP_Text)__instance.levelNameText).text = "" + ((TMP_Text)__instance.levelNameText).text + ""; } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref LoadingUI __instance) { //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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Expected I4, but got Unknown if (!Plugin.DetailedLoadingScreen.Value) { return; } if ((Object)(object)loadingText == (Object)null) { Transform transform = ((Component)__instance).transform; loadingText = ((transform != null) ? ((Component)transform.Find("[ROTATE ALL]/[SHAKE FRONT]/Loading Text")).GetComponent() : null); } if ((Object)(object)loadingText == (Object)null || (Object)(object)LevelGenerator.Instance == (Object)null) { return; } Traverse val = Traverse.Create((object)LevelGenerator.Instance); Room currentRoom = PhotonNetwork.CurrentRoom; int num = ((currentRoom == null) ? 1 : currentRoom.PlayerCount); if (LevelGenerator.Instance.Generated) { ((TMP_Text)loadingText).text = "LOADING"; return; } LevelState state = LevelGenerator.Instance.State; switch ((int)state) { case 0: case 15: ((TMP_Text)loadingText).text = "LOADING"; break; case 1: ((TMP_Text)loadingText).text = "WAITING FOR OTHERS"; break; case 2: ((TMP_Text)loadingText).text = "SETTING UP TILES"; break; case 3: ((TMP_Text)loadingText).text = "SETTING UP START ROOM"; break; case 4: ((TMP_Text)loadingText).text = "SETTING UP CONNECTORS"; break; case 5: ((TMP_Text)loadingText).text = $"GENERATING MODULES ({LevelGeneratorPatch.modulesSpawned}/{LevelGeneratorPatch.modulesTotal})"; break; case 6: ((TMP_Text)loadingText).text = "GENERATING BLOCKERS"; break; case 7: ((TMP_Text)loadingText).text = "WAITING FOR HOST TO GENERATE LEVEL"; break; case 8: { int value4 = val.Field("ModulesReadyPlayers").GetValue(); ((TMP_Text)loadingText).text = $"WAITING FOR OTHERS ({value4}/{num})"; break; } case 9: ((TMP_Text)loadingText).text = "SETTING UP LEVEL POINTS"; break; case 10: ((TMP_Text)loadingText).text = "SETTING UP ITEMS"; break; case 11: { int num2 = Mathf.FloorToInt(Traverse.Create((object)ValuableDirector.instance).Field("totalCurrentValue").GetValue()); int value3 = Traverse.Create((object)ValuableDirector.instance).Field("valuableSpawnPlayerReady").GetValue(); if (value3 > 0) { ((TMP_Text)loadingText).text = $"SYNCING VALUABLES ({value3}/{num})"; } else { ((TMP_Text)loadingText).text = $"SPAWNING VALUABLES ({num2}/{Mathf.RoundToInt(ValuableDirectorPatch.TotalMaxValue)}K)"; } break; } case 12: ((TMP_Text)loadingText).text = "SETTING UP PLAYERS"; break; case 13: { int value2 = val.Field("playerSpawned").GetValue(); ((TMP_Text)loadingText).text = $"SPAWNING PLAYERS ({value2}/{num})"; break; } case 14: { int value = val.Field("EnemyReadyPlayers").GetValue(); ((TMP_Text)loadingText).text = $"SETTING UP ENEMIES ({value}/{num})"; break; } } } } [HarmonyPatch(typeof(MapModule))] internal class MapModulePatch { [HarmonyPatch("Hide")] [HarmonyPrefix] private static void HideP(ref bool ___animating) { if (!___animating) { LevelStatsManager.AddModuleExplored(); PlayerControllerPatch.Malfunc_NewRoom(); } } } [HarmonyPatch(typeof(Map))] internal class MapPatch { [HarmonyPatch("AddRoomVolume")] [HarmonyPostfix] private static void AddRoomVolumeP(ref Map __instance) { if (SemiFunc.RunIsLevel()) { LevelStatsManager.totalModules = __instance.MapModules.Count; } } } [HarmonyPatch(typeof(MapToolController))] internal class MapToolControllerPatch { public static bool mapToolActive; private static DirtFinderMapPlayer mapPlayerInstance; [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref bool ___Active, ref PhotonView ___photonView) { if (!GameManager.Multiplayer() || ___photonView.IsMine) { mapToolActive = ___Active; } } [HarmonyPatch(typeof(DirtFinderMapPlayer), "Awake")] [HarmonyPostfix] private static void AwakeP(ref DirtFinderMapPlayer __instance) { mapPlayerInstance = __instance; } private static void SpoofPosition() { //IL_0030: 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) if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { ((Component)mapPlayerInstance).transform.position = new Vector3(-1234567f, 0f, 7654321f); ((Component)mapPlayerInstance).transform.rotation = Quaternion.identity; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyTranspiler] private static IEnumerable LogicTranspiler(IEnumerable inst) { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown List list = new List(inst); if (list.Count <= 10) { Plugin.loggy.LogError((object)"Less than 10 instructions were found in Logic, this is abnormal, refusing to patch."); return list; } int num = -1; for (int i = 1; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Stfld && (FieldInfo)list[i].operand == AccessTools.Field(typeof(Map), "PlayerLayer") && list[i + 1].opcode == OpCodes.Ldarg_0) { num = i; break; } } if (num == -1) { Plugin.loggy.LogError((object)"Never found an insertion point, unable to patch Logic."); return list; } List collection = new List { new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MapToolControllerPatch), "SpoofPosition", (Type[])null, (Type[])null)) }; list.InsertRange(num, collection); Plugin.loggy.LogDebug((object)"Successfully patched DirtFinderMapPlayer.Logic"); return list; } } [HarmonyPatch(typeof(MenuPageLobby))] internal class MenuPageLobbyPatch { [HarmonyPatch("PlayerAdd")] [HarmonyPostfix] private static void PlayerAddP() { if (Plugin.LSCompatibilityMode.Value >= Plugin.CompatibilityMode.None) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { instance.photonView.RPC("SyncMalfunctionRPC", (RpcTarget)0, new object[1] { (int)MalfunctionManager.activeMalfunction }); } } } } [HarmonyPatch(typeof(MenuPageMain))] internal class MenuPageMainPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref MenuPageMain __instance) { if (!Plugin.MenuLibInstalled) { return; } try { MenusManager.Start(__instance); } catch { } } } [HarmonyPatch(typeof(MenuPageSaves))] internal class MenuPageSavesPatch { private static TextMeshProUGUI noSaveText; private static TextMeshProUGUI tableTextLeftSide; private static TextMeshProUGUI tableTextRightSide; private static TextMeshProUGUI tableTextLeftSideValues; private static TextMeshProUGUI tableTextRightSideValues; private static TextMeshProUGUI malfunction; [HarmonyPatch("SaveFileSelected")] [HarmonyPostfix] private static void SaveFileSelectedP(ref MenuPageSaves __instance, ref string saveFolderName) { //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Expected O, but got Unknown //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown string text = Application.persistentDataPath + "/saves/" + saveFolderName + "/LevelScaling.es3"; string text2 = Application.persistentDataPath + "/saves/" + saveFolderName + "/" + saveFolderName + ".es3"; if (!File.Exists(text) || !File.Exists(text2)) { ((Component)noSaveText).gameObject.SetActive(true); ((Component)tableTextLeftSide).gameObject.SetActive(false); ((Component)tableTextRightSide).gameObject.SetActive(false); ((Component)tableTextLeftSideValues).gameObject.SetActive(false); ((Component)tableTextRightSideValues).gameObject.SetActive(false); ((Component)MenuPageSavesPatch.malfunction).gameObject.SetActive(false); ((TMP_Text)noSaveText).text = "No LevelScaling data found :("; return; } try { ((Component)noSaveText).gameObject.SetActive(false); ((Component)tableTextLeftSide).gameObject.SetActive(true); ((Component)tableTextRightSide).gameObject.SetActive(true); ((Component)tableTextLeftSideValues).gameObject.SetActive(true); ((Component)tableTextRightSideValues).gameObject.SetActive(true); ((Component)MenuPageSavesPatch.malfunction).gameObject.SetActive(false); ES3Settings val = new ES3Settings(text, (EncryptionType)1, SwaggiFunc.es3Password, (ES3Settings)null); ES3Settings val2 = new ES3Settings(text2, (EncryptionType)1, SwaggiFunc.es3Password, (ES3Settings)null); RunStatsManager runStatsManager = ES3.Load("runStats", text, new RunStatsManager(), val); ((TMP_Text)tableTextLeftSideValues).text = $"x {Mathf.Clamp(runStatsManager.extractionPointsCompleted, 0, 9999)}\n" + $"x {Mathf.Clamp(runStatsManager.valuablesFound, 0, 9999)}\n" + $"x {Mathf.Clamp(runStatsManager.enemyKills, 0, 9999)}\n" + $"x {Mathf.Clamp(runStatsManager.playerDeaths, 0, 9999)}"; ((TMP_Text)tableTextRightSideValues).text = $"{Mathf.Clamp(runStatsManager.largestSurplusValue, 0, 999999)}\n" + $"-{Mathf.Clamp((int)(runStatsManager.totalValueBroken / 1000f), 0, 9999)}K\n" + $"x {Mathf.Clamp(runStatsManager.modulesExplored, 0, 9999)}\n" + $"x {Mathf.Clamp(runStatsManager.challengesCompleted, 0, 9999)}"; Dictionary> dictionary = ES3.Load>>("dictionaryOfDictionaries", text2, new Dictionary>(), val2); if (dictionary.ContainsKey("LSmalfunctionConfig") && dictionary["LSmalfunctionConfig"].ContainsKey("malfunction")) { MalfunctionManager.Malfunction malfunction = MalfunctionManager.GetMalfunction((MalfunctionManager.MalfunctionType)dictionary["LSmalfunctionConfig"]["malfunction"]); if (malfunction.type != 0) { ((Component)MenuPageSavesPatch.malfunction).gameObject.SetActive(true); ((TMP_Text)MenuPageSavesPatch.malfunction).text = "MALFUNCTION: " + malfunction.name + ""; } } } catch (Exception ex) { ((Component)noSaveText).gameObject.SetActive(true); ((Component)tableTextLeftSide).gameObject.SetActive(false); ((Component)tableTextRightSide).gameObject.SetActive(false); ((Component)tableTextLeftSideValues).gameObject.SetActive(false); ((Component)tableTextRightSideValues).gameObject.SetActive(false); ((TMP_Text)noSaveText).text = "LevelScaling data corrupted :("; Plugin.loggy.LogError((object)("Could not load LS file - " + ex.Message)); } } [HarmonyPatch("PositionMoonText")] [HarmonyPrefix] private static bool PositionMoonText(ref MenuPageSaves __instance) { ((Behaviour)__instance.saveFileInfoMoonText).enabled = false; return false; } [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref MenuPageSaves __instance) { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_011b: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: 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_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: 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) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: 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_0308: Unknown result type (might be due to invalid IL or missing references) //IL_0317: Unknown result type (might be due to invalid IL or missing references) //IL_031c: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03dd: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_0400: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)noSaveText)) { Object.Destroy((Object)(object)noSaveText); } if (Object.op_Implicit((Object)(object)tableTextLeftSide)) { Object.Destroy((Object)(object)tableTextLeftSide); } if (Object.op_Implicit((Object)(object)tableTextRightSide)) { Object.Destroy((Object)(object)tableTextRightSide); } if (Object.op_Implicit((Object)(object)tableTextLeftSideValues)) { Object.Destroy((Object)(object)tableTextLeftSideValues); } if (Object.op_Implicit((Object)(object)tableTextRightSideValues)) { Object.Destroy((Object)(object)tableTextRightSideValues); } if (Object.op_Implicit((Object)(object)malfunction)) { Object.Destroy((Object)(object)malfunction); } noSaveText = Object.Instantiate(__instance.saveFileInfoRow3, ((TMP_Text)__instance.saveFileInfoRow3).transform.parent); tableTextLeftSide = Object.Instantiate(noSaveText, ((TMP_Text)noSaveText).transform.parent); ((TMP_Text)__instance.saveFileInfoMoonText).text = ""; Transform transform = ((Component)__instance.saveFileInfoMoonImage).transform; transform.localPosition -= new Vector3(115f, 0f); ((TMP_Text)__instance.saveFileInfoRow3).transform.localScale = new Vector3(0.9f, 0.9f, 0.9f); ((TMP_Text)__instance.saveFileInfoRow3).transform.localPosition = new Vector3(75f, -95f, 0f); ((TMP_Text)__instance.saveFileInfoRow3).alignment = (TextAlignmentOptions)4097; TextMeshProUGUI saveFileInfoRow = __instance.saveFileInfoRow3; ((TMP_Text)saveFileInfoRow).margin = ((TMP_Text)saveFileInfoRow).margin + new Vector4(0f, 0f, -64f, 0f); ((Graphic)__instance.saveFileInfoRow3).color = new Color(0.7f, 0.7f, 0.7f); ((TMP_Text)noSaveText).text = "No LevelScaling data found :("; ((Graphic)noSaveText).color = new Color(1f, 0.2f, 0.2f); ((TMP_Text)tableTextLeftSide).fontSize = 14f; ((TMP_Text)tableTextLeftSide).alignment = (TextAlignmentOptions)257; TextMeshProUGUI obj = tableTextLeftSide; ((TMP_Text)obj).margin = ((TMP_Text)obj).margin - new Vector4(0f, 0f, 0f, 55f); Transform transform2 = ((TMP_Text)tableTextLeftSide).transform; transform2.localPosition += new Vector3(0f, 0f); ((TMP_Text)tableTextLeftSide).lineSpacing = 3f; ((Graphic)tableTextLeftSide).color = new Color(0.8f, 0.8f, 0.8f); ((TMP_Text)tableTextLeftSide).text = " EXTRACTIONS\n VALUABLES\n KILLS\n DEATHS"; tableTextRightSide = Object.Instantiate(tableTextLeftSide, ((TMP_Text)tableTextLeftSide).transform.parent); Transform transform3 = ((TMP_Text)tableTextRightSide).transform; transform3.localPosition += new Vector3(169f, 0f); ((TMP_Text)tableTextRightSide).text = " BIGGEST BAG\n BROKEN\n EXPLORED\n CHALLENGES"; tableTextLeftSideValues = Object.Instantiate(tableTextLeftSide, ((TMP_Text)tableTextLeftSide).transform.parent); Transform transform4 = ((TMP_Text)tableTextLeftSideValues).transform; transform4.localPosition += new Vector3(115f, -0.5f); ((TMP_Text)tableTextLeftSideValues).text = "-\n-\n-\n-"; ((Graphic)tableTextLeftSideValues).color = Color.white; ((TMP_Text)tableTextLeftSideValues).fontStyle = (FontStyles)1; ((TMP_Text)tableTextLeftSideValues).lineSpacing = 7f; tableTextRightSideValues = Object.Instantiate(tableTextLeftSideValues, ((TMP_Text)tableTextLeftSideValues).transform.parent); Transform transform5 = ((TMP_Text)tableTextRightSideValues).transform; transform5.localPosition += new Vector3(280f, -0.5f); malfunction = Object.Instantiate(tableTextLeftSide, ((TMP_Text)tableTextLeftSide).transform.parent); Transform transform6 = ((TMP_Text)malfunction).transform; transform6.localPosition += new Vector3(0f, 111f); ((Graphic)malfunction).color = new Color(0.4f, 0.2f, 0.8f); ((TMP_Text)malfunction).fontSize = 12f; ((TMP_Text)malfunction).text = ""; ((TMP_Text)malfunction).richText = true; ((TMP_Text)malfunction).alignment = (TextAlignmentOptions)514; } } [HarmonyPatch(typeof(PhysGrabber))] internal class PhysGrabberPatch { [HarmonyPatch("PhysGrabOverChargeLogic")] [HarmonyPostfix] private static void PhysGrabOverChargeLogicP(ref PhysGrabber __instance, ref float ___physGrabBeamOverChargeTimer, ref float ___physGrabBeamOverChargeFloat, ref float ___physGrabBeamOverchargeDecreaseCooldown) { if (!__instance.isLocal || Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || ___physGrabBeamOverChargeTimer > 0f || ___physGrabBeamOverChargeFloat <= 0f) { return; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.OverOvercharge)) { if (___physGrabBeamOverchargeDecreaseCooldown > 0f) { ___physGrabBeamOverchargeDecreaseCooldown += Time.deltaTime * 0.1f; } ___physGrabBeamOverChargeFloat -= 0.03f * Time.deltaTime; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush)) { if (___physGrabBeamOverchargeDecreaseCooldown > 0f) { ___physGrabBeamOverchargeDecreaseCooldown += Time.deltaTime * 0.5f; ___physGrabBeamOverChargeFloat -= 0.06f * Time.deltaTime; } else { ___physGrabBeamOverChargeFloat -= 0.083f * Time.deltaTime; } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal class PhysGrabObjectImpactDetectorPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref PhysGrabObjectImpactDetector __instance, ref ValuableObject ___valuableObject) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FragileValuables) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && Object.op_Implicit((Object)(object)___valuableObject) && !Object.op_Implicit((Object)(object)((Component)___valuableObject).GetComponent())) { __instance.fragility = Mathf.Max(__instance.fragility, (float)Random.Range(90, 101)); __instance.durability = Mathf.Min(__instance.durability, (float)Random.Range(0, 6)); } } [HarmonyPatch("Break")] [HarmonyPrefix] private static void BreakP(ref PhysGrabObjectImpactDetector __instance, ref float valueLost, ref bool _forceBreak, ref bool ___isIndestructible) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.SharedDurability) || !__instance.isValuable || Helpers.TruckLeaving || Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host) { return; } valueLost = Mathf.Max(0f, valueLost * 0.28f); if ((!_forceBreak && (___isIndestructible || __instance.destroyDisable)) || (Object)(object)__instance.physGrabObject == (Object)null || __instance.physGrabObject.hasNeverBeenGrabbed) { return; } if (__instance.physGrabObject.playerGrabbing.Count == 0) { SwaggiFunc.SharedDurability_DamageAllPlayers(valueLost, GameDirector.instance.PlayerList); return; } List list = new List(); foreach (PhysGrabber item in __instance.physGrabObject.playerGrabbing) { list.Add(item.playerAvatar); } SwaggiFunc.SharedDurability_DamageAllPlayers(valueLost, list); } [HarmonyPatch("BreakRPC")] [HarmonyPrefix] private static void BreakRPCP(ref PhysGrabObjectImpactDetector __instance, ref float valueLost, ref bool _loseValue) { if (Object.op_Implicit((Object)(object)__instance.valuableObject) && !Helpers.TruckLeaving && valueLost != 0f && _loseValue && !__instance.physGrabObject.dead) { float dollarValueCurrent = __instance.valuableObject.dollarValueCurrent; float num = Mathf.Clamp(valueLost, 0f, dollarValueCurrent); if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent())) { LevelStatsManager.AddValueExtracted(0f - num); } LevelStatsManager.AddValueBroken(num); } } [HarmonyPatch("DestroyObjectRPC")] [HarmonyPostfix] private static void DestroyObjectRPCP(ref PhysGrabObjectImpactDetector __instance, ref PhotonMessageInfo _info) { //IL_0001: 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) if (!SemiFunc.MasterOnlyRPC(_info)) { return; } if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent())) { LevelStatsManager.AddCosmeticBoxBroken(); } if (Object.op_Implicit((Object)(object)__instance.valuableObject)) { float dollarValueCurrent = __instance.valuableObject.dollarValueCurrent; if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent())) { LevelStatsManager.AddValueExtracted(0f - dollarValueCurrent); } LevelStatsManager.AddValueBroken(dollarValueCurrent); if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.SharedDurability)) { SwaggiFunc.SharedDurability_DamageAllPlayers(dollarValueCurrent * 0.33f, GameDirector.instance.PlayerList); } if (!__instance.valuableObject.discovered) { LevelStatsManager.nonDiscoveredValuablesBroken++; } if ((Object)(object)((Component)__instance).GetComponent() == (Object)null && MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { SwaggiFunc.Soulstealers_SpawnExplosion(((Component)__instance).transform.position, __instance.physGrabObject?.massOriginal ?? 1f); } } } } [HarmonyPatch(typeof(PhysGrabObject))] internal class PhysGrabObjectPatch { [HarmonyPatch("FixedUpdate")] [HarmonyPostfix] private static void UpdateP(ref PhysGrabObject __instance, ref bool ___heldByLocalPlayer, ref bool ___isValuable) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.OverOvercharge) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && ___heldByLocalPlayer && !((Object)(object)((Component)__instance).GetComponent() == (Object)null)) { float num = __instance.rb.mass; if (num > 1f) { num = Mathf.Pow(Mathf.Sqrt(num), 1.3333334f); } float num2 = 0.05f; if (GameDirector.instance.PlayerList.Count == 2) { num2 = 0.045f; } if (GameDirector.instance.PlayerList.Count == 1) { num2 = 0.03f; } if (SemiFunc.MoonLevel() == 3) { num2 /= 1.25f; } if (SemiFunc.MoonLevel() >= 4) { num2 /= 1.5f; } PhysGrabber.instance.PhysGrabOverCharge(num / (float)__instance.playerGrabbing.Count * num2, 0f); } } [HarmonyPatch("DestroyPhysGrabObjectRPC")] [HarmonyPrefix] private static void DestroyPhysGrabObjectRPCP(ref PhysGrabObject __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { return; } ValuableObject component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null) && !ItemValuableBoxPatch.absorbingObjects.Contains(__instance) && RoundDirector.instance.dollarHaulList.Contains(((Component)__instance).gameObject) && !__instance.dead) { if (!component.discovered) { LevelStatsManager.nonDiscoveredValuablesBroken++; } if (!Object.op_Implicit((Object)(object)((Component)__instance).GetComponent())) { LevelStatsManager.AddValueExtracted(component.dollarValueCurrent); } } } } [HarmonyPatch(typeof(PlayerAvatar))] internal class PlayerAvatarPatch { [HarmonyPatch("HealedOther")] [HarmonyPostfix] private static void HealedOtherP(ref PlayerAvatar __instance) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap) && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host && !((Object)(object)__instance != (Object)(object)PlayerAvatar.instance)) { PlayerHealthPatch.maxHealth = Mathf.Max(10, PlayerHealthPatch.maxHealth - 10); if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { PlayerHealthPatch.maxHealth = Mathf.Max(10, PlayerHealthPatch.maxHealth - 10); } } } [HarmonyPatch("PlayerDeathRPC")] [HarmonyPostfix] private static void DeathP(ref PlayerAvatar __instance, ref bool ___isLocal, ref PhotonMessageInfo _info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterAndOwnerOnlyRPC(_info, __instance.photonView)) { return; } GlobalStatsManager.AddPlayerDeath(); if (___isLocal) { GlobalStatsManager.AddPlayerSelfDeath(); } if (!SemiFunc.RunIsArena()) { LevelStatsManager.AddPlayerDeath(); if (SemiFunc.RunIsLevel()) { RunStatsManager.instance.playerDeaths++; } } } [HarmonyPatch("ReviveRPC")] [HarmonyPostfix] private static void ReviveRPCP(ref PlayerAvatar __instance, ref PhotonMessageInfo _info) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(_info) && (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers))) { __instance.playerHealth.InvincibleSet(2.5f); } } } [HarmonyPatch(typeof(PlayerController))] internal class PlayerControllerPatch { private static float _walkspeedAddition; private static float _stamregenAddition; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref float ___sprintRechargeAmount) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LargeMap)) { ___sprintRechargeAmount *= 2f; } } [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref PlayerController __instance) { if ((Object)(object)__instance == (Object)(object)PlayerController.instance) { _walkspeedAddition = 0f; _stamregenAddition = 0f; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut)) { PlayerController obj = __instance; obj.MoveSpeed *= 1.2f; } } public static void Malfunc_NewRoom() { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomLevelSize)) { Traverse val = Traverse.Create((object)PlayerController.instance).Field("sprintRechargeAmount"); PlayerController instance = PlayerController.instance; instance.MoveSpeed -= _walkspeedAddition; val.SetValue((object)(val.GetValue() - _stamregenAddition)); _walkspeedAddition += PlayerController.instance.MoveSpeed * 0.02f; _stamregenAddition += val.GetValue() * 0.02f; PlayerController instance2 = PlayerController.instance; instance2.MoveSpeed += _walkspeedAddition; val.SetValue((object)(val.GetValue() + _stamregenAddition)); } } } [HarmonyPatch(typeof(PlayerDeathHead))] internal class PlayerDeathHeadPatch { [HarmonyPatch("Revive")] [HarmonyPrefix] private static void ReviveP(ref PlayerDeathHead __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { __instance.inExtractionPoint = false; } } [HarmonyPatch("Update")] [HarmonyPrefix] private static void UpdateP(ref PlayerDeathHead __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { __instance.roomVolumeCheck.inExtractionPoint = false; } } [HarmonyPatch("SetupDone")] [HarmonyPostfix] private static void SetupDoneP(ref PlayerDeathHead __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { ((Component)__instance).gameObject.AddComponent().Setup(SoulstealersDeathHeadManager.managersIndex + __instance.playerAvatar.photonView.ViewID, __instance.playerAvatar.photonView.IsMine || !GameManager.Multiplayer()); } } } [HarmonyPatch(typeof(PlayerHealth))] internal class PlayerHealthPatch { private static float healCooldown = 0f; private static float damageCooldown = 0f; public static int maxHealth = -1; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP() { healCooldown = 10f; damageCooldown = 5f; maxHealth = -1; } [HarmonyPatch("HurtOtherRPC")] [HarmonyPrefix] private static void HurtOtherRPCP(ref int damage, ref Vector3 hurtPosition, ref bool savingGrace, ref int enemyIndex) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) if (!((damage != 10 || hurtPosition != Vector3.zero) | savingGrace) && enemyIndex == -1) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { damage = 12; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10)) { damage *= 2; } } } [HarmonyPatch("Hurt")] [HarmonyPrefix] private static void HurtP(ref PhotonView ___photonView, ref int damage) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { damage = Mathf.CeilToInt((float)damage * 0.8f); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10)) { damage = Mathf.CeilToInt((float)damage * 0.5f); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { damage = Mathf.CeilToInt((float)damage * 2f); } if (damage > 0 && (!GameManager.Multiplayer() || ___photonView.IsMine)) { GlobalStatsManager.AddPlayerDamageTaken(damage); } damageCooldown = 5f; } [HarmonyPatch("Heal")] [HarmonyPrefix] private static void HealP(ref PhotonView ___photonView, ref int healAmount) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { healAmount = Mathf.CeilToInt((float)healAmount * 2f); } if (healAmount > 0 && (!GameManager.Multiplayer() || ___photonView.IsMine)) { GlobalStatsManager.AddPlayerHealthHealed(healAmount); } } [HarmonyPatch("Update")] [HarmonyPrefix] private static void UpdateP(ref PlayerHealth __instance, ref PlayerAvatar ___playerAvatar, ref bool ___healthSet, ref int ___health, ref int ___maxHealth, ref PhotonView ___photonView) { if ((Object)(object)___playerAvatar != (Object)(object)PlayerAvatar.instance || Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host || Traverse.Create((object)PlayerAvatar.instance).Field("isDisabled").GetValue()) { return; } if (maxHealth == -1) { if (___healthSet) { maxHealth = Mathf.Max(10, ___health); } return; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { if (___health > maxHealth) { maxHealth = Mathf.Max(10, ___health); } damageCooldown = Mathf.Max(0f, damageCooldown - Time.deltaTime); healCooldown = Mathf.Max(0f, healCooldown - Time.deltaTime); if (damageCooldown > 0f || healCooldown > 0f || ___health >= maxHealth) { return; } __instance.Heal(1, false); healCooldown = 3f; if (GameDirector.instance.PlayerList.Count < 2) { return; } int num = 0; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Traverse.Create((object)player).Field("isDisabled").GetValue()) { continue; } num++; if (num > 1) { if (num <= 3) { healCooldown += 0.5f; } healCooldown += 0.5f; if (num >= 6) { break; } } } } if (!ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.DangerZone) || Helpers.TruckLeaving) { return; } healCooldown = Mathf.Max(0f, healCooldown - Time.deltaTime); if (___health <= 1) { healCooldown = 5f; } else { if (healCooldown != 0f) { return; } bool flag = false; foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if (Traverse.Create((object)item).Field("Spawned").GetValue()) { flag = true; break; } } if (!flag) { healCooldown = 7.5f; return; } float num2 = LevelStatsManager.thisLevelTime / 60f; float num3 = Mathf.Clamp(4f - num2 * 0.1f, 1f, 4f); if (___health > 1) { ___health = Mathf.Max(1, ___health - ((!ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) ? 1 : 2)); StatsManager.instance.SetPlayerHealth(SemiFunc.PlayerGetSteamID(___playerAvatar), ___health, false); if (GameManager.Multiplayer()) { ___photonView.RPC("UpdateHealthRPC", (RpcTarget)1, new object[3] { ___health, ___maxHealth, ___health < 10 }); } if (___health < 10) { CameraGlitch.Instance.PlayShortHurt(true); num3 *= 2f; } } healCooldown = num3; } } } [HarmonyPatch(typeof(RoomVolume))] internal class RoomVolumePatch { } [HarmonyPatch(typeof(RoundDirector))] internal class RoundDirectorPatch { } [HarmonyPatch(typeof(RunManager))] internal class RunManagerPatch { public static int _lastLevelsCompleted = -100; private static string _previousLevelName = "null"; [HarmonyPatch("ChangeLevel")] [HarmonyPostfix] private static void ChangeLevel_Postfix(ref RunManager __instance, ref bool _completedLevel) { LevelStatsManager.OnNewLevel(); if (_completedLevel && SemiFunc.RunIsShop()) { OnLevelComplete(__instance.levelsCompleted + 1, _previousLevelName); } _previousLevelName = __instance.levelCurrent.NarrativeName; if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { SwaggiFunc.SharedDurability_overheal = 0f; MalfunctionManager.SyncMalfunction(); if (!SemiFunc.IsMultiplayer() && (SemiFunc.RunIsShop() || SemiFunc.RunIsArena() || SemiFunc.RunIsLobby())) { ChallengeManager.SetupChallenges(ChallengeManager.ChallengeType.None); } else { ChallengeManager.DetermineChallengeForLevel(__instance.levelsCompleted + 1, ChallengeManager.CurrentSeed); } } } [HarmonyPatch("UpdateLevel")] [HarmonyPostfix] private static void UpdateLevel_Postfix(ref RunManager __instance, ref string _levelName, ref int _levelsCompleted) { LevelStatsManager.OnNewLevel(); foreach (Level item in __instance.levelShop) { if (_levelsCompleted == _lastLevelsCompleted + 1 && _levelName == ((Object)item).name) { OnLevelComplete(_levelsCompleted + 1, _previousLevelName); break; } } _lastLevelsCompleted = _levelsCompleted; _previousLevelName = __instance.levelCurrent.NarrativeName; } private static void OnLevelComplete(int newLevel, string levelName) { Helpers.DeepLog($"LEVEL COMPLETE - {newLevel} - {levelName}"); MalfunctionManager.SetMalfunctionBestLevel(MalfunctionManager.activeMalfunction, newLevel); GlobalStatsManager.AddLevelCompleted(levelName); GlobalStatsManager.SetHighestLevel(newLevel, levelName); } } [HarmonyPatch(typeof(RunManagerPUN))] internal class RunManagerPUNPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref RunManagerPUN __instance) { ((Component)__instance).gameObject.AddComponent(); } } [HarmonyPatch(typeof(SemiFunc))] internal class SemiFuncPatch { [HarmonyPatch("OnLevelGenDone")] [HarmonyPostfix] private static void OnLevelGenDoneP() { LevelStatsManager.SetModuleCount(LevelStatsManager.totalModules); SoulstealersDeathHeadManager.managers.Clear(); SoulstealersDeathHeadManager.managersIndex = 8626260; } [HarmonyPatch("SaveFileDelete")] [HarmonyPostfix] private static void SaveFileDeleteP(ref string saveFileName) { if (!string.IsNullOrEmpty(saveFileName) && SemiFunc.IsMasterClientOrSingleplayer() && !(saveFileName != Traverse.Create((object)StatsManager.instance).Field("saveFileCurrent").GetValue())) { RunStatsManager.Reset(); } } [HarmonyPatch("OnSceneSwitch")] [HarmonyPrefix] private static void OnSceneSwitchP(ref bool _gameOver, ref bool _leaveGame) { if (_leaveGame) { GlobalStatsManager.RevertChallengesCompleted(); MalfunctionManager.SetMalfunction(MalfunctionManager.selectedMalfunction); RunManagerPatch._lastLevelsCompleted = -100; } GlobalStatsManager.SaveGlobalStats(); MenusManager.currentPage = MenusManager.RightHandPage.None; MalfunctionManager._solitude_ShownWarning = 0; MalfunctionManager._lastSolitudeSecondsRemoved = 0; MalfunctionManager.solitudeRevives = 0; MalfunctionManager.solitudeDeathTimers.Clear(); MalfunctionManager._solitudeGameOverSequence = false; MalfunctionManager._solitudeCompletedSequence = false; HaulUIPatch.Solitude_GoalSwitch = false; HaulUIPatch.Solitude_GoalSwitchTimer = 0f; } } [HarmonyPatch(typeof(SpectateCamera))] internal class SpectateCameraPatch { [HarmonyPatch("StateDeath")] [HarmonyPrefix] private static void StateDeathP(ref float ___stateTimer) { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) if (!Helpers.AllPlayersDead()) { return; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { Solitude_HandleBeingDead(); if (MalfunctionManager.Solitude_ShouldRevivePlayer()) { ___stateTimer = Mathf.Max(___stateTimer, 4f); return; } foreach (PlayerAvatar item in MalfunctionManager.solitudeDeathTimers.Keys.ToList()) { if (MalfunctionManager.solitudeDeathTimers[item] >= 10f) { ___stateTimer = Mathf.Max(___stateTimer, 4f); return; } } ExtractionPoint extractionPointCurrent = Helpers.ExtractionPointCurrent; if ((Object)(object)extractionPointCurrent != (Object)null && MalfunctionManager.SolitudeQuotaMet) { MalfunctionManager.Solitude_TimerOut(extractionPointCurrent.currentState); ___stateTimer = Mathf.Max(___stateTimer, 4f); return; } } if (!MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { return; } foreach (SoulstealersDeathHeadManager manager in SoulstealersDeathHeadManager.managers) { if (manager.foundNearestOrbTier != -1) { ___stateTimer = Mathf.Max(___stateTimer, 4f); break; } } } [HarmonyPatch("StateNormal")] [HarmonyPostfix] private static void StateNormalP() { Solitude_HandleBeingDead(); } private static void Solitude_HandleBeingDead() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (!MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) || !MalfunctionManager.Solitude_ShouldRevivePlayer() || !MalfunctionManager.solitudeDeathTimers.TryGetValue(PlayerAvatar.instance, out var value)) { return; } int num = Mathf.Clamp(10 - (int)value, 0, 10); if (num > 7) { return; } if (num == 0) { int num2 = Mathf.Clamp(40 - (int)value, 0, 30); string text = ""; if (num2 <= 15) { text = $" ({num2})"; } PhysGrabObject value2 = Traverse.Create((object)PlayerAvatar.instance.playerDeathHead).Field("physGrabObject").GetValue(); if (value2.playerGrabbing.Count > 0) { ItemInfoExtraUI.instance.ItemInfoText("WAITING FOR HEAD TO BE LET GO..." + text + "", Color.green); return; } Vector3 velocity = value2.rb.velocity; if (((Vector3)(ref velocity)).magnitude > 0.01f) { ItemInfoExtraUI.instance.ItemInfoText("WAITING FOR HEAD TO STOP MOVING..." + text + "", Color.green); return; } ItemInfoExtraUI.instance.ItemInfoText("WAITING TO BE REVIVED..." + text + "", Color.green); } if (!Helpers.AllExtractionPointsCompleted) { ItemInfoExtraUI.instance.ItemInfoText($"YOU WILL BE REVIVED IN {num}...", Color.green); } } } [HarmonyPatch(typeof(StatsManager))] internal class StatsManagerPatch { [HarmonyPatch("LoadGame")] [HarmonyPostfix] private static void LoadGameP(ref StatsManager __instance, ref string fileName) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !File.Exists(Application.persistentDataPath + "/saves/" + fileName + "/" + fileName + ".es3")) { return; } if (__instance.dictionaryOfDictionaries.TryGetValue("LSchallengeSeed", out var value)) { if (value.ContainsKey("currentSeed")) { ChallengeManager.CurrentSeed = value["currentSeed"]; } if (value.ContainsKey("lastChallengeLevel")) { ChallengeManager.LastChallengeLevel = value["lastChallengeLevel"]; } } if (__instance.dictionaryOfDictionaries.TryGetValue("LSmalfunctionConfig", out var value2) && value2.ContainsKey("malfunction")) { MalfunctionManager.SetMalfunction((MalfunctionManager.MalfunctionType)value2["malfunction"]); } } [HarmonyPatch("SaveGame")] [HarmonyPrefix] private static void SaveGameP(ref StatsManager __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { if (__instance.dictionaryOfDictionaries.ContainsKey("LSmalfunctionConfig")) { __instance.dictionaryOfDictionaries["LSmalfunctionConfig"]["malfunction"] = (int)MalfunctionManager.activeMalfunction; } else { __instance.dictionaryOfDictionaries.Add("LSmalfunctionConfig", new Dictionary { { "malfunction", (int)MalfunctionManager.activeMalfunction } }); } if (__instance.dictionaryOfDictionaries.ContainsKey("LSchallengeSeed")) { __instance.dictionaryOfDictionaries["LSchallengeSeed"] = ChallengeManager.challengesDofD; return; } ChallengeManager.CurrentSeed = Random.Range(0, 100000000); ChallengeManager.LastChallengeLevel = -1; __instance.dictionaryOfDictionaries.Add("LSchallengeSeed", ChallengeManager.challengesDofD); } } [HarmonyPatch("SaveFileCreate")] [HarmonyPrefix] private static void SaveFileCreateP(ref StatsManager __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { ChallengeManager.CurrentSeed = Random.Range(0, 100000000); ChallengeManager.LastChallengeLevel = -1; if (__instance.dictionaryOfDictionaries.ContainsKey("LSmalfunctionConfig")) { __instance.dictionaryOfDictionaries["LSmalfunctionConfig"]["malfunction"] = (int)MalfunctionManager.activeMalfunction; } else { __instance.dictionaryOfDictionaries.Add("LSmalfunctionConfig", new Dictionary { { "malfunction", (int)MalfunctionManager.activeMalfunction } }); } if (__instance.dictionaryOfDictionaries.ContainsKey("LSchallengeSeed")) { __instance.dictionaryOfDictionaries["LSchallengeSeed"] = ChallengeManager.challengesDofD; } else { __instance.dictionaryOfDictionaries.Add("LSchallengeSeed", ChallengeManager.challengesDofD); } } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP() { LevelStatsManager.Update(); } [HarmonyPatch("SaveGame")] [HarmonyPostfix] private static void SaveGameP(ref string fileName) { if (!string.IsNullOrEmpty(fileName) && SemiFunc.IsMasterClientOrSingleplayer()) { RunStatsManager.SaveRunStats(fileName); } } [HarmonyPatch("LoadGame")] [HarmonyPostfix] private static void LoadGameP(ref string fileName) { if (!string.IsNullOrEmpty(fileName) && SemiFunc.IsMasterClientOrSingleplayer()) { RunStatsManager.LoadRunStats(fileName); } } } [HarmonyPatch(typeof(StatsUI))] internal class StatsUIPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref StatsUI __instance) { LevelStatsUI.Create(__instance); } } [HarmonyPatch(typeof(TruckScreenText))] internal class TruckScreenTextPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void TruckScreenText_Awake() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) Helpers.truckScreenState = (PlayerChatBoxState)0; } [HarmonyPatch("PlayerChatBoxStateUpdateRPC")] [HarmonyPostfix] private static void TruckScreenText_PlayerChatBoxStateUpdateRPC(ref PlayerChatBoxState _state) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) Helpers.truckScreenState = _state; } } [HarmonyPatch(typeof(ValuableEgg))] internal class ValuableEggPatch { [HarmonyPatch("Explode")] [HarmonyPostfix] private static void TrapStopP(ref ValuableEgg __instance) { if (SemiFunc.RunIsLevel()) { ValuableObject component = ((Component)__instance).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { LevelStatsManager.AddValueBroken(Traverse.Create((object)component).Field("dollarValueCurrent").GetValue()); } } } } [HarmonyPatch(typeof(ValuableObject))] internal class ValuableObjectPatch { public class ValueRange { public int min; public int max; public int weight; public ValueRange(int _min, int _max, int _weight) { min = _min; max = _max; weight = _weight; } } public static readonly Dictionary randomValueRanges = new Dictionary { { (Type)0, new ValueRange[3] { new ValueRange(100, 1000, 50), new ValueRange(100, 10000, 40), new ValueRange(100, 50000, 10) } }, { (Type)1, new ValueRange[3] { new ValueRange(300, 3000, 50), new ValueRange(100, 15000, 40), new ValueRange(100, 50000, 10) } }, { (Type)2, new ValueRange[3] { new ValueRange(900, 9000, 50), new ValueRange(100, 27000, 40), new ValueRange(100, 50000, 10) } }, { (Type)3, new ValueRange[3] { new ValueRange(1600, 12000, 50), new ValueRange(800, 24000, 40), new ValueRange(100, 50000, 10) } }, { (Type)4, new ValueRange[3] { new ValueRange(7500, 25000, 50), new ValueRange(10000, 20000, 40), new ValueRange(100, 55000, 10) } }, { (Type)5, new ValueRange[3] { new ValueRange(10000, 35000, 50), new ValueRange(15000, 25000, 40), new ValueRange(100, 60000, 10) } }, { (Type)6, new ValueRange[3] { new ValueRange(15000, 35000, 50), new ValueRange(15000, 30000, 40), new ValueRange(100, 90000, 10) } } }; private static bool addToMapValue = false; public static float GetRandomValue(Type type) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) if (Random.Range(0, 100) == 0) { return Random.Range(0, 100005); } List list = new List(); int num = 0; ValueRange[] array = randomValueRanges[type]; foreach (ValueRange valueRange in array) { num += valueRange.weight; list.Add(valueRange); } int num2 = Random.Range(0, num + 1); num = 0; foreach (ValueRange item in list) { num += item.weight; if (num2 <= num) { return Random.Range(item.min, item.max + 1); } } return Random.Range(100, 50000); } private static float GetNewDollarValue(float original, Type type = 0, bool enemyOrb = false) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) float num = original; if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomValuableValue) && !enemyOrb) { num = GetRandomValue(type); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FragileValuables)) { num = ((num <= 1000f) ? (num * 1.75f) : ((num <= 5000f) ? (num * 1.45f) : ((!(num <= 10000f)) ? (num * 1.13f) : (num * 1.25f)))); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) { if (!enemyOrb) { return Mathf.Clamp(num / 1000f, 1f, 30f); } num *= 1.5f; } return Helpers.RoundTo100(num); } [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref ValuableObject __instance) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected I4, but got Unknown if (!SemiFunc.RunIsLevel()) { return; } LevelStatsManager.AddValuableTotal(); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.RandomValuableValue) && (Object)(object)((Component)__instance).GetComponent() == (Object)null) { float num = Random.Range(0f, 1f); Type volumeType = __instance.volumeType; switch ((int)volumeType) { case 0: num = 0.3f + 5.7f * Mathf.Sqrt(Mathf.Pow(num, 4f)); break; case 1: num = ((!(num < 0.1f)) ? (1f + 5f * Mathf.Sqrt(Mathf.Pow(num - 0.1f, 4f))) : (0.3f + 70f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; case 2: num = ((!(num < 0.1f)) ? (2f + 5f * Mathf.Sqrt(Mathf.Pow(num - 0.1f, 4f))) : (0.3f + 170f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; case 3: num = ((!(num < 0.15f)) ? (3f + 4.15f * Mathf.Sqrt(Mathf.Pow(num - 0.15f, 4f))) : (0.3f + 120f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; case 5: num = ((!(num < 0.15f)) ? (3f + 4.15f * Mathf.Sqrt(Mathf.Pow(num - 0.15f, 4f))) : (0.3f + 120f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; case 6: num = ((!(num < 0.15f)) ? (3.5f + 3.5f * Mathf.Sqrt(Mathf.Pow(num - 0.15f, 4f))) : (0.3f + 142f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; case 4: num = ((!(num < 0.15f)) ? (4f + 2.8f * Mathf.Sqrt(Mathf.Pow(num - 0.15f, 4f))) : (0.3f + 164f * Mathf.Sqrt(Mathf.Pow(num, 4f)))); break; } num = Mathf.Clamp(num, 0.3f, 6f); if (Object.op_Implicit((Object)(object)__instance.rb)) { __instance.rb.mass = num; } __instance.physGrabObject.massOriginal = num; } } [HarmonyPatch("DollarValueSetLogic")] [HarmonyPrefix] private static void DollarValueSetLogic(ref ValuableObject __instance) { addToMapValue = !__instance.dollarValueSet; } [HarmonyPatch("DollarValueSetLogic")] [HarmonyPostfix] private static void DollarValueSetLogicP(ref ValuableObject __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) bool num = (Object)(object)((Component)__instance).GetComponent() != (Object)null; if (!num && Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { float newDollarValue = GetNewDollarValue(__instance.dollarValueCurrent, __instance.volumeType, (Object)(object)((Component)__instance).GetComponent() != (Object)null); __instance.dollarValueCurrent = newDollarValue; __instance.dollarValueOriginal = newDollarValue; } if (addToMapValue) { LevelStatsManager._clientTotalMapValue += __instance.dollarValueCurrent; } if (num) { LevelStatsManager._valueFromSurplus += (int)__instance.dollarValueCurrent; } } [HarmonyPatch("DiscoverRPC")] [HarmonyPrefix] private static void DiscoverRPCP(ref ValuableObject __instance) { if (!__instance.discovered && SemiFunc.RunIsLevel()) { LevelStatsManager.AddValuableFound(); } } [HarmonyPatch("Discover")] [HarmonyPrefix] private static void DiscoverP(ref ValuableObject __instance) { if (!__instance.discovered && SemiFunc.RunIsLevel()) { GlobalStatsManager.AddValuableFoundSelf(); } } [HarmonyPatch("DollarValueSetRPC")] [HarmonyPostfix] private static void DollarValueSetRPCP(ref ValuableObject __instance, ref float value) { LevelStatsManager._clientTotalMapValue += value; if (Object.op_Implicit((Object)(object)((Component)__instance).GetComponent())) { LevelStatsManager._valueFromSurplus += (int)__instance.dollarValueCurrent; } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref ValuableObject __instance) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) && __instance.inStartRoom) { __instance.physGrabObject.OverrideDrag(5f, 1f); __instance.physGrabObject.OverrideAngularDrag(20f, 1f); __instance.physGrabObject.OverrideZeroGravity(1f); } } } } namespace LevelScaling.Menu { internal class MenuLSPageCredits { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ScrollViewBuilderDelegate <>9__0_0; public static ScrollViewBuilderDelegate <>9__0_1; public static ScrollViewBuilderDelegate <>9__0_2; public static ScrollViewBuilderDelegate <>9__0_3; public static ScrollViewBuilderDelegate <>9__0_4; public static ScrollViewBuilderDelegate <>9__0_5; public static ScrollViewBuilderDelegate <>9__0_6; public static ScrollViewBuilderDelegate <>9__0_7; public static ScrollViewBuilderDelegate <>9__0_8; public static ScrollViewBuilderDelegate <>9__0_9; public static ScrollViewBuilderDelegate <>9__0_10; public static ScrollViewBuilderDelegate <>9__0_11; public static ScrollViewBuilderDelegate <>9__0_12; public static ScrollViewBuilderDelegate <>9__0_13; public static ScrollViewBuilderDelegate <>9__0_14; public static ScrollViewBuilderDelegate <>9__0_15; public static ScrollViewBuilderDelegate <>9__0_16; public static ScrollViewBuilderDelegate <>9__0_17; public static ScrollViewBuilderDelegate <>9__0_18; public static ScrollViewBuilderDelegate <>9__0_19; public static ScrollViewBuilderDelegate <>9__0_20; public static ScrollViewBuilderDelegate <>9__0_21; public static ScrollViewBuilderDelegate <>9__0_22; public static ScrollViewBuilderDelegate <>9__0_23; public static ScrollViewBuilderDelegate <>9__0_24; public static ScrollViewBuilderDelegate <>9__0_25; public static ScrollViewBuilderDelegate <>9__0_26; public static ScrollViewBuilderDelegate <>9__0_27; public static ScrollViewBuilderDelegate <>9__0_28; public static ScrollViewBuilderDelegate <>9__0_29; public static ScrollViewBuilderDelegate <>9__0_30; public static ScrollViewBuilderDelegate <>9__0_31; public static ScrollViewBuilderDelegate <>9__0_32; public static ScrollViewBuilderDelegate <>9__0_33; public static ScrollViewBuilderDelegate <>9__0_34; public static ScrollViewBuilderDelegate <>9__0_35; public static ScrollViewBuilderDelegate <>9__0_36; public static ScrollViewBuilderDelegate <>9__0_37; internal RectTransform b__0_0(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__0_1(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOLabel("Developer", sv, default(Vector2))).rectTransform; } internal RectTransform b__0_2(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Swaggies (me!!!!!)", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_3(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__0_4(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOLabel("Testers & Helpers", sv, default(Vector2))).rectTransform; } internal RectTransform b__0_5(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Mocha", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_6(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- melonearss", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_7(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Emily", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_8(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Benneze", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_9(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- 1A3", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_10(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Toxyc", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_11(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- HostileCorpse", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_12(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- itullus", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_13(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__0_14(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOLabel("Feedback & Bugs", sv, default(Vector2))).rectTransform; } internal RectTransform b__0_15(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- VMN", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_16(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Enraged Potato", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_17(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- EndMark_3", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_18(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Mr. Cosmic", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_19(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Yu", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_20(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Booz", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_21(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Friendly", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_22(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Gastrodon", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_23(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Ganzuto", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_24(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Aronx443", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_25(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- TheGoldenOne", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_26(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- BlxeFe4r", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_27(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Ominiknight", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_28(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- BLOKBUSTR", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_29(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__0_30(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOLabel("Special Thanks", sv, default(Vector2))).rectTransform; } internal RectTransform b__0_31(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- nickklmao for MenuLib", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_32(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- melonwater", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_33(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Axel & all of semiwork for R.E.P.O.", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_34(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Aeroni", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_35(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- MissBeck73", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_36(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Omniscye", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_37(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("and YOU for trying my mod! :3", sv, default(Vector2)))).rectTransform; } } public static void Show() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Expected O, but got Unknown //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: Expected O, but got Unknown //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_00a8: Expected O, but got Unknown //IL_00cc: 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_00d7: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Expected O, but got Unknown //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Expected O, but got Unknown //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Expected O, but got Unknown //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Expected O, but got Unknown //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Expected O, but got Unknown //IL_0273: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Expected O, but got Unknown //IL_02a2: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Expected O, but got Unknown //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02dc: Expected O, but got Unknown //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Expected O, but got Unknown //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Expected O, but got Unknown //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0363: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Expected O, but got Unknown //IL_038d: Unknown result type (might be due to invalid IL or missing references) //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Expected O, but got Unknown //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03c1: Unknown result type (might be due to invalid IL or missing references) //IL_03c7: Expected O, but got Unknown //IL_03eb: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f6: Expected O, but got Unknown //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0425: Expected O, but got Unknown //IL_0449: Unknown result type (might be due to invalid IL or missing references) //IL_044e: Unknown result type (might be due to invalid IL or missing references) //IL_0454: Expected O, but got Unknown //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047d: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Expected O, but got Unknown //IL_04a7: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Expected O, but got Unknown //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04db: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Expected O, but got Unknown //IL_0505: Unknown result type (might be due to invalid IL or missing references) //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0510: Expected O, but got Unknown //IL_0534: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Expected O, but got Unknown //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0568: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Expected O, but got Unknown //IL_0592: Unknown result type (might be due to invalid IL or missing references) //IL_0597: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Expected O, but got Unknown //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05c6: Unknown result type (might be due to invalid IL or missing references) //IL_05cc: Expected O, but got Unknown //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_05f5: Unknown result type (might be due to invalid IL or missing references) //IL_05fb: Expected O, but got Unknown //IL_061f: Unknown result type (might be due to invalid IL or missing references) //IL_0624: Unknown result type (might be due to invalid IL or missing references) //IL_062a: Expected O, but got Unknown //IL_064e: Unknown result type (might be due to invalid IL or missing references) //IL_0653: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Expected O, but got Unknown //IL_067d: Unknown result type (might be due to invalid IL or missing references) //IL_0682: Unknown result type (might be due to invalid IL or missing references) //IL_0688: Expected O, but got Unknown //IL_06ac: Unknown result type (might be due to invalid IL or missing references) //IL_06b1: Unknown result type (might be due to invalid IL or missing references) //IL_06b7: Expected O, but got Unknown //IL_06db: Unknown result type (might be due to invalid IL or missing references) //IL_06e0: Unknown result type (might be due to invalid IL or missing references) //IL_06e6: Expected O, but got Unknown //IL_070a: Unknown result type (might be due to invalid IL or missing references) //IL_070f: Unknown result type (might be due to invalid IL or missing references) //IL_0715: Expected O, but got Unknown if (MenusManager.currentPage == MenusManager.RightHandPage.Credits) { return; } MenuAPI.CloseAllPagesAddedOnTop(); MenuLSPageMalfunctions.buttons.Clear(); REPOPopupPage obj = MenuAPI.CreateREPOPopupPage("Credits", (PresetSide)1, false, false, 5f); object obj2 = <>c.<>9__0_0; if (obj2 == null) { ScrollViewBuilderDelegate val = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val42 = default(Vector2); ((Vector2)(ref val42))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val42)).rectTransform; }; <>c.<>9__0_0 = val; obj2 = (object)val; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); object obj3 = <>c.<>9__0_1; if (obj3 == null) { ScrollViewBuilderDelegate val2 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Developer", sv, default(Vector2))).rectTransform; <>c.<>9__0_1 = val2; obj3 = (object)val2; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); object obj4 = <>c.<>9__0_2; if (obj4 == null) { ScrollViewBuilderDelegate val3 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Swaggies (me!!!!!)", sv, default(Vector2)))).rectTransform; <>c.<>9__0_2 = val3; obj4 = (object)val3; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); object obj5 = <>c.<>9__0_3; if (obj5 == null) { ScrollViewBuilderDelegate val4 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val41 = default(Vector2); ((Vector2)(ref val41))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val41)).rectTransform; }; <>c.<>9__0_3 = val4; obj5 = (object)val4; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); object obj6 = <>c.<>9__0_4; if (obj6 == null) { ScrollViewBuilderDelegate val5 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Testers & Helpers", sv, default(Vector2))).rectTransform; <>c.<>9__0_4 = val5; obj6 = (object)val5; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); object obj7 = <>c.<>9__0_5; if (obj7 == null) { ScrollViewBuilderDelegate val6 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Mocha", sv, default(Vector2)))).rectTransform; <>c.<>9__0_5 = val6; obj7 = (object)val6; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); object obj8 = <>c.<>9__0_6; if (obj8 == null) { ScrollViewBuilderDelegate val7 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- melonearss", sv, default(Vector2)))).rectTransform; <>c.<>9__0_6 = val7; obj8 = (object)val7; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f); object obj9 = <>c.<>9__0_7; if (obj9 == null) { ScrollViewBuilderDelegate val8 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Emily", sv, default(Vector2)))).rectTransform; <>c.<>9__0_7 = val8; obj9 = (object)val8; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj9, 0f, 0f); object obj10 = <>c.<>9__0_8; if (obj10 == null) { ScrollViewBuilderDelegate val9 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Benneze", sv, default(Vector2)))).rectTransform; <>c.<>9__0_8 = val9; obj10 = (object)val9; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj10, 0f, 0f); object obj11 = <>c.<>9__0_9; if (obj11 == null) { ScrollViewBuilderDelegate val10 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- 1A3", sv, default(Vector2)))).rectTransform; <>c.<>9__0_9 = val10; obj11 = (object)val10; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj11, 0f, 0f); object obj12 = <>c.<>9__0_10; if (obj12 == null) { ScrollViewBuilderDelegate val11 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Toxyc", sv, default(Vector2)))).rectTransform; <>c.<>9__0_10 = val11; obj12 = (object)val11; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj12, 0f, 0f); object obj13 = <>c.<>9__0_11; if (obj13 == null) { ScrollViewBuilderDelegate val12 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- HostileCorpse", sv, default(Vector2)))).rectTransform; <>c.<>9__0_11 = val12; obj13 = (object)val12; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj13, 0f, 0f); object obj14 = <>c.<>9__0_12; if (obj14 == null) { ScrollViewBuilderDelegate val13 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- itullus", sv, default(Vector2)))).rectTransform; <>c.<>9__0_12 = val13; obj14 = (object)val13; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj14, 0f, 0f); object obj15 = <>c.<>9__0_13; if (obj15 == null) { ScrollViewBuilderDelegate val14 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val40 = default(Vector2); ((Vector2)(ref val40))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val40)).rectTransform; }; <>c.<>9__0_13 = val14; obj15 = (object)val14; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj15, 0f, 0f); object obj16 = <>c.<>9__0_14; if (obj16 == null) { ScrollViewBuilderDelegate val15 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Feedback & Bugs", sv, default(Vector2))).rectTransform; <>c.<>9__0_14 = val15; obj16 = (object)val15; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj16, 0f, 0f); object obj17 = <>c.<>9__0_15; if (obj17 == null) { ScrollViewBuilderDelegate val16 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- VMN", sv, default(Vector2)))).rectTransform; <>c.<>9__0_15 = val16; obj17 = (object)val16; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj17, 0f, 0f); object obj18 = <>c.<>9__0_16; if (obj18 == null) { ScrollViewBuilderDelegate val17 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Enraged Potato", sv, default(Vector2)))).rectTransform; <>c.<>9__0_16 = val17; obj18 = (object)val17; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj18, 0f, 0f); object obj19 = <>c.<>9__0_17; if (obj19 == null) { ScrollViewBuilderDelegate val18 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- EndMark_3", sv, default(Vector2)))).rectTransform; <>c.<>9__0_17 = val18; obj19 = (object)val18; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj19, 0f, 0f); object obj20 = <>c.<>9__0_18; if (obj20 == null) { ScrollViewBuilderDelegate val19 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Mr. Cosmic", sv, default(Vector2)))).rectTransform; <>c.<>9__0_18 = val19; obj20 = (object)val19; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj20, 0f, 0f); object obj21 = <>c.<>9__0_19; if (obj21 == null) { ScrollViewBuilderDelegate val20 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Yu", sv, default(Vector2)))).rectTransform; <>c.<>9__0_19 = val20; obj21 = (object)val20; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj21, 0f, 0f); object obj22 = <>c.<>9__0_20; if (obj22 == null) { ScrollViewBuilderDelegate val21 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Booz", sv, default(Vector2)))).rectTransform; <>c.<>9__0_20 = val21; obj22 = (object)val21; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj22, 0f, 0f); object obj23 = <>c.<>9__0_21; if (obj23 == null) { ScrollViewBuilderDelegate val22 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Friendly", sv, default(Vector2)))).rectTransform; <>c.<>9__0_21 = val22; obj23 = (object)val22; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj23, 0f, 0f); object obj24 = <>c.<>9__0_22; if (obj24 == null) { ScrollViewBuilderDelegate val23 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Gastrodon", sv, default(Vector2)))).rectTransform; <>c.<>9__0_22 = val23; obj24 = (object)val23; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj24, 0f, 0f); object obj25 = <>c.<>9__0_23; if (obj25 == null) { ScrollViewBuilderDelegate val24 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Ganzuto", sv, default(Vector2)))).rectTransform; <>c.<>9__0_23 = val24; obj25 = (object)val24; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj25, 0f, 0f); object obj26 = <>c.<>9__0_24; if (obj26 == null) { ScrollViewBuilderDelegate val25 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Aronx443", sv, default(Vector2)))).rectTransform; <>c.<>9__0_24 = val25; obj26 = (object)val25; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj26, 0f, 0f); object obj27 = <>c.<>9__0_25; if (obj27 == null) { ScrollViewBuilderDelegate val26 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- TheGoldenOne", sv, default(Vector2)))).rectTransform; <>c.<>9__0_25 = val26; obj27 = (object)val26; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj27, 0f, 0f); object obj28 = <>c.<>9__0_26; if (obj28 == null) { ScrollViewBuilderDelegate val27 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- BlxeFe4r", sv, default(Vector2)))).rectTransform; <>c.<>9__0_26 = val27; obj28 = (object)val27; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj28, 0f, 0f); object obj29 = <>c.<>9__0_27; if (obj29 == null) { ScrollViewBuilderDelegate val28 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Ominiknight", sv, default(Vector2)))).rectTransform; <>c.<>9__0_27 = val28; obj29 = (object)val28; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj29, 0f, 0f); object obj30 = <>c.<>9__0_28; if (obj30 == null) { ScrollViewBuilderDelegate val29 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- BLOKBUSTR", sv, default(Vector2)))).rectTransform; <>c.<>9__0_28 = val29; obj30 = (object)val29; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj30, 0f, 0f); object obj31 = <>c.<>9__0_29; if (obj31 == null) { ScrollViewBuilderDelegate val30 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val39 = default(Vector2); ((Vector2)(ref val39))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val39)).rectTransform; }; <>c.<>9__0_29 = val30; obj31 = (object)val30; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj31, 0f, 0f); object obj32 = <>c.<>9__0_30; if (obj32 == null) { ScrollViewBuilderDelegate val31 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Special Thanks", sv, default(Vector2))).rectTransform; <>c.<>9__0_30 = val31; obj32 = (object)val31; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj32, 0f, 0f); object obj33 = <>c.<>9__0_31; if (obj33 == null) { ScrollViewBuilderDelegate val32 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- nickklmao for MenuLib", sv, default(Vector2)))).rectTransform; <>c.<>9__0_31 = val32; obj33 = (object)val32; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj33, 0f, 0f); object obj34 = <>c.<>9__0_32; if (obj34 == null) { ScrollViewBuilderDelegate val33 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- melonwater", sv, default(Vector2)))).rectTransform; <>c.<>9__0_32 = val33; obj34 = (object)val33; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj34, 0f, 0f); object obj35 = <>c.<>9__0_33; if (obj35 == null) { ScrollViewBuilderDelegate val34 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Axel & all of semiwork for R.E.P.O.", sv, default(Vector2)))).rectTransform; <>c.<>9__0_33 = val34; obj35 = (object)val34; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj35, 0f, 0f); object obj36 = <>c.<>9__0_34; if (obj36 == null) { ScrollViewBuilderDelegate val35 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Aeroni", sv, default(Vector2)))).rectTransform; <>c.<>9__0_34 = val35; obj36 = (object)val35; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj36, 0f, 0f); object obj37 = <>c.<>9__0_35; if (obj37 == null) { ScrollViewBuilderDelegate val36 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- MissBeck73", sv, default(Vector2)))).rectTransform; <>c.<>9__0_35 = val36; obj37 = (object)val36; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj37, 0f, 0f); object obj38 = <>c.<>9__0_36; if (obj38 == null) { ScrollViewBuilderDelegate val37 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Omniscye", sv, default(Vector2)))).rectTransform; <>c.<>9__0_36 = val37; obj38 = (object)val37; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj38, 0f, 0f); object obj39 = <>c.<>9__0_37; if (obj39 == null) { ScrollViewBuilderDelegate val38 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("and YOU for trying my mod! :3", sv, default(Vector2)))).rectTransform; <>c.<>9__0_37 = val38; obj39 = (object)val38; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj39, 0f, 0f); MenusManager.currentPage = MenusManager.RightHandPage.Credits; obj.OpenPage(true); } } internal class MenuLSPageMalfunctions { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ScrollViewBuilderDelegate <>9__1_0; public static ScrollViewBuilderDelegate <>9__1_1; public static ScrollViewBuilderDelegate <>9__1_2; public static ScrollViewBuilderDelegate <>9__1_3; public static ScrollViewBuilderDelegate <>9__1_4; public static ScrollViewBuilderDelegate <>9__1_5; public static ScrollViewBuilderDelegate <>9__1_6; public static ScrollViewBuilderDelegate <>9__1_7; public static ScrollViewBuilderDelegate <>9__1_8; public static Action <>9__1_12; public static ScrollViewBuilderDelegate <>9__1_9; public static ScrollViewBuilderDelegate <>9__1_10; public static ScrollViewBuilderDelegate <>9__1_11; internal RectTransform b__1_0(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__1_1(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Malfunctions are an extra way to spice up your REPO runs.", sv, default(Vector2)), 0.5f)).rectTransform; } internal RectTransform b__1_2(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("They apply at the start of a run, and are permanent and", sv, default(Vector2)), 0.5f)).rectTransform; } internal RectTransform b__1_3(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("cannot be changed for the duration of your run.", sv, default(Vector2)), 0.5f)).rectTransform; } internal RectTransform b__1_4(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("If a malfunction is enabled, all configuration settings", sv, default(Vector2)), 0.5f)).rectTransform; } internal RectTransform b__1_5(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("are ignored and default Level Scaling values are used.", sv, default(Vector2)), 0.5f)).rectTransform; } internal RectTransform b__1_6(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Reaching high levels with a Malfunction active will grant your team", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__1_7(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("some badges for their Personal Best level! Good luck!", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__1_8(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__1_9(Transform sv) { //IL_0027: 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) REPOButton val = MenuAPI.CreateREPOButton("None", (Action)delegate { SelectMalfunction(MalfunctionManager.MalfunctionType.None); }, sv, default(Vector2)); buttons.Add("None", val); return ((REPOElement)val).rectTransform; } internal void b__1_12() { SelectMalfunction(MalfunctionManager.MalfunctionType.None); } internal RectTransform b__1_10(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("• Disable Malfunction", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__1_11(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } } public static Dictionary buttons = new Dictionary(); public static void Show() { //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_0041: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Expected O, but got Unknown //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_009f: Expected O, but got Unknown //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_00ce: Expected O, but got Unknown //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Expected O, but got Unknown //IL_01dd: 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_01e8: Expected O, but got Unknown //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Expected O, but got Unknown if (MenusManager.currentPage == MenusManager.RightHandPage.Malfunction) { return; } MenuAPI.CloseAllPagesAddedOnTop(); REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Malfunctions", (PresetSide)1, false, false, 5f); object obj = <>c.<>9__1_0; if (obj == null) { ScrollViewBuilderDelegate val2 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val17 = default(Vector2); ((Vector2)(ref val17))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val17)).rectTransform; }; <>c.<>9__1_0 = val2; obj = (object)val2; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); object obj2 = <>c.<>9__1_1; if (obj2 == null) { ScrollViewBuilderDelegate val3 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Malfunctions are an extra way to spice up your REPO runs.", sv, default(Vector2)), 0.5f)).rectTransform; <>c.<>9__1_1 = val3; obj2 = (object)val3; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); object obj3 = <>c.<>9__1_2; if (obj3 == null) { ScrollViewBuilderDelegate val4 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("They apply at the start of a run, and are permanent and", sv, default(Vector2)), 0.5f)).rectTransform; <>c.<>9__1_2 = val4; obj3 = (object)val4; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); object obj4 = <>c.<>9__1_3; if (obj4 == null) { ScrollViewBuilderDelegate val5 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("cannot be changed for the duration of your run.", sv, default(Vector2)), 0.5f)).rectTransform; <>c.<>9__1_3 = val5; obj4 = (object)val5; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); object obj5 = <>c.<>9__1_4; if (obj5 == null) { ScrollViewBuilderDelegate val6 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("If a malfunction is enabled, all configuration settings", sv, default(Vector2)), 0.5f)).rectTransform; <>c.<>9__1_4 = val6; obj5 = (object)val6; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); object obj6 = <>c.<>9__1_5; if (obj6 == null) { ScrollViewBuilderDelegate val7 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("are ignored and default Level Scaling values are used.", sv, default(Vector2)), 0.5f)).rectTransform; <>c.<>9__1_5 = val7; obj6 = (object)val7; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); object obj7 = <>c.<>9__1_6; if (obj7 == null) { ScrollViewBuilderDelegate val8 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Reaching high levels with a Malfunction active will grant your team", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__1_6 = val8; obj7 = (object)val8; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); object obj8 = <>c.<>9__1_7; if (obj8 == null) { ScrollViewBuilderDelegate val9 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("some badges for their Personal Best level! Good luck!", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__1_7 = val9; obj8 = (object)val9; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f); object obj9 = <>c.<>9__1_8; if (obj9 == null) { ScrollViewBuilderDelegate val10 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val16 = default(Vector2); ((Vector2)(ref val16))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val16)).rectTransform; }; <>c.<>9__1_8 = val10; obj9 = (object)val10; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj9, 0f, 0f); object obj10 = <>c.<>9__1_9; if (obj10 == null) { ScrollViewBuilderDelegate val11 = delegate(Transform sv) { //IL_0027: 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) REPOButton val15 = MenuAPI.CreateREPOButton("None", (Action)delegate { SelectMalfunction(MalfunctionManager.MalfunctionType.None); }, sv, default(Vector2)); buttons.Add("None", val15); return ((REPOElement)val15).rectTransform; }; <>c.<>9__1_9 = val11; obj10 = (object)val11; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj10, 0f, 0f); object obj11 = <>c.<>9__1_10; if (obj11 == null) { ScrollViewBuilderDelegate val12 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("• Disable Malfunction", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__1_10 = val12; obj11 = (object)val12; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj11, 0f, 0f); object obj12 = <>c.<>9__1_11; if (obj12 == null) { ScrollViewBuilderDelegate val13 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val14 = default(Vector2); ((Vector2)(ref val14))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val14)).rectTransform; }; <>c.<>9__1_11 = val13; obj12 = (object)val13; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj12, 0f, 0f); foreach (MalfunctionManager.MalfunctionType whitelistedMalfunction in MalfunctionManager._whitelistedMalfunctions) { AddMalfunctionToList(MalfunctionManager.GetMalfunction(whitelistedMalfunction), val); } RefreshButtonLabels(); MenusManager.currentPage = MenusManager.RightHandPage.Malfunction; val.OpenPage(true); } private static void AddMalfunctionToList(MalfunctionManager.Malfunction malfunction, REPOPopupPage page) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform sv) { //IL_002d: 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) REPOButton val = MenuAPI.CreateREPOButton(malfunction.name, (Action)delegate { SelectMalfunction(malfunction.type); }, sv, default(Vector2)); buttons.Add(malfunction.name, val); return ((REPOElement)val).rectTransform; }, 0f, 0f); int bestLevel = MalfunctionManager.GetMalfunctionBestLevel(malfunction.type); if (bestLevel > 0) { string sprites = ""; if (bestLevel >= 5) { sprites += ""; } if (bestLevel >= 10) { sprites += ""; } if (bestLevel >= 15) { sprites += ""; } if (bestLevel >= 20) { sprites += ""; } if (bestLevel >= 25) { sprites += ""; } if (bestLevel >= 50) { sprites += ""; } if (bestLevel >= 100) { sprites += ""; } page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel($"• Personal best: Level {bestLevel} {sprites}", sv, default(Vector2)), 0.45f, tintSprites: true)).rectTransform), 0f, 0f); } string[] infoLines = malfunction.infoLines; foreach (string line in infoLines) { page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("" + line + "", sv, default(Vector2)), 0.45f)).rectTransform), 0f, 0f); } } public static void SelectMalfunction(MalfunctionManager.MalfunctionType type) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMainMenu() && !SemiFunc.RunIsLobbyMenu()) { MenuManager.instance.PagePopUp("Sorry :(", Color.red, "You can only change Malfunction on the main menu and lobby menu.", "Oh Ok Then", false); return; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { MenuManager.instance.PagePopUp("Sorry :(", Color.red, "Only the host can change the Malfunction.", "Oh Ok Then", false); return; } if (RunManager.instance.levelsCompleted > 0 && SemiFunc.RunIsLobbyMenu()) { MenuManager.instance.PagePopUp("Sorry :(", Color.red, "You can't change the Malfunction on an existing save.", "Oh Ok Then", false); return; } MalfunctionManager.malfunctionSetThisSave = false; MalfunctionManager.SelectMalfunction(type); RefreshButtonLabels(); } private static void RefreshButtonLabels() { foreach (KeyValuePair button in buttons) { ((TMP_Text)button.Value.labelTMP).text = button.Key; if ((button.Key == "None" && MalfunctionManager.activeMalfunction == MalfunctionManager.MalfunctionType.None) || button.Key == MalfunctionManager.GetMalfunction(MalfunctionManager.activeMalfunction).name) { ((TMP_Text)button.Value.labelTMP).text = "" + button.Key + " (ACTIVE)"; } } } } internal class MenuLSPageSimulation { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ScrollViewBuilderDelegate <>9__0_0; public static ScrollViewBuilderDelegate <>9__0_1; public static ScrollViewBuilderDelegate <>9__0_2; public static ScrollViewBuilderDelegate <>9__0_3; public static ScrollViewBuilderDelegate <>9__0_4; public static ScrollViewBuilderDelegate <>9__0_5; public static ScrollViewBuilderDelegate <>9__0_6; public static ScrollViewBuilderDelegate <>9__0_7; public static ScrollViewBuilderDelegate <>9__1_0; internal RectTransform b__0_0(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } internal RectTransform b__0_1(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations may not be fully accurate depending", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_2(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("on your Randomness and Player Addition configurations.", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_3(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations will assume the average value from", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_4(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("randomness is always chosen for each level.", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_5(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations are client-sided and based on YOUR config.", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__0_6(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" # Extractions # Modules Estimate Map Value Quota Difficulty", sv, default(Vector2)), 0.35f)).rectTransform; } internal RectTransform b__0_7(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" Challenge Chance % # Enemies (T1/T2/T3) Enemy Health %", sv, default(Vector2)), 0.35f)).rectTransform; } internal RectTransform b__1_0(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 4f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } } public static void Show() { //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) //IL_004b: Expected O, but got Unknown //IL_006f: 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_007a: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Expected O, but got Unknown //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Expected O, but got Unknown //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Expected O, but got Unknown //IL_0189: 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_0194: Expected O, but got Unknown if (MenusManager.currentPage == MenusManager.RightHandPage.Simulation) { return; } MenuAPI.CloseAllPagesAddedOnTop(); MenuLSPageMalfunctions.buttons.Clear(); REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Level Simulation", (PresetSide)1, false, false, 5f); object obj = <>c.<>9__0_0; if (obj == null) { ScrollViewBuilderDelegate val2 = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val10 = default(Vector2); ((Vector2)(ref val10))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val10)).rectTransform; }; <>c.<>9__0_0 = val2; obj = (object)val2; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); object obj2 = <>c.<>9__0_1; if (obj2 == null) { ScrollViewBuilderDelegate val3 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations may not be fully accurate depending", sv, default(Vector2)))).rectTransform; <>c.<>9__0_1 = val3; obj2 = (object)val3; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); object obj3 = <>c.<>9__0_2; if (obj3 == null) { ScrollViewBuilderDelegate val4 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("on your Randomness and Player Addition configurations.", sv, default(Vector2)))).rectTransform; <>c.<>9__0_2 = val4; obj3 = (object)val4; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); object obj4 = <>c.<>9__0_3; if (obj4 == null) { ScrollViewBuilderDelegate val5 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations will assume the average value from", sv, default(Vector2)))).rectTransform; <>c.<>9__0_3 = val5; obj4 = (object)val5; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); object obj5 = <>c.<>9__0_4; if (obj5 == null) { ScrollViewBuilderDelegate val6 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("randomness is always chosen for each level.", sv, default(Vector2)))).rectTransform; <>c.<>9__0_4 = val6; obj5 = (object)val6; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); object obj6 = <>c.<>9__0_5; if (obj6 == null) { ScrollViewBuilderDelegate val7 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("Simulations are client-sided and based on YOUR config.", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__0_5 = val7; obj6 = (object)val7; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); object obj7 = <>c.<>9__0_6; if (obj7 == null) { ScrollViewBuilderDelegate val8 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" # Extractions # Modules Estimate Map Value Quota Difficulty", sv, default(Vector2)), 0.35f)).rectTransform; <>c.<>9__0_6 = val8; obj7 = (object)val8; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); object obj8 = <>c.<>9__0_7; if (obj8 == null) { ScrollViewBuilderDelegate val9 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" Challenge Chance % # Enemies (T1/T2/T3) Enemy Health %", sv, default(Vector2)), 0.35f)).rectTransform; <>c.<>9__0_7 = val9; obj8 = (object)val9; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f); for (int i = 1; i <= 100; i++) { SimulateLevel(i, val); } MenusManager.currentPage = MenusManager.RightHandPage.Simulation; val.OpenPage(true); } public static void SimulateLevel(int levelNumber, REPOPopupPage page) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_02ab: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Expected O, but got Unknown //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Expected O, but got Unknown object obj = <>c.<>9__1_0; if (obj == null) { ScrollViewBuilderDelegate val = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0f, 4f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val2)).rectTransform; }; <>c.<>9__1_0 = val; obj = (object)val; } page.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform sv) { //IL_0029: 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_0041: Unknown result type (might be due to invalid IL or missing references) REPOLabel obj2 = MenuAPI.CreateREPOLabel((levelNumber == 100) ? "Level 100+" : $"Level {levelNumber}", sv, default(Vector2)); ((Graphic)obj2.labelTMP).color = Helpers.GetDifficultyColor(levelNumber); return ((REPOElement)obj2).rectTransform; }, 0f, 0f); int num = SwaggiFunc.DetermineNumberOfExtractions(levelNumber, (GameDirector.instance?.PlayerList?.Count).GetValueOrDefault(1), withoutRandomness: true) + 1; int num2 = SwaggiFunc.DetermineNumberOfModules(levelNumber, (GameDirector.instance?.PlayerList?.Count).GetValueOrDefault(1), "none", withoutRandomness: true); int num3 = Mathf.RoundToInt(SwaggiFunc.DetermineMapValue(levelNumber, (GameDirector.instance?.PlayerList?.Count).GetValueOrDefault(1), withoutRandomness: true)); float num4 = SwaggiFunc.DetermineBaseQuotaDifficulty(levelNumber, withoutRandomness: true); float num5 = SwaggiFunc.DetermineChallengeChance(levelNumber, includeChanceModifiers: true); int num6 = SwaggiFunc.DetermineT1Enemies(levelNumber); int num7 = SwaggiFunc.DetermineT2Enemies(levelNumber); int num8 = SwaggiFunc.DetermineT3Enemies(levelNumber); int num9 = SwaggiFunc.DetermineEnemyHealthPercentage(levelNumber, (GameDirector.instance?.PlayerList?.Count).GetValueOrDefault(1)); string text = string.Format("{0} {1}", "", num) + string.Format(" {0} {1}", "", num2) + string.Format(" {0} ~{1}K", "", num3) + string.Format(" {0} ~{1:0.000}", "", num4); string text2 = string.Format("{0} ~{1:0.0}%", "", num5) + string.Format(" {0} {1} / {2} / {3}", "", num6, num7, num8) + string.Format(" {0} {1}%", "", num9); page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("" + text + "", sv, default(Vector2)))).rectTransform), 0f, 0f); page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("" + text2 + "", sv, default(Vector2)))).rectTransform), 0f, 0f); } } internal class MenuLSPageStats { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ScrollViewBuilderDelegate <>9__3_0; public static ScrollViewBuilderDelegate <>9__4_0; internal RectTransform b__3_0(Transform sv) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("These stats don't count toward the totals.", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__4_0(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } } private static readonly List totalStatsBlacklist = new List { "Service Station", "Splash Screen", "Main Menu", "Disposal Arena", "Truck", "Lobby Menu", "Recording", "Tutorial", string.Empty }; private static readonly List sectionBlacklist = new List { "Splash Screen", "Main Menu", "Disposal Arena", "Truck", "Lobby Menu", "Recording", "Tutorial", string.Empty }; public static GlobalStatsManager.LevelGlobalStats ComputeTotalStats() { GlobalStatsManager.LevelGlobalStats levelGlobalStats = new GlobalStatsManager.LevelGlobalStats(); foreach (KeyValuePair levelsG in GlobalStatsManager.levelsGS) { if (totalStatsBlacklist.Contains(levelsG.Key)) { continue; } levelGlobalStats.playerDeaths += levelsG.Value.playerDeaths; levelGlobalStats.totalValueExtractedThousands += levelsG.Value.totalValueExtractedThousands; levelGlobalStats.largestSurplusValue = Mathf.Max(levelsG.Value.largestSurplusValue, levelGlobalStats.largestSurplusValue); levelGlobalStats.highestLevel = Mathf.Max(levelsG.Value.highestLevel, levelGlobalStats.highestLevel); levelGlobalStats.levelsCompleted += levelsG.Value.levelsCompleted; levelGlobalStats.playerSelfDeaths += levelsG.Value.playerSelfDeaths; levelGlobalStats.extractionPointsCompleted += levelsG.Value.extractionPointsCompleted; levelGlobalStats.challengesCompleted += levelsG.Value.challengesCompleted; levelGlobalStats.totalValueBrokenThousands += levelsG.Value.totalValueBrokenThousands; levelGlobalStats.modulesExplored += levelsG.Value.modulesExplored; levelGlobalStats.valuablesFound += levelsG.Value.valuablesFound; levelGlobalStats.playtimeInHours += levelsG.Value.playtimeInHours; levelGlobalStats.playerHealthHealed += levelsG.Value.playerHealthHealed; levelGlobalStats.playerDamageTaken += levelsG.Value.playerDamageTaken; foreach (KeyValuePair item in levelsG.Value.enemyDamageDealt) { if (levelGlobalStats.enemyDamageDealt.ContainsKey(item.Key)) { levelGlobalStats.enemyDamageDealt[item.Key] += item.Value; } else { levelGlobalStats.enemyDamageDealt.Add(item.Key, item.Value); } } foreach (KeyValuePair item2 in levelsG.Value.enemiesKilled) { if (levelGlobalStats.enemiesKilled.ContainsKey(item2.Key)) { levelGlobalStats.enemiesKilled[item2.Key] += item2.Value; } else { levelGlobalStats.enemiesKilled.Add(item2.Key, item2.Value); } } } return levelGlobalStats; } public static void Show() { //IL_00d3: 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_00de: Expected O, but got Unknown if (MenusManager.currentPage == MenusManager.RightHandPage.Stats) { return; } MenuAPI.CloseAllPagesAddedOnTop(); MenuLSPageMalfunctions.buttons.Clear(); REPOPopupPage val = MenuAPI.CreateREPOPopupPage("Global Stats", (PresetSide)1, false, false, 5f); AddLevelSection(val, ComputeTotalStats(), "TOTAL"); GlobalStatsManager.LevelGlobalStats levelGlobalStats = null; foreach (KeyValuePair levelsG in GlobalStatsManager.levelsGS) { if (!sectionBlacklist.Contains(levelsG.Key)) { if (levelsG.Key == "Service Station") { levelGlobalStats = levelsG.Value; } else { AddLevelSection(val, levelsG.Value, levelsG.Key); } } } if (levelGlobalStats != null) { AddLevelSection(val, levelGlobalStats, "Service Station"); object obj = <>c.<>9__3_0; if (obj == null) { ScrollViewBuilderDelegate val2 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("These stats don't count toward the totals.", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__3_0 = val2; obj = (object)val2; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); } MenusManager.currentPage = MenusManager.RightHandPage.Stats; val.OpenPage(true); } private static void AddLevelSection(REPOPopupPage page, GlobalStatsManager.LevelGlobalStats stats, string levelName) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //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_003e: Expected O, but got Unknown bool flag = levelName == "Service Station"; object obj = <>c.<>9__4_0; if (obj == null) { ScrollViewBuilderDelegate val = delegate(Transform sv) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val2)).rectTransform; }; <>c.<>9__4_0 = val; obj = (object)val; } page.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel(levelName, sv, default(Vector2))).rectTransform), 0f, 0f); uint num = 0u; uint num2 = 0u; foreach (KeyValuePair item in stats.enemiesKilled) { num += item.Value; } foreach (KeyValuePair item2 in stats.enemyDamageDealt) { num2 += item2.Value; } AddLabelSubsection("clock", "#7ff", Helpers.TimeToString((float)(stats.playtimeInHours * 3600.0)) ?? "", "TIME PLAYED", page); if (!flag) { AddLabelSubsection("check", "#0f0", $"x {stats.levelsCompleted:n0}", "LEVELS PASSED", page); } if (!flag) { AddLabelSubsection("extraction", "#0f7", $"x {stats.extractionPointsCompleted:n0}", "EXTRACTIONS COMPLETED", page); } if (!flag) { AddLabelSubsection("$$", "#2c2", $"${SemiFunc.DollarGetString((int)(stats.totalValueExtractedThousands * 1000.0)):n0}", "VALUE EXTRACTED", page); } if (!flag) { AddLabelSubsection("surplus", "#5c2", $"${SemiFunc.DollarGetString(stats.largestSurplusValue):n0}", "HIGHEST TAX RETURN", page); } if (!flag) { AddLabelSubsection("sparkle", "#7f0", $"x {stats.valuablesFound:n0}", "VALUABLES FOUND", page); } if (!flag) { AddLabelSubsection("road", "#ff0", $"x {stats.modulesExplored:n0}", "MODULES EXPLORED", page); } if (!flag) { AddLabelSubsection("burnmoney", "#c62", $"${SemiFunc.DollarGetString((int)(stats.totalValueBrokenThousands * 1000.0)):n0}", "VALUE LOST", page); } if (!flag) { AddLabelSubsection("spiral", "#f00", $"x {stats.challengesCompleted:n0}", "CHALLENGES CLEARED", page); } if (!flag) { AddLabelSubsection("item_health_pack_L", "#f0f", $"{stats.playerHealthHealed:n0} HP", "HEALTH RECOVERED", page); } AddLabelSubsection("player", "#70f", $"{stats.playerDamageTaken:n0} HP", "DAMAGE TAKEN", page); AddLabelSubsection("deathhead", "#00f", $"x {stats.playerSelfDeaths:n0}", "DEATHS", page); if (!flag) { AddLabelSubsection("blood", "#69f", $"{num2:n0} HP", "ENEMY DAMAGE DEALT", page); } if (!flag) { AddLabelSubsection("weapon_sword", "#94f", $"x {num:n0}", "ENEMIES KILLED", page); } } private static void AddLabelSubsection(string emoji, string color, string boldText, string labelText, REPOPopupPage page) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" " + boldText + " " + labelText + "", sv, default(Vector2)))).rectTransform), 0f, 0f); } } internal class MenusManager { public enum RightHandPage { None, Stats, Simulation, Malfunction, Credits } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static BuilderDelegate <>9__7_0; public static BuilderDelegate <>9__7_1; public static BuilderDelegate <>9__8_0; public static BuilderDelegate <>9__8_1; public static BuilderDelegate <>9__8_2; public static BuilderDelegate <>9__8_3; internal void b__7_0(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI labelTMP = MenuAPI.CreateREPOButton("Level Scaling", (Action)LevelScalingButtonClicked, p, new Vector2(25f, 10f)).labelTMP; ((TMP_Text)labelTMP).fontSize = ((TMP_Text)labelTMP).fontSize * 0.8f; } internal void b__7_1(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI labelTMP = MenuAPI.CreateREPOButton("Level Scaling", (Action)LevelScalingButtonClicked, p, new Vector2(25f, 10f)).labelTMP; ((TMP_Text)labelTMP).fontSize = ((TMP_Text)labelTMP).fontSize * 0.8f; } internal void b__8_0(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Global Stats", (Action)MenuLSPageStats.Show, p, new Vector2(80f, 230f)); } internal void b__8_1(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Level Simulation", (Action)MenuLSPageSimulation.Show, p, new Vector2(80f, 195f)); } internal void b__8_2(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Malfunctions", (Action)MenuLSPageMalfunctions.Show, p, new Vector2(80f, 160f)); } internal void b__8_3(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Credits", (Action)MenuLSPageCredits.Show, p, new Vector2(80f, 125f)); } } private static bool createdButtons; private static TMP_SpriteAsset _spriteAsset; public static RightHandPage currentPage; public static TMP_SpriteAsset SpriteAsset { get { if ((Object)(object)_spriteAsset != (Object)null) { return _spriteAsset; } _spriteAsset = ((TMP_Text)Resources.FindObjectsOfTypeAll().First().saveFileInfoRow3).spriteAsset; return _spriteAsset; } } public static REPOLabel SwoonLabelText(REPOLabel label, float scale = 0.55f, bool tintSprites = false) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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) TextMeshProUGUI labelTMP = label.labelTMP; ((TMP_Text)labelTMP).fontSize = ((TMP_Text)labelTMP).fontSize * scale; TextMeshProUGUI labelTMP2 = label.labelTMP; ((TMP_Text)labelTMP2).lineSpacing = ((TMP_Text)labelTMP2).lineSpacing * scale; ((TMP_Text)label.labelTMP).fontStyle = (FontStyles)0; ((Graphic)label.labelTMP).color = Color.white; ((TMP_Text)label.labelTMP).spriteAsset = SpriteAsset; ((TMP_Text)label.labelTMP).tintAllSprites = tintSprites; ((REPOElement)label).rectTransform.sizeDelta = new Vector2(((REPOElement)label).rectTransform.sizeDelta.x, ((REPOElement)label).rectTransform.sizeDelta.y * scale * 0.85f); return label; } public static void Start(MenuPageMain menuPageMainParent) { //IL_002d: 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: Expected O, but got Unknown //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown if (Plugin.ShowMenuButton_MainMenu.Value) { TextMeshProUGUI labelTMP = MenuAPI.CreateREPOButton("Level Scaling", (Action)LevelScalingButtonClicked, ((Component)menuPageMainParent).transform, new Vector2(46f, 360f)).labelTMP; ((TMP_Text)labelTMP).fontSize = ((TMP_Text)labelTMP).fontSize * 0.8f; } if (createdButtons) { return; } if (Plugin.ShowMenuButton_LobbyMenu.Value) { object obj = <>c.<>9__7_0; if (obj == null) { BuilderDelegate val = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI labelTMP3 = MenuAPI.CreateREPOButton("Level Scaling", (Action)LevelScalingButtonClicked, p, new Vector2(25f, 10f)).labelTMP; ((TMP_Text)labelTMP3).fontSize = ((TMP_Text)labelTMP3).fontSize * 0.8f; }; <>c.<>9__7_0 = val; obj = (object)val; } MenuAPI.AddElementToLobbyMenu((BuilderDelegate)obj); } if (Plugin.ShowMenuButton_PauseScreen.Value) { object obj2 = <>c.<>9__7_1; if (obj2 == null) { BuilderDelegate val2 = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) TextMeshProUGUI labelTMP2 = MenuAPI.CreateREPOButton("Level Scaling", (Action)LevelScalingButtonClicked, p, new Vector2(25f, 10f)).labelTMP; ((TMP_Text)labelTMP2).fontSize = ((TMP_Text)labelTMP2).fontSize * 0.8f; }; <>c.<>9__7_1 = val2; obj2 = (object)val2; } MenuAPI.AddElementToEscapeMenu((BuilderDelegate)obj2); } createdButtons = true; } public static void LevelScalingButtonClicked() { //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_0043: 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 //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Expected O, but got Unknown REPOPopupPage page = MenuAPI.CreateREPOPopupPage("Level Scaling", (PresetSide)0, false, true, 0f); REPOPopupPage obj = page; object obj2 = <>c.<>9__8_0; if (obj2 == null) { BuilderDelegate val = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Global Stats", (Action)MenuLSPageStats.Show, p, new Vector2(80f, 230f)); }; <>c.<>9__8_0 = val; obj2 = (object)val; } obj.AddElement((BuilderDelegate)obj2); if (!Plugin.LevelSimulationDisabled) { REPOPopupPage obj3 = page; object obj4 = <>c.<>9__8_1; if (obj4 == null) { BuilderDelegate val2 = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Level Simulation", (Action)MenuLSPageSimulation.Show, p, new Vector2(80f, 195f)); }; <>c.<>9__8_1 = val2; obj4 = (object)val2; } obj3.AddElement((BuilderDelegate)obj4); } if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { REPOPopupPage obj5 = page; object obj6 = <>c.<>9__8_2; if (obj6 == null) { BuilderDelegate val3 = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Malfunctions", (Action)MenuLSPageMalfunctions.Show, p, new Vector2(80f, 160f)); }; <>c.<>9__8_2 = val3; obj6 = (object)val3; } obj5.AddElement((BuilderDelegate)obj6); } REPOPopupPage obj7 = page; object obj8 = <>c.<>9__8_3; if (obj8 == null) { BuilderDelegate val4 = delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Credits", (Action)MenuLSPageCredits.Show, p, new Vector2(80f, 125f)); }; <>c.<>9__8_3 = val4; obj8 = (object)val4; } obj7.AddElement((BuilderDelegate)obj8); page.AddElement((BuilderDelegate)delegate(Transform p) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) MenuAPI.CreateREPOButton("Close", (Action)ClosePage, p, new Vector2(80f, 40f)); }); REPOPopupPage obj9 = page; obj9.onEscapePressed = (ShouldCloseMenuDelegate)Delegate.Combine((Delegate?)(object)obj9.onEscapePressed, (Delegate?)(ShouldCloseMenuDelegate)delegate { ClosePage(); return true; }); page.OpenPage(false); void ClosePage() { page.ClosePage(true); currentPage = RightHandPage.None; MenuLSPageMalfunctions.buttons.Clear(); } } } } namespace LevelScaling.LevelStats { internal class GlobalStatsManager { public class LevelGlobalStats { public uint playerDeaths; public double totalValueExtractedThousands; public int largestSurplusValue; public uint extractionPointsCompleted; public uint challengesCompleted; public double totalValueBrokenThousands; public uint modulesExplored; public uint valuablesFound; public double playtimeInHours; public uint playerDamageTaken; public uint playerHealthHealed; public Dictionary enemiesKilled = new Dictionary(); public Dictionary enemyDamageDealt = new Dictionary(); public uint levelsCompleted; public int highestLevel; public uint playerSelfDeaths; public uint valuablesFoundSelf; } public static string _challengesSetLevelName = "null"; public static int _challengesSetAmount = 0; public static Dictionary levelsGS = new Dictionary(); public static string ThisLevel => RunManager.instance?.levelCurrent?.NarrativeName ?? "null"; public static void TryCreateLevelInDictionary(string level) { if (!levelsGS.ContainsKey(level)) { levelsGS.Add(level, new LevelGlobalStats()); } } public static void AddPlayerDeath() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].playerDeaths++; } public static void AddPlayerSelfDeath() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].playerSelfDeaths++; } public static void AddExtractedValue(float amount) { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].totalValueExtractedThousands += (double)amount / 1000.0; } public static void SetLargestSurplusValue(int amount) { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].largestSurplusValue = Mathf.Max(amount, levelsGS[ThisLevel].largestSurplusValue); } public static void AddExtractionCompleted() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].extractionPointsCompleted++; } public static void AddChallengesCompleted(int amount, string levelName = "") { TryCreateLevelInDictionary(levelName); if (amount < 0) { if (string.IsNullOrEmpty(levelName)) { levelName = ThisLevel; } levelsGS[levelName].challengesCompleted -= (uint)Mathf.Abs(amount); } else { levelsGS[ThisLevel].challengesCompleted += (uint)amount; } } public static void RevertChallengesCompleted() { if (!(_challengesSetLevelName == "null") && !string.IsNullOrEmpty(_challengesSetLevelName) && _challengesSetAmount != 0 && levelsGS.ContainsKey(_challengesSetLevelName)) { AddChallengesCompleted(Mathf.Max(-_challengesSetAmount, (int)(0 - levelsGS[_challengesSetLevelName].challengesCompleted))); _challengesSetLevelName = "null"; _challengesSetAmount = 0; } } public static void AddBrokenValue(float amount) { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].totalValueBrokenThousands += (double)amount / 1000.0; } public static void AddModuleExplored() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].modulesExplored++; } public static void AddValuableFound() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].valuablesFound++; } public static void AddValuableFoundSelf() { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].valuablesFoundSelf++; } public static void AddPlaytime(string levelName, float seconds) { TryCreateLevelInDictionary(levelName); levelsGS[levelName].playtimeInHours += (double)seconds / 3600.0; } public static void AddPlayerDamageTaken(int amount) { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].playerDamageTaken += (uint)amount; } public static void AddPlayerHealthHealed(int amount) { TryCreateLevelInDictionary(ThisLevel); levelsGS[ThisLevel].playerHealthHealed += (uint)amount; } public static void AddLevelCompleted(string level) { TryCreateLevelInDictionary(level); levelsGS[level].levelsCompleted++; } public static void SetHighestLevel(int amount, string level) { TryCreateLevelInDictionary(level); levelsGS[level].highestLevel = Mathf.Max(amount, levelsGS[level].highestLevel); } public static void AddEnemyDamageDealt(string enemyName, int amount) { if (Plugin.DeepLog) { Helpers.DeepLog($"[GS] enemy damaged - {enemyName} ({amount})"); } TryCreateLevelInDictionary(ThisLevel); if (!levelsGS[ThisLevel].enemyDamageDealt.ContainsKey(enemyName)) { levelsGS[ThisLevel].enemyDamageDealt.Add(enemyName, (uint)amount); } else { levelsGS[ThisLevel].enemyDamageDealt[enemyName] += (uint)amount; } } public static void AddEnemyKilled(string enemyName) { if (Plugin.DeepLog) { Helpers.DeepLog("[GS] enemy killed - " + enemyName); } TryCreateLevelInDictionary(ThisLevel); if (!levelsGS[ThisLevel].enemiesKilled.ContainsKey(enemyName)) { levelsGS[ThisLevel].enemiesKilled.Add(enemyName, 1u); } else { levelsGS[ThisLevel].enemiesKilled[enemyName]++; } } public static void SaveGlobalStats(bool backup = false) { //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_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: 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_0045: Expected O, but got Unknown string path = (backup ? (Application.persistentDataPath + "/LevelScalingGlobalSave_backup.es3") : (Application.persistentDataPath + "/LevelScalingGlobalSave.es3")); ES3Settings val = new ES3Settings((string)null, (ES3Settings)null) { encryptionType = (EncryptionType)1, encryptionPassword = SwaggiFunc.es3Password, path = path }; ES3.Save>("allLevelsGlobalStats", levelsGS, val); ES3.Save>("bestMalfunctionLevels", MalfunctionManager.bestMalfunctionLevels, val); Plugin.loggy.LogDebug((object)("Saved global stats to " + val.path + ".")); } public static void LoadGlobalStats() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown string text = Application.persistentDataPath + "/LevelScalingGlobalSave.es3"; if (!File.Exists(text)) { return; } ES3Settings val = new ES3Settings(text, (EncryptionType)1, SwaggiFunc.es3Password, (ES3Settings)null); levelsGS = ES3.Load>("allLevelsGlobalStats", text, new Dictionary(), val); Plugin.loggy.LogDebug((object)("Loaded global stats from " + val.path + ".")); if (ES3.KeyExists("bestMalfunctionLevels", text, val)) { foreach (KeyValuePair item in ES3.Load>("bestMalfunctionLevels", text, val)) { MalfunctionManager.SetMalfunctionBestLevel(item.Key, item.Value, allowBelow: false, force: true); Helpers.DeepLog($"loaded BML - {item.Key} / {item.Value}"); } } SaveGlobalStats(backup: true); } } internal class LevelStatsManager { public static bool firstExtractionOpenedThisLevel = false; public static bool _syncedTimer = false; public static float thisLevelTime = 0f; public static float _lastLevelTimeSync = 0f; public static int enemyKills = 0; public static int enemyKillsRaw = 0; public static int playerDeaths = 0; public static float totalValueExtracted = 0f; public static int totalMapValue = 0; public static float _clientTotalMapValue = 0f; public static int _valueFromSurplus = 0; public static float totalValueBroken = 0f; public static int modulesExplored = 0; public static int totalModules = 0; public static int valuablesFound = 0; public static int nonDiscoveredValuablesBroken = 0; public static int valuablesTotal = 0; public static int individualOrbDrops = 0; public static int maxIndividualOrbDrops = 0; public static Dictionary individualOrbDropCounts = new Dictionary(); public static bool allOrbsDropped = false; public static int cosmeticBoxesExtracted = 0; public static int cosmeticBoxesBroken = 0; public static int cosmeticBoxesTotal = 0; private static Level _lastLevel = null; private static float _totalTimeSpentOnLevel = 0f; public static bool IsMaster => SemiFunc.IsMasterClientOrSingleplayer(); public static int ExploredPercentage => Mathf.FloorToInt(100f * (float)modulesExplored / (float)totalModules); public static int RemainingTotalMapValue => totalMapValue - (int)totalValueBroken; public static int RemainingTotalValuables => valuablesTotal - nonDiscoveredValuablesBroken; public static int RemainingCosmeticBoxes => cosmeticBoxesTotal - cosmeticBoxesBroken; public static void OnNewLevel() { ItemValuableBoxPatch.absorbingObjects.Clear(); thisLevelTime = 0f; _lastLevelTimeSync = 0f; enemyKills = 0; enemyKillsRaw = 0; playerDeaths = 0; totalValueExtracted = 0f; totalValueBroken = 0f; firstExtractionOpenedThisLevel = false; _syncedTimer = false; totalMapValue = 0; _clientTotalMapValue = 0f; _valueFromSurplus = 0; modulesExplored = 0; totalModules = 0; valuablesFound = 0; nonDiscoveredValuablesBroken = 0; valuablesTotal = 0; individualOrbDrops = 0; maxIndividualOrbDrops = 0; individualOrbDropCounts.Clear(); allOrbsDropped = false; cosmeticBoxesBroken = 0; cosmeticBoxesExtracted = 0; cosmeticBoxesTotal = 0; } public static void Update() { if ((Object)(object)RunManager.instance.levelCurrent != (Object)(object)_lastLevel) { if ((Object)(object)_lastLevel != (Object)null) { GlobalStatsManager.AddPlaytime(_lastLevel.NarrativeName, _totalTimeSpentOnLevel); } _lastLevel = RunManager.instance.levelCurrent; _totalTimeSpentOnLevel = 0f; } _totalTimeSpentOnLevel += Time.deltaTime; if ((SemiFunc.RunIsLevel() || SemiFunc.RunIsShop()) && firstExtractionOpenedThisLevel && !Helpers.TruckStarting) { thisLevelTime += Time.deltaTime; MalfunctionManager.Solitude_HandleTimer(); if (GameManager.Multiplayer() && SemiFunc.IsMasterClient() && Plugin.LSCompatibilityMode.Value <= Plugin.CompatibilityMode.Host && SemiFunc.RunIsLevel() && Mathf.Abs(thisLevelTime - _lastLevelTimeSync) > 10f) { _lastLevelTimeSync = thisLevelTime; LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("SyncTimerRPC", (RpcTarget)0, new object[1] { thisLevelTime }); } } } } if ((Object)(object)RoundDirector.instance == (Object)null) { totalMapValue = 0; return; } totalMapValue = (int)_clientTotalMapValue; totalMapValue -= _valueFromSurplus; } public static void AddEnemyKill() { if (SemiFunc.RunIsLevel()) { enemyKills++; LevelStatsUI.flashTimer_orbDrops = 0.4f; if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { GoalUIPatch.FlashGreen(); } } } public static void AddEnemyKillRaw() { if (SemiFunc.RunIsLevel()) { enemyKillsRaw++; if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { GoalUIPatch.FlashGreen(); } } } public static void AddPlayerDeath() { playerDeaths++; LevelStatsUI.flashTimer_deaths = 0.4f; } public static void AddValueExtracted(float value) { if (value > 0f) { GlobalStatsManager.AddExtractedValue(value); } if (SemiFunc.RunIsLevel()) { totalValueExtracted += value; LevelStatsUI.flashTimer_extracted = 0.4f; } } public static void AddValueBroken(float value) { if (value > 0f) { GlobalStatsManager.AddBrokenValue(value); } if (SemiFunc.RunIsLevel()) { totalValueBroken += value; RunStatsManager.instance.totalValueBroken += value; if (value >= 10000f) { LevelStatsUI.flashTimer_broken = Mathf.Max(LevelStatsUI.flashTimer_broken, 0.6f); } else if (value >= 1000f) { LevelStatsUI.flashTimer_broken = Mathf.Max(LevelStatsUI.flashTimer_broken, 0.4f); } else { LevelStatsUI.flashTimer_broken = 0.2f; } } } public static void SetModuleCount(int value) { if (SemiFunc.RunIsLevel()) { totalModules = value; } } public static void AddModuleExplored() { GlobalStatsManager.AddModuleExplored(); if (SemiFunc.RunIsLevel()) { modulesExplored++; LevelStatsUI.flashTimer_explored = 0.4f; RunStatsManager.instance.modulesExplored++; } } public static void AddTotalIndivOrbs(int value) { if (SemiFunc.RunIsLevel()) { maxIndividualOrbDrops += value; } } public static void AddIndivOrb() { if (SemiFunc.RunIsLevel()) { individualOrbDrops++; } } public static void SetAllOrbsFound(bool value) { if (SemiFunc.RunIsLevel()) { allOrbsDropped = value; } } public static void AddValuableTotal() { if (SemiFunc.RunIsLevel()) { valuablesTotal++; } } public static void AddValuableFound() { GlobalStatsManager.AddValuableFound(); if (SemiFunc.RunIsLevel()) { valuablesFound++; LevelStatsUI.flashTimer_found = 0.4f; RunStatsManager.instance.valuablesFound++; } } public static void AddCosmeticBoxSpawn() { if (SemiFunc.RunIsLevel()) { cosmeticBoxesTotal++; } } public static void AddCosmeticBoxBroken() { if (SemiFunc.RunIsLevel()) { cosmeticBoxesBroken++; } } public static void AddCosmeticBoxExtracted() { if (SemiFunc.RunIsLevel()) { cosmeticBoxesExtracted++; LevelStatsUI.flashTimer_cosmetic = 0.4f; } } } internal class LevelStatsSyncing : MonoBehaviour { public static LevelStatsSyncing instance; public PhotonView photonView; private void Start() { if (Plugin.LSCompatibilityMode.Value > Plugin.CompatibilityMode.Host) { photonView = ((Component)this).gameObject.AddComponent(); photonView.ViewID = 8626255; if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)((Component)instance).gameObject); } instance = this; Helpers.DeepLog("Setup syncing."); } } [PunRPC] public void SyncTimerRPC(float time, PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog($"Timer sync received - {time:0.000} sec"); if (!SemiFunc.IsMasterClientOrSingleplayer() && Mathf.Abs(time - LevelStatsManager.thisLevelTime) > 0.5f) { LevelStatsManager.thisLevelTime = time; } } } [PunRPC] public void SyncChallengeRPC(int challenge, PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog($"Challenge sync received - {challenge}"); ChallengeManager.SetupChallenges((ChallengeManager.ChallengeType)challenge); } } [PunRPC] public void SyncMalfunctionRPC(int malfunction, PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog($"Malfunction sync received - {malfunction}"); MalfunctionManager.SetMalfunction((MalfunctionManager.MalfunctionType)malfunction, withNotification: true); } } [PunRPC] public void Solitude_TimesUpSequenceRPC(PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog("Solitude times up!!!!!"); if (MalfunctionManager._solitude_timesUpSequence != null) { ((MonoBehaviour)this).StopCoroutine(MalfunctionManager._solitude_timesUpSequence); } MalfunctionManager._solitude_timesUpSequence = ((MonoBehaviour)this).StartCoroutine(MalfunctionManager.Solitude_TimesUp()); } } [PunRPC] public void Solitude_KillSelfRPC(PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog("Solitude death"); MalfunctionManager._solitudeGameOverSequence = true; MalfunctionManager.Solitude_KillSelf(); } } [PunRPC] public void Solitude_CompleteRPC(PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.MasterOnlyRPC(info)) { return; } Helpers.DeepLog("Solitude complete"); MalfunctionManager._solitudeCompletedSequence = true; if (SemiFunc.IsMasterClientOrSingleplayer()) { ExtractionPoint extractionPointCurrent = RoundDirector.instance.extractionPointCurrent; if (extractionPointCurrent != null) { extractionPointCurrent.StateSet((State)3); } } if (Helpers.AllPlayersDead()) { SwaggiFunc.DisplayBigMessage("EVERYONE'S DEAD? I'M\nTAKING THE LOOT THEN.", "{!}", 4f, Color.red, Color.red); } else { SwaggiFunc.DisplayBigMessage("TIME'S UP! I'M TAKING\nWHATEVER YOU'VE GOT.", "{!}", 4f, Color.red, Color.red); } } [PunRPC] public void Solitude_PlayerRevivedRPC(PhotonMessageInfo info = default(PhotonMessageInfo)) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.MasterOnlyRPC(info)) { Helpers.DeepLog("Solitude player revived"); MalfunctionManager.solitudeRevives++; GoalUIPatch.FlashRed(); } } } internal class LevelStatsUI : SemiUI { public static LevelStatsUI instance; public TextMeshProUGUI statsNumbers; public TextMeshProUGUI statsText; public TextMeshProUGUI statsHeader; public float hideTime; public float scootedTime; private bool dontScoot = true; private static readonly Color colorNone = new Color(0.5f, 0.5f, 0.5f); private static readonly Color colorSubtext = new Color(0.63f, 0.63f, 0.63f); private static readonly Color colorBad = new Color(1f, 0.2f, 0.2f); private static readonly Color colorNeutral = new Color(1f, 1f, 0.2f); private static readonly Color colorGood = new Color(0.2f, 1f, 0.2f); private static readonly Color colorSubtextGood = new Color(0.15f, 0.7f, 0.15f); private static readonly Color colorSubtextNeutral = new Color(0.7f, 0.7f, 0.15f); private static readonly Color colorSubtextBad = new Color(0.7f, 0.15f, 0.15f); private static readonly Color colorBase = Color.white; private static readonly Vector3 _origPosition = new Vector3(260f, -20f, 0f); public const float FLASH_TIMER = 0.2f; public static float flashTimer_deaths = 0f; private static readonly Color colorFlashDeaths = new Color(1f, 1f, 0f); public static float flashTimer_orbDrops = 0f; private static readonly Color colorFlashOrbDrops = new Color(1f, 0f, 1f); public static float flashTimer_extracted = 0f; private static readonly Color colorFlashExtracted = new Color(0f, 0f, 1f); public static float flashTimer_broken = 0f; private static readonly Color colorFlashBroken = new Color(1f, 1f, 0f); public static float flashTimer_found = 0f; private static readonly Color colorFlashFound = new Color(0f, 0f, 1f); public static float flashTimer_explored = 0f; private static readonly Color colorFlashExplored = new Color(0f, 0f, 1f); public static float flashTimer_cosmetic = 0f; private static readonly Color colorFlashCosmetic = new Color(0f, 0f, 0f); private static bool ShowBase => Plugin.StatsUIShow_Base.Value; private static bool ShowShop => Plugin.StatsUIShow_Shop.Value; private static bool ShowMap => Plugin.StatsUIShow_Map.Value; private static bool ShowEnd => Plugin.StatsUIShow_EndOfLevel.Value; private static Color FlashColor(float flashTime, Color original, Color flashColor) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) if (flashTime % 0.2f > 0.1f && Plugin.StatsUI_Flash.Value) { return flashColor; } return original; } public static void Create(StatsUI orig) { //IL_004a: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.RunIsShop() || SemiFunc.RunIsLevel()) { Plugin.loggy.LogDebug((object)"creating LevelStatsUI object..."); GameObject obj = Object.Instantiate(((Component)orig).gameObject, ((Component)orig).gameObject.transform.parent); ((Object)obj).name = "LevelStatsUI"; obj.transform.localPosition = _origPosition + new Vector3(0f, (float)Plugin.StatsUI_YOffset.Value, 0f); Transform transform = obj.transform; transform.localScale *= 0.875f; StatsUI val = default(StatsUI); if (obj.TryGetComponent(ref val)) { Object.Destroy((Object)(object)val); } obj.AddComponent(); } } public override void Start() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_014f: 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_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: 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) base.animateTheEntireObject = true; ((SemiUI)this).Start(); base.allChildren.Clear(); if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)((Component)instance).gameObject); } instance = this; flashTimer_deaths = 0f; flashTimer_orbDrops = 0f; flashTimer_extracted = 0f; flashTimer_broken = 0f; flashTimer_found = 0f; flashTimer_explored = 0f; Helpers.DeepLog("[LevelStatsUI] setting up header..."); statsHeader = ((Component)((Component)this).transform.Find("Upgrades Header")).GetComponent(); ((Behaviour)statsHeader).enabled = true; Helpers.DeepLog("[LevelStatsUI] setting up stats text..."); statsText = ((Component)((Component)this).transform.Find("StatsNumbers")).GetComponent(); TextMeshProUGUI obj = statsText; ((TMP_Text)obj).margin = ((TMP_Text)obj).margin + new Vector4(-500f, 0f, 0f, 0f); Transform transform = ((TMP_Text)statsText).transform; transform.localPosition -= new Vector3(10f, 0f, 0f); ((TMP_Text)statsText).alignment = (TextAlignmentOptions)260; ((Graphic)statsText).color = new Color(1f, 0.4f, 0f); ((TMP_Text)statsText).fontStyle = (FontStyles)0; ((TMP_Text)statsText).spriteAsset = GoalUIPatch.SpriteAsset; Helpers.DeepLog("[LevelStatsUI] setting up values..."); statsNumbers = ((Component)this).GetComponent(); ((TMP_Text)statsNumbers).alignment = (TextAlignmentOptions)257; ((Graphic)statsNumbers).color = Color.white; ((TMP_Text)statsNumbers).fontStyle = (FontStyles)1; Helpers.DeepLog("[LevelStatsUI] correcting positions..."); Transform transform2 = ((TMP_Text)statsNumbers).transform; transform2.localPosition += new Vector3(6f, 0f); Helpers.DeepLog("[LevelStatsUI] set up successfully!"); } public override void Update() { //IL_00ab: Unknown result type (might be due to invalid IL or missing references) ((SemiUI)this).Update(); ((Behaviour)statsText).enabled = true; ((Behaviour)statsNumbers).enabled = true; ((TMP_Text)statsText).text = ""; ((TMP_Text)statsNumbers).text = ""; if (SemiFunc.RunIsLevel()) { ((TMP_Text)statsHeader).text = $"LEVEL {Helpers.CurrentLevel}"; } else if (SemiFunc.RunIsShop()) { ((TMP_Text)statsHeader).text = $"SHOP {Helpers.CurrentLevel - 1}"; } else { ((TMP_Text)statsHeader).text = "??????"; } ((Graphic)statsHeader).color = Helpers.GetDifficultyColor(Helpers.CurrentLevel); ((Behaviour)statsHeader).enabled = true; flashTimer_deaths -= Time.deltaTime; flashTimer_orbDrops -= Time.deltaTime; flashTimer_extracted -= Time.deltaTime; flashTimer_broken -= Time.deltaTime; flashTimer_found -= Time.deltaTime; flashTimer_explored -= Time.deltaTime; ScootLogic(); SetText(); } private void ScootLogic() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) dontScoot = ShowBase; if (MapToolControllerPatch.mapToolActive) { dontScoot = ShowMap; } if (Helpers.TruckLeaving && ShowEnd) { dontScoot = true; } if (SemiFunc.RunIsShop()) { dontScoot = dontScoot && ShowShop; } if (hideTime > 0f) { dontScoot = false; hideTime = Mathf.Max(0f, hideTime - Time.deltaTime); } if (dontScoot) { scootedTime = 0f; return; } scootedTime += Time.deltaTime; ((SemiUI)this).SemiUIScoot(new Vector2(200f, 0f), 0.2f); } private bool ShouldDisplay(ConfigEntry config) { return config.Value; } private bool ShouldDisplay(ConfigEntry config) { return config.Value != Plugin.StatsUIValueOptions.DontDisplay; } private bool ShouldDisplay(ConfigEntry config) { if (config.Value == Plugin.StatsUIShowOptions.DontDisplay) { return false; } if (config.Value == Plugin.StatsUIShowOptions.OnlyInLevel) { return SemiFunc.RunIsLevel(); } if (config.Value == Plugin.StatsUIShowOptions.OnlyInShop) { return SemiFunc.RunIsShop(); } return true; } private void AddLineRaw(string label, string value) { TextMeshProUGUI obj = statsText; ((TMP_Text)obj).text = ((TMP_Text)obj).text + label + "\n"; TextMeshProUGUI obj2 = statsNumbers; ((TMP_Text)obj2).text = ((TMP_Text)obj2).text + value + "\n"; } private void AddBasicLine(string label, string sprite, string value, Color color) { //IL_000f: 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_002c: Unknown result type (might be due to invalid IL or missing references) if (Plugin.StatsUI_UseSprites.Value == Plugin.StatsUISpriteOptions.OnlyText) { AddLineRaw(label, Helpers.ColoredText(value, color)); } else if (Plugin.StatsUI_UseSprites.Value == Plugin.StatsUISpriteOptions.OnlySprites) { AddLineRaw(sprite, Helpers.ColoredText(value, color)); } else { AddLineRaw(label + " " + sprite, Helpers.ColoredText(value, color)); } } private void AddValueLine(string label, string sprite, string value, Color valueColor) { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) AddValueLine(label, sprite, value, valueColor, null, Color.white); } private void AddValueLine(string label, string sprite, string value, Color valueColor, string total, Color totalColor) { //IL_0035: 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) string text = value; if (!string.IsNullOrEmpty(total)) { string text2 = Helpers.ColoredText("/" + total + "", totalColor); text = text + " " + text2; } AddBasicLine(label, sprite, text, valueColor); } private void SetText() { //IL_0071: 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_00e4: 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_0120: 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_0101: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: 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) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0171: 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_0136: 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_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: 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_027a: 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_0284: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Unknown result type (might be due to invalid IL or missing references) //IL_0224: 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_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_039b: Unknown result type (might be due to invalid IL or missing references) //IL_03c0: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_0309: 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_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0350: Unknown result type (might be due to invalid IL or missing references) //IL_0355: Unknown result type (might be due to invalid IL or missing references) //IL_0369: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0340: Unknown result type (might be due to invalid IL or missing references) if (scootedTime > 1f) { return; } ((TMP_Text)statsNumbers).lineSpacing = ((Plugin.StatsUI_UseSprites.Value >= Plugin.StatsUISpriteOptions.OnlySprites) ? (-37f) : (-40f)); if (ShouldDisplay(Plugin.StatsUIDisplay_Malfunction) && MalfunctionManager.IsMalfunctionActive()) { MalfunctionManager.Malfunction malfunction = MalfunctionManager.GetMalfunction(MalfunctionManager.activeMalfunction); AddBasicLine("MALFUNCTION", "", malfunction.name, new Color(0.5f, 0f, 1f)); } if (ShouldDisplay(Plugin.StatsUIDisplay_Challenge) && ChallengeManager.IsChallengeActive()) { ChallengeManager.Challenge challenge = ChallengeManager.GetChallenge(ChallengeManager.currentChallenges[0]); AddBasicLine("CHALLENGE", "", challenge.name, Color.red); } if (ShouldDisplay(Plugin.StatsUIDisplay_Time)) { Color valueColor = (Helpers.TruckStarting ? colorGood : (LevelStatsManager.firstExtractionOpenedThisLevel ? colorBase : colorNone)); string value = Helpers.TimeToString(LevelStatsManager.thisLevelTime); AddValueLine("TIME", "", value, valueColor); } if (ShouldDisplay(Plugin.StatsUIDisplay_OrbDrops)) { Color valueColor2 = FlashColor(flashTimer_orbDrops, (LevelStatsManager.enemyKills == 0) ? colorNone : colorBase, colorFlashOrbDrops); int enemyKills = LevelStatsManager.enemyKills; AddValueLine("ORB DROPS", "", enemyKills.ToString(), valueColor2); } if (ShouldDisplay(Plugin.StatsUIDisplay_Deaths)) { Color valueColor3 = FlashColor(flashTimer_deaths, (LevelStatsManager.playerDeaths == 0) ? colorNone : colorBad, colorFlashDeaths); int playerDeaths = LevelStatsManager.playerDeaths; AddValueLine("DEATHS", "", playerDeaths.ToString(), valueColor3); } if (ShouldDisplay(Plugin.StatsUIDisplay_Extracted)) { Color valueColor4 = FlashColor(flashTimer_extracted, GetExtractedAColor(), colorFlashExtracted); string value2 = "$" + SemiFunc.DollarGetString((int)LevelStatsManager.totalValueExtracted); GetExtractedB(out var total, out var color); AddValueLine("EXTRACTED", "", value2, valueColor4, total, color); } if (ShouldDisplay(Plugin.StatsUIDisplay_Broken)) { Color valueColor5 = FlashColor(flashTimer_broken, (LevelStatsManager.totalValueBroken < 1f) ? colorNone : colorBad, colorFlashBroken); string value3 = "-$" + SemiFunc.DollarGetString((int)LevelStatsManager.totalValueBroken); AddValueLine("BROKEN", "", value3, valueColor5); } if (ShouldDisplay(Plugin.StatsUIDisplay_Found)) { Color valueColor6 = FlashColor(flashTimer_found, GetFoundAColor(), colorFlashFound); int valuablesFound = LevelStatsManager.valuablesFound; GetFoundB(out var total2, out var color2); AddValueLine("FOUND", "", valuablesFound.ToString(), valueColor6, total2, color2); } if (ShouldDisplay(Plugin.StatsUIDisplay_Explored)) { bool flag = LevelStatsManager.modulesExplored >= LevelStatsManager.totalModules && Plugin.StatsUIDisplay_Explored.Value >= Plugin.StatsUIValueOptions.CurrentAndTotal; Color valueColor7 = FlashColor(flashTimer_explored, flag ? colorGood : ((LevelStatsManager.modulesExplored < 1) ? colorNone : colorBase), colorFlashExplored); int modulesExplored = LevelStatsManager.modulesExplored; if (Plugin.StatsUIDisplay_Explored.Value < Plugin.StatsUIValueOptions.CurrentAndTotal) { AddValueLine("EXPLORED", "", modulesExplored.ToString(), valueColor7); } else { int totalModules = LevelStatsManager.totalModules; Color totalColor = colorSubtext; AddValueLine("EXPLORED", "", modulesExplored.ToString(), valueColor7, totalModules.ToString(), totalColor); } } if (ShouldDisplay(Plugin.StatsUIDisplay_Cosmetics)) { Color valueColor8 = FlashColor(flashTimer_cosmetic, GetCosmeticsAColor(), colorFlashCosmetic); int cosmeticBoxesExtracted = LevelStatsManager.cosmeticBoxesExtracted; GetCosmeticsB(out var total3, out var color3); AddValueLine("COSMETICS", "", cosmeticBoxesExtracted.ToString(), valueColor8, total3, color3); } } private Color GetExtractedAColor() { //IL_0045: 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_001a: 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) if (Plugin.StatsUIDisplay_Extracted.Value >= Plugin.StatsUIValueOptions.CurrentAndTotal) { if (LevelStatsManager.totalValueExtracted >= (float)LevelStatsManager.totalMapValue) { return colorGood; } if (LevelStatsManager.totalValueExtracted >= (float)LevelStatsManager.RemainingTotalMapValue) { return colorNeutral; } } if (LevelStatsManager.totalValueExtracted > 0f) { return colorBase; } return colorNone; } private void GetExtractedB(out string total, out Color color) { //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_008d: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (Plugin.StatsUIDisplay_Extracted.Value < Plugin.StatsUIValueOptions.CurrentAndTotal) { total = null; color = Color.white; } else if (LevelStatsManager.RemainingTotalMapValue < LevelStatsManager.totalMapValue && (Plugin.StatsUIShow_ExtractedUI.Value == Plugin.ExtractedUIDisplayType.AlwaysCurrentMapValue || (Plugin.StatsUIShow_ExtractedUI.Value == Plugin.ExtractedUIDisplayType.Alternate && Time.realtimeSinceStartup % 6f > 3f))) { total = "$" + SemiFunc.DollarGetString(LevelStatsManager.RemainingTotalMapValue); color = colorSubtextNeutral; } else { total = "$" + SemiFunc.DollarGetString(LevelStatsManager.totalMapValue); color = colorSubtext; } } private Color GetFoundAColor() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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) if (Plugin.StatsUIDisplay_Found.Value >= Plugin.StatsUIValueOptions.CurrentAndTotal) { if (LevelStatsManager.valuablesFound >= LevelStatsManager.valuablesTotal) { return colorGood; } if (LevelStatsManager.valuablesFound >= LevelStatsManager.RemainingTotalValuables) { return colorNeutral; } } if (LevelStatsManager.valuablesFound > 0) { return colorBase; } return colorNone; } private void GetFoundB(out string total, out Color color) { //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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Plugin.StatsUIDisplay_Found.Value < Plugin.StatsUIValueOptions.CurrentAndTotal) { total = null; color = Color.white; } else if (LevelStatsManager.RemainingTotalValuables < LevelStatsManager.valuablesTotal && (Plugin.StatsUIShow_FoundUI.Value == Plugin.FoundUIDisplayType.AlwaysCurrent || (Plugin.StatsUIShow_FoundUI.Value == Plugin.FoundUIDisplayType.Alternate && Time.realtimeSinceStartup % 6f > 3f))) { total = LevelStatsManager.RemainingTotalValuables.ToString(); color = colorSubtextNeutral; } else { total = LevelStatsManager.valuablesTotal.ToString(); color = colorSubtext; } } private Color GetCosmeticsAColor() { //IL_0007: 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_0046: 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_0038: Unknown result type (might be due to invalid IL or missing references) if (LevelStatsManager.cosmeticBoxesTotal == 0) { return colorNone; } if (Plugin.StatsUIDisplay_Cosmetics.Value >= Plugin.StatsUIValueOptions.CurrentAndTotal) { if (LevelStatsManager.cosmeticBoxesExtracted >= LevelStatsManager.cosmeticBoxesTotal) { return colorGood; } if (LevelStatsManager.cosmeticBoxesExtracted >= LevelStatsManager.RemainingCosmeticBoxes) { return colorNeutral; } } if (LevelStatsManager.cosmeticBoxesExtracted > 0) { return colorBase; } return colorNone; } private void GetCosmeticsB(out string total, out Color color) { //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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Plugin.StatsUIDisplay_Cosmetics.Value < Plugin.StatsUIValueOptions.CurrentAndTotal) { total = null; color = Color.white; } else if (LevelStatsManager.RemainingCosmeticBoxes < LevelStatsManager.cosmeticBoxesTotal && (Plugin.StatsUIShow_CosmeticsUI.Value == Plugin.FoundUIDisplayType.AlwaysCurrent || (Plugin.StatsUIShow_CosmeticsUI.Value == Plugin.FoundUIDisplayType.Alternate && Time.realtimeSinceStartup % 6f > 3f))) { total = LevelStatsManager.RemainingCosmeticBoxes.ToString(); color = colorSubtextNeutral; } else { total = LevelStatsManager.cosmeticBoxesTotal.ToString(); color = colorSubtext; } } } internal class RunStatsManager { public int enemyKills; public int playerDeaths; public float totalValueExtracted; public int largestSurplusValue; public int extractionPointsCompleted; public int challengesCompleted; public float totalValueBroken; public int modulesExplored; public int valuablesFound; public static RunStatsManager instance = new RunStatsManager(); public static void SaveRunStats(string fileName) { //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_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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Expected O, but got Unknown string text = Application.persistentDataPath + "/saves"; if (Directory.Exists(text)) { string text2 = text + "/" + fileName; if (Directory.Exists(text2)) { string path = text2 + "/LevelScaling.es3"; ES3Settings val = new ES3Settings((string)null, (ES3Settings)null) { encryptionType = (EncryptionType)1, encryptionPassword = SwaggiFunc.es3Password, path = path }; ES3.Save("runStats", instance, val); Plugin.loggy.LogDebug((object)("Saved to " + val.path + ".")); } } } public static void LoadRunStats(string fileName) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown string text = Application.persistentDataPath + "/saves/" + fileName + "/LevelScaling.es3"; if (!File.Exists(text)) { Reset(); return; } ES3Settings val = new ES3Settings(text, (EncryptionType)1, SwaggiFunc.es3Password, (ES3Settings)null); instance = ES3.Load("runStats", text, new RunStatsManager(), val); Plugin.loggy.LogDebug((object)("Loaded from " + val.path + ".")); } public static void Reset() { instance = new RunStatsManager(); } } }