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 System.Text.RegularExpressions; 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.Events; 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 are out, you'll be stuck in the dark.
Your vision may go dark from time to time."), 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 is much larger than usual. Watch your
surroundings, and don't stick around for too long."), 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. Taking damage will reduce your regen limit."), 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.compatibilityMode == Plugin.CompatibilityMode.None; } return false; } public static bool IsChallengeActive(ChallengeType challenge) { if (currentChallenges.Contains(challenge)) { return Plugin.compatibilityMode == 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) { if (!SemiFunc.IsMasterClientOrSingleplayer() || Plugin.compatibilityMode < Plugin.CompatibilityMode.None || (!MalfunctionManager.IsMalfunctionActive() && Helpers.GetConfig(Plugin.ChallengeChanceMultiplier) <= 0f)) { return; } Random random = new Random(initialSeed + level * 100); bool flag = Helpers.GetConfig(Plugin.ChallengeGuarantee); int num = Mathf.Max(0, level - Mathf.Max(1, LastChallengeLevel) - 1); float num2 = Mathf.Clamp((float)num * 4f, 0f, 20f); int num3 = 0; int num4 = Helpers.GetConfig(Plugin.ChallengeMaxAmount); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.QuotaDifficulty)) { num4 = Mathf.Min(4, 1 + level / 5); flag = true; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode)) { num4 = 5; } for (int i = 0; i < num4; i++) { int num5 = initialSeed + level * 100 + i + 1; Random random2 = new Random(num5); float num6 = SwaggiFunc.DetermineChallengeChance(level); float num7 = num6 + num2; if (num >= 3 && level >= 10) { num7 += 5f; if (num >= 5) { num7 += 7f; } } if (level >= 5 && LastChallengeLevel == -1) { num7 += 15f; if (level >= 7) { num7 += 20f; } } if (!MalfunctionManager.IsMalfunctionActive()) { num7 *= Helpers.GetConfig(Plugin.ChallengeChanceMultiplier); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy)) { num7 *= 3f; } float num8 = (float)random2.Next(0, 1000) / 10f; bool flag2 = SemiFunc.RunIsShop() || SemiFunc.RunIsTutorial() || SemiFunc.RunIsArena() || SemiFunc.RunIsLobby() || SemiFunc.RunIsLobbyMenu(); bool flag3 = level <= 3 || (level <= 20 && level % 5 == 0 && Helpers.GetConfig(Plugin.ChallengeDisableMoonPhase)); bool flag4 = num8 >= num7; bool flag5 = LastChallengeLevel == level - 1 && random2.Next(0, 100) >= 5; if (Plugin.DeepLog) { Helpers.DeepLog($"[ChallengeManager] seed: {num5}\n" + $"base chance = {num6:0.0}%\n" + $"consecutive bonus = {num2:0.0}%\n" + $"final chance = {num7:0.0}%\n" + "---\n" + $"passes chance = {!flag4} ({num8:0.0} < {num7:0.0}%) ({Helpers.GetConfig(Plugin.ChallengeChanceMultiplier):0.00}x)\n" + $"passes level type = {!flag2} ({RunManager.instance.levelCurrent.NarrativeName})\n" + $"passes level num = {!flag3} ({level})\n" + $"passes last level = {!flag5} ({LastChallengeLevel} == {level - 1})\n"); } if (forceChallenge != ChallengeType.None) { num3 = 1; Helpers.DeepLog("[ChallengeManager] challenge pick halted - forced challenge enabled."); break; } if (flag2 || (!flag && flag3)) { Helpers.DeepLog("[ChallengeManager] challenge pick halted - invalid level or level number."); num3 = 0; break; } if (!flag && (flag4 || flag5)) { Helpers.DeepLog("[ChallengeManager] challenge pick failed."); continue; } Helpers.DeepLog("[ChallengeManager] challenge pick success!"); num3++; num2 /= 2f; } Helpers.DeepLog($"[ChallengeManager] picked challenges: {num3}"); if (num3 <= 0) { SyncChallenges(new int[1]); return; } List list = new List(); List list2 = new List(); foreach (Challenge allChallenge in allChallenges) { if ((flag || ((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)) { list2.Add(allChallenge); } } Helpers.DeepLog($"[ChallengeManager] available challenges: {list2.Count}"); for (int j = 0; j < num3; j++) { if (list.Count >= 5) { break; } if (list2.Count == 0) { Helpers.DeepLog("no remaining available challenges, stopping early..."); break; } int num9 = 0; int num10 = 0; foreach (Challenge item in list2) { num10 += item.Weight; } int num11 = random.Next(0, num10); foreach (Challenge item2 in list2) { num9 += item2.Weight; if (num9 > num11) { list.Add((int)item2.type); list2.Remove(item2); break; } } } if (forceChallenge != ChallengeType.None) { list = new List { (int)forceChallenge }; } forceChallenge = ChallengeType.None; LastChallengeLevel = level; LastChallengeType = list[0]; SyncChallenges(list.ToArray()); } public static void SyncChallenges(int[] challenges) { //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 (GameManager.Multiplayer()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { PhotonView photonView = instance.photonView; if (photonView != null) { photonView.RPC("SyncChallengeRPC", (RpcTarget)0, new object[1] { challenges }); } } } else { LevelStatsSyncing.instance?.SyncChallengeRPC(challenges); } } public static void SetupChallenges(List challenges) { currentChallenges.Clear(); Helpers.DeepLog($"[ChallengeManager] selected challenges: {challenges.Count}"); foreach (ChallengeType challenge in challenges) { if (challenge != ChallengeType.None) { Helpers.DeepLog($" - {challenge}"); 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) }, { 1000, new Color(0.2f, 0.2f, 0.2f) }, { 500, new Color(0f, 0.33f, 0.16f) }, { 400, new Color(0f, 0.33f, 0.33f) }, { 350, new Color(0f, 0.16f, 0.33f) }, { 300, new Color(0f, 0f, 0.33f) }, { 275, new Color(0.16f, 0f, 0.33f) }, { 250, new Color(0.33f, 0f, 0.33f) }, { 225, new Color(0.33f, 0f, 0.16f) }, { 200, new Color(0.33f, 0f, 0f) }, { 175, new Color(0.33f, 0.16f, 0f) }, { 150, new Color(0.33f, 0.33f, 0f) }, { 125, new Color(0.16f, 0.33f, 0f) }, { 100, new Color(0f, 0.33f, 0f) }, { 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, bool clamp = true) { seconds = ((!clamp) ? Mathf.Max(0f, 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 bool GetConfigOrMalfunc(ConfigEntry config, bool forceLevelCheck = false) { if (!MalfunctionManager.IsMalfunctionActive(forceLevelCheck)) { return GetConfig(config); } return true; } public static T GetConfig(ConfigEntry config, bool forceLevelCheck = false) { return (T)(MalfunctionManager.IsMalfunctionActive(forceLevelCheck) ? ((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, bool bypassLevel = false) { return GetFloatFromDict(ExtractDictFromConfig(config, bypassLevel), level); } public static int GetIntFromConfig(ConfigEntry config, int level, bool bypassLevel = false) { return GetIntFromDict(ExtractDictFromConfig(config, bypassLevel), level); } public static Dictionary ExtractDictFromConfig(ConfigEntry config, bool bypassLevel = false) { if (!MalfunctionManager.IsMalfunctionActive(bypassLevel)) { 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 || outDict.ContainsKey(result)) { 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] { '/' }); } } 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.700/• Difficulty will rise linearly/• Caps at 0.990 at Level 20/• Every level has a Challenge/• +1 Challenge every 10 levels (up to +4)"), 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 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 IsMalfunctionSelected() { if (selectedMalfunction != MalfunctionType.None) { return Plugin.compatibilityMode == Plugin.CompatibilityMode.None; } return false; } public static bool IsMalfunctionSelected(MalfunctionType type) { if (selectedMalfunction == type) { return Plugin.compatibilityMode == Plugin.CompatibilityMode.None; } return false; } public static bool IsMalfunctionActive(bool bypassLevelCheck = false) { if (activeMalfunction != MalfunctionType.None && (bypassLevelCheck || SemiFunc.RunIsLevel())) { return Plugin.compatibilityMode == Plugin.CompatibilityMode.None; } return false; } public static bool IsMalfunctionActive(MalfunctionType type, bool bypassLevelCheck = false) { if (activeMalfunction == type && (SemiFunc.RunIsLevel() || bypassLevelCheck)) { return Plugin.compatibilityMode == 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) if (Plugin.compatibilityMode <= 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Plugin.compatibilityMode <= 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.compatibilityMode <= 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_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Invalid comparison between Unknown and I4 //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Invalid comparison between Unknown and I4 //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Invalid comparison between Unknown and I4 //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Invalid comparison between Unknown and I4 //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Invalid comparison between Unknown and I4 //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Invalid comparison between Unknown and I4 //IL_0177: 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_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_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_020b: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel() || !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(); } } public static IEnumerator Solitude_TimesUp() { _solitude_ShownWarning = byte.MaxValue; if ((Object)(object)Helpers.ExtractionPointCurrent == (Object)null || !SemiFunc.IsMasterClientOrSingleplayer() || _solitudeCompletedSequence || _solitudeGameOverSequence) { yield break; } 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()); } } } else { LevelStatsSyncing.instance?.Solitude_CompleteRPC(); } } else 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()); } } } else { LevelStatsSyncing.instance?.Solitude_KillSelfRPC(); } } 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.RunIsLevel()) { 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.GetConfigOrMalfunc(Plugin.Modify_HaulGoal) && Plugin.compatibilityMode > 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.GetConfigOrMalfunc(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] [HarmonyPriority(0)] private static void SetHaulTextP(ref ExtractionPoint __instance) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation) && !__instance.isShop) { ((TMP_Text)__instance.haulGoalScreen).text = "$??????"; __instance.haulBarTargetScale = 1f; __instance.SetEmojiScreen("", false); } } [HarmonyPatch("CancelExtraction")] [HarmonyPrefix] private static bool CancelExtractionP(ref ExtractionPoint __instance) { 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; __instance.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; } int num = CurrentModCount; if (Helpers.GetConfigOrMalfunc(Plugin.Modify_ModuleCount) && Plugin.compatibilityMode > Plugin.CompatibilityMode.Client) { num = SwaggiFunc.DetermineNumberOfModules(CurrentLevel, GameDirector.instance.PlayerList.Count, RunManager.instance.levelCurrent.NarrativeName); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { num = Random.Range(5, 9); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LargeMap)) { num += Mathf.Clamp(Mathf.RoundToInt((float)num * 0.5f), 4, 16); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { num = Mathf.Max(3, Mathf.CeilToInt((float)num / 2f)); } if (Plugin.DeepLog) { Helpers.DeepLog($"[ModuleCount] {num}"); } return num; } private static int GetNewExtractionCount() { if (!SemiFunc.RunIsLevel()) { return CurrentExtCount; } int num = CurrentExtCount; if (Helpers.GetConfigOrMalfunc(Plugin.Modify_ExtractionCount) && Plugin.compatibilityMode > 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", "2.0.2")] [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 = "2.0.2"; private readonly Harmony harmony = new Harmony("Swaggies.LevelScaling"); public static ManualLogSource loggy; public static bool LevelSimulationDisabled = false; public static bool Compatibility_SpawnConfig = false; public static bool MenuLibInstalled = false; public static CompatibilityMode compatibilityMode = CompatibilityMode.None; public static ConfigEntry StatsUIShow_Base; public static ConfigEntry StatsUIShow_Map; public static ConfigEntry StatsUIShow_EndOfLevel; 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 Exp_Enable; public static ConfigEntry Exp_ShowResultsScreen; public static ConfigEntry Exp_ShowMenuRank; public static ConfigEntry Exp_ShowPlayerRanks; public static ConfigEntry Exp_SyncExperience; 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 DisplayRegenCap; 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 ChallengeMaxAmount; 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 2.0.2"); GlobalStatsManager.LoadGlobalStats(); MalfunctionManager.Setup(); LevelResultsUIHelpers.TryMakeNew(); } private void CreateConfig() { CreateStatsUIConfig(); CreateExperienceConfig(); CreateMiscConfig(); CreateChallengeConfig(); CreateModuleConfig(); CreateExtractionConfig(); CreateHaulGoalConfig(); CreateTotalMapValueConfig(); CreateEnemyAmountsConfig(); CreateEnemyHealthMultiplierConfig(); } private void CreateStatsUIConfig() { //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: 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 StatsUIShow_Base = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Always show on-screen", StatsUIShowOptions.LevelAndShop, "Whether the level stats are always displayed on screen. When in a shop, the post-level results are shown. (applies when changed)"); StatsUIShow_Map = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show when map is open", StatsUIShowOptions.LevelAndShop, "Whether the level stats are displayed with the map open. If this check fails, stats will be hidden if the map is open, overriding the Always show on-screen setting. (applies when changed)"); StatsUIShow_EndOfLevel = ((BaseUnityPlugin)this).Config.Bind("Level Stats UI", "Show at end of level", true, "Whether the level stats will be forcibly shown on-screen when the truck is starting, overriding the two settings above. (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 vanilla Level Number UI from showing up completely (applies when changed)"); } private void CreateExperienceConfig() { Exp_Enable = ((BaseUnityPlugin)this).Config.Bind("Experience & Ranks", "Enable Experience & Ranks", true, "If disabled, will disable all Experience System features below, and prevent them from appearing in-game. Experience will still be accumulated while playing even if disabled. Disable this if you don't care for EXP and don't want it in your game."); Exp_ShowResultsScreen = ((BaseUnityPlugin)this).Config.Bind("Experience & Ranks", "Display Results Screen", true, "Whether to show results during the level outro animation detailing how much experience you earned. WARNING: the results screen will halt loading for other players, I recommend turning this off unless the rest of the lobby is also using the results screen. You can fast-forward the results screen by holding ESCAPE."); Exp_ShowMenuRank = ((BaseUnityPlugin)this).Config.Bind("Experience & Ranks", "Show Rank In Level Scaling Menu", true, "Whether to display your rank and rank progress in the Level Scaling menu (requires MenuLib)"); Exp_ShowPlayerRanks = ((BaseUnityPlugin)this).Config.Bind("Experience & Ranks", "Show Player Ranks In-Game", true, "Whether to display your rank and other players' ranks in the Lobby Menu, in your nametags in-game, and in the pause menu in-game."); Exp_SyncExperience = ((BaseUnityPlugin)this).Config.Bind("Experience & Ranks", "Sync Your EXP With Others", true, "Whether to send rank updates to other Level Scaling users. If disabled, they will not see your rank in-game."); } 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."); compatibilityMode = LSCompatibilityMode.Value; LSCompatibilityMode.SettingChanged += delegate { MenuPageMainPatch.TryUpdateCompatibilityMode(); }; 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)"); DisplayRegenCap = ((BaseUnityPlugin)this).Config.Bind("Misc", "Display Health Regen Cap", true, "Whether to display your health regen cap next to your max health in the Broken Map challenge. (applies when changed)"); 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Expected O, but got Unknown //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Expected O, but got Unknown //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Expected O, but got Unknown //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Expected O, but got Unknown //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: 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_0310: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Expected O, but got Unknown //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0375: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Expected O, but got Unknown //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Expected O, but got Unknown //IL_03da: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Expected O, but got Unknown //IL_040d: Unknown result type (might be due to invalid IL or missing references) //IL_0417: Expected O, but got Unknown //IL_043f: Unknown result type (might be due to invalid IL or missing references) //IL_0449: Expected O, but got Unknown //IL_0472: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Expected O, but got Unknown //IL_04a5: Unknown result type (might be due to invalid IL or missing references) //IL_04af: Expected O, but got Unknown //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04e1: Expected O, but got Unknown //IL_050a: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Expected O, but got Unknown //IL_053d: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Expected O, but got Unknown //IL_056f: Unknown result type (might be due to invalid IL or missing references) //IL_0579: Expected O, but got Unknown //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05ac: 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())); ChallengeMaxAmount = ((BaseUnityPlugin)this).Config.Bind("Challenge Levels", "Max number of challenges", 1, new ConfigDescription("Rolls the chance for a challenge multiple times, allowing for more than one challenge to appear on a level. (applies before the start of each level) (HOST ONLY)", (AcceptableValueBase)(object)new AcceptableValueRange(1, 5), 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", false, "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:4,5:6,10:8,20:15,50:20,100:25,1000:35", "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", 5, 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", false, "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,3:2,6:3,10:4,20:5,30:6,40:7,60:8,80:9,100:10,1000:15", "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", false, "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.25,2:0.35,5:0.45,10:0.55,20:0.70,50:0.75,100:0.85,1000:1.00", "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", false, "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,5:90,10:180,20:250,50:350,100:500,1000:750", "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", 5, 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", false, "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,50:4,100:5,1000:10", "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,50:5,100:7,1000:12", "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,50:5,100:6,1000:15", "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,50:100,100:200", "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", 5, 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 { 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.GetConfigOrMalfunc(Plugin.Modify_TotalMapValue) && Plugin.compatibilityMode > 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.5f; } } return num; } private static int MultiplyItemCount(int inAmount, Type type) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected I4, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) if (!Helpers.GetConfigOrMalfunc(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)); } } private static IEnumerator DeepLogValuableAmounts(ValuableDirector director) { yield return (object)new WaitUntil((Func)(() => director.setupComplete)); Helpers.DeepLog("[ValuableDirector] SetupHost Postfix ------------"); DeepLogValuableAmounts(); } [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() { 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 const string Level = ""; } 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 { 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, withoutRandomness)) { 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, withoutRandomness)) { return (int)Mathf.Lerp(16f, 32f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode, withoutRandomness)) { return 32; } if (withoutRandomness && (!Helpers.GetConfigOrMalfunc(Plugin.Modify_ModuleCount, withoutRandomness) || Plugin.compatibilityMode == 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, withoutRandomness); 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, withoutRandomness)) { 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, withoutRandomness)) { num6 *= 0.8f; } int num7 = Mathf.RoundToInt((float)(intFromConfig + num2 + num5) * num6); if (num7 < 2) { Plugin.loggy.LogWarning((object)$"Module count of {num7} is less than 2, it will be clamped."); num7 = 2; } if (num7 > 50) { Plugin.loggy.LogWarning((object)$"Module count of {num7} is larger than 50, it will be clamped."); num7 = 50; } 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, withoutRandomness)) { 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, withoutRandomness)) { return (int)Mathf.Lerp(4f, 11f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode, withoutRandomness)) { return 11; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction, withoutRandomness)) { return 0; } if (withoutRandomness && (!Helpers.GetConfigOrMalfunc(Plugin.Modify_ExtractionCount, withoutRandomness) || Plugin.compatibilityMode == 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, withoutRandomness); 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, withoutRandomness)) { 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, withoutRandomness)) { return Mathf.Lerp(0.7f, 0.99f, Mathf.InverseLerp(1f, 20f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy, withoutRandomness)) { return Mathf.Lerp(0.67f, 0.95f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode, withoutRandomness)) { return 0.99f; } if (withoutRandomness && (!Helpers.GetConfigOrMalfunc(Plugin.Modify_HaulGoal, withoutRandomness) || Plugin.compatibilityMode == 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, withoutRandomness); 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, withoutRandomness)) { return (int)Mathf.Lerp(200f, 550f, Mathf.InverseLerp(1f, 100f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode, withoutRandomness)) { return 550f; } if (withoutRandomness && (!Helpers.GetConfigOrMalfunc(Plugin.Modify_TotalMapValue, withoutRandomness) || Plugin.compatibilityMode == 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, withoutRandomness); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.LowMapValue, withoutRandomness)) { 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, withoutRandomness)) { return (float)num4 / 1000f; } return num4; } public static int DetermineEnemiesOfTier(int level, int tier, int originalAmount = -1, bool withoutRandomness = false) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10, withoutRandomness)) { return MalfunctionManager.Formidable_EnemiesThisLevel(level); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy, withoutRandomness)) { return (int)Mathf.Lerp(1f, 10f, Mathf.InverseLerp(1f, 50f, (float)level)); } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxMode, withoutRandomness)) { return 10; } if (!Helpers.GetConfigOrMalfunc(Plugin.Modify_Enemies, withoutRandomness) || Plugin.compatibilityMode == 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, withoutRandomness); if (num2 < 0) { Plugin.loggy.LogWarning((object)$"Enemy number of {num2} is less than 0, it will be clamped."); num2 = 0; } if (num2 > 30) { Plugin.loggy.LogWarning((object)$"Enemy number of {num2} is larger than 30, it will be clamped."); num2 = 30; } Helpers.DeepLog($"[DetermineT{tier}Enemies] {num2}"); return num2; } public static int DetermineT1Enemies(int level, int originalAmount = -1, bool withoutRandomness = false) { return DetermineEnemiesOfTier(level, 1, originalAmount, withoutRandomness); } public static int DetermineT2Enemies(int level, int originalAmount = -1, bool withoutRandomness = false) { return DetermineEnemiesOfTier(level, 2, originalAmount, withoutRandomness); } public static int DetermineT3Enemies(int level, int originalAmount = -1, bool withoutRandomness = false) { return DetermineEnemiesOfTier(level, 3, originalAmount, withoutRandomness); } public static int DetermineEnemyHealthPercentage(int level, int playerCount, bool withoutRandomness = false) { if (!Helpers.GetConfigOrMalfunc(Plugin.Modify_EnemyHealth, withoutRandomness) || Plugin.compatibilityMode == Plugin.CompatibilityMode.Client) { return 100; } float num = Helpers.GetFloatFromConfig(Plugin.EnemyHealthDict, level, withoutRandomness); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10, withoutRandomness)) { num *= 0.5f; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers, withoutRandomness)) { num += Mathf.Clamp(Mathf.Floor((float)level / 5f) * 10f, 0f, 100f); } int num2 = 0; if (playerCount > 1) { for (int i = 1; i < Mathf.Min(playerCount, Helpers.GetConfig(Plugin.EnemyHealth_PerPlayerMax)); i++) { num2 += Helpers.GetConfig(Plugin.EnemyHealth_PerPlayer); } } int num3 = Mathf.RoundToInt(num / 5f) * 5; if (num3 < 50) { Plugin.loggy.LogWarning((object)$"Enemy health percentage of {num3}% is less than 50%, it will be clamped."); num3 = 50; } if (num3 > 1000) { Plugin.loggy.LogWarning((object)$"Enemy health percentage of {num3}% is larger than 1000%, it will be clamped."); num3 = 1000; } if (Plugin.DeepLog) { Helpers.DeepLog("[DetermineEnemyHealthPercentage]\n" + $"base amount = {num:0.0}\n" + $"player bonus = {num2} ({Helpers.GetConfig(Plugin.EnemyHealth_PerPlayer)}/pl)\n" + $"final = {num3}"); } return num3; } 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); if (includeChanceModifiers) { float num2 = (MalfunctionManager.IsMalfunctionActive(includeChanceModifiers) ? 1f : Helpers.GetConfig(Plugin.ChallengeChanceMultiplier, includeChanceModifiers)); if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.MaxModeEasy, bypassLevelCheck: true)) { num2 *= 3f; } num = Mathf.Clamp(num * num2, 0f, 100f); if (levelNumber <= 3 || num2 == 0f) { num = 0f; } if (levelNumber % 5 == 0 && levelNumber <= 20 && Helpers.GetConfig(Plugin.ChallengeDisableMoonPhase, forceLevelCheck: true)) { num = 0f; } if (Helpers.GetConfig(Plugin.ChallengeGuarantee, forceLevelCheck: true) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.QuotaDifficulty, bypassLevelCheck: true)) { num = 100f; } if (Plugin.compatibilityMode < Plugin.CompatibilityMode.None) { num = 0f; } } return num; } public static void SharedDurability_DamageAllPlayers(float valueLost, List targets) { //IL_016e: Unknown result type (might be due to invalid IL or missing references) if (Plugin.compatibilityMode < Plugin.CompatibilityMode.None || Helpers.AllExtractionPointsCompleted) { 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); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FragileValuables)) { num = Mathf.CeilToInt((float)num * 0.6f); } list.RemoveAll((PlayerAvatar m) => m.isDisabled); 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 (!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 (!player.isDisabled) { 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) if (Object.op_Implicit((Object)(object)BigMessageUI.instance)) { if (_bigMessageCoroutine != null) { ((MonoBehaviour)BigMessageUI.instance).StopCoroutine(_bigMessageCoroutine); } _bigMessageCoroutine = ((MonoBehaviour)BigMessageUI.instance).StartCoroutine(BigMessage()); } IEnumerator BigMessage() { while (time > 0f) { time -= Time.deltaTime; BigMessageUI.instance.BigMessage(message, emoji, size, main, flash); yield return null; } } } public static void Soulstealers_SpawnExplosion(Vector3 breakPosition, float itemMass) { //IL_0117: 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); } } } } 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 2.0.2)"; } } } } [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_0072: 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 (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)) { 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)) { 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 (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 (player.isDisabled) { 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.5f); } 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.compatibilityMode >= Plugin.CompatibilityMode.None) { 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] [HarmonyPriority(0)] private static void UpdateP(ref EnergyUI __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)__instance.Text) && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { ((TMP_Text)__instance.textEnergyMax).transform.localPosition = __instance.maxEnergyBasePosition; ((TMP_Text)__instance.Text).text = "??"; } } } [HarmonyPatch(typeof(EnvironmentDirector))] internal class EnvironmentDirectorPatch { private enum BlindState { Wait, BlindIn, BlindHold, BlindOut } private static float fogMultiplier = 1f; private static float fogOscillationMultiplier = 1f; private static float fogBlindMultiplier = 1f; private static float fogBlindTimer = 15f; private static BlindState fogBlindState = BlindState.Wait; private static float originalFogStartDistance = 0f; private static float originalFogEndDistance = 0f; private static float FogMultiplier { get { if (!Object.op_Implicit((Object)(object)PlayerAvatar.instance) || PlayerAvatar.instance.isDisabled) { return 1f; } if (!SemiFunc.RunIsLevel()) { return 1f; } return fogMultiplier * fogOscillationMultiplier * fogBlindMultiplier; } } [HarmonyPatch("Setup")] [HarmonyPostfix] private static void SetupP() { if (Plugin.compatibilityMode >= Plugin.CompatibilityMode.None && SemiFunc.RunIsLevel()) { originalFogEndDistance = RenderSettings.fogEndDistance; originalFogStartDistance = RenderSettings.fogStartDistance; fogMultiplier = 1f; fogOscillationMultiplier = 1f; fogBlindMultiplier = 1f; fogBlindTimer = 15f; fogBlindState = BlindState.Wait; if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut)) { fogMultiplier = 0.8f; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { fogOscillationMultiplier = 0.3f; fogMultiplier = 1f; } } } [HarmonyPatch("Update")] [HarmonyPostfix] private static void UpdateP(ref EnvironmentDirector __instance) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Invalid comparison between Unknown and I4 if (Plugin.compatibilityMode < Plugin.CompatibilityMode.None) { return; } GameDirector instance = GameDirector.instance; if ((instance == null || (int)instance.currentState != 3) && SemiFunc.RunIsLevel() && LevelGenerator.Instance.Generated && __instance.SetupDone && Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { bool flag = false; if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { fogOscillationMultiplier = 0.3f + (1f + Mathf.Sin(LevelStatsManager.thisLevelTime / -15f)) * 0.15f; flag = true; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut)) { fogBlindTimer -= Time.deltaTime; BlindStateMachine(); flag = true; } if (flag) { SetValues(__instance.MainCamera); } } } private static void BlindStateMachine() { switch (fogBlindState) { case BlindState.Wait: fogBlindMultiplier = 1f; if (fogBlindTimer <= 0f) { fogBlindState = BlindState.BlindIn; fogBlindTimer = 0.7f; } break; case BlindState.BlindIn: fogBlindMultiplier = Mathf.Lerp(0.15f, 0.99f, Mathf.InverseLerp(0f, 0.7f, fogBlindTimer)); if (fogBlindTimer <= 0f) { fogBlindState = BlindState.BlindHold; fogBlindTimer = Random.Range(2f, 6f); if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { fogBlindMultiplier /= 2f; } if ((Object)(object)PlayerAvatar.instance?.playerHealth != (Object)null && !PlayerAvatar.instance.isDisabled) { PlayerAvatar.instance.playerHealth.EyeMaterialOverride((EyeOverrideState)5, fogBlindTimer + 1f, 999); } } break; case BlindState.BlindHold: fogBlindMultiplier = Mathf.MoveTowards(fogBlindMultiplier, 0.01f, Time.deltaTime * 0.02f); if (fogBlindTimer <= 0f) { fogBlindState = BlindState.BlindOut; fogBlindTimer = 3f; } break; case BlindState.BlindOut: fogBlindMultiplier = Mathf.MoveTowards(fogBlindMultiplier, 1f, Time.deltaTime / 3f); if (fogBlindTimer <= 0f) { fogBlindState = BlindState.Wait; fogBlindTimer = Random.Range(15f, 45f); } break; } } private static void SetValues(Camera mainCamera) { RenderSettings.fogStartDistance = originalFogStartDistance * FogMultiplier; RenderSettings.fogEndDistance = Mathf.Max(2f, originalFogEndDistance * FogMultiplier); mainCamera.farClipPlane = RenderSettings.fogEndDistance + 0.33f; } } [HarmonyPatch(typeof(GameDirector))] internal class GameDirectorPatch { 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 GameDirector __instance) { if ((Plugin.compatibilityMode < Plugin.CompatibilityMode.None) | (__instance.gameStateTimer > 0f)) { return; } ExperienceManager.SyncExperience(); if (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; LevelStatsManager.challengesJustCompleted = ChallengeManager.currentChallenges.Count; if (Plugin.ChallengeTutorials.Value) { ((MonoBehaviour)GameDirector.instance).StartCoroutine(DisplayAllChallenges()); } } } private static IEnumerator DisplayAllChallenges() { float displayTimePerChallenge = 5f; switch (ChallengeManager.currentChallenges.Count) { case 1: displayTimePerChallenge = 12f; break; case 2: displayTimePerChallenge = 9f; break; case 3: displayTimePerChallenge = 7f; break; case 4: displayTimePerChallenge = 6f; break; } yield return (object)new WaitForSeconds(1f); foreach (ChallengeManager.ChallengeType challenge in ChallengeManager.currentChallenges) { yield return (object)new WaitForSeconds(0.5f); ChallengeManager.Challenge challenge2 = ChallengeManager.GetChallenge(challenge); string name = challenge2.name; string info = challenge2.info; TutorialDirector.instance.delayBeforeTip = 0f; TutorialDirector.instance.showTipTimer = displayTimePerChallenge; TutorialDirector.instance.showTipTime = displayTimePerChallenge; LevelStatsUI.instance.hideTime = displayTimePerChallenge + 0.67f; TutorialUI.instance.SetTipPage(Clip, "" + name + ": " + info + "
", false); yield return (object)new WaitForSeconds(displayTimePerChallenge); } } } [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) { if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { if ((Helpers.CurrentLevel == 1 && LevelStatsManager.thisLevelTime < 120f && MalfunctionManager.SolitudeTimeRemainingSeconds > 120f) || !LevelStatsManager.firstExtractionOpenedThisLevel) { ((TMP_Text)__instance.Text).text = ""; ((SemiUI)__instance).Hide(); } else if (Helpers.AllExtractionPointsCompleted) { ((TMP_Text)__instance.Text).spriteAsset = SpriteAsset; ((TMP_Text)__instance.Text).text = " COMPLETE"; ((SemiUI)__instance).Hide(); } else { int num = Mathf.CeilToInt(MalfunctionManager.SolitudeTimeRemainingSeconds); int num2 = Mathf.FloorToInt((float)(num / 60)); ((TMP_Text)__instance.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] [HarmonyPriority(300)] private static void UpdateP(ref HaulUI __instance) { //IL_00d0: 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) if (!SemiFunc.RunIsLevel() || !MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction)) { return; } ((TMP_Text)__instance.Text).spriteAsset = GoalUIPatch.SpriteAsset; ExtractionPoint extractionPointCurrent = Helpers.ExtractionPointCurrent; if ((Object)(object)extractionPointCurrent == (Object)null) { return; } int haulGoal = extractionPointCurrent.haulGoal; if (haulGoal != 0) { float num = ((__instance.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 oldValue = "" + SemiFunc.DollarGetString(Helpers.ExtractionHaulGoal); string newValue = (Solitude_GoalSwitch ? ("" + SemiFunc.DollarGetString(haulGoal) + " " + text) : (SemiFunc.DollarGetString(MalfunctionManager.SolitudeRequiredQuota) + " " + text)); ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace(oldValue, newValue); } } [HarmonyPatch("Update")] [HarmonyPostfix] [HarmonyPriority(0)] private static void UpdateP2(ref HaulUI __instance) { if (SemiFunc.RunIsLevel() && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { string text = "$"; string oldValue = text + SemiFunc.DollarGetString(Mathf.Max(0, __instance.currentHaulValue)); ((TMP_Text)__instance.Text).text = ((TMP_Text)__instance.Text).text.Replace(oldValue, text + "??????"); } } } [HarmonyPatch(typeof(HealthUI))] internal class HealthUIPatch { [HarmonyPatch("Update")] [HarmonyPostfix] [HarmonyPriority(0)] private static void UpdateP(ref HealthUI __instance) { if (Object.op_Implicit((Object)(object)__instance.Text) && Plugin.compatibilityMode >= Plugin.CompatibilityMode.None) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.HiddenInformation)) { ((TMP_Text)__instance.Text).text = "???"; } if (Plugin.DisplayRegenCap.Value && PlayerHealthPatch.healthRegenCap != -1 && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { TextMeshProUGUI textMaxHealth = __instance.textMaxHealth; ((TMP_Text)textMaxHealth).text = ((TMP_Text)textMaxHealth).text + $" ({PlayerHealthPatch.healthRegenCap})"; } } } } [HarmonyPatch(typeof(ItemReviveItem))] internal class ItemReviveItemPatch { private static PlayerAvatar target; [HarmonyPatch("ReviveAndDestroy")] [HarmonyPrefix] private static void ReviveAndDestroy(ref ItemReviveItem __instance) { if ((MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) && SemiFunc.IsMasterClientOrSingleplayer() && __instance.hasTarget) { target = __instance.playerTarget; } } [HarmonyPatch("ReviveAndDestroy")] [HarmonyPostfix] private static void ReviveAndDestroyP() { if ((MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.SingleExtraction) || MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.Soulstealers)) && SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)target == (Object)null)) { target.playerHealth.HealOther(target.playerHealth.maxHealth - target.playerHealth.health, true); target = null; } } } [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) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LightsOut) && (int)GameDirector.instance.currentState == 2 && Object.op_Implicit((Object)(object)PlayerAvatar.instance) && !__instance.turnOffLights) { ((MonoBehaviour)__instance).StopAllCoroutines(); __instance.turningOffLights = true; ((MonoBehaviour)__instance).StartCoroutine(__instance.TurnOffLights()); __instance.turningOffEmissions = true; ((MonoBehaviour)__instance).StartCoroutine(__instance.TurnOffEmissions()); __instance.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 = ""; if (ChallengeManager.currentChallenges.Count <= 2) { 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(); } else { text = $"{ChallengeManager.currentChallenges.Count} CHALLENGES"; } ((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 MapToolController __instance) { if (!GameManager.Multiplayer() || __instance.photonView.IsMine) { mapToolActive = __instance.Active; } } [HarmonyPatch(typeof(DirtFinderMapPlayer), "Awake")] [HarmonyPostfix] private static void AwakeP(ref DirtFinderMapPlayer __instance) { mapPlayerInstance = __instance; } private static void SpoofPosition() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { ((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(MenuPageEsc))] internal class MenuPageEscPatch { [HarmonyPatch("Update")] [HarmonyPostfix] [HarmonyPriority(0)] private static void Update(ref MenuPageEsc __instance) { if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowPlayerRanks.Value) { LevelStatsSyncing.instance?.UpdateRanksInPauseMenu(__instance); } } } [HarmonyPatch(typeof(MenuPageLobby))] internal class MenuPageLobbyPatch { [HarmonyPatch("PlayerAdd")] [HarmonyPostfix] private static void PlayerAddP() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (Plugin.compatibilityMode < Plugin.CompatibilityMode.None) { return; } if (SemiFunc.IsMasterClient()) { if (SemiFunc.IsMultiplayer()) { LevelStatsSyncing instance = LevelStatsSyncing.instance; if (instance != null) { instance.photonView.RPC("SyncMalfunctionRPC", (RpcTarget)0, new object[1] { (int)MalfunctionManager.activeMalfunction }); } } else { LevelStatsSyncing.instance?.SyncMalfunctionRPC((int)MalfunctionManager.activeMalfunction); } } ExperienceManager.SyncExperience(); } [HarmonyPatch("Update")] [HarmonyPostfix] [HarmonyPriority(0)] private static void Update(ref MenuPageLobby __instance) { if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowPlayerRanks.Value) { LevelStatsSyncing.instance?.UpdateRanksInLobby(__instance); } } } [HarmonyPatch(typeof(MenuPageMain))] internal class MenuPageMainPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref MenuPageMain __instance) { ((MonoBehaviour)__instance).StartCoroutine(ChangeCompatibilityMode()); try { MenusManager.Start(__instance); } catch (Exception ex) { Plugin.loggy.LogError((object)("Unable to start MenusManager.\n" + ex.Message)); } } private static IEnumerator ChangeCompatibilityMode() { Helpers.DeepLog("changing compatibility mode in 1.5 seconds..."); yield return (object)new WaitForSeconds(1.5f); TryUpdateCompatibilityMode(); } public static void TryUpdateCompatibilityMode() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMainMenu() && Plugin.LSCompatibilityMode.Value != Plugin.compatibilityMode) { Plugin.compatibilityMode = Plugin.LSCompatibilityMode.Value; SwaggiFunc.DisplayBigMessage($"{Plugin.compatibilityMode}\nCOMPATIBILITY MODE", "{!}", 4f, new Color(0.5f, 0f, 1f), Color.red); } } } [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 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 != MalfunctionManager.MalfunctionType.None) { ((Component)MenuPageSavesPatch.malfunction).gameObject.SetActive(true); ((TMP_Text)MenuPageSavesPatch.malfunction).text = "MALFUNCTION: " + malfunction.name + ""; } } else { MalfunctionManager.Malfunction malfunction2 = MalfunctionManager.GetMalfunction((MalfunctionManager.MalfunctionType)ES3.Load("malfunction", text, 0, val)); if (malfunction2.type != MalfunctionManager.MalfunctionType.None) { ((Component)MenuPageSavesPatch.malfunction).gameObject.SetActive(true); ((TMP_Text)MenuPageSavesPatch.malfunction).text = "MALFUNCTION: " + malfunction2.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) { if (!__instance.isLocal || Plugin.compatibilityMode <= Plugin.CompatibilityMode.Host || __instance.physGrabBeamOverChargeTimer > 0f || __instance.physGrabBeamOverChargeFloat <= 0f) { return; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.OverOvercharge)) { if (__instance.physGrabBeamOverchargeDecreaseCooldown > 0f) { PhysGrabber obj = __instance; obj.physGrabBeamOverchargeDecreaseCooldown += Time.deltaTime * 0.1f; } PhysGrabber obj2 = __instance; obj2.physGrabBeamOverChargeFloat -= 0.03f * Time.deltaTime; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.EnemyRush)) { if (__instance.physGrabBeamOverchargeDecreaseCooldown > 0f) { PhysGrabber obj3 = __instance; obj3.physGrabBeamOverchargeDecreaseCooldown += Time.deltaTime * 0.5f; PhysGrabber obj4 = __instance; obj4.physGrabBeamOverChargeFloat -= 0.06f * Time.deltaTime; } else { PhysGrabber obj5 = __instance; obj5.physGrabBeamOverChargeFloat -= 0.083f * Time.deltaTime; } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal class PhysGrabObjectImpactDetectorPatch { [HarmonyPatch("Start")] [HarmonyPostfix] private static void StartP(ref PhysGrabObjectImpactDetector __instance) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FragileValuables) && Object.op_Implicit((Object)(object)__instance.valuableObject) && !Object.op_Implicit((Object)(object)((Component)__instance.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) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.SharedDurability) || !__instance.isValuable || Helpers.AllExtractionPointsCompleted) { return; } valueLost = Mathf.Max(0f, valueLost * 0.28f); if ((!_forceBreak && (__instance.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_00b1: 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) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.OverOvercharge) && __instance.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("PlayerDeathRPC")] [HarmonyPostfix] private static void DeathP(ref PlayerAvatar __instance, 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 (__instance.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("OutroDone")] [HarmonyPostfix] private static void FinishResultScreen(ref PlayerAvatar __instance) { if (__instance.isLocal && Object.op_Implicit((Object)(object)LevelResultsUIHelpers.instance)) { LevelResultsUIHelpers.instance.FinishExpLoop(); } } } [HarmonyPatch(typeof(PlayerController))] internal class PlayerControllerPatch { private static float _walkspeedAddition; private static float _stamregenAddition; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref PlayerController __instance) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.LargeMap)) { PlayerController obj = __instance; obj.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)) { PlayerController instance = PlayerController.instance; instance.MoveSpeed -= _walkspeedAddition; PlayerController instance2 = PlayerController.instance; instance2.sprintRechargeAmount -= _stamregenAddition; _walkspeedAddition += PlayerController.instance.MoveSpeed * 0.02f; _stamregenAddition += PlayerController.instance.sprintRechargeAmount * 0.02f; PlayerController instance3 = PlayerController.instance; instance3.MoveSpeed += _walkspeedAddition; PlayerController instance4 = PlayerController.instance; instance4.sprintRechargeAmount += _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 healthRegenTimer = 0f; private static float damageHealCooldown = 0f; private static float dotCooldown = 0f; public static int healthRegenCap = -1; [HarmonyPatch("Awake")] [HarmonyPostfix] private static void AwakeP(ref PlayerHealth __instance) { if (!SemiFunc.RunIsLobbyMenu() && Plugin.compatibilityMode >= Plugin.CompatibilityMode.None && !((Object)(object)__instance.playerAvatar != (Object)(object)PlayerAvatar.instance) && !__instance.isMenuAvatar) { healthRegenTimer = 10f; damageHealCooldown = 5f; dotCooldown = 10f; healthRegenCap = -1; } } [HarmonyPatch("Hurt")] [HarmonyPrefix] private static void HurtP(ref PlayerHealth __instance, ref int damage, ref bool hurtByHeal) { if (hurtByHeal) { if (damage > 0 && (!GameManager.Multiplayer() || __instance.photonView.IsMine)) { GlobalStatsManager.AddPlayerDamageTaken(damage); ChangeRegenCap(-damage); } return; } float num = 1f; if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.FoggyLevel)) { num *= 0.8f; } if (MalfunctionManager.IsMalfunctionActive(MalfunctionManager.MalfunctionType.E10_10_10)) { num *= 0.5f; } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage)) { num *= 2f; } damage = Mathf.CeilToInt((float)damage * num); if (damage > 0 && (!GameManager.Multiplayer() || __instance.photonView.IsMine)) { damageHealCooldown = 12f; GlobalStatsManager.AddPlayerDamageTaken(damage); ChangeRegenCap(-Mathf.Max(1, (int)((float)damage * 0.35f))); } } [HarmonyPatch("Heal")] [HarmonyPrefix] private static void HealP(ref PlayerHealth __instance, ref int healAmount) { if (healAmount > 0 && (!GameManager.Multiplayer() || __instance.photonView.IsMine)) { GlobalStatsManager.AddPlayerHealthHealed(healAmount); ChangeRegenCap(healAmount); } } [HarmonyPatch("Update")] [HarmonyPrefix] private static void UpdateP(ref PlayerHealth __instance) { if ((Object)(object)__instance.playerAvatar != (Object)(object)PlayerAvatar.instance || Plugin.compatibilityMode < Plugin.CompatibilityMode.None || PlayerAvatar.instance.isDisabled) { return; } damageHealCooldown = Mathf.Max(0f, damageHealCooldown - Time.deltaTime); healthRegenTimer = Mathf.Max(0f, healthRegenTimer - Time.deltaTime); dotCooldown = Mathf.Max(0f, dotCooldown - Time.deltaTime); if (LevelStatsManager.firstExtractionOpenedThisLevel) { if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { SetRegenCapIfUnset(); BrokenMap_Update(); } if (ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.DangerZone) && !Helpers.TruckLeaving) { DangerZone_Update(); } } } private static void SetRegenCapIfUnset() { if (healthRegenCap == -1 && ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.NoMap)) { healthRegenCap = PlayerAvatar.instance.playerHealth.maxHealth; } } private static void BrokenMap_Update() { PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth; if (damageHealCooldown > 0f || healthRegenTimer > 0f || playerHealth.health >= healthRegenCap) { return; } SilentHeal(playerHealth, 1); healthRegenTimer = 2.5f; if (GameDirector.instance.PlayerList.Count < 2) { return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!player.isDisabled) { healthRegenTimer += 0.5f; } } } private static void DangerZone_Update() { PlayerHealth playerHealth = PlayerAvatar.instance.playerHealth; if (playerHealth.health <= 1) { dotCooldown = 5f; } else { if (dotCooldown > 0f) { return; } bool flag = false; foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if (item.Spawned) { flag = true; break; } } if (!flag) { dotCooldown = 7.5f; return; } float num = LevelStatsManager.thisLevelTime / 60f; float num2 = Mathf.Clamp(4f - num * 0.1f, 1f, 4f); if (playerHealth.health > 1) { SilentHeal(playerHealth, ChallengeManager.IsChallengeActive(ChallengeManager.ChallengeType.IncreasedDamage) ? (-2) : (-1)); if (playerHealth.health < 10) { CameraGlitch.Instance.PlayShortHurt(true); num2 *= 2f; } } dotCooldown = num2; } } private static void ChangeRegenCap(int amount) { if (healthRegenCap != -1) { healthRegenCap = Mathf.Clamp(healthRegenCap + amount, 10, PlayerAvatar.instance.playerHealth.maxHealth); } } private static void SilentHeal(PlayerHealth health, int amount) { health.health = Mathf.Clamp(health.health + amount, 0, health.maxHealth); StatsManager.instance.SetPlayerHealth(SemiFunc.PlayerGetSteamID(health.playerAvatar), health.health, false); if (GameManager.Multiplayer()) { health.photonView.RPC("UpdateHealthRPC", (RpcTarget)1, new object[4] { health.health, health.maxHealth, false, false }); } } } [HarmonyPatch(typeof(ResultScreenUI))] internal class ResultScreenUIPatch { [HarmonyPatch("Awake")] [HarmonyPostfix] private static void Awake(ref ResultScreenUI __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowResultsScreen.Value) { GameObject val = new GameObject("Level Scaling Results UI"); Transform child = ((Component)__instance).transform.GetChild(0).GetChild(0); val.transform.SetParent(child, false); val.AddComponent(); } } [HarmonyPatch("StateCloseDoor")] [HarmonyPostfix] private static void StateCloseDoor(ref ResultScreenUI __instance) { if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowResultsScreen.Value && !(__instance.stateTimer > 0f) && Object.op_Implicit((Object)(object)LevelResultsUI.instance)) { LevelResultsUI.instance.SetRunning(RunManager.instance.cosmeticWorldObjectCooldown > 0f); __instance.StateUpdate((State)2); } } [HarmonyPatch("StateMiddleFade")] [HarmonyPrefix] private static bool StateMiddleFade(ref ResultScreenUI __instance) { if (!Plugin.Exp_Enable.Value || !Plugin.Exp_ShowResultsScreen.Value) { return true; } if (!Object.op_Implicit((Object)(object)LevelResultsUI.instance)) { return true; } if (!LevelResultsUI.instance.isRunning) { return true; } if (__instance.stateImpulse) { __instance.animator.SetTrigger(__instance.animatorMiddleFade); __instance.animator.SetTrigger(__instance.animatorSkipActive); __instance.stateTimer = 1f; __instance.stateImpulse = false; } return false; } [HarmonyPatch("FinishResultScreen")] [HarmonyPostfix] private static void FinishResultScreen(ref ResultScreenUI __instance) { if (Object.op_Implicit((Object)(object)LevelResultsUIHelpers.instance)) { LevelResultsUIHelpers.instance.FinishExpLoop(); } } } [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"; public static bool levelWasCompleted = false; [HarmonyPatch("ChangeLevel")] [HarmonyPostfix] private static void ChangeLevel_Postfix(ref RunManager __instance, ref bool _completedLevel) { levelWasCompleted = false; if ((WasLevel() & _completedLevel) && SemiFunc.RunIsShop()) { OnLevelComplete(__instance.levelsCompleted + 1, _previousLevelName); levelWasCompleted = true; } _previousLevelName = __instance.levelCurrent.NarrativeName; LevelStatsManager.OnNewLevel(!levelWasCompleted); if (Plugin.compatibilityMode < Plugin.CompatibilityMode.None) { ChallengeManager.currentChallenges.Clear(); return; } SwaggiFunc.SharedDurability_overheal = 0f; MalfunctionManager.SyncMalfunction(); if (!SemiFunc.IsMultiplayer() && !SemiFunc.RunIsLevel()) { ChallengeManager.SetupChallenges(new List()); } 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) { levelWasCompleted = false; if (WasLevel()) { foreach (Level item in __instance.levelShop) { if (_levelsCompleted == _lastLevelsCompleted + 1 && _levelName == ((Object)item).name) { OnLevelComplete(_levelsCompleted + 1, _previousLevelName); levelWasCompleted = true; break; } } } LevelStatsManager.OnNewLevel(!levelWasCompleted); _lastLevelsCompleted = _levelsCompleted; _previousLevelName = __instance.levelCurrent.NarrativeName; } private static bool WasLevel() { Level levelPrevious = RunManager.instance.levelPrevious; if (!SemiFunc.IsLevelShop(levelPrevious) && !SemiFunc.IsLevelArena(levelPrevious) && !SemiFunc.IsCurrentLevel(levelPrevious, RunManager.instance.levelLobby) && !SemiFunc.IsCurrentLevel(levelPrevious, RunManager.instance.levelLobbyMenu) && !SemiFunc.IsCurrentLevel(levelPrevious, RunManager.instance.levelMainMenu) && !SemiFunc.IsCurrentLevel(levelPrevious, RunManager.instance.levelSplashScreen)) { return !SemiFunc.IsCurrentLevel(levelPrevious, RunManager.instance.levelTutorial); } return false; } 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 _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_00a3: 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_012e: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) 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 { private static bool backwardCompatibility; [HarmonyPatch("SaveFileCreate")] [HarmonyPrefix] private static void SaveFileCreateP() { if (SemiFunc.IsMasterClientOrSingleplayer()) { ChallengeManager.CurrentSeed = Random.Range(0, 100000000); ChallengeManager.LastChallengeLevel = -1; } } [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 StatsManager __instance, ref string fileName) { if (string.IsNullOrEmpty(fileName) || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } backwardCompatibility = false; if (__instance.dictionaryOfDictionaries.TryGetValue("LSchallengeSeed", out var value)) { if (value.ContainsKey("currentSeed")) { ChallengeManager.CurrentSeed = value["currentSeed"]; } if (value.ContainsKey("lastChallengeLevel")) { ChallengeManager.LastChallengeLevel = value["lastChallengeLevel"]; } backwardCompatibility = true; __instance.dictionaryOfDictionaries.Remove("LSchallengeSeed"); } if (__instance.dictionaryOfDictionaries.TryGetValue("LSmalfunctionConfig", out var value2)) { if (value2.ContainsKey("malfunction")) { MalfunctionManager.SetMalfunction((MalfunctionManager.MalfunctionType)value2["malfunction"]); backwardCompatibility = true; } __instance.dictionaryOfDictionaries.Remove("LSmalfunctionConfig"); } RunStatsManager.LoadRunStats(fileName, backwardCompatibility); backwardCompatibility = false; } } [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 = (Type)0, bool enemyOrb = false) { //IL_000e: 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_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_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0021: Unknown result type (might be due to invalid IL or missing references) bool num = (Object)(object)((Component)__instance).GetComponent() != (Object)null; if (!num && Plugin.compatibilityMode >= Plugin.CompatibilityMode.None) { 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); } } } [HarmonyPatch(typeof(WorldSpaceUIPlayerName))] internal class WorldSpaceUIPlayerNamePatch { [HarmonyPatch("Update")] [HarmonyPostfix] [HarmonyPriority(0)] private static void Update(ref WorldSpaceUIPlayerName __instance) { if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowPlayerRanks.Value) { LevelStatsSyncing.instance?.UpdateRanksInGame(__instance); } } } } 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; public static ScrollViewBuilderDelegate <>9__0_38; public static ScrollViewBuilderDelegate <>9__0_39; public static ScrollViewBuilderDelegate <>9__0_40; 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_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("- Birdy", sv, default(Vector2)))).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)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- toast", 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("- hankjwimbleton", 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("- Daan13000", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_33(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_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)MenuAPI.CreateREPOLabel("Special Thanks", 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("- nickklmao for MenuLib", 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("- melonwater", 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("- Axel & all of semiwork for R.E.P.O.", sv, default(Vector2)))).rectTransform; } internal RectTransform b__0_38(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_39(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_40(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 //IL_0739: Unknown result type (might be due to invalid IL or missing references) //IL_073e: Unknown result type (might be due to invalid IL or missing references) //IL_0744: Expected O, but got Unknown //IL_0768: Unknown result type (might be due to invalid IL or missing references) //IL_076d: Unknown result type (might be due to invalid IL or missing references) //IL_0773: Expected O, but got Unknown //IL_0797: Unknown result type (might be due to invalid IL or missing references) //IL_079c: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: 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 val42 = default(Vector2); ((Vector2)(ref val42))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val42)).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 val42 = default(Vector2); ((Vector2)(ref val42))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val42)).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 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Birdy", sv, default(Vector2)))).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)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- toast", 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("- hankjwimbleton", 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("- Daan13000", 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 = 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_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)MenuAPI.CreateREPOLabel("Special Thanks", 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("- nickklmao for MenuLib", 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("- melonwater", 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("- Axel & all of semiwork for R.E.P.O.", sv, default(Vector2)))).rectTransform; <>c.<>9__0_37 = val38; obj39 = (object)val38; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj39, 0f, 0f); object obj40 = <>c.<>9__0_38; if (obj40 == null) { ScrollViewBuilderDelegate val39 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- Aeroni", sv, default(Vector2)))).rectTransform; <>c.<>9__0_38 = val39; obj40 = (object)val39; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj40, 0f, 0f); object obj41 = <>c.<>9__0_39; if (obj41 == null) { ScrollViewBuilderDelegate val40 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("- MissBeck73", sv, default(Vector2)))).rectTransform; <>c.<>9__0_39 = val40; obj41 = (object)val40; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj41, 0f, 0f); object obj42 = <>c.<>9__0_40; if (obj42 == null) { ScrollViewBuilderDelegate val41 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("and YOU for trying my mod! :3", sv, default(Vector2)))).rectTransform; <>c.<>9__0_40 = val41; obj42 = (object)val41; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj42, 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 Action <>9__1_8; public static ScrollViewBuilderDelegate <>9__1_4; public static ScrollViewBuilderDelegate <>9__1_5; public static ScrollViewBuilderDelegate <>9__1_6; 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)MenuAPI.CreateREPOLabel("Overview", sv, default(Vector2))).rectTransform; } internal RectTransform b__1_2(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_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)MenuAPI.CreateREPOLabel("Pick your Poison...", sv, default(Vector2))).rectTransform; } internal RectTransform b__1_4(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_8() { SelectMalfunction(MalfunctionManager.MalfunctionType.None); } 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("• Disable Malfunction", sv, default(Vector2)), 0.45f)).rectTransform; } internal RectTransform b__1_6(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_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Expected O, but got Unknown //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0123: 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) //IL_012e: Expected O, but got Unknown //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Expected O, but got Unknown //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: 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 val9 = default(Vector2); ((Vector2)(ref val9))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val9)).rectTransform; }; <>c.<>9__1_0 = val2; obj = (object)val2; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj, 0f, 0f); string[] obj2 = new string[4] { "Adds some spice to your runs.", "Cannot be changed during a run.", "Default scaling configurations will be used.", "Highest levels are saved!" }; object obj3 = <>c.<>9__1_1; if (obj3 == null) { ScrollViewBuilderDelegate val3 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Overview", sv, default(Vector2))).rectTransform; <>c.<>9__1_1 = val3; obj3 = (object)val3; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); string[] array = obj2; foreach (string o in array) { val.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("• " + o + "", sv, default(Vector2)), 0.4f)).rectTransform), 0f, 0f); } object obj4 = <>c.<>9__1_2; if (obj4 == 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 val9 = default(Vector2); ((Vector2)(ref val9))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val9)).rectTransform; }; <>c.<>9__1_2 = val4; obj4 = (object)val4; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); object obj5 = <>c.<>9__1_3; if (obj5 == null) { ScrollViewBuilderDelegate val5 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOLabel("Pick your Poison...", sv, default(Vector2))).rectTransform; <>c.<>9__1_3 = val5; obj5 = (object)val5; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj5, 0f, 0f); object obj6 = <>c.<>9__1_4; if (obj6 == null) { ScrollViewBuilderDelegate val6 = 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 val9 = MenuAPI.CreateREPOButton("None", (Action)delegate { SelectMalfunction(MalfunctionManager.MalfunctionType.None); }, sv, default(Vector2)); buttons.Add("None", val9); return ((REPOElement)val9).rectTransform; }; <>c.<>9__1_4 = val6; obj6 = (object)val6; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); object obj7 = <>c.<>9__1_5; if (obj7 == null) { ScrollViewBuilderDelegate val7 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("• Disable Malfunction", sv, default(Vector2)), 0.45f)).rectTransform; <>c.<>9__1_5 = val7; obj7 = (object)val7; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj7, 0f, 0f); object obj8 = <>c.<>9__1_6; if (obj8 == null) { ScrollViewBuilderDelegate val8 = 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 val9 = default(Vector2); ((Vector2)(ref val9))..ctor(0f, 5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val9)).rectTransform; }; <>c.<>9__1_6 = val8; obj8 = (object)val8; } val.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 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_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Expected O, but got Unknown //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0169: 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); string sprites; string color; if (bestLevel > 0) { sprites = ""; color = "#ff7"; if (bestLevel >= 5) { AddSprite("#ff0"); } if (bestLevel >= 10) { AddSprite("#f70"); } if (bestLevel >= 15) { AddSprite("#f00"); } if (bestLevel >= 20) { AddSprite("#f0f"); } if (bestLevel >= 25) { AddSprite("#00f"); } if (bestLevel >= 50) { AddSprite("#0ff", "sparkle", spriteWithColor: false); } if (bestLevel >= 100) { AddSprite("#0f0", "semibots", spriteWithColor: false); } 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); } void AddSprite(string setColorTo = null, string sprite = "settings", bool spriteWithColor = true) { if (!string.IsNullOrEmpty(setColorTo)) { color = setColorTo; } if (!string.IsNullOrEmpty(sprite)) { string text = ""; if (spriteWithColor) { text = "" + text + ""; } sprites += text; } } } 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__3_0; public static ScrollViewBuilderDelegate <>9__3_1; public static ScrollViewBuilderDelegate <>9__3_2; public static ScrollViewBuilderDelegate <>9__3_3; public static Func <>9__4_0; public static ScrollViewBuilderDelegate <>9__8_0; internal RectTransform b__3_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__3_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(" # Extractions # Modules Estimate Map Value Quota Difficulty", sv, default(Vector2)), 0.35f)).rectTransform; } internal RectTransform b__3_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(" Challenge Chance % # Enemies (T1/T2/T3) Enemy Health %", sv, default(Vector2)), 0.35f)).rectTransform; } internal RectTransform b__3_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) return ((REPOElement)MenuAPI.CreateREPOInputField("Simulate Level...", (Action)OnLevelsInputted, sv, default(Vector2), true, "1, 2-5, 15", levelsToSimulate)).rectTransform; } internal int b__4_0(int m) { return m; } internal RectTransform b__8_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, 2.5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val)).rectTransform; } } private static string levelsToSimulate = "1-20, 100"; private static List levelsList = new List(); private static REPOPopupPage page = null; public static void Show() { //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown if (MenusManager.currentPage == MenusManager.RightHandPage.Simulation) { return; } MenuAPI.CloseAllPagesAddedOnTop(); MenuLSPageMalfunctions.buttons.Clear(); Object.Destroy((Object)(object)page); page = MenuAPI.CreateREPOPopupPage("Level Simulation", (PresetSide)1, false, false, 5f); REPOPopupPage obj = page; object obj2 = <>c.<>9__3_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 val5 = default(Vector2); ((Vector2)(ref val5))..ctor(0f, 10f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val5)).rectTransform; }; <>c.<>9__3_0 = val; obj2 = (object)val; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); string[] array = new string[4] { "Simulate levels based on your config.", "Randomness & party size are not accounted for.", "Simulates based on YOUR config, not host's.", "Input a list or range of levels (can combine)." }; foreach (string o in array) { page.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel("• " + o + "", sv, default(Vector2)), 0.4f)).rectTransform), 0f, 0f); } REPOPopupPage obj3 = page; object obj4 = <>c.<>9__3_1; if (obj4 == null) { ScrollViewBuilderDelegate val2 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" # Extractions # Modules Estimate Map Value Quota Difficulty", sv, default(Vector2)), 0.35f)).rectTransform; <>c.<>9__3_1 = val2; obj4 = (object)val2; } obj3.AddElementToScrollView((ScrollViewBuilderDelegate)obj4, 0f, 0f); REPOPopupPage obj5 = page; object obj6 = <>c.<>9__3_2; if (obj6 == null) { ScrollViewBuilderDelegate val3 = (Transform sv) => ((REPOElement)MenusManager.SwoonLabelText(MenuAPI.CreateREPOLabel(" Challenge Chance % # Enemies (T1/T2/T3) Enemy Health %", sv, default(Vector2)), 0.35f)).rectTransform; <>c.<>9__3_2 = val3; obj6 = (object)val3; } obj5.AddElementToScrollView((ScrollViewBuilderDelegate)obj6, 0f, 0f); REPOPopupPage obj7 = page; object obj8 = <>c.<>9__3_3; if (obj8 == null) { ScrollViewBuilderDelegate val4 = (Transform sv) => ((REPOElement)MenuAPI.CreateREPOInputField("Simulate Level...", (Action)OnLevelsInputted, sv, default(Vector2), true, "1, 2-5, 15", levelsToSimulate)).rectTransform; <>c.<>9__3_3 = val4; obj8 = (object)val4; } obj7.AddElementToScrollView((ScrollViewBuilderDelegate)obj8, 0f, 0f); SetLevelsToSimulate(levelsToSimulate, refreshPage: false); SimulateSetLevels(levelsList); MenusManager.currentPage = MenusManager.RightHandPage.Simulation; page.OpenPage(true); } private static bool GetLevelsToSim(string sims, out List levels) { levels = new List(); sims = sims.Replace(" ", ""); if (string.IsNullOrEmpty(sims)) { return false; } List list = new List(); if (sims.Contains(",")) { list = sims.Split(new char[1] { ',' }).ToList(); } else { list.Add(sims); } foreach (string item in list) { if (levels.Count >= 100) { break; } if (string.IsNullOrEmpty(item)) { continue; } int result3; if (item.Contains("-")) { string[] array = item.Split(new char[1] { '-' }); if (array.Length != 2 || !int.TryParse(array[0], out var result) || !int.TryParse(array[1], out var result2) || result > result2) { continue; } for (int i = result; i <= result2; i++) { if (!levels.Contains(i) && i > 0) { levels.Add(i); } if (levels.Count >= 100) { break; } } } else if (int.TryParse(item, out result3) && !levels.Contains(result3) && result3 > 0) { levels.Add(result3); } } if (levels.Count < 1) { return false; } levels = levels.OrderBy((int m) => m).ToList(); return true; } public static void OnLevelsInputted(string sims) { SetLevelsToSimulate(sims, refreshPage: true); } public static void SetLevelsToSimulate(string levels, bool refreshPage) { if (GetLevelsToSim(levels, out var levels2)) { levelsToSimulate = levels; levelsList = levels2; if (refreshPage && MenusManager.currentPage == MenusManager.RightHandPage.Simulation) { MenusManager.currentPage = MenusManager.RightHandPage.None; Show(); } } } public static void SimulateSetLevels(List levels) { if (levels.Count > 0) { for (int i = 0; i < Mathf.Min(100, levels.Count); i++) { SimulateLevel(levels[i]); } } } public static void SimulateLevel(int levelNumber) { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //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_0031: Expected O, but got Unknown //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Expected O, but got Unknown //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Expected O, but got Unknown REPOPopupPage obj = page; object obj2 = <>c.<>9__8_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 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0f, 2.5f); return ((REPOElement)MenuAPI.CreateREPOSpacer(sv, default(Vector2), val2)).rectTransform; }; <>c.<>9__8_0 = val; obj2 = (object)val; } obj.AddElementToScrollView((ScrollViewBuilderDelegate)obj2, 0f, 0f); page.AddElementToScrollView((ScrollViewBuilderDelegate)delegate(Transform sv) { //IL_0018: 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_0030: Unknown result type (might be due to invalid IL or missing references) REPOLabel obj3 = MenuAPI.CreateREPOLabel($"Level {levelNumber}", sv, default(Vector2)); ((Graphic)obj3.labelTMP).color = Helpers.GetDifficultyColor(levelNumber); return ((REPOElement)obj3).rectTransform; }, 0f, 0f); int num = SwaggiFunc.DetermineNumberOfExtractions(levelNumber, GameDirector.instance?.PlayerList?.Count ?? 1, withoutRandomness: true) + 1; int num2 = SwaggiFunc.DetermineNumberOfModules(levelNumber, GameDirector.instance?.PlayerList?.Count ?? 1, "none", withoutRandomness: true); int num3 = Mathf.RoundToInt(SwaggiFunc.DetermineMapValue(levelNumber, GameDirector.instance?.PlayerList?.Count ?? 1, withoutRandomness: true)); float num4 = SwaggiFunc.DetermineBaseQuotaDifficulty(levelNumber, withoutRandomness: true); float num5 = SwaggiFunc.DetermineChallengeChance(levelNumber, includeChanceModifiers: true); int num6 = SwaggiFunc.DetermineT1Enemies(levelNumber, -1, withoutRandomness: true); int num7 = SwaggiFunc.DetermineT2Enemies(levelNumber, -1, withoutRandomness: true); int num8 = SwaggiFunc.DetermineT3Enemies(levelNumber, -1, withoutRandomness: true); int num9 = SwaggiFunc.DetermineEnemyHealthPercentage(levelNumber, GameDirector.instance?.PlayerList?.Count ?? 1, withoutRandomness: true); 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("Service Station stats don't count towards Total.", 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("Service Station stats don't count towards Total.", 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), clamp: false) ?? "", "TIME PLAYED", page); if (!flag) { AddLabelSubsection("check", "#0f0", $"x {stats.levelsCompleted:n0}", "LEVELS PASSED", page); AddLabelSubsection("extraction", "#0f7", $"x {stats.extractionPointsCompleted:n0}", "EXTRACTIONS COMPLETED", page); AddLabelSubsection("$$", "#2c2", $"${SemiFunc.DollarGetString((int)(stats.totalValueExtractedThousands * 1000.0)):n0}", "VALUE EXTRACTED", page); AddLabelSubsection("surplus", "#5c2", $"${SemiFunc.DollarGetString(stats.largestSurplusValue):n0}", "HIGHEST TAX RETURN", page); AddLabelSubsection("sparkle", "#7f0", $"x {stats.valuablesFound:n0}", "VALUABLES FOUND", page); AddLabelSubsection("road", "#ff0", $"x {stats.modulesExplored:n0}", "MODULES EXPLORED", page); AddLabelSubsection("burnmoney", "#c62", $"${SemiFunc.DollarGetString((int)(stats.totalValueBrokenThousands * 1000.0)):n0}", "VALUE LOST", page); AddLabelSubsection("spiral", "#f00", $"x {stats.challengesCompleted:n0}", "CHALLENGES CLEARED", page); 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); 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; public static BuilderDelegate <>9__8_5; 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)); } internal void b__8_5(Transform p) { CreateMenuEXPBar(p); } } 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_0035: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Expected O, but got Unknown if (!Plugin.MenuLibInstalled) { return; } 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 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_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_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Expected O, but got Unknown //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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.compatibilityMode >= Plugin.CompatibilityMode.None) { 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)); }); if (Plugin.Exp_Enable.Value && Plugin.Exp_ShowMenuRank.Value) { REPOPopupPage obj9 = page; object obj10 = <>c.<>9__8_5; if (obj10 == null) { BuilderDelegate val5 = delegate(Transform p) { CreateMenuEXPBar(p); }; <>c.<>9__8_5 = val5; obj10 = (object)val5; } obj9.AddElement((BuilderDelegate)obj10); } REPOPopupPage obj11 = page; obj11.onEscapePressed = (ShouldCloseMenuDelegate)Delegate.Combine((Delegate?)(object)obj11.onEscapePressed, (Delegate?)(ShouldCloseMenuDelegate)delegate { ClosePage(); return true; }); page.OpenPage(false); void ClosePage() { page.ClosePage(true); currentPage = RightHandPage.None; MenuLSPageMalfunctions.buttons.Clear(); } } public static GameObject CreateMenuEXPBar(Transform parent) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Unknown result type (might be due to invalid IL or missing references) //IL_029d: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) ExperienceManager.Level levelFromExp = ExperienceManager.GetLevelFromExp(ExperienceManager.experience); float num = 0f; GameObject val = new GameObject("LS Menu Level"); val.transform.SetParent(parent, false); GameObject val2 = new GameObject("LSRUI EXP Bar BG"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, num, 0f); Image val3 = val2.AddComponent(); ((Graphic)val3).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)val3).rectTransform.sizeDelta = new Vector2(120f, 5f); ((Graphic)val3).color = new Color(0f, 0.5f, 1f, 0.3f); GameObject val4 = new GameObject("LSRUI EXP Bar"); val4.transform.SetParent(val.transform, false); val4.transform.localPosition = new Vector3(0f, num, 0f); Image obj = val4.AddComponent(); ((Graphic)obj).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)obj).color = new Color(0f, 1f, 1f); GameObject val5 = new GameObject("LSRUI EXP Bar Icon"); val5.transform.SetParent(val.transform, false); val5.transform.localPosition = new Vector3(0f, num + 5f, 0f); Image obj2 = val5.AddComponent(); ((Graphic)obj2).rectTransform.sizeDelta = new Vector2(50f, 50f); obj2.sprite = LevelResultsUIHelpers.instance.levelBgSprite; TextMeshProUGUI val6 = Object.Instantiate(LevelResultsUIHelpers.instance.uiText, val.transform); ((Object)val6).name = "LSRUI EXP Bar Level"; ((TMP_Text)val6).transform.localPosition = new Vector3(0f, num + 8.5f, 0f); ((TMP_Text)val6).alignment = (TextAlignmentOptions)514; ((TMP_Text)val6).fontSize = 18f; TextMeshProUGUI obj3 = Object.Instantiate(LevelResultsUIHelpers.instance.uiText, val.transform); ((Object)obj3).name = "LSRUI EXP Bar Level Progress"; ((TMP_Text)obj3).transform.localPosition = new Vector3(-80f, num + 13.5f, 0f); ((TMP_Text)obj3).alignment = (TextAlignmentOptions)516; ((Graphic)obj3).color = new Color(0.5f, 0.5f, 0.67f); ((TMP_Text)obj3).fontSize = 12f; (Color, Color) rankColor = ExperienceManager.GetRankColor(levelFromExp.rank); ((TMP_Text)val6).text = levelFromExp.rank.ToString(); ((TMP_Text)obj3).text = ExperienceManager.GetExpProgressString(levelFromExp); ((Graphic)obj2).color = rankColor.Item2; ((Graphic)val6).color = rankColor.Item1; ((Graphic)obj).rectTransform.sizeDelta = new Vector2(levelFromExp.ProgressPercent * ((Graphic)val3).rectTransform.sizeDelta.x, ((Graphic)val3).rectTransform.sizeDelta.y); val.transform.localPosition = new Vector3(210f, 33f, 0f); return val; } } } namespace LevelScaling.LevelStats { public class ExperienceManager { public enum ExpBonusType { Level, FullClear, Challenge, Time, Extracted, Broken, Orbs, Cosmetics } public class ExpBonus { public ExpBonusType type; public int amount; public int expGained; public ExpBonus(ExpBonusType _type, int _amount, int _expGained) { type = _type; amount = _amount; expGained = _expGained; } } public class Level { public int rank; public int totalExpRequired; public int expProgress; public int expToRankUp; public float ProgressPercent => (float)expProgress / (float)expToRankUp; } public class CachedPlayerRank { public Level level; public string namePrefix; } private static readonly Dictionary levelColorBreakpoints = new Dictionary { { 999, new Color(0.5f, 1f, 1f) }, { 900, new Color(0.8f, 1f, 0.25f) }, { 800, new Color(0.7f, 0.8f, 0.9f) }, { 700, new Color(0.75f, 0.35f, 0.15f) }, { 600, new Color(0f, 1f, 0f) }, { 500, new Color(0f, 1f, 0.5f) }, { 400, new Color(0f, 1f, 1f) }, { 300, new Color(0f, 0.5f, 1f) }, { 200, new Color(0f, 0f, 1f) }, { 100, new Color(0.5f, 0f, 1f) }, { 90, new Color(1f, 0f, 0.8f) }, { 80, new Color(1f, 0f, 0.6f) }, { 70, new Color(1f, 0f, 0.4f) }, { 60, new Color(1f, 0f, 0.2f) }, { 50, new Color(1f, 0f, 0f) }, { 40, new Color(1f, 0.5f, 0f) }, { 30, new Color(1f, 1f, 0f) }, { 20, new Color(1f, 1f, 0.5f) }, { 10, new Color(1f, 1f, 1f) }, { 1, new Color(0.55f, 0.55f, 0.55f) } }; private static readonly Dictionary iconColorBreakpoints = new Dictionary { { 999, new Color(1f, 1f, 0f) }, { 900, new Color(0.5f, 0f, 1f) }, { 800, new Color(1f, 0f, 0f) }, { 700, new Color(0f, 0.7f, 0f) }, { 1, new Color(0f, 0f, 1f) } }; public const int MAX_LEVEL = 999; public static readonly int MAX_EXP = 2007276350; public static int experience = 0; public static Level currentLevel = null; public static List expBonusList = new List(); public static bool ssCompleted = false; public static int ssLevel = 0; public static int ssFullClearType = 0; public static int ssChallenge = 0; public static int ssTime = 0; public static int ssExtracted = 0; public static int ssBroken = 0; public static int ssOrbs = 0; public static int ssCosmetics = 0; public static int ssExpStart = 0; public static int ssExpEnd = 0; public static int SetExperience(int exp) { experience = Mathf.Clamp(exp, 0, MAX_EXP); currentLevel = GetLevelFromExp(exp); return experience; } public static Level GetLevelFromExp(int exp) { int num = 0; int num2 = 250; int num3 = 250; int num4 = 50; int num5 = 1; while (true) { if (num5 % 25 == 0 && num4 > 10) { num4 -= 10; } if (num5 >= 125) { num4 = 5; } if (num5 >= 250) { num4 = 0; } if (exp < num2 || num5 >= 999) { break; } exp -= num2; num += num2; num2 += num3; num3 += num4; num5++; } return new Level { rank = num5, totalExpRequired = num, expProgress = exp, expToRankUp = num2 }; } public static string GetExpProgressString(Level level) { if (level.rank >= 999) { return $"{level.totalExpRequired + level.expProgress:n0}"; } return $"{level.expProgress:n0} / {level.expToRankUp:n0}"; } public static void SnapshotLevelAndAwardExp(bool completedLevel) { SetAllStats(completedLevel); if (!completedLevel) { return; } expBonusList.Clear(); expBonusList = GetExpBonusesThisGame(out var expGained); Helpers.DeepLog($"Experience gained this level: {expGained}"); foreach (ExpBonus expBonus in expBonusList) { Helpers.DeepLog($" --> {expBonus.type} ({expBonus.amount}) = +{expBonus.expGained:n0}"); } ssExpStart = experience; ssExpEnd = SetExperience(experience + expGained); Helpers.DeepLog($"TOTAL EXP: {ssExpStart} ==> {ssExpEnd}"); } public static void SetAllStats(bool completedLevel) { ssCompleted = completedLevel; ssLevel = LevelStatsManager.LevelNumber - 1; ssChallenge = Mathf.Clamp(LevelStatsManager.challengesJustCompleted, 0, 5); ssTime = Mathf.Clamp((int)LevelStatsManager.thisLevelTime, 0, 5999); ssExtracted = Mathf.Clamp((int)LevelStatsManager.totalValueExtracted, 0, LevelStatsManager.totalMapValue); ssBroken = (int)(1000f * Mathf.Clamp01((float)LevelStatsManager.RemainingTotalMapValue / Mathf.Max(1f, (float)LevelStatsManager.totalMapValue))); ssOrbs = Mathf.Clamp(LevelStatsManager.enemyKills, 0, 99); ssCosmetics = Mathf.Clamp(LevelStatsManager.cosmeticBoxesExtracted, 0, 3); ssFullClearType = 0; if (LevelStatsManager.totalValueExtracted >= (float)LevelStatsManager.totalMapValue) { ssFullClearType = 3; } else if (LevelStatsManager.totalValueExtracted >= (float)LevelStatsManager.RemainingTotalMapValue) { if (LevelStatsManager.nonDiscoveredValuablesBroken > 0) { ssFullClearType = 1; } else { ssFullClearType = 2; } } } public static List GetExpBonusesThisGame(out int expGained) { List list = new List(); expGained = 0; int num = 100; if (ssCompleted) { int num2 = Mathf.Clamp(ssLevel * 50, 10, 1000); num2 += Mathf.Clamp((ssLevel - 20) * 5, 0, 400); ExpBonus expBonus = new ExpBonus(ExpBonusType.Level, ssLevel, num2); list.Add(expBonus); expGained += expBonus.expGained; } if (ssCompleted && ssFullClearType > 0) { float num3; float num4; switch (ssFullClearType) { case 3: num3 = 2f; num4 = 0.5f; break; case 2: num3 = 1.33f; num4 = 0.17f; break; default: num3 = 1f; num4 = 0.05f; break; } int expGained2 = (int)((float)LevelStatsManager.valuablesFound * num3 + (float)ssExtracted / 1000f * num4); ExpBonus expBonus2 = new ExpBonus(ExpBonusType.FullClear, ssFullClearType, expGained2); list.Add(expBonus2); expGained += expBonus2.expGained; } if (ssCompleted && ssChallenge > 0) { int expGained3 = 50 * ssChallenge + 25 * (ssChallenge - 1); ExpBonus expBonus3 = new ExpBonus(ExpBonusType.Challenge, ssChallenge, expGained3); list.Add(expBonus3); expGained += expBonus3.expGained; } ExpBonus expBonus4 = new ExpBonus(ExpBonusType.Time, ssTime, Mathf.Max(1, ssTime / 12)); list.Add(expBonus4); expGained += expBonus4.expGained; if (ssExtracted > 0) { int num5 = ssExtracted / 100; int num6 = Mathf.Min(2000, num5); if (num5 > 2000) { num6 += Mathf.Min((num5 - 2000) / 5, 500); } num = Mathf.Clamp(num6, num, 2000); ExpBonus expBonus5 = new ExpBonus(ExpBonusType.Extracted, ssExtracted, num6); list.Add(expBonus5); expGained += expBonus5.expGained; } if (ssCompleted && ssBroken > 0) { float num7 = Mathf.Clamp01(1E-06f * Mathf.Pow((float)ssBroken, 2f)); num = (int)Mathf.Max((float)num * num7 / 2f, 1f); ExpBonus expBonus6 = new ExpBonus(ExpBonusType.Broken, ssBroken, num); list.Add(expBonus6); expGained += expBonus6.expGained; } if (ssOrbs > 0) { float num8 = Mathf.Min((float)ssOrbs * 25f, 200f); if (ssOrbs > 8) { num8 += Mathf.Min((float)(ssOrbs - 8) * 10f, 120f); } ExpBonus expBonus7 = new ExpBonus(ExpBonusType.Orbs, ssOrbs, (int)num8); list.Add(expBonus7); expGained += expBonus7.expGained; } if (ssCompleted && ssCosmetics > 0) { int expGained4 = Mathf.Clamp(ssCosmetics * 35, 0, 150); ExpBonus expBonus8 = new ExpBonus(ExpBonusType.Cosmetics, ssCosmetics, expGained4); list.Add(expBonus8); expGained += expBonus8.expGained; } return list; } public static void SyncExperience() { if (Plugin.Exp_Enable.Value && Plugin.Exp_SyncExperience.Value && Object.op_Implicit((Object)(object)LevelStatsSyncing.instance) && Plugin.compatibilityMode >= Plugin.CompatibilityMode.None && Object.op_Implicit((Object)(object)PlayerAvatar.instance)) { if (!SemiFunc.IsMultiplayer() || !PhotonNetwork.InRoom) { LevelStatsSyncing.instance.SyncExperienceRPC(SemiFunc.PlayerGetSteamID(PlayerAvatar.instance), experience); return; } LevelStatsSyncing.instance.photonView.RPC("SyncExperienceRPC", (RpcTarget)0, new object[2] { SemiFunc.PlayerGetSteamID(PlayerAvatar.instance), experience }); } } public static string GetRankPrefixString(Level level) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (level.rank >= 999) { return "(999)"; } (Color, Color) rankColor = GetRankColor(level.rank); if (rankColor.Item2 == Color.blue) { string arg = ColorUtility.ToHtmlStringRGB(rankColor.Item1); return $"({level.rank})"; } string text = ColorUtility.ToHtmlStringRGB(rankColor.Item2); string text2 = ColorUtility.ToHtmlStringRGB(rankColor.Item1); return $"({level.rank})"; } public static (Color, Color) GetRankColor(int rank) { //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_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: 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_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_0091: 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) Color item = Color.white; Color item2 = Color.blue; foreach (KeyValuePair levelColorBreakpoint in levelColorBreakpoints) { if (rank >= levelColorBreakpoint.Key) { item = levelColorBreakpoint.Value; break; } } foreach (KeyValuePair iconColorBreakpoint in iconColorBreakpoints) { if (rank >= iconColorBreakpoint.Key) { item2 = iconColorBreakpoint.Value; break; } } return (item, item2); } } public 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 UnityEvent OnGlobalStatsUpdate = new UnityEvent(); 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); ES3.Save("experience", ExperienceManager.experience, val); UpdateGlobalStatsEvent(); Plugin.loggy.LogDebug((object)("Saved global stats to " + val.path + ".")); } public static void LoadGlobalStats() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown string text = Application.persistentDataPath + "/LevelScalingGlobalSave.es3"; if (!File.Exists(text)) { return; } try { 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}"); } } if (ES3.KeyExists("experience", text, val)) { ExperienceManager.experience = ES3.Load("experience", text, 0, val); Helpers.DeepLog($"loaded exp - {ExperienceManager.experience:n0} (RANK {ExperienceManager.GetLevelFromExp(ExperienceManager.experience).rank})"); } SaveGlobalStats(backup: true); } catch (Exception ex) { Plugin.loggy.LogError((object)("Unable to load global stats.\n\n" + ex.Message + "\n" + ex.StackTrace)); } } public static void UpdateGlobalStatsEvent() { OnGlobalStatsUpdate.Invoke(); } } public class LevelResultsUIHelpers : MonoBehaviour { public static LevelResultsUIHelpers instance; public AudioSource main; public AudioSource mainSFX; public AudioClip countUpSound; public AudioClip countUpSoundFinish1; public AudioClip countUpSoundFinish2; public AudioClip countUpSoundFinish3; public AudioClip countUpSoundFinish4; public AudioClip levelComplete; public AudioClip resultPopUp; public AudioClip rankCountUp; public AudioClip rankUp; public AudioClip rankUp2; public Sprite levelBgSprite; public TextMeshProUGUI uiText; private const int stuffReq = 12; private int stuffDone; public static void TryMakeNew() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)instance)) { instance = new GameObject("Level Scaling Audio Source") { hideFlags = (HideFlags)61 }.AddComponent(); instance.Setup(); } } private IEnumerator Start() { if (stuffDone < 12) { yield return null; ((GameObject)Resources.Load("level/recording/start room/Start Room - Recording")).SetActive(false); yield return null; ((GameObject)Resources.Load("level/shop/modules/Module - Shop - S - Cosmetic Machine 01")).SetActive(false); } } private void Setup() { //IL_0067: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)uiText == (Object)null && Object.op_Implicit((Object)(object)SplashScreenUI.instance) && Object.op_Implicit((Object)(object)((Component)SplashScreenUI.instance).transform)) { TextMeshProUGUI val = Object.Instantiate(((Component)((Component)SplashScreenUI.instance).transform.Find("Warning/Text 1")).GetComponent(), ((Component)this).transform); ((Object)val).name = "LSRUI Header Text Default"; Object.DestroyImmediate((Object)(object)((Component)val).GetComponent()); ((Graphic)val).color = Color.white; ((TMP_Text)val).text = ""; uiText = val; } if (!Object.op_Implicit((Object)(object)main) && Object.op_Implicit((Object)(object)AudioManager.instance)) { GameObject val2 = Object.Instantiate(AudioManager.instance.AudioCutscene); Object.DontDestroyOnLoad((Object)(object)val2); Object.Destroy((Object)(object)val2.GetComponent()); Object.Destroy((Object)(object)val2.GetComponent()); main = val2.GetComponent(); ((Object)main).name = "Level Scaling Audio Global"; main.volume = 0.2f; main.spatialBlend = 0f; main.dopplerLevel = 0f; GameObject val3 = Object.Instantiate(AudioManager.instance.AudioCutscene); Object.DontDestroyOnLoad((Object)(object)val3); Object.Destroy((Object)(object)val3.GetComponent()); Object.Destroy((Object)(object)val3.GetComponent()); mainSFX = val3.GetComponent(); ((Object)mainSFX).name = "Level Scaling Audio Global SFX"; mainSFX.volume = 0.3f; mainSFX.spatialBlend = 0f; mainSFX.dopplerLevel = 0f; } AudioClip[] array = Resources.FindObjectsOfTypeAll(); foreach (AudioClip clip in array) { Register("extraction point surplus done ding lvl1", clip, ref countUpSoundFinish1); Register("extraction point surplus done ding lvl2", clip, ref countUpSoundFinish2); Register("extraction point surplus done ding lvl3", clip, ref countUpSoundFinish3); Register("extraction point surplus done ding lvl4", clip, ref countUpSoundFinish4); Register("extraction point surplus increase loop", clip, ref countUpSound); Register("ui moon title", clip, ref levelComplete); Register("snd_dirt_tracker_count up", clip, ref rankCountUp); Register("ui moon attribute01", clip, ref resultPopUp); Register("cosmetic shop screen cosmetic reward rare", clip, ref rankUp); Register("cosmetic shop cannons shoot", clip, ref rankUp2); } Texture2D[] array2 = Resources.FindObjectsOfTypeAll(); foreach (Texture2D tex in array2) { Register("moon corner", tex, ref levelBgSprite); } } private void Register(string expectedName, AudioClip clip, ref AudioClip to) { if (!((Object)(object)to != (Object)null) && !(((Object)clip).name != expectedName) && !((Object)(object)clip == (Object)null)) { to = clip; stuffDone++; Helpers.DeepLog("done sound " + expectedName); } } private void Register(string expectedName, Texture2D tex, ref Sprite to) { //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_004b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)to != (Object)null) && !(((Object)tex).name != expectedName) && !((Object)(object)tex == (Object)null)) { to = Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), Vector2.one * 0.5f); stuffDone++; Helpers.DeepLog("done sprite " + expectedName); } } private void Update() { if (stuffDone < 12 || (Object)(object)main == (Object)null) { Setup(); } } private void TestCountLoop(float time = 2f, int endLevel = 2) { ((MonoBehaviour)this).StartCoroutine(TestPlayCountLoop()); IEnumerator TestPlayCountLoop() { float timer = 0f; while (timer < time) { PlayCountLoop(1f + Mathf.Clamp01(timer / time)); timer += Time.deltaTime; yield return null; } FinishCountUp(endLevel); } } public void PlayCountLoop(float pitch = 1f) { if (Object.op_Implicit((Object)(object)main) && Object.op_Implicit((Object)(object)countUpSound)) { if (main.isPlaying) { main.pitch = pitch; return; } main.pitch = 1f; main.clip = countUpSound; main.loop = true; main.Play(); } } public void FinishCountUp(int level = 1) { if (Object.op_Implicit((Object)(object)main) && Object.op_Implicit((Object)(object)mainSFX)) { if (main.isPlaying) { main.Stop(); } AudioClip val = countUpSoundFinish4; switch (level) { case 1: val = countUpSoundFinish1; break; case 2: val = countUpSoundFinish2; break; case 3: val = countUpSoundFinish3; break; } if (!((Object)(object)val == (Object)null)) { mainSFX.PlayOneShot(val); } } } public void PlayLevelComplete() { if (Object.op_Implicit((Object)(object)mainSFX) && !((Object)(object)levelComplete == (Object)null)) { mainSFX.PlayOneShot(levelComplete); } } public void PlayResultPopup() { if (Object.op_Implicit((Object)(object)mainSFX) && !((Object)(object)resultPopUp == (Object)null)) { mainSFX.PlayOneShot(resultPopUp); } } public void PlayExpLoop(float pitch = 1f) { if (Object.op_Implicit((Object)(object)main) && Object.op_Implicit((Object)(object)rankCountUp)) { if (main.isPlaying) { main.pitch = pitch; return; } main.pitch = pitch; main.clip = rankCountUp; main.loop = true; main.Play(); } } public void FinishExpLoop() { if (Object.op_Implicit((Object)(object)main) && main.isPlaying) { main.Stop(); } } public void PlayRankUp(bool firstTime) { if (Object.op_Implicit((Object)(object)mainSFX)) { if (Object.op_Implicit((Object)(object)rankUp) && firstTime) { mainSFX.PlayOneShot(rankUp); } if (Object.op_Implicit((Object)(object)rankUp2)) { mainSFX.PlayOneShot(rankUp2); } } } } public class LevelResultsUI : MonoBehaviour { public enum LevelResultsState { Idle, FadeIn, ShiftHeaderUp, BringUpTotal, ExpBonusAppear, ExpBonusCount, ExpBonusFinish, LevelAppear, LevelCount, LevelFinish, FadeAllOut } public static LevelResultsUI instance; public GameObject totalGameObject; public TextMeshProUGUI levelCompleteHeader; public TextMeshProUGUI expTotalLabel; public TextMeshProUGUI expTotalGain; public TextMeshProUGUI currentExpBonusLabel; public TextMeshProUGUI currentExpBonusAmount; public TextMeshProUGUI currentExpBonusGain; public Image expBar; public Image expBarBackground; public Image expBarIcon; public TextMeshProUGUI expLevel; public TextMeshProUGUI expLevelLabel; public TextMeshProUGUI expProgress; public List allTexts = new List(); public List allImages = new List(); public Color curRankTextColor = Color.white; public Color curRankIconColor = Color.blue; public bool isRunning; public bool isInitialized; private bool _skipCosmeticsFlag; public LevelResultsState state; public bool stateImpulse; public float stateTimer; public float stateTimerMax; public int expBonusIndex; public int accumulatedTotal; public float currentLerp; public ExperienceManager.Level currentLevel; private const int expBarYPos = -120; private const int expBarIconYPos = -115; private const float expBarLevelYPos = -112.5f; private const int expBarProgressYPos = -105; private const int totalTextYPos = -140; private const int initialBonusYPos = 110; private const int bonusYPosSubtract = 25; private const int labelXPos = 10; private const int amountXPos = 33; private const int gainXPos = 300; private float fastForwardTimer; private int previousRank = -1; private bool rankedUpThisGo; private Coroutine levelUpCoroutineText; private Coroutine levelUpCoroutineImage; private int CurrentBonusYPos => 110 - 25 * expBonusIndex; private bool FastForward => fastForwardTimer > 0f; public void SetRunning(bool skipCosmetics = false) { _skipCosmeticsFlag = skipCosmetics; isRunning = true; SetState(LevelResultsState.Idle); } public void Finish() { if (RoundDirector.instance.cosmeticWorldObjectsExtracted.Count <= 0) { ResultScreenUI.instance.StateUpdate((State)4); } else if (GameManager.Multiplayer() && !SemiFunc.IsMasterClient() && _skipCosmeticsFlag) { RoundDirector.instance.cosmeticWorldObjectsExtracted.Clear(); NetworkManager.instance.TriggerLeavePhotonRoomForcedStuckInLoading(); ResultScreenUI.instance.StateUpdate((State)4); } isRunning = false; GlobalStatsManager.SaveGlobalStats(); } public void SetState(LevelResultsState _state) { stateImpulse = true; state = _state; } private void Start() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) LevelResultsUIHelpers.TryMakeNew(); instance = this; ((Component)this).transform.localPosition = Vector3.zero; SetUpAllTexts(); } private void OnDestroy() { if (Object.op_Implicit((Object)(object)LevelResultsUIHelpers.instance)) { LevelResultsUIHelpers.instance.FinishExpLoop(); } } private void SetUpAllTexts() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: 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_00e7: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("LSRUI Header"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.zero; levelCompleteHeader = Object.Instantiate(LevelResultsUIHelpers.instance.uiText, val.transform); ((Object)levelCompleteHeader).name = "LSRUI Header Text"; ((Graphic)levelCompleteHeader).color = Color.green; ((TMP_Text)levelCompleteHeader).text = "Level Complete!"; ((TMP_Text)levelCompleteHeader).transform.localPosition = Vector3.zero; ((TMP_Text)levelCompleteHeader).transform.localScale = Vector3.one * 1.9f; ((TMP_Text)levelCompleteHeader).alpha = 0f; allTexts.Add(levelCompleteHeader); Helpers.DeepLog("creating total gain"); totalGameObject = new GameObject("LSRUI Total"); totalGameObject.transform.SetParent(((Component)this).transform, false); totalGameObject.transform.localPosition = Vector3.zero; expTotalGain = Object.Instantiate(levelCompleteHeader, totalGameObject.transform); ((Object)expTotalGain).name = "LSRUI EXP Bonus Gain"; ((TMP_Text)expTotalGain).alignment = (TextAlignmentOptions)513; ((TMP_Text)expTotalGain).transform.localScale = Vector3.one; ((Graphic)expTotalGain).color = new Color(0f, 1f, 1f); ((TMP_Text)expTotalGain).alpha = 0f; ((TMP_Text)expTotalGain).text = "+0"; ((TMP_Text)expTotalGain).transform.localPosition = new Vector3(300f, -140f, 0f); allTexts.Add(expTotalGain); Helpers.DeepLog("creating total label"); expTotalLabel = Object.Instantiate(expTotalGain, totalGameObject.transform); ((Object)expTotalLabel).name = "LSRUI EXP Bonus Label"; ((TMP_Text)expTotalLabel).transform.localPosition = new Vector3(10f, -140f, 0f); ((TMP_Text)expTotalLabel).transform.localScale = Vector3.one; ((Graphic)expTotalLabel).color = new Color(1f, 1f, 0f); ((TMP_Text)expTotalLabel).text = " TOTAL EXPERIENCE GAINED"; ((TMP_Text)expTotalLabel).alpha = 0f; allTexts.Add(expTotalLabel); Helpers.DeepLog("creating total amount"); TextMeshProUGUI obj = Object.Instantiate(expTotalGain, totalGameObject.transform); ((Object)obj).name = "LSRUI EXP Bonus Amount"; ((TMP_Text)obj).alignment = (TextAlignmentOptions)514; ((TMP_Text)obj).transform.localPosition = new Vector3(33f, -140f, 0f); ((TMP_Text)obj).transform.localScale = Vector3.one; ((Graphic)obj).color = Color.white; ((TMP_Text)obj).text = ""; ((TMP_Text)obj).alpha = 0f; isInitialized = true; } private void CreateNewExpBonusRow(ExperienceManager.ExpBonus bonus) { //IL_0033: 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) GameObject val = Object.Instantiate(totalGameObject, ((Component)this).transform); ((Object)val).name = $"LSRUI EXP Bonus - {bonus.type}"; val.transform.localPosition = Vector3.zero; currentExpBonusLabel = ((Component)val.transform.Find("LSRUI EXP Bonus Label")).GetComponent(); ((TMP_Text)currentExpBonusLabel).fontStyle = (FontStyles)16; ((Graphic)currentExpBonusLabel).color = new Color(0.8f, 0.8f, 0.8f); currentExpBonusAmount = ((Component)val.transform.Find("LSRUI EXP Bonus Amount")).GetComponent(); ((TMP_Text)currentExpBonusAmount).text = FormatValue(bonus.type, 0); currentExpBonusGain = ((Component)val.transform.Find("LSRUI EXP Bonus Gain")).GetComponent(); ((TMP_Text)currentExpBonusGain).text = "+0"; allTexts.Add(currentExpBonusLabel); allTexts.Add(currentExpBonusAmount); allTexts.Add(currentExpBonusGain); string text = "???"; switch (bonus.type) { case ExperienceManager.ExpBonusType.Level: text = " LEVEL COMPLETED!"; break; case ExperienceManager.ExpBonusType.Challenge: text = " CHALLENGES"; break; case ExperienceManager.ExpBonusType.Time: text = " TIME"; break; case ExperienceManager.ExpBonusType.Extracted: text = " EXTRACTED"; break; case ExperienceManager.ExpBonusType.Broken: text = " VALUE CONDITIONS"; break; case ExperienceManager.ExpBonusType.Orbs: text = " ORB DROPS"; break; case ExperienceManager.ExpBonusType.Cosmetics: text = " COSMETICS"; break; case ExperienceManager.ExpBonusType.FullClear: text = ((bonus.amount != 3) ? ((bonus.amount != 2) ? " PARTIAL FULL CLEAR" : " FULL CLEAR!") : " PERFECT FULL CLEAR!"); break; } ((TMP_Text)currentExpBonusLabel).text = text; } private void CreateLevelObjects() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_0023: 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_0038: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_02f2: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) GameObject val = new GameObject("LSRUI Level"); val.transform.SetParent(((Component)this).transform, false); val.transform.localPosition = Vector3.zero; GameObject val2 = new GameObject("LSRUI EXP Bar BG"); val2.transform.SetParent(val.transform, false); val2.transform.localPosition = new Vector3(0f, -120f, 0f); expBarBackground = val2.AddComponent(); ((Graphic)expBarBackground).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)expBarBackground).rectTransform.sizeDelta = new Vector2(180f, 5f); ((Graphic)expBarBackground).color = new Color(0f, 0.5f, 1f, 0.3f); GameObject val3 = new GameObject("LSRUI EXP Bar"); val3.transform.SetParent(val.transform, false); val3.transform.localPosition = new Vector3(0f, -120f, 0f); expBar = val3.AddComponent(); ((Graphic)expBar).rectTransform.pivot = new Vector2(0f, 0.5f); ((Graphic)expBar).rectTransform.sizeDelta = new Vector2(180f, 5f); ((Graphic)expBar).color = new Color(0f, 1f, 1f); GameObject val4 = new GameObject("LSRUI EXP Bar Icon"); val4.transform.SetParent(val.transform, false); val4.transform.localPosition = new Vector3(0f, -115f, 0f); expBarIcon = val4.AddComponent(); ((Graphic)expBarIcon).rectTransform.sizeDelta = new Vector2(50f, 50f); expBarIcon.sprite = LevelResultsUIHelpers.instance.levelBgSprite; ((Graphic)expBarIcon).color = new Color(0f, 0f, 1f); expLevel = Object.Instantiate(expTotalGain, val.transform); ((Object)expLevel).name = "LSRUI EXP Bar Level"; ((TMP_Text)expLevel).transform.localPosition = new Vector3(0f, -112.5f, 0f); ((TMP_Text)expLevel).alignment = (TextAlignmentOptions)514; ((Graphic)expLevel).color = new Color(1f, 1f, 0f); ((TMP_Text)expLevel).fontSize = 28f; ((TMP_Text)expLevel).text = ""; expLevelLabel = Object.Instantiate(expTotalLabel, val.transform); ((Object)expLevelLabel).name = "LSRUI EXP Bar Level Label"; ((TMP_Text)expLevelLabel).transform.localPosition = new Vector3(30f, -112.5f, 0f); ((TMP_Text)expLevelLabel).tintAllSprites = true; ((Graphic)expLevelLabel).color = new Color(0f, 1f, 1f); ((TMP_Text)expLevelLabel).text = " YOUR RANK:"; expProgress = Object.Instantiate(expTotalGain, val.transform); ((Object)expProgress).name = "LSRUI EXP Bar Level Progress"; ((TMP_Text)expProgress).transform.localPosition = new Vector3(-20f, -105f, 0f); ((TMP_Text)expProgress).alignment = (TextAlignmentOptions)516; ((Graphic)expProgress).color = new Color(0.5f, 0.5f, 0.67f); ((TMP_Text)expProgress).fontSize = 16f; ((TMP_Text)expProgress).text = ""; allTexts.Add(expLevel); allTexts.Add(expProgress); allTexts.Add(expLevelLabel); allImages.Add(expBar); allImages.Add(expBarBackground); allImages.Add(expBarIcon); } private string FormatValue(ExperienceManager.ExpBonusType type, int amount) { switch (type) { case ExperienceManager.ExpBonusType.Level: case ExperienceManager.ExpBonusType.FullClear: return ""; case ExperienceManager.ExpBonusType.Challenge: case ExperienceManager.ExpBonusType.Orbs: case ExperienceManager.ExpBonusType.Cosmetics: return $"x {amount:n0}"; case ExperienceManager.ExpBonusType.Time: { int num = amount / 60; int num2 = amount % 60; return $"{num:00}:{num2:00}"; } case ExperienceManager.ExpBonusType.Extracted: return "$" + SemiFunc.DollarGetString(amount); case ExperienceManager.ExpBonusType.Broken: return $"{(float)amount / 10f:0.0}%"; default: return ""; } } private float GetStateTimer(ExperienceManager.ExpBonusType type, int amount) { switch (type) { case ExperienceManager.ExpBonusType.Level: return 1f; case ExperienceManager.ExpBonusType.Challenge: return 0.8f; case ExperienceManager.ExpBonusType.Orbs: return (float)amount * 0.125f; case ExperienceManager.ExpBonusType.Cosmetics: return (float)amount * 0.33f; case ExperienceManager.ExpBonusType.Time: return Mathf.Clamp((float)amount / 450f, 0.5f, 4f); case ExperienceManager.ExpBonusType.Extracted: if (amount >= 500000) { return 7f; } if (amount >= 400000) { return 6f; } if (amount >= 300000) { return 5f; } if (amount >= 200000) { return 4f; } if (amount >= 100000) { return 3f; } if (amount >= 60000) { return 2f; } if (amount >= 30000) { return 1.5f; } return 1f; case ExperienceManager.ExpBonusType.Broken: return 1f; default: return 1f; } } private void Update() { fastForwardTimer -= Time.deltaTime; if (isRunning && isInitialized) { if (SemiFunc.InputHold((InputKey)6)) { fastForwardTimer = 0.3f; } Machine(); } } private void Machine() { switch (state) { case LevelResultsState.Idle: StateIdle(); break; case LevelResultsState.FadeIn: StateFadeIn(); break; case LevelResultsState.ShiftHeaderUp: StateShiftHeaderUp(); break; case LevelResultsState.BringUpTotal: StateBringUpTotal(); break; case LevelResultsState.ExpBonusAppear: StateExpBonusAppear(); break; case LevelResultsState.ExpBonusCount: StateExpBonusCount(); break; case LevelResultsState.ExpBonusFinish: StateExpBonusFinish(); break; case LevelResultsState.LevelAppear: StateLevelAppear(); break; case LevelResultsState.LevelCount: StateLevelCount(); break; case LevelResultsState.LevelFinish: StateLevelFinish(); break; case LevelResultsState.FadeAllOut: StateFadeAllOut(); break; } } private void StateIdle() { if (stateImpulse) { stateTimer = 0.1f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (stateTimer <= 0f) { SetState(LevelResultsState.FadeIn); } } private void StateFadeIn() { //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { int num = ExperienceManager.ssLevel; if (!ExperienceManager.ssCompleted) { num++; } ((TMP_Text)levelCompleteHeader).text = $"Level {num} RESULTS"; ((Graphic)levelCompleteHeader).color = Helpers.GetDifficultyColor(num); LevelResultsUIHelpers.instance.PlayLevelComplete(); stateTimer = 0.85f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 5f; } float num2 = Mathf.InverseLerp(0.85f, 0.65f, stateTimer); ((TMP_Text)levelCompleteHeader).alpha = num2; ((TMP_Text)levelCompleteHeader).transform.localScale = Vector3.one * Mathf.Lerp(2.5f, 1.9f, num2); if (stateTimer <= 0f) { SetState(LevelResultsState.ShiftHeaderUp); } } private void StateShiftHeaderUp() { //IL_0087: 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_00b1: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 0.1f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 7f; } float num = Mathf.InverseLerp(0.1f, 0f, stateTimer); ((TMP_Text)levelCompleteHeader).transform.localPosition = new Vector3(0f, Mathf.Lerp(0f, 150f, num), 0f); ((TMP_Text)levelCompleteHeader).transform.localScale = Vector3.one * Mathf.Lerp(1.9f, 1.5f, num); if (stateTimer <= 0f) { SetState(LevelResultsState.BringUpTotal); } } private void StateBringUpTotal() { //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { accumulatedTotal = 0; stateTimer = 0.2f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 5f; } float num = Mathf.InverseLerp(0.2f, 0.05f, stateTimer); ((TMP_Text)expTotalLabel).alpha = num; ((TMP_Text)expTotalGain).alpha = num; ((TMP_Text)expTotalLabel).transform.localPosition = new Vector3(10f, -140f - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)expTotalGain).transform.localPosition = new Vector3(300f, -140f - Mathf.Lerp(10f, 0f, num)); if (stateTimer <= 0f) { SetState(LevelResultsState.ExpBonusAppear); } } private void StateExpBonusAppear() { //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { if (expBonusIndex >= ExperienceManager.expBonusList.Count) { SetState(LevelResultsState.LevelAppear); return; } CreateNewExpBonusRow(ExperienceManager.expBonusList[expBonusIndex]); LevelResultsUIHelpers.instance.PlayResultPopup(); stateTimer = 0.4f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 5f; } float num = Mathf.InverseLerp(0.4f, 0.25f, stateTimer); ((TMP_Text)currentExpBonusLabel).alpha = num; ((TMP_Text)currentExpBonusAmount).alpha = num; ((TMP_Text)currentExpBonusGain).alpha = num; ((TMP_Text)currentExpBonusLabel).transform.localPosition = new Vector3(10f, (float)CurrentBonusYPos - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)currentExpBonusAmount).transform.localPosition = new Vector3(33f, (float)CurrentBonusYPos - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)currentExpBonusGain).transform.localPosition = new Vector3(300f, (float)CurrentBonusYPos - Mathf.Lerp(10f, 0f, num)); if (stateTimer <= 0f) { SetState(LevelResultsState.ExpBonusCount); } } private void StateExpBonusCount() { ExperienceManager.ExpBonus expBonus = ExperienceManager.expBonusList[expBonusIndex]; if (stateImpulse) { currentLerp = 0f; stateTimer = (stateTimerMax = GetStateTimer(expBonus.type, expBonus.amount)); stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer = 0f; } currentLerp = Mathf.InverseLerp(stateTimerMax, 0f, stateTimer); int amount = Mathf.CeilToInt(Mathf.Lerp(0f, (float)expBonus.amount, currentLerp)); int num = Mathf.CeilToInt(Mathf.Lerp(0f, (float)expBonus.expGained, currentLerp)); ((TMP_Text)currentExpBonusAmount).text = FormatValue(expBonus.type, amount); ((TMP_Text)currentExpBonusGain).text = $"+{num:n0}"; ((TMP_Text)expTotalGain).text = $"+{accumulatedTotal + num:n0}"; float num2 = Mathf.Lerp(1f, 2f, Mathf.InverseLerp(0f, 2f, stateTimerMax)); num2 += Mathf.InverseLerp(3f, 9f, stateTimerMax); LevelResultsUIHelpers.instance.PlayCountLoop(Mathf.Lerp(1f, num2, currentLerp)); if (stateTimer <= 0f) { accumulatedTotal += expBonus.expGained; ((TMP_Text)currentExpBonusAmount).text = FormatValue(expBonus.type, expBonus.amount); ((TMP_Text)currentExpBonusGain).text = $"+{expBonus.expGained:n0}"; ((TMP_Text)expTotalGain).text = $"+{accumulatedTotal:n0}"; if (expBonus.expGained < 100) { LevelResultsUIHelpers.instance.FinishCountUp(); } else if (expBonus.expGained < 500) { LevelResultsUIHelpers.instance.FinishCountUp(2); } else if (expBonus.expGained < 1000) { LevelResultsUIHelpers.instance.FinishCountUp(3); } else { LevelResultsUIHelpers.instance.FinishCountUp(4); } SetState(LevelResultsState.ExpBonusFinish); } } private void StateExpBonusFinish() { //IL_0075: 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) if (stateImpulse) { stateTimer = 0.6f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward && stateTimer <= 0.5f) { stateTimer = 0f; } ((Graphic)currentExpBonusGain).color = (Color)((stateTimer > 0.45f) ? Color.white : new Color(0f, 1f, 1f)); if (stateTimer <= 0f) { expBonusIndex++; if (expBonusIndex >= ExperienceManager.expBonusList.Count) { SetState(LevelResultsState.LevelAppear); } else { SetState(LevelResultsState.ExpBonusAppear); } } } private void StateLevelAppear() { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_026f: 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_028f: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b6: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: 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_02e1: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { CreateLevelObjects(); UpdateExpStuff(ExperienceManager.ssExpStart); LevelResultsUIHelpers.instance.PlayResultPopup(); stateTimer = 0.85f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 10f; } float num = Mathf.InverseLerp(0.85f, 0.65f, stateTimer); ((TMP_Text)expLevel).transform.localPosition = new Vector3(((TMP_Text)expLevel).transform.localPosition.x, -112.5f - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)expLevelLabel).transform.localPosition = new Vector3(((TMP_Text)expLevelLabel).transform.localPosition.x, -112.5f - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)expProgress).transform.localPosition = new Vector3(((TMP_Text)expProgress).transform.localPosition.x, -105f - Mathf.Lerp(10f, 0f, num)); ((Component)expBar).transform.localPosition = new Vector3(((Component)expBar).transform.localPosition.x, -120f - Mathf.Lerp(10f, 0f, num)); ((Component)expBarBackground).transform.localPosition = new Vector3(((Component)expBarBackground).transform.localPosition.x, -120f - Mathf.Lerp(10f, 0f, num)); ((Component)expBarIcon).transform.localPosition = new Vector3(((Component)expBarIcon).transform.localPosition.x, -115f - Mathf.Lerp(10f, 0f, num)); ((TMP_Text)expLevel).alpha = num; ((TMP_Text)expLevelLabel).alpha = num; ((TMP_Text)expProgress).alpha = num; ((Graphic)expBar).color = new Color(((Graphic)expBar).color.r, ((Graphic)expBar).color.g, ((Graphic)expBar).color.b, num); ((Graphic)expBarBackground).color = new Color(((Graphic)expBarBackground).color.r, ((Graphic)expBarBackground).color.g, ((Graphic)expBarBackground).color.b, num * 0.3f); ((Graphic)expBarIcon).color = new Color(((Graphic)expBarIcon).color.r, ((Graphic)expBarIcon).color.g, ((Graphic)expBarIcon).color.b, num); if (stateTimer <= 0f) { SetState(LevelResultsState.LevelCount); } } private void StateLevelCount() { if (stateImpulse) { previousRank = currentLevel.rank; rankedUpThisGo = false; stateTimer = 3.5f; stateImpulse = false; } stateTimer -= Time.deltaTime; if (FastForward) { stateTimer -= Time.deltaTime * 6.7f; } currentLerp = Mathf.InverseLerp(3.5f, 0.5f, stateTimer); int num; if (currentLerp < 1f) { LevelResultsUIHelpers.instance.PlayExpLoop(2f + currentLerp * 2f); ((Component)expBarIcon).transform.Rotate(0f, 0f, -120f * Time.deltaTime); int exp = (int)Mathf.Lerp((float)ExperienceManager.ssExpStart, (float)ExperienceManager.ssExpEnd, currentLerp); num = UpdateExpStuff(exp); } else { LevelResultsUIHelpers.instance.FinishExpLoop(); num = UpdateExpStuff(ExperienceManager.ssExpEnd); } if (num > previousRank) { OnRankUp(!rankedUpThisGo); rankedUpThisGo = true; previousRank = num; } if (stateTimer <= 0f) { SetState(LevelResultsState.LevelFinish); } } private void StateLevelFinish() { if (stateImpulse) { stateTimer = 10f; stateImpulse = false; } stateTimer -= Time.deltaTime; if ((FastForward && stateTimer <= 8f) || stateTimer <= 0f || SemiFunc.InputDown((InputKey)6)) { SetState(LevelResultsState.FadeAllOut); } } private void StateFadeAllOut() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) if (stateImpulse) { stateTimer = 1f; stateImpulse = false; } stateTimer -= Time.deltaTime; foreach (TextMeshProUGUI allText in allTexts) { ((TMP_Text)allText).alpha = Mathf.MoveTowards(((TMP_Text)allText).alpha, 0f, Time.deltaTime * 2f); } foreach (Image allImage in allImages) { ((Graphic)allImage).color = new Color(((Graphic)allImage).color.r, ((Graphic)allImage).color.g, ((Graphic)allImage).color.b, Mathf.MoveTowards(((Graphic)allImage).color.a, 0f, Time.deltaTime * 2f)); } if (stateTimer <= 0f) { if (levelUpCoroutineImage != null) { ((MonoBehaviour)this).StopCoroutine(levelUpCoroutineImage); } if (levelUpCoroutineText != null) { ((MonoBehaviour)this).StopCoroutine(levelUpCoroutineText); } SetState(LevelResultsState.Idle); Finish(); } } private int UpdateExpStuff(int exp) { //IL_005e: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) currentLevel = ExperienceManager.GetLevelFromExp(exp); ((TMP_Text)expLevel).text = currentLevel.rank.ToString(); ((TMP_Text)expProgress).text = ExperienceManager.GetExpProgressString(currentLevel); ((Graphic)expBar).rectTransform.sizeDelta = new Vector2(currentLevel.ProgressPercent * ((Graphic)expBarBackground).rectTransform.sizeDelta.x, ((Graphic)expBar).rectTransform.sizeDelta.y); (Color, Color) rankColor = ExperienceManager.GetRankColor(currentLevel.rank); Color val = (((Graphic)expLevel).color = rankColor.Item1); curRankTextColor = val; val = (((Graphic)expBarIcon).color = rankColor.Item2); curRankIconColor = val; return currentLevel.rank; } private void OnRankUp(bool firstTime) { LevelResultsUIHelpers.instance.PlayRankUp(firstTime); if (firstTime && levelUpCoroutineImage == null) { levelUpCoroutineImage = ((MonoBehaviour)this).StartCoroutine(RankUpImageAnim()); } if (levelUpCoroutineText != null) { ((MonoBehaviour)this).StopCoroutine(levelUpCoroutineText); } levelUpCoroutineText = ((MonoBehaviour)this).StartCoroutine(RankUpTextAnim()); } private IEnumerator RankUpImageAnim() { float time = 0f; while (true) { time += Time.deltaTime; float num = Mathf.InverseLerp(0f, 0.23f, time); ((Graphic)expBarIcon).rectTransform.sizeDelta = new Vector2(50f + 50f * num, 50f + 50f * num); ((Graphic)expBarIcon).color = Color.Lerp(new Color(curRankIconColor.r, curRankIconColor.g, curRankIconColor.b, ((Graphic)expBarIcon).color.a), new Color(0f, 1f, 1f, ((Graphic)expBarIcon).color.a), num); float num2 = 720f * Mathf.InverseLerp(3.5f, 0.5f, time); ((Component)expBarIcon).transform.Rotate(0f, 0f, (0f - num2) * Time.deltaTime); yield return null; } } private IEnumerator RankUpTextAnim() { float time = 0f; while (true) { time += Time.deltaTime; float fontSize = Mathf.Lerp(56f, 28f, Mathf.InverseLerp(0f, 0.2f, time)); float num = Mathf.InverseLerp(2f, 3f, time); ((TMP_Text)expLevel).fontSize = fontSize; ((Graphic)expLevel).color = Color.Lerp(new Color(0f, 1f, 0f, ((Graphic)expLevel).color.a), new Color(curRankTextColor.r, curRankTextColor.g, curRankTextColor.b, ((Graphic)expLevel).color.a), num); yield return null; } } } internal class LevelStatsManager { public static bool firstExtractionOpenedThisLevel = false; public static bool _syncedTimer = false; public static bool _shouldSyncTimerEndOfLevel = 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; public static int challengesJustCompleted = 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 int LevelNumber => Helpers.CurrentLevel; public static void OnNewLevel(bool resetAllStats = true) { PlayerHealthPatch.healthRegenCap = -1; ItemValuableBoxPatch.absorbingObjects.Clear(); firstExtractionOpenedThisLevel = false; _syncedTimer = false; if (resetAllStats) { challengesJustCompleted = 0; } ExperienceManager.SnapshotLevelAndAwardExp(!resetAllStats); if (resetAllStats) { Helpers.DeepLog("resetting all level stats"); thisLevelTime = 0f; _lastLevelTimeSync = 0f; enemyKills = 0; enemyKillsRaw = 0; playerDeaths = 0; totalValueExtracted = 0f; totalValueBroken = 0f; 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() && firstExtractionOpenedThisLevel) { if (!Helpers.TruckStarting) { MalfunctionManager.Solitude_HandleTimer(); thisLevelTime += Time.deltaTime; _shouldSyncTimerEndOfLevel = true; if (Mathf.Abs(thisLevelTime - _lastLevelTimeSync) > 10f) { SyncTimer(); } } else if (Helpers.TruckStarting && _shouldSyncTimerEndOfLevel) { _shouldSyncTimerEndOfLevel = false; SyncTimer(); } } if (!SemiFunc.RunIsShop() && LevelGenerator.Instance.Generated) { if ((Object)(object)RoundDirector.instance == (Object)null) { totalMapValue = 0; return; } totalMapValue = (int)_clientTotalMapValue; totalMapValue -= _valueFromSurplus; } } public static void SyncTimer() { if (Plugin.compatibilityMode <= Plugin.CompatibilityMode.Host || !SemiFunc.RunIsLevel() || !GameManager.Multiplayer() || !SemiFunc.IsMasterClient()) { return; } _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 }); } } } 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() { if (SemiFunc.RunIsLevel()) { 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.8f; } } } internal class LevelStatsSyncing : MonoBehaviour { public static LevelStatsSyncing instance; public PhotonView photonView; public Dictionary playerRanks = new Dictionary(); private void Start() { ((Object)this).name = "Level Scaling Stats Syncing"; if (Plugin.compatibilityMode > Plugin.CompatibilityMode.Host) { photonView = ((Component)this).gameObject.AddComponent(); photonView.ViewID = 862696255; if ((Object)(object)instance != (Object)null) { Object.Destroy((Object)(object)((Component)instance).gameObject); } instance = this; Helpers.DeepLog("Setup syncing."); } } public void UpdateRanksInGame(WorldSpaceUIPlayerName nametag) { if (Object.op_Implicit((Object)(object)nametag.playerAvatar) && playerRanks.ContainsKey(nametag.playerAvatar)) { string rankPrefixString = ExperienceManager.GetRankPrefixString(playerRanks[nametag.playerAvatar]); string text = Regex.Replace(nametag.playerAvatar.playerName, "<.*?>", ""); ((TMP_Text)nametag.text).richText = true; ((TMP_Text)nametag.text).text = rankPrefixString + " " + text; } } public void UpdateRanksInLobby(MenuPageLobby lobbyPage) { foreach (GameObject listObject in lobbyPage.listObjects) { MenuPlayerListed component = listObject.GetComponent(); PlayerAvatar val = component?.playerAvatar; if (!((Object)(object)val == (Object)null) && playerRanks.ContainsKey(val)) { string rankPrefixString = ExperienceManager.GetRankPrefixString(playerRanks[val]); string text = Regex.Replace(val.playerName, "<.*?>", ""); ((TMP_Text)component.playerName).richText = true; ((TMP_Text)component.playerName).text = rankPrefixString + " " + text; } } } public void UpdateRanksInPauseMenu(MenuPageEsc escPage) { if (escPage.playerMicGainSliders.Count == 0) { return; } foreach (KeyValuePair playerMicGainSlider in escPage.playerMicGainSliders) { if (Object.op_Implicit((Object)(object)playerMicGainSlider.Value) && Object.op_Implicit((Object)(object)playerMicGainSlider.Value.menuSlider) && Object.op_Implicit((Object)(object)playerMicGainSlider.Value.menuSlider.elementNameText) && Object.op_Implicit((Object)(object)playerMicGainSlider.Key) && playerRanks.ContainsKey(playerMicGainSlider.Key)) { string rankPrefixString = ExperienceManager.GetRankPrefixString(playerRanks[playerMicGainSlider.Key]); string text = Regex.Replace(playerMicGainSlider.Key.playerName, "<.*?>", ""); ((TMP_Text)playerMicGainSlider.Value.menuSlider.elementNameText).richText = true; ((TMP_Text)playerMicGainSlider.Value.menuSlider.elementNameText).text = rankPrefixString + " " + text; } } } [PunRPC] public void SyncExperienceRPC(string steamId, int experience) { PlayerAvatar key = SemiFunc.PlayerAvatarGetFromSteamID(steamId); ExperienceManager.Level levelFromExp = ExperienceManager.GetLevelFromExp(experience); Helpers.DeepLog($"received exp sync from id {steamId} - {experience:n0} (RANK {levelFromExp.rank})"); if (!playerRanks.ContainsKey(key)) { playerRanks.Add(key, levelFromExp); } else { playerRanks[key] = levelFromExp; } } [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()) { LevelStatsManager.thisLevelTime = time; } } } [PunRPC] public void SyncChallengeRPC(int[] challenges, 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 - {challenges.Length}"); List list = new List(); foreach (int item in challenges) { list.Add((ChallengeManager.ChallengeType)item); } ChallengeManager.SetupChallenges(list); } } [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, 1f); private static Plugin.StatsUIShowOptions ShowBase => Plugin.StatsUIShow_Base.Value; private static Plugin.StatsUIShowOptions 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_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: 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_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01ec: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0216: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) 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; ((TMP_Text)statsHeader).alignment = (TextAlignmentOptions)2050; 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); Transform transform3 = ((TMP_Text)statsHeader).transform; transform3.localPosition -= new Vector3(60f, 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 = $"LEVEL {Helpers.CurrentLevel - 1} RESULTS"; } 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; flashTimer_cosmetic -= Time.deltaTime; ScootLogic(); SetText(); } private void ScootLogic() { //IL_00e2: Unknown result type (might be due to invalid IL or missing references) dontScoot = false; switch (MapToolControllerPatch.mapToolActive ? ShowMap : ShowBase) { case Plugin.StatsUIShowOptions.OnlyInLevel: dontScoot = SemiFunc.RunIsLevel(); break; case Plugin.StatsUIShowOptions.OnlyInShop: dontScoot = SemiFunc.RunIsShop() && RunManagerPatch.levelWasCompleted; break; case Plugin.StatsUIShowOptions.LevelAndShop: dontScoot = SemiFunc.RunIsLevel() || (SemiFunc.RunIsShop() && RunManagerPatch.levelWasCompleted); break; } if (Helpers.TruckLeaving && ShowEnd) { dontScoot = true; } if (hideTime > 0f) { dontScoot = false; 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_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0251: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_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_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_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_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_02cc: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02d6: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_0300: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0276: 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_0282: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Unknown result type (might be due to invalid IL or missing references) //IL_028c: 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_03de: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03e8: Unknown result type (might be due to invalid IL or missing references) //IL_03ed: Unknown result type (might be due to invalid IL or missing references) //IL_0412: Unknown result type (might be due to invalid IL or missing references) //IL_0416: Unknown result type (might be due to invalid IL or missing references) //IL_035b: Unknown result type (might be due to invalid IL or missing references) //IL_0360: Unknown result type (might be due to invalid IL or missing references) //IL_0365: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: 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_0392: 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(bypassLevelCheck: true)) { MalfunctionManager.Malfunction malfunction = MalfunctionManager.GetMalfunction(MalfunctionManager.activeMalfunction); AddBasicLine("MALFUNCTION", "", malfunction.name, new Color(0.5f, 0f, 1f)); } if (ShouldDisplay(Plugin.StatsUIDisplay_Challenge) && ChallengeManager.IsChallengeActive()) { string label = ((ChallengeManager.currentChallenges.Count == 1) ? "CHALLENGE" : "CHALLENGES"); foreach (ChallengeManager.ChallengeType currentChallenge in ChallengeManager.currentChallenges) { ChallengeManager.Challenge challenge = ChallengeManager.GetChallenge(currentChallenge); AddBasicLine(label, "", challenge.name, Color.red); label = ""; } } if (ShouldDisplay(Plugin.StatsUIDisplay_Time)) { Color valueColor = (Helpers.TruckStarting ? colorGood : (LevelStatsManager.firstExtractionOpenedThisLevel ? colorBase : colorNone)); if (SemiFunc.RunIsShop()) { valueColor = colorGood; } 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); ES3.Save("challengeSeed", ChallengeManager.CurrentSeed, val); ES3.Save("challengeLastLevel", ChallengeManager.LastChallengeLevel, val); ES3.Save("challengeLastType", ChallengeManager.LastChallengeType, val); ES3.Save("malfunction", (int)MalfunctionManager.activeMalfunction, val); Plugin.loggy.LogDebug((object)("Saved to " + val.path + ".")); } } } public static void LoadRunStats(string fileName, bool backwardCompatibility = false) { //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); Plugin.loggy.LogDebug((object)("Loaded from " + val.path + ".")); instance = ES3.Load("runStats", text, new RunStatsManager(), val); if (!backwardCompatibility) { ChallengeManager.CurrentSeed = ES3.Load("challengeSeed", text, Random.Range(0, 100000000), val); ChallengeManager.LastChallengeLevel = ES3.Load("challengeLastLevel", text, -1, val); ChallengeManager.LastChallengeType = ES3.Load("challengeLastType", text, -1, val); MalfunctionManager.SetMalfunction((MalfunctionManager.MalfunctionType)ES3.Load("malfunction", text, 0, val)); } } public static void Reset() { instance = new RunStatsManager(); } } }