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.Versioning; using System.Text; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Mono.Cecil.Cil; using MonoMod.Cil; using MonoMod.RuntimeDetour; using Newtonsoft.Json; using Photon.Pun; using Photon.Realtime; using REPOConomyMod; using REPOConomyMod.Config; using REPOConomyMod.Menu; using REPOConomyMod.Stats; using REPOConomyPlus; using TMPro; using UnityEngine; using UnityEngine.AI; using UnityEngine.Events; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyCompany("REPOConomyPlus")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("REPOConomyPlus")] [assembly: AssemblyTitle("REPOConomyPlus")] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace REPOConomyPlus { public static class LevelScalingImprovements { [HarmonyPatch(/*Could not decode attribute arguments.*/)] public static class Patch_LevelGenerator_TileGeneration_Transpiler { private static IEnumerable Transpiler(IEnumerable instructions) { //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020d: 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_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0250: Expected O, but got Unknown //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Expected O, but got Unknown //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Expected O, but got Unknown List list = new List(instructions); if (list.Count <= 20) { REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Less than 20 instructions found - cannot patch!"); return list; } int num = -1; int num2 = -1; for (int i = 3; i < list.Count - 1; i++) { if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "ModuleAmount" && i + 1 < list.Count && list[i + 1].opcode == OpCodes.Ldc_I4_3) { num = i - 3; REPOConomyPlugin.Logger.LogInfo((object)$"[Transpiler] Found ModuleAmount insert point at index {num}"); break; } } for (int j = 1; j < list.Count - 4; j++) { if (list[j].opcode == OpCodes.Ldarg_0 && j + 1 < list.Count && list[j + 1].opcode == OpCodes.Ldc_I4_M1 && j + 4 < list.Count && list[j + 4].opcode == OpCodes.Ldfld && list[j + 4].operand is FieldInfo fieldInfo2 && fieldInfo2.Name == "ExtractionAmount") { num2 = j - 1; REPOConomyPlugin.Logger.LogInfo((object)$"[Transpiler] Found ExtractionAmount insert point at index {num2}"); break; } } if (num == -1) { REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Failed to find ModuleAmount insertion point!"); return list; } if (num2 == -1) { REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Failed to find ExtractionAmount insertion point!"); return list; } List list2 = new List { new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelScalingImprovements), "GetNewModuleCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ModuleAmount")) }; list.InsertRange(num, list2); List collection = new List { new CodeInstruction(OpCodes.Ldloc_1, (object)null), new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelScalingImprovements), "GetNewExtractionCount", (Type[])null, (Type[])null)), new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ExtractionAmount")) }; list.InsertRange(num2 + list2.Count, collection); REPOConomyPlugin.Logger.LogInfo((object)"[Transpiler] Successfully patched TileGeneration!"); return list; } } private static int GetVanillaModuleAmount(int levelsCompleted) { int num = Mathf.Min(5 + levelsCompleted, 10); if (levelsCompleted >= 10) { num += Mathf.Min(levelsCompleted - 9, 5); } return num; } private static int GetVanillaExtractionAmount(int levelsCompleted) { int vanillaModuleAmount = GetVanillaModuleAmount(levelsCompleted); if (vanillaModuleAmount >= 15) { return 4; } if (vanillaModuleAmount >= 10) { return 3; } if (vanillaModuleAmount >= 8) { return 2; } if (vanillaModuleAmount >= 6) { return 1; } return 0; } public static int GetScaledModuleAmount(int levelsCompleted) { if (!REPOConfig.EnableLevelScaling.Value) { return GetVanillaModuleAmount(levelsCompleted); } int num = Mathf.Min(levelsCompleted, REPOConfig.LevelScalingMaxModulesLevel.Value); int value = REPOConfig.LevelScalingModulesInterval.Value; float num2 = REPOConfig.LevelScalingModulesPerInterval.Value; if (REPOConfig.EnableMultiplicativeScaling.Value) { int num3 = Mathf.FloorToInt((float)(num + 1) / (float)value); int num4 = 0; for (int i = 0; i < num3; i++) { num4 += (int)Mathf.Pow(num2, (float)i); } return REPOConfig.LevelScalingMinModules.Value + num4; } return REPOConfig.LevelScalingMinModules.Value + Mathf.FloorToInt((float)(num + 1) / (float)value) * (int)num2; } public static int GetScaledExtractionAmount(int levelsCompleted) { if (!REPOConfig.EnableLevelScaling.Value) { return GetVanillaExtractionAmount(levelsCompleted); } int value = REPOConfig.LevelScalingExtractionsInterval.Value; int value2 = REPOConfig.LevelScalingExtractionsPerInterval.Value; if (REPOConfig.EnableMultiplicativeScaling.Value) { int num = (levelsCompleted + 1) / value; int num2 = 0; for (int i = 0; i < num; i++) { num2 += (int)Mathf.Pow((float)value2, (float)i); } return Mathf.Min(REPOConfig.LevelScalingBaseExtractions.Value + num2, REPOConfig.LevelScalingMaxExtractions.Value); } return Mathf.Min(REPOConfig.LevelScalingBaseExtractions.Value + (levelsCompleted + 1) / value * value2, REPOConfig.LevelScalingMaxExtractions.Value); } public static float GetScaledHaulMultiplier(int levelsCompleted) { if (!REPOConfig.EnableLevelScaling.Value) { return 0.7f; } int num = Mathf.Min(levelsCompleted, REPOConfig.LevelScalingMaxHaulLevel.Value); if (REPOConfig.EnableMultiplicativeScaling.Value) { return Mathf.Min(REPOConfig.LevelScalingBaseHaulMultiplier.Value * Mathf.Pow(1f + REPOConfig.LevelScalingHaulIncreasePerLevel.Value, (float)num), REPOConfig.LevelScalingMaxHaulMultiplier.Value); } return Mathf.Min(REPOConfig.LevelScalingBaseHaulMultiplier.Value + (float)num * REPOConfig.LevelScalingHaulIncreasePerLevel.Value, REPOConfig.LevelScalingMaxHaulMultiplier.Value); } private static int GetNewModuleCount() { if ((Object)(object)RunManager.instance == (Object)null) { return 6; } if (SemiFunc.RunIsArena() || SemiFunc.RunIsShop() || SemiFunc.MenuLevel() || SemiFunc.RunIsLobby()) { return 6; } int levelsCompleted = RunManager.instance.levelsCompleted; int num = GetScaledModuleAmount(levelsCompleted); if (REPOEventManager.CrampedFacility) { num = Mathf.Min(num + 4, 25); } if (REPOEventManager.SpaciousFacility) { num = Mathf.Max(num - 3, 2); } REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] New ModuleCount: {num} for level {levelsCompleted + 1}"); return num; } private static int GetNewExtractionCount() { if ((Object)(object)RunManager.instance == (Object)null) { return 1; } if (SemiFunc.RunIsArena() || SemiFunc.RunIsShop() || SemiFunc.MenuLevel() || SemiFunc.RunIsLobby()) { return 0; } int levelsCompleted = RunManager.instance.levelsCompleted; int num = GetScaledExtractionAmount(levelsCompleted); if (REPOEventManager.ManyExtractions) { num = 9; } REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] New ExtractionCount: {num} for level {levelsCompleted + 1}"); return num; } } [HarmonyPatch(typeof(RoundDirector), "StartRoundLogic")] public static class Patch_RoundDirector_StartRoundLogic { public static bool IsHaulScaled; private static void Prefix(RoundDirector __instance, ref int value) { if (SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)RunManager.instance == (Object)null) && !((Object)(object)__instance == (Object)null) && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.MenuLevel() && !SemiFunc.RunIsLobby()) { if (IsHaulScaled) { REPOConomyPlugin.Logger.LogInfo((object)"[LevelScaling] Haul already scaled, skipping double apply."); } else if (REPOConfig.EnableLevelScaling.Value) { float scaledHaulMultiplier = LevelScalingImprovements.GetScaledHaulMultiplier(RunManager.instance.levelsCompleted); float num = value; value = Mathf.RoundToInt(num * (scaledHaulMultiplier / 0.7f)); IsHaulScaled = true; REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] Haul goal scaled: {value} (original: {num}, multiplier: {scaledHaulMultiplier:F2})"); } } } } } namespace REPOConomyMod { public sealed class ChallengeDefinition { public string id; public string name; public string description; public REPOConomyPlugin.EconomyType economy; public REPOConomyPlugin.EconomyType rewardEconomy; public string rewardModifierId; public ShopEconomyType rewardShopEconomy; public string shopEconomy; public string[] modifierIds; public Color color; } public static class ChallengeManager { private sealed class ChallengeSaveMeta { public string challengeId; public int targetLevel; public string challengeName; } [CompilerGenerated] private sealed class d__52 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Color popupColor; public string popupBody; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__52(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(3.5f); <>1__state = 1; return true; case 1: <>1__state = -1; try { if ((Object)(object)RunManager.instance == (Object)null) { return false; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return false; } if ((Object)(object)StatsManager.instance != (Object)null) { FieldInfo fieldInfo = AccessTools.Field(typeof(StatsManager), "saveFileCurrent"); string text = fieldInfo?.GetValue(StatsManager.instance) as string; if (!string.IsNullOrWhiteSpace(text)) { StatsManager.instance.SaveFileDelete(text); fieldInfo?.SetValue(StatsManager.instance, string.Empty); } } RunManager.instance.ResetProgress(); RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)4); } catch (Exception ex2) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to return to main menu: " + ex2.Message)); return false; } 5__2 = 0; goto IL_0159; case 2: <>1__state = -1; 5__2++; goto IL_0159; case 3: { <>1__state = -1; try { if ((Object)(object)MenuManager.instance != (Object)null) { MenuManager.instance.PagePopUp("Challenge Complete", popupColor, popupBody, "OK", false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to show completion popup: " + ex.Message)); } return false; } IL_0159: if (5__2 < 120 && (!((Object)(object)MenuManager.instance != (Object)null) || !MenuManager.instance.PageCheck((MenuPageIndex)0))) { <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 2; return true; } <>2__current = (object)new WaitForSecondsRealtime(0.35f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool activeChallengeProgressBlocked; private const string ChallengeSaveNamePrefix = "Challenge - "; public static readonly int[] Targets = new int[3] { 10, 25, 50 }; public static readonly ChallengeDefinition[] Challenges = new ChallengeDefinition[7] { new ChallengeDefinition { id = "glass_bank", name = "Glass Bank", description = "High value, fragile loot, and explosive mistakes.", economy = REPOConomyPlugin.EconomyType.GoldenHour, rewardEconomy = REPOConomyPlugin.EconomyType.GlassBankDividend, rewardModifierId = "glass_dividend", rewardShopEconomy = ShopEconomyType.CollectorsVaultSale, shopEconomy = "LuxuryTax", modifierIds = new string[3] { "value_lottery", "valuables_fragile", "explosive_valuables" }, color = new Color(1f, 0.78f, 0.22f) }, new ChallengeDefinition { id = "pit_contract", name = "Pit Contract", description = "Enemies survive pits while extraction becomes messy.", economy = REPOConomyPlugin.EconomyType.BlackMarketSurge, rewardEconomy = REPOConomyPlugin.EconomyType.PitContractInsurance, rewardModifierId = "pit_insurance", rewardShopEconomy = ShopEconomyType.HazardPayMarket, shopEconomy = "SupplyShortage", modifierIds = new string[3] { "pit_immunity", "single_extraction", "heavy_burden" }, color = new Color(0.7f, 0.45f, 1f) }, new ChallengeDefinition { id = "storm_runner", name = "Storm Runner", description = "Fast bodies, unstable movement, constant pressure.", economy = REPOConomyPlugin.EconomyType.Turbulence, rewardEconomy = REPOConomyPlugin.EconomyType.StormRunnerSurge, rewardModifierId = "storm_surge", rewardShopEconomy = ShopEconomyType.AdrenalineClearance, shopEconomy = "EnergySurcharge", modifierIds = new string[3] { "speed_demons", "explosive_tumble", "slippery_hands" }, color = new Color(0.25f, 0.9f, 1f) }, new ChallengeDefinition { id = "silent_debt", name = "Silent Debt", description = "Darkness, quiet danger, and punishing market swings.", economy = REPOConomyPlugin.EconomyType.MarketEclipse, rewardEconomy = REPOConomyPlugin.EconomyType.SilentDebtEclipse, rewardModifierId = "debt_silence", rewardShopEconomy = ShopEconomyType.BlackoutWholesale, shopEconomy = "BlackoutTariff", modifierIds = new string[3] { "total_darkness", "too_quiet", "player_deaf" }, color = new Color(0.35f, 0.36f, 0.46f) }, new ChallengeDefinition { id = "clone_lottery", name = "Clone Lottery", description = "Enemies return, values swing, and greed gets loud.", economy = REPOConomyPlugin.EconomyType.JackpotMirage, rewardEconomy = REPOConomyPlugin.EconomyType.CloneLotteryJackpot, rewardModifierId = "lucky_echoes", rewardShopEconomy = ShopEconomyType.DuplicateDiscount, shopEconomy = "GamblersDream", modifierIds = new string[3] { "shadow_clones", "value_lottery", "found_map" }, color = new Color(0.35f, 1f, 0.55f) }, new ChallengeDefinition { id = "magnet_shift", name = "Magnet Shift", description = "Moving loot, strange physics, and cart pressure.", economy = REPOConomyPlugin.EconomyType.ValueVortex, rewardEconomy = REPOConomyPlugin.EconomyType.MagnetShiftVortex, rewardModifierId = "magnetic_margin", rewardShopEconomy = ShopEconomyType.PolarizedPricing, shopEconomy = "SplitMarket", modifierIds = new string[3] { "magnetic_valuables", "runaway_valuables", "scale_in_cart" }, color = new Color(0.95f, 0.35f, 0.85f) }, new ChallengeDefinition { id = "last_invoice", name = "Last Invoice", description = "A brutal final mix of damage, explosions, and bad prices.", economy = REPOConomyPlugin.EconomyType.MarketKraken, rewardEconomy = REPOConomyPlugin.EconomyType.LastInvoiceJudgement, rewardModifierId = "final_notice", rewardShopEconomy = ShopEconomyType.JudgementLiquidation, shopEconomy = "HyperInflation", modifierIds = new string[3] { "kamikaze_enemies", "double_enemy_damage", "shared_pain" }, color = new Color(1f, 0.25f, 0.18f) } }; public static bool HasActiveChallenge { get { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager != (Object)null) { return !string.IsNullOrWhiteSpace(rEPOStatsManager.stats.activeChallengeId); } return false; } } public static ChallengeDefinition ActiveChallenge { get { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null) { return null; } return GetChallenge(rEPOStatsManager.stats.activeChallengeId); } } public static int ActiveTarget { get { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if (!((Object)(object)rEPOStatsManager != (Object)null)) { return 0; } return rEPOStatsManager.stats.activeChallengeTarget; } } public static bool ActiveChallengeProgressBlocked { get { if (HasActiveChallenge) { return activeChallengeProgressBlocked; } return false; } } public static ChallengeDefinition GetChallenge(string id) { if (string.IsNullOrWhiteSpace(id)) { return null; } return Challenges.FirstOrDefault((ChallengeDefinition c) => string.Equals(c.id, id, StringComparison.OrdinalIgnoreCase)); } public static int GetCompletedTierCount(string challengeId) { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null || string.IsNullOrWhiteSpace(challengeId)) { return 0; } if (!rEPOStatsManager.stats.challengeCompletedTiers.TryGetValue(challengeId, out var value)) { return 0; } return Mathf.Clamp(value, 0, Targets.Length); } public static int GetTotalCompletedTiers() { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null) { return 0; } return rEPOStatsManager.stats.challengeCompletedTiers.Values.Sum((int v) => Mathf.Clamp(v, 0, Targets.Length)); } public static int GetFullyCompletedChallenges() { return Challenges.Count((ChallengeDefinition c) => GetCompletedTierCount(c.id) >= Targets.Length); } public static bool AreAllChallengesCompleted() { return GetFullyCompletedChallenges() >= Challenges.Length; } public static bool IsChallengeRewardEconomy(REPOConomyPlugin.EconomyType economy) { return Challenges.Any((ChallengeDefinition c) => c.rewardEconomy == economy); } public static bool IsRewardEconomyUnlocked(REPOConomyPlugin.EconomyType economy) { ChallengeDefinition challengeDefinition = Challenges.FirstOrDefault((ChallengeDefinition c) => c.rewardEconomy == economy); if (challengeDefinition != null) { return GetCompletedTierCount(challengeDefinition.id) >= Targets.Length; } return false; } public static bool IsChallengeRewardModifier(string modifierId) { return Challenges.Any((ChallengeDefinition c) => string.Equals(c.rewardModifierId, modifierId, StringComparison.OrdinalIgnoreCase)); } public static bool IsRewardModifierUnlocked(string modifierId) { ChallengeDefinition challengeDefinition = Challenges.FirstOrDefault((ChallengeDefinition c) => string.Equals(c.rewardModifierId, modifierId, StringComparison.OrdinalIgnoreCase)); if (challengeDefinition != null) { return GetCompletedTierCount(challengeDefinition.id) >= Targets.Length; } return false; } public static bool IsChallengeRewardShopEconomy(ShopEconomyType shopEconomy) { return Challenges.Any((ChallengeDefinition c) => c.rewardShopEconomy == shopEconomy); } public static bool IsRewardShopEconomyUnlocked(ShopEconomyType shopEconomy) { ChallengeDefinition challengeDefinition = Challenges.FirstOrDefault((ChallengeDefinition c) => c.rewardShopEconomy == shopEconomy); if (challengeDefinition != null) { return GetCompletedTierCount(challengeDefinition.id) >= Targets.Length; } return false; } public static bool IsRewardPackUnlocked(ChallengeDefinition challenge) { if (challenge != null) { return GetCompletedTierCount(challenge.id) >= Targets.Length; } return false; } public static string GetRewardSummary(ChallengeDefinition challenge) { if (challenge == null) { return string.Empty; } return $"{challenge.rewardModifierId} (Modifier), {challenge.rewardEconomy} (Economy), {challenge.rewardShopEconomy} (Shop)"; } public static void StartChallenge(string challengeId, int targetLevel) { ChallengeDefinition challenge = GetChallenge(challengeId); if (challenge != null) { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if (!((Object)(object)rEPOStatsManager == (Object)null)) { rEPOStatsManager.stats.activeChallengeId = challenge.id; rEPOStatsManager.stats.activeChallengeTarget = Mathf.Clamp(targetLevel, Targets[0], Targets[Targets.Length - 1]); rEPOStatsManager.stats.activeChallengeRunStarted = false; rEPOStatsManager.stats.activeChallengeRunSaveKey = string.Empty; activeChallengeProgressBlocked = false; rEPOStatsManager.SaveStats(); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Started {challenge.id} target {rEPOStatsManager.stats.activeChallengeTarget}"); REPOConomyNetworkHandler.SyncBlackMarketToClients(); } } } public static void ClearActiveChallenge() { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if (!((Object)(object)rEPOStatsManager == (Object)null)) { rEPOStatsManager.stats.activeChallengeId = string.Empty; rEPOStatsManager.stats.activeChallengeTarget = 0; rEPOStatsManager.stats.activeChallengeRunStarted = false; rEPOStatsManager.stats.activeChallengeRunSaveKey = string.Empty; activeChallengeProgressBlocked = false; rEPOStatsManager.SaveStats(); REPOConomyNetworkHandler.SyncBlackMarketToClients(); } } public static void OnLevelStarted(int currentLevel) { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null) { return; } ChallengeDefinition activeChallenge = ActiveChallenge; int activeTarget = ActiveTarget; if (activeChallenge == null || activeTarget <= 0) { return; } REPOConomyNetworkHandler.SyncBlackMarketToClients(); string currentSaveKeyForChallenge = REPOBlackMarketManager.GetCurrentSaveKeyForChallenge(); bool flag = !string.IsNullOrWhiteSpace(rEPOStatsManager.stats.activeChallengeRunSaveKey) && string.Equals(rEPOStatsManager.stats.activeChallengeRunSaveKey, currentSaveKeyForChallenge, StringComparison.OrdinalIgnoreCase); if (!rEPOStatsManager.stats.activeChallengeRunStarted || !flag) { if (currentLevel > 1) { ChallengeSaveMeta challengeSaveMeta = LoadChallengeSaveMeta(currentSaveKeyForChallenge); if (challengeSaveMeta == null || !string.Equals(challengeSaveMeta.challengeId, activeChallenge.id, StringComparison.OrdinalIgnoreCase) || challengeSaveMeta.targetLevel != activeTarget) { activeChallengeProgressBlocked = true; REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] {activeChallenge.id} is waiting for a fresh run before progress can count. Current level: {currentLevel}, save: {currentSaveKeyForChallenge}"); REPOConomyNetworkHandler.SyncBlackMarketToClients(); return; } activeChallengeProgressBlocked = false; rEPOStatsManager.stats.activeChallengeRunStarted = true; rEPOStatsManager.stats.activeChallengeRunSaveKey = currentSaveKeyForChallenge; rEPOStatsManager.SaveStats(); EnforceCurrentChallengeSaveName(activeChallenge); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Continuing marked challenge save {currentSaveKeyForChallenge} for {activeChallenge.id} target {activeTarget}"); REPOConomyNetworkHandler.SyncBlackMarketToClients(); } else { activeChallengeProgressBlocked = false; rEPOStatsManager.stats.activeChallengeRunStarted = true; rEPOStatsManager.stats.activeChallengeRunSaveKey = currentSaveKeyForChallenge; MarkCurrentSaveForChallenge(activeChallenge, rEPOStatsManager.stats.activeChallengeTarget); rEPOStatsManager.SaveStats(); } } else if (activeChallengeProgressBlocked) { activeChallengeProgressBlocked = false; EnforceCurrentChallengeSaveName(activeChallenge); REPOConomyNetworkHandler.SyncBlackMarketToClients(); } else { EnforceCurrentChallengeSaveName(activeChallenge); } if (currentLevel < activeTarget) { return; } int num = Array.IndexOf(Targets, activeTarget) + 1; if (num > 0) { int completedTierCount = GetCompletedTierCount(activeChallenge.id); if (num > completedTierCount + 1) { REPOConomyPlugin.Logger.LogWarning((object)$"[Challenges] Ignored out-of-order completion for {activeChallenge.id}: tier {num}, previous {completedTierCount}"); } else if (num > completedTierCount) { rEPOStatsManager.stats.challengeCompletedTiers[activeChallenge.id] = num; rEPOStatsManager.stats.totalChallengeTierCompletions++; rEPOStatsManager.stats.activeChallengeId = string.Empty; rEPOStatsManager.stats.activeChallengeTarget = 0; rEPOStatsManager.stats.activeChallengeRunStarted = false; rEPOStatsManager.stats.activeChallengeRunSaveKey = string.Empty; activeChallengeProgressBlocked = false; DeleteChallengeSaveMeta(REPOBlackMarketManager.GetCurrentSaveKeyForChallenge()); rEPOStatsManager.SaveStats(); REPOConomyNetworkHandler.SyncBlackMarketToClients(); REPOConomyNetworkHandler.SyncChallengeCompletionToClients(activeChallenge.id, num); ShowCompletionMessage(activeChallenge, num); TryAnnounceChallengeReward(activeChallenge, num); ShowCompletionPopupAndReturnToMainMenu(activeChallenge, num); } } } public static void ApplySyncedCompletion(string challengeId, int completedTier) { ChallengeDefinition challenge = GetChallenge(challengeId); if (challenge == null) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Ignored synced unknown challenge: " + challengeId)); return; } completedTier = Mathf.Clamp(completedTier, 1, Targets.Length); REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null) { return; } int completedTierCount = GetCompletedTierCount(challenge.id); if (completedTier > completedTierCount) { rEPOStatsManager.stats.challengeCompletedTiers[challenge.id] = completedTier; rEPOStatsManager.stats.totalChallengeTierCompletions += completedTier - completedTierCount; if (string.Equals(rEPOStatsManager.stats.activeChallengeId, challenge.id, StringComparison.OrdinalIgnoreCase)) { rEPOStatsManager.stats.activeChallengeId = string.Empty; rEPOStatsManager.stats.activeChallengeTarget = 0; rEPOStatsManager.stats.activeChallengeRunStarted = false; rEPOStatsManager.stats.activeChallengeRunSaveKey = string.Empty; activeChallengeProgressBlocked = false; } rEPOStatsManager.SaveStats(); REPOConomyNetworkHandler.SyncBlackMarketToClients(); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Applied synced completion: {challenge.id} tier {completedTier}"); ShowCompletionMessage(challenge, completedTier); TryAnnounceChallengeReward(challenge, completedTier); } } public static bool CanLoadSaveFromMenu(string saveFileName, out string title, out string message) { title = string.Empty; message = string.Empty; ChallengeSaveMeta challengeSaveMeta = LoadChallengeSaveMeta(SanitizeSaveKey(saveFileName)); ChallengeDefinition activeChallenge = ActiveChallenge; if (challengeSaveMeta == null) { if (activeChallenge != null && ActiveTarget > 0) { title = "Challenge Save Required"; message = "This save was not started with the active challenge.\n\nProgress will not count here.\nCreate a new save for this challenge, or disable the challenge before loading this save."; return false; } return true; } ChallengeDefinition challenge = GetChallenge(challengeSaveMeta.challengeId); if (activeChallenge != null && string.Equals(activeChallenge.id, challengeSaveMeta.challengeId, StringComparison.OrdinalIgnoreCase) && ActiveTarget == challengeSaveMeta.targetLevel) { return true; } string arg = challenge?.name ?? challengeSaveMeta.challengeName ?? challengeSaveMeta.challengeId; title = "Challenge Save"; message = $"This save was started with challenge:\n{arg} to level {challengeSaveMeta.targetLevel}\n\nEnable this exact challenge to continue this save."; return false; } public static void OnVanillaSaveCreated(string saveFileName) { ChallengeDefinition activeChallenge = ActiveChallenge; int activeTarget = ActiveTarget; if (activeChallenge != null && activeTarget > 0 && !string.IsNullOrWhiteSpace(saveFileName)) { SaveChallengeSaveMeta(SanitizeSaveKey(saveFileName), activeChallenge, activeTarget); SetRuntimeTeamName(BuildChallengeSaveName(activeChallenge, null)); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Marked new save '{saveFileName}' for {activeChallenge.id} target {activeTarget}"); } } public static void BeforeVanillaSaveFileSave() { ChallengeDefinition activeChallenge = ActiveChallenge; if (activeChallenge == null) { return; } string currentRawSaveName = GetCurrentRawSaveName(); if (!string.IsNullOrWhiteSpace(currentRawSaveName)) { ChallengeSaveMeta challengeSaveMeta = LoadChallengeSaveMeta(SanitizeSaveKey(currentRawSaveName)); if (challengeSaveMeta != null && string.Equals(challengeSaveMeta.challengeId, activeChallenge.id, StringComparison.OrdinalIgnoreCase)) { SetRuntimeTeamName(BuildChallengeSaveName(activeChallenge, challengeSaveMeta)); } } } public static bool CanRenameSaveFromMenu(string saveFileName, out string title, out string message) { title = string.Empty; message = string.Empty; ChallengeSaveMeta challengeSaveMeta = LoadChallengeSaveMeta(SanitizeSaveKey(saveFileName)); if (challengeSaveMeta == null) { return true; } string teamName = BuildChallengeSaveName(GetChallenge(challengeSaveMeta.challengeId), challengeSaveMeta); ForceSaveTeamName(saveFileName, teamName); title = "Challenge Save"; message = "Challenge save names are locked while the challenge run exists."; return false; } public static string GetSaveListDisplayName(string saveFileName, string currentName) { ChallengeSaveMeta challengeSaveMeta = LoadChallengeSaveMeta(SanitizeSaveKey(saveFileName)); if (challengeSaveMeta == null) { return currentName; } string text = BuildChallengeSaveName(GetChallenge(challengeSaveMeta.challengeId), challengeSaveMeta); ForceSaveTeamName(saveFileName, text); return text; } private static void MarkCurrentSaveForChallenge(ChallengeDefinition challenge, int targetLevel) { if (challenge != null) { string currentSaveKeyForChallenge = REPOBlackMarketManager.GetCurrentSaveKeyForChallenge(); string currentRawSaveName = GetCurrentRawSaveName(); SaveChallengeSaveMeta(currentSaveKeyForChallenge, challenge, targetLevel); ForceSaveTeamName(currentRawSaveName, BuildChallengeSaveName(challenge, null)); } } private static void EnforceCurrentChallengeSaveName(ChallengeDefinition challenge) { if (challenge != null) { string currentRawSaveName = GetCurrentRawSaveName(); if (!string.IsNullOrWhiteSpace(currentRawSaveName)) { ForceSaveTeamName(currentRawSaveName, BuildChallengeSaveName(challenge, null)); } } } private static string BuildChallengeSaveName(ChallengeDefinition challenge, ChallengeSaveMeta meta) { string text = challenge?.name ?? meta?.challengeName ?? "Challenge"; return "Challenge - " + text; } private static void SaveChallengeSaveMeta(string saveKey, ChallengeDefinition challenge, int targetLevel) { try { string challengeSaveMetaPath = GetChallengeSaveMetaPath(saveKey); Directory.CreateDirectory(Path.GetDirectoryName(challengeSaveMetaPath)); File.WriteAllLines(challengeSaveMetaPath, new string[3] { challenge.id ?? string.Empty, targetLevel.ToString(), challenge.name ?? string.Empty }); } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to save challenge save meta: " + ex.Message)); } } private static ChallengeSaveMeta LoadChallengeSaveMeta(string saveKey) { try { string challengeSaveMetaPath = GetChallengeSaveMetaPath(saveKey); if (!File.Exists(challengeSaveMetaPath)) { return null; } string[] array = File.ReadAllLines(challengeSaveMetaPath); if (array.Length < 2 || string.IsNullOrWhiteSpace(array[0])) { return null; } int.TryParse(array[1], out var result); return new ChallengeSaveMeta { challengeId = array[0], targetLevel = result, challengeName = ((array.Length >= 3) ? array[2] : string.Empty) }; } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to load challenge save meta: " + ex.Message)); return null; } } private static void DeleteChallengeSaveMeta(string saveKey) { try { string challengeSaveMetaPath = GetChallengeSaveMetaPath(saveKey); if (File.Exists(challengeSaveMetaPath)) { File.Delete(challengeSaveMetaPath); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to delete challenge save meta: " + ex.Message)); } } private static string GetChallengeSaveMetaPath(string saveKey) { return Path.Combine(Application.persistentDataPath, "REPOConomyPlus", "Challenges", SanitizeSaveKey(saveKey) + ".txt"); } private static string SanitizeSaveKey(string saveKey) { if (string.IsNullOrWhiteSpace(saveKey)) { return "active_run"; } char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); foreach (char oldChar in invalidFileNameChars) { saveKey = saveKey.Replace(oldChar, '_'); } if (!string.IsNullOrWhiteSpace(saveKey)) { return saveKey; } return "active_run"; } private static string GetCurrentRawSaveName() { try { string text = AccessTools.Field(typeof(StatsManager), "saveFileCurrent")?.GetValue(StatsManager.instance) as string; if (!string.IsNullOrWhiteSpace(text)) { return text; } } catch { } return string.Empty; } private static void ForceSaveTeamName(string saveFileName, string teamName) { if (string.IsNullOrWhiteSpace(saveFileName) || string.IsNullOrWhiteSpace(teamName) || (Object)(object)StatsManager.instance == (Object)null) { return; } try { if (string.Equals(GetCurrentRawSaveName(), saveFileName, StringComparison.OrdinalIgnoreCase)) { SetRuntimeTeamName(teamName); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Failed to lock challenge save name: " + ex.Message)); } } private static void SetRuntimeTeamName(string teamName) { if (!((Object)(object)StatsManager.instance == (Object)null) && !string.IsNullOrWhiteSpace(teamName)) { AccessTools.Field(typeof(StatsManager), "teamName")?.SetValue(StatsManager.instance, teamName); AccessTools.Field(typeof(StatsManager), "teamNameChanged")?.SetValue(StatsManager.instance, true); } } public static bool TryApplyEconomyPreset() { ChallengeDefinition activeChallenge = ActiveChallenge; if (activeChallenge == null) { return false; } REPOConomyPlugin.ApplyChallengeEconomy(activeChallenge.economy); REPOConomyPlugin.CurrentRollMode = REPOConomyPlugin.PercentRollMode.Stable; REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Economy locked to {activeChallenge.economy} for {activeChallenge.id}"); return true; } public static bool TryApplyModifierPreset() { ChallengeDefinition activeChallenge = ActiveChallenge; if (activeChallenge == null) { return false; } REPOEventManager.ActiveEvents.Clear(); REPOEventManager.ResetMultipliers(); string[] array = activeChallenge.modifierIds ?? Array.Empty(); foreach (string modifierId in array) { GameEvent gameEvent = REPOEventManager.AllEvents.FirstOrDefault((GameEvent e) => string.Equals(e.id, modifierId, StringComparison.OrdinalIgnoreCase)); if (gameEvent == null) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Modifier '" + modifierId + "' not found for " + activeChallenge.id)); continue; } REPOEventManager.ActiveEvents.Add(gameEvent); gameEvent.onActivate?.Invoke(); } REPOEventManager.TrackActiveModifiersForStats(); if (PhotonNetwork.IsMasterClient) { REPOEventManager.SyncModifiersToClients(); REPOConomyNetworkHandler.SyncSharedPoolToClients(); REPOConomyNetworkHandler.SyncBlackMarketToClients(); } REPOConomyPlugin.Logger.LogInfo((object)("[Challenges] Applied modifier preset for " + activeChallenge.id)); return true; } public static bool TryApplyShopEconomyPreset(Random rng) { ChallengeDefinition activeChallenge = ActiveChallenge; if (activeChallenge == null || string.IsNullOrWhiteSpace(activeChallenge.shopEconomy)) { return false; } if (!Enum.TryParse(activeChallenge.shopEconomy, ignoreCase: true, out var result)) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Shop economy '" + activeChallenge.shopEconomy + "' not found for " + activeChallenge.id)); return false; } ShopEconomyManager.ApplyChallengeShopEconomy(result, rng); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Shop economy locked to {result} for {activeChallenge.id}"); return true; } private static void ShowCompletionMessage(ChallengeDefinition challenge, int completedTier) { //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) int num = Targets[Mathf.Clamp(completedTier - 1, 0, Targets.Length - 1)]; string text = $"{challenge.name} completed to level {num}"; if ((Object)(object)BigMessageUI.instance != (Object)null) { SemiFunc.UIBigMessage(text.ToUpperInvariant(), "{check}", 28f, challenge.color, Color.white); } if (completedTier >= Targets.Length && (Object)(object)BigMessageUI.instance != (Object)null) { SemiFunc.UIBigMessage(challenge.name.ToUpperInvariant() + " MASTERED", "{star}", 30f, challenge.color, Color.white); } } private static void TryAnnounceChallengeReward(ChallengeDefinition challenge, int completedTier) { //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) REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null || challenge == null || completedTier < Targets.Length) { return; } string key = challenge.id + "_reward_pack"; if (!(rEPOStatsManager.stats.challengeRewardUnlockAnnouncements.TryGetValue(key, out var value) && value)) { rEPOStatsManager.stats.challengeRewardUnlockAnnouncements[key] = true; rEPOStatsManager.SaveStats(); if ((Object)(object)BigMessageUI.instance != (Object)null) { SemiFunc.UIBigMessage(challenge.name.ToUpperInvariant() + " REWARD PACK UNLOCKED", "{star}", 32f, challenge.color, Color.white); } } } private static void ShowCompletionPopupAndReturnToMainMenu(ChallengeDefinition challenge, int completedTier) { //IL_0077: 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) int num = Targets[Mathf.Clamp(completedTier - 1, 0, Targets.Length - 1)]; string arg = ((completedTier < Targets.Length) ? $"Unlocked next target: level {Targets[completedTier]}" : ("Unlocked rewards: " + GetRewardSummary(challenge))); string popupBody = $"{challenge.name}\nReach level {num} completed!\n\n{arg}"; if ((Object)(object)REPOConomyPlugin.Instance != (Object)null) { ((MonoBehaviour)REPOConomyPlugin.Instance).StartCoroutine(ReturnToMainMenuAfterDelay(challenge.color, popupBody)); } else if ((Object)(object)EconomyController.Instance != (Object)null) { ((MonoBehaviour)EconomyController.Instance).StartCoroutine(ReturnToMainMenuAfterDelay(challenge.color, popupBody)); } } [IteratorStateMachine(typeof(d__52))] private static IEnumerator ReturnToMainMenuAfterDelay(Color popupColor, string popupBody) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__52(0) { popupColor = popupColor, popupBody = popupBody }; } } [HarmonyPatch(typeof(MenuPageSaves), "OnLoadGame")] internal static class ChallengeSaveLoadGuardPatch { [HarmonyPrefix] private static bool Prefix(MenuPageSaves __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) try { string text = AccessTools.Field(typeof(MenuPageSaves), "currentSaveFileName")?.GetValue(__instance) as string; if (string.IsNullOrWhiteSpace(text)) { return true; } if (ChallengeManager.CanLoadSaveFromMenu(text, out var title, out var message)) { return true; } MenuManager instance = MenuManager.instance; if (instance != null) { instance.PagePopUp(title, Color.red, message, "OK", true); } MenuManager instance2 = MenuManager.instance; if (instance2 != null) { instance2.MenuEffectClick((MenuClickEffectType)2, (MenuPage)null, 1f, 1f, false); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save load guard failed: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(MenuPageSaves), "OnNewGame")] internal static class RemoveSaveLimitPatch { [HarmonyPrefix] private static bool Prefix() { try { if (SemiFunc.MainMenuIsMultiplayer()) { SemiFunc.MenuActionHostGame((string)null, (List)null); } else { SemiFunc.MenuActionSingleplayerGame((string)null, (List)null); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save limit bypass failed: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(StatsManager), "SaveFileCreate")] internal static class ChallengeSaveCreatePatch { [HarmonyPostfix] private static void Postfix(StatsManager __instance) { try { ChallengeManager.OnVanillaSaveCreated(AccessTools.Field(typeof(StatsManager), "saveFileCurrent")?.GetValue(__instance) as string); } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save create hook failed: " + ex.Message)); } } } [HarmonyPatch(typeof(StatsManager), "SaveFileSave")] internal static class ChallengeSaveFileSavePatch { [HarmonyPrefix] private static void Prefix() { try { ChallengeManager.BeforeVanillaSaveFileSave(); } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save name hook failed: " + ex.Message)); } } } [HarmonyPatch(typeof(MenuPageSavesRename), "ButtonConfirm")] internal static class ChallengeSaveRenameGuardPatch { [HarmonyPrefix] private static bool Prefix(MenuPageSavesRename __instance) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) try { string text = AccessTools.Field(typeof(MenuPageSavesRename), "fileName")?.GetValue(__instance) as string; if (string.IsNullOrWhiteSpace(text)) { return true; } if (ChallengeManager.CanRenameSaveFromMenu(text, out var title, out var message)) { return true; } MenuManager instance = MenuManager.instance; if (instance != null) { instance.PagePopUp(title, Color.yellow, message, "OK", true); } MenuManager instance2 = MenuManager.instance; if (instance2 != null) { instance2.MenuEffectClick((MenuClickEffectType)2, (MenuPage)null, 1f, 1f, false); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save rename guard failed: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(MenuPageSaves), "UpdateSaveDetails")] internal static class ChallengeSaveDisplayNamePatch { [HarmonyPostfix] private static void Postfix(MenuElementSaveFile _menuSaveFile, string _saveFileName) { try { if (!((Object)(object)_menuSaveFile?.saveFileHeader == (Object)null) && !string.IsNullOrWhiteSpace(_saveFileName)) { ((TMP_Text)_menuSaveFile.saveFileHeader).text = ChallengeManager.GetSaveListDisplayName(_saveFileName, ((TMP_Text)_menuSaveFile.saveFileHeader).text); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Challenges] Save display patch failed: " + ex.Message)); } } } [Serializable] public class CustomEconomyData { public string id; public string name_en; public string name_ru; public string name_ko; public string desc_en; public string desc_ru; public string desc_ko; public float[] color; public float min; public float max; public bool useDelta; } public static class CustomEconomyLoader { public static List CustomEvents = new List(); public static void LoadCustomEvents() { string text = Path.Combine(Paths.ConfigPath, "CustomEvents"); if (!Directory.Exists(text)) { Directory.CreateDirectory(text); REPOConomyPlugin.Logger.LogInfo((object)("[REPOConomy] Created folder for custom events: " + text)); } string[] files = Directory.GetFiles(text, "*.json", SearchOption.TopDirectoryOnly); int num = 0; int num2 = 0; string[] array = files; foreach (string text2 in array) { try { List list = JsonConvert.DeserializeObject>(File.ReadAllText(text2)); if (list != null) { foreach (CustomEconomyData item in list) { if (!string.IsNullOrEmpty(item.id)) { CustomEvents.Add(item); REPOConomyPlugin.Logger.LogInfo((object)("[REPOConomy] Loaded custom event: " + item.name_en + " (" + text2 + ")")); num++; } else { REPOConomyPlugin.Logger.LogWarning((object)("[REPOConomy] Invalid custom event in file: " + text2 + " (missing ID)")); num2++; } } } else { REPOConomyPlugin.Logger.LogWarning((object)("[REPOConomy] JSON file does not contain a valid event list: " + text2)); num2++; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[REPOConomy] Failed to load custom event from " + text2 + ": " + ex.Message)); num2++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[REPOConomy] Loaded {num} custom events. Failed: {num2}"); } } public class EconomyController : MonoBehaviour { public static EconomyController Instance; public static bool UIShownOnce; public static bool ShowChancesInLevel; public static bool ShopEconomyUIShownOnce; public static bool BlackMarketHintShownOnce; private bool economyResetPending = true; private bool showGUI; private float displayTimer = 20f; private string lastSceneType = ""; private bool showShopGUI; private float shopDisplayTimer = 15f; private Vector2 scrollPosition = Vector2.zero; private float scrollSpeed = 100f; private float autoScrollTimer; private float autoScrollDelay = 1.5f; private bool autoScrollActive; private float autoScrollSpeed = 30f; private float cachedContentHeight; private float cachedScrollableHeight; private float fadeAlpha; private float bmFadeAlpha; private float targetFadeAlpha; private float glowPulse; private Texture2D bgTexture; private Texture2D gradientTexture; private Texture2D glowTexture; private Texture2D separatorTexture; private GUIStyle noScrollbarStyle; private void Awake() { Instance = this; InitializeTextures(); InitializeStyles(); } private void InitializeStyles() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown noScrollbarStyle = new GUIStyle(); } private void InitializeTextures() { //IL_0018: 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) bgTexture = MakeTexture(2, 2, new Color(0.05f, 0.05f, 0.08f, 0.95f)); gradientTexture = MakeGradientTexture(); glowTexture = MakeGlowTexture(); separatorTexture = MakeTexture(2, 2, new Color(0.3f, 0.6f, 1f, 0.3f)); } private Texture2D MakeTexture(int width, int height, Color col) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown Color[] array = (Color[])(object)new Color[width * height]; for (int i = 0; i < array.Length; i++) { array[i] = col; } Texture2D val = new Texture2D(width, height); val.SetPixels(array); val.Apply(); return val; } private Texture2D MakeGradientTexture() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) int num = 256; Texture2D val = new Texture2D(1, num); for (int i = 0; i < num; i++) { float num2 = (float)i / (float)num; Color val2 = Color.Lerp(new Color(0.1f, 0.15f, 0.25f, 0.9f), new Color(0.05f, 0.05f, 0.08f, 0.95f), num2); val.SetPixel(0, i, val2); } val.Apply(); return val; } private Texture2D MakeGlowTexture() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_007d: Unknown result type (might be due to invalid IL or missing references) int num = 64; Texture2D val = new Texture2D(num, num); for (int i = 0; i < num; i++) { for (int j = 0; j < num; j++) { float num2 = ((float)j - (float)num / 2f) / ((float)num / 2f); float num3 = ((float)i - (float)num / 2f) / ((float)num / 2f); float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3); float num5 = Mathf.Max(0f, 1f - num4) * 0.5f; val.SetPixel(j, i, new Color(0.3f, 0.6f, 1f, num5)); } } val.Apply(); return val; } private void Update() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) fadeAlpha = Mathf.Lerp(fadeAlpha, targetFadeAlpha, Time.deltaTime * 8f); float num = ((REPOBlackMarketManager.IsShopHintVisible() && SemiFunc.RunIsShop()) ? 1f : 0f); bmFadeAlpha = Mathf.Lerp(bmFadeAlpha, num, Time.deltaTime * 8f); glowPulse = Mathf.Sin(Time.time * 2f) * 0.3f + 0.7f; string currentSceneType = GetCurrentSceneType(); if (Input.GetKeyDown(REPOConfig.UIToggleHotkey.Value)) { if (currentSceneType == "Shop") { showShopGUI = !showShopGUI; if (showShopGUI) { shopDisplayTimer = 15f; } } else { showGUI = !showGUI; targetFadeAlpha = (showGUI ? 1f : 0f); displayTimer = 20f; scrollPosition = Vector2.zero; autoScrollTimer = 0f; autoScrollActive = false; } } string text = lastSceneType; if (currentSceneType != lastSceneType) { lastSceneType = currentSceneType; switch (currentSceneType) { case "Level": economyResetPending = true; UIShownOnce = false; showGUI = false; targetFadeAlpha = 0f; autoScrollTimer = 0f; autoScrollActive = false; if (text == "Shop") { showShopGUI = false; ShopEconomyUIShownOnce = false; BlackMarketHintShownOnce = false; } break; case "Lobby": if (text == "Shop") { showShopGUI = false; ShopEconomyUIShownOnce = false; BlackMarketHintShownOnce = false; } break; case "Shop": showGUI = false; targetFadeAlpha = 0f; autoScrollTimer = 0f; autoScrollActive = false; break; } } bool flag = economyResetPending; if (flag) { bool flag2 = ((currentSceneType == "Level" || currentSceneType == "Lobby") ? true : false); flag = flag2; } if (flag) { REPOConomyPlugin.ResetEconomy(); economyResetPending = false; } if (showGUI && (REPOConomyPlugin.HasEconomy || currentSceneType == "Lobby")) { displayTimer -= Time.deltaTime; if (displayTimer <= 0f) { showGUI = false; targetFadeAlpha = 0f; autoScrollTimer = 0f; autoScrollActive = false; } bool flag3 = false; float num2 = Mathf.Max(0f, cachedContentHeight - cachedScrollableHeight); if (Input.GetKey((KeyCode)274)) { scrollPosition.y += scrollSpeed * Time.deltaTime; scrollPosition.y = Mathf.Min(scrollPosition.y, num2); flag3 = true; autoScrollTimer = 0f; autoScrollActive = false; } if (Input.GetKey((KeyCode)273)) { scrollPosition.y -= scrollSpeed * Time.deltaTime; scrollPosition.y = Mathf.Max(0f, scrollPosition.y); flag3 = true; autoScrollTimer = 0f; autoScrollActive = false; } if (!flag3) { if (!autoScrollActive) { autoScrollTimer += Time.deltaTime; if (autoScrollTimer >= autoScrollDelay) { autoScrollActive = true; } } else { scrollPosition.y += autoScrollSpeed * Time.deltaTime; scrollPosition.y = Mathf.Min(scrollPosition.y, num2); if (scrollPosition.y >= num2) { autoScrollActive = false; } } } } if (showShopGUI && REPOConomyPlugin.HasShopEconomy) { shopDisplayTimer -= Time.deltaTime; if (shopDisplayTimer <= 0f) { showShopGUI = false; } } } private string GetCurrentSceneType() { if (SemiFunc.RunIsLevel()) { return "Level"; } if (SemiFunc.RunIsLobby()) { return "Lobby"; } if (SemiFunc.RunIsShop()) { return "Shop"; } return "Other"; } public void ResetGUI() { //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) showGUI = true; targetFadeAlpha = 1f; displayTimer = 20f; scrollPosition = Vector2.zero; autoScrollTimer = 0f; autoScrollActive = false; } public void ShowGUI() { //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) showGUI = true; targetFadeAlpha = 1f; displayTimer = 20f; scrollPosition = Vector2.zero; autoScrollTimer = 0f; autoScrollActive = false; } public void ShowShopEconomyGUI() { showShopGUI = true; shopDisplayTimer = 15f; } private void OnGUI() { //IL_0063: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) if (showShopGUI && REPOConomyPlugin.HasShopEconomy && SemiFunc.RunIsShop()) { DrawShopEconomyGUI(); } if (REPOBlackMarketManager.IsShopHintVisible() && SemiFunc.RunIsShop()) { DrawBlackMarketHintGUI(); } if (!(fadeAlpha < 0.01f) && showGUI && (REPOConomyPlugin.HasEconomy || SemiFunc.RunIsLobby()) && (SemiFunc.RunIsLevel() || SemiFunc.RunIsLobby())) { Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, fadeAlpha); int currentLevel = REPOConomyPlugin.GetCurrentLevel(); float num = (float)Screen.width / 2f; float num2 = (float)Screen.height * 0.12f; float num3 = Mathf.Min((float)Screen.width * 0.45f, 700f); float num4 = 500f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num - num3 / 2f, num2, num3, num4); DrawGlowEffect(val); DrawModernBackground(val); DrawHeaderSection(val); DrawContentSection(val); DrawFooterSection(val, currentLevel); GUI.color = color; } } private void DrawShopEconomyGUI() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: 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_00fb: 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) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_0118: 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_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01d7: 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_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Expected O, but got Unknown //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //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_0280: 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_0290: Expected O, but got Unknown //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f4: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0361: 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_037d: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0395: Expected O, but got Unknown //IL_0400: Unknown result type (might be due to invalid IL or missing references) //IL_0444: Unknown result type (might be due to invalid IL or missing references) //IL_0462: Unknown result type (might be due to invalid IL or missing references) //IL_0467: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Expected O, but got Unknown //IL_0496: Unknown result type (might be due to invalid IL or missing references) //IL_04c7: 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_04fb: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; bool num = value == "Russian"; ShopEconomyType currentShopEconomy = REPOConomyPlugin.CurrentShopEconomy; string shopEconomyName = ShopEconomyManager.GetShopEconomyName(currentShopEconomy, value); string shopEconomyDescription = ShopEconomyManager.GetShopEconomyDescription(currentShopEconomy, value); string priceModifierText = ShopEconomyManager.GetPriceModifierText(value); Color shopEconomyColor = ShopEconomyManager.GetShopEconomyColor(currentShopEconomy); float num2 = Mathf.Clamp01(shopDisplayTimer / 2f); float num3 = ((shopDisplayTimer > 13f) ? ((15f - shopDisplayTimer) / 2f) : num2); num3 = Mathf.Clamp01(num3); float num4 = Mathf.Min((float)Screen.width * 0.4f, 500f); float num5 = 215f; float num6 = (float)Screen.width / 2f; float num7 = (float)Screen.height * 0.08f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num6 - num4 / 2f, num7, num4, num5); GUI.color = new Color(0.05f, 0.05f, 0.08f, 0.9f * num3); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = new Color(shopEconomyColor.r, shopEconomyColor.g, shopEconomyColor.b, 0.6f * num3); float num8 = 2f; GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, num8), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + ((Rect)(ref val)).height - num8, ((Rect)(ref val)).width, num8), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, num8, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x + ((Rect)(ref val)).width - num8, ((Rect)(ref val)).y, num8, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; val2.normal.textColor = new Color(0.7f, 0.7f, 0.7f, num3); string text = (num ? "\ud83d\udcb0 ЭКОНОМИКА МАГАЗИНА" : "\ud83d\udcb0 SHOP ECONOMY"); GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width, 25f), text, val2); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 22, alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; val3.normal.textColor = new Color(shopEconomyColor.r, shopEconomyColor.g, shopEconomyColor.b, num3); GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + 40f, ((Rect)(ref val)).width, 35f), shopEconomyName, val3); GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 13, alignment = (TextAnchor)4, fontStyle = (FontStyle)2, wordWrap = true }; val4.normal.textColor = new Color(0.8f, 0.8f, 0.8f, num3); GUI.Label(new Rect(((Rect)(ref val)).x + 15f, ((Rect)(ref val)).y + 78f, ((Rect)(ref val)).width - 30f, 56f), shopEconomyDescription, val4); GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)4, fontStyle = (FontStyle)1 }; Color textColor = default(Color); if (REPOConomyPlugin.ShopPriceMultiplier < 1f) { ((Color)(ref textColor))..ctor(0.3f, 0.9f, 0.3f, num3); } else if (REPOConomyPlugin.ShopPriceMultiplier > 1f) { ((Color)(ref textColor))..ctor(0.9f, 0.3f, 0.3f, num3); } else { ((Color)(ref textColor))..ctor(0.7f, 0.7f, 0.7f, num3); } val5.normal.textColor = textColor; string text2 = (num ? "Цены: " : "Prices: "); GUI.Label(new Rect(((Rect)(ref val)).x + 12f, ((Rect)(ref val)).y + 140f, ((Rect)(ref val)).width - 24f, 36f), text2 + priceModifierText, val5); GUIStyle val6 = new GUIStyle(GUI.skin.label) { fontSize = 10, alignment = (TextAnchor)4 }; val6.normal.textColor = new Color(0.5f, 0.5f, 0.5f, num3 * 0.7f); string text3 = (num ? $"[{REPOConfig.UIToggleHotkey.Value}] для закрытия" : $"Press [{REPOConfig.UIToggleHotkey.Value}] to close"); GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + num5 - 25f, ((Rect)(ref val)).width, 20f), text3, val6); GUI.color = Color.white; } private void DrawBlackMarketHintGUI() { //IL_0097: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019a: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Expected O, but got Unknown //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02d9: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) string shopHintText = REPOBlackMarketManager.GetShopHintText(); if (!string.IsNullOrWhiteSpace(shopHintText)) { float num = bmFadeAlpha; if (!(num < 0.01f)) { float num2 = Mathf.Min((float)Screen.width * 0.5f, 640f); float num3 = (shopHintText.Contains("\n") ? 112f : 76f); float num4 = (float)Screen.width / 2f; float num5 = (float)Screen.height * 0.74f; Rect val = default(Rect); ((Rect)(ref val))..ctor(num4 - num2 / 2f, num5, num2, num3); GUI.color = new Color(0.05f, 0.04f, 0.03f, 0.9f * num); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = new Color(1f, 0.62f, 0.14f, 0.9f * num); float num6 = 2f; GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, num6), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y + ((Rect)(ref val)).height - num6, ((Rect)(ref val)).width, num6), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, num6, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val)).x + ((Rect)(ref val)).width - num6, ((Rect)(ref val)).y, num6, ((Rect)(ref val)).height), (Texture)(object)Texture2D.whiteTexture); GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 15, alignment = (TextAnchor)4, fontStyle = (FontStyle)1, wordWrap = true }; val2.normal.textColor = new Color(1f, 0.78f, 0.35f, num); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 12, alignment = (TextAnchor)4, wordWrap = true }; val3.normal.textColor = new Color(0.95f, 0.9f, 0.82f, num); string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "암시장" : ((!(value == "Russian")) ? "BLACK MARKET" : "ЧЁРНЫЙ РЫНОК")); string text2 = text; GUI.color = Color.white; GUI.Label(new Rect(((Rect)(ref val)).x + 14f, ((Rect)(ref val)).y + 8f, ((Rect)(ref val)).width - 28f, 24f), text2, val2); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 34f, ((Rect)(ref val)).width - 36f, ((Rect)(ref val)).height - 42f), shopHintText, val3); GUI.color = Color.white; } } } private void DrawGlowEffect(Rect rect) { //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) float num = 30f * glowPulse; Rect val = new Rect(((Rect)(ref rect)).x - num, ((Rect)(ref rect)).y - num, ((Rect)(ref rect)).width + num * 2f, ((Rect)(ref rect)).height + num * 2f); GUI.color = new Color(0.3f, 0.6f, 1f, 0.15f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)glowTexture, (ScaleMode)0); GUI.color = Color.white; } private void DrawModernBackground(Rect rect) { //IL_0034: 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_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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) Rect val = new Rect(((Rect)(ref rect)).x - 2f, ((Rect)(ref rect)).y - 2f, ((Rect)(ref rect)).width + 4f, ((Rect)(ref rect)).height + 4f); GUI.color = new Color(0.3f, 0.6f, 1f, 0.4f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = new Color(1f, 1f, 1f, fadeAlpha); GUI.DrawTexture(rect, (Texture)(object)gradientTexture, (ScaleMode)0); DrawBorder(rect, new Color(0.2f, 0.4f, 0.8f, 0.6f * fadeAlpha), 1f); } private void DrawBorder(Rect rect, Color color, float thickness) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_009f: 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) GUI.color = color; GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, thickness), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + ((Rect)(ref rect)).height - thickness, ((Rect)(ref rect)).width, thickness), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - thickness, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; } private void DrawHeaderSection(Rect mainRect) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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_016f: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_0206: 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_0222: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0231: Unknown result type (might be due to invalid IL or missing references) //IL_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Expected O, but got Unknown //IL_02d8: Unknown result type (might be due to invalid IL or missing references) //IL_0306: Unknown result type (might be due to invalid IL or missing references) //IL_032d: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; KeyCode value2 = REPOConfig.UIToggleHotkey.Value; string text = ((object)(KeyCode)(ref value2)).ToString(); string currentSceneType = GetCurrentSceneType(); string text3; if (currentSceneType == "Lobby" || (currentSceneType == "Level" && ShowChancesInLevel)) { string text2 = ((value == "Korean") ? "이벤트 확률" : ((!(value == "Russian")) ? "EVENT DROP CHANCES" : "ШАНСЫ ВЫПАДЕНИЯ СОБЫТИЙ")); text3 = text2; } else { string text2 = ((value == "Korean") ? "활성 이벤트" : ((!(value == "Russian")) ? "ACTIVE EVENTS" : "АКТИВНЫЕ СОБЫТИЯ")); text3 = text2; } string text4 = text3; Rect val = new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y, ((Rect)(ref mainRect)).width, 60f); GUI.color = new Color(0.15f, 0.25f, 0.4f, 0.5f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = Color.white; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 28, fontStyle = (FontStyle)1, alignment = (TextAnchor)4 }; val2.normal.textColor = new Color(0.7f, 0.9f, 1f, fadeAlpha); GUIStyle val3 = val2; GUI.color = new Color(0f, 0f, 0f, 0.5f * fadeAlpha); GUI.Label(new Rect(((Rect)(ref mainRect)).x + 2f, ((Rect)(ref mainRect)).y + 12f, ((Rect)(ref mainRect)).width, 40f), text4, val3); GUI.color = new Color(1f, 1f, 1f, fadeAlpha); GUI.Label(new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 10f, ((Rect)(ref mainRect)).width, 40f), text4, val3); GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 12, alignment = (TextAnchor)4 }; val4.normal.textColor = new Color(0.6f, 0.8f, 1f, 0.7f * fadeAlpha); GUIStyle val5 = val4; text3 = ((value == "Korean") ? ("[" + text + "] 키를 눌러 전환") : ((!(value == "Russian")) ? ("Press [" + text + "] to toggle") : ("Нажмите [" + text + "] для переключения"))); string text5 = text3; GUI.Label(new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 40f, ((Rect)(ref mainRect)).width, 20f), text5, val5); Rect val6 = new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 58f, ((Rect)(ref mainRect)).width, 2f); GUI.color = new Color(0.3f, 0.6f, 1f, 0.6f * fadeAlpha * glowPulse); GUI.DrawTexture(val6, (Texture)(object)Texture2D.whiteTexture); } private void DrawContentSection(Rect mainRect) { //IL_00a8: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref mainRect)).x + 15f, ((Rect)(ref mainRect)).y + 70f, ((Rect)(ref mainRect)).width - 30f, ((Rect)(ref mainRect)).height - 130f); cachedScrollableHeight = ((Rect)(ref val)).height; string currentSceneType = GetCurrentSceneType(); cachedContentHeight = CalculateActualContentHeight(((Rect)(ref val)).width - 20f, currentSceneType); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(0f, 0f, ((Rect)(ref val)).width - 20f, cachedContentHeight); GUI.color = new Color(0.08f, 0.08f, 0.12f, 0.6f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = Color.white; scrollPosition = GUI.BeginScrollView(val, scrollPosition, val2, false, false, GUIStyle.none, GUIStyle.none); float yOffset = 10f; if (currentSceneType == "Lobby" || (currentSceneType == "Level" && ShowChancesInLevel)) { yOffset = DrawChancesContent(val2, yOffset); } else { yOffset = DrawActiveEventsContent(val2, yOffset); } GUI.EndScrollView(); if (cachedContentHeight > cachedScrollableHeight) { DrawScrollIndicator(val); } } private void DrawScrollIndicator(Rect area) { //IL_005c: 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_0090: Unknown result type (might be due to invalid IL or missing references) float num = Mathf.Max(1f, cachedContentHeight - cachedScrollableHeight); float num2 = scrollPosition.y / num; float num3 = 40f; float num4 = ((Rect)(ref area)).y + num2 * (((Rect)(ref area)).height - num3); Rect val = new Rect(((Rect)(ref area)).x + ((Rect)(ref area)).width - 6f, num4, 4f, num3); GUI.color = new Color(0.3f, 0.6f, 1f, 0.7f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; } private float CalculateActualContentHeight(float contentWidth, string sceneType) { float num = 10f; _ = REPOConfig.UILanguage.Value == "Russian"; if (sceneType == "Lobby" || (sceneType == "Level" && ShowChancesInLevel)) { if (sceneType == "Lobby") { string lobbyStatusText = REPOBlackMarketManager.GetLobbyStatusText(); if (!string.IsNullOrWhiteSpace(lobbyStatusText)) { int num2 = lobbyStatusText.Split(new char[1] { '\n' }).Length; num += 35f; num += (float)(Mathf.Max(90, 24 + num2 * 22) + 10); } } if (REPOConfig.EnableSharedPool.Value) { num += 35f; Dictionary dictionary = new Dictionary(); foreach (EventType value in Enum.GetValues(typeof(EventType))) { dictionary[value] = REPOEventManager.GetSharedPoolWeight(value); } num += (float)(dictionary.Count * 32); num += 15f; } else { EventCategory[] array = new EventCategory[4] { EventCategory.LootModifier, EventCategory.EnemyModifier, EventCategory.PlayerModifier, EventCategory.EnvironmentModifier }; foreach (EventCategory category in array) { List list = REPOEventManager.AllEvents.Where((GameEvent e) => e.category == category && REPOConfig.ModifierEnables["Enable " + e.id].Value).ToList(); if (list.Count == 0) { continue; } num += 35f; Dictionary dictionary2 = new Dictionary(); foreach (GameEvent item in list) { EventType eventType2 = item.eventType; if (!dictionary2.ContainsKey(eventType2)) { dictionary2[eventType2] = 0f; } dictionary2[eventType2] += REPOEventManager.GetEventWeight(eventType2); } num += (float)(dictionary2.Count * 32); num += 10f; } } } else { num += 35f; string activeEventsStatusText = REPOBlackMarketManager.GetActiveEventsStatusText(); if (!string.IsNullOrWhiteSpace(activeEventsStatusText)) { int num3 = activeEventsStatusText.Split(new char[1] { '\n' }).Length; num += (float)(45 + Mathf.Max(90, num3 * 24)); } if (ChallengeManager.HasActiveChallenge) { num += 35f; num += 80f; } num += 90f; if (REPOEventManager.ActiveEvents.Count > 0) { num += 35f; num += (float)(REPOEventManager.ActiveEvents.Count * 68); num += 10f; } if (sceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.EnableLevelScaling.Value) { num += 35f; num += 110f; } if (sceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.HideVanillaMoonUI.Value) { num += 35f; num += 100f; } if (sceneType == "Level" && (Object)(object)RunManager.instance != (Object)null) { int level = RunManager.instance.levelsCompleted + 1; float num4 = CalculateScaling(level, REPOConfig.EnableEnemyHPScaling.Value, REPOConfig.EnemyHPStartLevel.Value, REPOConfig.EnemyHPMultiplier.Value, REPOConfig.EnemyHPUseExponentialScaling.Value, REPOConfig.EnemyHPMaxLevel.Value); float num5 = CalculateScaling(level, REPOConfig.EnableEnemyCapScaling.Value, REPOConfig.EnemyCapStartLevel.Value, REPOConfig.EnemyCapMultiplier.Value, REPOConfig.EnemyCapUseExponentialScaling.Value, REPOConfig.EnemyCapMaxLevel.Value); float num6 = CalculateScaling(level, REPOConfig.EnableMapValueScaling.Value, REPOConfig.MapValueStartLevel.Value, REPOConfig.MapValueMultiplier.Value, REPOConfig.MapValueUseExponentialScaling.Value, REPOConfig.MapValueMaxLevel.Value); float playerDamageFromEnemyHPMultiplier = EnemyScaling.GetPlayerDamageFromEnemyHPMultiplier(); float weaponDamageFromEnemyHPMultiplier = EnemyScaling.GetWeaponDamageFromEnemyHPMultiplier(); float enemyRespawnFromCapMultiplier = EnemyScaling.GetEnemyRespawnFromCapMultiplier(); if (num4 > 1f || num5 > 1f || num6 > 1f || playerDamageFromEnemyHPMultiplier > 1f || weaponDamageFromEnemyHPMultiplier > 1f || enemyRespawnFromCapMultiplier > 1f) { num += 35f; float num7 = 10f; if (num4 > 1f) { num7 += 25f; } if (num5 > 1f) { num7 += 25f; } if (num6 > 1f) { num7 += 25f; } if (playerDamageFromEnemyHPMultiplier > 1f) { num7 += 25f; } if (weaponDamageFromEnemyHPMultiplier > 1f) { num7 += 25f; } if (enemyRespawnFromCapMultiplier > 1f) { num7 += 25f; } num += num7 + 20f; } } } return num + 20f; } private float DrawChancesContent(Rect viewRect, float yOffset) { //IL_0028: 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_003f: Unknown result type (might be due to invalid IL or missing references) bool isRu = REPOConfig.UILanguage.Value == "Russian"; if (GetCurrentSceneType() == "Lobby") { yOffset = DrawBlackMarketLobbySection(viewRect, yOffset, isRu); } yOffset = ((!REPOConfig.EnableSharedPool.Value) ? DrawCategoryChances(viewRect, yOffset, isRu) : DrawSharedPoolChances(viewRect, yOffset, isRu)); return yOffset; } private float DrawBlackMarketLobbySection(Rect viewRect, float yOffset, bool isRu) { //IL_0011: 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_0082: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) string lobbyStatusText = REPOBlackMarketManager.GetLobbyStatusText(); if (string.IsNullOrWhiteSpace(lobbyStatusText)) { return yOffset; } yOffset = DrawModernCategory(viewRect, yOffset, "BLACK MARKET", new Color(1f, 0.62f, 0.14f, fadeAlpha)); int num = lobbyStatusText.Split(new char[1] { '\n' }).Length; float num2 = Mathf.Max(90f, 24f + (float)num * 22f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num2); DrawModernCard(rect, new Color(1f, 0.62f, 0.14f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)4 }; val.normal.textColor = new Color(1f, 0.9f, 0.65f, fadeAlpha); val.wordWrap = true; GUIStyle val2 = val; GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 24f, ((Rect)(ref rect)).height - 20f), lobbyStatusText, val2); return yOffset + num2 + 10f; } private float DrawSharedPoolChances(Rect viewRect, float yOffset, bool isRu) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0136: 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) string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "공유 풀" : ((!(value == "Russian")) ? "SHARED POOL" : "ОБЩИЙ ПУЛ")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(1f, 0.8f, 0.2f, fadeAlpha)); Dictionary dictionary = new Dictionary(); foreach (EventType value2 in Enum.GetValues(typeof(EventType))) { dictionary[value2] = REPOEventManager.GetSharedPoolWeight(value2); } float num = dictionary.Values.Sum(); foreach (KeyValuePair item in dictionary.OrderBy((KeyValuePair k) => (int)k.Key)) { EventType key = item.Key; float chance = item.Value / num * 100f; string eventIcon = GetEventIcon(key); string eventTypeName = GetEventTypeName(key, isRu); yOffset = DrawModernChanceItem(viewRect, yOffset, eventIcon, eventTypeName, chance, REPOEventManager.GetEventColor(key)); } return yOffset + 15f; } private float DrawCategoryChances(Rect viewRect, float yOffset, bool isRu) { //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) EventCategory[] array = new EventCategory[4] { EventCategory.LootModifier, EventCategory.EnemyModifier, EventCategory.PlayerModifier, EventCategory.EnvironmentModifier }; foreach (EventCategory category in array) { List list = REPOEventManager.AllEvents.Where((GameEvent e) => e.category == category && REPOConfig.ModifierEnables["Enable " + e.id].Value).ToList(); if (list.Count == 0) { continue; } string categoryName = GetCategoryName(category, isRu); yOffset = DrawModernCategory(viewRect, yOffset, categoryName, GetCategoryColor(category)); Dictionary dictionary = new Dictionary(); foreach (GameEvent item in list) { EventType eventType = item.eventType; if (!dictionary.ContainsKey(eventType)) { dictionary[eventType] = 0f; } dictionary[eventType] += REPOEventManager.GetEventWeight(eventType); } float num = dictionary.Values.Sum(); foreach (KeyValuePair item2 in dictionary.OrderBy((KeyValuePair k) => (int)k.Key)) { EventType key = item2.Key; float chance = item2.Value / num * 100f; string eventIcon = GetEventIcon(key); string eventTypeName = GetEventTypeName(key, isRu); yOffset = DrawModernChanceItem(viewRect, yOffset, eventIcon, eventTypeName, chance, REPOEventManager.GetEventColor(key)); } yOffset += 10f; } return yOffset; } private float DrawActiveEventsContent(Rect viewRect, float yOffset) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_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_0093: 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_00c3: Unknown result type (might be due to invalid IL or missing references) bool isRu = REPOConfig.UILanguage.Value == "Russian"; string currentSceneType = GetCurrentSceneType(); yOffset = DrawBlackMarketSection(viewRect, yOffset, isRu); yOffset = DrawChallengeSection(viewRect, yOffset, isRu); yOffset = DrawEconomySection(viewRect, yOffset, isRu); yOffset = DrawModifiersSection(viewRect, yOffset, isRu); if (currentSceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.EnableLevelScaling.Value) { yOffset = DrawLevelScalingSection(viewRect, yOffset, isRu); } if (currentSceneType == "Level" && (Object)(object)RunManager.instance != (Object)null) { yOffset = DrawMapScalingSection(viewRect, yOffset, isRu); } if (currentSceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.HideVanillaMoonUI.Value) { yOffset = DrawMoonScalingSection(viewRect, yOffset, isRu); } return yOffset; } private float DrawBlackMarketSection(Rect viewRect, float yOffset, bool isRu) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: 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_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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Expected O, but got Unknown //IL_015f: Unknown result type (might be due to invalid IL or missing references) string activeEventsStatusText = REPOBlackMarketManager.GetActiveEventsStatusText(); if (string.IsNullOrWhiteSpace(activeEventsStatusText)) { return yOffset; } string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "암시장" : ((!(value == "Russian")) ? "BLACK MARKET" : "ЧЁРНЫЙ РЫНОК")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(1f, 0.62f, 0.14f, fadeAlpha)); int num = activeEventsStatusText.Split(new char[1] { '\n' }).Length; float num2 = Mathf.Max(90f, 24f + (float)num * 22f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num2); DrawModernCard(rect, new Color(1f, 0.62f, 0.14f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)4 }; val.normal.textColor = new Color(1f, 0.9f, 0.65f, fadeAlpha); val.wordWrap = true; GUIStyle val2 = val; GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 24f, ((Rect)(ref rect)).height - 20f), activeEventsStatusText, val2); return yOffset + num2 + 10f; } private float DrawChallengeSection(Rect viewRect, float yOffset, bool isRu) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: 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_012a: 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_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Expected O, but got Unknown //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0282: Unknown result type (might be due to invalid IL or missing references) //IL_028a: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Expected O, but got Unknown //IL_032b: Unknown result type (might be due to invalid IL or missing references) ChallengeDefinition activeChallenge = ChallengeManager.ActiveChallenge; if (activeChallenge == null) { return yOffset; } string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "도전 모드" : ((!(value == "Russian")) ? "CHALLENGE MODE" : "РЕЖИМ ЧЕЛЛЕНДЖА")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(activeChallenge.color.r, activeChallenge.color.g, activeChallenge.color.b, fadeAlpha)); bool activeChallengeProgressBlocked = ChallengeManager.ActiveChallengeProgressBlocked; float num = (activeChallengeProgressBlocked ? 104f : 70f); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num); DrawModernCard(rect, activeChallenge.color); float num2 = (Mathf.Sin(Time.unscaledTime * 5.5f) + 1f) * 0.5f; Color val = Color.Lerp(activeChallenge.color, Color.white, num2); GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1, alignment = (TextAnchor)1 }; val2.normal.textColor = new Color(val.r, val.g, val.b, fadeAlpha); GUIStyle val3 = val2; GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 8f, ((Rect)(ref rect)).width - 20f, 24f), activeChallenge.name, val3); GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 13, alignment = (TextAnchor)1 }; val4.normal.textColor = new Color(0.85f, 0.95f, 1f, fadeAlpha); GUIStyle val5 = val4; text = ((value == "Korean") ? $"목표: {ChallengeManager.ActiveTarget} 레벨 도달" : ((!(value == "Russian")) ? $"Target: reach level {ChallengeManager.ActiveTarget}" : $"Цель: достичь {ChallengeManager.ActiveTarget} уровня")); string text2 = text; GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 36f, ((Rect)(ref rect)).width - 20f, 22f), text2, val5); if (activeChallengeProgressBlocked) { GUIStyle val6 = new GUIStyle(GUI.skin.label) { fontSize = 12, fontStyle = (FontStyle)1, alignment = (TextAnchor)1, wordWrap = true }; val6.normal.textColor = new Color(1f, 0.22f, 0.18f, fadeAlpha); GUIStyle val7 = val6; text = ((value == "Korean") ? "진행이 기록되지 않습니다. 1레벨부터 새로 시작하세요." : ((!(value == "Russian")) ? "Progress will not count. Start a fresh run from level 1." : "Прогресс не засчитается. Начните новый забег с 1 уровня.")); string text3 = text; GUI.Label(new Rect(((Rect)(ref rect)).x + 12f, ((Rect)(ref rect)).y + 62f, ((Rect)(ref rect)).width - 24f, 36f), text3, val7); } return yOffset + num + 10f; } private float DrawEconomySection(Rect viewRect, float yOffset, bool isRu) { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: 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_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0179: 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_01a0: Expected O, but got Unknown //IL_01cc: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Expected O, but got Unknown //IL_0262: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; string economyName = REPOConomyPlugin.GetEconomyName(); string economyFlavor = REPOConomyPlugin.GetEconomyFlavor(); string text = REPOConomyPlugin.MinPercent.ToString("+#0.##;-#0.##;0"); string text2 = REPOConomyPlugin.MaxPercent.ToString("+#0.##;-#0.##;0"); string text3 = ((value == "Korean") ? "경제" : ((!(value == "Russian")) ? "ECONOMY" : "ЭКОНОМИКА")); string title = text3; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(0.2f, 0.8f, 0.4f, fadeAlpha)); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 80f); DrawModernCard(rect, REPOConomyPlugin.CurrentEconomyColor); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 20, fontStyle = (FontStyle)1, alignment = (TextAnchor)1 }; val.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha); GUIStyle val2 = val; GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 20f, 25f), economyName ?? "", val2); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 16, alignment = (TextAnchor)1 }; val3.normal.textColor = new Color(0.8f, 0.9f, 1f, fadeAlpha); GUIStyle val4 = val3; GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 35f, ((Rect)(ref rect)).width - 20f, 20f), text + "% — " + text2 + "%", val4); GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 12, alignment = (TextAnchor)1 }; val5.normal.textColor = new Color(0.7f, 0.7f, 0.7f, fadeAlpha); val5.wordWrap = true; GUIStyle val6 = val5; GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 55f, ((Rect)(ref rect)).width - 20f, 20f), economyFlavor, val6); return yOffset + 90f; } private float DrawModifiersSection(Rect viewRect, float yOffset, bool isRu) { //IL_0112: 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_015d: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; int count = REPOEventManager.ActiveEvents.Count; if (count == 0) { return yOffset; } int count2 = REPOEventManager.ForcedEvents.Count; int num = count - count2; string text = ((value == "Korean") ? "수정자" : ((!(value == "Russian")) ? "MODIFIERS" : "МОДИФИКАТОРЫ")); string text2 = text; if (count2 > 0) { text = ((value == "Korean") ? "선택됨" : ((!(value == "Russian")) ? "selected" : "выбрано")); string text3 = text; text = ((value == "Korean") ? "강제" : ((!(value == "Russian")) ? "forced" : "принудительно")); string text4 = text; text2 += $" ({num} {text3}, {count2} {text4})"; } yOffset = DrawModernCategory(viewRect, yOffset, text2, new Color(0.8f, 0.3f, 1f, fadeAlpha)); foreach (GameEvent activeEvent in REPOEventManager.ActiveEvents) { bool isForced = REPOEventManager.ForcedEvents.Contains(activeEvent); yOffset = DrawModifierCard(viewRect, yOffset, activeEvent, isRu, isForced); } return yOffset + 10f; } private float DrawModifierCard(Rect viewRect, float yOffset, GameEvent evt, bool isRu, bool isForced = false) { //IL_0089: 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_0090: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_0114: 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_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016d: Expected O, but got Unknown //IL_0199: Unknown result type (might be due to invalid IL or missing references) string text = evt.GetName(); string description = evt.GetDescription(); if (isForced) { text = text ?? ""; } float num = 60f; Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num); if (!isForced) { _ = evt.color; } else { new Color(evt.color.r * 0.7f, evt.color.g * 0.7f, evt.color.b * 0.7f, evt.color.a); } DrawModernCard(rect, evt.color); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 16, fontStyle = (FontStyle)1, alignment = (TextAnchor)0 }; val.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha); GUIStyle val2 = val; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, ((Rect)(ref rect)).y + 8f, ((Rect)(ref rect)).width - 30f, 25f), text, val2); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 12, alignment = (TextAnchor)0 }; val3.normal.textColor = new Color(0.8f, 0.8f, 0.8f, fadeAlpha); val3.wordWrap = true; GUIStyle val4 = val3; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, ((Rect)(ref rect)).y + 30f, ((Rect)(ref rect)).width - 30f, 26f), description, val4); return yOffset + num + 8f; } private float DrawLevelScalingSection(Rect viewRect, float yOffset, bool isRu) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Expected O, but got Unknown //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02f3: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "레벨 스케일링" : ((!(value == "Russian")) ? "LEVEL SCALING" : "СКЕЙЛИНГ УРОВНЕЙ")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(0.2f, 0.6f, 1f, fadeAlpha)); int levelsCompleted = RunManager.instance.levelsCompleted; int scaledModuleAmount = LevelScalingImprovements.GetScaledModuleAmount(levelsCompleted); int scaledExtractionAmount = LevelScalingImprovements.GetScaledExtractionAmount(levelsCompleted); float scaledHaulMultiplier = LevelScalingImprovements.GetScaledHaulMultiplier(levelsCompleted); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 100f); DrawModernCard(rect, new Color(0.2f, 0.6f, 1f, 0.3f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)0 }; val.normal.textColor = new Color(0.9f, 0.9f, 1f, fadeAlpha); GUIStyle val2 = val; float num = ((Rect)(ref rect)).y + 10f; float num2 = 20f; text = ((value == "Korean") ? "레벨" : ((!(value == "Russian")) ? "Level" : "Уровень")); string arg = text; text = ((value == "Korean") ? "모듈" : ((!(value == "Russian")) ? "Modules" : "Модули")); string arg2 = text; text = ((value == "Korean") ? "추출" : ((!(value == "Russian")) ? "Extractions" : "Экстракции")); string arg3 = text; text = ((value == "Korean") ? "운반" : ((!(value == "Russian")) ? "Haul" : "Хаул")); string arg4 = text; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), $"\ud83d\udcca {arg}: {levelsCompleted + 1}", val2); num += num2; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), $"\ud83d\udd27 {arg2}: {scaledModuleAmount}", val2); num += num2; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), $"\ud83d\udeaa {arg3}: {scaledExtractionAmount}", val2); num += num2; GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), $"\ud83d\udcb0 {arg4}: {scaledHaulMultiplier:F2}x", val2); return yOffset + 110f; } private float DrawMoonScalingSection(Rect viewRect, float yOffset, bool isRu) { //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Expected O, but got Unknown //IL_0235: 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_0252: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Expected O, but got Unknown //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_03ba: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "달 단계" : ((!(value == "Russian")) ? "MOON PHASE" : "ФАЗА ЛУНЫ")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(0.6f, 0.5f, 0.9f, fadeAlpha)); int currentMoonPhase = MoonScalingPatches.GetCurrentMoonPhase(); string text2; List list; if (currentMoonPhase == 0) { text = ((value == "Korean") ? "달 없음" : ((!(value == "Russian")) ? "No Moon" : "Нет Луны")); text2 = text; list = new List(); } else { text2 = RunManager.instance.MoonGetName(currentMoonPhase); list = (from attribute in RunManager.instance.MoonGetAttributes(currentMoonPhase) select (((Object)(object)attribute.LocalizedText != (Object)null) ? attribute.LocalizedText.GetLocalizedString() : null) ?? attribute.text into attributeText where !string.IsNullOrWhiteSpace(attributeText) select attributeText).ToList(); } int levelsToNextPhase = MoonScalingPatches.GetLevelsToNextPhase(); Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 90f); DrawModernCard(rect, new Color(0.6f, 0.5f, 0.9f, 0.3f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1, alignment = (TextAnchor)1 }; val.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha); GUIStyle val2 = val; text = ((value == "Korean") ? "단계" : ((!(value == "Russian")) ? "Phase" : "Фаза")); string arg = text; string text3 = ((currentMoonPhase == 0) ? ("\ud83c\udf11 " + text2) : $"\ud83c\udf19 {text2} ({arg} {currentMoonPhase})"); GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 20f, 25f), text3, val2); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 12, alignment = (TextAnchor)1 }; val3.normal.textColor = new Color(0.8f, 0.8f, 1f, fadeAlpha); val3.wordWrap = true; GUIStyle val4 = val3; string text4; if (levelsToNextPhase < 0) { text = ((value == "Korean") ? "최대 단계 도달" : ((!(value == "Russian")) ? "Max phase reached" : "Максимальная фаза достигнута")); text4 = text; } else { text = ((value == "Korean") ? $"다음 단계까지 {levelsToNextPhase} 레벨" : ((!(value == "Russian")) ? $"Next phase in {levelsToNextPhase} levels" : $"До следующей фазы: {levelsToNextPhase} ур.")); text4 = text; } GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 35f, ((Rect)(ref rect)).width - 20f, 20f), text4, val4); string text5 = ((list.Count > 0) ? string.Join(" • ", list) : ""); if (!string.IsNullOrEmpty(text5)) { GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 55f, ((Rect)(ref rect)).width - 20f, 30f), text5, val4); } return yOffset + 100f; } private float DrawMapScalingSection(Rect viewRect, float yOffset, bool isRu) { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0210: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0247: 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_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Expected O, but got Unknown //IL_0358: 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_041f: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_0589: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; int level = RunManager.instance.levelsCompleted + 1; float num = CalculateScaling(level, REPOConfig.EnableEnemyHPScaling.Value, REPOConfig.EnemyHPStartLevel.Value, REPOConfig.EnemyHPMultiplier.Value, REPOConfig.EnemyHPUseExponentialScaling.Value, REPOConfig.EnemyHPMaxLevel.Value); float num2 = CalculateScaling(level, REPOConfig.EnableEnemyCapScaling.Value, REPOConfig.EnemyCapStartLevel.Value, REPOConfig.EnemyCapMultiplier.Value, REPOConfig.EnemyCapUseExponentialScaling.Value, REPOConfig.EnemyCapMaxLevel.Value); float num3 = CalculateScaling(level, REPOConfig.EnableMapValueScaling.Value, REPOConfig.MapValueStartLevel.Value, REPOConfig.MapValueMultiplier.Value, REPOConfig.MapValueUseExponentialScaling.Value, REPOConfig.MapValueMaxLevel.Value); float playerDamageFromEnemyHPMultiplier = EnemyScaling.GetPlayerDamageFromEnemyHPMultiplier(); float weaponDamageFromEnemyHPMultiplier = EnemyScaling.GetWeaponDamageFromEnemyHPMultiplier(); float enemyRespawnFromCapMultiplier = EnemyScaling.GetEnemyRespawnFromCapMultiplier(); if (!(num > 1f) && !(num2 > 1f) && !(num3 > 1f) && !(playerDamageFromEnemyHPMultiplier > 1f) && !(weaponDamageFromEnemyHPMultiplier > 1f) && !(enemyRespawnFromCapMultiplier > 1f)) { return yOffset; } string text = ((value == "Korean") ? "맵 스케일링" : ((!(value == "Russian")) ? "MAP SCALING" : "СКЕЙЛИНГ КАРТЫ")); string title = text; yOffset = DrawModernCategory(viewRect, yOffset, title, new Color(1f, 0.4f, 0.4f, fadeAlpha)); float num4 = 0f; if (num > 1f) { num4 += 25f; } if (num2 > 1f) { num4 += 25f; } if (num3 > 1f) { num4 += 25f; } if (playerDamageFromEnemyHPMultiplier > 1f) { num4 += 25f; } if (weaponDamageFromEnemyHPMultiplier > 1f) { num4 += 25f; } if (enemyRespawnFromCapMultiplier > 1f) { num4 += 25f; } Rect rect = default(Rect); ((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num4 + 10f); DrawModernCard(rect, new Color(1f, 0.4f, 0.4f, 0.2f)); GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 13, alignment = (TextAnchor)0 }; val.normal.textColor = new Color(1f, 0.9f, 0.9f, fadeAlpha); GUIStyle val2 = val; float num5 = ((Rect)(ref rect)).y + 8f; text = ((value == "Korean") ? "적 HP" : ((!(value == "Russian")) ? "Enemy HP" : "HP врагов")); string arg = text; text = ((value == "Korean") ? "적 한도" : ((!(value == "Russian")) ? "Enemy Cap" : "Лимит врагов")); string arg2 = text; text = ((value == "Korean") ? "맵 가치" : ((!(value == "Russian")) ? "Map Value" : "Стоимость карты")); string arg3 = text; if (num > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), $"\ud83d\udc79 {arg}: x{num:F2} (+{(num - 1f) * 100f:F0}%)", val2); num5 += 25f; } if (num2 > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), $"\ud83d\udc79 {arg2}: x{num2:F2} (+{(num2 - 1f) * 100f:F0}%)", val2); num5 += 25f; } if (num3 > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), $"\ud83d\udc8e {arg3}: x{num3:F2} (+{(num3 - 1f) * 100f:F0}%)", val2); } float num6 = ((Rect)(ref rect)).y + 8f; if (num > 1f) { num6 += 25f; } if (num2 > 1f) { num6 += 25f; } if (num3 > 1f) { num6 += 25f; } if (playerDamageFromEnemyHPMultiplier > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num6, ((Rect)(ref rect)).width - 30f, 22f), $"! Player Damage Taken: x{playerDamageFromEnemyHPMultiplier:F2} (+{(playerDamageFromEnemyHPMultiplier - 1f) * 100f:F0}%)", val2); num6 += 25f; } if (weaponDamageFromEnemyHPMultiplier > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num6, ((Rect)(ref rect)).width - 30f, 22f), $"+ Damage To Enemies: x{weaponDamageFromEnemyHPMultiplier:F2} (+{(weaponDamageFromEnemyHPMultiplier - 1f) * 100f:F0}%)", val2); num6 += 25f; } if (enemyRespawnFromCapMultiplier > 1f) { GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num6, ((Rect)(ref rect)).width - 30f, 22f), $"> Enemy Respawn Time: x{enemyRespawnFromCapMultiplier:F2} (+{(enemyRespawnFromCapMultiplier - 1f) * 100f:F0}%)", val2); } return yOffset + num4 + 20f; } private float CalculateScaling(int level, bool enabled, int startLevel, float multiplier, bool exponential, int maxLevel) { if (!enabled || level < startLevel) { return 1f; } int num = Mathf.Min(level, maxLevel); if (exponential) { return Mathf.Pow(multiplier, (float)(num - startLevel + 1)); } return 1f + (float)(num - startLevel) * (multiplier - 1f); } private void DrawModernCard(Rect rect, Color accentColor) { //IL_0028: 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_0078: 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_00a8: 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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: 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_010b: Unknown result type (might be due to invalid IL or missing references) Rect val = new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height); GUI.color = new Color(0f, 0f, 0f, 0.3f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); GUI.color = new Color(0.1f, 0.12f, 0.15f, 0.9f * fadeAlpha); GUI.DrawTexture(rect, (Texture)(object)bgTexture); Rect val2 = new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 4f, ((Rect)(ref rect)).height); GUI.color = new Color(accentColor.r, accentColor.g, accentColor.b, 0.8f * fadeAlpha); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture); DrawBorder(rect, new Color(0.3f, 0.3f, 0.4f, 0.5f * fadeAlpha), 1f); GUI.color = Color.white; } private float DrawModernCategory(Rect viewRect, float yOffset, string title, Color color) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001e: 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_002b: 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_0039: 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_0051: Expected O, but got Unknown //IL_0051: 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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = 18, fontStyle = (FontStyle)1, alignment = (TextAnchor)0 }; val.normal.textColor = new Color(color.r, color.g, color.b, fadeAlpha); GUIStyle val2 = val; GUI.color = new Color(color.r, color.g, color.b, 0.3f * fadeAlpha); GUI.Label(new Rect(12f, yOffset + 2f, ((Rect)(ref viewRect)).width - 20f, 25f), title, val2); GUI.color = Color.white; GUI.Label(new Rect(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 25f), title, val2); Rect val3 = new Rect(10f, yOffset + 27f, ((Rect)(ref viewRect)).width - 20f, 2f); GUI.color = new Color(color.r, color.g, color.b, 0.4f * fadeAlpha); GUI.DrawTexture(val3, (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; return yOffset + 35f; } private float DrawModernChanceItem(Rect viewRect, float yOffset, string icon, string name, float chance, Color color) { //IL_003a: 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_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Expected O, but got Unknown //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0183: Expected O, but got Unknown //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: 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_01d6: 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_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Expected O, but got Unknown //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) Rect val = default(Rect); ((Rect)(ref val))..ctor(15f, yOffset, ((Rect)(ref viewRect)).width - 30f, 28f); GUI.color = new Color(0.08f, 0.1f, 0.12f, 0.7f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); float num = (((Rect)(ref viewRect)).width - 30f) * (chance / 100f); Rect val2 = new Rect(15f, yOffset, num, 28f); GUI.color = new Color(color.r * 0.3f, color.g * 0.3f, color.b * 0.3f, 0.4f * fadeAlpha); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture); GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 16, alignment = (TextAnchor)3 }; val3.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha); GUIStyle val4 = val3; GUI.color = Color.white; GUI.Label(new Rect(((Rect)(ref val)).x + 8f, ((Rect)(ref val)).y, 30f, ((Rect)(ref val)).height), icon, val4); GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)3 }; val5.normal.textColor = new Color(color.r, color.g, color.b, fadeAlpha); GUIStyle val6 = val5; GUI.Label(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y, ((Rect)(ref val)).width - 80f, ((Rect)(ref val)).height), name, val6); GUIStyle val7 = new GUIStyle(GUI.skin.label) { fontSize = 14, fontStyle = (FontStyle)1, alignment = (TextAnchor)5 }; val7.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha); GUIStyle val8 = val7; GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width - 10f, ((Rect)(ref val)).height), $"{chance:F1}%", val8); DrawBorder(val, new Color(0.2f, 0.2f, 0.3f, 0.4f * fadeAlpha), 1f); return yOffset + 32f; } private void DrawFooterSection(Rect mainRect, int level) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Expected O, but got Unknown //IL_0267: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + ((Rect)(ref mainRect)).height - 50f, ((Rect)(ref mainRect)).width, 50f); GUI.color = new Color(0.12f, 0.15f, 0.2f, 0.8f * fadeAlpha); GUI.DrawTexture(val, (Texture)(object)bgTexture); Rect val2 = new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 1f); GUI.color = new Color(0.3f, 0.6f, 1f, 0.5f * fadeAlpha); GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture); GUI.color = Color.white; string text = ((value == "Korean") ? "난이도" : ((!(value == "Russian")) ? "Difficulty" : "Сложность")); string text2 = text; text = ((value == "Korean") ? "레벨" : ((!(value == "Russian")) ? "Level" : "Уровень")); string text3 = text; text = ((value == "Korean") ? "플레이어" : ((!(value == "Russian")) ? "Players" : "Игроки")); string text4 = text; string text5 = "Seed"; REPODifficultyManager.GetDifficultyColor(); string difficultyText = REPODifficultyManager.GetDifficultyText(); string currentSeed = REPOSeedManager.CurrentSeed; GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 14, alignment = (TextAnchor)4 }; val3.normal.textColor = new Color(0.8f, 0.9f, 1f, fadeAlpha); GUIStyle val4 = val3; string text6 = $"{text2}: {difficultyText} ({REPODifficultyManager.CurrentDifficulty:F1}/{REPOConfig.DifficultyMaxCap.Value}) | {text3}: {level} | {text5}: {currentSeed} | {text4}: {GameDirector.instance.PlayerList.Count}"; GUI.Label(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y + 15f, ((Rect)(ref val)).width - 20f, 30f), text6, val4); } private string GetEventIcon(EventType type) { return type switch { EventType.VeryGood => "\ud83d\udfe2", EventType.Good => "\ud83d\udfe1", EventType.Neutral => "⚪", EventType.Bad => "\ud83d\udfe0", EventType.VeryBad => "\ud83d\udd34", _ => "⚫", }; } private string GetEventTypeName(EventType type, bool isRu) { string value = REPOConfig.UILanguage.Value; return type switch { EventType.VeryGood => (value == "Korean") ? "매우 좋음" : ((!(value == "Russian")) ? "Very Good" : "Очень Хорошо"), EventType.Good => (value == "Korean") ? "좋음" : ((!(value == "Russian")) ? "Good" : "Хорошо"), EventType.Neutral => (value == "Korean") ? "중립" : ((!(value == "Russian")) ? "Neutral" : "Нейтрально"), EventType.Bad => (value == "Korean") ? "나쁨" : ((!(value == "Russian")) ? "Bad" : "Плохо"), EventType.VeryBad => (value == "Korean") ? "매우 나쁨" : ((!(value == "Russian")) ? "Very Bad" : "Очень Плохо"), _ => "Unknown", }; } private string GetCategoryName(EventCategory category, bool isRu) { string value = REPOConfig.UILanguage.Value; return category switch { EventCategory.LootModifier => (value == "Korean") ? "전리품" : ((!(value == "Russian")) ? "Loot" : "Лут"), EventCategory.EnemyModifier => (value == "Korean") ? "적" : ((!(value == "Russian")) ? "Enemy" : "Враги"), EventCategory.PlayerModifier => (value == "Korean") ? "플레이어" : ((!(value == "Russian")) ? "Player" : "Игрок"), EventCategory.EnvironmentModifier => (value == "Korean") ? "환경" : ((!(value == "Russian")) ? "Environment" : "Окружение"), _ => "Unknown", }; } private Color GetCategoryColor(EventCategory category) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_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_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) return (Color)(category switch { EventCategory.LootModifier => new Color(1f, 0.8f, 0.2f), EventCategory.EnemyModifier => new Color(1f, 0.3f, 0.3f), EventCategory.PlayerModifier => new Color(0.3f, 0.7f, 1f), EventCategory.EnvironmentModifier => new Color(0.5f, 1f, 0.5f), _ => Color.white, }); } } [HarmonyPatch(typeof(EnemyDirector))] public static class EnemyDirectorSeededPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] public static void AwakePrefix() { REPOSeedManager.ResetEnemyRandom(); } [HarmonyPatch("Start")] [HarmonyPrefix] public static void StartPrefix() { Random.InitState(REPOSeedManager.EnemyNext()); } [HarmonyPatch("PickEnemies")] [HarmonyPrefix] public static bool PickEnemiesPrefix(EnemyDirector __instance, List _enemiesList) { Random.InitState(REPOSeedManager.EnemyNext()); List list = AccessTools.Field(typeof(EnemyDirector), "enemyList").GetValue(__instance) as List; List list2 = AccessTools.Field(typeof(EnemyDirector), "enemyListCurrent").GetValue(__instance) as List; int num = DataDirector.instance.SettingValueFetch((Setting)31); ListExtension.Shuffle((IList)_enemiesList); EnemySetup val = null; float num2 = -1f; foreach (EnemySetup _enemies in _enemiesList) { if ((_enemies.levelsCompletedCondition && (RunManager.instance.levelsCompleted < _enemies.levelsCompletedMin || (_enemies.levelsCompletedMax != 0 && RunManager.instance.levelsCompleted > _enemies.levelsCompletedMax))) || num < _enemies.runsPlayed) { continue; } int num3 = 0; foreach (EnemySetup item in RunManager.instance.enemiesSpawned) { if ((Object)(object)item == (Object)(object)_enemies) { num3++; } } int num4 = 0; foreach (EnemySetup item2 in list) { if ((Object)(object)item2 == (Object)(object)_enemies) { num4++; } } float num5 = 100f; if (Object.op_Implicit((Object)(object)_enemies.rarityPreset)) { num5 = _enemies.rarityPreset.chance; } float num6 = Mathf.Max(1f, num5 - 30f * (float)num3 - 10f * (float)num4); float num7 = Random.Range(0f, num6); if (num7 > num2) { val = _enemies; num2 = num7; } } if ((Object)(object)val != (Object)null) { list2.Add(val); list.Add(val); } return false; } } [HarmonyPatch(typeof(EnemyParent))] public static class EnemyParentSeededPatch { [HarmonyPatch("Awake")] [HarmonyPrefix] public static void AwakePrefix(EnemyParent __instance) { if (!REPOSeedManager.EnemyOrbSeeds.ContainsKey(__instance)) { int value = REPOSeedManager.ValuableNext(); REPOSeedManager.EnemyOrbSeeds.Add(__instance, value); } } [HarmonyPatch("Despawn")] [HarmonyPrefix] public static void DespawnPrefix(EnemyParent __instance) { if (REPOSeedManager.EnemyOrbSeeds.ContainsKey(__instance)) { REPOSeedManager.ScheduledOrbSeed = REPOSeedManager.EnemyOrbSeeds[__instance]; REPOSeedManager.EnemyOrbSeeds[__instance] = REPOSeedManager.ValuableNext(); } } } public static class EnemyScaling { [HarmonyPatch(typeof(EnemyHealth), "OnSpawn")] public static class Patch_EnemyHealth_OnSpawn { private static Dictionary originalHealthValues = new Dictionary(); private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); public static void Reset() { originalHealthValues.Clear(); scaledDespawnTimers.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[EnemyScaling] Dictionary cleared"); } private static void Postfix(EnemyHealth __instance) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !REPOConfig.EnableEnemyHPScaling.Value || (Object)(object)RunManager.instance == (Object)null) { return; } int num = RunManager.instance.levelsCompleted + 1; int value = REPOConfig.EnemyHPStartLevel.Value; int value2 = REPOConfig.EnemyHPScalingLevelCap.Value; int num2 = Mathf.Min(num, value2); if (num2 >= value) { if (!originalHealthValues.ContainsKey(__instance)) { originalHealthValues[__instance] = __instance.health; REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Saved original HP: {__instance.health} for enemy"); } int num3 = originalHealthValues[__instance]; float enemyHPMultiplier = GetEnemyHPMultiplier(); int num4 = (__instance.health = Mathf.RoundToInt((float)num3 * enemyHPMultiplier)); FI_healthCurrent.SetValue(__instance, num4); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy HP scaled: {num4} (original: {num3}, multiplier: {enemyHPMultiplier:F3}, level: {num}, effective: {num2})"); } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_EnemyDirector_AmountSetup { private static void Postfix(EnemyDirector __instance) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !REPOConfig.EnableEnemyCapScaling.Value || (Object)(object)RunManager.instance == (Object)null) { return; } int num = RunManager.instance.levelsCompleted + 1; int value = REPOConfig.EnemyCapStartLevel.Value; int value2 = REPOConfig.EnemyCapScalingLevelCap.Value; int num2 = Mathf.Min(num, value2); if (num2 < value) { return; } int num3 = (int)FI_totalAmount.GetValue(__instance); float enemyCapMultiplier = GetEnemyCapMultiplier(); int num4 = Mathf.RoundToInt((float)num3 * enemyCapMultiplier); FI_totalAmount.SetValue(__instance, num4); List list = (List)AccessTools.Field(typeof(EnemyDirector), "enemyList").GetValue(__instance); int count = list.Count; int num5 = num4 - num3; if (count > 0) { for (int i = 0; i < num5; i++) { int index = REPOSeedManager.Range(0, count); list.Add(list[index]); } } REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy cap scaled: {num4} (original: {num3}, multiplier: {enemyCapMultiplier:F3}, level: {num}, effective: {num2}), enemyList: {count} -> {list.Count}"); } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_EnemyParent_Despawn { private static void Postfix(EnemyParent __instance) { if (SemiFunc.IsMasterClientOrSingleplayer()) { float enemyRespawnFromCapMultiplier = GetEnemyRespawnFromCapMultiplier(); if (!(enemyRespawnFromCapMultiplier <= 1f) && !scaledDespawnTimers.Contains(__instance)) { __instance.DespawnedTimer *= enemyRespawnFromCapMultiplier; scaledDespawnTimers.Add(__instance); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy respawn timer scaled by cap multiplier x{enemyRespawnFromCapMultiplier:F3}: {__instance.DespawnedTimer:F1}s"); } } } } [HarmonyPatch(typeof(EnemyParent), "Spawn")] public static class Patch_EnemyParent_Spawn { private static void Postfix(EnemyParent __instance) { scaledDespawnTimers.Remove(__instance); } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_EnemyHealth_Hurt_DamageScaling { private static void Prefix(ref int _damage) { if (SemiFunc.RunIsLevel()) { float weaponDamageFromEnemyHPMultiplier = GetWeaponDamageFromEnemyHPMultiplier(); if (!(weaponDamageFromEnemyHPMultiplier <= 1f) && _damage > 0) { int num = _damage; _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * weaponDamageFromEnemyHPMultiplier)); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy damage scaled with HP: {num} -> {_damage} (x{weaponDamageFromEnemyHPMultiplier:F3})"); } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_PlayerHealth_Hurt_EnemyHPDamageScaling { private static void Prefix(ref int damage) { if (SemiFunc.RunIsLevel() && damage > 0) { float playerDamageFromEnemyHPMultiplier = GetPlayerDamageFromEnemyHPMultiplier(); if (!(playerDamageFromEnemyHPMultiplier <= 1f)) { int num = damage; damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * playerDamageFromEnemyHPMultiplier)); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Player damage scaled with enemy HP: {num} -> {damage} (x{playerDamageFromEnemyHPMultiplier:F3})"); } } } } private static readonly HashSet scaledDespawnTimers = new HashSet(); private static readonly FieldInfo FI_totalAmount = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); private static float GetLevelScalingMultiplier(bool enabled, int startLevel, int levelCap, float perLevelMultiplier, bool exponential) { if (!enabled || (Object)(object)RunManager.instance == (Object)null) { return 1f; } int num = Mathf.Min(RunManager.instance.levelsCompleted + 1, levelCap); if (num < startLevel) { return 1f; } if (exponential) { return Mathf.Pow(perLevelMultiplier, (float)(num - startLevel + 1)); } return 1f + (float)(num - startLevel) * (perLevelMultiplier - 1f); } public static float GetEnemyHPMultiplier() { return GetLevelScalingMultiplier(REPOConfig.EnableEnemyHPScaling.Value, REPOConfig.EnemyHPStartLevel.Value, REPOConfig.EnemyHPScalingLevelCap.Value, REPOConfig.EnemyHPMultiplier.Value, REPOConfig.EnemyHPUseExponentialScaling.Value); } public static float GetEnemyCapMultiplier() { return GetLevelScalingMultiplier(REPOConfig.EnableEnemyCapScaling.Value, REPOConfig.EnemyCapStartLevel.Value, REPOConfig.EnemyCapScalingLevelCap.Value, REPOConfig.EnemyCapMultiplier.Value, REPOConfig.EnemyCapUseExponentialScaling.Value); } public static float GetPlayerDamageFromEnemyHPMultiplier() { if (!REPOConfig.ScalePlayerDamageWithEnemyHP.Value) { return 1f; } float enemyHPMultiplier = GetEnemyHPMultiplier(); float value = REPOConfig.PlayerDamageEnemyHPScaleStrength.Value; return Mathf.Max(1f, 1f + (enemyHPMultiplier - 1f) * value); } public static float GetWeaponDamageFromEnemyHPMultiplier() { if (!REPOConfig.ScaleEnemyDamageWithEnemyHP.Value) { return 1f; } float enemyHPMultiplier = GetEnemyHPMultiplier(); float value = REPOConfig.EnemyDamageEnemyHPScaleStrength.Value; return Mathf.Max(1f, 1f + (enemyHPMultiplier - 1f) * value); } public static float GetEnemyRespawnFromCapMultiplier() { if (!REPOConfig.ScaleEnemyRespawnWithEnemyCap.Value) { return 1f; } float enemyCapMultiplier = GetEnemyCapMultiplier(); float value = REPOConfig.EnemyRespawnCapScaleStrength.Value; return Mathf.Max(1f, 1f + (enemyCapMultiplier - 1f) * value); } } public static class ItemBundlesCompat { private static bool? _isInstalled; private static object _itemBundlesInstance; private static FieldInfo _itemDictionaryShopField; private static FieldInfo _blacklistField; public static bool IsInstalled { get { if (!_isInstalled.HasValue) { _isInstalled = Chainloader.PluginInfos.ContainsKey("SeroRonin.ItemBundles"); if (_isInstalled.Value) { InitializeReflection(); } } return _isInstalled.Value; } } private static void InitializeReflection() { try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "ItemBundles"); if (assembly != null) { Type type = assembly.GetType("ItemBundles.ItemBundles"); if (type != null) { _itemBundlesInstance = AccessTools.Property(type, "Instance").GetValue(null); _itemDictionaryShopField = AccessTools.Field(type, "itemDictionaryShop"); _blacklistField = AccessTools.Field(type, "itemDictionaryShopBlacklist"); REPOConomyPlugin.Logger.LogInfo((object)"[ItemBundlesCompat] Compatibility initialized successfully."); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ItemBundlesCompat] Init failed: " + ex.Message)); _isInstalled = false; } } public static Dictionary GetShopItems() { if (!IsInstalled || _itemBundlesInstance == null) { return StatsManager.instance.itemDictionary; } try { Dictionary dictionary = _itemDictionaryShopField.GetValue(_itemBundlesInstance) as Dictionary; if (dictionary == null || dictionary.Count == 0) { REPOConomyPlugin.Logger.LogInfo((object)"[ItemBundlesCompat] Dictionary empty, populating manually..."); dictionary = PopulateManually(); } return dictionary; } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[ItemBundlesCompat] Error getting items: {arg}"); return StatsManager.instance.itemDictionary; } } private static Dictionary PopulateManually() { Dictionary dictionary = new Dictionary(); Dictionary obj = _blacklistField.GetValue(_itemBundlesInstance) as Dictionary; List list = obj?.Keys.ToList() ?? new List(); List list2 = obj?.Values.ToList() ?? new List(); foreach (KeyValuePair item in StatsManager.instance.itemDictionary) { if (!list.Contains(item.Key) && !list2.Contains(item.Value)) { dictionary.Add(item.Key, item.Value); } } return dictionary; } } [HarmonyPatch(typeof(LevelGenerator))] public static class LevelGeneratorSeededPatch { [HarmonyPatch("Generate")] [HarmonyPrefix] public static void GeneratePrefix() { REPOSeedManager.ResetLevelRandom(); REPOSeedManager.ResetTruckRandom(); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] public static void StartRoomGenerationPrefix() { Random.InitState(REPOSeedManager.LevelNext()); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] public static void TileGenerationPrefix() { Random.InitState(REPOSeedManager.LevelNext()); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] public static void ModuleGenerationPrefix() { Random.InitState(REPOSeedManager.LevelNext()); } [HarmonyPatch("PlayerSpawn")] [HarmonyPrefix] public static void PlayerSpawnPrefix() { Random.InitState(REPOSeedManager.LevelNext()); } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPrefix] public static void EnemySetupPrefix() { Random.InitState(REPOSeedManager.EnemyNext()); } } public static class LevelMilestoneRewardManager { [CompilerGenerated] private sealed class d__7 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string message; private int 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Expected O, but got Unknown //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_0189: 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_0043: 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 switch (<>1__state) { default: return false; case 0: <>1__state = -1; 5__2 = 0; goto IL_0063; case 1: <>1__state = -1; 5__2++; goto IL_0063; case 2: { <>1__state = -1; bool flag = false; try { if ((Object)(object)RunManager.instance != (Object)null && SemiFunc.IsMasterClientOrSingleplayer()) { RunManager.instance.ChangeLevel(false, false, (ChangeLevelType)4); flag = true; } } catch (Exception ex2) { REPOConomyPlugin.Logger.LogWarning((object)("[Level100Reward] Return to menu failed: " + ex2.Message)); } if (!flag) { return false; } 5__2 = 0; goto IL_0140; } case 3: <>1__state = -1; 5__2++; goto IL_0140; case 4: { <>1__state = -1; try { MenuManager instance = MenuManager.instance; if (instance != null) { instance.PagePopUp("Level 100 Reward Pack", new Color(1f, 0.84f, 0.18f), message + "\n\nYou can keep playing on your save.", "OK", true); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Level100Reward] Popup failed: " + ex.Message)); } return false; } IL_0063: if (5__2 < 200 && ((Object)(object)PlayerAvatar.instance == (Object)null || !SemiFunc.RunIsLevel())) { <>2__current = (object)new WaitForSecondsRealtime(0.25f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSecondsRealtime(2f); <>1__state = 2; return true; IL_0140: if (5__2 < 120 && (!((Object)(object)MenuManager.instance != (Object)null) || !MenuManager.instance.PageCheck((MenuPageIndex)0))) { <>2__current = (object)new WaitForSecondsRealtime(0.1f); <>1__state = 3; return true; } <>2__current = (object)new WaitForSecondsRealtime(0.35f); <>1__state = 4; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const int Level100Target = 100; public const string Level100UnlockKey = "level_100_reward_pack"; public const string Level100ModifierId = "centurion_compound"; public const REPOConomyPlugin.EconomyType Level100Economy = REPOConomyPlugin.EconomyType.CenturionMarket; public const ShopEconomyType Level100ShopEconomy = ShopEconomyType.CenturionSupply; public static bool IsLevel100Unlocked() { REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); bool value = default(bool); return (Object)(object)rEPOStatsManager != (Object)null && rEPOStatsManager.stats.challengeRewardUnlockAnnouncements != null && rEPOStatsManager.stats.challengeRewardUnlockAnnouncements.TryGetValue("level_100_reward_pack", out value) && value; } public static void TryUnlockLevel100Pack(int currentLevel) { if (currentLevel < 100 || ChallengeManager.HasActiveChallenge || IsLevel100Unlocked()) { return; } REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if (!((Object)(object)rEPOStatsManager == (Object)null)) { rEPOStatsManager.stats.challengeRewardUnlockAnnouncements["level_100_reward_pack"] = true; rEPOStatsManager.SaveStats(); string message = "Congratulations!\nYou reached level 100.\n\nUnlocked rewards:\n- centurion_compound (Modifier)\n" + $"- {REPOConomyPlugin.EconomyType.CenturionMarket} (Economy)\n" + $"- {ShopEconomyType.CenturionSupply} (Shop Economy)"; if ((Object)(object)REPOConomyPlugin.Instance != (Object)null) { ((MonoBehaviour)REPOConomyPlugin.Instance).StartCoroutine(ReturnToMenuAndNotifyLevel100(message)); } else if ((Object)(object)EconomyController.Instance != (Object)null) { ((MonoBehaviour)EconomyController.Instance).StartCoroutine(ReturnToMenuAndNotifyLevel100(message)); } else { REPOConomyPlugin.Logger.LogWarning((object)"[Level100Reward] No coroutine host (Instance & EconomyController null)!"); } REPOConomyNetworkHandler.SyncBlackMarketToClients(); REPOConomyPlugin.Logger.LogInfo((object)"[Level100Reward] Level 100 reward pack unlocked."); } } [IteratorStateMachine(typeof(d__7))] private static IEnumerator ReturnToMenuAndNotifyLevel100(string message) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(0) { message = message }; } public static bool IsRewardEconomy(REPOConomyPlugin.EconomyType economy) { return economy == REPOConomyPlugin.EconomyType.CenturionMarket; } public static bool IsRewardModifier(string modifierId) { return string.Equals(modifierId, "centurion_compound", StringComparison.OrdinalIgnoreCase); } public static bool IsRewardShopEconomy(ShopEconomyType shopEconomy) { return shopEconomy == ShopEconomyType.CenturionSupply; } public static string GetRewardSummary() { return string.Format("{0} (Modifier), {1} (Economy), {2} (Shop Economy)", "centurion_compound", REPOConomyPlugin.EconomyType.CenturionMarket, ShopEconomyType.CenturionSupply); } } [HarmonyPatch(typeof(RunManager))] public static class MoonScalingPatches { private static FieldInfo _moonLevelField; private static FieldInfo _moonLevelChangedField; static MoonScalingPatches() { _moonLevelField = typeof(RunManager).GetField("moonLevel", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); _moonLevelChangedField = typeof(RunManager).GetField("moonLevelChanged", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } [HarmonyPatch("CalculateMoonLevel")] [HarmonyPrefix] public static bool CalculateMoonLevelPrefix(int _levelsCompleted, ref int __result) { if (!REPOConfig.EnableMoonScaling.Value) { return true; } try { float num = Mathf.Max(0.1f, REPOConfig.MoonLevelsPerPhase.Value); int val = Mathf.FloorToInt((float)REPOConfig.MoonMaxLevel.Value / num); int val2 = Mathf.FloorToInt(((float)_levelsCompleted + 1f) / num); __result = Math.Min(val2, val); return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[MoonScaling] Error in CalculateMoonLevel: " + ex.Message)); return true; } } public static int GetCurrentMoonPhase() { if ((Object)(object)RunManager.instance == (Object)null) { return 0; } int levelsCompleted = RunManager.instance.levelsCompleted; if (!REPOConfig.EnableMoonScaling.Value) { return Math.Min((levelsCompleted + 1) / 5, 4); } float num = Mathf.Max(0.1f, REPOConfig.MoonLevelsPerPhase.Value); int val = Mathf.FloorToInt((float)REPOConfig.MoonMaxLevel.Value / num); return Math.Min(Mathf.FloorToInt(((float)levelsCompleted + 1f) / num), val); } public static int GetLevelsToNextPhase() { if ((Object)(object)RunManager.instance == (Object)null) { return 0; } int levelsCompleted = RunManager.instance.levelsCompleted; int currentMoonPhase = GetCurrentMoonPhase(); if (!REPOConfig.EnableMoonScaling.Value) { int num = 4; if (currentMoonPhase >= num) { return -1; } return (currentMoonPhase + 1) * 5 - 1 - levelsCompleted; } float num2 = Mathf.Max(0.1f, REPOConfig.MoonLevelsPerPhase.Value); int num3 = Mathf.FloorToInt((float)REPOConfig.MoonMaxLevel.Value / num2); if (currentMoonPhase >= num3) { return -1; } return Mathf.CeilToInt((float)(currentMoonPhase + 1) * num2 - 1f) - levelsCompleted; } public static bool GetMoonLevelChanged() { if ((Object)(object)RunManager.instance == (Object)null || _moonLevelChangedField == null) { return false; } return (bool)_moonLevelChangedField.GetValue(RunManager.instance); } public static void SetMoonLevelChanged(bool value) { if ((Object)(object)RunManager.instance != (Object)null && _moonLevelChangedField != null) { _moonLevelChangedField.SetValue(RunManager.instance, value); } } public static int GetMoonLevel() { if ((Object)(object)RunManager.instance == (Object)null || _moonLevelField == null) { return 0; } return (int)_moonLevelField.GetValue(RunManager.instance); } } [HarmonyPatch(typeof(MoonUI))] public static class MoonUIPatches { private static FieldInfo _debugDisableField; static MoonUIPatches() { _debugDisableField = typeof(MoonUI).GetField("debugDisable", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } [HarmonyPatch("Check")] [HarmonyPrefix] public static bool CheckPrefix(MoonUI __instance) { if (!REPOConfig.EnableMoonScaling.Value || !REPOConfig.HideVanillaMoonUI.Value) { return true; } try { if (_debugDisableField != null) { _debugDisableField.SetValue(__instance, true); } if (MoonScalingPatches.GetMoonLevelChanged()) { int moonLevel = MoonScalingPatches.GetMoonLevel(); REPOConomyPlugin.Logger.LogInfo((object)$"[MoonScaling] \ud83c\udf19 Moon phase changed to {moonLevel} (vanilla UI hidden)"); MoonScalingPatches.SetMoonLevelChanged(value: false); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[MoonScaling] Error in MoonUI.Check: " + ex.Message)); return true; } } } public static class MoreUpgradesCompat { private static bool? _isInstalled; private static object _muPluginInstance; private static FieldInfo _upgradeItemsField; private static FieldInfo _playerUpgradeField; private static MethodInfo _getConfigMethod; private static MethodInfo _apiMultiplierMethod; public static bool IsInstalled { get { if (!_isInstalled.HasValue) { _isInstalled = Chainloader.PluginInfos.ContainsKey("bulletbot.moreupgrades"); if (_isInstalled.Value) { InitializeReflection(); } } return _isInstalled.Value; } } private static void InitializeReflection() { try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "MoreUpgrades"); if (assembly != null) { Type type = assembly.GetType("MoreUpgrades.Plugin"); if (type != null) { _muPluginInstance = AccessTools.Field(type, "instance").GetValue(null); _upgradeItemsField = AccessTools.Field(type, "upgradeItems"); } Type type2 = assembly.GetType("MoreUpgrades.Classes.UpgradeItem"); if (type2 != null) { _playerUpgradeField = AccessTools.Field(type2, "playerUpgrade"); _getConfigMethod = AccessTools.Method(type2, "GetConfig", new Type[1] { typeof(string) }, new Type[1] { typeof(bool) }); } Type type3 = assembly.GetType("MoreUpgrades.Classes.MoreUpgradesAPI"); if (type3 != null) { _apiMultiplierMethod = AccessTools.Method(type3, "ItemValueMultiplier", new Type[1] { typeof(Item) }, (Type[])null); } REPOConomyPlugin.Logger.LogInfo((object)"[MoreUpgradesCompat] Compatibility initialized."); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[MoreUpgradesCompat] Init failed: " + ex.Message)); _isInstalled = false; } } public static IEnumerable FilterDisabledItems(IEnumerable incomingItems) { if (!IsInstalled || _muPluginInstance == null || _upgradeItemsField == null) { return incomingItems; } try { if (!(_upgradeItemsField.GetValue(_muPluginInstance) is IList list) || list.Count == 0) { return incomingItems; } HashSet disabledItems = new HashSet(); foreach (object item in list) { if (item == null) { continue; } object value = _playerUpgradeField.GetValue(item); if (value == null) { continue; } FieldInfo fieldInfo = AccessTools.Field(value.GetType(), "Item"); Item val = null; if (fieldInfo != null) { object? value2 = fieldInfo.GetValue(value); val = (Item)((value2 is Item) ? value2 : null); } else { PropertyInfo propertyInfo = AccessTools.Property(value.GetType(), "Item"); if (propertyInfo != null) { object? value3 = propertyInfo.GetValue(value); val = (Item)((value3 is Item) ? value3 : null); } } if ((Object)(object)val == (Object)null || !(_getConfigMethod != null)) { continue; } try { if (!(bool)_getConfigMethod.Invoke(item, new object[1] { "Enabled" })) { disabledItems.Add(val); } } catch { } } return incomingItems.Where((Item x) => !disabledItems.Contains(x)); } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[MoreUpgradesCompat] Filter error: {arg}"); return incomingItems; } } public static float GetItemPriceMultiplier(Item item, float globalDefault) { if (!IsInstalled || _apiMultiplierMethod == null) { return globalDefault; } try { return (float)_apiMultiplierMethod.Invoke(null, new object[1] { item }); } catch { return globalDefault; } } } public static class PocketCartPlusCompat { private static bool? _isInstalled; private static FieldInfo _randField; private static object _pluginInstance; public static bool IsInstalled { get { if (!_isInstalled.HasValue) { _isInstalled = Chainloader.PluginInfos.ContainsKey("com.github.darmuh.PocketCartPlus"); if (_isInstalled.Value) { InitializeReflection(); } } return _isInstalled.Value; } } private static void InitializeReflection() { try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "com.github.darmuh.PocketCartPlus"); if (assembly != null) { Type type = assembly.GetType("PocketCartPlus.Plugin"); if (type != null) { _randField = AccessTools.Field(type, "Rand"); } REPOConomyPlugin.Logger.LogInfo((object)"[PocketCartPlusCompat] Compatibility initialized."); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PocketCartPlusCompat] Init failed: " + ex.Message)); _isInstalled = false; } } public static void ReseedRandom(int seed) { if (!IsInstalled || _randField == null) { return; } try { Random value = new Random(seed); _randField.SetValue(null, value); REPOConomyPlugin.Logger.LogInfo((object)$"[PocketCartPlusCompat] Reseeded with {seed}"); } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[PocketCartPlusCompat] Reseed error: {arg}"); } } } public sealed class REPOBlackMarketManager : MonoBehaviour { private sealed class EconomyChoice { public string id; public string name; } private sealed class ShopEconomyChoice { public string id; public string name; } [CompilerGenerated] private sealed class d__87 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Action buyAction; public REPOBlackMarketManager <>4__this; public string popupText; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__87(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown //IL_00a2: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; REPOBlackMarketManager rEPOBlackMarketManager = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; buyAction?.Invoke(); <>2__current = null; <>1__state = 2; return true; case 2: <>1__state = -1; rEPOBlackMarketManager.OpenNativeMenu(); <>2__current = (object)new WaitForSecondsRealtime(0.35f); <>1__state = 3; return true; case 3: { <>1__state = -1; MenuManager instance = MenuManager.instance; if (instance != null) { instance.PagePopUp("Black Market", Color.yellow, popupText, "OK", false); } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__85 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public Action openAction; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__85(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; openAction?.Invoke(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static REPOBlackMarketManager Instance; private static readonly Dictionary PendingModifierBlocks = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary PendingEconomyBlocks = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly Dictionary PendingShopEconomyBlocks = new Dictionary(StringComparer.OrdinalIgnoreCase); private static readonly List RecentLevelBlocks = new List(); private static readonly List RecentShopBlocks = new List(); private static string loadedSaveKey = string.Empty; private static string syncedStatusText = string.Empty; private static bool hasUncommittedShopPurchases; private static bool hasUncommittedConsumedBlocks; private static int totalModifierPurchases; private static int totalEconomyPurchases; private static int totalShopEconomyPurchases; private static readonly FieldInfo RunManagerLevelIsShopField = typeof(RunManager).GetField("levelIsShop", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); private Rect windowRect = new Rect(90f, 90f, 560f, 620f); private Vector2 scrollPosition; private bool showMenu; private bool selectingModifier; private bool selectingEconomy; private bool selectingShopEconomy; private float hintTimer; private string statusText = string.Empty; private float statusTimer; private REPOPopupPage activePage; private bool blackMarketPageOpen; private GUIStyle windowStyle; private GUIStyle titleStyle; private GUIStyle subtitleStyle; private GUIStyle bodyStyle; private GUIStyle smallStyle; private GUIStyle buttonStyle; private GUIStyle dangerButtonStyle; private GUIStyle choiceButtonStyle; private GUIStyle panelStyle; private Texture2D panelTexture; private Texture2D headerTexture; private bool readyLogged; private int lastHotkeyFrame = -1; private static string syncedLobbyStatusText = string.Empty; public static bool IsModifierBlocked(string eventId) { EnsureLoadedForCurrentSave(); return GetCount(PendingModifierBlocks, eventId) > 0; } public static bool IsEconomyBlocked(string economyId) { EnsureLoadedForCurrentSave(); return GetCount(PendingEconomyBlocks, economyId) > 0; } public static bool IsShopEconomyBlocked(string shopEconomyId) { EnsureLoadedForCurrentSave(); return GetCount(PendingShopEconomyBlocks, shopEconomyId) > 0; } public static bool TryConsumeModifierBlock(string eventId, string displayName = null) { if (!TryConsume(PendingModifierBlocks, eventId)) { return false; } RecordLevelBlock("Modifier blocked: " + FirstNonEmpty(displayName, eventId)); hasUncommittedConsumedBlocks = true; SyncToClients(); return true; } public static bool TryConsumeEconomyBlock(string economyId, string displayName = null) { if (!TryConsume(PendingEconomyBlocks, economyId)) { return false; } RecordLevelBlock("Economy blocked: " + FirstNonEmpty(displayName, economyId)); hasUncommittedConsumedBlocks = true; SyncToClients(); return true; } public static bool TryConsumeShopEconomyBlock(string shopEconomyId, string displayName = null) { if (!TryConsume(PendingShopEconomyBlocks, shopEconomyId)) { return false; } RecordShopBlock("Shop economy blocked: " + FirstNonEmpty(displayName, shopEconomyId)); hasUncommittedConsumedBlocks = true; SyncToClients(); return true; } public static string GetActiveEventsStatusText() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return syncedStatusText ?? string.Empty; } EnsureLoadedForCurrentSave(); return BuildBlackMarketStatusText(); } public static bool IsShopHintVisible() { if ((Object)(object)Instance != (Object)null && Instance.hintTimer > 0f) { return IsShopAvailable(); } return false; } public static string GetShopHintText() { //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) string value = REPOConfig.UILanguage.Value; if (ChallengeManager.HasActiveChallenge) { if (!(value == "Korean")) { if (value == "Russian") { return "Чёрный рынок отключён в режиме челленджа."; } return "Black Market is disabled in Challenge mode."; } return "도전 모드에서는 암시장을 사용할 수 없습니다."; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { if (!(value == "Korean")) { if (value == "Russian") { return "Чёрный рынок доступен. Попросите хоста открыть его."; } return "Black Market available. Ask the host to open it."; } return "암시장 사용 가능. 호스트에게 열어 달라고 하세요."; } EnsureLoadedForCurrentSave(); KeyCode value2 = REPOConfig.BlackMarketHotkey.Value; string text = ((object)(KeyCode)(ref value2)).ToString().ToUpperInvariant(); string text2 = BuildReserveDetails(multiline: false, includeLevel: false); string text3 = ((value == "Korean") ? (text + " 키를 눌러 암시장을 여세요.") : ((!(value == "Russian")) ? ("Press " + text + " to open the Black Market.") : ("Нажмите " + text + ", чтобы открыть Чёрный рынок."))); string text4 = text3; text3 = ((value == "Korean") ? "\n이번 상점에서 차단됨: " : ((!(value == "Russian")) ? "\nBlocked this shop: " : "\nЗаблокировано в этом магазине: ")); string text5 = text3; string text6 = ((RecentShopBlocks.Count > 0) ? (text5 + string.Join("; ", RecentShopBlocks.Take(2).ToArray())) : string.Empty); if (string.IsNullOrWhiteSpace(text2)) { return text4; } return text4 + "\n" + text2 + text6; } public static string GetHostStatusTextForSync() { EnsureLoadedForCurrentSave(); return BuildSyncedStatusText(); } public static string GetLobbyStatusText() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { return syncedLobbyStatusText ?? string.Empty; } EnsureLoadedForCurrentSave(); return BuildLobbyStatusText(); } public static void ApplySyncedStatusText(string status) { syncedStatusText = status ?? string.Empty; } public static void ApplySyncedStatusText(string status, string lobbyStatus) { syncedStatusText = status ?? string.Empty; syncedLobbyStatusText = lobbyStatus ?? string.Empty; } public static void ConsumePendingBlocksAfterGeneration() { SyncToClients(); } public static void BeginLevelRoll() { if (RecentLevelBlocks.Count != 0) { RecentLevelBlocks.Clear(); SyncToClients(); } } public static void BeginShopRoll() { if (RecentShopBlocks.Count != 0) { RecentShopBlocks.Clear(); SyncToClients(); } } public static void ConsumePendingShopEconomyBlocksAfterGeneration() { SyncToClients(); } public static void ShowShopHint() { EnsureInstance(); if (hasUncommittedShopPurchases) { ReloadForCurrentSave(); } else { EnsureLoadedForCurrentSave(); } SyncToClients(); if ((Object)(object)Instance != (Object)null) { Instance.hintTimer = 12f; } } public static void CommitShopPurchasesForRunStart() { if (hasUncommittedShopPurchases) { hasUncommittedShopPurchases = false; SaveForCurrentSave(); SyncToClients(); REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Shop purchases committed for run start."); } } public static void CommitConsumedBlocksAfterLevelCompleted() { if (hasUncommittedConsumedBlocks) { hasUncommittedConsumedBlocks = false; SaveForCurrentSave(); SyncToClients(); REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Consumed reserves committed after level completion."); } } public static void DiscardUncommittedRunChanges() { if (hasUncommittedShopPurchases || hasUncommittedConsumedBlocks) { ReloadForCurrentSave(); SyncToClients(); REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Uncommitted reserve changes discarded."); } } public static void DiscardUncommittedConsumedBlocks() { if (hasUncommittedConsumedBlocks) { ReloadForCurrentSave(); SyncToClients(); REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Uncommitted consumed reserves restored."); } } public static void DeleteForCurrentSaveAndReset(string reason) { DeleteForSaveAndReset(GetCurrentSaveKey(), reason); } public static void DeleteForSaveAndReset(string saveKey, string reason) { string text = (string.IsNullOrWhiteSpace(saveKey) ? GetCurrentSaveKey() : saveKey); string savePath = GetSavePath(text); if (string.Equals(loadedSaveKey, text, StringComparison.OrdinalIgnoreCase) || string.Equals(GetCurrentSaveKey(), text, StringComparison.OrdinalIgnoreCase)) { PendingModifierBlocks.Clear(); PendingEconomyBlocks.Clear(); PendingShopEconomyBlocks.Clear(); RecentLevelBlocks.Clear(); RecentShopBlocks.Clear(); totalModifierPurchases = 0; totalEconomyPurchases = 0; totalShopEconomyPurchases = 0; hasUncommittedShopPurchases = false; hasUncommittedConsumedBlocks = false; loadedSaveKey = text; } try { if (File.Exists(savePath)) { File.Delete(savePath); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[BlackMarket] Failed to delete save data: " + ex.Message)); } SyncToClients(); REPOConomyPlugin.Logger.LogInfo((object)("[BlackMarket] Save data reset for " + text + ". Reason: " + reason)); } public static void EnsureInstance() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown if ((Object)(object)Instance != (Object)null) { return; } Instance = Object.FindObjectOfType(); if (!((Object)(object)Instance != (Object)null)) { GameObject val = new GameObject("REPOBlackMarketManager"); Instance = val.AddComponent(); Object.DontDestroyOnLoad((Object)val); ManualLogSource logger = REPOConomyPlugin.Logger; if (logger != null) { logger.LogInfo((object)"[BlackMarket] Manager instance restored."); } } } public static void TickHotkeyFromGame() { EnsureInstance(); Instance?.HandleHotkeyTick(); } private void Awake() { Instance = this; CreateTextures(); } private void Update() { if (hintTimer > 0f) { hintTimer -= Time.unscaledDeltaTime; } if (statusTimer > 0f) { statusTimer -= Time.unscaledDeltaTime; } } private void HandleHotkeyTick() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (REPOConfig.EnableBlackMarketShop == null || !REPOConfig.EnableBlackMarketShop.Value) { return; } if (ChallengeManager.HasActiveChallenge) { if (blackMarketPageOpen) { CloseNativeMenu(); } return; } if (!readyLogged && IsShopAvailable()) { readyLogged = true; REPOConomyPlugin.Logger.LogInfo((object)$"[BlackMarket] Ready in shop. Hotkey={REPOConfig.BlackMarketHotkey.Value}, enabled={REPOConfig.EnableBlackMarketShop.Value}"); } if (!IsShopAvailable()) { if (Input.GetKeyDown(REPOConfig.BlackMarketHotkey.Value)) { REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Hotkey pressed, but shop state is not active yet."); } blackMarketPageOpen = false; showMenu = false; selectingModifier = false; selectingEconomy = false; selectingShopEconomy = false; } else if (blackMarketPageOpen && Input.GetKeyDown((KeyCode)27)) { CloseNativeMenu(); } else if (Input.GetKeyDown(REPOConfig.BlackMarketHotkey.Value) && lastHotkeyFrame != Time.frameCount) { lastHotkeyFrame = Time.frameCount; if (blackMarketPageOpen) { CloseNativeMenu(); return; } OpenNativeMenu(); hintTimer = 0f; REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Native menu opened."); } } private void OnGUI() { } private void OpenNativeMenu() { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) if (ChallengeManager.HasActiveChallenge) { return; } if ((Object)(object)MenuManager.instance == (Object)null || (Object)(object)MenuHolder.instance == (Object)null) { ShowStatus("Menu is not ready yet."); REPOConomyPlugin.Logger.LogWarning((object)"[BlackMarket] Native menu unavailable: MenuManager/MenuHolder is null."); return; } CloseAllNativePages(); EnsureLoadedForCurrentSave(); blackMarketPageOpen = true; activePage = REPOUIFactory.CreatePopupPage("Black Market", pageDimmerVisibility: false, 1f, (Vector2?)new Vector2(40f, 0f)); if ((Object)(object)activePage == (Object)null) { MenuManager.instance.PagePopUp("Black Market", Color.red, "Failed to create Black Market page.", "OK", false); return; } bool flag = SemiFunc.IsMasterClientOrSingleplayer(); int currency = GetCurrency(); int escalatedCost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketModifierBlockCost.Value), totalModifierPurchases); int escalatedCost2 = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketEconomyBlockCost.Value), totalEconomyPurchases); int escalatedCost3 = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketShopEconomyBlockCost.Value), totalShopEconomyPurchases); AddPopupLabel(activePage, "Currency: $" + FormatMoney(currency), 18f, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)210, (byte)64, byte.MaxValue))); AddPopupLabel(activePage, flag ? "Buy reserves that block exact next rolls. A reserve is spent only when it actually prevents that modifier or economy." : "Client access is read-only. Only the host can buy Black Market services.", 12f, Color.white); AddPopupLabel(activePage, $"Reserves: {SumCounts(PendingModifierBlocks)} modifier, {SumCounts(PendingEconomyBlocks)} economy, {SumCounts(PendingShopEconomyBlocks)} shop economy", 11f, Color32.op_Implicit(new Color32((byte)150, (byte)220, byte.MaxValue, byte.MaxValue))); AddPurchaseButton(activePage, "Block Modifier - $" + FormatMoney(escalatedCost), flag && currency >= escalatedCost, delegate { OpenDeferred(OpenModifierNativeMenu); }, escalatedCost); AddPurchaseButton(activePage, "Block Economy - $" + FormatMoney(escalatedCost2), flag && currency >= escalatedCost2, delegate { OpenDeferred(OpenEconomyNativeMenu); }, escalatedCost2); AddPurchaseButton(activePage, "Block Shop Economy - $" + FormatMoney(escalatedCost3), flag && currency >= escalatedCost3, delegate { OpenDeferred(OpenShopEconomyNativeMenu); }, escalatedCost3); AddPopupButton(activePage, "Close", CloseNativeMenu); ShowNativePage(activePage); } private void OpenModifierNativeMenu() { REPOUIFactory.CloseAllSettingsPages(); blackMarketPageOpen = true; int cost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketModifierBlockCost.Value), totalModifierPurchases); REPOPopupPage rEPOPopupPage = CreateSelectionPage("Block Modifier", "Choose modifier to block - $" + FormatMoney(cost)); if ((Object)(object)rEPOPopupPage == (Object)null) { return; } int currency = GetCurrency(); bool flag = SemiFunc.IsMasterClientOrSingleplayer() && currency >= cost; foreach (GameEvent modifierChoice in GetModifierChoices()) { GameEvent local = modifierChoice; string text = ((GetCount(PendingModifierBlocks, local.id) > 0) ? $" x{GetCount(PendingModifierBlocks, local.id)}" : string.Empty); AddPurchaseButton(rEPOPopupPage, FirstNonEmpty(local.name_en, local.id) + text, flag, delegate { BuyAndReturnDeferred(delegate { BuyModifierBlock(local, cost); }, "Modifier reserve bought:\n" + FirstNonEmpty(local.name_en, local.id)); }, cost, GetModifierChoiceColor(local), !flag, allowDefaultGameColor: true); } AddPopupButton(rEPOPopupPage, "Back", delegate { OpenDeferred(OpenNativeMenu); }); ShowNativePage(rEPOPopupPage); } private void OpenEconomyNativeMenu() { REPOUIFactory.CloseAllSettingsPages(); blackMarketPageOpen = true; int cost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketEconomyBlockCost.Value), totalEconomyPurchases); REPOPopupPage rEPOPopupPage = CreateSelectionPage("Block Economy", "Choose economy to block - $" + FormatMoney(cost)); if ((Object)(object)rEPOPopupPage == (Object)null) { return; } int currency = GetCurrency(); bool flag = SemiFunc.IsMasterClientOrSingleplayer() && currency >= cost; foreach (EconomyChoice economyChoice in GetEconomyChoices()) { EconomyChoice local = economyChoice; string text = ((GetCount(PendingEconomyBlocks, local.id) > 0) ? $" x{GetCount(PendingEconomyBlocks, local.id)}" : string.Empty); AddPurchaseButton(rEPOPopupPage, local.name + text, flag, delegate { BuyAndReturnDeferred(delegate { BuyEconomyBlock(local, cost); }, "Economy reserve bought:\n" + local.name); }, cost, GetEconomyChoiceColor(local), !flag, allowDefaultGameColor: true); } AddPopupButton(rEPOPopupPage, "Back", delegate { OpenDeferred(OpenNativeMenu); }); ShowNativePage(rEPOPopupPage); } private void OpenShopEconomyNativeMenu() { REPOUIFactory.CloseAllSettingsPages(); blackMarketPageOpen = true; int cost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketShopEconomyBlockCost.Value), totalShopEconomyPurchases); REPOPopupPage rEPOPopupPage = CreateSelectionPage("Block Shop Economy", "Choose shop economy to block - $" + FormatMoney(cost)); if ((Object)(object)rEPOPopupPage == (Object)null) { return; } int currency = GetCurrency(); bool flag = SemiFunc.IsMasterClientOrSingleplayer() && currency >= cost; foreach (ShopEconomyChoice shopEconomyChoice in GetShopEconomyChoices()) { ShopEconomyChoice local = shopEconomyChoice; string text = ((GetCount(PendingShopEconomyBlocks, local.id) > 0) ? $" x{GetCount(PendingShopEconomyBlocks, local.id)}" : string.Empty); AddPurchaseButton(rEPOPopupPage, local.name + text, flag, delegate { BuyAndReturnDeferred(delegate { BuyShopEconomyBlock(local, cost); }, "Shop economy reserve bought:\n" + local.name); }, cost, GetShopEconomyChoiceColor(local), !flag, allowDefaultGameColor: true); } AddPopupButton(rEPOPopupPage, "Back", delegate { OpenDeferred(OpenNativeMenu); }); ShowNativePage(rEPOPopupPage); } private REPOPopupPage CreateSelectionPage(string title, string subtitle) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) REPOPopupPage rEPOPopupPage = REPOUIFactory.CreatePopupPage(title, pageDimmerVisibility: false, 1f, (Vector2?)new Vector2(40f, 0f)); if ((Object)(object)rEPOPopupPage == (Object)null) { MenuManager.instance.PagePopUp("Black Market", Color.red, "Failed to create selection page.", "OK", false); return null; } AddPopupLabel(rEPOPopupPage, subtitle, 17f, Color32.op_Implicit(new Color32(byte.MaxValue, (byte)210, (byte)64, byte.MaxValue))); AddPopupLabel(rEPOPopupPage, "Purchases stack. One reserve is consumed only when this exact entry would roll.", 12f, Color.white); return rEPOPopupPage; } private static void AddPopupLabel(REPOPopupPage page, string text, float fontSize, Color color) { //IL_000e: 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) //IL_00f7: 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_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_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: 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) REPOLabel rEPOLabel = REPOUIFactory.CreateLabel(text, (Transform)(object)page.menuScrollBox.scroller); if ((Object)(object)rEPOLabel?.labelTMP != (Object)null) { ((TMP_Text)rEPOLabel.labelTMP).fontSize = fontSize; ((Graphic)rEPOLabel.labelTMP).color = color; ((TMP_Text)rEPOLabel.labelTMP).enableWordWrapping = true; ((TMP_Text)rEPOLabel.labelTMP).overflowMode = (TextOverflowModes)0; ((TMP_Text)rEPOLabel.labelTMP).alignment = (TextAlignmentOptions)513; float num = ((fontSize <= 12f) ? 280f : 235f); Vector2 preferredValues = ((TMP_Text)rEPOLabel.labelTMP).GetPreferredValues(text ?? string.Empty, num, 0f); rEPOLabel.rectTransform.sizeDelta = new Vector2(num, Mathf.Max(rEPOLabel.rectTransform.sizeDelta.y, preferredValues.y + 6f)); ((TMP_Text)rEPOLabel.labelTMP).rectTransform.sizeDelta = rEPOLabel.rectTransform.sizeDelta; } page.AddElementToScrollView(rEPOLabel.rectTransform, Vector2.zero, 2f, 1f); page.scrollView.UpdateElements(); } private static MenuButton AddPopupButton(REPOPopupPage page, string text, Action onClick) { //IL_000f: 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) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) MenuButton val = REPOUIFactory.CreateMenuButtonNative(text, onClick, (Transform)(object)page.menuScrollBox.scroller); RectTransform val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { page.AddElementToScrollView(val2, Vector2.zero, 1f, 1f); ((Transform)val2).localScale = Vector3.one; } page.scrollView.UpdateElements(); return val; } private static void AddPurchaseButton(REPOPopupPage page, string text, bool canAfford, Action onClick, int cost, Color? normalColor = null, bool strikeThrough = false, bool allowDefaultGameColor = false) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) MenuButton button = AddPopupButton(page, text, delegate { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { MenuManager instance = MenuManager.instance; if (instance != null) { instance.PagePopUp("Black Market", Color.red, "Only the host can open this Black Market tab.", "OK", false); } } else if (!canAfford) { MenuManager instance2 = MenuManager.instance; if (instance2 != null) { instance2.PagePopUp("Black Market", Color.red, "Not enough currency.\nNeed $" + FormatMoney(cost) + ".", "OK", false); } } else { onClick?.Invoke(); } }); if (!canAfford) { ApplyButtonColor(button, new Color(1f, 0.22f, 0.18f), strikeThrough: true); } else if (normalColor.HasValue) { ApplyButtonColor(button, normalColor.Value, strikeThrough); } else if (!allowDefaultGameColor) { ApplyButtonColor(button, new Color(0.25f, 0.95f, 0.35f), strikeThrough); } else { ApplyButtonTextStyle(button, null, strikeThrough); } } private static void ApplyButtonColor(MenuButton button, Color color, bool strikeThrough = false) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002f: 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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } button.customColors = true; button.colorNormal = color; button.colorHover = Color.Lerp(color, Color.white, 0.35f); button.colorClick = Color.Lerp(color, new Color(1f, 0.9f, 0.25f), 0.45f); TextMeshProUGUI componentInChildren = ((Component)button).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((Graphic)componentInChildren).color = color; if (strikeThrough) { ((TMP_Text)componentInChildren).fontStyle = (FontStyles)(((TMP_Text)componentInChildren).fontStyle | 0x40); } else { ((TMP_Text)componentInChildren).fontStyle = (FontStyles)(((TMP_Text)componentInChildren).fontStyle & -65); } } } private static void ApplyButtonTextStyle(MenuButton button, Color? color = null, bool strikeThrough = false) { //IL_0027: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } TextMeshProUGUI componentInChildren = ((Component)button).GetComponentInChildren(); if (!((Object)(object)componentInChildren == (Object)null)) { if (color.HasValue) { ((Graphic)componentInChildren).color = color.Value; } if (strikeThrough) { ((TMP_Text)componentInChildren).fontStyle = (FontStyles)(((TMP_Text)componentInChildren).fontStyle | 0x40); } else { ((TMP_Text)componentInChildren).fontStyle = (FontStyles)(((TMP_Text)componentInChildren).fontStyle & -65); } } } private static void ShowNativePage(REPOPopupPage page) { page.scrollView.UpdateElements(); page.ReinitializeSelectableElements(); page.OpenPage(openOnTop: true); } private static Color GetLockedChoiceColor() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) return new Color(0.62f, 0.68f, 0.78f); } private static Color? GetModifierChoiceColor(GameEvent gameEvent) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) if (gameEvent == null) { return null; } REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager != (Object)null && rEPOStatsManager.IsModifierDiscovered(gameEvent.id)) { return rEPOStatsManager.GetModifierColor(gameEvent.id, gameEvent.color); } return null; } private static Color? GetEconomyChoiceColor(EconomyChoice choice) { //IL_0013: 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_001d: 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) if (choice == null) { return null; } Color economyColorForId = REPOConomyPlugin.GetEconomyColorForId(choice.id, GetLockedChoiceColor()); REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager != (Object)null && rEPOStatsManager.IsEconomyDiscovered(choice.id)) { return rEPOStatsManager.GetEconomyColor(choice.id, economyColorForId); } return null; } private static Color? GetShopEconomyChoiceColor(ShopEconomyChoice choice) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (choice == null) { return null; } Color fallback = GetLockedChoiceColor(); if (Enum.TryParse(choice.id, ignoreCase: true, out var result)) { fallback = ShopEconomyManager.GetShopEconomyColor(result); } REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager != (Object)null && rEPOStatsManager.IsShopEconomyDiscovered(choice.id)) { return rEPOStatsManager.GetShopEconomyColor(choice.id, fallback); } return null; } private void OpenDeferred(Action openAction) { CloseAllNativePages(); blackMarketPageOpen = true; ((MonoBehaviour)this).StartCoroutine(OpenDeferredCoroutine(openAction)); } [IteratorStateMachine(typeof(d__85))] private IEnumerator OpenDeferredCoroutine(Action openAction) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__85(0) { openAction = openAction }; } private void BuyAndReturnDeferred(Action buyAction, string popupText) { CloseAllNativePages(); blackMarketPageOpen = true; ((MonoBehaviour)this).StartCoroutine(BuyAndReturnDeferredCoroutine(buyAction, popupText)); } [IteratorStateMachine(typeof(d__87))] private IEnumerator BuyAndReturnDeferredCoroutine(Action buyAction, string popupText) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__87(0) { <>4__this = this, buyAction = buyAction, popupText = popupText }; } private void CloseNativeMenu() { CloseAllNativePages(); activePage = null; blackMarketPageOpen = false; REPOConomyPlugin.Logger.LogInfo((object)"[BlackMarket] Native menu closed."); } private static void CloseAllNativePages() { REPOUIFactory.CloseAllSettingsPages(); try { MenuManager instance = MenuManager.instance; if (instance != null) { instance.PageCloseAllAddedOnTop(); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[BlackMarket] Failed to close added pages: " + ex.Message)); } } private void DrawHint() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) if (!(hintTimer <= 0f) && !showMenu) { KeyCode value = REPOConfig.BlackMarketHotkey.Value; string text = ((object)(KeyCode)(ref value)).ToString().ToUpperInvariant(); Rect val = default(Rect); ((Rect)(ref val))..ctor((float)Screen.width / 2f - 250f, 32f, 500f, 70f); GUI.Box(val, GUIContent.none, panelStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 10f, ((Rect)(ref val)).width - 36f, 24f), "REPOConomyPlus Black Market", titleStyle); GUI.Label(new Rect(((Rect)(ref val)).x + 18f, ((Rect)(ref val)).y + 38f, ((Rect)(ref val)).width - 36f, 22f), "Host can press " + text + " to buy next-roll economy, shop economy, and modifier blocks.", smallStyle); } } private void DrawWindow(int windowId) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: 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) GUI.DrawTexture(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 72f), (Texture)(object)headerTexture); GUI.Label(new Rect(22f, 12f, ((Rect)(ref windowRect)).width - 44f, 26f), "REPOCONOMY PLUS BLACK MARKET", titleStyle); GUI.Label(new Rect(22f, 40f, ((Rect)(ref windowRect)).width - 44f, 22f), "Expensive one-time services for the next generated level.", subtitleStyle); bool flag = SemiFunc.IsMasterClientOrSingleplayer(); int currency = GetCurrency(); EnsureLoadedForCurrentSave(); GUILayout.Space(78f); GUILayout.BeginVertical(panelStyle, Array.Empty()); GUILayout.Label("Currency: $" + FormatMoney(currency), bodyStyle, Array.Empty()); GUILayout.Label(flag ? "Only the host can buy. Blocks are consumed after the next level is generated." : "Client access is read-only. Ask the host to buy black market services.", smallStyle, Array.Empty()); if (PendingModifierBlocks.Count > 0 || PendingEconomyBlocks.Count > 0 || PendingShopEconomyBlocks.Count > 0) { GUILayout.Label($"Reserves: {SumCounts(PendingModifierBlocks)} modifier, {SumCounts(PendingEconomyBlocks)} economy, {SumCounts(PendingShopEconomyBlocks)} shop economy", smallStyle, Array.Empty()); } if (statusTimer > 0f && !string.IsNullOrWhiteSpace(statusText)) { GUILayout.Label(statusText, subtitleStyle, Array.Empty()); } GUILayout.EndVertical(); GUILayout.Space(8f); if (selectingModifier) { DrawModifierSelection(flag, currency); } else if (selectingEconomy) { DrawEconomySelection(flag, currency); } else if (selectingShopEconomy) { DrawShopEconomySelection(flag, currency); } else { DrawMainActions(flag, currency); } GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Close", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { showMenu = false; } GUI.enabled = true; GUILayout.EndHorizontal(); GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, 72f)); } private void DrawMainActions(bool isHost, int currency) { //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_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) int escalatedCost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketModifierBlockCost.Value), totalModifierPurchases); int escalatedCost2 = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketEconomyBlockCost.Value), totalEconomyPurchases); int escalatedCost3 = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketShopEconomyBlockCost.Value), totalShopEconomyPurchases); GUILayout.BeginVertical(panelStyle, Array.Empty()); GUILayout.Label("Services", titleStyle, Array.Empty()); GUILayout.Label("Buy reserves for exact events. A reserve is spent only when it actually prevents that roll.", smallStyle, Array.Empty()); GUILayout.Space(6f); GUI.enabled = isHost && currency >= escalatedCost && GetModifierChoices().Count > 0; if (GUILayout.Button("Block Modifier - $" + FormatMoney(escalatedCost), dangerButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(44f) })) { selectingModifier = true; scrollPosition = Vector2.zero; } GUI.enabled = true; GUILayout.Label("Prevents one enabled modifier from appearing in the next level.", smallStyle, Array.Empty()); GUILayout.Space(8f); GUI.enabled = isHost && currency >= escalatedCost2 && GetEconomyChoices().Count > 0; if (GUILayout.Button("Block Economy - $" + FormatMoney(escalatedCost2), dangerButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(44f) })) { selectingEconomy = true; scrollPosition = Vector2.zero; } GUI.enabled = true; GUILayout.Label("Prevents one enabled economy from being selected for the next level.", smallStyle, Array.Empty()); GUILayout.Space(8f); GUI.enabled = isHost && currency >= escalatedCost3 && GetShopEconomyChoices().Count > 0; if (GUILayout.Button("Block Shop Economy - $" + FormatMoney(escalatedCost3), dangerButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(44f) })) { selectingShopEconomy = true; scrollPosition = Vector2.zero; } GUI.enabled = true; GUILayout.Label("Prevents one enabled shop economy from being selected in the next shop.", smallStyle, Array.Empty()); GUILayout.EndVertical(); } private void DrawModifierSelection(bool isHost, int currency) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) int escalatedCost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketModifierBlockCost.Value), totalModifierPurchases); List modifierChoices = GetModifierChoices(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Back", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(30f) })) { selectingModifier = false; } GUILayout.Label("Choose modifier to block - $" + FormatMoney(escalatedCost), titleStyle, Array.Empty()); GUILayout.EndHorizontal(); if (modifierChoices.Count == 0) { GUILayout.Label("No enabled modifier choices are available.", bodyStyle, Array.Empty()); return; } scrollPosition = GUILayout.BeginScrollView(scrollPosition, panelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(390f) }); foreach (GameEvent item in modifierChoices) { GUI.enabled = isHost && currency >= escalatedCost; string text = FirstNonEmpty(item.name_en, item.id); int count = GetCount(PendingModifierBlocks, item.id); string text2 = ((count > 0) ? $" x{count}" : string.Empty); if (GUILayout.Button(text + text2, choiceButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { BuyModifierBlock(item, escalatedCost); selectingModifier = false; } GUI.enabled = true; } GUILayout.EndScrollView(); } private void DrawEconomySelection(bool isHost, int currency) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) int escalatedCost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketEconomyBlockCost.Value), totalEconomyPurchases); List economyChoices = GetEconomyChoices(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Back", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(30f) })) { selectingEconomy = false; } GUILayout.Label("Choose economy to block - $" + FormatMoney(escalatedCost), titleStyle, Array.Empty()); GUILayout.EndHorizontal(); if (economyChoices.Count == 0) { GUILayout.Label("No enabled economy choices are available.", bodyStyle, Array.Empty()); return; } scrollPosition = GUILayout.BeginScrollView(scrollPosition, panelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(390f) }); foreach (EconomyChoice item in economyChoices) { GUI.enabled = isHost && currency >= escalatedCost; int count = GetCount(PendingEconomyBlocks, item.id); string text = ((count > 0) ? $" x{count}" : string.Empty); if (GUILayout.Button(item.name + text, choiceButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { BuyEconomyBlock(item, escalatedCost); selectingEconomy = false; } GUI.enabled = true; } GUILayout.EndScrollView(); } private void DrawShopEconomySelection(bool isHost, int currency) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) int escalatedCost = GetEscalatedCost(GetConfiguredBaseCost(REPOConfig.BlackMarketShopEconomyBlockCost.Value), totalShopEconomyPurchases); List shopEconomyChoices = GetShopEconomyChoices(); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button("Back", buttonStyle, (GUILayoutOption[])(object)new GUILayoutOption[2] { GUILayout.Width(110f), GUILayout.Height(30f) })) { selectingShopEconomy = false; } GUILayout.Label("Choose shop economy to block - $" + FormatMoney(escalatedCost), titleStyle, Array.Empty()); GUILayout.EndHorizontal(); if (shopEconomyChoices.Count == 0) { GUILayout.Label("No enabled shop economy choices are available.", bodyStyle, Array.Empty()); return; } scrollPosition = GUILayout.BeginScrollView(scrollPosition, panelStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(390f) }); foreach (ShopEconomyChoice item in shopEconomyChoices) { GUI.enabled = isHost && currency >= escalatedCost; int count = GetCount(PendingShopEconomyBlocks, item.id); string text = ((count > 0) ? $" x{count}" : string.Empty); if (GUILayout.Button(item.name + text, choiceButtonStyle, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(34f) })) { BuyShopEconomyBlock(item, escalatedCost); selectingShopEconomy = false; } GUI.enabled = true; } GUILayout.EndScrollView(); } private void BuyModifierBlock(GameEvent gameEvent, int cost) { if (gameEvent != null && TrySpend(cost)) { AddCount(PendingModifierBlocks, gameEvent.id); totalModifierPurchases++; hasUncommittedShopPurchases = true; SyncToClients(); ShowStatus($"Modifier reserve bought: {FirstNonEmpty(gameEvent.name_en, gameEvent.id)} x{GetCount(PendingModifierBlocks, gameEvent.id)}"); REPOConomyPlugin.Logger.LogInfo((object)("[BlackMarket] Bought modifier reserve: " + gameEvent.id)); } } private void BuyEconomyBlock(EconomyChoice choice, int cost) { if (choice != null && TrySpend(cost)) { AddCount(PendingEconomyBlocks, choice.id); totalEconomyPurchases++; hasUncommittedShopPurchases = true; SyncToClients(); ShowStatus($"Economy reserve bought: {choice.name} x{GetCount(PendingEconomyBlocks, choice.id)}"); REPOConomyPlugin.Logger.LogInfo((object)("[BlackMarket] Bought economy reserve: " + choice.id)); } } private void BuyShopEconomyBlock(ShopEconomyChoice choice, int cost) { if (choice != null && TrySpend(cost)) { AddCount(PendingShopEconomyBlocks, choice.id); totalShopEconomyPurchases++; hasUncommittedShopPurchases = true; SyncToClients(); ShowStatus($"Shop economy reserve bought: {choice.name} x{GetCount(PendingShopEconomyBlocks, choice.id)}"); REPOConomyPlugin.Logger.LogInfo((object)("[BlackMarket] Bought shop economy reserve: " + choice.id)); } } private bool TrySpend(int cost) { if (!SemiFunc.IsMasterClientOrSingleplayer()) { ShowStatus("Only the host can buy black market services."); return false; } int currency = GetCurrency(); if (currency < cost) { ShowStatus("Not enough currency. Need $" + FormatMoney(cost) + "."); return false; } int num = Mathf.Max(0, currency - cost); SemiFunc.StatSetRunCurrency(num); if ((Object)(object)ShopManager.instance != (Object)null) { ShopManager.instance.totalCurrency = num; SemiFunc.ShopUpdateCost(); } return true; } private static int GetCurrency() { try { return SemiFunc.StatGetRunCurrency(); } catch { return ((Object)(object)ShopManager.instance != (Object)null) ? ShopManager.instance.totalCurrency : 0; } } private static List GetModifierChoices() { if (REPOEventManager.AllEvents == null) { return new List(); } return (from e in (from e in REPOEventManager.AllEvents where e != null && !string.IsNullOrWhiteSpace(e.id) where IsModifierEnabled(e.id) where IsModifierCategoryEnabled(e.category) select e).Where(REPOEventManager.IsModifierRewardUnlockedForPool) orderby e.eventType select e).ThenBy((GameEvent e) => FirstNonEmpty(e.name_en, e.id), StringComparer.OrdinalIgnoreCase).ToList(); } private static List GetEconomyChoices() { List list = new List(); foreach (REPOConomyPlugin.EconomyType value2 in Enum.GetValues(typeof(REPOConomyPlugin.EconomyType))) { if (value2 != 0) { string text = value2.ToString(); if (IsVanillaEconomyEnabled(text) && (!ChallengeManager.IsChallengeRewardEconomy(value2) || ChallengeManager.IsRewardEconomyUnlocked(value2)) && (!LevelMilestoneRewardManager.IsRewardEconomy(value2) || LevelMilestoneRewardManager.IsLevel100Unlocked())) { list.Add(new EconomyChoice { id = text, name = FirstNonEmpty(REPOConomyPlugin.GetEconomyNameForId(text), text) }); } } } foreach (CustomEconomyData customEvent in CustomEconomyLoader.CustomEvents) { if (customEvent != null && !string.IsNullOrWhiteSpace(customEvent.id)) { string key = "Enable Custom " + customEvent.id; if (REPOConfig.EconomyEnables.TryGetValue(key, out var value) && value.Value) { list.Add(new EconomyChoice { id = customEvent.id, name = FirstNonEmpty(customEvent.name_en, customEvent.id) }); } } } return list.OrderBy((EconomyChoice e) => e.name, StringComparer.OrdinalIgnoreCase).ToList(); } private static List GetShopEconomyChoices() { List list = new List(); foreach (ShopEconomyType value2 in Enum.GetValues(typeof(ShopEconomyType))) { if (value2 != 0 && (!ChallengeManager.IsChallengeRewardShopEconomy(value2) || ChallengeManager.IsRewardShopEconomyUnlocked(value2)) && (!LevelMilestoneRewardManager.IsRewardShopEconomy(value2) || LevelMilestoneRewardManager.IsLevel100Unlocked())) { string text = value2.ToString(); string key = "Enable Shop " + text; if (REPOConfig.ShopEconomyEnables != null && REPOConfig.ShopEconomyEnables.TryGetValue(key, out var value) && value.Value) { list.Add(new ShopEconomyChoice { id = text, name = ShopEconomyManager.GetShopEconomyName(value2, "English") }); } } } return list.OrderBy((ShopEconomyChoice e) => e.name, StringComparer.OrdinalIgnoreCase).ToList(); } private static bool IsModifierEnabled(string id) { string key = "Enable " + id; if (REPOConfig.ModifierEnables != null && REPOConfig.ModifierEnables.TryGetValue(key, out var value)) { return value.Value; } return false; } private static bool IsModifierCategoryEnabled(EventCategory category) { return category switch { EventCategory.LootModifier => REPOConfig.EnableLootModifiers.Value, EventCategory.EnemyModifier => REPOConfig.EnableEnemyModifiers.Value, EventCategory.PlayerModifier => REPOConfig.EnablePlayerModifiers.Value, EventCategory.EnvironmentModifier => REPOConfig.EnableEnvironmentModifiers.Value, _ => true, }; } private static bool IsVanillaEconomyEnabled(string id) { string key = "Enable " + id; if (REPOConfig.EconomyEnables != null && REPOConfig.EconomyEnables.TryGetValue(key, out var value)) { return value.Value; } return false; } private void ShowStatus(string text) { statusText = text; statusTimer = 5f; } private static bool IsShopAvailable() { if (SemiFunc.RunIsShop()) { return true; } try { bool flag = default(bool); int num; if ((Object)(object)RunManager.instance != (Object)null && RunManagerLevelIsShopField != null) { object value = RunManagerLevelIsShopField.GetValue(RunManager.instance); if (value is bool) { flag = (bool)value; num = 1; } else { num = 0; } } else { num = 0; } return (byte)((uint)num & (flag ? 1u : 0u)) != 0; } catch { return false; } } private static int GetPendingBlockCount() { return SumCounts(PendingModifierBlocks) + SumCounts(PendingEconomyBlocks) + SumCounts(PendingShopEconomyBlocks); } private static int GetLevelPendingBlockCount() { return SumCounts(PendingModifierBlocks) + SumCounts(PendingEconomyBlocks); } private static int GetShopPendingBlockCount() { return SumCounts(PendingShopEconomyBlocks); } private static string BuildSyncedStatusText() { List list = new List(); ChallengeDefinition activeChallenge = ChallengeManager.ActiveChallenge; if (activeChallenge != null && ChallengeManager.ActiveTarget > 0) { list.Add($"Challenge: {activeChallenge.name} to level {ChallengeManager.ActiveTarget}"); if (ChallengeManager.ActiveChallengeProgressBlocked) { list.Add("Challenge progress will not count. Start a fresh run from level 1."); } } string text = BuildBlackMarketStatusText(); if (!string.IsNullOrWhiteSpace(text)) { list.Add(text); } return string.Join("\n", list.ToArray()); } private static string BuildLobbyStatusText() { if (GetPendingBlockCount() == 0) { return string.Empty; } List list = new List { $"Black Market reserves: {SumCounts(PendingModifierBlocks)} modifier, {SumCounts(PendingEconomyBlocks)} economy, {SumCounts(PendingShopEconomyBlocks)} shop economy" }; string text = BuildReserveDetails(multiline: true); if (!string.IsNullOrWhiteSpace(text)) { list.Add(text); } return string.Join("\n", list.ToArray()); } private static string BuildBlackMarketStatusText() { int levelPendingBlockCount = GetLevelPendingBlockCount(); if (levelPendingBlockCount == 0 && RecentLevelBlocks.Count == 0) { return string.Empty; } string value = REPOConfig.UILanguage.Value; List list = new List(); if (levelPendingBlockCount > 0) { int num = SumCounts(PendingModifierBlocks); int num2 = SumCounts(PendingEconomyBlocks); List list2 = list; string item = ((value == "Korean") ? $"암시장 예약: 변경자 {num}, 경제 {num2}" : ((!(value == "Russian")) ? $"Black Market reserves: {num} modifier, {num2} economy" : $"Резервы Чёрного рынка: модификаторов {num}, экономик {num2}")); list2.Add(item); string text = BuildReserveDetails(multiline: true, includeLevel: true, includeShop: false); if (!string.IsNullOrWhiteSpace(text)) { list.Add(text); } } if (RecentLevelBlocks.Count > 0) { string item = ((value == "Korean") ? "차단됨: " : ((!(value == "Russian")) ? "Blocked: " : "Заблокировано: ")); string text2 = item; list.Add(text2 + string.Join("; ", RecentLevelBlocks.Take(3).ToArray())); } return string.Join("\n", list.ToArray()); } private static string BuildReserveDetails(bool multiline, bool includeLevel = true, bool includeShop = true) { string value = REPOConfig.UILanguage.Value; string text = ((value == "Korean") ? "변경자" : ((!(value == "Russian")) ? "Modifiers" : "Модификаторы")); string label = text; text = ((value == "Korean") ? "경제" : ((!(value == "Russian")) ? "Economy" : "Экономики")); string label2 = text; text = ((value == "Korean") ? "상점" : ((!(value == "Russian")) ? "Shop" : "Магазин")); string label3 = text; List list = new List(); if (includeLevel) { AddReserveDetail(list, label, PendingModifierBlocks, GetModifierDisplayName); AddReserveDetail(list, label2, PendingEconomyBlocks, GetEconomyDisplayName); } if (includeShop) { AddReserveDetail(list, label3, PendingShopEconomyBlocks, GetShopEconomyDisplayName); } if (!multiline) { return string.Join(" | ", list.ToArray()); } return string.Join("\n", list.ToArray()); } private static void AddReserveDetail(List parts, string label, Dictionary counts, Func nameResolver) { if (counts != null) { string[] array = (from kvp in counts.Where((KeyValuePair kvp) => !string.IsNullOrWhiteSpace(kvp.Key) && kvp.Value > 0).OrderBy, string>((KeyValuePair kvp) => nameResolver(kvp.Key), StringComparer.OrdinalIgnoreCase) select $"{nameResolver(kvp.Key)} x{kvp.Value}").ToArray(); if (array.Length != 0) { parts.Add(label + ": " + string.Join(", ", array)); } } } private static string GetModifierDisplayName(string id) { GameEvent gameEvent = REPOEventManager.AllEvents?.FirstOrDefault((GameEvent e) => string.Equals(e.id, id, StringComparison.OrdinalIgnoreCase)); return FirstNonEmpty(gameEvent?.name_en, id); } private static string GetEconomyDisplayName(string id) { return FirstNonEmpty(REPOConomyPlugin.GetEconomyNameForId(id), id); } private static string GetShopEconomyDisplayName(string id) { if (Enum.TryParse(id, ignoreCase: true, out var result)) { return ShopEconomyManager.GetShopEconomyName(result, "English"); } return id; } private static void SyncToClients() { REPOConomyNetworkHandler.SyncBlackMarketToClients(); } private static int GetEscalatedCost(int baseCost, int categoryPurchases) { float num = Mathf.Pow(1.1f, (float)Mathf.Max(0, categoryPurchases)); return Mathf.CeilToInt((float)Mathf.Max(0, baseCost) * num); } private static int GetConfiguredBaseCost(int configuredCost) { if (configuredCost >= 10000) { return Mathf.Max(1, Mathf.CeilToInt((float)configuredCost / 1000f)); } return Mathf.Max(0, configuredCost); } private static int GetCount(Dictionary counts, string key) { if (counts == null || string.IsNullOrWhiteSpace(key)) { return 0; } if (!counts.TryGetValue(key, out var value)) { return 0; } return Mathf.Max(0, value); } private static void AddCount(Dictionary counts, string key) { if (counts != null && !string.IsNullOrWhiteSpace(key)) { counts[key] = GetCount(counts, key) + 1; } } private static bool TryConsume(Dictionary counts, string key) { EnsureLoadedForCurrentSave(); int count = GetCount(counts, key); if (count <= 0) { return false; } if (count == 1) { counts.Remove(key); } else { counts[key] = count - 1; } return true; } private static int SumCounts(Dictionary counts) { return counts?.Values.Sum((int v) => Mathf.Max(0, v)) ?? 0; } private static void RecordLevelBlock(string text) { RecordBlock(RecentLevelBlocks, text); } private static void RecordShopBlock(string text) { RecordBlock(RecentShopBlocks, text); } private static void RecordBlock(List list, string text) { if (list != null && !string.IsNullOrWhiteSpace(text)) { list.Insert(0, text); while (list.Count > 5) { list.RemoveAt(list.Count - 1); } } } private static void EnsureLoadedForCurrentSave() { string currentSaveKey = GetCurrentSaveKey(); if (!string.Equals(loadedSaveKey, currentSaveKey, StringComparison.OrdinalIgnoreCase)) { LoadForCurrentSave(currentSaveKey); } } private static void ReloadForCurrentSave() { LoadForCurrentSave(GetCurrentSaveKey()); hasUncommittedShopPurchases = false; hasUncommittedConsumedBlocks = false; } private static void LoadForCurrentSave(string key) { PendingModifierBlocks.Clear(); PendingEconomyBlocks.Clear(); PendingShopEconomyBlocks.Clear(); RecentLevelBlocks.Clear(); RecentShopBlocks.Clear(); totalModifierPurchases = 0; totalEconomyPurchases = 0; totalShopEconomyPurchases = 0; loadedSaveKey = key; string savePath = GetSavePath(key); if (!File.Exists(savePath)) { return; } try { string[] array = File.ReadAllLines(savePath); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split(new char[1] { '|' }); if (array2.Length < 3 || !int.TryParse(array2[2], out var result) || result <= 0) { continue; } if (array2[0] == "P") { if (string.Equals(array2[1], "M", StringComparison.OrdinalIgnoreCase)) { totalModifierPurchases = result; } else if (string.Equals(array2[1], "E", StringComparison.OrdinalIgnoreCase)) { totalEconomyPurchases = result; } else if (string.Equals(array2[1], "S", StringComparison.OrdinalIgnoreCase)) { totalShopEconomyPurchases = result; } } else { Dictionary dictionary = array2[0] switch { "M" => PendingModifierBlocks, "E" => PendingEconomyBlocks, "S" => PendingShopEconomyBlocks, _ => null, }; if (dictionary != null && !string.IsNullOrWhiteSpace(array2[1])) { dictionary[array2[1]] = result; } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[BlackMarket] Failed to load reserves: " + ex.Message)); } } private static void SaveForCurrentSave() { string savePath = GetSavePath(loadedSaveKey = GetCurrentSaveKey()); try { Directory.CreateDirectory(Path.GetDirectoryName(savePath)); List list = new List(); AppendLines(list, "M", PendingModifierBlocks); AppendLines(list, "E", PendingEconomyBlocks); AppendLines(list, "S", PendingShopEconomyBlocks); AppendPurchaseCounter(list, "M", totalModifierPurchases); AppendPurchaseCounter(list, "E", totalEconomyPurchases); AppendPurchaseCounter(list, "S", totalShopEconomyPurchases); if (list.Count == 0) { if (File.Exists(savePath)) { File.Delete(savePath); } } else { File.WriteAllLines(savePath, list.ToArray()); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[BlackMarket] Failed to save reserves: " + ex.Message)); } } private static void AppendLines(List lines, string prefix, Dictionary counts) { foreach (KeyValuePair count in counts) { if (!string.IsNullOrWhiteSpace(count.Key) && count.Value > 0) { lines.Add($"{prefix}|{count.Key}|{count.Value}"); } } } private static void AppendPurchaseCounter(List lines, string category, int count) { if (count > 0) { lines.Add($"P|{category}|{count}"); } } private static string GetCurrentSaveKey() { try { string value = typeof(StatsManager).GetField("saveFileCurrent", BindingFlags.Instance | BindingFlags.NonPublic)?.GetValue(StatsManager.instance) as string; if (!string.IsNullOrWhiteSpace(value)) { return SanitizeFileName(value); } } catch { } return "active_run"; } public static string GetCurrentSaveKeyForChallenge() { return GetCurrentSaveKey(); } private static string GetSavePath(string saveKey) { return Path.Combine(Application.persistentDataPath, "REPOConomyPlus", "BlackMarket", saveKey + ".txt"); } private static string SanitizeFileName(string value) { char[] invalidFileNameChars = Path.GetInvalidFileNameChars(); foreach (char oldChar in invalidFileNameChars) { value = value.Replace(oldChar, '_'); } if (!string.IsNullOrWhiteSpace(value)) { return value; } return "active_run"; } private void ClampWindowToScreen() { ((Rect)(ref windowRect)).x = Mathf.Clamp(((Rect)(ref windowRect)).x, 8f, Mathf.Max(8f, (float)Screen.width - ((Rect)(ref windowRect)).width - 8f)); ((Rect)(ref windowRect)).y = Mathf.Clamp(((Rect)(ref windowRect)).y, 8f, Mathf.Max(8f, (float)Screen.height - ((Rect)(ref windowRect)).height - 8f)); } private void EnsureStyles() { //IL_0014: 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_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005a: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: 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_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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_0129: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Expected O, but got Unknown //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019e: 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_01c3: 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_01e2: 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_01f5: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown if (windowStyle == null) { GUIStyle val = new GUIStyle(GUI.skin.window) { padding = new RectOffset(14, 14, 12, 12) }; val.normal.background = panelTexture; windowStyle = val; GUIStyle val2 = new GUIStyle(GUI.skin.label) { fontSize = 20, fontStyle = (FontStyle)1 }; val2.normal.textColor = new Color(1f, 0.72f, 0.18f); val2.alignment = (TextAnchor)3; val2.wordWrap = true; titleStyle = val2; GUIStyle val3 = new GUIStyle(GUI.skin.label) { fontSize = 15, fontStyle = (FontStyle)1 }; val3.normal.textColor = new Color(0.45f, 0.95f, 1f); val3.wordWrap = true; subtitleStyle = val3; GUIStyle val4 = new GUIStyle(GUI.skin.label) { fontSize = 16 }; val4.normal.textColor = Color.white; val4.wordWrap = true; bodyStyle = val4; GUIStyle val5 = new GUIStyle(GUI.skin.label) { fontSize = 13 }; val5.normal.textColor = new Color(0.82f, 0.88f, 0.95f); val5.wordWrap = true; smallStyle = val5; buttonStyle = BuildButtonStyle(new Color(0.16f, 0.28f, 0.35f), Color.white); dangerButtonStyle = BuildButtonStyle(new Color(0.55f, 0.14f, 0.08f), new Color(1f, 0.82f, 0.32f)); choiceButtonStyle = BuildButtonStyle(new Color(0.13f, 0.18f, 0.24f), Color.white); GUIStyle val6 = new GUIStyle(GUI.skin.box) { padding = new RectOffset(12, 12, 10, 10) }; val6.normal.background = panelTexture; panelStyle = val6; } } private GUIStyle BuildButtonStyle(Color background, Color text) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: 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_009e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.button) { fontSize = 15, fontStyle = (FontStyle)1 }; val.normal.background = MakeTexture(background); val.normal.textColor = text; val.hover.background = MakeTexture(Color.Lerp(background, Color.white, 0.18f)); val.hover.textColor = Color.white; val.active.background = MakeTexture(Color.Lerp(background, Color.black, 0.18f)); val.active.textColor = text; val.alignment = (TextAnchor)4; val.wordWrap = true; return val; } private void CreateTextures() { //IL_0015: 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) panelTexture = MakeTexture(new Color(0.035f, 0.045f, 0.06f, 0.94f)); headerTexture = MakeTexture(new Color(0.14f, 0.05f, 0.02f, 0.96f)); } private static Texture2D MakeTexture(Color color) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown Texture2D val = new Texture2D(1, 1); val.SetPixel(0, 0, color); val.Apply(); return val; } private static string FirstNonEmpty(params string[] values) { foreach (string text in values) { if (!string.IsNullOrWhiteSpace(text)) { return text; } } return string.Empty; } private static string FormatMoney(int value) { return SemiFunc.DollarGetString(value) + "K"; } } public static class REPOConfig { private static ConfigFile configFile; public static ConfigEntry EnableEnemyHPScaling; public static ConfigEntry EnemyHPStartLevel; public static ConfigEntry EnemyHPMultiplier; public static ConfigEntry EnemyHPUseExponentialScaling; public static ConfigEntry EnemyHPMaxLevel; public static ConfigEntry EnemyHPScalingLevelCap; public static ConfigEntry ScaleEnemyDamageWithEnemyHP; public static ConfigEntry EnemyDamageEnemyHPScaleStrength; public static ConfigEntry ScalePlayerDamageWithEnemyHP; public static ConfigEntry PlayerDamageEnemyHPScaleStrength; public static ConfigEntry EnableEnemyCapScaling; public static ConfigEntry EnemyCapStartLevel; public static ConfigEntry EnemyCapMultiplier; public static ConfigEntry EnemyCapUseExponentialScaling; public static ConfigEntry EnemyCapMaxLevel; public static ConfigEntry EnemyCapScalingLevelCap; public static ConfigEntry ScaleEnemyRespawnWithEnemyCap; public static ConfigEntry EnemyRespawnCapScaleStrength; public static ConfigEntry EnableMapValueScaling; public static ConfigEntry MapValueStartLevel; public static ConfigEntry MapValueMultiplier; public static ConfigEntry MapValueUseExponentialScaling; public static ConfigEntry MapValueMaxLevel; public static ConfigEntry MapValueScalingLevelCap; public static ConfigEntry DefaultBaseMin; public static ConfigEntry DefaultBaseMax; public static ConfigEntry LevelScaleMin; public static ConfigEntry LevelScaleMax; public static ConfigEntry MinClampLimit; public static ConfigEntry MaxClampLimit; public static ConfigEntry ForceStableEconomy; public static ConfigEntry EventStartLevel; public static ConfigEntry UseEventChance; public static ConfigEntry EventChance; public static ConfigEntry ShowTotalMapValue; public static ConfigEntry UseSeparateModifiers; public static ConfigEntry UILanguage; public static ConfigEntry RollMode; public static ConfigEntry EnableCustomEvents; public static ConfigEntry DisableVanillaEvents; public static ConfigEntry UseCustomEventChance; public static ConfigEntry CustomEventChance; public static ConfigEntry DifficultyPerLevel; public static ConfigEntry DifficultyPerPlayer; public static ConfigEntry DifficultyPerValuable; public static ConfigEntry DifficultyMaxCap; public static ConfigEntry ModifierStartLevel; public static ConfigEntry MinModifierCount; public static ConfigEntry MaxModifierCount; public static ConfigEntry EnableLootModifiers; public static ConfigEntry EnableEnemyModifiers; public static ConfigEntry EnablePlayerModifiers; public static ConfigEntry EnableEnvironmentModifiers; public static ConfigEntry EnableSharedPool; public static ConfigEntry GlobalUpgradesMultiplier; public static ConfigEntry PlayerRevivalHotkey; public static ConfigEntry UIToggleHotkey; public static ConfigEntry UIAutoShowOnLevelStart; public static ConfigEntry EnableLevelScaling; public static ConfigEntry EnableMultiplicativeScaling; public static ConfigEntry LevelScalingMinModules; public static ConfigEntry LevelScalingMaxModulesLevel; public static ConfigEntry LevelScalingModulesInterval; public static ConfigEntry LevelScalingModulesPerInterval; public static ConfigEntry LevelScalingBaseExtractions; public static ConfigEntry LevelScalingExtractionsInterval; public static ConfigEntry LevelScalingExtractionsPerInterval; public static ConfigEntry LevelScalingMaxExtractions; public static ConfigEntry LevelScalingBaseHaulMultiplier; public static ConfigEntry LevelScalingHaulIncreasePerLevel; public static ConfigEntry LevelScalingMaxHaulLevel; public static ConfigEntry LevelScalingMaxHaulMultiplier; public static ConfigEntry EnableMoonScaling; public static ConfigEntry MoonLevelsPerPhase; public static ConfigEntry MoonMaxLevel; public static ConfigEntry HideVanillaMoonUI; public static Dictionary> EconomyEnables = new Dictionary>(); public static Dictionary> ModifierEnables = new Dictionary>(); public static Dictionary> ShopEconomyEnables = new Dictionary>(); public static Dictionary> ForceEconomy = new Dictionary>(); public static Dictionary> ForceModifier = new Dictionary>(); public static ConfigEntry EnableShopEconomy; public static ConfigEntry ForceNormalShopPrices; public static ConfigEntry ShopEconomyChance; public static ConfigEntry EnableBlackMarketShop; public static ConfigEntry BlackMarketHotkey; public static ConfigEntry BlackMarketModifierBlockCost; public static ConfigEntry BlackMarketEconomyBlockCost; public static ConfigEntry BlackMarketShopEconomyBlockCost; public static ConfigEntry RandomizeSeedEachLevel; public static ConfigEntry UseCustomSeed; public static ConfigEntry CustomSeedValue; public static ConfigEntry UseLevelBasedSeed; public static ConfigEntry ForceScaleInCart; public static ConfigEntry ScaleInCartSettings; public static ConfigEntry ForceExtractionShrink; public static ConfigEntry ExtractionShrinkSettings; public static ConfigEntry StrictForceMode; public static void Init(ConfigFile config) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Expected O, but got Unknown //IL_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Expected O, but got Unknown //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Expected O, but got Unknown //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Expected O, but got Unknown //IL_027d: Unknown result type (might be due to invalid IL or missing references) //IL_0287: Expected O, but got Unknown //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Expected O, but got Unknown //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Expected O, but got Unknown //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_035e: 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_03ef: Unknown result type (might be due to invalid IL or missing references) //IL_03f9: Expected O, but got Unknown //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0445: Expected O, but got Unknown //IL_046c: Unknown result type (might be due to invalid IL or missing references) //IL_0476: Expected O, but got Unknown //IL_04bf: Unknown result type (might be due to invalid IL or missing references) //IL_04c9: Expected O, but got Unknown //IL_0512: Unknown result type (might be due to invalid IL or missing references) //IL_051c: Expected O, but got Unknown //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_0565: Expected O, but got Unknown //IL_0593: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Expected O, but got Unknown //IL_05df: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Expected O, but got Unknown //IL_0610: Unknown result type (might be due to invalid IL or missing references) //IL_061a: Expected O, but got Unknown //IL_0663: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Expected O, but got Unknown //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06b5: Expected O, but got Unknown //IL_06e3: Unknown result type (might be due to invalid IL or missing references) //IL_06ed: Expected O, but got Unknown //IL_072f: Unknown result type (might be due to invalid IL or missing references) //IL_0739: Expected O, but got Unknown //IL_0760: Unknown result type (might be due to invalid IL or missing references) //IL_076a: Expected O, but got Unknown //IL_07c3: Unknown result type (might be due to invalid IL or missing references) //IL_07cd: Expected O, but got Unknown //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Expected O, but got Unknown //IL_0821: Unknown result type (might be due to invalid IL or missing references) //IL_082b: Expected O, but got Unknown //IL_084d: Unknown result type (might be due to invalid IL or missing references) //IL_0857: Expected O, but got Unknown //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_0884: Expected O, but got Unknown //IL_08a7: Unknown result type (might be due to invalid IL or missing references) //IL_08b1: Expected O, but got Unknown //IL_08d5: Unknown result type (might be due to invalid IL or missing references) //IL_08df: Expected O, but got Unknown //IL_0901: Unknown result type (might be due to invalid IL or missing references) //IL_090b: Expected O, but got Unknown //IL_0939: Unknown result type (might be due to invalid IL or missing references) //IL_0943: Expected O, but got Unknown //IL_0971: Unknown result type (might be due to invalid IL or missing references) //IL_097b: Expected O, but got Unknown //IL_099f: Unknown result type (might be due to invalid IL or missing references) //IL_09a9: Expected O, but got Unknown //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09e1: Expected O, but got Unknown //IL_0a2a: Unknown result type (might be due to invalid IL or missing references) //IL_0a34: Expected O, but got Unknown //IL_0a5c: Unknown result type (might be due to invalid IL or missing references) //IL_0a66: Expected O, but got Unknown //IL_0aaf: Unknown result type (might be due to invalid IL or missing references) //IL_0ab9: Expected O, but got Unknown //IL_0ae7: Unknown result type (might be due to invalid IL or missing references) //IL_0af1: Expected O, but got Unknown //IL_0b1f: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Expected O, but got Unknown //IL_0b57: Unknown result type (might be due to invalid IL or missing references) //IL_0b61: Expected O, but got Unknown //IL_0b8f: Unknown result type (might be due to invalid IL or missing references) //IL_0b99: Expected O, but got Unknown //IL_0bb6: Unknown result type (might be due to invalid IL or missing references) //IL_0bc0: Expected O, but got Unknown //IL_0c72: Unknown result type (might be due to invalid IL or missing references) //IL_0c7c: Expected O, but got Unknown //IL_0c9e: Unknown result type (might be due to invalid IL or missing references) //IL_0ca8: Expected O, but got Unknown //IL_0cca: Unknown result type (might be due to invalid IL or missing references) //IL_0cd4: Expected O, but got Unknown //IL_0db5: Unknown result type (might be due to invalid IL or missing references) //IL_0dbf: Expected O, but got Unknown configFile = config; DefaultBaseMin = config.Bind("Economy", "DefaultBaseMin", 5f, new ConfigDescription("Base minimum (-%) value without modifiers.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); DefaultBaseMax = config.Bind("Economy", "DefaultBaseMax", 10f, new ConfigDescription("Base maximum (+%) value without modifiers.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); UseSeparateModifiers = config.Bind("Economy", "UseTwoStepPercentRoll", false, "Use separate positive and negative percent rolls. Result = (base - rollMin) + rollMax."); RollMode = config.Bind("Economy", "PercentRollMode", "Random", new ConfigDescription("Determines weighed percentage RNG: Random = Uniform (Flat), Stable = Near center (Bell curve), Volatile = Near Min/Max (Inverse bell curve), Dynamic (Changes per level)", (AcceptableValueBase)(object)new AcceptableValueList(new string[4] { "Random", "Stable", "Volatile", "Dynamic" }), Array.Empty())); LevelScaleMin = config.Bind("LevelScale", "LevelScaleMin", 1f, new ConfigDescription("How much to add to the minimum (-%) for each level.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); LevelScaleMax = config.Bind("LevelScale", "LevelScaleMax", 2f, new ConfigDescription("How much to add to the maximum (+%) for each level.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); MinClampLimit = config.Bind("Limit", "ClampMinLimit", 100f, new ConfigDescription("Maximum reduction limit (for example: -100%).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 500f), Array.Empty())); MaxClampLimit = config.Bind("Limit", "ClampMaxLimit", 10000f, new ConfigDescription("Maximum increase limit (for example: +10000%).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 10000f), Array.Empty())); EventStartLevel = config.Bind("Economy", "EconomyStartLevel", 2, new ConfigDescription("At what level will random economy start (1–12). 1 = immediately, 2 = from the second level, etc.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 12), Array.Empty())); ForceStableEconomy = config.Bind("Economy", "NoRandomEconomy", false, "Force enable a stable economy (without random economy)."); DisableVanillaEvents = config.Bind("Economy", "DisableVanillaEconomy", false, "If true, disables all built-in vanilla random economies. Only custom economies will be used, if EnableCustomEconomies enabled."); EnableCustomEvents = config.Bind("Economy", "EnableCustomEconomies", true, "Enable loading of custom economy events from JSON files to appear in-game."); UseEventChance = config.Bind("EconomyChance", "UseEconomyChance", true, "Enable the random economy drop system based on chance."); EventChance = config.Bind("EconomyChance", "EconomyChance", 50, new ConfigDescription("Chance (1–100) for an random economy to occur instead of a stable economy.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); UseCustomEventChance = config.Bind("CustomEconomyChance", "UseCustomEconomyChance", true, "Enable a separate chance check for custom random economy (only applies if UseEventsChance is true). If this feature is disabled, there will be a 50/50 chance of either a vanilla economy or a custom economy occurring."); CustomEventChance = config.Bind("CustomEconomyChance", "CustomEconomyChance", 50, new ConfigDescription("Chance (1–100%) for custom economy to occur instead of vanilla economy if UseCustomEconomyChance is enabled.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); ShowTotalMapValue = config.Bind("Debug", "ShowTotalMapValue", false, "Show total value of all valuables on the map in logs."); UILanguage = config.Bind("UI Settings", "UILanguage", "English", new ConfigDescription("Language used for the economy UI.", (AcceptableValueBase)(object)new AcceptableValueList(new string[3] { "English", "Russian", "Korean" }), Array.Empty())); UIToggleHotkey = config.Bind("UI Settings", "UIToggleHotkey", (KeyCode)103, new ConfigDescription("Hotkey to toggle the economy UI on/off.", (AcceptableValueBase)null, Array.Empty())); UIAutoShowOnLevelStart = config.Bind("UI Settings", "UIAutoShowOnLevelStart", true, "Automatically show UI when entering a level."); EnableEnemyHPScaling = config.Bind("Enemy HP Scaling", "EnableEnemyHPScaling", true, "Enable enemy HP scaling per level."); EnemyHPStartLevel = config.Bind("Enemy HP Scaling", "StartLevel", 3, new ConfigDescription("Level at which enemy HP scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); EnemyHPMultiplier = config.Bind("Enemy HP Scaling", "Multiplier", 1.02f, new ConfigDescription("Enemy HP multiplier per level (1.02 = +2% per level).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 2f), Array.Empty())); EnemyHPUseExponentialScaling = config.Bind("Enemy HP Scaling", "UseExponentialScaling", false, "Use exponential scaling (pow) instead of linear scaling for enemy HP."); EnemyHPMaxLevel = config.Bind("Enemy HP Scaling", "MaxLevel", 100, new ConfigDescription("Maximum level for enemy HP scaling. Scaling stops increasing beyond this level.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); EnemyHPScalingLevelCap = config.Bind("Enemy HP Scaling", "LevelCap", 100, new ConfigDescription("Level at which enemy HP scaling stops.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); ScaleEnemyDamageWithEnemyHP = config.Bind("Enemy HP Scaling", "ScaleEnemyDamageWithEnemyHP", true, "Scale damage dealt to enemies from the extra enemy HP multiplier."); EnemyDamageEnemyHPScaleStrength = config.Bind("Enemy HP Scaling", "EnemyDamageEnemyHPScaleStrength", 1f, new ConfigDescription("How much enemy HP scaling affects damage dealt to enemies. 0 = no extra damage, 1 = full enemy HP multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); ScalePlayerDamageWithEnemyHP = config.Bind("Enemy HP Scaling", "ScalePlayerDamageWithEnemyHP", true, "Scale enemy damage dealt to players from the extra enemy HP multiplier."); PlayerDamageEnemyHPScaleStrength = config.Bind("Enemy HP Scaling", "PlayerDamageEnemyHPScaleStrength", 1f, new ConfigDescription("How much enemy HP scaling affects damage to players. 0 = no extra damage, 1 = full enemy HP multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); EnableEnemyCapScaling = config.Bind("Enemy Cap Scaling", "EnableEnemyCapScaling", true, "Enable max enemy cap scaling per level."); EnemyCapStartLevel = config.Bind("Enemy Cap Scaling", "StartLevel", 20, new ConfigDescription("Level at which enemy cap scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); EnemyCapMultiplier = config.Bind("Enemy Cap Scaling", "Multiplier", 1.03f, new ConfigDescription("Max enemy cap multiplier per level (1.05 = +5 per level).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 2f), Array.Empty())); EnemyCapUseExponentialScaling = config.Bind("Enemy Cap Scaling", "UseExponentialScaling", false, "Use exponential scaling (pow) instead of linear scaling for enemy cap."); EnemyCapMaxLevel = config.Bind("Enemy Cap Scaling", "MaxLevel", 100, new ConfigDescription("Maximum level for enemy cap scaling. Scaling stops increasing beyond this level.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); EnemyCapScalingLevelCap = config.Bind("Enemy Cap Scaling", "LevelCap", 100, new ConfigDescription("Level at which enemy cap scaling stops.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); ScaleEnemyRespawnWithEnemyCap = config.Bind("Enemy Cap Scaling", "ScaleEnemyRespawnWithEnemyCap", true, "Scale enemy respawn/despawn timers from the extra enemy cap multiplier."); EnemyRespawnCapScaleStrength = config.Bind("Enemy Cap Scaling", "EnemyRespawnCapScaleStrength", 1f, new ConfigDescription("How much enemy cap scaling affects enemy respawn time. 0 = no extra delay, 1 = full enemy cap multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 2f), Array.Empty())); EnableMapValueScaling = config.Bind("Map Value Scaling", "EnableMapValueScaling", true, "Enable total map value scaling per level."); MapValueStartLevel = config.Bind("Map Value Scaling", "StartLevel", 2, new ConfigDescription("Level at which map value scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 50), Array.Empty())); MapValueMultiplier = config.Bind("Map Value Scaling", "Multiplier", 1.02f, new ConfigDescription("Total map value multiplier per level (1.03 = +3% per level).", (AcceptableValueBase)(object)new AcceptableValueRange(1f, 2f), Array.Empty())); MapValueUseExponentialScaling = config.Bind("Map Value Scaling", "UseExponentialScaling", false, "Use exponential scaling (pow) instead of linear scaling for map value."); MapValueMaxLevel = config.Bind("Map Value Scaling", "MaxLevel", 100, new ConfigDescription("Maximum level for map value scaling. Scaling stops increasing beyond this level.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); MapValueScalingLevelCap = config.Bind("Map Value Scaling", "LevelCap", 100, new ConfigDescription("Level at which map value scaling stops.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); EnableLevelScaling = config.Bind("Level Scaling", "EnableLevelScaling", true, "Enable level scaling for modules, extractions, and haul multiplier."); EnableMultiplicativeScaling = config.Bind("Level Scaling", "EnableMultiplicativeScaling", false, "Enable multiplicative scaling instead of additive. Each level multiplies the current value."); LevelScalingMinModules = config.Bind("Level Scaling", "MinModules", 3, new ConfigDescription("Minimum number of modules per level.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 10), Array.Empty())); LevelScalingMaxModulesLevel = config.Bind("Level Scaling", "MaxModulesLevel", 48, new ConfigDescription("Up to which level modules will increase (after this level, modules stay the same).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 1000), Array.Empty())); LevelScalingModulesInterval = config.Bind("Level Scaling", "ModulesInterval", 3, new ConfigDescription("Every how many levels to add modules.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 10), Array.Empty())); LevelScalingModulesPerInterval = config.Bind("Level Scaling", "ModulesPerInterval", 1, new ConfigDescription("How many modules to add every interval levels.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 5), Array.Empty())); LevelScalingBaseExtractions = config.Bind("Level Scaling", "BaseExtractions", 0, new ConfigDescription("Base number of extractions (0 = 1 extraction).", (AcceptableValueBase)(object)new AcceptableValueRange(0, 10), Array.Empty())); LevelScalingMaxExtractions = config.Bind("Level Scaling", "MaxExtractions", 4, new ConfigDescription("Maximum number of extractions.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 20), Array.Empty())); LevelScalingExtractionsInterval = config.Bind("Level Scaling", "ExtractionsInterval", 20, new ConfigDescription("Every how many levels to add extractions.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 20), Array.Empty())); LevelScalingExtractionsPerInterval = config.Bind("Level Scaling", "ExtractionsPerInterval", 1, new ConfigDescription("How many extractions to add every interval levels.", (AcceptableValueBase)(object)new AcceptableValueRange(0, 5), Array.Empty())); LevelScalingBaseHaulMultiplier = config.Bind("Level Scaling", "BaseHaulMultiplier", 0.5f, new ConfigDescription("Base haul goal multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 2f), Array.Empty())); LevelScalingMaxHaulMultiplier = config.Bind("Level Scaling", "MaxHaulMultiplier", 0.75f, new ConfigDescription("Maximum haul multiplier.", (AcceptableValueBase)(object)new AcceptableValueRange(0.5f, 5f), Array.Empty())); LevelScalingMaxHaulLevel = config.Bind("Level Scaling", "MaxHaulLevel", 100, new ConfigDescription("Up to which level haul multiplier will increase.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); LevelScalingHaulIncreasePerLevel = config.Bind("Level Scaling", "HaulIncreasePerLevel", 0.002525f, new ConfigDescription("How much to increase haul multiplier per level.", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 0.1f), Array.Empty())); EnableMoonScaling = config.Bind("Moon Scaling", "EnableMoonScaling", true, "Enable custom moon phase progression based on levels. Moon phases control difficulty modifiers."); MoonLevelsPerPhase = config.Bind("Moon Scaling", "LevelsPerPhase", 10f, new ConfigDescription("How many levels per moon phase (e.g., 10 = phase changes every 10 levels).", (AcceptableValueBase)(object)new AcceptableValueRange(5f, 30f), Array.Empty())); MoonMaxLevel = config.Bind("Moon Scaling", "MaxMoonLevel", 60, new ConfigDescription("Level at which max moon phase is reached (e.g., 60 = phase 4 at level 60).", (AcceptableValueBase)(object)new AcceptableValueRange(20, 200), Array.Empty())); HideVanillaMoonUI = config.Bind("Moon Scaling", "HideVanillaMoonUI", true, "Hide the vanilla moon phase UI animation and show moon info in mod UI instead."); DifficultyPerLevel = config.Bind("Difficulty System", "DifficultyPerLevel", 1f, new ConfigDescription("How much difficulty to add per level (e.g., level 5 = +5 difficulty).", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 50f), Array.Empty())); DifficultyPerPlayer = config.Bind("Difficulty System", "DifficultyPerPlayer", 0f, new ConfigDescription("How much difficulty to add per player (e.g., 4 players = +0 difficulty). NOT WORKING!", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 50f), Array.Empty())); DifficultyPerValuable = config.Bind("Difficulty System", "DifficultyPerValuable", 0f, new ConfigDescription("How much difficulty to add per valuable on map (e.g., 100 valuables = +0 difficulty). NOT WORKING!", (AcceptableValueBase)(object)new AcceptableValueRange(0f, 5f), Array.Empty())); DifficultyMaxCap = config.Bind("Difficulty System", "DifficultyMaxCap", 100f, new ConfigDescription("Maximum difficulty cap. Difficulty will never go above this value.", (AcceptableValueBase)(object)new AcceptableValueRange(10f, 500f), Array.Empty())); GlobalUpgradesMultiplier = config.Bind("Upgrades Rework", "GlobalUpgradesMultiplier", 0.5f, new ConfigDescription("Multiplier for upgrades (1.0 = default, 2.0 = double upgrades bonus)", (AcceptableValueBase)(object)new AcceptableValueRange(0.1f, 10f), Array.Empty())); PlayerRevivalHotkey = config.Bind("Player Revival", "RevivalHotkey", (KeyCode)114, new ConfigDescription("Hotkey to revive player when dead (only works once per player per round).", (AcceptableValueBase)null, Array.Empty())); ForceScaleInCart = config.Bind("Forced Modifiers", "ForceScaleInCart", false, "Always enable 'Compact Storage' modifier."); ScaleInCartSettings = config.Bind("Forced Modifiers", "ScaleInCartSettings", "Tiny:0.75, Small:0.65, Medium:0.55, Big:0.45, Wide:0.35, Tall:0.30, VeryTall:0.25", "Scale in cart settings (TYPE:SCALE). Valid types: Tiny, Small, Medium, Big, Wide, Tall, VeryTall."); ForceExtractionShrink = config.Bind("Forced Modifiers", "ForceExtractionShrink", false, "Always enable 'Extraction Shrink' modifier."); ExtractionShrinkSettings = config.Bind("Forced Modifiers", "ExtractionShrinkSettings", "Tiny:0.85, Small:0.75, Medium:0.65, Big:0.55, Wide:0.45, Tall:0.35, VeryTall:0.30", "Extraction shrink settings (TYPE:SCALE)."); StrictForceMode = config.Bind("Forced Modifiers", "StrictForceMode", true, "Strict force mode: when forced modifiers conflict, a newly applied forced modifier replaces conflicting forced ones."); ModifierStartLevel = config.Bind("Event Modifiers", "ModifierStartLevel", 2, new ConfigDescription("At what level modifiers will start appearing (1–12). 1 = immediately, 2 = from the second level, etc.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 12), Array.Empty())); MinModifierCount = config.Bind("Event Modifiers", "MinModifierCount", 2, new ConfigDescription("Minimum number of gameplay modifiers per level (2-5).", (AcceptableValueBase)(object)new AcceptableValueRange(0, 5), Array.Empty())); MaxModifierCount = config.Bind("Event Modifiers", "MaxModifierCount", 5, new ConfigDescription("Maximum number of gameplay modifiers per level (2-5).", (AcceptableValueBase)(object)new AcceptableValueRange(1, 5), Array.Empty())); EnableLootModifiers = config.Bind("Event Modifiers", "EnableLootModifiers", true, "Enable loot-related events (e.g., Jackpot, Empty Facility, Value Lottery)."); EnableEnemyModifiers = config.Bind("Event Modifiers", "EnableEnemyModifiers", true, "Enable enemy-related events (e.g., Enemy Horde, Speed Demons, Pacifist Mode)."); EnablePlayerModifiers = config.Bind("Event Modifiers", "EnablePlayerModifiers", true, "Enable player-related events (e.g., Sonic Speed, Glass Cannon, Infinite Stamina)."); EnableEnvironmentModifiers = config.Bind("Event Modifiers", "EnableEnvironmentModifiers", true, "Enable environment-related events (e.g., Darkness, Disco Lights)."); EnableSharedPool = config.Bind("Event Modifiers", "EnableSharedPool", true, "Enable shared pool mode: all events are in one pool, selected based on difficulty-adjusted chances."); EnableShopEconomy = config.Bind("Shop Economy", "EnableShopEconomy", true, "Enable the shop economy system that modifies shop prices."); ForceNormalShopPrices = config.Bind("Shop Economy", "ForceNormalShopPrices", false, "Force normal shop prices (disable random shop economy events)."); ShopEconomyChance = config.Bind("Shop Economy", "ShopEconomyChance", 50, new ConfigDescription("Chance (1–100) for a shop economy event to occur. If roll fails, normal prices apply.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 100), Array.Empty())); EnableBlackMarketShop = config.Bind("Shop Economy", "EnableBlackMarketShop", true, "Enable the REPOConomyPlus black market menu in the shop."); BlackMarketHotkey = config.Bind("Shop Economy", "BlackMarketHotkey", (KeyCode)98, "Hotkey used to open the REPOConomyPlus black market while in the shop."); BlackMarketModifierBlockCost = config.Bind("Shop Economy", "BlackMarketModifierBlockCost", 75, "Cost to block one modifier from the next level roll."); BlackMarketEconomyBlockCost = config.Bind("Shop Economy", "BlackMarketEconomyBlockCost", 100, "Cost to block one economy from the next level roll."); BlackMarketShopEconomyBlockCost = config.Bind("Shop Economy", "BlackMarketShopEconomyBlockCost", 125, "Cost to block one shop economy from the next shop economy roll."); RandomizeSeedEachLevel = config.Bind("Seed Settings", "RandomizeSeedEachLevel", true, "Generate a new random seed for each level and save it to config. If enabled, a new seed is created every level. If disabled, uses CustomSeedValue."); UseCustomSeed = config.Bind("Seed Settings", "UseCustomSeed", false, "Use a specific seed for economy and modifiers generation. Useful for fun or speedruns."); CustomSeedValue = config.Bind("Seed Settings", "CustomSeedValue", "", "The seed to use (text or numbers). If empty, a random seed is generated."); UseLevelBasedSeed = config.Bind("Seed Settings", "UseLevelBasedSeed", false, "If true, the level number is added to the custom seed (different results each level). If false, the seed stays exactly as written (same results every level if seed is same)."); } public static void InitDynamicConfigs(ConfigFile config) { foreach (object value in Enum.GetValues(typeof(REPOConomyPlugin.EconomyType))) { string text = $"Enable {value}"; EconomyEnables[text] = config.Bind("Economies", text, true, $"Enable the {value} economy event."); } foreach (CustomEconomyData customEvent in CustomEconomyLoader.CustomEvents) { string text2 = "Enable Custom " + customEvent.id; EconomyEnables[text2] = config.Bind("Economies", text2, true, "Enable the custom economy: " + customEvent.name_en + "."); } foreach (GameEvent allEvent in REPOEventManager.AllEvents) { string text3 = "Enable " + allEvent.id; ModifierEnables[text3] = config.Bind("Modifiers", text3, true, "Enable the " + allEvent.name_en + " modifier."); } foreach (ShopEconomyType value2 in Enum.GetValues(typeof(ShopEconomyType))) { if (value2 != 0) { string text4 = $"Enable Shop {value2}"; ShopEconomyEnables[text4] = config.Bind("Shop Economies", text4, true, $"Enable the {value2} shop economy."); } } foreach (string key in EconomyEnables.Keys) { GetOrCreateForceEconomyEntry(key); } foreach (string key2 in ShopEconomyEnables.Keys) { GetOrCreateForceEconomyEntry(key2); } foreach (string key3 in ModifierEnables.Keys) { GetOrCreateForceModifierEntry(key3); } } public static ConfigEntry GetOrCreateForceEconomyEntry(string key) { if (string.IsNullOrWhiteSpace(key)) { return null; } if (ForceEconomy.TryGetValue(key, out var value) && value != null) { return value; } if (configFile == null) { return null; } ConfigEntry val = configFile.Bind("Force Economies", key, false, "Force economy '" + key + "' to be selected."); ForceEconomy[key] = val; return val; } public static ConfigEntry GetOrCreateForceModifierEntry(string key) { if (string.IsNullOrWhiteSpace(key)) { return null; } if (ForceModifier.TryGetValue(key, out var value) && value != null) { return value; } if (configFile == null) { return null; } ConfigEntry val = configFile.Bind("Force Modifiers", key, false, "Force modifier '" + key + "' to be selected."); ForceModifier[key] = val; return val; } public static bool IsEconomyEnabled(REPOConomyPlugin.EconomyType economyType) { string key = $"Enable_{economyType}"; if (EconomyEnables.ContainsKey(key)) { return EconomyEnables[key].Value; } return false; } public static bool IsCustomEconomyEnabled(string customId) { string key = "Enable_Custom_" + customId; if (EconomyEnables.ContainsKey(key)) { return EconomyEnables[key].Value; } return false; } public static bool IsModifierEnabled(string modifierId) { string key = "Enable_" + modifierId; if (ModifierEnables.ContainsKey(key)) { return ModifierEnables[key].Value; } return false; } } public class REPOConomyNetworkHandler : MonoBehaviour { [CompilerGenerated] private sealed class d__26 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__26(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Invalid comparison between Unknown and I4 //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Invalid comparison between Unknown and I4 //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[Client] \ud83c\udfae Event IDs synced!"); 5__2 = 30f; goto IL_0074; case 1: <>1__state = -1; 5__2 -= 0.5f; goto IL_0074; case 2: <>1__state = -1; 5__2 -= 0.5f; goto IL_00f9; case 3: { <>1__state = -1; if (REPOEventManager.FoundMap) { REPOConomyPlugin.Logger.LogInfo((object)"[Client] \ud83d\uddfa\ufe0f Triggering Found Map reveal"); Patch_FoundMap_RevealAll.TriggerRevealFromNetwork(); } if (REPOEventManager.Earthquake) { REPOConomyPlugin.Logger.LogInfo((object)"[Client] \ud83c\udf0d Triggering Earthquake from network sync"); Patch_Earthquake.TriggerEarthquakeFromNetwork(); } REPOConomyPlugin.Logger.LogInfo((object)"[Client] ✅ Special events applied after network sync"); return false; } IL_0074: if (!SemiFunc.RunIsLevel() && 5__2 > 0f) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel()) { REPOConomyPlugin.Logger.LogWarning((object)"[Client] Timeout waiting for level"); return false; } 5__2 = 60f; goto IL_00f9; IL_00f9: if (5__2 > 0f && (!((Object)(object)GameDirector.instance != (Object)null) || (int)GameDirector.instance.currentState != 2)) { <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } if ((Object)(object)GameDirector.instance == (Object)null || (int)GameDirector.instance.currentState != 2) { REPOConomyPlugin.Logger.LogWarning((object)"[Client] Timeout waiting for GameDirector.Main state"); return false; } REPOConomyPlugin.Logger.LogInfo((object)"[Client] ✅ GameDirector is in Main state, applying events..."); <>2__current = (object)new WaitForSeconds(1f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private const byte ECONOMY_SYNC_EVENT = 179; private const byte MODIFIERS_SYNC_EVENT = 180; private const byte DIFFICULTY_SYNC_EVENT = 181; private const byte UPGRADES_MULTIPLIER_SYNC_EVENT = 182; private const byte UI_SHOW_EVENT = 183; private const byte SHARED_POOL_SYNC_EVENT = 184; private const byte SCALING_SYNC_EVENT = 185; private const byte SEED_SYNC_EVENT = 186; private const byte BLOODLUST_SYNC_EVENT = 187; private const byte SHOP_ECONOMY_SYNC_EVENT = 188; private const byte EXPLOSION_SYNC_EVENT = 189; private const byte BLACK_MARKET_SYNC_EVENT = 190; private const byte CHALLENGE_COMPLETION_SYNC_EVENT = 191; private const byte DANGEROUS_VALUABLE_SYNC_EVENT = 192; private void Start() { PhotonNetwork.NetworkingClient.EventReceived += OnEvent; } private void OnDestroy() { PhotonNetwork.NetworkingClient.EventReceived -= OnEvent; } private void OnEvent(EventData evt) { if (evt.Code == 179) { HandleEconomySync(evt); } else if (evt.Code == 180) { HandleModifiersSync(evt); } else if (evt.Code == 181) { HandleDifficultySync(evt); } else if (evt.Code == 182) { HandleUpgradesMultiplierSync(evt); } else if (evt.Code == 183) { HandleUiShow(evt); } else if (evt.Code == 184) { HandleSharedPoolSync(evt); } else if (evt.Code == 185) { HandleScalingSync(evt); } else if (evt.Code == 186) { HandleSeedSync(evt); } else if (evt.Code == 187) { HandleBloodlustSync(evt); } else if (evt.Code == 188) { HandleShopEconomySync(evt); } else if (evt.Code == 189) { HandleExplosionSync(evt); } else if (evt.Code == 190) { HandleBlackMarketSync(evt); } else if (evt.Code == 191) { HandleChallengeCompletionSync(evt); } else if (evt.Code == 192) { HandleDangerousValuableSync(evt); } } private void HandleEconomySync(EventData evt) { //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) try { object[] array = (object[])evt.CustomData; if (array.Length < 5) { REPOConomyPlugin.Logger.LogWarning((object)"[REPOConomy] Invalid economy event data."); return; } if ((int)array[0] == -1) { CustomEconomyData customEconomyData = new CustomEconomyData(); customEconomyData.id = (string)array[5]; customEconomyData.name_en = (string)array[6]; customEconomyData.name_ru = (string)array[7]; customEconomyData.desc_en = (string)array[8]; customEconomyData.desc_ru = (string)array[9]; customEconomyData.color = new float[3] { (float)array[10], (float)array[11], (float)array[12] }; customEconomyData.min = (float)array[1]; customEconomyData.max = (float)array[2]; CustomEconomyData customEconomyData3 = (REPOConomyPlugin.CurrentCustomEconomy = customEconomyData); REPOConomyPlugin.CurrentEconomy = REPOConomyPlugin.EconomyType.Stable; REPOConomyPlugin.CurrentEconomyColor = new Color(customEconomyData3.color[0], customEconomyData3.color[1], customEconomyData3.color[2]); REPOConomyPlugin.Logger.LogInfo((object)("[Economy] Synced custom event: " + customEconomyData3.id)); } else { REPOConomyPlugin.CurrentEconomy = (REPOConomyPlugin.EconomyType)(int)array[0]; REPOConomyPlugin.CurrentCustomEconomy = null; REPOConomyPlugin.CurrentEconomyColor = REPOConomyPlugin.GetEconomyColor(); REPOConomyPlugin.Logger.LogInfo((object)$"[Economy] Synced vanilla event: {REPOConomyPlugin.CurrentEconomy}"); } REPOConomyPlugin.MinPercent = (float)array[1]; REPOConomyPlugin.MaxPercent = (float)array[2]; REPOConomyPlugin.ClientDeltaMin = (float)array[3]; REPOConomyPlugin.ClientDeltaMax = (float)array[4]; REPOConomyPlugin.HasEconomy = true; } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[REPOConomy] HandleEconomySync: {arg}"); } } private void HandleModifiersSync(EventData evt) { try { object[] array = (object[])evt.CustomData; string[] array2; if (array[0] is string[]) { array2 = (string[])array[0]; } else { if (!(array[0] is object[])) { REPOConomyPlugin.Logger.LogError((object)"[Modifiers] Invalid eventIds type"); return; } array2 = ((object[])array[0]).Select((object o) => o.ToString()).ToArray(); } float num = ConvertToFloat(array[1]); float num2 = ConvertToFloat(array[2]); long num3 = Convert.ToInt64(array[3]); long num4 = Convert.ToInt64(array[4]); long num5 = Convert.ToInt64(array[5]); long num6 = ((array.Length > 11) ? Convert.ToInt64(array[11]) : 0); long num7 = ((array.Length > 12) ? Convert.ToInt64(array[12]) : 0); long num8 = ((array.Length > 13) ? Convert.ToInt64(array[13]) : 0); REPOEventManager.EnemiesInvisible = (num3 & 1) != 0; REPOEventManager.PlayersInvisible = (num3 & 2) != 0; REPOEventManager.RandomBoosts = (num3 & 4) != 0; REPOEventManager.HealthRegeneration = (num3 & 8) != 0; REPOEventManager.ToxicAir = (num3 & 0x10) != 0; REPOEventManager.FoggyVision = (num3 & 0x20) != 0; REPOEventManager.InvertedControls = (num3 & 0x40) != 0; REPOEventManager.GoldenTouch = (num3 & 0x80) != 0; REPOEventManager.FrozenEnemies = (num3 & 0x100) != 0; REPOEventManager.MagneticValuables = (num3 & 0x200) != 0; REPOEventManager.EnemyMultiplication = (num3 & 0x400) != 0; REPOEventManager.SuperJump = (num3 & 0x800) != 0; REPOEventManager.NightVision = (num3 & 0x1000) != 0; REPOEventManager.LuckyFind = (num3 & 0x2000) != 0; REPOEventManager.StickyFeet = (num3 & 0x4000) != 0; REPOEventManager.TimeWarp = (num3 & 0x8000) != 0; REPOEventManager.InfiniteAmmo = (num3 & 0x10000) != 0; REPOEventManager.OneHitKill = (num3 & 0x20000) != 0; REPOEventManager.OneHitKillPlayers = (num3 & 0x40000) != 0; REPOEventManager.HealthVampire = (num3 & 0x80000) != 0; REPOEventManager.ExtractionRush = (num3 & 0x100000) != 0; REPOEventManager.ExtractionMagnet = (num3 & 0x200000) != 0; REPOEventManager.ExtractionShield = (num3 & 0x400000) != 0; REPOEventManager.ExtractionChaos = (num3 & 0x800000) != 0; REPOEventManager.SingleExtraction = (num3 & 0x1000000) != 0; REPOEventManager.DoublePlayerDamage = (num3 & 0x2000000) != 0; REPOEventManager.DoubleEnemyHealth = (num3 & 0x4000000) != 0; REPOEventManager.HalfPlayerDamage = (num3 & 0x8000000) != 0; REPOEventManager.DoubleEnemyDamage = (num3 & 0x10000000) != 0; REPOEventManager.ValuablesUnbreakable = (num3 & 0x20000000) != 0; REPOEventManager.ValuablesFragile = (num3 & 0x40000000) != 0; REPOEventManager.FeatherWeight = (num3 & 0x80000000u) != 0; REPOEventManager.HeavyBurden = (num3 & 0x100000000L) != 0; REPOEventManager.SlipperyChaos = (num3 & 0x200000000L) != 0; REPOEventManager.ZeroGravityLoot = (num3 & 0x400000000L) != 0; REPOEventManager.PhantomObjects = (num3 & 0x800000000L) != 0; REPOEventManager.BouncyHavoc = (num3 & 0x1000000000L) != 0; REPOEventManager.ScaleInCart = (num3 & 0x2000000000L) != 0; REPOEventManager.EnemyHeavyWeight = (num3 & 0x4000000000L) != 0; REPOEventManager.EnemyLightWeight = (num3 & 0x8000000000L) != 0; REPOEventManager.InstantRespawn = (num3 & 0x10000000000L) != 0; REPOEventManager.PersistentEnemies = (num3 & 0x20000000000L) != 0; REPOEventManager.ExplosiveValuables = (num3 & 0x40000000000L) != 0; REPOEventManager.HotPotato = (num3 & 0x80000000000L) != 0; REPOEventManager.UnbreakableDoors = (num3 & 0x100000000000L) != 0; REPOEventManager.PlayerRevival = (num3 & 0x200000000000L) != 0; REPOEventManager.ShrinkExtractionValuables = (num3 & 0x400000000000L) != 0; REPOEventManager.EnemiesOmniscient = (num3 & 0x800000000000L) != 0; REPOEventManager.BossFight = (num3 & 0x1000000000000L) != 0; REPOEventManager.TooQuiet = (num3 & 0x2000000000000L) != 0; REPOEventManager.InvincibleHorror = (num3 & 0x4000000000000L) != 0; REPOEventManager.PitImmunity = (num3 & 0x8000000000000L) != 0; REPOEventManager.EnemiesPitImmunity = (num3 & 0x10000000000000L) != 0; REPOEventManager.UnstableGrabbing = (num3 & 0x20000000000000L) != 0; REPOEventManager.NoOvercharge = (num3 & 0x40000000000000L) != 0; REPOEventManager.LevelGlitch = (num3 & 0x80000000000000L) != 0; REPOEventManager.SettleItInSmash = (num3 & 0x100000000000000L) != 0; REPOEventManager.FoundMap = (num3 & 0x200000000000000L) != 0; REPOEventManager.SuperRecoil = (num3 & 0x400000000000000L) != 0; REPOEventManager.JammingGuns = (num3 & 0x800000000000000L) != 0; REPOEventManager.CheapBatteries = (num3 & 0x1000000000000000L) != 0; REPOEventManager.ExplosiveTumble = (num3 & 0x2000000000000000L) != 0; REPOEventManager.GlassBones = (num3 & 0x4000000000000000L) != 0; REPOEventManager.SlipperyHands = (num4 & 1) != 0; REPOEventManager.GiantPlayer = (num4 & 2) != 0; REPOEventManager.TinyPlayer = (num4 & 4) != 0; REPOEventManager.WeakArms = (num4 & 8) != 0; REPOEventManager.StrongArms = (num4 & 0x10) != 0; REPOEventManager.Earthquake = (num4 & 0x20) != 0; REPOEventManager.NoJump = (num4 & 0x40) != 0; REPOEventManager.TotalDarkness = (num4 & 0x80) != 0; REPOEventManager.KamikazeEnemies = (num4 & 0x100) != 0; REPOEventManager.RegeneratingEnemies = (num4 & 0x200) != 0; REPOEventManager.ShadowClones = (num4 & 0x400) != 0; REPOEventManager.DangerousValuables = (num4 & 0x800) != 0; REPOEventManager.CloakedValuables = (num4 & 0x1000) != 0; REPOEventManager.RunawayValuables = (num4 & 0x2000) != 0; REPOEventManager.EnemiesFasterOnKill = (num4 & 0x4000) != 0; REPOEventManager.CriticalHits = (num4 & 0x8000) != 0; REPOEventManager.Dodge = (num4 & 0x10000) != 0; REPOEventManager.ChainReaction = (num4 & 0x20000) != 0; REPOEventManager.FakeValuables = (num4 & 0x40000) != 0; REPOEventManager.ValueDecay = (num4 & 0x80000) != 0; REPOEventManager.EnemyHealOnDamage = (num4 & 0x100000) != 0; REPOEventManager.PlayerDeaf = (num4 & 0x200000) != 0; REPOEventManager.TeleportingEnemies = (num4 & 0x400000) != 0; REPOEventManager.SharedPain = (num4 & 0x800000) != 0; REPOEventManager.SharedHealing = (num4 & 0x1000000) != 0; REPOEventManager.LowHealthSpeedBoost = (num4 & 0x2000000) != 0; REPOEventManager.ValuableEncumbrance = (num4 & 0x4000000) != 0; REPOEventManager.SpeedZones = (num4 & 0x8000000) != 0; REPOEventManager.RandomPlayerTeleportations = (num4 & 0x10000000) != 0; REPOEventManager.StickyValuables = (num4 & 0x20000000) != 0; REPOEventManager.ExplosiveThrowValuables = (num4 & 0x40000000) != 0; REPOEventManager.RoomGravity = (num4 & 0x80000000u) != 0; REPOEventManager.DoubleJump = (num5 & 1) != 0; REPOEventManager.NoFallDamage = (num5 & 2) != 0; REPOEventManager.DamageTradeoff = (num5 & 4) != 0; REPOEventManager.CursedValuables = (num5 & 8) != 0; REPOEventManager.AlarmSystem = (num5 & 0x10) != 0; REPOEventManager.EnemyTouchShock = (num5 & 0x20) != 0; REPOEventManager.WoundedFury = (num5 & 0x40) != 0; REPOEventManager.Executioner = (num5 & 0x80) != 0; REPOEventManager.LifestealStrikes = (num5 & 0x100) != 0; REPOEventManager.LastBreath = (num5 & 0x200) != 0; REPOEventManager.Thorns = (num5 & 0x400) != 0; REPOEventManager.GlassEnemies = (num5 & 0x800) != 0; REPOEventManager.BountifulKills = (num5 & 0x1000) != 0; REPOEventManager.TaxSeason = (num5 & 0x2000) != 0; REPOEventManager.RiskReward = (num5 & 0x4000) != 0; REPOEventManager.Bloodthirst = (num5 & 0x8000) != 0; REPOEventManager.IronWill = (num5 & 0x10000) != 0; REPOEventManager.GuardianShield = (num5 & 0x20000) != 0; REPOEventManager.DamageWard = (num5 & 0x40000) != 0; REPOEventManager.TitansVigor = (num5 & 0x80000) != 0; REPOEventManager.RegenerationAura = (num5 & 0x100000) != 0; REPOEventManager.BloodthirstyHealer = (num5 & 0x200000) != 0; REPOEventManager.BerserkersResolve = (num5 & 0x400000) != 0; REPOEventManager.ExecutionersEdge = (num5 & 0x800000) != 0; REPOEventManager.LastStand = (num5 & 0x1000000) != 0; REPOEventManager.SecondWind = (num5 & 0x2000000) != 0; REPOEventManager.FirstStrike = (num5 & 0x4000000) != 0; REPOEventManager.AdrenalineSurge = (num5 & 0x8000000) != 0; REPOEventManager.Brawler = (num5 & 0x10000000) != 0; REPOEventManager.Toughened = (num5 & 0x20000000) != 0; REPOEventManager.Frailty = (num5 & 0x40000000) != 0; REPOEventManager.Feeble = (num5 & 0x80000000u) != 0; REPOEventManager.GlassJaw = (num5 & 0x100000000L) != 0; REPOEventManager.PainAmplifier = (num5 & 0x200000000L) != 0; REPOEventManager.AdrenalineCrash = (num5 & 0x400000000L) != 0; REPOEventManager.Exhausted = (num5 & 0x800000000L) != 0; REPOEventManager.RecoilStrikes = (num5 & 0x1000000000L) != 0; REPOEventManager.Vulnerable = (num5 & 0x2000000000L) != 0; REPOEventManager.SoulDrain = (num5 & 0x4000000000L) != 0; REPOEventManager.Crippled = (num5 & 0x8000000000L) != 0; REPOEventManager.CowardsCurse = (num5 & 0x10000000000L) != 0; REPOEventManager.FaintHeart = (num5 & 0x20000000000L) != 0; REPOEventManager.SlowHealing = (num5 & 0x40000000000L) != 0; REPOEventManager.SluggishRecovery = (num5 & 0x80000000000L) != 0; REPOEventManager.AchillesHeel = (num5 & 0x100000000000L) != 0; REPOEventManager.StageFright = (num5 & 0x200000000000L) != 0; REPOEventManager.ThinSkin = (num5 & 0x400000000000L) != 0; REPOEventManager.RecklessSwings = (num5 & 0x800000000000L) != 0; REPOEventManager.SoftBlows = (num5 & 0x1000000000000L) != 0; REPOEventManager.Fumble = (num5 & 0x2000000000000L) != 0; REPOEventManager.RecklessPower = (num5 & 0x4000000000000L) != 0; REPOEventManager.VampiricPact = (num5 & 0x8000000000000L) != 0; REPOEventManager.AdrenalineCycle = (num5 & 0x10000000000000L) != 0; REPOEventManager.Gambler = (num5 & 0x20000000000000L) != 0; REPOEventManager.CoinFlipDefense = (num5 & 0x40000000000000L) != 0; REPOEventManager.BerserkersBargain = (num5 & 0x80000000000000L) != 0; REPOEventManager.BloodPrice = (num5 & 0x100000000000000L) != 0; REPOEventManager.Equalizer = (num5 & 0x200000000000000L) != 0; REPOEventManager.TugOfWar = (num5 & 0x400000000000000L) != 0; REPOEventManager.Pendulum = (num5 & 0x800000000000000L) != 0; REPOEventManager.JuggernautEnemies = (num6 & 1) != 0; REPOEventManager.ArmoredHides = (num6 & 2) != 0; REPOEventManager.BrutalEnemies = (num6 & 4) != 0; REPOEventManager.ThornedEnemies = (num6 & 8) != 0; REPOEventManager.HardenedCores = (num6 & 0x10) != 0; REPOEventManager.DeathThroes = (num6 & 0x20) != 0; REPOEventManager.PlagueBearers = (num6 & 0x40) != 0; REPOEventManager.PackTactics = (num6 & 0x80) != 0; REPOEventManager.PhaseShield = (num6 & 0x100) != 0; REPOEventManager.VengefulHorde = (num6 & 0x200) != 0; REPOEventManager.PaperEnemies = (num6 & 0x400) != 0; REPOEventManager.BrittleBonesEnemies = (num6 & 0x800) != 0; REPOEventManager.FeebleFoes = (num6 & 0x1000) != 0; REPOEventManager.GoldenEnemies = (num6 & 0x2000) != 0; REPOEventManager.SelfDestructEnemies = (num6 & 0x4000) != 0; REPOEventManager.ExposedCores = (num6 & 0x8000) != 0; REPOEventManager.BleedingEnemies = (num6 & 0x10000) != 0; REPOEventManager.GlassJawEnemies = (num6 & 0x20000) != 0; REPOEventManager.ExposedWeakpoint = (num6 & 0x40000) != 0; REPOEventManager.Lootsplosion = (num6 & 0x80000) != 0; REPOEventManager.ToughSkin = (num6 & 0x100000) != 0; REPOEventManager.BulkyEnemies = (num6 & 0x200000) != 0; REPOEventManager.AggressiveEnemies = (num6 & 0x400000) != 0; REPOEventManager.ResilientCores = (num6 & 0x800000) != 0; REPOEventManager.QuickRecovery = (num6 & 0x1000000) != 0; REPOEventManager.HardyEnemies = (num6 & 0x2000000) != 0; REPOEventManager.SecondSkin = (num6 & 0x4000000) != 0; REPOEventManager.VengefulSparks = (num6 & 0x8000000) != 0; REPOEventManager.PackInstinct = (num6 & 0x10000000) != 0; REPOEventManager.EvasiveEnemies = (num6 & 0x20000000) != 0; REPOEventManager.BerserkerEnemies = (num6 & 0x40000000) != 0; REPOEventManager.GlassCannonEnemies = (num6 & 0x80000000u) != 0; REPOEventManager.ErraticEnemies = (num6 & 0x100000000L) != 0; REPOEventManager.GamblingFoes = (num6 & 0x200000000L) != 0; REPOEventManager.VampiricFoes = (num6 & 0x400000000L) != 0; REPOEventManager.AdaptiveEnemies = (num6 & 0x800000000L) != 0; REPOEventManager.VolatileCores = (num6 & 0x1000000000L) != 0; REPOEventManager.EnragedOnHit = (num6 & 0x2000000000L) != 0; REPOEventManager.ScavengerEnemies = (num6 & 0x4000000000L) != 0; REPOEventManager.ToughLove = (num6 & 0x8000000000L) != 0; REPOEventManager.SoftTargets = (num6 & 0x10000000000L) != 0; REPOEventManager.FrailEnemies = (num6 & 0x20000000000L) != 0; REPOEventManager.ClumsyEnemies = (num6 & 0x40000000000L) != 0; REPOEventManager.SoftSpot = (num6 & 0x80000000000L) != 0; REPOEventManager.StumblingEnemies = (num6 & 0x100000000000L) != 0; REPOEventManager.GenerousKills = (num6 & 0x200000000000L) != 0; REPOEventManager.SoulHarvest = (num6 & 0x400000000000L) != 0; REPOEventManager.BrittleShells = (num6 & 0x800000000000L) != 0; REPOEventManager.Bonanza = (num6 & 0x1000000000000L) != 0; REPOEventManager.LuckyStrike = (num6 & 0x2000000000000L) != 0; REPOEventManager.ValueFloor = (num6 & 0x4000000000000L) != 0; REPOEventManager.HeavyweightBonus = (num6 & 0x8000000000000L) != 0; REPOEventManager.CompoundInterest = (num6 & 0x10000000000000L) != 0; REPOEventManager.TreasureSense = (num6 & 0x20000000000000L) != 0; REPOEventManager.DiamondLoot = (num6 & 0x40000000000000L) != 0; REPOEventManager.Salvage = (num6 & 0x80000000000000L) != 0; REPOEventManager.PristineValuables = (num6 & 0x100000000000000L) != 0; REPOEventManager.LuckyLottery = (num6 & 0x200000000000000L) != 0; REPOEventManager.Bankruptcy = (num7 & 1) != 0; REPOEventManager.Pyrite = (num7 & 2) != 0; REPOEventManager.WorthlessHeavies = (num7 & 4) != 0; REPOEventManager.CrumblingTreasures = (num7 & 8) != 0; REPOEventManager.LeakyValue = (num7 & 0x10) != 0; REPOEventManager.Spoilage = (num7 & 0x20) != 0; REPOEventManager.GlassHoard = (num7 & 0x40) != 0; REPOEventManager.VolatileWealth = (num7 & 0x80) != 0; REPOEventManager.DiminishingHoard = (num7 & 0x100) != 0; REPOEventManager.FoolsAbundance = (num7 & 0x200) != 0; REPOEventManager.Windfall = (num7 & 0x400) != 0; REPOEventManager.LightweightPremium = (num7 & 0x800) != 0; REPOEventManager.HiddenGems = (num7 & 0x1000) != 0; REPOEventManager.TreasureTrove = (num7 & 0x2000) != 0; REPOEventManager.PaddedValuables = (num7 & 0x4000) != 0; REPOEventManager.ReinforcedEdges = (num7 & 0x8000) != 0; REPOEventManager.SecondChance = (num7 & 0x10000) != 0; REPOEventManager.GoldenCart = (num7 & 0x20000) != 0; REPOEventManager.SurgeDemand = (num7 & 0x40000) != 0; REPOEventManager.AppraisersGlow = (num7 & 0x80000) != 0; REPOEventManager.LightweightTax = (num7 & 0x100000) != 0; REPOEventManager.Misfortune = (num7 & 0x200000) != 0; REPOEventManager.WornEdges = (num7 & 0x400000) != 0; REPOEventManager.FadingFortune = (num7 & 0x800000) != 0; REPOEventManager.Tarnish = (num7 & 0x1000000) != 0; REPOEventManager.BruisedGoods = (num7 & 0x2000000) != 0; REPOEventManager.HeavyPockets = (num7 & 0x4000000) != 0; REPOEventManager.HandlingFee = (num7 & 0x8000000) != 0; REPOEventManager.BrittleHandling = (num7 & 0x10000000) != 0; REPOEventManager.BoomOrBust = (num7 & 0x20000000) != 0; REPOEventManager.JackpotGamble = (num7 & 0x40000000) != 0; REPOEventManager.Counterweight = (num7 & 0x80000000u) != 0; REPOEventManager.RiskPremium = (num7 & 0x100000000L) != 0; REPOEventManager.SlowInflation = (num7 & 0x200000000L) != 0; REPOEventManager.LiquidationSale = (num7 & 0x400000000L) != 0; REPOEventManager.HeadsOrTails = (num7 & 0x800000000L) != 0; REPOEventManager.WeightSwap = (num7 & 0x1000000000L) != 0; REPOEventManager.LuckyDip = (num7 & 0x2000000000L) != 0; REPOEventManager.LongReach = (num7 & 0x4000000000L) != 0; REPOEventManager.BigLungs = (num7 & 0x8000000000L) != 0; REPOEventManager.Tailwind = (num7 & 0x10000000000L) != 0; REPOEventManager.SpringyLegs = (num7 & 0x20000000000L) != 0; REPOEventManager.NinjaCrouch = (num7 & 0x40000000000L) != 0; REPOEventManager.LunarFacility = (num7 & 0x80000000000L) != 0; REPOEventManager.SparseEnemies = (num7 & 0x100000000000L) != 0; REPOEventManager.CrystalAir = (num7 & 0x200000000000L) != 0; REPOEventManager.ExtractionBeacons = (num7 & 0x400000000000L) != 0; REPOEventManager.RichFacility = (num7 & 0x1000000000000L) != 0; REPOEventManager.QuietFacility = (num7 & 0x2000000000000L) != 0; REPOEventManager.LightQuota = (num7 & 0x4000000000000L) != 0; REPOEventManager.ScatteredRiches = (num7 & 0x8000000000000L) != 0; REPOEventManager.FleetingEnemies = (num7 & 0x10000000000000L) != 0; REPOEventManager.GenerousExtraction = (num7 & 0x20000000000000L) != 0; REPOEventManager.EnergizedAtmosphere = (num7 & 0x800000000000L) != 0; REPOEventManager.HeavyQuota = (num7 & 0x40000000000000L) != 0; REPOEventManager.PoorFacility = (num7 & 0x80000000000000L) != 0; REPOEventManager.EchoingHalls = (num7 & 0x100000000000000L) != 0; REPOEventManager.RelentlessEnemies = (num7 & 0x200000000000000L) != 0; REPOEventManager.FlickeringPower = (num7 & 0x400000000000000L) != 0; REPOEventManager.LootedFacility = (num7 & 0x800000000000000L) != 0; REPOEventManager.ExhaustingAir = (num7 & 0x1000000000000000L) != 0; REPOEventManager.PowerSurge = (num7 & 0x2000000000000000L) != 0; REPOEventManager.HazardousSparks = (num7 & 0x4000000000000000L) != 0; REPOEventManager.PhantomQuota = (num7 & long.MinValue) != 0; REPOEventManager.DimFacility = (num8 & 1) != 0; REPOEventManager.StiffDoors = (num8 & 2) != 0; REPOEventManager.AgedTubes = (num8 & 4) != 0; REPOEventManager.FrostCreep = (num8 & 8) != 0; REPOEventManager.CreakyFloors = (num8 & 0x10) != 0; REPOEventManager.ModestQuota = (num8 & 0x20) != 0; REPOEventManager.TightBudget = (num8 & 0x40) != 0; REPOEventManager.StuffyAir = (num8 & 0x80) != 0; REPOEventManager.CrampedFacility = (num8 & 0x100) != 0; REPOEventManager.ColdFacility = (num8 & 0x200) != 0; REPOEventManager.ColoredLights = (num8 & 0x400) != 0; REPOEventManager.PulsingLights = (num8 & 0x800) != 0; REPOEventManager.FloatingDust = (num8 & 0x1000) != 0; REPOEventManager.ReverbHall = (num8 & 0x2000) != 0; REPOEventManager.SpaciousFacility = (num8 & 0x4000) != 0; REPOEventManager.LowStakes = (num8 & 0x8000) != 0; REPOEventManager.ShuffledLoot = (num8 & 0x10000) != 0; REPOEventManager.WeakSwarm = (num8 & 0x20000) != 0; REPOEventManager.EliteGuard = (num8 & 0x40000) != 0; REPOEventManager.HighStakes = (num8 & 0x80000) != 0; REPOEventManager.SluggishEnemies = (num8 & 0x100000) != 0; REPOEventManager.ReducedQuota = (num8 & 0x200000) != 0; REPOEventManager.FairBonus = (num8 & 0x400000) != 0; REPOEventManager.FreshAir = (num8 & 0x800000) != 0; REPOEventManager.MuffledHalls = (num8 & 0x1000000) != 0; REPOEventManager.ThinnedPatrols = (num8 & 0x2000000) != 0; REPOEventManager.RoomyExtractions = (num8 & 0x4000000) != 0; REPOEventManager.LuckyScraps = (num8 & 0x8000000) != 0; REPOEventManager.SwiftTubes = (num8 & 0x10000000) != 0; REPOEventManager.MagneticCarts = (num8 & 0x20000000) != 0; REPOEventManager.DeafToMonsters = (num8 & 0x40000000) != 0; REPOEventManager.AdrenalineHunters = (num8 & 0x80000000u) != 0; REPOEventManager.TankyButGentle = (num8 & 0x100000000L) != 0; REPOEventManager.TierMercy = (num8 & 0x200000000L) != 0; REPOEventManager.SuicidalAttackers = (num8 & 0x400000000L) != 0; REPOEventManager.BlinkingHaze = (num8 & 0x800000000L) != 0; REPOEventManager.ManyExtractions = (num8 & 0x1000000000L) != 0; REPOEventManager.LoneWolf = (num8 & 0x2000000000L) != 0; REPOEventManager.RestorativeRooms = (num8 & 0x4000000000L) != 0; REPOEventManager.HostileRooms = (num8 & 0x8000000000L) != 0; REPOEventManager.MapDisabled = (num8 & 0x10000000000L) != 0; REPOEventManager.HalfStamina = (num8 & 0x20000000000L) != 0; REPOEventManager.GlassRunner = (num8 & 0x40000000000L) != 0; REPOEventManager.KillRecharge = (num8 & 0x80000000000L) != 0; REPOEventManager.TripledUpgrades = (num8 & 0x100000000000L) != 0; REPOEventManager.ValueDrainHeld = (num8 & 0x200000000000L) != 0; REPOEventManager.BulkyCargo = (num8 & 0x400000000000L) != 0; REPOEventManager.OffGrid = (num8 & 0x800000000000L) != 0; REPOEventManager.VitalHaul = (num8 & 0x1000000000000L) != 0; REPOEventManager.BattleHardened = (num8 & 0x2000000000000L) != 0; if (array.Length >= 10) { bool num9 = Convert.ToBoolean(array[6]); bool flag = Convert.ToBoolean(array[7]); string settings = array[8]?.ToString() ?? ""; string settings2 = array[9]?.ToString() ?? ""; if (array.Length >= 11) { REPOEventManager.EnemiesFasterOnKillMultiplier = ConvertToFloat(array[10]); } if (num9) { REPOEventManager.ScaleInCart = true; REPOEventManager.cartScaleTable = REPOEventManager.ParseScaleSettingsByType(settings); REPOConomyPlugin.Logger.LogInfo((object)$"[Modifiers] \ud83d\udd12 Forced Scale in Cart enabled (table: {REPOEventManager.cartScaleTable.Count} entries)"); } if (flag) { REPOEventManager.ShrinkExtractionValuables = true; REPOEventManager.extractionScaleTable = REPOEventManager.ParseScaleSettingsByType(settings2); REPOConomyPlugin.Logger.LogInfo((object)$"[Modifiers] \ud83d\udd12 Forced Extraction Shrink enabled (table: {REPOEventManager.extractionScaleTable.Count} entries)"); } } REPOConomyPlugin.Logger.LogInfo((object)($"[Modifiers] \ud83d\udd25 Parsed: {array2.Length} events, " + $"Speed={num}x, Health={num2}x, " + $"SuperJump={REPOEventManager.SuperJump}, NightVision={REPOEventManager.NightVision}, " + $"LuckyFind={REPOEventManager.LuckyFind}, StickyFeet={REPOEventManager.StickyFeet}, " + $"TimeWarp={REPOEventManager.TimeWarp}, InfiniteAmmo={REPOEventManager.InfiniteAmmo}, " + $"OneHitKill={REPOEventManager.OneHitKill}, OneHitKillPlayers={REPOEventManager.OneHitKillPlayers}, HealthVampire={REPOEventManager.HealthVampire}, " + $"ExtractionRush={REPOEventManager.ExtractionRush}, ExtractionMagnet={REPOEventManager.ExtractionMagnet}, " + $"ExtractionShield={REPOEventManager.ExtractionShield}, ExtractionChaos={REPOEventManager.ExtractionChaos}, " + $"SingleExtraction={REPOEventManager.SingleExtraction}, " + $"HalfPlayerDamage={REPOEventManager.HalfPlayerDamage}, DoubleEnemyDamage={REPOEventManager.DoubleEnemyDamage}, " + $"ValuablesUnbreakable={REPOEventManager.ValuablesUnbreakable}, ValuablesFragile={REPOEventManager.ValuablesFragile}, " + $"FeatherWeight={REPOEventManager.FeatherWeight}, HeavyBurden={REPOEventManager.HeavyBurden}, SlipperyChaos={REPOEventManager.SlipperyChaos}, " + $"ZeroGravityLoot={REPOEventManager.ZeroGravityLoot}, PhantomObjects={REPOEventManager.PhantomObjects}, BouncyHavoc={REPOEventManager.BouncyHavoc}, " + $"EnemyHeavyWeight={REPOEventManager.EnemyHeavyWeight}, EnemyLightWeight={REPOEventManager.EnemyLightWeight}, " + $"HotPotato={REPOEventManager.HotPotato}, ShrinkExtractionValuables={REPOEventManager.ShrinkExtractionValuables}")); REPOEventManager.PlayerSpeedMultiplier = num; REPOEventManager.PlayerHealthMultiplier = num2; if (REPOEventManager.AllEvents == null || REPOEventManager.AllEvents.Count == 0) { REPOEventManager.Initialize(); REPOConomyPlugin.Logger.LogInfo((object)"[Modifiers] ✅ Initialized event list on client"); } REPOEventManager.ActiveEvents.Clear(); string[] array3 = array2; foreach (string id in array3) { GameEvent gameEvent = REPOEventManager.AllEvents.FirstOrDefault((GameEvent e) => e.id == id); if (gameEvent != null) { REPOEventManager.ActiveEvents.Add(gameEvent); REPOConomyPlugin.Logger.LogInfo((object)("[Modifiers] ✅ Added event to ActiveEvents: " + gameEvent.id)); } else { REPOConomyPlugin.Logger.LogWarning((object)("[Modifiers] ⚠\ufe0f Event not found in AllEvents: " + id)); } } REPOConomyPlugin.Logger.LogInfo((object)$"[Modifiers] ✅ ActiveEvents count: {REPOEventManager.ActiveEvents.Count}"); ((MonoBehaviour)this).StartCoroutine(WaitForSceneAndApplySpecialEvents()); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[REPOConomy] HandleModifiersSync error: " + ex.Message + "\n" + ex.StackTrace)); } } private void HandleDifficultySync(EventData evt) { try { object[] array = (object[])evt.CustomData; float num = ConvertToFloat(array[0]); REPODifficultyManager.SetDifficulty(num); REPOConomyPlugin.Logger.LogInfo((object)$"[Difficulty] ✅ Synced from host: {num:F1}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Difficulty] Sync error: " + ex.Message)); } } private void HandleUpgradesMultiplierSync(EventData evt) { try { object[] array = (object[])evt.CustomData; float num = ConvertToFloat(array[0]); REPOConfig.GlobalUpgradesMultiplier.Value = num; REPOConomyPlugin.Logger.LogInfo((object)$"[UpgradesMultiplier] ✅ Synced from host: x{num:F2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[UpgradesMultiplier] Sync error: " + ex.Message)); } } private void HandleSharedPoolSync(EventData evt) { try { object[] array = (object[])evt.CustomData; bool flag = ConvertToBool(array[0]); REPOConfig.EnableSharedPool.Value = flag; REPOConomyPlugin.Logger.LogInfo((object)$"[SharedPool] ✅ Synced from host: {flag}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SharedPool] Sync error: " + ex.Message)); } } private void HandleUiShow(EventData evt) { try { REPOConomyPlugin.Logger.LogInfo((object)"[UI] UI show event received (handled locally)"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[UI] Show error: " + ex.Message)); } } private void HandleBloodlustSync(EventData evt) { try { object[] array = (object[])evt.CustomData; if (array.Length < 2) { REPOConomyPlugin.Logger.LogWarning((object)"[Bloodlust] Invalid bloodlust event data."); return; } int num = Convert.ToInt32(array[0]); float num2 = ConvertToFloat(array[1]); REPOEventManager.EnemiesFasterOnKillCount = num; REPOEventManager.EnemiesFasterOnKillMultiplier = num2; REPOConomyPlugin.Logger.LogInfo((object)$"[Bloodlust] ✅ Synced from host: {num} kills, x{num2:F2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Bloodlust] Sync error: " + ex.Message)); } } private float ConvertToFloat(object value) { try { if (value is float result) { return result; } if (value is double num) { return (float)num; } if (value is int num2) { return num2; } if (value is long num3) { return num3; } return Convert.ToSingle(value); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)$"[Modifiers] ❌ Failed to convert {value} to float: {ex.Message}"); return 1f; } } private bool ConvertToBool(object value) { try { if (value is bool result) { return result; } return Convert.ToBoolean(value); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)$"[Modifiers] ❌ Failed to convert {value} to bool: {ex.Message}"); return false; } } [IteratorStateMachine(typeof(d__26))] private IEnumerator WaitForSceneAndApplySpecialEvents() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__26(0); } public static void ResetClientFlags() { REPOConomyPlugin.Logger.LogInfo((object)"[NetworkHandler] ✅ Reset client flags"); } public static void SyncUpgradesMultiplierToClients() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } try { float value = REPOConfig.GlobalUpgradesMultiplier.Value; object[] array = new object[1] { value }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)182, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[UpgradesMultiplier] \ud83d\udce4 Synced to clients: x{value:F2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[UpgradesMultiplier] Sync error: " + ex.Message)); } } public static void SyncDifficultyToClients() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } try { float currentDifficulty = REPODifficultyManager.CurrentDifficulty; object[] array = new object[1] { currentDifficulty }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)181, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[Difficulty] \ud83d\udce4 Synced to clients: {currentDifficulty:F1}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Difficulty] Sync error: " + ex.Message)); } } public static void SyncSharedPoolToClients() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Expected O, but got Unknown //IL_0038: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } try { bool value = REPOConfig.EnableSharedPool.Value; object[] array = new object[1] { value }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)184, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[SharedPool] \ud83d\udce4 Synced to clients: {value}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SharedPool] Sync error: " + ex.Message)); } } public static void SyncScalingToClients() { //IL_032d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: 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_033b: Expected O, but got Unknown //IL_0344: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } try { bool value = REPOConfig.EnableEnemyHPScaling.Value; int value2 = REPOConfig.EnemyHPStartLevel.Value; float value3 = REPOConfig.EnemyHPMultiplier.Value; bool value4 = REPOConfig.EnemyHPUseExponentialScaling.Value; bool value5 = REPOConfig.ScaleEnemyDamageWithEnemyHP.Value; float value6 = REPOConfig.EnemyDamageEnemyHPScaleStrength.Value; bool value7 = REPOConfig.ScalePlayerDamageWithEnemyHP.Value; float value8 = REPOConfig.PlayerDamageEnemyHPScaleStrength.Value; bool value9 = REPOConfig.EnableEnemyCapScaling.Value; int value10 = REPOConfig.EnemyCapStartLevel.Value; float value11 = REPOConfig.EnemyCapMultiplier.Value; bool value12 = REPOConfig.EnemyCapUseExponentialScaling.Value; bool value13 = REPOConfig.ScaleEnemyRespawnWithEnemyCap.Value; float value14 = REPOConfig.EnemyRespawnCapScaleStrength.Value; bool value15 = REPOConfig.EnableMapValueScaling.Value; int value16 = REPOConfig.MapValueStartLevel.Value; float value17 = REPOConfig.MapValueMultiplier.Value; bool value18 = REPOConfig.MapValueUseExponentialScaling.Value; bool value19 = REPOConfig.EnableLevelScaling.Value; bool value20 = REPOConfig.EnableMultiplicativeScaling.Value; int value21 = REPOConfig.LevelScalingMinModules.Value; int value22 = REPOConfig.LevelScalingMaxModulesLevel.Value; int value23 = REPOConfig.LevelScalingModulesInterval.Value; int value24 = REPOConfig.LevelScalingModulesPerInterval.Value; int value25 = REPOConfig.LevelScalingBaseExtractions.Value; int value26 = REPOConfig.LevelScalingExtractionsInterval.Value; int value27 = REPOConfig.LevelScalingExtractionsPerInterval.Value; int value28 = REPOConfig.LevelScalingMaxExtractions.Value; float value29 = REPOConfig.LevelScalingBaseHaulMultiplier.Value; float value30 = REPOConfig.LevelScalingHaulIncreasePerLevel.Value; int value31 = REPOConfig.LevelScalingMaxHaulLevel.Value; float value32 = REPOConfig.LevelScalingMaxHaulMultiplier.Value; object[] array = new object[36] { value, value2, value3, value4, value5, value6, value7, value8, value9, value10, value11, value12, value13, value14, value15, value16, value17, value18, value19, value20, value21, value22, value23, value24, value25, value26, value27, value28, value29, value30, value31, value32, REPOConfig.EnableMoonScaling.Value, REPOConfig.MoonLevelsPerPhase.Value, REPOConfig.MoonMaxLevel.Value, REPOConfig.HideVanillaMoonUI.Value }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)185, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)"[Scaling] \ud83d\udce4 Synced scaling settings to clients"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Scaling] Sync error: " + ex.Message)); } } private void HandleScalingSync(EventData evt) { try { object[] array = (object[])evt.CustomData; if (array.Length < 36) { REPOConomyPlugin.Logger.LogWarning((object)"[Scaling] Invalid scaling event data."); return; } int num = 0; REPOConfig.EnableEnemyHPScaling.Value = ConvertToBool(array[num++]); REPOConfig.EnemyHPStartLevel.Value = ConvertToInt(array[num++]); REPOConfig.EnemyHPMultiplier.Value = ConvertToFloat(array[num++]); REPOConfig.EnemyHPUseExponentialScaling.Value = ConvertToBool(array[num++]); REPOConfig.ScaleEnemyDamageWithEnemyHP.Value = ConvertToBool(array[num++]); REPOConfig.EnemyDamageEnemyHPScaleStrength.Value = ConvertToFloat(array[num++]); REPOConfig.ScalePlayerDamageWithEnemyHP.Value = ConvertToBool(array[num++]); REPOConfig.PlayerDamageEnemyHPScaleStrength.Value = ConvertToFloat(array[num++]); REPOConfig.EnableEnemyCapScaling.Value = ConvertToBool(array[num++]); REPOConfig.EnemyCapStartLevel.Value = ConvertToInt(array[num++]); REPOConfig.EnemyCapMultiplier.Value = ConvertToFloat(array[num++]); REPOConfig.EnemyCapUseExponentialScaling.Value = ConvertToBool(array[num++]); REPOConfig.ScaleEnemyRespawnWithEnemyCap.Value = ConvertToBool(array[num++]); REPOConfig.EnemyRespawnCapScaleStrength.Value = ConvertToFloat(array[num++]); REPOConfig.EnableMapValueScaling.Value = ConvertToBool(array[num++]); REPOConfig.MapValueStartLevel.Value = ConvertToInt(array[num++]); REPOConfig.MapValueMultiplier.Value = ConvertToFloat(array[num++]); REPOConfig.MapValueUseExponentialScaling.Value = ConvertToBool(array[num++]); REPOConfig.EnableLevelScaling.Value = ConvertToBool(array[num++]); REPOConfig.EnableMultiplicativeScaling.Value = ConvertToBool(array[num++]); REPOConfig.LevelScalingMinModules.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingMaxModulesLevel.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingModulesInterval.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingModulesPerInterval.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingBaseExtractions.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingExtractionsInterval.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingExtractionsPerInterval.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingMaxExtractions.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingBaseHaulMultiplier.Value = ConvertToFloat(array[num++]); REPOConfig.LevelScalingHaulIncreasePerLevel.Value = ConvertToFloat(array[num++]); REPOConfig.LevelScalingMaxHaulLevel.Value = ConvertToInt(array[num++]); REPOConfig.LevelScalingMaxHaulMultiplier.Value = ConvertToFloat(array[num++]); REPOConfig.EnableMoonScaling.Value = ConvertToBool(array[num++]); REPOConfig.MoonLevelsPerPhase.Value = ConvertToFloat(array[num++]); REPOConfig.MoonMaxLevel.Value = ConvertToInt(array[num++]); REPOConfig.HideVanillaMoonUI.Value = ConvertToBool(array[num++]); REPOConomyPlugin.Logger.LogInfo((object)"[Scaling] ✅ Synced scaling settings from host (including Moon Scaling)"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Scaling] Sync error: " + ex.Message)); } } public static void SyncSeedToClients(string seed) { //IL_0013: 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_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.IsMasterClient) { object[] array = new object[1] { seed }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)186, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)("[Seed] \ud83d\udce4 Synced seed to clients: " + seed)); } } private void HandleSeedSync(EventData evt) { try { REPOSeedManager.SetRemoteSeed((string)((object[])evt.CustomData)[0]); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Seed] Sync error: " + ex.Message)); } } private void HandleShopEconomySync(EventData evt) { try { object[] array = (object[])evt.CustomData; REPOConomyPlugin.CurrentShopEconomy = (ShopEconomyType)ConvertToInt(array[0]); REPOConomyPlugin.ShopPriceMultiplier = ConvertToFloat(array[1]); REPOConomyPlugin.ShopUpgradeMultiplier = ConvertToFloat(array[2]); REPOConomyPlugin.ShopHealthPackMultiplier = ConvertToFloat(array[3]); REPOConomyPlugin.ShopConsumableMultiplier = ConvertToFloat(array[4]); REPOConomyPlugin.HasShopEconomy = true; ShopEconomyManager.ShopEconomyInitialized = true; REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] ✅ Synced from host: {REPOConomyPlugin.CurrentShopEconomy}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ShopEconomy] Sync error: " + ex.Message)); } } public static void SyncShopEconomyToClients() { //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.IsMasterClient) { object[] array = new object[5] { (int)REPOConomyPlugin.CurrentShopEconomy, REPOConomyPlugin.ShopPriceMultiplier, REPOConomyPlugin.ShopUpgradeMultiplier, REPOConomyPlugin.ShopHealthPackMultiplier, REPOConomyPlugin.ShopConsumableMultiplier }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)188, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] \ud83d\udce4 Synced to clients: {REPOConomyPlugin.CurrentShopEconomy}"); } } private void HandleExplosionSync(EventData evt) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) try { object[] array = (object[])evt.CustomData; if (array.Length < 8) { REPOConomyPlugin.Logger.LogWarning((object)"[ExplosionSync] Invalid explosion event data."); return; } Vector3 position = (Vector3)array[0]; float size = ConvertToFloat(array[1]); int damage = ConvertToInt(array[2]); int enemyDamage = ConvertToInt(array[3]); float forceMulti = ConvertToFloat(array[4]); bool onlyParticleEffect = ConvertToBool(array[5]); bool disableSound = ConvertToBool(array[6]); float shakeMultiplier = ConvertToFloat(array[7]); SpawnExplosionLocal(position, size, damage, enemyDamage, forceMulti, onlyParticleEffect, disableSound, shakeMultiplier); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExplosionSync] Sync error: " + ex.Message)); } } public static void SpawnExplosionLocal(Vector3 position, float size, int damage, int enemyDamage, float forceMulti = 1f, bool onlyParticleEffect = false, bool disableSound = false, float shakeMultiplier = 1f) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) ParticleScriptExplosion val = Object.FindObjectOfType(); if ((Object)(object)val == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)"[ExplosionSync] ParticleScriptExplosion not found."); } else { val.Spawn(position, size, damage, enemyDamage, forceMulti, onlyParticleEffect, disableSound, shakeMultiplier); } } public static void SyncExplosionToClients(Vector3 position, float size, int damage, int enemyDamage, float forceMulti = 1f, bool onlyParticleEffect = false, bool disableSound = false, float shakeMultiplier = 1f) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { object[] array = new object[8] { position, size, damage, enemyDamage, forceMulti, onlyParticleEffect, disableSound, shakeMultiplier }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)189, (object)array, val, SendOptions.SendReliable); } } private void HandleBlackMarketSync(EventData evt) { try { object[] array = (object[])evt.CustomData; string text = ((array.Length == 0) ? string.Empty : (array[0]?.ToString() ?? string.Empty)); string lobbyStatus = ((array.Length <= 1) ? text : (array[1]?.ToString() ?? string.Empty)); REPOBlackMarketManager.ApplySyncedStatusText(text, lobbyStatus); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BlackMarket] Sync error: " + ex.Message)); } } public static void SyncBlackMarketToClients() { //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_0033: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer() && PhotonNetwork.IsMasterClient) { object[] array = new object[2] { REPOBlackMarketManager.GetHostStatusTextForSync(), REPOBlackMarketManager.GetLobbyStatusText() }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)190, (object)array, val, SendOptions.SendReliable); } } private void HandleChallengeCompletionSync(EventData evt) { try { object[] array = (object[])evt.CustomData; if (array.Length < 2) { REPOConomyPlugin.Logger.LogWarning((object)"[Challenges] Invalid completion sync payload."); return; } string? challengeId = array[0]?.ToString() ?? string.Empty; int completedTier = ConvertToInt(array[1]); ChallengeManager.ApplySyncedCompletion(challengeId, completedTier); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Challenges] Completion sync error: " + ex.Message)); } } private void HandleDangerousValuableSync(EventData evt) { try { object[] array = (object[])evt.CustomData; if (array != null && array.Length >= 1) { Patch_DangerousValuables.RegisterSpent(ConvertToInt(array[0])); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[DangerousValuables] Spent sync error: " + ex.Message)); } } public static void SyncDangerousValuableSpentToClients(int valuableId) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer()) { object[] array = new object[1] { valuableId }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)192, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[DangerousValuables] Synced spent valuable: {valuableId}"); } } public static void SyncChallengeCompletionToClients(string challengeId, int completedTier) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown //IL_0044: Unknown result type (might be due to invalid IL or missing references) if (SemiFunc.IsMultiplayer() && PhotonNetwork.IsMasterClient && !string.IsNullOrWhiteSpace(challengeId) && completedTier > 0) { object[] array = new object[2] { challengeId, completedTier }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)191, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[Challenges] Synced completion to clients: {challengeId} tier {completedTier}"); } } private int ConvertToInt(object value) { try { if (value is int result) { return result; } if (value is float num) { return Mathf.RoundToInt(num); } if (value is double num2) { return (int)num2; } if (value is long num3) { return (int)num3; } return Convert.ToInt32(value); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)$"[Scaling] ❌ Failed to convert {value} to int: {ex.Message}"); return 0; } } } [BepInPlugin("PxntxrezStudio.REPOConomyPlus", "REPOConomyPlus", "1.6.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class REPOConomyPlugin : BaseUnityPlugin { public static class HealthPotionCompatibilityPatch { private static bool isPatched = false; private static readonly FieldInfo FI_dollarValueOriginal = AccessTools.Field(typeof(ValuableObject), "dollarValueOriginal"); public static void Initialize() { //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown try { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "UniquePotions"); if (assembly == null) { Logger.LogInfo((object)"[Compatibility] UniquePotions mod not found, skipping patch."); return; } Type type = assembly.GetType("UniquePotions.Potions.HealthPotion"); if (type == null) { Logger.LogWarning((object)"[Compatibility] HealthPotion class not found!"); return; } MethodInfo methodInfo = AccessTools.Method(type, "startHeal", (Type[])null, (Type[])null); if (methodInfo == null) { Logger.LogWarning((object)"[Compatibility] startHeal method not found!"); return; } Harmony val = new Harmony("PxntxrezStudio.REPOConomyPlus.HealthPotionCompat"); MethodInfo methodInfo2 = AccessTools.Method(typeof(HealthPotionCompatibilityPatch), "Transpiler", (Type[])null, (Type[])null); val.Patch((MethodBase)methodInfo, (HarmonyMethod)null, (HarmonyMethod)null, new HarmonyMethod(methodInfo2), (HarmonyMethod)null, (HarmonyMethod)null); isPatched = true; Logger.LogInfo((object)"[Compatibility] ✅ Successfully patched UniquePotions.HealthPotion.startHeal with Transpiler!"); } catch (Exception arg) { Logger.LogError((object)$"[Compatibility] Failed to patch UniquePotions: {arg}"); } } public static IEnumerable Transpiler(IEnumerable instructions) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Expected O, but got Unknown List list = new List(instructions); FieldInfo fieldInfo = AccessTools.Field(typeof(ValuableObject), "dollarValueOriginal"); MethodInfo methodInfo = AccessTools.Method(typeof(HealthPotionCompatibilityPatch), "GetEconomyPrice", (Type[])null, (Type[])null); int num = 0; for (int i = 0; i < list.Count; i++) { if (CodeInstructionExtensions.LoadsField(list[i], fieldInfo, false)) { list[i] = new CodeInstruction(OpCodes.Call, (object)methodInfo); num++; Logger.LogInfo((object)$"[Compatibility] Patched dollarValueOriginal reference #{num} at instruction {i}"); } } if (num > 0) { Logger.LogInfo((object)$"[Compatibility] ✅ Successfully replaced {num} references to dollarValueOriginal!"); } else { Logger.LogWarning((object)"[Compatibility] ⚠\ufe0f No references to dollarValueOriginal found!"); } return list; } public static float GetEconomyPrice(ValuableObject valuable) { if ((Object)(object)valuable == (Object)null) { return 0f; } int instanceID = ((Object)valuable).GetInstanceID(); if (EconomyAdjustedValues.TryGetValue(instanceID, out var value)) { return value; } if (FI_dollarValueOriginal != null) { return (float)FI_dollarValueOriginal.GetValue(valuable); } Logger.LogWarning((object)"[Compatibility] Failed to get dollarValueOriginal via reflection!"); return 0f; } } public static class AdminMenuCompatibility { public static bool BlockExecution() { return false; } } [HarmonyPatch(typeof(LevelGenerator), "Start")] public static class Patch_LevelGenerator_Start { public static void Postfix() { if (SemiFunc.RunIsLevel()) { Logger.LogInfo((object)"[REPOConomyPlus] Start Generating InitializeEconomy."); InitializeEconomy(); } } } [HarmonyPatch(typeof(StatsManager), "DictionaryUpdateValue")] public static class Patch_StatsManager_DictionaryUpdateValue { [HarmonyPostfix] public static void Postfix(string dictionaryName, string key, int value) { if (string.Equals(dictionaryName, "runStats", StringComparison.OrdinalIgnoreCase) && string.Equals(key, "totalHaul", StringComparison.OrdinalIgnoreCase)) { REPOStatsManager.EnsureInstance()?.SyncRunTotalHaul(value); } } } public enum EconomyType { Stable, Deflation, Inflation, Chaos, FreezeMarket, BlackMarketSurge, Overload, RareBoom, CommonCrash, LegendaryOnlyMatters, EchoMarket, ReverseInflation, LuxuryHunt, DumpsterDive, ExtraProfit, ScamSeason, SuddenDrop, TreasureRush, ZeroGravity, Turbulence, BubbleBurst, CollectorsFrenzy, PanicSale, EconomicTwister, TaxAudit, CrashAndBurn, GoldenHour, CrystalBubble, CoinDecay, EchoCrash, SpeculationBubble, ColdStorage, PriceWhirlwind, ExperimentalPricing, ShadowMarket, AuctionFever, MemoryMarket, LoopbackSpike, GlitchedGoldrush, MarketEclipse, JackpotMirage, CollectorsVoid, VolatileExperiment, CleanSweep, ValueVortex, TemporalSurge, EchoOfWealth, ArtifactBloat, MarketDrain, InversionProtocol, SyntheticDemand, TaxFrenzy, AssetDump, SmugglersSurge, CollectorsCraze, MarketKraken, MarketBoom, PriceLockdown, WildSpeculation, SilentAuction, FlashCrash, CryptoSurge, ResourceRush, DemandSpike, SupplyShortage, ConsumerConfidence, MarketMeltup, BargainHunt, MarketRebound, PriceCascade, BullRun, BearTrap, PanicBuying, SupplyGlut, SpeculatorFrenzy, ValueStabilizer, MarketMirroring, InflationSpike, DeflationDip, EconomicEquilibrium, PriceSurge, BargainBlitz, CollectorCarnival, GhostPrices, BarterBonanza, SeasonalShift, BlackoutSale, InflationEbb, FoolsGold, HoardersHavoc, PennyPinch, Trendsetter, PriceSpike, Clearance, BoomerangMarket, SilentDip, LuxuryOnly, EarlyBubble, LateDeflation, PriceSlalom, FalseDemand, UndergroundTrade, CrystalCrash, GhostRush, QuantumFlux, VoidMarket, CrystalCascade, ShadowInflation, PlasmaSurge, EtherCrash, MysticDeflation, ArcaneBubble, SpectralBoom, PhantomDip, NebulaTwist, StellarSurge, CometCrash, AuroraBust, GalaxyGlitch, MeteorShower, EclipseEvent, LunarEclipse, SolarFlare, CosmicDust, BlackHole, WhiteDwarf, RedGiant, BlueSupergiant, NeutronStar, PulsarPulse, QuasarQuake, Singularity, WarpDrive, TimeDilation, SpaceTime, DimensionalRift, ParallelUniverse, QuantumEntanglement, WaveFunction, ProbabilityCloud, UncertaintyPrinciple, ObserverEffect, Decoherence, Superposition, EntanglementSwap, BellInequality, EPRParadox, ManyWorlds, Copenhagen, Multiverse, StringTheory, Membrane, BraneWorld, Holographic, InformationParadox, Firewall, EventHorizon, HawkingRadiation, UnruhEffect, CasimirForce, VacuumEnergy, DarkMatter, DarkEnergy, InflationField, HiggsField, Graviton, Tachyon, WIMP, Axion, Neutrino, Muon, Tau, Quark, Lepton, Boson, Fermion, Hadron, Meson, Baryon, Photon, Gluon, W_Boson, Z_Boson, HiggsBoson, GravitonFlux, Chroniton, Dilaton, Axigluon, MagneticMonopole, Instanton, Skyrmion, Soliton, Vortex, DomainWall, CosmicString, Texture, Monopole, GlobalString, LocalString, AxionString, Superstring, Heterotic, TypeI, TypeIIA, TypeIIB, HO, E6, E7, E8, SU5, SO10, SUSY, MSSM, NMSSM, AMSB, GMSB, KKLT, LVS, RS, ADD, UED, TC2, LR, ALR, VLQ, SMEFT, EFT, GlassBankDividend, PitContractInsurance, StormRunnerSurge, SilentDebtEclipse, CloneLotteryJackpot, MagnetShiftVortex, LastInvoiceJudgement, CenturionMarket } public enum PercentRollMode { Random, Stable, Volatile, Dynamic } [HarmonyPatch(typeof(TruckScreenText), "ArrowPointAtGoalLogic")] public static class EconomyUITriggerPatch { [HarmonyPostfix] public static void ShowEconomyUI() { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Expected O, but got Unknown //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!EconomyController.UIShownOnce && (Object)(object)EconomyController.Instance != (Object)null && HasEconomy && REPOConfig.UIAutoShowOnLevelStart.Value) { EconomyController.Instance.ShowGUI(); EconomyController.UIShownOnce = true; LogTotalMapValue(); REPODifficultyManager.CalculateDifficulty(); if (PhotonNetwork.InRoom && PhotonNetwork.IsMasterClient) { REPOConomyNetworkHandler.SyncDifficultyToClients(); RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)183, (object)null, val, SendOptions.SendReliable); Logger.LogInfo((object)"[UI] \ud83d\udce4 Synced UI show and difficulty to clients"); } } if (SemiFunc.RunIsShop() && !EconomyController.ShopEconomyUIShownOnce && (Object)(object)EconomyController.Instance != (Object)null && HasShopEconomy) { EconomyController.Instance.ShowShopEconomyGUI(); EconomyController.ShopEconomyUIShownOnce = true; Logger.LogInfo((object)"[ShopEconomy] UI triggered via ArrowPointAtGoalLogic"); if (!EconomyController.BlackMarketHintShownOnce) { REPOBlackMarketManager.ShowShopHint(); EconomyController.BlackMarketHintShownOnce = true; Logger.LogInfo((object)"[BlackMarket] Hint triggered with ShopEconomy UI via ArrowPointAtGoalLogic"); } } } } [HarmonyPatch(typeof(TruckScreenText), "Start")] public static class TruckTextStartReset { [HarmonyPrefix] public static void ResetFlag() { EconomyController.UIShownOnce = false; EconomyInitialized = false; ValuablePatch.ResetKraken(); } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public class ValuablePatch { private static readonly FieldInfo FI_original = AccessTools.Field(typeof(ValuableObject), "dollarValueOriginal"); private static readonly FieldInfo FI_current = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static bool krakenInitialized = false; private static List krakenList; private static int krakenBoostCount; private static float GetOriginal(ValuableObject inst) { return (float)FI_original.GetValue(inst); } private static void SetCurrent(ValuableObject inst, float val) { FI_current.SetValue(inst, val); } private static void MarkSet(ValuableObject inst) { FI_set.SetValue(inst, true); } [HarmonyPostfix] public static void ApplyRandomValue(ValuableObject __instance) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Invalid comparison between Unknown and I4 if ((Object)(object)__instance == (Object)null || SemiFunc.RunIsLobby() || SemiFunc.RunIsShop() || SemiFunc.RunIsArena()) { return; } if ((int)LevelGenerator.Instance.State <= 11) { if (!pendingValuables.Contains(__instance)) { pendingValuables.Add(__instance); } return; } if (!HasEconomy) { if (!pendingValuables.Contains(__instance)) { pendingValuables.Add(__instance); } return; } if ((Object)(object)AssetManager.instance == (Object)null || (Object)(object)AssetManager.instance.surplusValuableSmall == (Object)null || (Object)(object)AssetManager.instance.surplusValuableMedium == (Object)null || (Object)(object)AssetManager.instance.surplusValuableBig == (Object)null) { Logger.LogWarning((object)"[REPOConomy] AssetManager or its values are missing, skipping…"); return; } string name = ((Object)((Component)__instance).gameObject).name; if (name.Contains(((Object)AssetManager.instance.surplusValuableSmall).name) || name.Contains(((Object)AssetManager.instance.surplusValuableMedium).name) || name.Contains(((Object)AssetManager.instance.surplusValuableBig).name)) { Logger.LogInfo((object)("[REPOConomy] Skipped (Surplus): " + name)); return; } float original = GetOriginal(__instance); int instanceID = ((Object)__instance).GetInstanceID(); float num2; if (CurrentEconomy == EconomyType.EconomicTwister) { float num = Random.Range(0f, 2f); num2 = Mathf.Round(original * num); Logger.LogInfo((object)$"[REPOConomy] [Twister] {name} | {original} → {num2} ({num * 100f:0.##}%)"); SetCurrent(__instance, num2); MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); return; } if (CurrentEconomy == EconomyType.ValueVortex) { float num3 = Random.Range(-1f, 2f); num2 = Mathf.Round(original * (1f + num3)); Logger.LogInfo((object)$"[REPOConomy] [Vortex] {name} | {original} → {num2} ({num3 * 100f:+0.##;-0.##}%)"); SetCurrent(__instance, num2); MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); return; } if (CurrentEconomy == EconomyType.SmugglersSurge) { float num4 = ((original > 2400f) ? Random.Range(1.5f, 2f) : Random.Range(0.3f, 0.6f)); num2 = Mathf.Round(original * num4); SetCurrent(__instance, num2); MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); return; } if (CurrentEconomy == EconomyType.CollectorsCraze) { num2 = ((!(original >= 8000f)) ? Mathf.Round(original * (1f + Random.Range(-0.3f, -0.1f))) : Mathf.Round(original * Random.Range(2f, 3f))); SetCurrent(__instance, num2); MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); return; } if (CurrentEconomy == EconomyType.MarketKraken) { if (!krakenInitialized) { krakenList = Object.FindObjectsOfType().ToList(); foreach (ValuableObject kraken in krakenList) { SetCurrent(kraken, 0f); } krakenBoostCount = Mathf.CeilToInt((float)krakenList.Count * 0.3f); krakenInitialized = true; } num2 = 0f; if (krakenBoostCount > 0 && krakenList.Count > 0) { int index = Random.Range(0, krakenList.Count); ValuableObject inst = krakenList[index]; num2 = Mathf.Round(GetOriginal(inst) * 4f); SetCurrent(inst, Mathf.Round(GetOriginal(inst) * 4f)); krakenList.RemoveAt(index); krakenBoostCount--; } MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); return; } float num5 = original; if (REPOConfig.UseSeparateModifiers.Value) { float num6 = ((MinPercent < 0f) ? Random.Range(0f, Mathf.Abs(MinPercent)) : 0f); float num7 = ((MaxPercent > 0f) ? Random.Range(0f, MaxPercent) : 0f); float num8 = 0f - num6 + num7; num2 = Mathf.Round(num5 * (1f + num8 / 100f)); string text = ((num6 > 0f) ? $"-{num6:0.##}%" : ""); string text2 = ((num7 > 0f) ? $"+{num7:0.##}%" : ""); string text3 = ((num6 > 0f && num7 > 0f) ? " + " : ""); Logger.LogInfo((object)$"[REPOConomy] {name} | {text}{text3}{text2} = {num8:+0.##;-0.##}% | {num5} → {num2} |"); } else { float minPercent = MinPercent; float maxPercent = MaxPercent; float num8; switch (CurrentRollMode) { case PercentRollMode.Random: num8 = Random.Range(minPercent, maxPercent); break; case PercentRollMode.Stable: { float num11 = 0f; for (int i = 0; i < 3; i++) { num11 += Random.Range(minPercent, maxPercent); } num8 = num11 / 3f; break; } case PercentRollMode.Volatile: { float num9 = Random.Range(minPercent, maxPercent); float num10 = Random.Range(minPercent, maxPercent); num8 = ((Mathf.Abs(num9 - num10) > Mathf.Abs((maxPercent - minPercent) / 2f)) ? num9 : ((Random.value < 0.5f) ? minPercent : maxPercent)); break; } default: num8 = Random.Range(minPercent, maxPercent); break; } num2 = Mathf.Round(num5 * (1f + num8 / 100f)); Logger.LogInfo((object)$"[REPOConomy] {name} | {num5} → {num2} ({num8:+0.##;-0.##}%)"); } float challengeRewardValueMultiplier = REPOEventManager.GetChallengeRewardValueMultiplier(); if (challengeRewardValueMultiplier > 1.001f) { float num12 = num2; num2 = Mathf.Round(num2 * challengeRewardValueMultiplier); Logger.LogInfo((object)$"[REPOConomy] [ChallengeReward] {name} | {num12} -> {num2} (x{challengeRewardValueMultiplier:0.##})"); } SetCurrent(__instance, num2); MarkSet(__instance); EconomyAdjustedValues[instanceID] = num2; ProcessedByEconomy.Add(instanceID); } public static void ResetKraken() { krakenInitialized = false; krakenList = null; krakenBoostCount = 0; } } internal static ManualLogSource Logger; public const string PLUGIN_VERSION = "1.6.0"; private static readonly List pendingValuables = new List(); public static string CurrentEconomyName = "Stability"; public static string CurrentEconomyFlavor = "Economy by default"; public static HashSet ProcessedByEconomy = new HashSet(); public static Dictionary EconomyAdjustedValues = new Dictionary(); private static readonly FieldInfo FI_current = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); internal static REPOConomyPlugin Instance { get; private set; } public static bool HasEconomy { get; set; } = false; public static EconomyType CurrentEconomy { get; set; } public static float MinPercent { get; set; } public static float MaxPercent { get; set; } public static bool EconomyInitialized { get; private set; } = false; public static float ClientDeltaMin { get; set; } public static float ClientDeltaMax { get; set; } public static PercentRollMode CurrentRollMode { get; set; } = PercentRollMode.Random; public static Color CurrentEconomyColor { get; set; } = Color.white; public static CustomEconomyData CurrentCustomEconomy { get; set; } = null; public static ShopEconomyType CurrentShopEconomy { get; set; } = ShopEconomyType.NormalPrices; public static bool HasShopEconomy { get; set; } = false; public static float ShopPriceMultiplier { get; set; } = 1f; public static float ShopUpgradeMultiplier { get; set; } = 1f; public static float ShopHealthPackMultiplier { get; set; } = 1f; public static float ShopConsumableMultiplier { get; set; } = 1f; private void Awake() { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown Logger = ((BaseUnityPlugin)this).Logger; Instance = this; Harmony val = new Harmony("PxntxrezStudio.REPOConomyPlus"); val.PatchAll(); REPOUIMenuLibHooks.Install(); HealthPotionCompatibilityPatch.Initialize(); if (Chainloader.PluginInfos.ContainsKey("SeroRonin.ItemBundles")) { Logger.LogInfo((object)"[REPOConomyPlus] ItemBundles detected! Compatibility enabled via ShopManager patch."); } if (Chainloader.PluginInfos.ContainsKey("bulletbot.moreupgrades")) { Logger.LogInfo((object)"[REPOConomyPlus] MoreUpgrades detected! Compatibility enabled via ShopManager patch."); } if (Chainloader.PluginInfos.ContainsKey("com.github.darmuh.PocketCartPlus")) { Logger.LogInfo((object)"[REPOConomyPlus] PocketCartPlus detected! Random seed sync enabled."); } if (Chainloader.PluginInfos.ContainsKey("Swaggies.LevelScaling")) { Logger.LogInfo((object)"[REPOConomyPlus] LevelScaling detected! Ordering patches to run AFTER it."); } if (Chainloader.PluginInfos.ContainsKey("proferabg.REPO.RepoAdminMenu")) { Debug.Log((object)"[REPOConomyPlus] RepoAdminMenu detected! Applying compatibility patches..."); try { PatchAdminMenuCompatibility(val); Debug.Log((object)"[REPOConomyPlus] AdminMenu compatibility patches applied successfully!"); } catch (Exception arg) { Debug.LogError((object)$"[REPOConomyPlus] Failed to apply AdminMenu compatibility: {arg}"); } } CustomEconomyLoader.LoadCustomEvents(); REPOConfig.Init(((BaseUnityPlugin)this).Config); REPOEventManager.Initialize(); REPOSeedManager.LoadSeedFromConfig(); REPOConfig.GlobalUpgradesMultiplier.SettingChanged += OnUpgradesMultiplierChanged; REPOConfig.InitDynamicConfigs(((BaseUnityPlugin)this).Config); InitializeMenuSystem(); SceneManager.sceneLoaded += OnSceneLoaded; } private void InitializeMenuSystem() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown //IL_0047: 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_0058: Expected O, but got Unknown GameObject val = new GameObject("REPOSettingsManager"); val.AddComponent(); Object.DontDestroyOnLoad((Object)val); GameObject val2 = new GameObject("REPOStatsManager"); val2.AddComponent(); Object.DontDestroyOnLoad((Object)val2); GameObject val3 = new GameObject("REPOMenuManager"); val3.AddComponent(); Object.DontDestroyOnLoad((Object)val3); GameObject val4 = new GameObject("REPOBlackMarketManager"); val4.AddComponent(); Object.DontDestroyOnLoad((Object)val4); Logger.LogInfo((object)"[REPOConomyPlus] Menu system initialized!"); } private void OnUpgradesMultiplierChanged(object sender, EventArgs e) { if (SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.RunIsLevel()) { REPOConomyNetworkHandler.SyncUpgradesMultiplierToClients(); Logger.LogInfo((object)$"[UpgradesMultiplier] Config changed, syncing to clients: x{REPOConfig.GlobalUpgradesMultiplier.Value:F2}"); } } private void PatchAdminMenuCompatibility(Harmony harmony) { Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "RepoAdminMenu"); if (assembly == null) { Debug.LogWarning((object)"[REPOConomyPlus] AdminMenu assembly not found!"); return; } if (assembly.GetType("RepoAdminMenu.Patches.PunManagerPatch") == null) { Debug.LogWarning((object)"[REPOConomyPlus] PunManagerPatch type not found!"); return; } string[] obj = new string[8] { "Prefix_UpdateHealthRightAway", "Prefix_UpdateEnergyRightAway", "Prefix_UpdateExtraJumpRightAway", "Prefix_UpdateTumbleLaunchRightAway", "Prefix_UpdateSprintSpeedRightAway", "Prefix_UpdateGrabStrengthRightAway", "Prefix_UpdateThrowStrengthRightAway", "Prefix_UpdateGrabRangeRightAway" }; int num = 0; string[] array = obj; foreach (string text in array) { try { MethodInfo methodInfo = AccessTools.Method(typeof(PunManager), text.Replace("Prefix_", ""), (Type[])null, (Type[])null); if (!(methodInfo != null)) { continue; } Patches patchInfo = Harmony.GetPatchInfo((MethodBase)methodInfo); if (patchInfo == null) { continue; } foreach (Patch prefix in patchInfo.Prefixes) { if (prefix.owner.Contains("RepoAdminMenu") || prefix.owner.Contains("AdminMenu")) { harmony.Unpatch((MethodBase)methodInfo, prefix.PatchMethod); Debug.Log((object)("[REPOConomyPlus] REMOVED AdminMenu patch from: " + methodInfo.Name)); num++; } } } catch (Exception ex) { Debug.LogError((object)("[REPOConomyPlus] Failed to unpatch " + text + ": " + ex.Message)); } } Debug.Log((object)$"[REPOConomyPlus] Successfully REMOVED {num} AdminMenu patches"); } private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown if (!SemiFunc.RunIsArena()) { REPOStatsManager.EnsureInstance()?.SyncRunTotalHaulFromGame(); if ((Object)(object)EconomyController.Instance == (Object)null) { GameObject val = new GameObject("EconomyUI"); EconomyController.Instance = val.AddComponent(); val.AddComponent(); Object.DontDestroyOnLoad((Object)val); } } } public static void InitializeEconomy() { //IL_02c0: Unknown result type (might be due to invalid IL or missing references) if (EconomyInitialized) { Logger.LogInfo((object)"[Economy] Already initialized. Skipping."); return; } if (SemiFunc.RunIsLobby() || SemiFunc.RunIsShop() || SemiFunc.RunIsArena()) { Logger.LogInfo((object)"[Economy] Initialization canceled: Lobby, store, or arena."); return; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { Logger.LogInfo((object)"[Economy] Initialization skipped: not the MasterClient or Singleplayer."); return; } REPOConomyNetworkHandler.SyncSeedToClients(REPOSeedManager.CurrentSeed); REPOConomyNetworkHandler.SyncUpgradesMultiplierToClients(); REPOConomyNetworkHandler.SyncScalingToClients(); REPOBlackMarketManager.BeginLevelRoll(); EconomyInitialized = true; int currentLevel = GetCurrentLevel(); REPOStatsManager.EnsureInstance()?.SyncRunTotalHaulFromGame(); REPOStatsManager.EnsureInstance()?.TrackLevelCompleted(currentLevel); LevelMilestoneRewardManager.TryUnlockLevel100Pack(currentLevel); ChallengeManager.OnLevelStarted(currentLevel); float clientDeltaMin = (float)(currentLevel - 1) * REPOConfig.LevelScaleMin.Value; float clientDeltaMax = (float)(currentLevel - 1) * REPOConfig.LevelScaleMax.Value; ClientDeltaMin = clientDeltaMin; ClientDeltaMax = clientDeltaMax; bool value = REPOConfig.ForceStableEconomy.Value; bool flag = currentLevel >= REPOConfig.EventStartLevel.Value; bool flag2 = !REPOConfig.UseEventChance.Value || REPOSeedManager.Range(1, 101) <= REPOConfig.EventChance.Value; bool flag3 = REPOConfig.EnableCustomEvents.Value && CustomEconomyLoader.CustomEvents.Count > 0; bool value2 = REPOConfig.DisableVanillaEvents.Value; bool value3 = REPOConfig.UseCustomEventChance.Value; int value4 = REPOConfig.CustomEventChance.Value; bool flag4 = false; bool flag5 = false; if (flag && TryApplyForcedEconomy(out var _)) { flag4 = true; flag5 = true; } if (!flag4 && (value || !flag || !flag2)) { ApplyVanillaEconomy(EconomyType.Stable); flag4 = true; if (value) { flag5 = true; } } if (!flag4 && flag3 && value2) { PickRandomCustomEvent(); flag4 = true; } if (!flag4 && flag3 && value3) { if (REPOSeedManager.Range(1, 101) <= value4) { PickRandomCustomEvent(); } else { ApplyVanillaEconomy(GetRandomVanillaType()); } flag4 = true; } if (!flag4 && flag3) { if (!value2 && REPOSeedManager.Range(0, 2) == 1) { ApplyVanillaEconomy(GetRandomVanillaType()); } else { PickRandomCustomEvent(); } flag4 = true; } if (!flag4) { ApplyVanillaEconomy(GetRandomVanillaType()); flag4 = true; } string text = ((CurrentCustomEconomy != null) ? (CurrentCustomEconomy.id ?? string.Empty) : CurrentEconomy.ToString()); if (ChallengeManager.TryApplyEconomyPreset()) { text = CurrentEconomy.ToString(); flag5 = true; } string economyName = FirstNonEmpty(GetEconomyNameForId(text), FormatStatsEnglishLabel(text)); string economyDescription = FirstNonEmpty(GetEconomyFlavorForId(text), "Economy event affecting value range."); if (!flag5) { REPOStatsManager.EnsureInstance()?.TrackEconomyOccurrence(text, economyName, economyDescription, CurrentEconomyColor, currentLevel); } else { Logger.LogInfo((object)("[Stats] Skipped economy tracking for forced economy: " + text)); } string value5 = REPOConfig.RollMode.Value; if (value5 == "Dynamic") { PercentRollMode[] array = new PercentRollMode[3] { PercentRollMode.Random, PercentRollMode.Stable, PercentRollMode.Volatile }; CurrentRollMode = array[REPOSeedManager.Range(0, array.Length)]; } else { CurrentRollMode = (PercentRollMode)Enum.Parse(typeof(PercentRollMode), value5); } REPODifficultyManager.CalculateDifficulty(); REPOEventManager.PickEvents(currentLevel >= REPOConfig.ModifierStartLevel.Value); REPOBlackMarketManager.ConsumePendingBlocksAfterGeneration(); foreach (ValuableObject pendingValuable in pendingValuables) { ValuablePatch.ApplyRandomValue(pendingValuable); } pendingValuables.Clear(); } private static bool TryApplyForcedEconomy(out bool pickedCustom) { pickedCustom = false; if (REPOConfig.ForceEconomy == null || REPOConfig.ForceEconomy.Count == 0) { return false; } List list = new List(); List list2 = new List(); foreach (KeyValuePair> item in REPOConfig.ForceEconomy) { if (item.Value == null || !item.Value.Value) { continue; } string text = item.Key ?? string.Empty; string text2 = text.Trim(); if (string.IsNullOrWhiteSpace(text2) || text2.StartsWith("Enable Shop ", StringComparison.OrdinalIgnoreCase)) { continue; } if (text2.StartsWith("Enable Custom ", StringComparison.OrdinalIgnoreCase)) { string customId = text2.Substring("Enable Custom ".Length).Trim(); if (!string.IsNullOrWhiteSpace(customId)) { CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData e) => string.Equals(e.id, customId, StringComparison.OrdinalIgnoreCase)); if (customEconomyData == null) { Logger.LogWarning((object)("[Economy] Forced custom economy '" + customId + "' not found.")); } else if (!list2.Contains(customEconomyData)) { list2.Add(customEconomyData); } } continue; } string text3 = text2; if (text3.StartsWith("Enable ", StringComparison.OrdinalIgnoreCase)) { text3 = text3.Substring("Enable ".Length).Trim(); } if (Enum.TryParse(text3, ignoreCase: true, out var result)) { if (REPOBlackMarketManager.TryConsumeEconomyBlock(result.ToString(), result.ToString())) { Logger.LogInfo((object)$"[Economy] Forced economy '{result}' blocked by black market."); } else if (ChallengeManager.IsChallengeRewardEconomy(result) && !ChallengeManager.IsRewardEconomyUnlocked(result)) { Logger.LogInfo((object)$"[Economy] Forced challenge reward economy '{result}' is locked."); } else if (LevelMilestoneRewardManager.IsRewardEconomy(result) && !LevelMilestoneRewardManager.IsLevel100Unlocked()) { Logger.LogInfo((object)$"[Economy] Level 100 reward economy '{result}' is locked."); } else if (!list.Contains(result)) { list.Add(result); } } else { Logger.LogWarning((object)("[Economy] Forced economy key '" + text + "' is invalid.")); } } int num = list.Count + list2.Count; if (num == 0) { return false; } int num2 = REPOSeedManager.Range(0, num); if (num2 < list.Count) { EconomyType economyType = list[num2]; ApplyVanillaEconomy(economyType); Logger.LogInfo((object)$"[Economy] Forced vanilla economy applied: {economyType}"); pickedCustom = false; return true; } CustomEconomyData customEconomyData2 = list2[num2 - list.Count]; if (ApplyCustomEconomy(customEconomyData2)) { Logger.LogInfo((object)("[Economy] Forced custom economy applied: " + customEconomyData2.id)); pickedCustom = true; return true; } return false; } private static bool PickRandomCustomEvent() { List list = CustomEconomyLoader.CustomEvents.Where((CustomEconomyData e) => REPOConfig.EconomyEnables["Enable Custom " + e.id].Value).ToList(); if (list.Count == 0) { Logger.LogWarning((object)"[Economy] No custom economies enabled, falling back to Stable."); ApplyVanillaEconomy(EconomyType.Stable); return false; } while (list.Count > 0) { int index = REPOSeedManager.Range(0, list.Count); CustomEconomyData customEconomyData = list[index]; if (REPOBlackMarketManager.TryConsumeEconomyBlock(customEconomyData.id, customEconomyData.name_en)) { Logger.LogInfo((object)("[Economy] Black market prevented custom economy: " + customEconomyData.id)); list.RemoveAt(index); continue; } return ApplyCustomEconomy(customEconomyData); } Logger.LogWarning((object)"[Economy] All rolled custom economies were blocked, falling back to Stable."); ApplyVanillaEconomy(EconomyType.Stable); return false; } private static bool ApplyCustomEconomy(CustomEconomyData data) { //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02f7: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown //IL_0307: Unknown result type (might be due to invalid IL or missing references) if (data == null) { Logger.LogWarning((object)"[Economy] Cannot apply custom economy: data is null."); return false; } _ = REPOConfig.UILanguage.Value == "Russian"; CurrentCustomEconomy = data; int currentLevel = GetCurrentLevel(); float num = (float)(currentLevel - 1) * REPOConfig.LevelScaleMin.Value; float num2 = (float)(currentLevel - 1) * REPOConfig.LevelScaleMax.Value; ClientDeltaMin = num; ClientDeltaMax = num2; float num3 = 0f - REPOConfig.DefaultBaseMin.Value - num; float num4 = REPOConfig.DefaultBaseMax.Value + num2; if (data.useDelta) { num3 += data.min; num4 += data.max; } else { num3 = data.min + ClientDeltaMin; num4 = data.max + ClientDeltaMax; } num3 = Mathf.Clamp(num3, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); num4 = Mathf.Clamp(num4, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); MinPercent = num3; MaxPercent = num4; CurrentEconomyColor = (Color)((data.color != null && data.color.Length == 3) ? new Color(data.color[0] / 255f, data.color[1] / 255f, data.color[2] / 255f) : Color.white); HasEconomy = true; Logger.LogInfo((object)("[Economy] Picked custom event: " + data.id + " " + $"({CurrentEconomyName} {MinPercent}%–{MaxPercent}%)")); if (PhotonNetwork.IsMasterClient) { object[] obj = new object[13] { -1, MinPercent, MaxPercent, ClientDeltaMin, ClientDeltaMax, CurrentCustomEconomy.id, CurrentCustomEconomy.name_en ?? "", CurrentCustomEconomy.name_ru ?? "", CurrentCustomEconomy.desc_en ?? "", CurrentCustomEconomy.desc_ru ?? "", null, null, null }; float[] color = CurrentCustomEconomy.color; obj[10] = ((color != null && color.Length != 0) ? (CurrentCustomEconomy.color[0] / 255f) : 1f); float[] color2 = CurrentCustomEconomy.color; obj[11] = ((color2 != null && color2.Length > 1) ? (CurrentCustomEconomy.color[1] / 255f) : 1f); float[] color3 = CurrentCustomEconomy.color; obj[12] = ((color3 != null && color3.Length > 2) ? (CurrentCustomEconomy.color[2] / 255f) : 1f); object[] array = obj; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)179, (object)array, val, SendOptions.SendReliable); } return true; } private static void ApplyVanillaEconomy(EconomyType economy) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_1a50: Unknown result type (might be due to invalid IL or missing references) //IL_1a55: Unknown result type (might be due to invalid IL or missing references) //IL_1a57: Unknown result type (might be due to invalid IL or missing references) //IL_1a5e: Expected O, but got Unknown //IL_1a67: Unknown result type (might be due to invalid IL or missing references) CurrentEconomy = economy; CurrentCustomEconomy = null; CurrentEconomyColor = GetEconomyColor(); HasEconomy = true; int currentLevel = GetCurrentLevel(); float num = (float)(currentLevel - 1) * REPOConfig.LevelScaleMin.Value; float num2 = (float)(currentLevel - 1) * REPOConfig.LevelScaleMax.Value; ClientDeltaMin = num; ClientDeltaMax = num2; float num3 = 0f - REPOConfig.DefaultBaseMin.Value - num; float num4 = REPOConfig.DefaultBaseMax.Value + num2; switch (economy) { case EconomyType.GlassBankDividend: num3 += 15f; num4 += 95f; break; case EconomyType.PitContractInsurance: num3 -= 5f; num4 += 55f; break; case EconomyType.StormRunnerSurge: num3 -= 35f; num4 += 120f; break; case EconomyType.SilentDebtEclipse: num3 -= 75f; num4 += 45f; break; case EconomyType.CloneLotteryJackpot: num3 -= 90f; num4 += 190f; break; case EconomyType.MagnetShiftVortex: num3 -= 45f; num4 += 145f; break; case EconomyType.LastInvoiceJudgement: num3 -= 65f; num4 += 165f; break; case EconomyType.CenturionMarket: num3 += 35f; num4 += 210f; break; case EconomyType.FreezeMarket: num3 = 0f; num4 = 0f; break; case EconomyType.Deflation: num3 -= 10f; num4 -= 5f; break; case EconomyType.Inflation: num3 += 0f; num4 += 10f; break; case EconomyType.Chaos: num3 -= 10f; num4 += 10f; break; case EconomyType.BlackMarketSurge: num3 -= 10f; num4 += 20f; break; case EconomyType.Overload: num3 = -100f; num4 += 100f; break; case EconomyType.RareBoom: num3 += 5f; num4 += 30f; break; case EconomyType.CommonCrash: num3 -= 30f; num4 -= 10f; break; case EconomyType.LegendaryOnlyMatters: num3 = -20f; num4 = 5f; break; case EconomyType.EchoMarket: num3 += REPOSeedManager.Range(-25f, 0f); num4 += REPOSeedManager.Range(0f, 25f); break; case EconomyType.ReverseInflation: num3 -= 15f; num4 -= 5f; break; case EconomyType.LuxuryHunt: num3 += 10f; num4 += 40f; break; case EconomyType.DumpsterDive: num3 += 5f; num4 += 60f; break; case EconomyType.ExtraProfit: num4 += 50f; break; case EconomyType.ScamSeason: num3 -= 30f; num4 -= 10f; break; case EconomyType.SuddenDrop: num3 = -50f; num4 = -20f; break; case EconomyType.TreasureRush: num3 += 100f; num4 += 200f; break; case EconomyType.ZeroGravity: num3 = -50f; num4 = 150f; break; case EconomyType.Turbulence: { float num20 = REPOSeedManager.Range(-30f, 30f); num3 += num20; num4 += num20; break; } case EconomyType.BubbleBurst: num3 -= 40f; num4 -= 5f; break; case EconomyType.CollectorsFrenzy: num3 += 30f; num4 += 80f; break; case EconomyType.PanicSale: num3 = -40f; num4 = -20f; break; case EconomyType.EconomicTwister: num3 = 0f; num4 = 0f; break; case EconomyType.TaxAudit: num3 = -15f; num4 = -15f; break; case EconomyType.CrashAndBurn: num3 = -90f; num4 = 0f; break; case EconomyType.GoldenHour: num3 += 20f; num4 += 50f; break; case EconomyType.CrystalBubble: num3 += 50f; num4 += 100f; break; case EconomyType.CoinDecay: num3 -= 20f; num4 -= 60f; break; case EconomyType.EchoCrash: { float num19 = REPOSeedManager.Range(-50f, 50f); num3 += num19; num4 += num19; break; } case EconomyType.SpeculationBubble: num3 -= 20f; num4 += 100f; break; case EconomyType.ColdStorage: num3 -= 10f; num4 -= 10f; break; case EconomyType.PriceWhirlwind: num3 += REPOSeedManager.Range(-60f, 0f); num4 += REPOSeedManager.Range(0f, 60f); break; case EconomyType.ExperimentalPricing: num3 -= 20f; num4 += 40f; break; case EconomyType.ShadowMarket: num3 -= 60f; num4 += 5f; break; case EconomyType.AuctionFever: num3 += 10f; num4 += 80f; break; case EconomyType.MemoryMarket: num3 = Mathf.Clamp(MinPercent + REPOSeedManager.Range(-5f, 5f), 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); num4 = Mathf.Clamp(MaxPercent + REPOSeedManager.Range(-5f, 5f), 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); break; case EconomyType.LoopbackSpike: { float num17 = MinPercent * 2f; float num18 = MaxPercent * 2f; num3 = Mathf.Clamp(num17, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); num4 = Mathf.Clamp(num18, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); break; } case EconomyType.GlitchedGoldrush: num3 = 20f; num4 = 100f; break; case EconomyType.MarketEclipse: num3 = -5f; num4 = 5f; break; case EconomyType.JackpotMirage: { float num16 = REPOSeedManager.Range(-50f, 150f); num3 = num16 / 2f; num4 = num16; break; } case EconomyType.CollectorsVoid: num3 = -90f; num4 = -50f; break; case EconomyType.VolatileExperiment: num3 = -100f; num4 = 250f; break; case EconomyType.CleanSweep: num3 = 0f; num4 = 5f; break; case EconomyType.TemporalSurge: num3 -= 20f; num4 += 60f; break; case EconomyType.EchoOfWealth: num3 = MinPercent; num4 = MaxPercent; break; case EconomyType.ArtifactBloat: num3 += 50f; num4 += 100f; break; case EconomyType.MarketDrain: num3 -= 60f; num4 -= 30f; break; case EconomyType.InversionProtocol: { float num15 = num3; num3 = 0f - num4; num4 = 0f - num15; break; } case EconomyType.SyntheticDemand: num3 += REPOSeedManager.Range(0f, 30f); num4 += REPOSeedManager.Range(30f, 80f); break; case EconomyType.TaxFrenzy: num3 = -50f; num4 = -20f; break; case EconomyType.AssetDump: num3 = -80f; num4 = 20f; break; case EconomyType.MarketBoom: num3 += 20f; num4 += 50f; break; case EconomyType.PriceLockdown: num3 = -5f; num4 = 5f; break; case EconomyType.WildSpeculation: { float num14 = REPOSeedManager.Range(-50f, 100f); num3 += num14; num4 += num14; break; } case EconomyType.SilentAuction: num3 += 0f; num4 += 30f; break; case EconomyType.FlashCrash: num3 -= 50f; num4 -= 20f; break; case EconomyType.CryptoSurge: num3 += 10f; num4 += 100f; break; case EconomyType.ResourceRush: num3 += 5f; num4 += 25f; break; case EconomyType.DemandSpike: num3 += 0f; num4 += 60f; break; case EconomyType.SupplyShortage: num3 -= 20f; num4 -= 5f; break; case EconomyType.ConsumerConfidence: num3 += 5f; num4 += 15f; break; case EconomyType.MarketMeltup: num3 += 50f; num4 += 200f; break; case EconomyType.BargainHunt: num3 -= 10f; num4 += 10f; break; case EconomyType.MarketRebound: num3 += 10f; num4 += 20f; break; case EconomyType.PriceCascade: num3 += REPOSeedManager.Range(-20f, 0f); num4 += REPOSeedManager.Range(0f, 20f); break; case EconomyType.BullRun: num3 += 30f; num4 += 60f; break; case EconomyType.BearTrap: num3 -= 60f; num4 -= 30f; break; case EconomyType.PanicBuying: num3 += 50f; num4 += 100f; break; case EconomyType.SupplyGlut: num3 -= 50f; num4 += 10f; break; case EconomyType.SpeculatorFrenzy: { float num13 = REPOSeedManager.Range(-40f, 40f); num3 += num13; num4 += num13; break; } case EconomyType.ValueStabilizer: num3 = Mathf.Clamp(num3, -5f, 5f); num4 = Mathf.Clamp(num4, -5f, 5f); break; case EconomyType.MarketMirroring: num3 = MinPercent; num4 = MaxPercent; break; case EconomyType.InflationSpike: num3 += 15f; num4 += 25f; break; case EconomyType.DeflationDip: num3 -= 15f; num4 -= 25f; break; case EconomyType.EconomicEquilibrium: num3 = 0f; num4 = 0f; break; case EconomyType.PriceSurge: num3 += 20f; num4 += 40f; break; case EconomyType.BargainBlitz: num3 -= 30f; num4 -= 10f; break; case EconomyType.CollectorCarnival: num3 = ((!(num3 >= 50f)) ? (num3 - 10f) : (num3 * 2f)); num4 = ((!(num4 >= 50f)) ? (num4 - 10f) : (num4 * 2f)); break; case EconomyType.GhostPrices: { float num12 = REPOSeedManager.Range(-25f, 25f); num3 += num12; num4 += num12; break; } case EconomyType.BarterBonanza: num3 -= 20f; num4 += 15f; break; case EconomyType.SeasonalShift: num3 += 15f; num4 -= 5f; break; case EconomyType.BlackoutSale: { float num11 = REPOSeedManager.Range(-50f, -30f); num3 += num11; num4 += num11; break; } case EconomyType.InflationEbb: num3 -= 20f; num4 -= 10f; break; case EconomyType.FoolsGold: { float num10 = REPOSeedManager.Range(0f, 50f); num3 = num3 - 10f + num10; num4 = num4 - 10f + num10; break; } case EconomyType.HoardersHavoc: num3 -= 40f; num4 += 10f; break; case EconomyType.PennyPinch: { float num9 = REPOSeedManager.Range(-60f, -40f); num3 += num9; num4 += num9; break; } case EconomyType.Trendsetter: { float num8 = REPOSeedManager.Range(30f, 60f); num3 += num8; num4 += num8; break; } case EconomyType.PriceSpike: num3 += 40f; num4 += 80f; break; case EconomyType.Clearance: num3 -= 60f; num4 -= 20f; break; case EconomyType.BoomerangMarket: num3 += REPOSeedManager.Range(-20f, 10f); num4 += REPOSeedManager.Range(10f, 40f); break; case EconomyType.SilentDip: num3 -= 10f; num4 -= 5f; break; case EconomyType.LuxuryOnly: num3 = -40f; num4 = 5f; break; case EconomyType.EarlyBubble: num3 += 30f; num4 += 100f; break; case EconomyType.LateDeflation: num3 = -70f; num4 = -10f; break; case EconomyType.PriceSlalom: { float num7 = REPOSeedManager.Range(-30f, 30f); num3 += num7; num4 += num7; break; } case EconomyType.FalseDemand: num3 += 10f; num4 += 40f; break; case EconomyType.UndergroundTrade: num3 -= 40f; num4 += 5f; break; case EconomyType.CrystalCrash: num3 = -100f; num4 = -40f; break; case EconomyType.GhostRush: num3 += 50f; num4 += 150f; break; case EconomyType.QuantumFlux: num3 += REPOSeedManager.Range(-20f, 20f); num4 += REPOSeedManager.Range(-20f, 20f); break; case EconomyType.VoidMarket: num3 = -50f; num4 = 50f; break; case EconomyType.CrystalCascade: num3 += 25f; num4 += 75f; break; case EconomyType.ShadowInflation: num3 -= 10f; num4 += 40f; break; case EconomyType.PlasmaSurge: num3 += 30f; num4 += 60f; break; case EconomyType.EtherCrash: num3 -= 80f; num4 -= 20f; break; case EconomyType.MysticDeflation: num3 -= 35f; num4 -= 10f; break; case EconomyType.ArcaneBubble: num3 += 15f; num4 += 85f; break; case EconomyType.SpectralBoom: num3 += 40f; num4 += 90f; break; case EconomyType.PhantomDip: num3 -= 60f; num4 -= 15f; break; case EconomyType.NebulaTwist: { float num6 = REPOSeedManager.Range(-40f, 40f); num3 += num6; num4 += num6; break; } case EconomyType.StellarSurge: num3 += 45f; num4 += 95f; break; case EconomyType.CometCrash: num3 -= 70f; num4 -= 25f; break; case EconomyType.AuroraBust: num3 -= 45f; num4 -= 5f; break; case EconomyType.GalaxyGlitch: num3 += REPOSeedManager.Range(-50f, 50f); num4 += REPOSeedManager.Range(-50f, 50f); break; case EconomyType.MeteorShower: num3 += 55f; num4 += 120f; break; case EconomyType.EclipseEvent: num3 = 0f; num4 = 0f; break; case EconomyType.LunarEclipse: num3 -= 25f; num4 -= 25f; break; case EconomyType.SolarFlare: num3 += 35f; num4 += 35f; break; case EconomyType.CosmicDust: num3 += REPOSeedManager.Range(-30f, 10f); num4 += REPOSeedManager.Range(-10f, 30f); break; case EconomyType.BlackHole: num3 = -100f; num4 = -50f; break; case EconomyType.WhiteDwarf: num3 += 20f; num4 += 40f; break; case EconomyType.RedGiant: num3 += 60f; num4 += 140f; break; case EconomyType.BlueSupergiant: num3 += 80f; num4 += 180f; break; case EconomyType.NeutronStar: num3 += 15f; num4 += 35f; break; case EconomyType.PulsarPulse: num3 += REPOSeedManager.Range(-25f, 25f); num4 += REPOSeedManager.Range(-25f, 25f); break; case EconomyType.QuasarQuake: num3 -= 40f; num4 += 60f; break; case EconomyType.Singularity: num3 = -200f; num4 = 200f; break; case EconomyType.WarpDrive: num3 += 70f; num4 += 150f; break; case EconomyType.TimeDilation: num3 -= 20f; num4 -= 20f; break; case EconomyType.SpaceTime: { float num5 = REPOSeedManager.Range(-60f, 60f); num3 += num5; num4 += num5; break; } case EconomyType.DimensionalRift: num3 = -80f; num4 = 120f; break; case EconomyType.ParallelUniverse: num3 += REPOSeedManager.Range(-100f, 100f); num4 += REPOSeedManager.Range(-100f, 100f); break; case EconomyType.QuantumEntanglement: num3 += 25f; num4 += 75f; break; case EconomyType.WaveFunction: num3 += REPOSeedManager.Range(-40f, 40f); num4 += REPOSeedManager.Range(-40f, 40f); break; case EconomyType.ProbabilityCloud: num3 += REPOSeedManager.Range(-50f, 50f); num4 += REPOSeedManager.Range(-50f, 50f); break; case EconomyType.UncertaintyPrinciple: num3 -= 30f; num4 += 30f; break; case EconomyType.ObserverEffect: num3 += 10f; num4 += 50f; break; case EconomyType.Decoherence: num3 -= 25f; num4 -= 5f; break; case EconomyType.Superposition: num3 = -50f; num4 = 150f; break; case EconomyType.EntanglementSwap: num3 += 40f; num4 += 80f; break; case EconomyType.BellInequality: num3 -= 35f; num4 -= 10f; break; case EconomyType.EPRParadox: num3 += REPOSeedManager.Range(-45f, 45f); num4 += REPOSeedManager.Range(-45f, 45f); break; case EconomyType.ManyWorlds: num3 += 30f; num4 += 90f; break; case EconomyType.Copenhagen: num3 -= 20f; num4 += 40f; break; case EconomyType.Multiverse: num3 += REPOSeedManager.Range(-80f, 80f); num4 += REPOSeedManager.Range(-80f, 80f); break; case EconomyType.StringTheory: num3 += 50f; num4 += 100f; break; case EconomyType.Membrane: num3 += 25f; num4 += 55f; break; case EconomyType.BraneWorld: num3 += REPOSeedManager.Range(-35f, 35f); num4 += REPOSeedManager.Range(-35f, 35f); break; case EconomyType.Holographic: num3 += 20f; num4 += 60f; break; case EconomyType.InformationParadox: num3 = -75f; num4 = 25f; break; case EconomyType.Firewall: num3 -= 50f; num4 -= 10f; break; case EconomyType.EventHorizon: num3 = -90f; num4 = -30f; break; case EconomyType.HawkingRadiation: num3 += 15f; num4 += 45f; break; case EconomyType.UnruhEffect: num3 -= 15f; num4 -= 15f; break; case EconomyType.CasimirForce: num3 -= 5f; num4 -= 25f; break; case EconomyType.VacuumEnergy: num3 += REPOSeedManager.Range(-20f, 20f); num4 += REPOSeedManager.Range(-20f, 20f); break; case EconomyType.DarkMatter: num3 += 40f; num4 += 80f; break; case EconomyType.DarkEnergy: num3 += 60f; num4 += 120f; break; case EconomyType.InflationField: num3 += 75f; num4 += 150f; break; case EconomyType.HiggsField: num3 += 10f; num4 += 30f; break; case EconomyType.Graviton: num3 += REPOSeedManager.Range(-30f, 30f); num4 += REPOSeedManager.Range(-30f, 30f); break; case EconomyType.Tachyon: num3 += 85f; num4 += 170f; break; case EconomyType.WIMP: num3 += 20f; num4 += 50f; break; case EconomyType.Axion: num3 -= 5f; num4 -= 15f; break; case EconomyType.Neutrino: num3 -= 10f; num4 -= 5f; break; case EconomyType.Muon: num3 -= 25f; num4 -= 45f; break; case EconomyType.Tau: num3 -= 30f; num4 -= 60f; break; case EconomyType.Quark: num3 -= 15f; num4 -= 35f; break; case EconomyType.Lepton: num3 -= 10f; num4 -= 30f; break; case EconomyType.Boson: num3 += REPOSeedManager.Range(-25f, 25f); num4 += REPOSeedManager.Range(-25f, 25f); break; case EconomyType.Fermion: num3 -= 20f; num4 -= 40f; break; case EconomyType.Hadron: num3 -= 25f; num4 -= 55f; break; case EconomyType.Meson: num3 -= 15f; num4 -= 35f; break; case EconomyType.Baryon: num3 -= 30f; num4 -= 70f; break; case EconomyType.Photon: num3 -= 5f; num4 -= 20f; break; case EconomyType.Gluon: num3 += REPOSeedManager.Range(-15f, 15f); num4 += REPOSeedManager.Range(-15f, 15f); break; case EconomyType.W_Boson: num3 -= 35f; num4 -= 65f; break; case EconomyType.Z_Boson: num3 -= 40f; num4 -= 75f; break; case EconomyType.HiggsBoson: num3 += 50f; num4 += 100f; break; case EconomyType.GravitonFlux: num3 += REPOSeedManager.Range(-40f, 40f); num4 += REPOSeedManager.Range(-40f, 40f); break; case EconomyType.Chroniton: num3 += 45f; num4 += 90f; break; case EconomyType.Dilaton: num3 -= 20f; num4 -= 40f; break; case EconomyType.Axigluon: num3 -= 25f; num4 -= 50f; break; case EconomyType.MagneticMonopole: num3 += 70f; num4 += 140f; break; case EconomyType.Instanton: num3 += REPOSeedManager.Range(-30f, 30f); num4 += REPOSeedManager.Range(-30f, 30f); break; case EconomyType.Skyrmion: num3 -= 35f; num4 -= 70f; break; case EconomyType.Soliton: num3 -= 40f; num4 -= 80f; break; case EconomyType.Vortex: num3 += REPOSeedManager.Range(-50f, 50f); num4 += REPOSeedManager.Range(-50f, 50f); break; case EconomyType.DomainWall: num3 -= 25f; num4 += 25f; break; case EconomyType.CosmicString: num3 += 55f; num4 += 110f; break; case EconomyType.Texture: num3 += REPOSeedManager.Range(-35f, 35f); num4 += REPOSeedManager.Range(-35f, 35f); break; case EconomyType.Monopole: num3 += 60f; num4 += 120f; break; case EconomyType.GlobalString: num3 -= 30f; num4 -= 60f; break; case EconomyType.LocalString: num3 -= 25f; num4 -= 50f; break; case EconomyType.AxionString: num3 -= 20f; num4 -= 45f; break; case EconomyType.Superstring: num3 += 65f; num4 += 130f; break; case EconomyType.Heterotic: num3 += 50f; num4 += 95f; break; case EconomyType.TypeI: num3 += 40f; num4 += 80f; break; case EconomyType.TypeIIA: num3 -= 35f; num4 -= 70f; break; case EconomyType.TypeIIB: num3 -= 45f; num4 -= 90f; break; case EconomyType.HO: num3 += 55f; num4 += 105f; break; case EconomyType.E6: num3 -= 30f; num4 -= 65f; break; case EconomyType.E7: num3 -= 35f; num4 -= 75f; break; case EconomyType.E8: num3 += 70f; num4 += 140f; break; case EconomyType.SU5: num3 -= 25f; num4 -= 55f; break; case EconomyType.SO10: num3 += 40f; num4 += 85f; break; case EconomyType.SUSY: num3 += 50f; num4 += 100f; break; case EconomyType.MSSM: num3 += 35f; num4 += 70f; break; case EconomyType.NMSSM: num3 -= 30f; num4 -= 65f; break; case EconomyType.AMSB: num3 -= 25f; num4 -= 50f; break; case EconomyType.GMSB: num3 += 40f; num4 += 80f; break; case EconomyType.KKLT: num3 += 45f; num4 += 90f; break; case EconomyType.LVS: num3 -= 35f; num4 -= 75f; break; case EconomyType.RS: num3 -= 30f; num4 -= 65f; break; case EconomyType.ADD: num3 -= 20f; num4 -= 45f; break; case EconomyType.UED: num3 -= 25f; num4 -= 55f; break; case EconomyType.TC2: num3 -= 15f; num4 -= 35f; break; case EconomyType.LR: num3 -= 20f; num4 -= 40f; break; case EconomyType.ALR: num3 += 30f; num4 += 60f; break; case EconomyType.VLQ: num3 -= 35f; num4 -= 70f; break; case EconomyType.SMEFT: num3 -= 25f; num4 -= 50f; break; case EconomyType.EFT: num3 -= 15f; num4 -= 30f; break; } num3 = Mathf.Clamp(num3, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); num4 = Mathf.Clamp(num4, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value); MinPercent = num3; MaxPercent = num4; Logger.LogInfo((object)($"[Economy] Picked vanilla event: {economy}, " + $"Range: {MinPercent}%–{MaxPercent}%")); if (PhotonNetwork.IsMasterClient) { object[] array = new object[5] { (int)economy, MinPercent, MaxPercent, ClientDeltaMin, ClientDeltaMax }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)179, (object)array, val, SendOptions.SendReliable); } } public static void ApplyChallengeEconomy(EconomyType economy) { ApplyVanillaEconomy(economy); } private static EconomyType GetRandomVanillaType() { List list = (from e in Enum.GetValues(typeof(EconomyType)).Cast().Skip(1) .ToList() where REPOConfig.EconomyEnables[$"Enable {e}"].Value where !ChallengeManager.IsChallengeRewardEconomy(e) || ChallengeManager.IsRewardEconomyUnlocked(e) where !LevelMilestoneRewardManager.IsRewardEconomy(e) || LevelMilestoneRewardManager.IsLevel100Unlocked() select e).ToList(); if (list.Count == 0) { Logger.LogWarning((object)"[Economy] No vanilla economies enabled, falling back to Stable."); return EconomyType.Stable; } while (list.Count > 0) { int index = REPOSeedManager.Range(0, list.Count); EconomyType economyType = list[index]; if (REPOBlackMarketManager.TryConsumeEconomyBlock(economyType.ToString(), economyType.ToString())) { Logger.LogInfo((object)$"[Economy] Black market prevented economy: {economyType}"); list.RemoveAt(index); continue; } return economyType; } Logger.LogWarning((object)"[Economy] All rolled vanilla economies were blocked, falling back to Stable."); return EconomyType.Stable; } private static string FirstNonEmpty(params string[] values) { if (values == null) { return string.Empty; } foreach (string text in values) { if (!string.IsNullOrWhiteSpace(text)) { return text; } } return string.Empty; } private static string FormatStatsEnglishLabel(string raw) { if (string.IsNullOrWhiteSpace(raw)) { return "Unknown"; } string text = raw.Replace('_', ' ').Trim(); StringBuilder stringBuilder = new StringBuilder(text.Length * 2); for (int i = 0; i < text.Length; i++) { char c = text[i]; bool flag = false; if (i > 0 && char.IsUpper(c)) { char c2 = text[i - 1]; bool num = char.IsLower(c2) || char.IsDigit(c2); bool flag2 = char.IsUpper(c2) && i + 1 < text.Length && char.IsLower(text[i + 1]); flag = num || flag2; } if (flag) { stringBuilder.Append(' '); } stringBuilder.Append(c); } return stringBuilder.ToString().Trim(); } private static void LogTotalMapValue() { if (REPOConfig.ShowTotalMapValue.Value) { float num = 0f; ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject obj in array) { num += (float)FI_current.GetValue(obj); } Logger.LogInfo((object)$"[REPOConomy] \ud83d\udcb0 Total value on map: ${Mathf.RoundToInt(num)}"); } } public static int GetCurrentLevel() { if (StatsManager.instance?.runStats != null && StatsManager.instance.runStats.ContainsKey("level")) { return StatsManager.instance.runStats["level"] + 1; } return 1; } public static string GetEconomyName(string forcedLanguage = null) { if (!HasEconomy) { return "Stability"; } string text = (string.IsNullOrWhiteSpace(forcedLanguage) ? REPOConfig.UILanguage.Value : forcedLanguage); if (CurrentCustomEconomy != null) { if (text == "Korean" && !string.IsNullOrWhiteSpace(CurrentCustomEconomy.name_ko)) { return CurrentCustomEconomy.name_ko; } if (text == "Russian" && !string.IsNullOrWhiteSpace(CurrentCustomEconomy.name_ru)) { return CurrentCustomEconomy.name_ru; } return CurrentCustomEconomy.name_en; } if (REPOConfig.EnableCustomEvents.Value) { CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData e) => e.id == CurrentCustomEconomy?.id); if (customEconomyData != null) { if (text == "Korean" && !string.IsNullOrWhiteSpace(customEconomyData.name_ko)) { return customEconomyData.name_ko; } if (text == "Russian" && !string.IsNullOrWhiteSpace(customEconomyData.name_ru)) { return customEconomyData.name_ru; } return customEconomyData.name_en; } } return CurrentEconomy switch { EconomyType.GlassBankDividend => "Glass Bank Dividend", EconomyType.PitContractInsurance => "Pit Contract Insurance", EconomyType.StormRunnerSurge => "Storm Runner Surge", EconomyType.SilentDebtEclipse => "Silent Debt Eclipse", EconomyType.CloneLotteryJackpot => "Clone Lottery Jackpot", EconomyType.MagnetShiftVortex => "Magnet Shift Vortex", EconomyType.LastInvoiceJudgement => "Last Invoice Judgement", EconomyType.CenturionMarket => "Centurion Market", EconomyType.Stable => (text == "Korean") ? "안정" : ((!(text == "Russian")) ? "Stability" : "Стабильность"), EconomyType.Deflation => (text == "Korean") ? "디플레이션" : ((!(text == "Russian")) ? "Deflation" : "Дефляция"), EconomyType.Inflation => (text == "Korean") ? "인플레이션" : ((!(text == "Russian")) ? "Inflation" : "Инфляция"), EconomyType.Chaos => (text == "Korean") ? "혼돈" : ((!(text == "Russian")) ? "Chaos" : "Хаос"), EconomyType.FreezeMarket => (text == "Korean") ? "시장 동결" : ((!(text == "Russian")) ? "Freeze Market" : "Заморозка"), EconomyType.BlackMarketSurge => (text == "Korean") ? "암시장 급등" : ((!(text == "Russian")) ? "Black Market Surge" : "Черный Рынок"), EconomyType.Overload => (text == "Korean") ? "과부하" : ((!(text == "Russian")) ? "Overload" : "Перегруз"), EconomyType.RareBoom => (text == "Korean") ? "희귀 붐" : ((!(text == "Russian")) ? "Rare Boom" : "Редкий бум"), EconomyType.CommonCrash => (text == "Korean") ? "일반 폭락" : ((!(text == "Russian")) ? "Common Crash" : "Обычный Краш"), EconomyType.LegendaryOnlyMatters => (text == "Korean") ? "전설만 가치있음" : ((!(text == "Russian")) ? "Legendary Only Matters" : "Только Легенды"), EconomyType.EchoMarket => (text == "Korean") ? "메아리 시장" : ((!(text == "Russian")) ? "Echo Market" : "Рынок Эха"), EconomyType.ReverseInflation => (text == "Korean") ? "역인플레이션" : ((!(text == "Russian")) ? "Reverse Inflation" : "Обратная Инфляция"), EconomyType.LuxuryHunt => (text == "Korean") ? "럭셔리 사냥" : ((!(text == "Russian")) ? "Luxury Hunt" : "Охота За Роскошью"), EconomyType.DumpsterDive => (text == "Korean") ? "쓰레기통 뒤지기" : ((!(text == "Russian")) ? "Dumpster Dive" : "Мусорная Находка"), EconomyType.ExtraProfit => (text == "Korean") ? "추가 이익" : ((!(text == "Russian")) ? "Extra Profit" : "Доп. Прибыль"), EconomyType.ScamSeason => (text == "Korean") ? "사기 시즌" : ((!(text == "Russian")) ? "Scam Season" : "Сезон Скама"), EconomyType.SuddenDrop => (text == "Korean") ? "급락" : ((!(text == "Russian")) ? "Sudden Drop" : "Резкое Падение"), EconomyType.TreasureRush => (text == "Korean") ? "보물 러시" : ((!(text == "Russian")) ? "Treasure Rush" : "Охота За Сокровищами"), EconomyType.ZeroGravity => (text == "Korean") ? "무중력" : ((!(text == "Russian")) ? "Zero Gravity" : "Невесомость Цен"), EconomyType.Turbulence => (text == "Korean") ? "난기류" : ((!(text == "Russian")) ? "Turbulence" : "Турбулентность"), EconomyType.BubbleBurst => (text == "Korean") ? "버블 붕괴" : ((!(text == "Russian")) ? "Bubble Burst" : "Лопнувший Пузырь"), EconomyType.CollectorsFrenzy => (text == "Korean") ? "수집가 열풍" : ((!(text == "Russian")) ? "Collectors Frenzy" : "Коллекционная Лихорадка"), EconomyType.PanicSale => (text == "Korean") ? "패닉 세일" : ((!(text == "Russian")) ? "Panic Sale" : "Паническая Распродажа"), EconomyType.EconomicTwister => (text == "Korean") ? "경제 회오리" : ((!(text == "Russian")) ? "Economic Twister" : "Экономический Твистер"), EconomyType.TaxAudit => (text == "Korean") ? "세무 조사" : ((!(text == "Russian")) ? "Tax Audit" : "Налоговая Проверка"), EconomyType.CrashAndBurn => (text == "Korean") ? "폭락과 소멸" : ((!(text == "Russian")) ? "Crash & Burn" : "Краш & Выгорание"), EconomyType.GoldenHour => (text == "Korean") ? "골든 아워" : ((!(text == "Russian")) ? "Golden Hour" : "Золотой Час"), EconomyType.CrystalBubble => (text == "Korean") ? "수정 버블" : ((!(text == "Russian")) ? "Crystal Bubble" : "Хрустальный Пузырь"), EconomyType.CoinDecay => (text == "Korean") ? "코인 부패" : ((!(text == "Russian")) ? "Coin Decay" : "Обесценивание"), EconomyType.EchoCrash => (text == "Korean") ? "메아리 폭락" : ((!(text == "Russian")) ? "Echo Crash" : "Эхо-Краш"), EconomyType.SpeculationBubble => (text == "Korean") ? "투기 버블" : ((!(text == "Russian")) ? "Speculation Bubble" : "Спекулятивный Пузырь"), EconomyType.ColdStorage => (text == "Korean") ? "냉동 보관" : ((!(text == "Russian")) ? "Cold Storage" : "Холодное Хранение"), EconomyType.PriceWhirlwind => (text == "Korean") ? "가격 회오리" : ((!(text == "Russian")) ? "Price Whirlwind" : "Ценовой Вихрь"), EconomyType.ExperimentalPricing => (text == "Korean") ? "실험적 가격" : ((!(text == "Russian")) ? "Experimental Pricing" : "Экспериментальные Цены"), EconomyType.ShadowMarket => (text == "Korean") ? "그림자 시장" : ((!(text == "Russian")) ? "Shadow Market" : "Теневой Рынок"), EconomyType.AuctionFever => (text == "Korean") ? "경매 열기" : ((!(text == "Russian")) ? "Auction Fever" : "Аукционная Лихорадка"), EconomyType.MemoryMarket => (text == "Korean") ? "기억 시장" : ((!(text == "Russian")) ? "Memory Market" : "Рынок Памяти"), EconomyType.LoopbackSpike => (text == "Korean") ? "루프백 스파이크" : ((!(text == "Russian")) ? "Loopback Spike" : "Петля Резонанса"), EconomyType.GlitchedGoldrush => (text == "Korean") ? "글리치 골드러시" : ((!(text == "Russian")) ? "Glitched Goldrush" : "Глитч Золотой Лихорадки"), EconomyType.MarketEclipse => (text == "Korean") ? "시장 일식" : ((!(text == "Russian")) ? "Market Eclipse" : "Экономическое затмение"), EconomyType.JackpotMirage => (text == "Korean") ? "잭팟 신기루" : ((!(text == "Russian")) ? "Jackpot Mirage" : "Мираж Джекпота"), EconomyType.CollectorsVoid => (text == "Korean") ? "수집가의 공허" : ((!(text == "Russian")) ? "Collector's Void" : "Пустота Коллекционеров"), EconomyType.VolatileExperiment => (text == "Korean") ? "불안정한 실험" : ((!(text == "Russian")) ? "Volatile Experiment" : "Экспериментальный Хаос"), EconomyType.CleanSweep => (text == "Korean") ? "클린 스윕" : ((!(text == "Russian")) ? "Clean Sweep" : "Чистая Полоса"), EconomyType.ValueVortex => (text == "Korean") ? "가치 소용돌이" : ((!(text == "Russian")) ? "Value Vortex" : "Вихрь Цен"), EconomyType.TemporalSurge => (text == "Korean") ? "시간 급등" : ((!(text == "Russian")) ? "Temporal Surge" : "Всплеск Времени"), EconomyType.EchoOfWealth => (text == "Korean") ? "부의 메아리" : ((!(text == "Russian")) ? "Echo of Wealth" : "Отголоски Богатства"), EconomyType.ArtifactBloat => (text == "Korean") ? "유물 팽창" : ((!(text == "Russian")) ? "Artifact Bloat" : "Артефактная Накрутка"), EconomyType.MarketDrain => (text == "Korean") ? "시장 유출" : ((!(text == "Russian")) ? "Market Drain" : "Слив Рынка"), EconomyType.InversionProtocol => (text == "Korean") ? "역전 프로토콜" : ((!(text == "Russian")) ? "Inversion Protocol" : "Протокол Инверсии"), EconomyType.SyntheticDemand => (text == "Korean") ? "합성 수요" : ((!(text == "Russian")) ? "Synthetic Demand" : "Синтетический Спрос"), EconomyType.TaxFrenzy => (text == "Korean") ? "세금 광란" : ((!(text == "Russian")) ? "Taxman's Frenzy" : "Налоговая лихорадка"), EconomyType.AssetDump => (text == "Korean") ? "자산 투매" : ((!(text == "Russian")) ? "Asset Dump" : "Слитые активы"), EconomyType.SmugglersSurge => (text == "Korean") ? "밀수꾼 급등" : ((!(text == "Russian")) ? "Smugglers Surge" : "Контрабандный всплеск"), EconomyType.CollectorsCraze => (text == "Korean") ? "수집가 열광" : ((!(text == "Russian")) ? "Collectors Craze" : "Коллекционный бум"), EconomyType.MarketKraken => (text == "Korean") ? "시장 크라켄" : ((!(text == "Russian")) ? "Market Kraken" : "Кракен на бирже"), EconomyType.MarketBoom => (text == "Korean") ? "시장 붐" : ((!(text == "Russian")) ? "Market Boom" : "Рынок Бум"), EconomyType.PriceLockdown => (text == "Korean") ? "가격 봉쇄" : ((!(text == "Russian")) ? "Price Lockdown" : "Ценовой Локдаун"), EconomyType.WildSpeculation => (text == "Korean") ? "광적인 투기" : ((!(text == "Russian")) ? "Wild Speculation" : "Безумная Спекуляция"), EconomyType.SilentAuction => (text == "Korean") ? "조용한 경매" : ((!(text == "Russian")) ? "Silent Auction" : "Тихий Аукцион"), EconomyType.FlashCrash => (text == "Korean") ? "플래시 크래시" : ((!(text == "Russian")) ? "Flash Crash" : "Молниеносный Краш"), EconomyType.CryptoSurge => (text == "Korean") ? "암호화폐 급등" : ((!(text == "Russian")) ? "Crypto Surge" : "КриптоПрорыв"), EconomyType.ResourceRush => (text == "Korean") ? "자원 러시" : ((!(text == "Russian")) ? "Resource Rush" : "Ресурсный Бум"), EconomyType.DemandSpike => (text == "Korean") ? "수요 급증" : ((!(text == "Russian")) ? "Demand Spike" : "Всплеск Спроса"), EconomyType.SupplyShortage => (text == "Korean") ? "공급 부족" : ((!(text == "Russian")) ? "Supply Shortage" : "Дефицит Предложений"), EconomyType.ConsumerConfidence => (text == "Korean") ? "소비자 신뢰" : ((!(text == "Russian")) ? "Consumer Confidence" : "Доверие Потребителей"), EconomyType.MarketMeltup => (text == "Korean") ? "시장 멜트업" : ((!(text == "Russian")) ? "Market Melt-up" : "Рыночный Взлет"), EconomyType.BargainHunt => (text == "Korean") ? "할인 사냥" : ((!(text == "Russian")) ? "Bargain Hunt" : "Охота за Скидками"), EconomyType.MarketRebound => (text == "Korean") ? "시장 반등" : ((!(text == "Russian")) ? "Market Rebound" : "Отскок Рынка"), EconomyType.PriceCascade => (text == "Korean") ? "가격 폭포" : ((!(text == "Russian")) ? "Price Cascade" : "Ценовой Каскад"), EconomyType.BullRun => (text == "Korean") ? "불마켓" : ((!(text == "Russian")) ? "Bull Run" : "Бычий Рывок"), EconomyType.BearTrap => (text == "Korean") ? "베어 트랩" : ((!(text == "Russian")) ? "Bear Trap" : "Медвежья Ловушка"), EconomyType.PanicBuying => (text == "Korean") ? "패닉 바잉" : ((!(text == "Russian")) ? "Panic Buying" : "Паническая Покупка"), EconomyType.SupplyGlut => (text == "Korean") ? "공급 과잉" : ((!(text == "Russian")) ? "Supply Glut" : "Избыток Предложений"), EconomyType.SpeculatorFrenzy => (text == "Korean") ? "투기꾼 열광" : ((!(text == "Russian")) ? "Speculator Frenzy" : "Бешенство Спекулянтов"), EconomyType.ValueStabilizer => (text == "Korean") ? "가치 안정기" : ((!(text == "Russian")) ? "Value Stabilizer" : "Стабилизатор Цен"), EconomyType.MarketMirroring => (text == "Korean") ? "시장 미러링" : ((!(text == "Russian")) ? "Market Mirroring" : "Зеркало Рынка"), EconomyType.InflationSpike => (text == "Korean") ? "인플레이션 급등" : ((!(text == "Russian")) ? "Inflation Spike" : "Всплеск Инфляции"), EconomyType.DeflationDip => (text == "Korean") ? "디플레이션 하락" : ((!(text == "Russian")) ? "Deflation Dip" : "Провал Дефляции"), EconomyType.EconomicEquilibrium => (text == "Korean") ? "경제 균형" : ((!(text == "Russian")) ? "Economic Equilibrium" : "Экономическое Равновесие"), EconomyType.PriceSurge => (text == "Korean") ? "가격 급등" : ((!(text == "Russian")) ? "Price Surge" : "Резкий Рост Цен"), EconomyType.BargainBlitz => (text == "Korean") ? "할인 블리츠" : ((!(text == "Russian")) ? "Bargain Blitz" : "Скидочный Блиц"), EconomyType.CollectorCarnival => (text == "Korean") ? "수집가 카니발" : ((!(text == "Russian")) ? "Collector Carnival" : "Карнавал Коллекционеров"), EconomyType.GhostPrices => (text == "Korean") ? "유령 가격" : ((!(text == "Russian")) ? "Ghost Prices" : "Призрачные Цены"), EconomyType.BarterBonanza => (text == "Korean") ? "물물교환 축제" : ((!(text == "Russian")) ? "Barter Bonanza" : "Бартёрное Безумие"), EconomyType.SeasonalShift => (text == "Korean") ? "시즌 변화" : ((!(text == "Russian")) ? "Seasonal Shift" : "Сезонный Сдвиг"), EconomyType.BlackoutSale => (text == "Korean") ? "블랙아웃 세일" : ((!(text == "Russian")) ? "Blackout Sale" : "Чёрная Распродажа"), EconomyType.InflationEbb => (text == "Korean") ? "인플레이션 퇴조" : ((!(text == "Russian")) ? "Inflation Ebb" : "Утихание Инфляции"), EconomyType.FoolsGold => (text == "Korean") ? "바보의 금" : ((!(text == "Russian")) ? "Fool's Gold" : "Дурачье Золото"), EconomyType.HoardersHavoc => (text == "Korean") ? "저장광 혼란" : ((!(text == "Russian")) ? "Hoarder's Havoc" : "Хаос Накопителей"), EconomyType.PennyPinch => (text == "Korean") ? "푼돈 아끼기" : ((!(text == "Russian")) ? "Penny Pinch" : "Щепотка Рублей"), EconomyType.Trendsetter => (text == "Korean") ? "트렌드세터" : ((!(text == "Russian")) ? "Trendsetter" : "Законодатель Трендов"), EconomyType.PriceSpike => (text == "Korean") ? "가격 스파이크" : ((!(text == "Russian")) ? "Price Spike" : "Ценовой всплеск"), EconomyType.Clearance => (text == "Korean") ? "정리 세일" : ((!(text == "Russian")) ? "Clearance" : "Ликвидация"), EconomyType.BoomerangMarket => (text == "Korean") ? "부메랑 시장" : ((!(text == "Russian")) ? "Boomerang Market" : "Бумеранг Рынка"), EconomyType.SilentDip => (text == "Korean") ? "조용한 하락" : ((!(text == "Russian")) ? "Silent Dip" : "Тихое падение"), EconomyType.LuxuryOnly => (text == "Korean") ? "럭셔리 온리" : ((!(text == "Russian")) ? "Luxury Only" : "Только Люкс"), EconomyType.EarlyBubble => (text == "Korean") ? "초기 버블" : ((!(text == "Russian")) ? "Early Bubble" : "Ранняя надутость"), EconomyType.LateDeflation => (text == "Korean") ? "후기 디플레이션" : ((!(text == "Russian")) ? "Late Deflation" : "Поздняя дефляция"), EconomyType.PriceSlalom => (text == "Korean") ? "가격 슬라롬" : ((!(text == "Russian")) ? "Price Slalom" : "Ценовой слалом"), EconomyType.FalseDemand => (text == "Korean") ? "가짜 수요" : ((!(text == "Russian")) ? "False Demand" : "Фальшивый спрос"), EconomyType.UndergroundTrade => (text == "Korean") ? "지하 거래" : ((!(text == "Russian")) ? "Underground Trade" : "Подпольная торговля"), EconomyType.CrystalCrash => (text == "Korean") ? "수정 폭락" : ((!(text == "Russian")) ? "Crystal Crash" : "Хрустальный краш"), EconomyType.GhostRush => (text == "Korean") ? "유령 러시" : ((!(text == "Russian")) ? "Ghost Rush" : "Призрачная гонка"), EconomyType.QuantumFlux => (text == "Korean") ? "양자 플럭스" : ((!(text == "Russian")) ? "Quantum Flux" : "Квантовый поток"), EconomyType.VoidMarket => (text == "Korean") ? "공허 시장" : ((!(text == "Russian")) ? "Void Market" : "Рынок пустоты"), EconomyType.CrystalCascade => (text == "Korean") ? "크리스탈 캐스케이드" : ((!(text == "Russian")) ? "Crystal Cascade" : "Хрустальный каскад"), EconomyType.ShadowInflation => (text == "Korean") ? "그림자 인플레이션" : ((!(text == "Russian")) ? "Shadow Inflation" : "Теневая инфляция"), EconomyType.PlasmaSurge => (text == "Korean") ? "플라즈마 서지" : ((!(text == "Russian")) ? "Plasma Surge" : "Плазменный всплеск"), EconomyType.EtherCrash => (text == "Korean") ? "에테르 크래시" : ((!(text == "Russian")) ? "Ether Crash" : "Эфирный крах"), EconomyType.MysticDeflation => (text == "Korean") ? "신비 디플레이션" : ((!(text == "Russian")) ? "Mystic Deflation" : "Мистическая дефляция"), EconomyType.ArcaneBubble => (text == "Korean") ? "신비 버블" : ((!(text == "Russian")) ? "Arcane Bubble" : "Таинственный пузырь"), EconomyType.SpectralBoom => (text == "Korean") ? "스펙트럴 붐" : ((!(text == "Russian")) ? "Spectral Boom" : "Спектральный бум"), EconomyType.PhantomDip => (text == "Korean") ? "팬텀 딥" : ((!(text == "Russian")) ? "Phantom Dip" : "Фантомное падение"), EconomyType.NebulaTwist => (text == "Korean") ? "네뷸라 트위스트" : ((!(text == "Russian")) ? "Nebula Twist" : "Туманность поворот"), EconomyType.StellarSurge => (text == "Korean") ? "스텔라 서지" : ((!(text == "Russian")) ? "Stellar Surge" : "Звездный всплеск"), EconomyType.CometCrash => (text == "Korean") ? "혜성 크래시" : ((!(text == "Russian")) ? "Comet Crash" : "Кометный крах"), EconomyType.AuroraBust => (text == "Korean") ? "오로라 버스트" : ((!(text == "Russian")) ? "Aurora Bust" : "Авроральный взрыв"), EconomyType.GalaxyGlitch => (text == "Korean") ? "갤럭시 글리치" : ((!(text == "Russian")) ? "Galaxy Glitch" : "Галактический глюк"), EconomyType.MeteorShower => (text == "Korean") ? "메테오 샤워" : ((!(text == "Russian")) ? "Meteor Shower" : "Метеоритный дождь"), EconomyType.EclipseEvent => (text == "Korean") ? "일식 이벤트" : ((!(text == "Russian")) ? "Eclipse Event" : "Солнечное затмение"), EconomyType.LunarEclipse => (text == "Korean") ? "월식" : ((!(text == "Russian")) ? "Lunar Eclipse" : "Лунное затмение"), EconomyType.SolarFlare => (text == "Korean") ? "태양 플레어" : ((!(text == "Russian")) ? "Solar Flare" : "Солнечная вспышка"), EconomyType.CosmicDust => (text == "Korean") ? "코스믹 더스트" : ((!(text == "Russian")) ? "Cosmic Dust" : "Космическая пыль"), EconomyType.BlackHole => (text == "Korean") ? "블랙홀" : ((!(text == "Russian")) ? "Black Hole" : "Черная дыра"), EconomyType.WhiteDwarf => (text == "Korean") ? "화이트 드워프" : ((!(text == "Russian")) ? "White Dwarf" : "Белый карлик"), EconomyType.RedGiant => (text == "Korean") ? "레드 자이언트" : ((!(text == "Russian")) ? "Red Giant" : "Красный гигант"), EconomyType.BlueSupergiant => (text == "Korean") ? "블루 슈퍼자이언트" : ((!(text == "Russian")) ? "Blue Supergiant" : "Синий сверхгигант"), EconomyType.NeutronStar => (text == "Korean") ? "중성자별" : ((!(text == "Russian")) ? "Neutron Star" : "Нейтронная звезда"), EconomyType.PulsarPulse => (text == "Korean") ? "펄서 펄스" : ((!(text == "Russian")) ? "Pulsar Pulse" : "Пульсарный импульс"), EconomyType.QuasarQuake => (text == "Korean") ? "퀘이사 퀘이크" : ((!(text == "Russian")) ? "Quasar Quake" : "Квазарное землетрясение"), EconomyType.Singularity => (text == "Korean") ? "특이점" : ((!(text == "Russian")) ? "Singularity" : "Сингулярность"), EconomyType.WarpDrive => (text == "Korean") ? "워프 드라이브" : ((!(text == "Russian")) ? "Warp Drive" : "Варп-двигатель"), EconomyType.TimeDilation => (text == "Korean") ? "시간 팽창" : ((!(text == "Russian")) ? "Time Dilation" : "Замедление времени"), EconomyType.SpaceTime => (text == "Korean") ? "시공간" : ((!(text == "Russian")) ? "Space-Time" : "Пространство-время"), EconomyType.DimensionalRift => (text == "Korean") ? "차원 균열" : ((!(text == "Russian")) ? "Dimensional Rift" : "Разлом измерений"), EconomyType.ParallelUniverse => (text == "Korean") ? "평행 우주" : ((!(text == "Russian")) ? "Parallel Universe" : "Параллельная вселенная"), EconomyType.QuantumEntanglement => (text == "Korean") ? "양자 얽힘" : ((!(text == "Russian")) ? "Quantum Entanglement" : "Квантовая запутанность"), EconomyType.WaveFunction => (text == "Korean") ? "파동 함수" : ((!(text == "Russian")) ? "Wave Function" : "Волновая функция"), EconomyType.ProbabilityCloud => (text == "Korean") ? "확률 구름" : ((!(text == "Russian")) ? "Probability Cloud" : "Облако вероятности"), EconomyType.UncertaintyPrinciple => (text == "Korean") ? "불확정성 원리" : ((!(text == "Russian")) ? "Uncertainty Principle" : "Принцип неопределенности"), EconomyType.ObserverEffect => (text == "Korean") ? "관찰자 효과" : ((!(text == "Russian")) ? "Observer Effect" : "Эффект наблюдателя"), EconomyType.Decoherence => (text == "Korean") ? "결맞음 붕괴" : ((!(text == "Russian")) ? "Decoherence" : "Декогеренция"), EconomyType.Superposition => (text == "Korean") ? "중첩" : ((!(text == "Russian")) ? "Superposition" : "Суперпозиция"), EconomyType.EntanglementSwap => (text == "Korean") ? "얽힘 교환" : ((!(text == "Russian")) ? "Entanglement Swap" : "Обмен запутанностью"), EconomyType.BellInequality => (text == "Korean") ? "벨 부등식" : ((!(text == "Russian")) ? "Bell Inequality" : "Неравенство Белла"), EconomyType.EPRParadox => (text == "Korean") ? "EPR 패러독스" : ((!(text == "Russian")) ? "EPR Paradox" : "Парадокс EPR"), EconomyType.ManyWorlds => (text == "Korean") ? "다중 세계" : ((!(text == "Russian")) ? "Many Worlds" : "Много миров"), EconomyType.Copenhagen => (text == "Korean") ? "코펜하겐" : ((!(text == "Russian")) ? "Copenhagen" : "Копенгагенская интерпретация"), EconomyType.Multiverse => (text == "Korean") ? "멀티버스" : ((!(text == "Russian")) ? "Multiverse" : "Мультивселенная"), EconomyType.StringTheory => (text == "Korean") ? "끈 이론" : ((!(text == "Russian")) ? "String Theory" : "Теория струн"), EconomyType.Membrane => (text == "Korean") ? "막" : ((!(text == "Russian")) ? "Membrane" : "Мембрана"), EconomyType.BraneWorld => (text == "Korean") ? "브레인 세계" : ((!(text == "Russian")) ? "Brane World" : "Брановый мир"), EconomyType.Holographic => (text == "Korean") ? "홀로그래픽" : ((!(text == "Russian")) ? "Holographic" : "Голографический принцип"), EconomyType.InformationParadox => (text == "Korean") ? "정보 패러독스" : ((!(text == "Russian")) ? "Information Paradox" : "Информационный парадокс"), EconomyType.Firewall => (text == "Korean") ? "방화벽" : ((!(text == "Russian")) ? "Firewall" : "Огненная стена"), EconomyType.EventHorizon => (text == "Korean") ? "사건 지평선" : ((!(text == "Russian")) ? "Event Horizon" : "Горизонт событий"), EconomyType.HawkingRadiation => (text == "Korean") ? "호킹 복사" : ((!(text == "Russian")) ? "Hawking Radiation" : "Излучение Хокинга"), EconomyType.UnruhEffect => (text == "Korean") ? "운ruh 효과" : ((!(text == "Russian")) ? "Unruh Effect" : "Эффект Унру"), EconomyType.CasimirForce => (text == "Korean") ? "카시미르 힘" : ((!(text == "Russian")) ? "Casimir Force" : "Сила Казимира"), EconomyType.VacuumEnergy => (text == "Korean") ? "진공 에너지" : ((!(text == "Russian")) ? "Vacuum Energy" : "Энергия вакуума"), EconomyType.DarkMatter => (text == "Korean") ? "암흑 물질" : ((!(text == "Russian")) ? "Dark Matter" : "Темная материя"), EconomyType.DarkEnergy => (text == "Korean") ? "암흑 에너지" : ((!(text == "Russian")) ? "Dark Energy" : "Темная энергия"), EconomyType.InflationField => (text == "Korean") ? "팽창장" : ((!(text == "Russian")) ? "Inflation Field" : "Поле инфляции"), EconomyType.HiggsField => (text == "Korean") ? "힉스장" : ((!(text == "Russian")) ? "Higgs Field" : "Поле Хиггса"), EconomyType.Graviton => (text == "Korean") ? "그라비톤" : ((!(text == "Russian")) ? "Graviton" : "Гравитон"), EconomyType.Tachyon => (text == "Korean") ? "타키온" : ((!(text == "Russian")) ? "Tachyon" : "Тахион"), EconomyType.WIMP => (text == "Korean") ? "WIMP" : ((!(text == "Russian")) ? "WIMP" : "WIMP"), EconomyType.Axion => (text == "Korean") ? "액시온" : ((!(text == "Russian")) ? "Axion" : "Аксион"), EconomyType.Neutrino => (text == "Korean") ? "뉴트리노" : ((!(text == "Russian")) ? "Neutrino" : "Нейтрино"), EconomyType.Muon => (text == "Korean") ? "뮤온" : ((!(text == "Russian")) ? "Muon" : "Мюон"), EconomyType.Tau => (text == "Korean") ? "타우" : ((!(text == "Russian")) ? "Tau" : "Таон"), EconomyType.Quark => (text == "Korean") ? "쿼크" : ((!(text == "Russian")) ? "Quark" : "Кварк"), EconomyType.Lepton => (text == "Korean") ? "렙톤" : ((!(text == "Russian")) ? "Lepton" : "Лептон"), EconomyType.Boson => (text == "Korean") ? "보존" : ((!(text == "Russian")) ? "Boson" : "Бозон"), EconomyType.Fermion => (text == "Korean") ? "페르미온" : ((!(text == "Russian")) ? "Fermion" : "Фермион"), EconomyType.Hadron => (text == "Korean") ? "강입자" : ((!(text == "Russian")) ? "Hadron" : "Адрон"), EconomyType.Meson => (text == "Korean") ? "메손" : ((!(text == "Russian")) ? "Meson" : "Мезон"), EconomyType.Baryon => (text == "Korean") ? "바리온" : ((!(text == "Russian")) ? "Baryon" : "Барион"), EconomyType.Photon => (text == "Korean") ? "광자" : ((!(text == "Russian")) ? "Photon" : "Фотон"), EconomyType.Gluon => (text == "Korean") ? "글루온" : ((!(text == "Russian")) ? "Gluon" : "Глюон"), EconomyType.W_Boson => (text == "Korean") ? "W 보존" : ((!(text == "Russian")) ? "W Boson" : "W-бозон"), EconomyType.Z_Boson => (text == "Korean") ? "Z 보존" : ((!(text == "Russian")) ? "Z Boson" : "Z-бозон"), EconomyType.HiggsBoson => (text == "Korean") ? "힉스 보존" : ((!(text == "Russian")) ? "Higgs Boson" : "Бозон Хиггса"), EconomyType.GravitonFlux => (text == "Korean") ? "그라비톤 플럭스" : ((!(text == "Russian")) ? "Graviton Flux" : "Поток гравитонов"), EconomyType.Chroniton => (text == "Korean") ? "크로니톤" : ((!(text == "Russian")) ? "Chroniton" : "Хронитон"), EconomyType.Dilaton => (text == "Korean") ? "딜라톤" : ((!(text == "Russian")) ? "Dilaton" : "Дилатон"), EconomyType.Axigluon => (text == "Korean") ? "액시글루온" : ((!(text == "Russian")) ? "Axigluon" : "Аксиглюон"), EconomyType.MagneticMonopole => (text == "Korean") ? "자기 단극" : ((!(text == "Russian")) ? "Magnetic Monopole" : "Магнитный монополь"), EconomyType.Instanton => (text == "Korean") ? "인스턴톤" : ((!(text == "Russian")) ? "Instanton" : "Инстантон"), EconomyType.Skyrmion => (text == "Korean") ? "스카이르미온" : ((!(text == "Russian")) ? "Skyrmion" : "Скайрмион"), EconomyType.Soliton => (text == "Korean") ? "솔리톤" : ((!(text == "Russian")) ? "Soliton" : "Солитон"), EconomyType.Vortex => (text == "Korean") ? "소용돌이" : ((!(text == "Russian")) ? "Vortex" : "Вихрь"), EconomyType.DomainWall => (text == "Korean") ? "도메인 벽" : ((!(text == "Russian")) ? "Domain Wall" : "Доменная стенка"), EconomyType.CosmicString => (text == "Korean") ? "코스믹 스트링" : ((!(text == "Russian")) ? "Cosmic String" : "Космическая струна"), EconomyType.Texture => (text == "Korean") ? "텍스처" : ((!(text == "Russian")) ? "Texture" : "Текстура"), EconomyType.Monopole => (text == "Korean") ? "단극" : ((!(text == "Russian")) ? "Monopole" : "Монополь"), EconomyType.GlobalString => (text == "Korean") ? "글로벌 스트링" : ((!(text == "Russian")) ? "Global String" : "Глобальная струна"), EconomyType.LocalString => (text == "Korean") ? "로컬 스트링" : ((!(text == "Russian")) ? "Local String" : "Локальная струна"), EconomyType.AxionString => (text == "Korean") ? "액시온 스트링" : ((!(text == "Russian")) ? "Axion String" : "Аксионная струна"), EconomyType.Superstring => (text == "Korean") ? "슈퍼스트링" : ((!(text == "Russian")) ? "Superstring" : "Суперструна"), EconomyType.Heterotic => (text == "Korean") ? "헤테로틱" : ((!(text == "Russian")) ? "Heterotic" : "Гетеротическая струна"), EconomyType.TypeI => (text == "Korean") ? "타입 I" : ((!(text == "Russian")) ? "Type I" : "Тип I"), EconomyType.TypeIIA => (text == "Korean") ? "타입 IIA" : ((!(text == "Russian")) ? "Type IIA" : "Тип IIA"), EconomyType.TypeIIB => (text == "Korean") ? "타입 IIB" : ((!(text == "Russian")) ? "Type IIB" : "Тип IIB"), EconomyType.HO => (text == "Korean") ? "HO" : ((!(text == "Russian")) ? "HO" : "HO"), EconomyType.E6 => (text == "Korean") ? "E6" : ((!(text == "Russian")) ? "E6" : "E6"), EconomyType.E7 => (text == "Korean") ? "E7" : ((!(text == "Russian")) ? "E7" : "E7"), EconomyType.E8 => (text == "Korean") ? "E8" : ((!(text == "Russian")) ? "E8" : "E8"), EconomyType.SU5 => (text == "Korean") ? "SU(5)" : ((!(text == "Russian")) ? "SU(5)" : "SU(5)"), EconomyType.SO10 => (text == "Korean") ? "SO(10)" : ((!(text == "Russian")) ? "SO(10)" : "SO(10)"), EconomyType.SUSY => (text == "Korean") ? "초대칭" : ((!(text == "Russian")) ? "SUSY" : "Суперсимметрия"), EconomyType.MSSM => (text == "Korean") ? "MSSM" : ((!(text == "Russian")) ? "MSSM" : "MSSM"), EconomyType.NMSSM => (text == "Korean") ? "NMSSM" : ((!(text == "Russian")) ? "NMSSM" : "NMSSM"), EconomyType.AMSB => (text == "Korean") ? "AMSB" : ((!(text == "Russian")) ? "AMSB" : "AMSB"), EconomyType.GMSB => (text == "Korean") ? "GMSB" : ((!(text == "Russian")) ? "GMSB" : "GMSB"), EconomyType.KKLT => (text == "Korean") ? "KKLT" : ((!(text == "Russian")) ? "KKLT" : "KKLT"), EconomyType.LVS => (text == "Korean") ? "LVS" : ((!(text == "Russian")) ? "LVS" : "LVS"), EconomyType.RS => (text == "Korean") ? "RS" : ((!(text == "Russian")) ? "RS" : "RS"), EconomyType.ADD => (text == "Korean") ? "ADD" : ((!(text == "Russian")) ? "ADD" : "ADD"), EconomyType.UED => (text == "Korean") ? "UED" : ((!(text == "Russian")) ? "UED" : "UED"), EconomyType.TC2 => (text == "Korean") ? "TC2" : ((!(text == "Russian")) ? "TC2" : "TC2"), EconomyType.LR => (text == "Korean") ? "LR" : ((!(text == "Russian")) ? "LR" : "LR"), EconomyType.ALR => (text == "Korean") ? "ALR" : ((!(text == "Russian")) ? "ALR" : "ALR"), EconomyType.VLQ => (text == "Korean") ? "VLQ" : ((!(text == "Russian")) ? "VLQ" : "VLQ"), EconomyType.SMEFT => (text == "Korean") ? "SMEFT" : ((!(text == "Russian")) ? "SMEFT" : "SMEFT"), EconomyType.EFT => (text == "Korean") ? "EFT" : ((!(text == "Russian")) ? "EFT" : "EFT"), _ => "???", }; } public static string GetEconomyFlavor(string forcedLanguage = null) { string text = (string.IsNullOrWhiteSpace(forcedLanguage) ? REPOConfig.UILanguage.Value : forcedLanguage); if (CurrentCustomEconomy != null) { if (text == "Korean" && !string.IsNullOrWhiteSpace(CurrentCustomEconomy.desc_ko)) { return CurrentCustomEconomy.desc_ko; } if (text == "Russian" && !string.IsNullOrWhiteSpace(CurrentCustomEconomy.desc_ru)) { return CurrentCustomEconomy.desc_ru; } return CurrentCustomEconomy.desc_en; } if (REPOConfig.EnableCustomEvents.Value) { CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData e) => e.id == CurrentCustomEconomy?.id); if (customEconomyData != null) { if (text == "Korean" && !string.IsNullOrWhiteSpace(customEconomyData.desc_ko)) { return customEconomyData.desc_ko; } if (text == "Russian" && !string.IsNullOrWhiteSpace(customEconomyData.desc_ru)) { return customEconomyData.desc_ru; } return customEconomyData.desc_en; } } return CurrentEconomy switch { EconomyType.GlassBankDividend => "Glass Bank mastery unlocks a high-profit market with fewer bad rolls.", EconomyType.PitContractInsurance => "Pit Contract mastery unlocks a steady hazard-pay economy.", EconomyType.StormRunnerSurge => "Storm Runner mastery unlocks a volatile fast-profit economy.", EconomyType.SilentDebtEclipse => "Silent Debt mastery unlocks a dark market with brutal lows and rare relief.", EconomyType.CloneLotteryJackpot => "Clone Lottery mastery unlocks a jackpot economy with extreme swings.", EconomyType.MagnetShiftVortex => "Magnet Shift mastery unlocks a vortex market that pulls prices upward.", EconomyType.LastInvoiceJudgement => "Last Invoice mastery unlocks a punishing final-contract economy.", EconomyType.CenturionMarket => "Level 100 mastery unlocks a prestige market with high guaranteed profit and huge upside.", EconomyType.Stable => (text == "Korean") ? "기본 경제" : ((!(text == "Russian")) ? "Economy by default" : "Экономика по умолчанию"), EconomyType.Deflation => (text == "Korean") ? "시장 붕괴" : ((!(text == "Russian")) ? "Market Crash" : "Краш рынка"), EconomyType.Inflation => (text == "Korean") ? "부자가 될 기회!" : ((!(text == "Russian")) ? "Moment to Get Rich!" : "Момент разбогатеть!"), EconomyType.Chaos => (text == "Korean") ? "금융 혼돈..." : ((!(text == "Russian")) ? "Financial chaos..." : "Финансовый хаос..."), EconomyType.FreezeMarket => (text == "Korean") ? "경제 동결 :(" : ((!(text == "Russian")) ? "Economy frozen :(" : "Экономика заморожена :("), EconomyType.BlackMarketSurge => (text == "Korean") ? "암시장에서 가격 급등..." : ((!(text == "Russian")) ? "Values have become more expensive..." : "Цены взлетели на черном рынке..."), EconomyType.Overload => (text == "Korean") ? "50/50" : ((!(text == "Russian")) ? "50/50" : "50/50"), EconomyType.RareBoom => (text == "Korean") ? "귀중품 가격 급등!" : ((!(text == "Russian")) ? "Values are suddenly in price!" : "Ценности резко подорожали!"), EconomyType.CommonCrash => (text == "Korean") ? "귀중품 가치 하락!" : ((!(text == "Russian")) ? "Values are devalued!" : "Ценности обесценились!"), EconomyType.LegendaryOnlyMatters => (text == "Korean") ? "최고만이 의미있음..." : ((!(text == "Russian")) ? "Only the best makes sense..." : "Ценятся только легенды..."), EconomyType.EchoMarket => (text == "Korean") ? "가격이 미친듯이 뛰어다님..." : ((!(text == "Russian")) ? "Prices are jumping like crazy..." : "Цены скачут как сумасшедшие..."), EconomyType.ReverseInflation => (text == "Korean") ? "예산이 부보다 낫다..." : ((!(text == "Russian")) ? "Budget is better than wealth..." : "Бюджет важнее богатства..."), EconomyType.LuxuryHunt => (text == "Korean") ? "모든 것이 더 비싸졌다!" : ((!(text == "Russian")) ? "Values are much more expensive!" : "Роскошь в моде! Всё подорожало"), EconomyType.DumpsterDive => (text == "Korean") ? "모든 것이 비싸졌다!" : ((!(text == "Russian")) ? "Everything has become expensive!" : "Даже мусор стал дорогим!"), EconomyType.ExtraProfit => (text == "Korean") ? "오늘 더 비싸게 팔 수 있다!" : ((!(text == "Russian")) ? "Today you can sell more profitably!" : "Сегодня можно продать выгоднее!"), EconomyType.ScamSeason => (text == "Korean") ? "가격 하락 중... :(" : ((!(text == "Russian")) ? "Prices are falling... :(" : "Цены падают... :("), EconomyType.SuddenDrop => (text == "Korean") ? "거의 모든 것이 가치 하락!" : ((!(text == "Russian")) ? "Almost everything has depreciated!" : "Почти всё обесценилось!"), EconomyType.TreasureRush => (text == "Korean") ? "모든 귀중품이 보물!" : ((!(text == "Russian")) ? "Every value is — treasure!" : "Каждая ценность — сокровище!"), EconomyType.ZeroGravity => (text == "Korean") ? "모든 것이 불안정..." : ((!(text == "Russian")) ? "Everything is unstable..." : "Цены нестабильны..."), EconomyType.Turbulence => (text == "Korean") ? "가격이 예측 불가능하게 움직임..." : ((!(text == "Russian")) ? "Prices behave unpredictably..." : "Цены ведут себя непредсказуемо..."), EconomyType.BubbleBurst => (text == "Korean") ? "시장이 호황이었는데... 아니었음" : ((!(text == "Russian")) ? "The market was booming... until it wasn't" : "Рынок рос... пока не лопнул"), EconomyType.CollectorsFrenzy => (text == "Korean") ? "모든 것이 제값보다 비쌈!" : ((!(text == "Russian")) ? "Everything is worth more than it should be" : "Всё ценится больше, чем должно!"), EconomyType.PanicSale => (text == "Korean") ? "플레이어들이 모든 것을 헐값에 판매!" : ((!(text == "Russian")) ? "Players are panic-selling everything for pennies!" : "Игроки распродают всё за копейки!"), EconomyType.EconomicTwister => (text == "Korean") ? "모든 아이템이 완전 랜덤 가치" : ((!(text == "Russian")) ? "Every item gets a completely random value" : "Каждая ценность получает случайную цену!"), EconomyType.TaxAudit => (text == "Korean") ? "세무국이 귀중품을 검토함" : ((!(text == "Russian")) ? "The Tax Department has reviewed your valuables" : "Налоговая проверила ваши ценности"), EconomyType.CrashAndBurn => (text == "Korean") ? "시장 붕괴 — 손실에 대비하라" : ((!(text == "Russian")) ? "The market is collapsing — brace for losses" : "Рынок рушится — готовьтесь к убыткам"), EconomyType.GoldenHour => (text == "Korean") ? "팔기 완벽한 시간!" : ((!(text == "Russian")) ? "A perfect time to sell — prices are booming!" : "Идеальное время для продажи!"), EconomyType.CrystalBubble => (text == "Korean") ? "시장 열광! 가격이 하늘 높이... 지금은" : ((!(text == "Russian")) ? "Market euphoria! Prices are sky-high… for now" : "Эйфория на рынке! Цены взлетели..."), EconomyType.CoinDecay => (text == "Korean") ? "모든 것이 무가치해 보임. 팔까 기다릴까?" : ((!(text == "Russian")) ? "Everything feels worthless. Time to sell or hold?" : "Всё кажется обесцененным. Продавать или ждать?"), EconomyType.EchoCrash => (text == "Korean") ? "잔여 충격파가 시장을 흔듦" : ((!(text == "Russian")) ? "Residual shockwaves shake the market unpredictably" : "Эхо-удары дестабилизируют рынок!"), EconomyType.SpeculationBubble => (text == "Korean") ? "가격이 이유 없이 상승... 버블이 언제든 터질 수 있음!" : ((!(text == "Russian")) ? "Prices are inflating without logic... Bubble may burst any time!" : "Цены растут без причин... Пузырь вот-вот лопнет!"), EconomyType.ColdStorage => (text == "Korean") ? "아무것도 잘 안 팔림. 가격이 시장가 이하로 동결" : ((!(text == "Russian")) ? "Nothing sells well. Prices are frozen under market value" : "Ничего не продаётся... Всё заморожено"), EconomyType.PriceWhirlwind => (text == "Korean") ? "불안정한 시장 급등이 가격을 회오리로!" : ((!(text == "Russian")) ? "An unstable market surge throws prices into a whirlwind!" : "Цены крутятся в вихре нестабильности!"), EconomyType.ExperimentalPricing => (text == "Korean") ? "시장 실험으로 가격이 격렬하게 변동" : ((!(text == "Russian")) ? "Prices fluctuate wildly due to market experiments" : "Цены нестабильны из-за рыночных экспериментов"), EconomyType.ShadowMarket => (text == "Korean") ? "비밀 시장이 대부분 귀중품의 가치를 뺌" : ((!(text == "Russian")) ? "A secret market drains value from most valuables" : "Теневой рынок обесценивает большинство ценностей"), EconomyType.AuctionFever => (text == "Korean") ? "입찰 전쟁이 가격을 천정까지!" : ((!(text == "Russian")) ? "A bidding war is driving prices through the roof!" : "Аукционы взвинтили цены до небес!"), EconomyType.MemoryMarket => (text == "Korean") ? "가격이 과거를 반영 — 하지만 변형이 있음" : ((!(text == "Russian")) ? "Prices mirror the past — but with a twist" : "Цены как в прошлом... но не совсем"), EconomyType.LoopbackSpike => (text == "Korean") ? "역사가 극단적 변동성으로 반복" : ((!(text == "Russian")) ? "History repeats with extreme volatility" : "История повторяется, но куда жёстче"), EconomyType.GlitchedGoldrush => (text == "Korean") ? "뭔가 고장났는데... 부자가 되고 있음" : ((!(text == "Russian")) ? "Something's broken… but you're getting rich" : "Что-то сломалось... но ты богатеешь"), EconomyType.MarketEclipse => (text == "Korean") ? "경제 정전... 거의 움직임 없음" : ((!(text == "Russian")) ? "An economic blackout... almost no movement" : "Экономическое затмение... всё стоит на месте"), EconomyType.JackpotMirage => (text == "Korean") ? "모든 것이 금처럼 보임... 일부는 바보의 금" : ((!(text == "Russian")) ? "Everything looks like gold... but some of it's fool's gold" : "Всё выглядит дорого... но ты уверен?"), EconomyType.CollectorsVoid => (text == "Korean") ? "모든 가치 상실 — 더 이상 수집품 없음" : ((!(text == "Russian")) ? "All value is lost — nothing is collectible anymore" : "Ценности исчезли... всё стало мусором"), EconomyType.VolatileExperiment => (text == "Korean") ? "위험한 경제 실험 — 혼돈이 지배" : ((!(text == "Russian")) ? "A dangerous economic experiment — chaos reigns" : "Экономический эксперимент... полный хаос"), EconomyType.CleanSweep => (text == "Korean") ? "평온한 시기 — 두려울 것도 얻을 것도 없음" : ((!(text == "Russian")) ? "A calm period — nothing to fear, nothing to gain" : "Затишье... почти ничего не изменилось"), EconomyType.ValueVortex => (text == "Korean") ? "소용돌이치는 가격 혼란 — 예측 불가능하고 격렬함" : ((!(text == "Russian")) ? "A swirling mess of prices — unpredictable and wild" : "Вихрь ценностей — всё непредсказуемо"), EconomyType.TemporalSurge => (text == "Korean") ? "가격이 시간 자체의 맥박과 함께 변화" : ((!(text == "Russian")) ? "Prices shift with a pulse of time itself" : "Цены колеблются с импульсом времени"), EconomyType.EchoOfWealth => (text == "Korean") ? "가격이 2레벨 전을 모방?" : ((!(text == "Russian")) ? "Prices mimic those from two levels ago?" : "Цены отражают прошлые уровни… с искажением?"), EconomyType.ArtifactBloat => (text == "Korean") ? "오래된 쓰레기가 이제 금!" : ((!(text == "Russian")) ? "Old junk is now gold!" : "Старый хлам внезапно стал ценным!"), EconomyType.MarketDrain => (text == "Korean") ? "모든 가격이 천천히 공허로 빠져나감" : ((!(text == "Russian")) ? "All prices slowly drain into the void" : "Цены медленно утекают в бездну"), EconomyType.InversionProtocol => (text == "Korean") ? "저가치가 고가치로. 고가치는 하락" : ((!(text == "Russian")) ? "Low-value becomes high-value. High-value drops" : "Низкая цена — высокая ценность, и наоборот"), EconomyType.SyntheticDemand => (text == "Korean") ? "인공 수요가 랜덤하게 급등" : ((!(text == "Russian")) ? "Artificial demand spikes at random" : "Искусственный спрос вызывает всплеск цен"), EconomyType.TaxFrenzy => (text == "Korean") ? "세율이 타격! 가격 급락" : ((!(text == "Russian")) ? "Tax rates hit hard! Prices plummet" : "Цены упали из-за налогов"), EconomyType.AssetDump => (text == "Korean") ? "모두가 자산을 투매 중!" : ((!(text == "Russian")) ? "Everyone's dumping assets!" : "Все сливают активы"), EconomyType.SmugglersSurge => (text == "Korean") ? "비싼 아이템 급등, 싼 것은 폭락" : ((!(text == "Russian")) ? "Expensive items skyrocket, cheap ones tank" : "Дорогие вещи рвутся в цене, остальное теряет смысл"), EconomyType.CollectorsCraze => (text == "Korean") ? "희귀 수집품 급등 — 나머지는 쓰레기" : ((!(text == "Russian")) ? "Rare collectibles soar — the rest is junk" : "Только редкие предметы в цене — остальное бесполезно"), EconomyType.MarketKraken => (text == "Korean") ? "시장이 미쳤다! 30%의 귀중품이 ×4 부스트!" : ((!(text == "Russian")) ? "The market goes wild! 30% of valuables get ×4 boost!" : "Биржа сошла с ума! 30% предметов получат *х4* цену!"), EconomyType.MarketBoom => (text == "Korean") ? "전체 시장에서 가격 급등!" : ((!(text == "Russian")) ? "Prices surge across the entire market!" : "Цены резко растут по всему рынку!"), EconomyType.PriceLockdown => (text == "Korean") ? "모든 가격이 법령으로 동결" : ((!(text == "Russian")) ? "All prices are frozen by decree" : "Правительство замораживает все цены..."), EconomyType.WildSpeculation => (text == "Korean") ? "투기꾼들이 가격을 격렬하게 올리고 내림!" : ((!(text == "Russian")) ? "Speculators drive prices wildly up and down!" : "Спекулянты творят хаос: всё летит вверх и вниз!"), EconomyType.SilentAuction => (text == "Korean") ? "경매가 조용히 진행, 가격 불명확" : ((!(text == "Russian")) ? "Auctions run in silence, prices unclear" : "Аукционы без торговцев — цены неопределённы"), EconomyType.FlashCrash => (text == "Korean") ? "자산 가치를 없애는 순간 폭락!" : ((!(text == "Russian")) ? "Instant crash wiping out asset values!" : "Мгновенное обрушение цен по всем активам!"), EconomyType.CryptoSurge => (text == "Korean") ? "암호화폐가 시장을 하늘까지!" : ((!(text == "Russian")) ? "Cryptocurrencies push the market sky-high!" : "Криптовалюты захлестнул рост!"), EconomyType.ResourceRush => (text == "Korean") ? "자원 부족이 가격 상승 유발" : ((!(text == "Russian")) ? "Resource scarcity drives prices up" : "Дефицит ресурсов: цены на всё растут"), EconomyType.DemandSpike => (text == "Korean") ? "폭발적 수요가 시장을 덮침!" : ((!(text == "Russian")) ? "Explosive demand floods the market!" : "Взрывной спрос на товары!"), EconomyType.SupplyShortage => (text == "Korean") ? "심각한 공급 부족이 가격을 망침" : ((!(text == "Russian")) ? "Severe supply shortages cripple prices" : "Серьёзный дефицит поставок"), EconomyType.ConsumerConfidence => (text == "Korean") ? "소비자들이 비합리적으로 자신만만!" : ((!(text == "Russian")) ? "Consumers irrationally confident!" : "Потребители необоснованно оптимистичны!"), EconomyType.MarketMeltup => (text == "Korean") ? "가격이 통제 불능으로 상승하는 멜트업!" : ((!(text == "Russian")) ? "A melt-up as prices climb uncontrollably!" : "Цены тают вверх: никто не может остановиться"), EconomyType.BargainHunt => (text == "Korean") ? "할인 사냥—일부는 폭락, 다른 것은 급등" : ((!(text == "Russian")) ? "Hunting bargains—some crash, others spike" : "Ищем редкие скидки: одни вещи падают, другие растут"), EconomyType.MarketRebound => (text == "Korean") ? "폭락 후 시장이 빠르게 반등!" : ((!(text == "Russian")) ? "After a crash, the market swiftly rebounds!" : "После обрушения рынок быстро возвращается к росту!"), EconomyType.PriceCascade => (text == "Korean") ? "가격이 폭포처럼 하락, 하지만 반등할 수도" : ((!(text == "Russian")) ? "Prices cascade downward, but may bounce back" : "Цены обваливаются каскадом, но могут отскочить"), EconomyType.BullRun => (text == "Korean") ? "불마켓—가격이 하늘로!" : ((!(text == "Russian")) ? "A bull run—prices charge skyward!" : "Бычий рынок: цены мчатся наверх!"), EconomyType.BearTrap => (text == "Korean") ? "베어 트랩—하락 전 잠깐의 상승…" : ((!(text == "Russian")) ? "A bear trap—brief gains before a fall…" : "Медвежья ловушка: временный рост перед падением…"), EconomyType.PanicBuying => (text == "Korean") ? "플레이어들이 패닉 구매—재고 소진!" : ((!(text == "Russian")) ? "Players panic-buy—supplies vanish!" : "Игроки скупают всё подряд—запасы тают!"), EconomyType.SupplyGlut => (text == "Korean") ? "과잉 공급—가격이 과잉으로 하락" : ((!(text == "Russian")) ? "Oversupply—prices sink under glut" : "Перепроизводство: цены тонут из-за избытка"), EconomyType.SpeculatorFrenzy => (text == "Korean") ? "투기꾼들이 가격을 극단적으로!" : ((!(text == "Russian")) ? "Speculators push prices to chaotic extremes!" : "Спекулянты безудержно качают цены—хаос!"), EconomyType.ValueStabilizer => (text == "Korean") ? "규제 조치로 가격 통제" : ((!(text == "Russian")) ? "Regulatory measures keep prices in check" : "Регуляторные меры удерживают цены в узких рамках"), EconomyType.MarketMirroring => (text == "Korean") ? "시장이 이전 레벨을 반영" : ((!(text == "Russian")) ? "The market mirrors its previous level" : "Рынок повторяет своё предыдущее состояние"), EconomyType.InflationSpike => (text == "Korean") ? "갑작스러운 인플레이션 급등!" : ((!(text == "Russian")) ? "A sudden spike in inflation!" : "Кратковременный скачок инфляции!"), EconomyType.DeflationDip => (text == "Korean") ? "가격이 디플레이션 구덩이로 급락" : ((!(text == "Russian")) ? "Prices plunge into a deflationary dip" : "Резкое провал цен в дефляционную яму"), EconomyType.EconomicEquilibrium => (text == "Korean") ? "수요와 공급의 완벽한 균형" : ((!(text == "Russian")) ? "A perfect balance of supply and demand" : "Баланс между спросом и предложением—стабильность"), EconomyType.PriceSurge => (text == "Korean") ? "갑작스러운 가격 급등—모든 것이 20–40% 점프!" : ((!(text == "Russian")) ? "Sudden price surge—everything jumps 20–40%!" : "Внезапный взлёт цен: все товары подорожали на 20–40%!"), EconomyType.BargainBlitz => (text == "Korean") ? "플래시 할인—가격이 30–10% 즉시 하락!" : ((!(text == "Russian")) ? "Flash discounts—prices drop 30–10% instantly!" : "Молниеносные скидки: всё дешевеет на 30–10%!"), EconomyType.CollectorCarnival => (text == "Korean") ? "수집품 ×2, 나머지 −10%" : ((!(text == "Russian")) ? "Collectibles ×2, others −10%" : "Коллекционные редкости ×2, остальные −10%"), EconomyType.GhostPrices => (text == "Korean") ? "유령 가격—랜덤 오프셋 ±25%" : ((!(text == "Russian")) ? "Ghostly prices—random offset ±25%" : "Цены скачут 'призрачно': разброс −25…+25%"), EconomyType.BarterBonanza => (text == "Korean") ? "물물교환 축제—저가 하락, 고가 상승" : ((!(text == "Russian")) ? "Barter bonanza—low items down, high items up" : "Бартер в моде: дешёвые падают, дорогие растут"), EconomyType.SeasonalShift => (text == "Korean") ? "시즌 변화—최소 +15%, 최대 −5%" : ((!(text == "Russian")) ? "Seasonal shift—min +15%, max −5%" : "Сезонная коррекция: +15% к низким, −5% к высоким ценам"), EconomyType.BlackoutSale => (text == "Korean") ? "블랙아웃 세일—가격 −50…−30% 삭감" : ((!(text == "Russian")) ? "Blackout sale—prices slashed −50…−30%" : "Чёрная распродажа: всё обесценивается −50…−30%"), EconomyType.InflationEbb => (text == "Korean") ? "인플레이션 퇴조—가격 10–20% 하락" : ((!(text == "Russian")) ? "Inflation ebb—prices fall 10–20%" : "Инфляция утихла: все цены снижаются на 10–20%"), EconomyType.FoolsGold => (text == "Korean") ? "바보의 금—일부 +50%, 나머지 −10%" : ((!(text == "Russian")) ? "Fool's Gold—some +50%, others −10%" : "Невнятный бум: часть товаров +50%, остальные −10%"), EconomyType.HoardersHavoc => (text == "Korean") ? "저장광 혼란—싼 것 −40%, 비싼 것 +10%" : ((!(text == "Russian")) ? "Hoarder's Havoc—cheap −40%, expensive +10%" : "Накопители скупают всё: дешёвые −40%, дорогие +10%"), EconomyType.PennyPinch => (text == "Korean") ? "푼돈 아끼기—가격 −60…−40% 하락" : ((!(text == "Russian")) ? "Penny Pinch—prices slump −60…−40%" : "Жёсткое удешевление: все цены −60…−40%"), EconomyType.Trendsetter => (text == "Korean") ? "트렌드세터—프리미엄 아이템 +30…+60% 급등!" : ((!(text == "Russian")) ? "Trendsetter—premium items surge +30…+60%!" : "Топовые товары дорожают: +30…+60%!"), EconomyType.PriceSpike => (text == "Korean") ? "가격이 전반적으로 갑자기 급등!" : ((!(text == "Russian")) ? "Prices suddenly spike across the board!" : "Цены внезапно подскакивают!"), EconomyType.Clearance => (text == "Korean") ? "대량 정리로 곳곳에서 가치 하락!" : ((!(text == "Russian")) ? "Massive clearance cuts values everywhere!" : "Обвальная распродажа: всё падает в цене!"), EconomyType.BoomerangMarket => (text == "Korean") ? "가치가 돌아옴—하지만 예측 불가능!" : ((!(text == "Russian")) ? "Values swing back—but unpredictably!" : "Цены возвращаются — но не туда!"), EconomyType.SilentDip => (text == "Korean") ? "조용한 하락... 아무것도 잘 안 팔림" : ((!(text == "Russian")) ? "Quiet dip... nothing sells well" : "Незаметный спад..."), EconomyType.LuxuryOnly => (text == "Korean") ? "이제 럭셔리 아이템만 가치 있음" : ((!(text == "Russian")) ? "Only luxury items hold value now" : "Ценятся только предметы класса люкс"), EconomyType.EarlyBubble => (text == "Korean") ? "버블이 일찍 형성—붐에 대비" : ((!(text == "Russian")) ? "A bubble forms early—brace for boom" : "Рынок перегрет с самого начала!"), EconomyType.LateDeflation => (text == "Korean") ? "후기 디플레이션이 시장을 빼앗음" : ((!(text == "Russian")) ? "Late-stage deflation drains the market" : "Цены падают ближе к концу..."), EconomyType.PriceSlalom => (text == "Korean") ? "오르내림의 슬라롬" : ((!(text == "Russian")) ? "A slalom of ups and downs" : "Рынок скользит как на лыжах"), EconomyType.FalseDemand => (text == "Korean") ? "인공 수요가 가격을 부풀림!" : ((!(text == "Russian")) ? "Artificial demand inflates prices!" : "Спекулятивный всплеск спроса!"), EconomyType.UndergroundTrade => (text == "Korean") ? "거래가 그림자 속에서 계속됨" : ((!(text == "Russian")) ? "Trade continues in the shadows" : "Ценности утекли в тень..."), EconomyType.CrystalCrash => (text == "Korean") ? "버블이 수정 폭락으로 산산조각" : ((!(text == "Russian")) ? "The bubble shatters into a crystal crash" : "Пузырь лопнул — рынок в стеклах"), EconomyType.GhostRush => (text == "Korean") ? "유령 가치 러시가 시장을 휩쓸음!" : ((!(text == "Russian")) ? "Phantom value rushes sweep the market!" : "Цены словно мертвые души — летают вверх!"), EconomyType.QuantumFlux => (text == "Korean") ? "양자 플럭스가 가격을 뒤흔듭니다..." : ((!(text == "Russian")) ? "Quantum flux shakes up prices..." : "Квантовый поток сотрясает цены..."), EconomyType.VoidMarket => (text == "Korean") ? "공허한 시장이 모든 것을 삼킵니다..." : ((!(text == "Russian")) ? "Void market devours everything..." : "Пустой рынок поглощает все..."), EconomyType.CrystalCascade => (text == "Korean") ? "크리스탈 같은 가격 폭포가 쏟아집니다!" : ((!(text == "Russian")) ? "Crystal cascade of prices pours down!" : "Хрустальный каскад цен обрушивается!"), EconomyType.ShadowInflation => (text == "Korean") ? "그림자 인플레이션이 은밀하게 퍼집니다..." : ((!(text == "Russian")) ? "Shadow inflation creeps in silently..." : "Теневая инфляция тихо распространяется..."), EconomyType.PlasmaSurge => (text == "Korean") ? "플라즈마 서지가 시장을 불태웁니다!" : ((!(text == "Russian")) ? "Plasma surge burns through the market!" : "Плазменный всплеск сжигает рынок!"), EconomyType.EtherCrash => (text == "Korean") ? "에테르 크래시가 모든 것을 무너뜨립니다..." : ((!(text == "Russian")) ? "Ether crash brings everything down..." : "Эфирный крах рушит все..."), EconomyType.MysticDeflation => (text == "Korean") ? "신비한 디플레이션이 가격을 끌어내립니다..." : ((!(text == "Russian")) ? "Mystic deflation pulls prices down..." : "Мистическая дефляция тянет цены вниз..."), EconomyType.ArcaneBubble => (text == "Korean") ? "신비한 버블이 부풀어 오릅니다..." : ((!(text == "Russian")) ? "Arcane bubble inflates..." : "Таинственный пузырь надувается..."), EconomyType.SpectralBoom => (text == "Korean") ? "스펙트럴 붐이 시장을 뒤흔듭니다!" : ((!(text == "Russian")) ? "Spectral boom shakes the market!" : "Спектральный бум сотрясает рынок!"), EconomyType.PhantomDip => (text == "Korean") ? "팬텀 딥이 가격을 끌어내립니다..." : ((!(text == "Russian")) ? "Phantom dip pulls prices down..." : "Фантомное падение тянет цены вниз..."), EconomyType.NebulaTwist => (text == "Korean") ? "네뷸라 트위스트가 모든 것을 뒤흔듭니다..." : ((!(text == "Russian")) ? "Nebula twist turns everything around..." : "Туманность поворачивает все..."), EconomyType.StellarSurge => (text == "Korean") ? "스텔라 서지가 별처럼 빛납니다!" : ((!(text == "Russian")) ? "Stellar surge shines like a star!" : "Звездный всплеск сияет как звезда!"), EconomyType.CometCrash => (text == "Korean") ? "혜성 크래시가 모든 것을 파괴합니다..." : ((!(text == "Russian")) ? "Comet crash destroys everything..." : "Кометный крах разрушает все..."), EconomyType.AuroraBust => (text == "Korean") ? "오로라 버스트가 북극광처럼 터집니다..." : ((!(text == "Russian")) ? "Aurora bust bursts like northern lights..." : "Авроральный взрыв вспыхивает как северное сияние..."), EconomyType.GalaxyGlitch => (text == "Korean") ? "갤럭시 글리치가 우주를 뒤흔듭니다..." : ((!(text == "Russian")) ? "Galaxy glitch shakes the cosmos..." : "Галактический глюк сотрясает вселенную..."), EconomyType.MeteorShower => (text == "Korean") ? "메테오 샤워가 별똥별처럼 쏟아집니다!" : ((!(text == "Russian")) ? "Meteor shower rains like shooting stars!" : "Метеоритный дождь льется как звездный дождь!"), EconomyType.EclipseEvent => (text == "Korean") ? "일식 이벤트가 모든 것을 가립니다..." : ((!(text == "Russian")) ? "Eclipse event covers everything..." : "Солнечное затмение скрывает все..."), EconomyType.LunarEclipse => (text == "Korean") ? "월식으로 가격이 어두워집니다..." : ((!(text == "Russian")) ? "Lunar eclipse darkens prices..." : "Лунное затмение затемняет цены..."), EconomyType.SolarFlare => (text == "Korean") ? "태양 플레어가 시장을 태웁니다!" : ((!(text == "Russian")) ? "Solar flare burns the market!" : "Солнечная вспышка жжет рынок!"), EconomyType.CosmicDust => (text == "Korean") ? "코스믹 더스트가 모든 것을 뒤덮습니다..." : ((!(text == "Russian")) ? "Cosmic dust covers everything..." : "Космическая пыль покрывает все..."), EconomyType.BlackHole => (text == "Korean") ? "블랙홀이 모든 것을 삼킵니다..." : ((!(text == "Russian")) ? "Black hole devours everything..." : "Черная дыра поглощает все..."), EconomyType.WhiteDwarf => (text == "Korean") ? "화이트 드워프가 차갑게 식습니다..." : ((!(text == "Russian")) ? "White dwarf cools coldly..." : "Белый карлик холодно остывает..."), EconomyType.RedGiant => (text == "Korean") ? "레드 자이언트가 거대하게 부풀어 오릅니다!" : ((!(text == "Russian")) ? "Red giant swells enormously!" : "Красный гигант огромно раздувается!"), EconomyType.BlueSupergiant => (text == "Korean") ? "블루 슈퍼자이언트가 초거대하게 빛납니다!" : ((!(text == "Russian")) ? "Blue supergiant shines super-hugely!" : "Синий сверхгигант сверхогромно сияет!"), EconomyType.NeutronStar => (text == "Korean") ? "중성자별이 밀도를 압축합니다..." : ((!(text == "Russian")) ? "Neutron star compresses density..." : "Нейтронная звезда сжимает плотность..."), EconomyType.PulsarPulse => (text == "Korean") ? "펄서 펄스가 리듬을 타며 가격을 뒤흔듭니다..." : ((!(text == "Russian")) ? "Pulsar pulse rhythmically shakes prices..." : "Пульсарный импульс ритмично сотрясает цены..."), EconomyType.QuasarQuake => (text == "Korean") ? "퀘이사 퀘이크가 우주를 진동시킵니다!" : ((!(text == "Russian")) ? "Quasar quake vibrates the universe!" : "Квазарное землетрясение вибрирует вселенной!"), EconomyType.Singularity => (text == "Korean") ? "특이점이 모든 법칙을 깨뜨립니다..." : ((!(text == "Russian")) ? "Singularity breaks all laws..." : "Сингулярность ломает все законы..."), EconomyType.WarpDrive => (text == "Korean") ? "워프 드라이브가 초광속으로 날아갑니다!" : ((!(text == "Russian")) ? "Warp drive flies at superluminal speed!" : "Варп-двигатель улетает со сверхсветовой скоростью!"), EconomyType.TimeDilation => (text == "Korean") ? "시간 팽창으로 모든 것이 느려집니다..." : ((!(text == "Russian")) ? "Time dilation slows everything..." : "Замедление времени замедляет все..."), EconomyType.SpaceTime => (text == "Korean") ? "시공간이 뒤틀리며 가격을 왜곡합니다..." : ((!(text == "Russian")) ? "Space-time warps and distorts prices..." : "Пространство-время искривляется и искажает цены..."), EconomyType.DimensionalRift => (text == "Korean") ? "차원 균열이 다른 차원을 열어냅니다..." : ((!(text == "Russian")) ? "Dimensional rift opens other dimensions..." : "Разлом измерений открывает другие измерения..."), EconomyType.ParallelUniverse => (text == "Korean") ? "평행 우주가 충돌하며 혼란을 일으킵니다..." : ((!(text == "Russian")) ? "Parallel universe collides causing chaos..." : "Параллельная вселенная сталкивается и вызывает хаос..."), EconomyType.QuantumEntanglement => (text == "Korean") ? "양자 얽힘이 가격을 연결합니다..." : ((!(text == "Russian")) ? "Quantum entanglement links prices..." : "Квантовая запутанность связывает цены..."), EconomyType.WaveFunction => (text == "Korean") ? "파동 함수가 가격을 확산시킵니다..." : ((!(text == "Russian")) ? "Wave function propagates prices..." : "Волновая функция распространяет цены..."), EconomyType.ProbabilityCloud => (text == "Korean") ? "확률 구름이 불확실성을 가져옵니다..." : ((!(text == "Russian")) ? "Probability cloud brings uncertainty..." : "Облако вероятности приносит неопределенность..."), EconomyType.UncertaintyPrinciple => (text == "Korean") ? "불확정성 원리가 가격을 불안정하게 만듭니다..." : ((!(text == "Russian")) ? "Uncertainty principle destabilizes prices..." : "Принцип неопределенности дестабилизирует цены..."), EconomyType.ObserverEffect => (text == "Korean") ? "관찰자 효과가 가격을 바꿉니다..." : ((!(text == "Russian")) ? "Observer effect changes prices..." : "Эффект наблюдателя меняет цены..."), EconomyType.Decoherence => (text == "Korean") ? "결맞음 붕괴가 현실을 깨뜨립니다..." : ((!(text == "Russian")) ? "Decoherence breaks reality..." : "Декогеренция ломает реальность..."), EconomyType.Superposition => (text == "Korean") ? "중첩으로 모든 가능성이 존재합니다..." : ((!(text == "Russian")) ? "Superposition allows all possibilities..." : "Суперпозиция позволяет всем возможностям существовать..."), EconomyType.EntanglementSwap => (text == "Korean") ? "얽힘 교환이 가격을 뒤바꿉니다..." : ((!(text == "Russian")) ? "Entanglement swap switches prices..." : "Обмен запутанностью меняет цены местами..."), EconomyType.BellInequality => (text == "Korean") ? "벨 부등식이 양자 현실을 증명합니다..." : ((!(text == "Russian")) ? "Bell inequality proves quantum reality..." : "Неравенство Белла доказывает квантовую реальность..."), EconomyType.EPRParadox => (text == "Korean") ? "EPR 패러독스가 양자 미스터리를 드러냅니다..." : ((!(text == "Russian")) ? "EPR paradox reveals quantum mysteries..." : "Парадокс EPR раскрывает квантовые тайны..."), EconomyType.ManyWorlds => (text == "Korean") ? "다중 세계가 모든 가능성을 열어냅니다..." : ((!(text == "Russian")) ? "Many worlds opens all possibilities..." : "Много миров открывает все возможности..."), EconomyType.Copenhagen => (text == "Korean") ? "코펜하겐 해석이 현실을 정의합니다..." : ((!(text == "Russian")) ? "Copenhagen interpretation defines reality..." : "Копенгагенская интерпретация определяет реальность..."), EconomyType.Multiverse => (text == "Korean") ? "멀티버스가 무한한 가능성을 가져옵니다..." : ((!(text == "Russian")) ? "Multiverse brings infinite possibilities..." : "Мультивселенная приносит бесконечные возможности..."), EconomyType.StringTheory => (text == "Korean") ? "끈 이론이 우주를 연결합니다..." : ((!(text == "Russian")) ? "String theory connects the universe..." : "Теория струн соединяет вселенную..."), EconomyType.Membrane => (text == "Korean") ? "막 이론이 차원을 분리합니다..." : ((!(text == "Russian")) ? "Membrane theory separates dimensions..." : "Теория мембран разделяет измерения..."), EconomyType.BraneWorld => (text == "Korean") ? "브레인 세계가 새로운 현실을 만듭니다..." : ((!(text == "Russian")) ? "Brane world creates new reality..." : "Брановый мир создает новую реальность..."), EconomyType.Holographic => (text == "Korean") ? "홀로그래픽 원리가 정보를 저장합니다..." : ((!(text == "Russian")) ? "Holographic principle stores information..." : "Голографический принцип хранит информацию..."), EconomyType.InformationParadox => (text == "Korean") ? "정보 패러독스가 블랙홀을 괴롭힙니다..." : ((!(text == "Russian")) ? "Information paradox torments black hole..." : "Информационный парадокс мучает черную дыру..."), EconomyType.Firewall => (text == "Korean") ? "방화벽이 사건 지평선을 보호합니다..." : ((!(text == "Russian")) ? "Firewall protects event horizon..." : "Огненная стена защищает горизонт событий..."), EconomyType.EventHorizon => (text == "Korean") ? "사건 지평선 너머는 아무것도 없습니다..." : ((!(text == "Russian")) ? "Beyond event horizon there's nothing..." : "За горизонтом событий ничего нет..."), EconomyType.HawkingRadiation => (text == "Korean") ? "호킹 복사가 블랙홀을 증발시킵니다..." : ((!(text == "Russian")) ? "Hawking radiation evaporates black hole..." : "Излучение Хокинга испаряет черную дыру..."), EconomyType.UnruhEffect => (text == "Korean") ? "운ruh 효과가 가속을 감지합니다..." : ((!(text == "Russian")) ? "Unruh effect detects acceleration..." : "Эффект Унру обнаруживает ускорение..."), EconomyType.CasimirForce => (text == "Korean") ? "카시미르 힘이 진공을 끌어당깁니다..." : ((!(text == "Russian")) ? "Casimir force attracts vacuum..." : "Сила Казимира притягивает вакуум..."), EconomyType.VacuumEnergy => (text == "Korean") ? "진공 에너지가 우주를 밀어냅니다..." : ((!(text == "Russian")) ? "Vacuum energy pushes the universe..." : "Энергия вакуума толкает вселенную..."), EconomyType.DarkMatter => (text == "Korean") ? "암흑 물질이 은밀하게 영향을 미칩니다..." : ((!(text == "Russian")) ? "Dark matter secretly influences..." : "Темная материя тайно влияет..."), EconomyType.DarkEnergy => (text == "Korean") ? "암흑 에너지가 우주를 가속시킵니다..." : ((!(text == "Russian")) ? "Dark energy accelerates the universe..." : "Темная энергия ускоряет вселенную..."), EconomyType.InflationField => (text == "Korean") ? "팽창장이 빅뱅을 일으킵니다..." : ((!(text == "Russian")) ? "Inflation field causes big bang..." : "Поле инфляции вызывает большой взрыв..."), EconomyType.HiggsField => (text == "Korean") ? "힉스장이 질량을 줍니다..." : ((!(text == "Russian")) ? "Higgs field gives mass..." : "Поле Хиггса дает массу..."), EconomyType.Graviton => (text == "Korean") ? "그라비톤이 중력을 전달합니다..." : ((!(text == "Russian")) ? "Graviton transmits gravity..." : "Гравитон передает гравитацию..."), EconomyType.Tachyon => (text == "Korean") ? "타키온이 빛보다 빠릅니다..." : ((!(text == "Russian")) ? "Tachyon is faster than light..." : "Тахион быстрее света..."), EconomyType.WIMP => (text == "Korean") ? "WIMP가 암흑 물질의 후보입니다..." : ((!(text == "Russian")) ? "WIMP is dark matter candidate..." : "WIMP — кандидат в темную материю..."), EconomyType.Axion => (text == "Korean") ? "액시온이 강한 CP 문제를 해결합니다..." : ((!(text == "Russian")) ? "Axion solves strong CP problem..." : "Аксион решает проблему сильного CP..."), EconomyType.Neutrino => (text == "Korean") ? "뉴트리노가 거의 없는 질량을 가집니다..." : ((!(text == "Russian")) ? "Neutrino has almost zero mass..." : "Нейтрино имеет почти нулевую массу..."), EconomyType.Muon => (text == "Korean") ? "뮤온이 전자의 무거운 사촌입니다..." : ((!(text == "Russian")) ? "Muon is electron's heavy cousin..." : "Мюон — тяжелый родственник электрона..."), EconomyType.Tau => (text == "Korean") ? "타우가 가장 무거운 렙톤입니다..." : ((!(text == "Russian")) ? "Tau is the heaviest lepton..." : "Таон — самый тяжелый лептон..."), EconomyType.Quark => (text == "Korean") ? "쿼크가 강입자의 구성 요소입니다..." : ((!(text == "Russian")) ? "Quark is building block of hadrons..." : "Кварк — строительный блок адронов..."), EconomyType.Lepton => (text == "Korean") ? "렙톤이 약한 상호작용에 참여합니다..." : ((!(text == "Russian")) ? "Lepton participates in weak interaction..." : "Лептон участвует в слабом взаимодействии..."), EconomyType.Boson => (text == "Korean") ? "보존이 힘을 전달합니다..." : ((!(text == "Russian")) ? "Boson transmits forces..." : "Бозон передает силы..."), EconomyType.Fermion => (text == "Korean") ? "페르미온이 물질의 기초입니다..." : ((!(text == "Russian")) ? "Fermion is basis of matter..." : "Фермион — основа материи..."), EconomyType.Hadron => (text == "Korean") ? "강입자가 강한 힘에 묶입니다..." : ((!(text == "Russian")) ? "Hadron is bound by strong force..." : "Адрон связан сильным взаимодействием..."), EconomyType.Meson => (text == "Korean") ? "메손이 쿼크-안티쿼크 쌍입니다..." : ((!(text == "Russian")) ? "Meson is quark-antiquark pair..." : "Мезон — кварк-антикварк пара..."), EconomyType.Baryon => (text == "Korean") ? "바리온이 세 개의 쿼크로 이루어집니다..." : ((!(text == "Russian")) ? "Baryon consists of three quarks..." : "Барион состоит из трех кварков..."), EconomyType.Photon => (text == "Korean") ? "광자가 빛과 전자기력을 전달합니다..." : ((!(text == "Russian")) ? "Photon transmits light and electromagnetism..." : "Фотон передает свет и электромагнетизм..."), EconomyType.Gluon => (text == "Korean") ? "글루온이 강한 힘을 전달합니다..." : ((!(text == "Russian")) ? "Gluon transmits strong force..." : "Глюон передает сильное взаимодействие..."), EconomyType.W_Boson => (text == "Korean") ? "W 보존이 약한 힘을 전달합니다..." : ((!(text == "Russian")) ? "W boson transmits weak force..." : "W-бозон передает слабое взаимодействие..."), EconomyType.Z_Boson => (text == "Korean") ? "Z 보존이 중성 약한 힘을 전달합니다..." : ((!(text == "Russian")) ? "Z boson transmits neutral weak force..." : "Z-бозон передает нейтральное слабое взаимодействие..."), EconomyType.HiggsBoson => (text == "Korean") ? "힉스 보존이 질량 메커니즘을 확인합니다..." : ((!(text == "Russian")) ? "Higgs boson confirms mass mechanism..." : "Бозон Хиггса подтверждает механизм массы..."), EconomyType.GravitonFlux => (text == "Korean") ? "그라비톤 플럭스가 중력을 전달합니다..." : ((!(text == "Russian")) ? "Graviton flux transmits gravity..." : "Поток гравитонов передает гравитацию..."), EconomyType.Chroniton => (text == "Korean") ? "크로니톤이 시간을 조작합니다..." : ((!(text == "Russian")) ? "Chroniton manipulates time..." : "Хронитон манипулирует временем..."), EconomyType.Dilaton => (text == "Korean") ? "딜라톤이 차원을 안정화합니다..." : ((!(text == "Russian")) ? "Dilaton stabilizes dimensions..." : "Дилатон стабилизирует измерения..."), EconomyType.Axigluon => (text == "Korean") ? "액시글루온이 추가 대칭을 제공합니다..." : ((!(text == "Russian")) ? "Axigluon provides additional symmetry..." : "Аксиглюон обеспечивает дополнительную симметрию..."), EconomyType.MagneticMonopole => (text == "Korean") ? "자기 단극이 양극만 존재합니다..." : ((!(text == "Russian")) ? "Magnetic monopole has only one pole..." : "Магнитный монополь имеет только один полюс..."), EconomyType.Instanton => (text == "Korean") ? "인스턴톤이 터널링 효과를 설명합니다..." : ((!(text == "Russian")) ? "Instanton explains tunneling effect..." : "Инстантон объясняет туннельный эффект..."), EconomyType.Skyrmion => (text == "Korean") ? "스카이르미온이 바리온을 모델링합니다..." : ((!(text == "Russian")) ? "Skyrmion models baryon..." : "Скайрмион моделирует барион..."), EconomyType.Soliton => (text == "Korean") ? "솔리톤이 안정된 파동입니다..." : ((!(text == "Russian")) ? "Soliton is stable wave..." : "Солитон — стабильная волна..."), EconomyType.Vortex => (text == "Korean") ? "소용돌이가 양자 유체를 회전시킵니다..." : ((!(text == "Russian")) ? "Vortex rotates quantum fluid..." : "Вихрь вращает квантовую жидкость..."), EconomyType.DomainWall => (text == "Korean") ? "도메인 벽이 상 전환을 분리합니다..." : ((!(text == "Russian")) ? "Domain wall separates phase transitions..." : "Доменная стенка разделяет фазовые переходы..."), EconomyType.CosmicString => (text == "Korean") ? "코스믹 스트링이 우주를 가로지릅니다..." : ((!(text == "Russian")) ? "Cosmic string crosses the universe..." : "Космическая струна пересекает вселенную..."), EconomyType.Texture => (text == "Korean") ? "텍스처가 위상 결함을 만듭니다..." : ((!(text == "Russian")) ? "Texture creates topological defects..." : "Текстура создает топологические дефекты..."), EconomyType.Monopole => (text == "Korean") ? "단극이 자장선을 끝냅니다..." : ((!(text == "Russian")) ? "Monopole terminates magnetic field lines..." : "Монополь завершает магнитные силовые линии..."), EconomyType.GlobalString => (text == "Korean") ? "글로벌 스트링이 대칭을 깨뜨립니다..." : ((!(text == "Russian")) ? "Global string breaks symmetry..." : "Глобальная струна нарушает симметрию..."), EconomyType.LocalString => (text == "Korean") ? "로컬 스트링이 게이지 대칭을 깨뜨립니다..." : ((!(text == "Russian")) ? "Local string breaks gauge symmetry..." : "Локальная струна нарушает калибровочную симметрию..."), EconomyType.AxionString => (text == "Korean") ? "액시온 스트링이 CP 문제를 해결합니다..." : ((!(text == "Russian")) ? "Axion string solves CP problem..." : "Аксионная струна решает проблему CP..."), EconomyType.Superstring => (text == "Korean") ? "슈퍼스트링이 M-이론의 기초입니다..." : ((!(text == "Russian")) ? "Superstring is basis of M-theory..." : "Суперструна — основа M-теории..."), EconomyType.Heterotic => (text == "Korean") ? "헤테로틱 스트링이 보손과 페르미온을 결합합니다..." : ((!(text == "Russian")) ? "Heterotic string combines bosons and fermions..." : "Гетеротическая струна объединяет бозоны и фермионы..."), EconomyType.TypeI => (text == "Korean") ? "타입 I 스트링이 개방과 폐쇄를 가집니다..." : ((!(text == "Russian")) ? "Type I string has open and closed..." : "Струна типа I имеет открытые и замкнутые..."), EconomyType.TypeIIA => (text == "Korean") ? "타입 IIA가 좌우 대칭입니다..." : ((!(text == "Russian")) ? "Type IIA is left-right symmetric..." : "Тип IIA симметричен слева направо..."), EconomyType.TypeIIB => (text == "Korean") ? "타입 IIB가 자기-이중적입니다..." : ((!(text == "Russian")) ? "Type IIB is self-dual..." : "Тип IIB самодвойствен..."), EconomyType.HO => (text == "Korean") ? "HO가 이론의 경계를 탐구합니다..." : ((!(text == "Russian")) ? "HO explores theory boundaries..." : "HO исследует границы теории..."), EconomyType.E6 => (text == "Korean") ? "E6가 대통일 이론의 후보입니다..." : ((!(text == "Russian")) ? "E6 is grand unification candidate..." : "E6 — кандидат в теорию великого объединения..."), EconomyType.E7 => (text == "Korean") ? "E7가 고차원 대칭을 제공합니다..." : ((!(text == "Russian")) ? "E7 provides higher symmetry..." : "E7 обеспечивает высшую симметрию..."), EconomyType.E8 => (text == "Korean") ? "E8가 가장 큰 예외적 리 군입니다..." : ((!(text == "Russian")) ? "E8 is largest exceptional Lie group..." : "E8 — самая большая исключительная группа Ли..."), EconomyType.SU5 => (text == "Korean") ? "SU(5)가 대통일 모델입니다..." : ((!(text == "Russian")) ? "SU(5) is grand unification model..." : "SU(5) — модель великого объединения..."), EconomyType.SO10 => (text == "Korean") ? "SO(10)가 더 큰 대칭을 제공합니다..." : ((!(text == "Russian")) ? "SO(10) provides larger symmetry..." : "SO(10) обеспечивает большую симметрию..."), EconomyType.SUSY => (text == "Korean") ? "초대칭이 보손과 페르미온을 짝지읍니다..." : ((!(text == "Russian")) ? "SUSY pairs bosons and fermions..." : "Суперсимметрия спаривает бозоны и фермионы..."), EconomyType.MSSM => (text == "Korean") ? "MSSM이 최소 초대칭 표준 모델입니다..." : ((!(text == "Russian")) ? "MSSM is minimal supersymmetric standard model..." : "MSSM — минимальная суперсимметричная стандартная модель..."), EconomyType.NMSSM => (text == "Korean") ? "NMSSM이 싱글렛을 추가합니다..." : ((!(text == "Russian")) ? "NMSSM adds a singlet..." : "NMSSM добавляет синглет..."), EconomyType.AMSB => (text == "Korean") ? "AMSB가 이상동역학을 사용합니다..." : ((!(text == "Russian")) ? "AMSB uses anomaly mediation..." : "AMSB использует аномальную размерность..."), EconomyType.GMSB => (text == "Korean") ? "GMSB가 게이지 매개자를 사용합니다..." : ((!(text == "Russian")) ? "GMSB uses gauge mediation..." : "GMSB использует калибровочное посредничество..."), EconomyType.KKLT => (text == "Korean") ? "KKLT가 안정화를 제공합니다..." : ((!(text == "Russian")) ? "KKLT provides stabilization..." : "KKLT обеспечивает стабилизацию..."), EconomyType.LVS => (text == "Korean") ? "LVS가 대규모 부피를 사용합니다..." : ((!(text == "Russian")) ? "LVS uses large volume..." : "LVS использует большой объем..."), EconomyType.RS => (text == "Korean") ? "RS가 여분 차원을 가집니다..." : ((!(text == "Russian")) ? "RS has extra dimensions..." : "RS имеет дополнительные измерения..."), EconomyType.ADD => (text == "Korean") ? "ADD가 큰 여분 차원을 가집니다..." : ((!(text == "Russian")) ? "ADD has large extra dimensions..." : "ADD имеет большие дополнительные измерения..."), EconomyType.UED => (text == "Korean") ? "UED가 보편적 여분 차원을 가집니다..." : ((!(text == "Russian")) ? "UED has universal extra dimensions..." : "UED имеет универсальные дополнительные измерения..."), EconomyType.TC2 => (text == "Korean") ? "TC2가 양자 색역학을 연구합니다..." : ((!(text == "Russian")) ? "TC2 studies quantum chromodynamics..." : "TC2 изучает квантовую хромодинамику..."), EconomyType.LR => (text == "Korean") ? "LR이 좌우 대칭을 확장합니다..." : ((!(text == "Russian")) ? "LR extends left-right symmetry..." : "LR расширяет левоправую симметрию..."), EconomyType.ALR => (text == "Korean") ? "ALR이 대칭을 조정합니다..." : ((!(text == "Russian")) ? "ALR adjusts symmetry..." : "ALR настраивает симметрию..."), EconomyType.VLQ => (text == "Korean") ? "VLQ가 벡터 같은 쿼크를 추가합니다..." : ((!(text == "Russian")) ? "VLQ adds vector-like quarks..." : "VLQ добавляет векторные кварки..."), EconomyType.SMEFT => (text == "Korean") ? "SMEFT가 표준 모델을 확장합니다..." : ((!(text == "Russian")) ? "SMEFT extends standard model..." : "SMEFT расширяет стандартную модель..."), EconomyType.EFT => (text == "Korean") ? "EFT가 유효 장론입니다..." : ((!(text == "Russian")) ? "EFT is effective field theory..." : "EFT — эффективная теория поля..."), _ => "???", }; } public static Color GetEconomyColor() { //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04ce: Unknown result type (might be due to invalid IL or missing references) //IL_04d3: Unknown result type (might be due to invalid IL or missing references) //IL_04d9: Unknown result type (might be due to invalid IL or missing references) //IL_04de: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_04e9: Unknown result type (might be due to invalid IL or missing references) //IL_04ef: Unknown result type (might be due to invalid IL or missing references) //IL_04f4: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_050e: Unknown result type (might be due to invalid IL or missing references) //IL_0514: Unknown result type (might be due to invalid IL or missing references) //IL_0519: Unknown result type (might be due to invalid IL or missing references) //IL_052e: Unknown result type (might be due to invalid IL or missing references) //IL_0533: 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_053e: Unknown result type (might be due to invalid IL or missing references) //IL_0553: Unknown result type (might be due to invalid IL or missing references) //IL_0558: Unknown result type (might be due to invalid IL or missing references) //IL_055e: Unknown result type (might be due to invalid IL or missing references) //IL_0563: Unknown result type (might be due to invalid IL or missing references) //IL_0569: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_059d: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05b7: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05d1: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05eb: Unknown result type (might be due to invalid IL or missing references) //IL_05f0: Unknown result type (might be due to invalid IL or missing references) //IL_0605: Unknown result type (might be due to invalid IL or missing references) //IL_060a: Unknown result type (might be due to invalid IL or missing references) //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_0639: Unknown result type (might be due to invalid IL or missing references) //IL_063e: 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_0658: Unknown result type (might be due to invalid IL or missing references) //IL_066d: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0687: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_06a1: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06bb: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06d5: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06ef: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0723: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_073d: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0757: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0771: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_078b: Unknown result type (might be due to invalid IL or missing references) //IL_0790: Unknown result type (might be due to invalid IL or missing references) //IL_07a5: Unknown result type (might be due to invalid IL or missing references) //IL_07aa: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Unknown result type (might be due to invalid IL or missing references) //IL_07c4: Unknown result type (might be due to invalid IL or missing references) //IL_07d9: Unknown result type (might be due to invalid IL or missing references) //IL_07de: Unknown result type (might be due to invalid IL or missing references) //IL_07f3: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_080d: Unknown result type (might be due to invalid IL or missing references) //IL_0812: Unknown result type (might be due to invalid IL or missing references) //IL_0827: Unknown result type (might be due to invalid IL or missing references) //IL_082c: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Unknown result type (might be due to invalid IL or missing references) //IL_0846: Unknown result type (might be due to invalid IL or missing references) //IL_085b: Unknown result type (might be due to invalid IL or missing references) //IL_0860: Unknown result type (might be due to invalid IL or missing references) //IL_0875: Unknown result type (might be due to invalid IL or missing references) //IL_087a: Unknown result type (might be due to invalid IL or missing references) //IL_088f: Unknown result type (might be due to invalid IL or missing references) //IL_0894: Unknown result type (might be due to invalid IL or missing references) //IL_08a9: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08c3: Unknown result type (might be due to invalid IL or missing references) //IL_08c8: Unknown result type (might be due to invalid IL or missing references) //IL_08dd: Unknown result type (might be due to invalid IL or missing references) //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_08fc: Unknown result type (might be due to invalid IL or missing references) //IL_0911: Unknown result type (might be due to invalid IL or missing references) //IL_0916: Unknown result type (might be due to invalid IL or missing references) //IL_092b: Unknown result type (might be due to invalid IL or missing references) //IL_0930: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Unknown result type (might be due to invalid IL or missing references) //IL_094a: Unknown result type (might be due to invalid IL or missing references) //IL_095f: Unknown result type (might be due to invalid IL or missing references) //IL_0964: Unknown result type (might be due to invalid IL or missing references) //IL_096a: Unknown result type (might be due to invalid IL or missing references) //IL_096f: Unknown result type (might be due to invalid IL or missing references) //IL_0984: Unknown result type (might be due to invalid IL or missing references) //IL_0989: Unknown result type (might be due to invalid IL or missing references) //IL_099e: Unknown result type (might be due to invalid IL or missing references) //IL_09a3: Unknown result type (might be due to invalid IL or missing references) //IL_09b8: Unknown result type (might be due to invalid IL or missing references) //IL_09bd: Unknown result type (might be due to invalid IL or missing references) //IL_09d2: Unknown result type (might be due to invalid IL or missing references) //IL_09d7: Unknown result type (might be due to invalid IL or missing references) //IL_09ec: Unknown result type (might be due to invalid IL or missing references) //IL_09f1: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0a20: Unknown result type (might be due to invalid IL or missing references) //IL_0a25: Unknown result type (might be due to invalid IL or missing references) //IL_0a3a: Unknown result type (might be due to invalid IL or missing references) //IL_0a3f: Unknown result type (might be due to invalid IL or missing references) //IL_0a54: Unknown result type (might be due to invalid IL or missing references) //IL_0a59: Unknown result type (might be due to invalid IL or missing references) //IL_0a6e: Unknown result type (might be due to invalid IL or missing references) //IL_0a73: Unknown result type (might be due to invalid IL or missing references) //IL_0a88: Unknown result type (might be due to invalid IL or missing references) //IL_0a8d: Unknown result type (might be due to invalid IL or missing references) //IL_0aa2: Unknown result type (might be due to invalid IL or missing references) //IL_0aa7: Unknown result type (might be due to invalid IL or missing references) //IL_0abc: Unknown result type (might be due to invalid IL or missing references) //IL_0ac1: Unknown result type (might be due to invalid IL or missing references) //IL_0ad6: Unknown result type (might be due to invalid IL or missing references) //IL_0adb: Unknown result type (might be due to invalid IL or missing references) //IL_0af0: Unknown result type (might be due to invalid IL or missing references) //IL_0af5: Unknown result type (might be due to invalid IL or missing references) //IL_0b0a: Unknown result type (might be due to invalid IL or missing references) //IL_0b0f: Unknown result type (might be due to invalid IL or missing references) //IL_0b24: Unknown result type (might be due to invalid IL or missing references) //IL_0b29: Unknown result type (might be due to invalid IL or missing references) //IL_0b3e: Unknown result type (might be due to invalid IL or missing references) //IL_0b43: Unknown result type (might be due to invalid IL or missing references) //IL_0b58: Unknown result type (might be due to invalid IL or missing references) //IL_0b5d: Unknown result type (might be due to invalid IL or missing references) //IL_0b72: Unknown result type (might be due to invalid IL or missing references) //IL_0b77: Unknown result type (might be due to invalid IL or missing references) //IL_0b8c: Unknown result type (might be due to invalid IL or missing references) //IL_0b91: Unknown result type (might be due to invalid IL or missing references) //IL_0ba6: Unknown result type (might be due to invalid IL or missing references) //IL_0bab: Unknown result type (might be due to invalid IL or missing references) //IL_0bc0: Unknown result type (might be due to invalid IL or missing references) //IL_0bc5: Unknown result type (might be due to invalid IL or missing references) //IL_0bda: Unknown result type (might be due to invalid IL or missing references) //IL_0bdf: Unknown result type (might be due to invalid IL or missing references) //IL_0bf4: Unknown result type (might be due to invalid IL or missing references) //IL_0bf9: Unknown result type (might be due to invalid IL or missing references) //IL_0c0e: Unknown result type (might be due to invalid IL or missing references) //IL_0c13: Unknown result type (might be due to invalid IL or missing references) //IL_0c28: Unknown result type (might be due to invalid IL or missing references) //IL_0c2d: Unknown result type (might be due to invalid IL or missing references) //IL_0c42: Unknown result type (might be due to invalid IL or missing references) //IL_0c47: Unknown result type (might be due to invalid IL or missing references) //IL_0c5c: Unknown result type (might be due to invalid IL or missing references) //IL_0c61: Unknown result type (might be due to invalid IL or missing references) //IL_0c76: Unknown result type (might be due to invalid IL or missing references) //IL_0c7b: Unknown result type (might be due to invalid IL or missing references) //IL_0c90: Unknown result type (might be due to invalid IL or missing references) //IL_0c95: Unknown result type (might be due to invalid IL or missing references) //IL_0caa: Unknown result type (might be due to invalid IL or missing references) //IL_0caf: Unknown result type (might be due to invalid IL or missing references) //IL_0cc4: Unknown result type (might be due to invalid IL or missing references) //IL_0cc9: Unknown result type (might be due to invalid IL or missing references) //IL_0cde: Unknown result type (might be due to invalid IL or missing references) //IL_0ce3: Unknown result type (might be due to invalid IL or missing references) //IL_0cf8: Unknown result type (might be due to invalid IL or missing references) //IL_0cfd: Unknown result type (might be due to invalid IL or missing references) //IL_0d12: Unknown result type (might be due to invalid IL or missing references) //IL_0d17: Unknown result type (might be due to invalid IL or missing references) //IL_0d2c: Unknown result type (might be due to invalid IL or missing references) //IL_0d31: Unknown result type (might be due to invalid IL or missing references) //IL_0d46: Unknown result type (might be due to invalid IL or missing references) //IL_0d4b: Unknown result type (might be due to invalid IL or missing references) //IL_0d60: Unknown result type (might be due to invalid IL or missing references) //IL_0d65: Unknown result type (might be due to invalid IL or missing references) //IL_0d7a: Unknown result type (might be due to invalid IL or missing references) //IL_0d7f: Unknown result type (might be due to invalid IL or missing references) //IL_0d94: Unknown result type (might be due to invalid IL or missing references) //IL_0d99: Unknown result type (might be due to invalid IL or missing references) //IL_0dae: Unknown result type (might be due to invalid IL or missing references) //IL_0db3: Unknown result type (might be due to invalid IL or missing references) //IL_0dc8: Unknown result type (might be due to invalid IL or missing references) //IL_0dcd: Unknown result type (might be due to invalid IL or missing references) //IL_0de2: Unknown result type (might be due to invalid IL or missing references) //IL_0de7: Unknown result type (might be due to invalid IL or missing references) //IL_0dfc: Unknown result type (might be due to invalid IL or missing references) //IL_0e01: Unknown result type (might be due to invalid IL or missing references) //IL_0e16: Unknown result type (might be due to invalid IL or missing references) //IL_0e1b: Unknown result type (might be due to invalid IL or missing references) //IL_0e30: Unknown result type (might be due to invalid IL or missing references) //IL_0e35: Unknown result type (might be due to invalid IL or missing references) //IL_0e4a: Unknown result type (might be due to invalid IL or missing references) //IL_0e4f: Unknown result type (might be due to invalid IL or missing references) //IL_0e64: Unknown result type (might be due to invalid IL or missing references) //IL_0e69: Unknown result type (might be due to invalid IL or missing references) //IL_0e7e: Unknown result type (might be due to invalid IL or missing references) //IL_0e83: Unknown result type (might be due to invalid IL or missing references) //IL_0e98: Unknown result type (might be due to invalid IL or missing references) //IL_0e9d: Unknown result type (might be due to invalid IL or missing references) //IL_0eb2: Unknown result type (might be due to invalid IL or missing references) //IL_0eb7: Unknown result type (might be due to invalid IL or missing references) //IL_0ecc: Unknown result type (might be due to invalid IL or missing references) //IL_0ed1: Unknown result type (might be due to invalid IL or missing references) //IL_0ee6: Unknown result type (might be due to invalid IL or missing references) //IL_0eeb: Unknown result type (might be due to invalid IL or missing references) //IL_0f00: Unknown result type (might be due to invalid IL or missing references) //IL_0f05: Unknown result type (might be due to invalid IL or missing references) //IL_0f1a: Unknown result type (might be due to invalid IL or missing references) //IL_0f1f: Unknown result type (might be due to invalid IL or missing references) //IL_0f34: Unknown result type (might be due to invalid IL or missing references) //IL_0f39: Unknown result type (might be due to invalid IL or missing references) //IL_0f4e: Unknown result type (might be due to invalid IL or missing references) //IL_0f53: Unknown result type (might be due to invalid IL or missing references) //IL_0f68: Unknown result type (might be due to invalid IL or missing references) //IL_0f6d: Unknown result type (might be due to invalid IL or missing references) //IL_0f82: Unknown result type (might be due to invalid IL or missing references) //IL_0f87: Unknown result type (might be due to invalid IL or missing references) //IL_0f9c: Unknown result type (might be due to invalid IL or missing references) //IL_0fa1: Unknown result type (might be due to invalid IL or missing references) //IL_0fb6: Unknown result type (might be due to invalid IL or missing references) //IL_0fbb: Unknown result type (might be due to invalid IL or missing references) //IL_0fd0: Unknown result type (might be due to invalid IL or missing references) //IL_0fd5: Unknown result type (might be due to invalid IL or missing references) //IL_0fea: Unknown result type (might be due to invalid IL or missing references) //IL_0fef: Unknown result type (might be due to invalid IL or missing references) //IL_1004: Unknown result type (might be due to invalid IL or missing references) //IL_1009: Unknown result type (might be due to invalid IL or missing references) //IL_101e: Unknown result type (might be due to invalid IL or missing references) //IL_1023: Unknown result type (might be due to invalid IL or missing references) //IL_1038: Unknown result type (might be due to invalid IL or missing references) //IL_103d: Unknown result type (might be due to invalid IL or missing references) //IL_1052: Unknown result type (might be due to invalid IL or missing references) //IL_1057: Unknown result type (might be due to invalid IL or missing references) //IL_106c: Unknown result type (might be due to invalid IL or missing references) //IL_1071: Unknown result type (might be due to invalid IL or missing references) //IL_1086: Unknown result type (might be due to invalid IL or missing references) //IL_108b: Unknown result type (might be due to invalid IL or missing references) //IL_10a0: Unknown result type (might be due to invalid IL or missing references) //IL_10a5: Unknown result type (might be due to invalid IL or missing references) //IL_10ba: Unknown result type (might be due to invalid IL or missing references) //IL_10bf: Unknown result type (might be due to invalid IL or missing references) //IL_10d4: Unknown result type (might be due to invalid IL or missing references) //IL_10d9: Unknown result type (might be due to invalid IL or missing references) //IL_10ee: Unknown result type (might be due to invalid IL or missing references) //IL_10f3: Unknown result type (might be due to invalid IL or missing references) //IL_1108: Unknown result type (might be due to invalid IL or missing references) //IL_110d: Unknown result type (might be due to invalid IL or missing references) //IL_1122: Unknown result type (might be due to invalid IL or missing references) //IL_1127: Unknown result type (might be due to invalid IL or missing references) //IL_113c: Unknown result type (might be due to invalid IL or missing references) //IL_1141: Unknown result type (might be due to invalid IL or missing references) //IL_1156: Unknown result type (might be due to invalid IL or missing references) //IL_115b: Unknown result type (might be due to invalid IL or missing references) //IL_1170: Unknown result type (might be due to invalid IL or missing references) //IL_1175: Unknown result type (might be due to invalid IL or missing references) //IL_118a: Unknown result type (might be due to invalid IL or missing references) //IL_118f: Unknown result type (might be due to invalid IL or missing references) //IL_11a4: Unknown result type (might be due to invalid IL or missing references) //IL_11a9: Unknown result type (might be due to invalid IL or missing references) //IL_11be: Unknown result type (might be due to invalid IL or missing references) //IL_11c3: Unknown result type (might be due to invalid IL or missing references) //IL_11d8: Unknown result type (might be due to invalid IL or missing references) //IL_11dd: Unknown result type (might be due to invalid IL or missing references) //IL_11f2: Unknown result type (might be due to invalid IL or missing references) //IL_11f7: Unknown result type (might be due to invalid IL or missing references) //IL_120c: Unknown result type (might be due to invalid IL or missing references) //IL_1211: Unknown result type (might be due to invalid IL or missing references) //IL_1226: Unknown result type (might be due to invalid IL or missing references) //IL_122b: Unknown result type (might be due to invalid IL or missing references) //IL_1240: Unknown result type (might be due to invalid IL or missing references) //IL_1245: Unknown result type (might be due to invalid IL or missing references) //IL_125a: Unknown result type (might be due to invalid IL or missing references) //IL_125f: Unknown result type (might be due to invalid IL or missing references) //IL_1274: Unknown result type (might be due to invalid IL or missing references) //IL_1279: Unknown result type (might be due to invalid IL or missing references) //IL_128e: Unknown result type (might be due to invalid IL or missing references) //IL_1293: Unknown result type (might be due to invalid IL or missing references) //IL_12a8: Unknown result type (might be due to invalid IL or missing references) //IL_12ad: Unknown result type (might be due to invalid IL or missing references) //IL_12c2: Unknown result type (might be due to invalid IL or missing references) //IL_12c7: Unknown result type (might be due to invalid IL or missing references) //IL_12dc: Unknown result type (might be due to invalid IL or missing references) //IL_12e1: Unknown result type (might be due to invalid IL or missing references) //IL_12f6: Unknown result type (might be due to invalid IL or missing references) //IL_12fb: Unknown result type (might be due to invalid IL or missing references) //IL_1310: Unknown result type (might be due to invalid IL or missing references) //IL_1315: Unknown result type (might be due to invalid IL or missing references) //IL_132a: Unknown result type (might be due to invalid IL or missing references) //IL_132f: Unknown result type (might be due to invalid IL or missing references) //IL_1344: Unknown result type (might be due to invalid IL or missing references) //IL_1349: Unknown result type (might be due to invalid IL or missing references) //IL_135e: Unknown result type (might be due to invalid IL or missing references) //IL_1363: Unknown result type (might be due to invalid IL or missing references) //IL_1378: Unknown result type (might be due to invalid IL or missing references) //IL_137d: Unknown result type (might be due to invalid IL or missing references) //IL_1392: Unknown result type (might be due to invalid IL or missing references) //IL_1397: Unknown result type (might be due to invalid IL or missing references) //IL_13ac: Unknown result type (might be due to invalid IL or missing references) //IL_13b1: Unknown result type (might be due to invalid IL or missing references) //IL_13c6: Unknown result type (might be due to invalid IL or missing references) //IL_13cb: Unknown result type (might be due to invalid IL or missing references) //IL_13e0: Unknown result type (might be due to invalid IL or missing references) //IL_13e5: Unknown result type (might be due to invalid IL or missing references) //IL_13fa: Unknown result type (might be due to invalid IL or missing references) //IL_13ff: Unknown result type (might be due to invalid IL or missing references) //IL_1414: Unknown result type (might be due to invalid IL or missing references) //IL_1419: Unknown result type (might be due to invalid IL or missing references) //IL_142e: Unknown result type (might be due to invalid IL or missing references) //IL_1433: Unknown result type (might be due to invalid IL or missing references) //IL_1448: Unknown result type (might be due to invalid IL or missing references) //IL_144d: Unknown result type (might be due to invalid IL or missing references) //IL_1462: Unknown result type (might be due to invalid IL or missing references) //IL_1467: Unknown result type (might be due to invalid IL or missing references) //IL_147c: Unknown result type (might be due to invalid IL or missing references) //IL_1481: Unknown result type (might be due to invalid IL or missing references) //IL_1496: Unknown result type (might be due to invalid IL or missing references) //IL_149b: Unknown result type (might be due to invalid IL or missing references) //IL_14b0: Unknown result type (might be due to invalid IL or missing references) //IL_14b5: Unknown result type (might be due to invalid IL or missing references) //IL_14ca: Unknown result type (might be due to invalid IL or missing references) //IL_14cf: Unknown result type (might be due to invalid IL or missing references) //IL_14e4: Unknown result type (might be due to invalid IL or missing references) //IL_14e9: Unknown result type (might be due to invalid IL or missing references) //IL_14fe: Unknown result type (might be due to invalid IL or missing references) //IL_1503: Unknown result type (might be due to invalid IL or missing references) //IL_1518: Unknown result type (might be due to invalid IL or missing references) //IL_151d: Unknown result type (might be due to invalid IL or missing references) //IL_1532: Unknown result type (might be due to invalid IL or missing references) //IL_1537: Unknown result type (might be due to invalid IL or missing references) //IL_154c: Unknown result type (might be due to invalid IL or missing references) //IL_1551: Unknown result type (might be due to invalid IL or missing references) //IL_1566: Unknown result type (might be due to invalid IL or missing references) //IL_156b: Unknown result type (might be due to invalid IL or missing references) //IL_1580: Unknown result type (might be due to invalid IL or missing references) //IL_1585: Unknown result type (might be due to invalid IL or missing references) //IL_159a: Unknown result type (might be due to invalid IL or missing references) //IL_159f: Unknown result type (might be due to invalid IL or missing references) //IL_15b4: Unknown result type (might be due to invalid IL or missing references) //IL_15b9: Unknown result type (might be due to invalid IL or missing references) //IL_15ce: Unknown result type (might be due to invalid IL or missing references) //IL_15d3: Unknown result type (might be due to invalid IL or missing references) //IL_15e8: Unknown result type (might be due to invalid IL or missing references) //IL_15ed: Unknown result type (might be due to invalid IL or missing references) //IL_1602: Unknown result type (might be due to invalid IL or missing references) //IL_1607: Unknown result type (might be due to invalid IL or missing references) //IL_161c: Unknown result type (might be due to invalid IL or missing references) //IL_1621: Unknown result type (might be due to invalid IL or missing references) //IL_1636: Unknown result type (might be due to invalid IL or missing references) //IL_163b: Unknown result type (might be due to invalid IL or missing references) //IL_1650: Unknown result type (might be due to invalid IL or missing references) //IL_1655: Unknown result type (might be due to invalid IL or missing references) //IL_166a: Unknown result type (might be due to invalid IL or missing references) //IL_166f: Unknown result type (might be due to invalid IL or missing references) //IL_1684: Unknown result type (might be due to invalid IL or missing references) //IL_1689: Unknown result type (might be due to invalid IL or missing references) //IL_169e: Unknown result type (might be due to invalid IL or missing references) //IL_16a3: Unknown result type (might be due to invalid IL or missing references) //IL_16b8: Unknown result type (might be due to invalid IL or missing references) //IL_16bd: Unknown result type (might be due to invalid IL or missing references) //IL_16d2: Unknown result type (might be due to invalid IL or missing references) //IL_16d7: Unknown result type (might be due to invalid IL or missing references) //IL_16ec: Unknown result type (might be due to invalid IL or missing references) //IL_16f1: Unknown result type (might be due to invalid IL or missing references) //IL_1706: Unknown result type (might be due to invalid IL or missing references) //IL_170b: Unknown result type (might be due to invalid IL or missing references) //IL_1720: Unknown result type (might be due to invalid IL or missing references) //IL_1725: Unknown result type (might be due to invalid IL or missing references) //IL_173a: Unknown result type (might be due to invalid IL or missing references) //IL_173f: Unknown result type (might be due to invalid IL or missing references) //IL_1754: Unknown result type (might be due to invalid IL or missing references) //IL_1759: Unknown result type (might be due to invalid IL or missing references) //IL_176e: Unknown result type (might be due to invalid IL or missing references) //IL_1773: Unknown result type (might be due to invalid IL or missing references) //IL_1788: Unknown result type (might be due to invalid IL or missing references) //IL_178d: Unknown result type (might be due to invalid IL or missing references) //IL_17a2: Unknown result type (might be due to invalid IL or missing references) //IL_17a7: Unknown result type (might be due to invalid IL or missing references) //IL_17bc: Unknown result type (might be due to invalid IL or missing references) //IL_17c1: Unknown result type (might be due to invalid IL or missing references) //IL_17d6: Unknown result type (might be due to invalid IL or missing references) //IL_17db: Unknown result type (might be due to invalid IL or missing references) //IL_17f0: Unknown result type (might be due to invalid IL or missing references) //IL_17f5: Unknown result type (might be due to invalid IL or missing references) //IL_180a: Unknown result type (might be due to invalid IL or missing references) //IL_180f: Unknown result type (might be due to invalid IL or missing references) //IL_1824: Unknown result type (might be due to invalid IL or missing references) //IL_1829: Unknown result type (might be due to invalid IL or missing references) //IL_183e: Unknown result type (might be due to invalid IL or missing references) //IL_1843: Unknown result type (might be due to invalid IL or missing references) //IL_1858: Unknown result type (might be due to invalid IL or missing references) //IL_185d: Unknown result type (might be due to invalid IL or missing references) //IL_1872: Unknown result type (might be due to invalid IL or missing references) //IL_1877: Unknown result type (might be due to invalid IL or missing references) //IL_188c: Unknown result type (might be due to invalid IL or missing references) //IL_1891: Unknown result type (might be due to invalid IL or missing references) //IL_18a6: Unknown result type (might be due to invalid IL or missing references) //IL_18ab: Unknown result type (might be due to invalid IL or missing references) //IL_18c0: Unknown result type (might be due to invalid IL or missing references) //IL_18c5: Unknown result type (might be due to invalid IL or missing references) //IL_18da: Unknown result type (might be due to invalid IL or missing references) //IL_18df: Unknown result type (might be due to invalid IL or missing references) //IL_18f4: Unknown result type (might be due to invalid IL or missing references) //IL_18f9: Unknown result type (might be due to invalid IL or missing references) //IL_190e: Unknown result type (might be due to invalid IL or missing references) //IL_1913: Unknown result type (might be due to invalid IL or missing references) //IL_1928: Unknown result type (might be due to invalid IL or missing references) //IL_192d: Unknown result type (might be due to invalid IL or missing references) //IL_1942: Unknown result type (might be due to invalid IL or missing references) //IL_1947: Unknown result type (might be due to invalid IL or missing references) //IL_195c: Unknown result type (might be due to invalid IL or missing references) //IL_1961: Unknown result type (might be due to invalid IL or missing references) //IL_1976: Unknown result type (might be due to invalid IL or missing references) //IL_197b: Unknown result type (might be due to invalid IL or missing references) //IL_1990: Unknown result type (might be due to invalid IL or missing references) //IL_1995: Unknown result type (might be due to invalid IL or missing references) //IL_19aa: Unknown result type (might be due to invalid IL or missing references) //IL_19af: Unknown result type (might be due to invalid IL or missing references) //IL_19c4: Unknown result type (might be due to invalid IL or missing references) //IL_19c9: Unknown result type (might be due to invalid IL or missing references) //IL_19de: Unknown result type (might be due to invalid IL or missing references) //IL_19e3: Unknown result type (might be due to invalid IL or missing references) //IL_19f8: Unknown result type (might be due to invalid IL or missing references) //IL_19fd: Unknown result type (might be due to invalid IL or missing references) //IL_1a12: Unknown result type (might be due to invalid IL or missing references) //IL_1a17: Unknown result type (might be due to invalid IL or missing references) //IL_1a2c: Unknown result type (might be due to invalid IL or missing references) //IL_1a31: Unknown result type (might be due to invalid IL or missing references) //IL_1a46: Unknown result type (might be due to invalid IL or missing references) //IL_1a4b: Unknown result type (might be due to invalid IL or missing references) //IL_1a60: Unknown result type (might be due to invalid IL or missing references) //IL_1a65: Unknown result type (might be due to invalid IL or missing references) //IL_1a7a: Unknown result type (might be due to invalid IL or missing references) //IL_1a7f: Unknown result type (might be due to invalid IL or missing references) //IL_1a94: Unknown result type (might be due to invalid IL or missing references) //IL_1a99: Unknown result type (might be due to invalid IL or missing references) //IL_1aae: Unknown result type (might be due to invalid IL or missing references) //IL_1ab3: Unknown result type (might be due to invalid IL or missing references) //IL_1ac5: Unknown result type (might be due to invalid IL or missing references) //IL_1aca: Unknown result type (might be due to invalid IL or missing references) //IL_1adc: Unknown result type (might be due to invalid IL or missing references) //IL_1ae1: Unknown result type (might be due to invalid IL or missing references) //IL_1af3: Unknown result type (might be due to invalid IL or missing references) //IL_1af8: Unknown result type (might be due to invalid IL or missing references) //IL_1b0a: Unknown result type (might be due to invalid IL or missing references) //IL_1b0f: Unknown result type (might be due to invalid IL or missing references) //IL_1b21: Unknown result type (might be due to invalid IL or missing references) //IL_1b26: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_1b2f: Unknown result type (might be due to invalid IL or missing references) //IL_1b29: Unknown result type (might be due to invalid IL or missing references) //IL_1b2e: 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) if (REPOConfig.EnableCustomEvents.Value && CurrentCustomEconomy != null) { float[] color = CurrentCustomEconomy.color; if (color != null && color.Length == 3) { return new Color(color[0], color[1], color[2]); } } return (Color)(CurrentEconomy switch { EconomyType.GlassBankDividend => new Color(1f, 0.78f, 0.22f), EconomyType.PitContractInsurance => new Color(0.7f, 0.45f, 1f), EconomyType.StormRunnerSurge => new Color(0.25f, 0.9f, 1f), EconomyType.SilentDebtEclipse => new Color(0.35f, 0.36f, 0.46f), EconomyType.CloneLotteryJackpot => new Color(0.35f, 1f, 0.55f), EconomyType.MagnetShiftVortex => new Color(0.95f, 0.35f, 0.85f), EconomyType.LastInvoiceJudgement => new Color(1f, 0.25f, 0.18f), EconomyType.CenturionMarket => new Color(1f, 0.84f, 0.18f), EconomyType.Stable => Color.white, EconomyType.Deflation => Color.red, EconomyType.Inflation => Color.green, EconomyType.Chaos => Color.cyan, EconomyType.FreezeMarket => Color.gray, EconomyType.BlackMarketSurge => new Color(1f, 0.84f, 0f), EconomyType.Overload => Color.magenta, EconomyType.RareBoom => new Color(0.7f, 0.2f, 1f), EconomyType.CommonCrash => Color.gray, EconomyType.LegendaryOnlyMatters => new Color(1f, 0.9f, 0.1f), EconomyType.EchoMarket => Color.yellow, EconomyType.ReverseInflation => Color.blue, EconomyType.LuxuryHunt => new Color(0.2f, 1f, 0.4f), EconomyType.DumpsterDive => new Color(0.6f, 0.3f, 0f), EconomyType.ExtraProfit => new Color(0.1f, 0.8f, 1f), EconomyType.ScamSeason => new Color(0.5f, 0f, 0.5f), EconomyType.SuddenDrop => new Color(1f, 0.4f, 0f), EconomyType.TreasureRush => new Color(1f, 0.65f, 0f), EconomyType.ZeroGravity => new Color(0.8f, 0.8f, 0.8f), EconomyType.Turbulence => new Color(0.4f, 0.6f, 0.8f), EconomyType.BubbleBurst => new Color(0.7f, 0.2f, 0.2f), EconomyType.CollectorsFrenzy => new Color(1f, 0.85f, 0.3f), EconomyType.PanicSale => new Color(1f, 0.4f, 0.1f), EconomyType.EconomicTwister => Color.Lerp(Color.red, Color.green, REPOSeedManager.Value()), EconomyType.TaxAudit => new Color(0.3f, 0.4f, 0.6f), EconomyType.CrashAndBurn => new Color(0.5f, 0.1f, 0.1f), EconomyType.GoldenHour => new Color(1f, 0.85f, 0.3f), EconomyType.CrystalBubble => new Color(1f, 0.9f, 1f), EconomyType.CoinDecay => new Color(0.4f, 0.4f, 0.4f), EconomyType.EchoCrash => new Color(0.8f, 0.3f, 0.9f), EconomyType.SpeculationBubble => new Color(1f, 0.6f, 0f), EconomyType.ColdStorage => new Color(0.3f, 0.5f, 0.9f), EconomyType.PriceWhirlwind => new Color(0.5f, 0.9f, 0.7f), EconomyType.ExperimentalPricing => new Color(0.6f, 0.3f, 0.9f), EconomyType.ShadowMarket => new Color(0.1f, 0.1f, 0.1f), EconomyType.AuctionFever => new Color(1f, 0.65f, 0f), EconomyType.MemoryMarket => new Color(0.5f, 0.9f, 0.8f), EconomyType.LoopbackSpike => new Color(1f, 0.6f, 0.3f), EconomyType.GlitchedGoldrush => new Color(1f, 1f, 0.2f), EconomyType.MarketEclipse => new Color(0.2f, 0.2f, 0.2f), EconomyType.JackpotMirage => new Color(1f, 0.75f, 0.3f), EconomyType.CollectorsVoid => new Color(0.1f, 0.1f, 0.1f), EconomyType.VolatileExperiment => new Color(1f, 0f, 0.5f), EconomyType.CleanSweep => new Color(0.8f, 0.95f, 1f), EconomyType.ValueVortex => new Color(0.6f, 0.2f, 1f), EconomyType.TemporalSurge => new Color(0.8f, 0.4f, 1f), EconomyType.EchoOfWealth => new Color(0.5f, 0.7f, 0.9f), EconomyType.ArtifactBloat => new Color(0.9f, 0.6f, 0.1f), EconomyType.MarketDrain => new Color(0.2f, 0.1f, 0.1f), EconomyType.InversionProtocol => new Color(1f, 0f, 1f), EconomyType.SyntheticDemand => new Color(0.3f, 1f, 0.6f), EconomyType.TaxFrenzy => Color.red, EconomyType.AssetDump => new Color(0.4f, 0.2f, 0.6f), EconomyType.SmugglersSurge => new Color(0.8f, 0.6f, 0.1f), EconomyType.CollectorsCraze => new Color(0.6f, 0.3f, 1f), EconomyType.MarketKraken => new Color(0f, 0.7f, 1f), EconomyType.MarketBoom => new Color(1f, 0.6f, 0f), EconomyType.PriceLockdown => new Color(0.5f, 0.5f, 0.5f), EconomyType.WildSpeculation => new Color(1f, 0f, 1f), EconomyType.SilentAuction => new Color(0.8f, 0.8f, 0.2f), EconomyType.FlashCrash => new Color(0.2f, 0f, 0f), EconomyType.CryptoSurge => new Color(0f, 1f, 0.8f), EconomyType.ResourceRush => new Color(0.4f, 0.8f, 0.2f), EconomyType.DemandSpike => new Color(1f, 0.2f, 0.2f), EconomyType.SupplyShortage => new Color(0.6f, 0.3f, 0.1f), EconomyType.ConsumerConfidence => new Color(0.2f, 0.6f, 1f), EconomyType.MarketMeltup => new Color(1f, 0.9f, 0.3f), EconomyType.BargainHunt => new Color(0.2f, 1f, 0.2f), EconomyType.MarketRebound => new Color(0.2f, 1f, 0.4f), EconomyType.PriceCascade => new Color(0.6f, 0.2f, 0.8f), EconomyType.BullRun => new Color(1f, 0.8f, 0.2f), EconomyType.BearTrap => new Color(0.5f, 0.1f, 0.1f), EconomyType.PanicBuying => new Color(1f, 0.2f, 0.2f), EconomyType.SupplyGlut => new Color(0.2f, 0.2f, 1f), EconomyType.SpeculatorFrenzy => new Color(1f, 0.4f, 0.8f), EconomyType.ValueStabilizer => new Color(0.8f, 0.8f, 0.8f), EconomyType.MarketMirroring => new Color(0.3f, 0.7f, 0.7f), EconomyType.InflationSpike => new Color(1f, 0.5f, 0.1f), EconomyType.DeflationDip => new Color(0.1f, 0.5f, 1f), EconomyType.EconomicEquilibrium => new Color(1f, 1f, 1f), EconomyType.PriceSurge => new Color(1f, 0.5f, 0f), EconomyType.BargainBlitz => new Color(0f, 1f, 0.5f), EconomyType.CollectorCarnival => new Color(1f, 0f, 1f), EconomyType.GhostPrices => new Color(0.5f, 0.5f, 0.5f), EconomyType.BarterBonanza => new Color(0.6f, 0.4f, 0.2f), EconomyType.SeasonalShift => new Color(0.4f, 1f, 0.4f), EconomyType.BlackoutSale => new Color(0.5f, 0f, 0f), EconomyType.InflationEbb => new Color(0f, 0f, 1f), EconomyType.FoolsGold => new Color(1f, 0.84f, 0f), EconomyType.HoardersHavoc => new Color(0.5f, 0f, 0.5f), EconomyType.PennyPinch => new Color(0.3f, 0.3f, 0.3f), EconomyType.Trendsetter => new Color(0f, 1f, 1f), EconomyType.PriceSpike => new Color(1f, 0.4f, 0.2f), EconomyType.Clearance => new Color(0.3f, 0.7f, 0.9f), EconomyType.BoomerangMarket => new Color(0.6f, 0.3f, 0.7f), EconomyType.SilentDip => new Color(0.6f, 0.6f, 0.6f), EconomyType.LuxuryOnly => new Color(1f, 0.9f, 0.7f), EconomyType.EarlyBubble => new Color(1f, 0.8f, 0.4f), EconomyType.LateDeflation => new Color(0.2f, 0.3f, 0.9f), EconomyType.PriceSlalom => new Color(0.4f, 1f, 0.4f), EconomyType.FalseDemand => new Color(1f, 0.6f, 0.1f), EconomyType.UndergroundTrade => new Color(0.2f, 0.1f, 0.1f), EconomyType.CrystalCrash => new Color(0.8f, 0.8f, 1f), EconomyType.GhostRush => new Color(1f, 1f, 1f), EconomyType.QuantumFlux => new Color(0.4f, 0.8f, 1f), EconomyType.VoidMarket => new Color(0.1f, 0.1f, 0.2f), EconomyType.CrystalCascade => new Color(0.7f, 0.9f, 1f), EconomyType.ShadowInflation => new Color(0.3f, 0.2f, 0.4f), EconomyType.PlasmaSurge => new Color(1f, 0.6f, 0.2f), EconomyType.EtherCrash => new Color(0.8f, 0.4f, 1f), EconomyType.MysticDeflation => new Color(0.2f, 0.5f, 0.8f), EconomyType.ArcaneBubble => new Color(0.9f, 0.7f, 0.3f), EconomyType.SpectralBoom => new Color(0.6f, 1f, 0.8f), EconomyType.PhantomDip => new Color(0.5f, 0.3f, 0.7f), EconomyType.NebulaTwist => new Color(0.8f, 0.5f, 1f), EconomyType.StellarSurge => new Color(1f, 0.9f, 0.4f), EconomyType.CometCrash => new Color(0.4f, 0.6f, 0.9f), EconomyType.AuroraBust => new Color(0.3f, 0.8f, 0.6f), EconomyType.GalaxyGlitch => new Color(0.7f, 0.4f, 0.8f), EconomyType.MeteorShower => new Color(1f, 0.5f, 0.1f), EconomyType.EclipseEvent => new Color(0.2f, 0.2f, 0.3f), EconomyType.LunarEclipse => new Color(0.6f, 0.6f, 0.8f), EconomyType.SolarFlare => new Color(1f, 0.8f, 0.3f), EconomyType.CosmicDust => new Color(0.5f, 0.4f, 0.3f), EconomyType.BlackHole => new Color(0f, 0f, 0f), EconomyType.WhiteDwarf => new Color(0.9f, 0.9f, 0.9f), EconomyType.RedGiant => new Color(1f, 0.3f, 0.2f), EconomyType.BlueSupergiant => new Color(0.4f, 0.7f, 1f), EconomyType.NeutronStar => new Color(0.8f, 0.8f, 0.9f), EconomyType.PulsarPulse => new Color(0.6f, 0.9f, 1f), EconomyType.QuasarQuake => new Color(1f, 0.5f, 0.8f), EconomyType.Singularity => new Color(0.1f, 0.1f, 0.1f), EconomyType.WarpDrive => new Color(0.8f, 0.4f, 1f), EconomyType.TimeDilation => new Color(0.5f, 0.8f, 0.9f), EconomyType.SpaceTime => new Color(0.7f, 0.6f, 0.8f), EconomyType.DimensionalRift => new Color(0.9f, 0.3f, 0.7f), EconomyType.ParallelUniverse => new Color(0.4f, 0.9f, 0.6f), EconomyType.QuantumEntanglement => new Color(0.8f, 0.7f, 0.9f), EconomyType.WaveFunction => new Color(0.6f, 0.8f, 1f), EconomyType.ProbabilityCloud => new Color(0.7f, 0.9f, 0.8f), EconomyType.UncertaintyPrinciple => new Color(0.9f, 0.6f, 0.4f), EconomyType.ObserverEffect => new Color(0.5f, 0.7f, 0.9f), EconomyType.Decoherence => new Color(0.8f, 0.5f, 0.6f), EconomyType.Superposition => new Color(0.6f, 1f, 0.7f), EconomyType.EntanglementSwap => new Color(0.9f, 0.8f, 0.5f), EconomyType.BellInequality => new Color(0.7f, 0.6f, 0.8f), EconomyType.EPRParadox => new Color(0.4f, 0.8f, 0.7f), EconomyType.ManyWorlds => new Color(0.8f, 0.9f, 0.6f), EconomyType.Copenhagen => new Color(0.5f, 0.6f, 0.9f), EconomyType.Multiverse => new Color(0.9f, 0.7f, 0.8f), EconomyType.StringTheory => new Color(1f, 0.6f, 0.9f), EconomyType.Membrane => new Color(0.6f, 0.9f, 0.7f), EconomyType.BraneWorld => new Color(0.8f, 0.6f, 1f), EconomyType.Holographic => new Color(0.7f, 1f, 0.8f), EconomyType.InformationParadox => new Color(0.9f, 0.5f, 0.6f), EconomyType.Firewall => new Color(1f, 0.4f, 0.5f), EconomyType.EventHorizon => new Color(0.2f, 0.1f, 0.3f), EconomyType.HawkingRadiation => new Color(0.8f, 0.9f, 1f), EconomyType.UnruhEffect => new Color(0.6f, 0.7f, 0.9f), EconomyType.CasimirForce => new Color(0.5f, 0.8f, 0.6f), EconomyType.VacuumEnergy => new Color(0.9f, 0.8f, 0.7f), EconomyType.DarkMatter => new Color(0.3f, 0.4f, 0.6f), EconomyType.DarkEnergy => new Color(0.7f, 0.5f, 0.9f), EconomyType.InflationField => new Color(1f, 0.7f, 0.4f), EconomyType.HiggsField => new Color(0.8f, 0.9f, 0.5f), EconomyType.Graviton => new Color(0.6f, 0.8f, 0.7f), EconomyType.Tachyon => new Color(0.9f, 0.6f, 1f), EconomyType.WIMP => new Color(0.4f, 0.7f, 0.8f), EconomyType.Axion => new Color(0.8f, 0.7f, 0.6f), EconomyType.Neutrino => new Color(0.5f, 0.6f, 0.9f), EconomyType.Muon => new Color(0.7f, 0.8f, 0.5f), EconomyType.Tau => new Color(0.9f, 0.5f, 0.7f), EconomyType.Quark => new Color(0.6f, 0.9f, 0.8f), EconomyType.Lepton => new Color(0.8f, 0.6f, 0.9f), EconomyType.Boson => new Color(0.7f, 0.9f, 0.6f), EconomyType.Fermion => new Color(0.9f, 0.7f, 0.8f), EconomyType.Hadron => new Color(0.5f, 0.8f, 0.7f), EconomyType.Meson => new Color(0.8f, 0.5f, 0.9f), EconomyType.Baryon => new Color(0.6f, 0.9f, 0.7f), EconomyType.Photon => new Color(1f, 1f, 0.8f), EconomyType.Gluon => new Color(0.9f, 0.6f, 0.8f), EconomyType.W_Boson => new Color(0.7f, 0.8f, 1f), EconomyType.Z_Boson => new Color(0.8f, 0.7f, 0.9f), EconomyType.HiggsBoson => new Color(0.9f, 0.9f, 0.5f), EconomyType.GravitonFlux => new Color(0.6f, 0.8f, 0.9f), EconomyType.Chroniton => new Color(0.8f, 0.9f, 0.6f), EconomyType.Dilaton => new Color(0.7f, 0.6f, 0.9f), EconomyType.Axigluon => new Color(0.9f, 0.8f, 0.7f), EconomyType.MagneticMonopole => new Color(0.5f, 0.9f, 0.8f), EconomyType.Instanton => new Color(0.8f, 0.7f, 1f), EconomyType.Skyrmion => new Color(0.6f, 1f, 0.7f), EconomyType.Soliton => new Color(0.9f, 0.6f, 0.8f), EconomyType.Vortex => new Color(0.7f, 0.9f, 1f), EconomyType.DomainWall => new Color(0.8f, 0.5f, 0.7f), EconomyType.CosmicString => new Color(0.9f, 0.8f, 0.6f), EconomyType.Texture => new Color(0.6f, 0.7f, 0.9f), EconomyType.Monopole => new Color(0.8f, 0.9f, 0.7f), EconomyType.GlobalString => new Color(0.7f, 0.6f, 0.8f), EconomyType.LocalString => new Color(0.9f, 0.7f, 0.6f), EconomyType.AxionString => new Color(0.6f, 0.8f, 0.9f), EconomyType.Superstring => new Color(1f, 0.5f, 0.8f), EconomyType.Heterotic => new Color(0.8f, 0.9f, 0.5f), EconomyType.TypeI => new Color(0.7f, 0.6f, 1f), EconomyType.TypeIIA => new Color(0.9f, 0.8f, 0.7f), EconomyType.TypeIIB => new Color(0.6f, 0.9f, 0.8f), EconomyType.HO => new Color(0.8f, 0.7f, 0.6f), EconomyType.E6 => new Color(0.7f, 0.8f, 0.9f), EconomyType.E7 => new Color(0.9f, 0.6f, 0.7f), EconomyType.E8 => new Color(0.8f, 0.9f, 1f), EconomyType.SU5 => new Color(0.6f, 0.7f, 0.8f), EconomyType.SO10 => new Color(0.9f, 0.8f, 0.5f), EconomyType.SUSY => new Color(0.7f, 0.9f, 0.8f), EconomyType.MSSM => new Color(0.8f, 0.6f, 0.9f), EconomyType.NMSSM => new Color(0.9f, 0.7f, 0.6f), EconomyType.AMSB => new Color(0.6f, 0.8f, 0.9f), EconomyType.GMSB => new Color(0.8f, 0.9f, 0.7f), EconomyType.KKLT => new Color(0.7f, 0.6f, 0.8f), EconomyType.LVS => new Color(0.9f, 0.8f, 0.9f), EconomyType.RS => new Color(0.6f, 0.9f, 0.7f), EconomyType.ADD => new Color(0.8f, 0.7f, 0.9f), EconomyType.UED => new Color(0.9f, 0.6f, 0.8f), EconomyType.TC2 => new Color(0.7f, 0.8f, 0.6f), EconomyType.LR => new Color(0.8f, 0.9f, 0.8f), EconomyType.ALR => new Color(0.6f, 0.7f, 0.9f), EconomyType.VLQ => new Color(0.9f, 0.8f, 0.7f), EconomyType.SMEFT => new Color(0.7f, 0.9f, 0.6f), EconomyType.EFT => new Color(0.8f, 0.6f, 0.9f), _ => Color.gray, }); } public static string GetEconomyNameForId(string economyId, string forcedLanguage = "English") { if (string.IsNullOrWhiteSpace(economyId)) { return string.Empty; } EconomyType currentEconomy = CurrentEconomy; CustomEconomyData currentCustomEconomy = CurrentCustomEconomy; bool hasEconomy = HasEconomy; try { CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData c) => string.Equals(c.id, economyId, StringComparison.OrdinalIgnoreCase)); if (customEconomyData != null) { CurrentCustomEconomy = customEconomyData; HasEconomy = true; return GetEconomyName(forcedLanguage); } if (Enum.TryParse(economyId, ignoreCase: true, out var result)) { CurrentCustomEconomy = null; CurrentEconomy = result; HasEconomy = true; return GetEconomyName(forcedLanguage); } return string.Empty; } finally { CurrentEconomy = currentEconomy; CurrentCustomEconomy = currentCustomEconomy; HasEconomy = hasEconomy; } } public static string GetEconomyFlavorForId(string economyId, string forcedLanguage = "English") { if (string.IsNullOrWhiteSpace(economyId)) { return string.Empty; } EconomyType currentEconomy = CurrentEconomy; CustomEconomyData currentCustomEconomy = CurrentCustomEconomy; bool hasEconomy = HasEconomy; try { CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData c) => string.Equals(c.id, economyId, StringComparison.OrdinalIgnoreCase)); if (customEconomyData != null) { CurrentCustomEconomy = customEconomyData; HasEconomy = true; return GetEconomyFlavor(forcedLanguage); } if (Enum.TryParse(economyId, ignoreCase: true, out var result)) { CurrentCustomEconomy = null; CurrentEconomy = result; HasEconomy = true; return GetEconomyFlavor(forcedLanguage); } return string.Empty; } finally { CurrentEconomy = currentEconomy; CurrentCustomEconomy = currentCustomEconomy; HasEconomy = hasEconomy; } } public static Color GetEconomyColorForId(string economyId, Color fallback) { //IL_001a: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) if (string.IsNullOrWhiteSpace(economyId)) { return fallback; } CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData c) => string.Equals(c.id, economyId, StringComparison.OrdinalIgnoreCase)); if (customEconomyData?.color != null && customEconomyData.color.Length >= 3) { return new Color(customEconomyData.color[0] / 255f, customEconomyData.color[1] / 255f, customEconomyData.color[2] / 255f); } EconomyType currentEconomy = CurrentEconomy; CustomEconomyData currentCustomEconomy = CurrentCustomEconomy; bool hasEconomy = HasEconomy; try { if (Enum.TryParse(economyId, ignoreCase: true, out var result)) { if (result == EconomyType.EconomicTwister) { return Color.Lerp(Color.red, Color.green, 0.5f); } CurrentCustomEconomy = null; CurrentEconomy = result; HasEconomy = true; return GetEconomyColor(); } return fallback; } finally { CurrentEconomy = currentEconomy; CurrentCustomEconomy = currentCustomEconomy; HasEconomy = hasEconomy; } } public static void ResetEconomy() { HasEconomy = false; MinPercent = 0f; MaxPercent = 0f; CurrentEconomy = EconomyType.Stable; ValuablePatch.ResetKraken(); Patch_ValuableSpawn_Override.Reset(); REPOEventPatchesReset.ResetAll(); ProcessedByEconomy.Clear(); EconomyAdjustedValues.Clear(); if ((Object)(object)RunManager.instance != (Object)null && RunManager.instance.enemiesSpawned.Count > 0) { Logger.LogInfo((object)$"[Economy] Clearing {RunManager.instance.enemiesSpawned.Count} enemies from previous run"); RunManager.instance.enemiesSpawned.Clear(); } Logger.LogInfo((object)"[Economy] The economy has been reset. Ready for a new race."); } } public static class REPODifficultyManager { public static float CurrentDifficulty { get; private set; } public static void SetDifficulty(float difficulty) { CurrentDifficulty = difficulty; REPOConomyPlugin.Logger.LogInfo((object)$"[Difficulty] Set to: {difficulty:F1}"); } public static void CalculateDifficulty() { if (!SemiFunc.IsMasterClientOrSingleplayer()) { REPOConomyPlugin.Logger.LogInfo((object)"[Difficulty] Skipped - not host"); return; } float num = 0f; int currentLevel = REPOConomyPlugin.GetCurrentLevel(); float num2 = (float)Mathf.Max(0, currentLevel - 1) * REPOConfig.DifficultyPerLevel.Value; int num3 = 0; if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null) { num3 = GameDirector.instance.PlayerList.Count; } float num4 = (float)num3 * REPOConfig.DifficultyPerPlayer.Value; int num5 = 0; if ((Object)(object)ValuableDirector.instance != (Object)null && ValuableDirector.instance.valuableList != null) { num5 = ValuableDirector.instance.valuableList.Count; } float num6 = (float)num5 * REPOConfig.DifficultyPerValuable.Value; num = num2 + num4 + num6; num = (CurrentDifficulty = Mathf.Clamp(num, 0f, REPOConfig.DifficultyMaxCap.Value)); REPOConomyPlugin.Logger.LogInfo((object)$"[Difficulty] Total: {num:F1} (Level: {num2:F1}, Players: {num4:F1} [{num3} players], Valuables: {num6:F1} [{num5} items])"); if (PhotonNetwork.IsMasterClient) { SyncDifficultyToClients(); } } private static void SyncDifficultyToClients() { //IL_0014: 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_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) try { object[] array = new object[1] { CurrentDifficulty }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)181, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[Difficulty] \ud83d\udce4 Synced to clients: {CurrentDifficulty:F1}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Difficulty] Sync error: " + ex.Message)); } } public static string GetDifficultyText() { if (CurrentDifficulty < 20f) { return "Easy"; } if (CurrentDifficulty < 40f) { return "Medium"; } if (CurrentDifficulty < 60f) { return "Hard"; } if (CurrentDifficulty < 80f) { return "Very Hard"; } return "Extreme"; } public static Color GetDifficultyColor() { //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_001c: Unknown result type (might be due to invalid IL or missing references) float num = CurrentDifficulty / REPOConfig.DifficultyMaxCap.Value; return Color.Lerp(Color.green, Color.red, num); } } public enum EventCategory { Economy, LootModifier, EnemyModifier, PlayerModifier, EnvironmentModifier } public enum EventType { VeryGood, Good, Neutral, Bad, VeryBad } public class GameEvent { public string id; public string name_en; public string name_ru; public string name_ko; public string desc_en; public string desc_ru; public string desc_ko; public EventCategory category; public EventType eventType; public Color color; public Action onActivate; public Action onDeactivate; public List conflictsWith = new List(); public string GetName() { string value = REPOConfig.UILanguage.Value; if (value == "Korean" && !string.IsNullOrWhiteSpace(name_ko)) { return name_ko; } if (value == "Russian" && !string.IsNullOrWhiteSpace(name_ru)) { return name_ru; } return name_en; } public string GetDescription() { string value = REPOConfig.UILanguage.Value; if (value == "Korean" && !string.IsNullOrWhiteSpace(desc_ko)) { return desc_ko; } if (value == "Russian" && !string.IsNullOrWhiteSpace(desc_ru)) { return desc_ru; } return desc_en; } } public static class REPOEventManager { public static List AllEvents = new List(); public static List ActiveEvents = new List(); public static List ForcedEvents = new List(); public static Dictionary cartScaleTable = new Dictionary(); public static Dictionary extractionScaleTable = new Dictionary(); private static readonly float[] SharedPoolBaseWeights = new float[5] { 11f, 23f, 13f, 43f, 9f }; private static readonly float[] SharedPoolIncrements = new float[5] { 0.14f, -0.1f, -0.05f, -0.15f, 0.25f }; private static readonly float[] SharedPoolMinCaps = new float[5] { 9f, 13f, 7f, 28f, 9f }; private static readonly float[] SharedPoolMaxCaps = new float[5] { 23f, 23f, 12f, 43f, 34f }; public static float EnemySpeedMultiplier = 1f; public static float EnemySpawnMultiplier = 1f; public static float PlayerSpeedMultiplier = 1f; public static float PlayerHealthMultiplier = 1f; public static float ValuableCountMultiplier = 1f; public static float EnemiesFasterOnKillMultiplier = 1f; public static int EnemiesFasterOnKillCount = 0; public static bool EnemiesInvisible = false; public static bool EnemiesPacifist = false; public static bool PlayersInvisible = false; public static bool GoldenTouch = false; public static bool InvertedControls = false; public static bool FoggyVision = false; public static bool RandomBoosts = false; public static bool HealthRegeneration = false; public static bool FrozenEnemies = false; public static bool MagneticValuables = false; public static bool ToxicAir = false; public static bool EnemyMultiplication = false; public static bool SuperJump = false; public static bool NightVision = false; public static bool LuckyFind = false; public static bool StickyFeet = false; public static bool TimeWarp = false; public static bool InfiniteAmmo = false; public static bool OneHitKill = false; public static bool OneHitKillPlayers = false; public static bool HealthVampire = false; public static bool ExtractionRush = false; public static bool ExtractionMagnet = false; public static bool ExtractionShield = false; public static bool ExtractionChaos = false; public static bool SingleExtraction = false; public static bool DoublePlayerDamage = false; public static bool DoubleEnemyHealth = false; public static bool HalfPlayerDamage = false; public static bool DoubleEnemyDamage = false; public static bool ValuablesUnbreakable = false; public static bool ValuablesFragile = false; public static bool FeatherWeight = false; public static bool HeavyBurden = false; public static bool EnemyHeavyWeight = false; public static bool EnemyLightWeight = false; public static bool EnemiesFasterOnKill = false; public static bool CriticalHits = false; public static bool InstantRespawn = false; public static bool PersistentEnemies = false; public static bool ExplosiveValuables = false; public static bool SlipperyChaos = false; public static bool ZeroGravityLoot = false; public static bool PhantomObjects = false; public static bool BouncyHavoc = false; public static bool ScaleInCart = false; public static bool HotPotato = false; public static bool UnbreakableDoors = false; public static bool PlayerRevival = false; public static bool ShrinkExtractionValuables = false; public static bool EnemiesOmniscient = false; public static bool BossFight = false; public static bool TooQuiet = false; public static bool InvincibleHorror = false; public static bool PitImmunity = false; public static bool EnemiesPitImmunity = false; public static bool UnstableGrabbing = false; public static bool NoOvercharge = false; public static bool LevelGlitch = false; public static bool SettleItInSmash = false; public static bool FoundMap = false; public static string SelectedSizeRestriction = null; public static bool SuperRecoil = false; public static bool JammingGuns = false; public static bool CheapBatteries = false; public static bool ExplosiveTumble = false; public static bool GlassBones = false; public static bool SlipperyHands = false; public static bool GiantPlayer = false; public static bool TinyPlayer = false; public static bool WeakArms = false; public static bool StrongArms = false; public static bool Earthquake = false; public static bool NoJump = false; public static bool TotalDarkness = false; public static bool KamikazeEnemies = false; public static bool RegeneratingEnemies = false; public static bool TeleportingEnemies = false; public static bool ShadowClones = false; public static bool DangerousValuables = false; public static bool CloakedValuables = false; public static bool RunawayValuables = false; public static bool Dodge = false; public static bool ChainReaction = false; public static bool FakeValuables = false; public static bool ValueDecay = false; public static bool EnemyHealOnDamage = false; public static bool PlayerDeaf = false; public static bool SharedPain = false; public static bool SharedHealing = false; public static bool LowHealthSpeedBoost = false; public static bool ValuableEncumbrance = false; public static bool SpeedZones = false; public static bool RandomPlayerTeleportations = false; public static bool StickyValuables = false; public static bool ExplosiveThrowValuables = false; public static bool RoomGravity = false; public static bool DoubleJump = false; public static bool NoFallDamage = false; public static bool DamageTradeoff = false; public static bool CursedValuables = false; public static bool AlarmSystem = false; public static bool EnemyTouchShock = false; public static bool WoundedFury = false; public static bool Executioner = false; public static bool LifestealStrikes = false; public static bool LastBreath = false; public static bool Thorns = false; public static bool GlassEnemies = false; public static bool BountifulKills = false; public static bool TaxSeason = false; public static bool RiskReward = false; public static bool Bloodthirst = false; public static bool IronWill = false; public static bool GuardianShield = false; public static bool DamageWard = false; public static bool TitansVigor = false; public static bool RegenerationAura = false; public static bool BloodthirstyHealer = false; public static bool BerserkersResolve = false; public static bool ExecutionersEdge = false; public static bool LastStand = false; public static bool SecondWind = false; public static bool FirstStrike = false; public static bool AdrenalineSurge = false; public static bool Brawler = false; public static bool Toughened = false; public static bool Frailty = false; public static bool Feeble = false; public static bool GlassJaw = false; public static bool PainAmplifier = false; public static bool AdrenalineCrash = false; public static bool Exhausted = false; public static bool RecoilStrikes = false; public static bool Vulnerable = false; public static bool SoulDrain = false; public static bool Crippled = false; public static bool CowardsCurse = false; public static bool FaintHeart = false; public static bool SlowHealing = false; public static bool SluggishRecovery = false; public static bool AchillesHeel = false; public static bool StageFright = false; public static bool ThinSkin = false; public static bool RecklessSwings = false; public static bool SoftBlows = false; public static bool Fumble = false; public static bool RecklessPower = false; public static bool VampiricPact = false; public static bool AdrenalineCycle = false; public static bool Gambler = false; public static bool CoinFlipDefense = false; public static bool BerserkersBargain = false; public static bool BloodPrice = false; public static bool Equalizer = false; public static bool TugOfWar = false; public static bool Pendulum = false; public static bool JuggernautEnemies = false; public static bool ArmoredHides = false; public static bool BrutalEnemies = false; public static bool ThornedEnemies = false; public static bool HardenedCores = false; public static bool DeathThroes = false; public static bool PlagueBearers = false; public static bool PackTactics = false; public static bool PhaseShield = false; public static bool VengefulHorde = false; public static bool PaperEnemies = false; public static bool BrittleBonesEnemies = false; public static bool FeebleFoes = false; public static bool GoldenEnemies = false; public static bool SelfDestructEnemies = false; public static bool ExposedCores = false; public static bool BleedingEnemies = false; public static bool GlassJawEnemies = false; public static bool ExposedWeakpoint = false; public static bool Lootsplosion = false; public static bool ToughSkin = false; public static bool BulkyEnemies = false; public static bool AggressiveEnemies = false; public static bool ResilientCores = false; public static bool QuickRecovery = false; public static bool HardyEnemies = false; public static bool SecondSkin = false; public static bool VengefulSparks = false; public static bool PackInstinct = false; public static bool EvasiveEnemies = false; public static bool BerserkerEnemies = false; public static bool GlassCannonEnemies = false; public static bool ErraticEnemies = false; public static bool GamblingFoes = false; public static bool VampiricFoes = false; public static bool AdaptiveEnemies = false; public static bool VolatileCores = false; public static bool EnragedOnHit = false; public static bool ScavengerEnemies = false; public static bool ToughLove = false; public static bool SoftTargets = false; public static bool FrailEnemies = false; public static bool ClumsyEnemies = false; public static bool SoftSpot = false; public static bool StumblingEnemies = false; public static bool GenerousKills = false; public static bool SoulHarvest = false; public static bool BrittleShells = false; public static bool Bonanza = false; public static bool LuckyStrike = false; public static bool ValueFloor = false; public static bool HeavyweightBonus = false; public static bool CompoundInterest = false; public static bool TreasureSense = false; public static bool DiamondLoot = false; public static bool Salvage = false; public static bool PristineValuables = false; public static bool LuckyLottery = false; public static bool GlassDividendReward = false; public static bool PitInsuranceReward = false; public static bool StormSurgeReward = false; public static bool DebtSilenceReward = false; public static bool LuckyEchoesReward = false; public static bool MagneticMarginReward = false; public static bool FinalNoticeReward = false; public static bool CenturionCompoundReward = false; public static bool Bankruptcy = false; public static bool Pyrite = false; public static bool WorthlessHeavies = false; public static bool CrumblingTreasures = false; public static bool LeakyValue = false; public static bool Spoilage = false; public static bool GlassHoard = false; public static bool VolatileWealth = false; public static bool DiminishingHoard = false; public static bool FoolsAbundance = false; public static bool Windfall = false; public static bool LightweightPremium = false; public static bool HiddenGems = false; public static bool TreasureTrove = false; public static bool PaddedValuables = false; public static bool ReinforcedEdges = false; public static bool SecondChance = false; public static bool GoldenCart = false; public static bool SurgeDemand = false; public static bool AppraisersGlow = false; public static bool LightweightTax = false; public static bool Misfortune = false; public static bool WornEdges = false; public static bool FadingFortune = false; public static bool Tarnish = false; public static bool BruisedGoods = false; public static bool HeavyPockets = false; public static bool HandlingFee = false; public static bool BrittleHandling = false; public static bool BoomOrBust = false; public static bool JackpotGamble = false; public static bool Counterweight = false; public static bool RiskPremium = false; public static bool SlowInflation = false; public static bool LiquidationSale = false; public static bool HeadsOrTails = false; public static bool WeightSwap = false; public static bool LuckyDip = false; public static bool LongReach = false; public static bool BigLungs = false; public static bool Tailwind = false; public static bool SpringyLegs = false; public static bool NinjaCrouch = false; public static bool CrystalAir = false; public static bool ExtractionBeacons = false; public static bool EnergizedAtmosphere = false; public static bool LunarFacility = false; public static bool SparseEnemies = false; public static bool RichFacility = false; public static bool QuietFacility = false; public static bool LightQuota = false; public static bool ScatteredRiches = false; public static bool FleetingEnemies = false; public static bool GenerousExtraction = false; public static bool HeavyQuota = false; public static bool PoorFacility = false; public static bool EchoingHalls = false; public static bool RelentlessEnemies = false; public static bool FlickeringPower = false; public static bool LootedFacility = false; public static bool ExhaustingAir = false; public static bool PowerSurge = false; public static bool HazardousSparks = false; public static bool PhantomQuota = false; public static bool DimFacility = false; public static bool StiffDoors = false; public static bool AgedTubes = false; public static bool FrostCreep = false; public static bool CreakyFloors = false; public static bool ModestQuota = false; public static bool TightBudget = false; public static bool StuffyAir = false; public static bool CrampedFacility = false; public static bool ColdFacility = false; public static bool ColoredLights = false; public static bool PulsingLights = false; public static bool FloatingDust = false; public static bool ReverbHall = false; public static bool SpaciousFacility = false; public static bool LowStakes = false; public static bool ShuffledLoot = false; public static bool WeakSwarm = false; public static bool EliteGuard = false; public static bool HighStakes = false; public static bool SluggishEnemies = false; public static bool ReducedQuota = false; public static bool FairBonus = false; public static bool FreshAir = false; public static bool MuffledHalls = false; public static bool ThinnedPatrols = false; public static bool RoomyExtractions = false; public static bool LuckyScraps = false; public static bool SwiftTubes = false; public static bool MagneticCarts = false; public static bool DeafToMonsters = false; public static bool AdrenalineHunters = false; public static bool TankyButGentle = false; public static bool TierMercy = false; public static bool SuicidalAttackers = false; public static bool BlinkingHaze = false; public static bool ManyExtractions = false; public static bool LoneWolf = false; public static bool RestorativeRooms = false; public static bool HostileRooms = false; public static bool MapDisabled = false; public static bool HalfStamina = false; public static bool GlassRunner = false; public static bool KillRecharge = false; public static bool TripledUpgrades = false; public static bool ValueDrainHeld = false; public static bool BulkyCargo = false; public static bool OffGrid = false; public static bool VitalHaul = false; public static bool BattleHardened = false; private static readonly HashSet MultiplayerOnlyModifierIds = new HashSet(StringComparer.OrdinalIgnoreCase) { "shared_pain", "shared_healing", "invisible_players" }; public static void Initialize() { REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] Initializing events..."); AllEvents.Clear(); RegisterAllEvents(); ConfigureConflictRules(); REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] Registered {AllEvents.Count} events"); } private static void ConfigureConflictRules() { AddConflictAgainst("one_hit_kill_players", "glass_cannon", "toxic_air", "hot_potato", "dangerous_valuables", "cursed_valuables", "shared_pain", "double_player_damage", "damage_tradeoff", "glass_bones", "explosive_tumble", "enemy_touch_shock", "health_regeneration"); AddConflictAgainst("glass_cannon", "toxic_air", "hot_potato", "dangerous_valuables", "cursed_valuables", "shared_pain", "double_player_damage", "damage_tradeoff", "glass_bones", "explosive_tumble", "enemy_touch_shock", "health_regeneration"); AddConflictAgainst("one_hit_kill", "double_enemy_damage", "critical_hits", "damage_tradeoff", "double_enemy_health", "regenerating_enemies", "enemy_heal_on_damage"); AddConflictGroup("enemy_horde", "enemy_multiplication"); AddConflictAgainst("pacifist_mode", "enemy_heal_on_damage", "extraction_chaos", "enemy_touch_shock"); AddConflictAgainst("no_jump", "double_jump"); AddConflictAgainst("no_fall_damage", "glass_bones", "explosive_tumble", "settle_it_in_smash"); AddConflictGroup("pit_immunity", "settle_it_in_smash"); AddConflictGroup("sticky_feet", "slippery_floor"); AddConflictAgainst("slippery_hands", "sticky_valuables", "stable_grip"); AddConflictGroup("heavy_burden", "feather_weight"); AddConflictGroup("magnetic_valuables", "runaway_valuables"); AddConflictAgainst("valuables_unbreakable", "chain_reaction", "alarm_system"); AddConflictGroup("total_darkness", "night_vision"); NormalizeConflictRules(); } private static bool IsModifierAllowedForCurrentPlayerCount(GameEvent gameEvent) { if (gameEvent == null || string.IsNullOrWhiteSpace(gameEvent.id)) { return false; } if (!MultiplayerOnlyModifierIds.Contains(gameEvent.id)) { return true; } bool num = HasMultiplePlayersForMultiplayerOnlyModifiers(); if (!num) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Skipping multiplayer-only modifier in solo: " + gameEvent.id)); } return num; } private static bool HasMultiplePlayersForMultiplayerOnlyModifiers() { try { if (PhotonNetwork.InRoom && PhotonNetwork.CurrentRoom != null) { return PhotonNetwork.CurrentRoom.PlayerCount > 1; } if ((Object)(object)GameDirector.instance != (Object)null && GameDirector.instance.PlayerList != null) { return GameDirector.instance.PlayerList.Count((PlayerAvatar player) => (Object)(object)player != (Object)null) > 1; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[EventManager] Failed to read player count for multiplayer-only modifiers: " + ex.Message)); } return false; } private static void AddConflictAgainst(string anchorId, params string[] conflictIds) { if (conflictIds != null) { foreach (string secondId in conflictIds) { AddConflictPair(anchorId, secondId); } } } private static void AddConflictGroup(params string[] ids) { if (ids == null || ids.Length < 2) { return; } for (int i = 0; i < ids.Length; i++) { for (int j = i + 1; j < ids.Length; j++) { AddConflictPair(ids[i], ids[j]); } } } private static void AddConflictPair(string firstId, string secondId) { GameEvent gameEvent = FindEvent(firstId); GameEvent gameEvent2 = FindEvent(secondId); if (gameEvent != null && gameEvent2 != null) { AddConflictId(gameEvent, gameEvent2.id); AddConflictId(gameEvent2, gameEvent.id); } } private static void NormalizeConflictRules() { foreach (GameEvent item in AllEvents.ToList()) { if (item?.conflictsWith == null) { continue; } foreach (string item2 in item.conflictsWith.ToList()) { GameEvent gameEvent = FindEvent(item2); if (gameEvent != null) { AddConflictId(gameEvent, item.id); } } } } private static GameEvent FindEvent(string id) { if (string.IsNullOrWhiteSpace(id)) { return null; } return AllEvents.FirstOrDefault((GameEvent e) => e != null && string.Equals(e.id, id, StringComparison.OrdinalIgnoreCase)); } private static void AddConflictId(GameEvent gameEvent, string conflictId) { if (gameEvent != null && !string.IsNullOrWhiteSpace(conflictId)) { if (gameEvent.conflictsWith == null) { gameEvent.conflictsWith = new List(); } if (!gameEvent.conflictsWith.Any((string id) => string.Equals(id, conflictId, StringComparison.OrdinalIgnoreCase))) { gameEvent.conflictsWith.Add(conflictId); } } } private static void RegisterAllEvents() { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_0323: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03cb: Unknown result type (might be due to invalid IL or missing references) //IL_048f: Unknown result type (might be due to invalid IL or missing references) //IL_0494: Unknown result type (might be due to invalid IL or missing references) //IL_0542: Unknown result type (might be due to invalid IL or missing references) //IL_0547: Unknown result type (might be due to invalid IL or missing references) //IL_05ea: Unknown result type (might be due to invalid IL or missing references) //IL_05ef: Unknown result type (might be due to invalid IL or missing references) //IL_0692: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) //IL_0755: Unknown result type (might be due to invalid IL or missing references) //IL_07f8: Unknown result type (might be due to invalid IL or missing references) //IL_07fd: Unknown result type (might be due to invalid IL or missing references) //IL_08ab: Unknown result type (might be due to invalid IL or missing references) //IL_08b0: Unknown result type (might be due to invalid IL or missing references) //IL_095e: Unknown result type (might be due to invalid IL or missing references) //IL_0963: Unknown result type (might be due to invalid IL or missing references) //IL_0a06: Unknown result type (might be due to invalid IL or missing references) //IL_0a0b: Unknown result type (might be due to invalid IL or missing references) //IL_0ab9: Unknown result type (might be due to invalid IL or missing references) //IL_0abe: Unknown result type (might be due to invalid IL or missing references) //IL_0b6c: Unknown result type (might be due to invalid IL or missing references) //IL_0b71: Unknown result type (might be due to invalid IL or missing references) //IL_0c1f: Unknown result type (might be due to invalid IL or missing references) //IL_0c24: Unknown result type (might be due to invalid IL or missing references) //IL_0cc7: Unknown result type (might be due to invalid IL or missing references) //IL_0ccc: Unknown result type (might be due to invalid IL or missing references) //IL_0d6f: Unknown result type (might be due to invalid IL or missing references) //IL_0d74: Unknown result type (might be due to invalid IL or missing references) //IL_0e22: Unknown result type (might be due to invalid IL or missing references) //IL_0e27: Unknown result type (might be due to invalid IL or missing references) //IL_0eca: Unknown result type (might be due to invalid IL or missing references) //IL_0ecf: Unknown result type (might be due to invalid IL or missing references) //IL_0f88: Unknown result type (might be due to invalid IL or missing references) //IL_0f8d: Unknown result type (might be due to invalid IL or missing references) //IL_1046: Unknown result type (might be due to invalid IL or missing references) //IL_104b: Unknown result type (might be due to invalid IL or missing references) //IL_10f9: Unknown result type (might be due to invalid IL or missing references) //IL_10fe: Unknown result type (might be due to invalid IL or missing references) //IL_11ac: Unknown result type (might be due to invalid IL or missing references) //IL_11b1: Unknown result type (might be due to invalid IL or missing references) //IL_1280: Unknown result type (might be due to invalid IL or missing references) //IL_1285: Unknown result type (might be due to invalid IL or missing references) //IL_1349: Unknown result type (might be due to invalid IL or missing references) //IL_134e: Unknown result type (might be due to invalid IL or missing references) //IL_13f1: Unknown result type (might be due to invalid IL or missing references) //IL_13f6: Unknown result type (might be due to invalid IL or missing references) //IL_1499: Unknown result type (might be due to invalid IL or missing references) //IL_149e: Unknown result type (might be due to invalid IL or missing references) //IL_1541: Unknown result type (might be due to invalid IL or missing references) //IL_1546: Unknown result type (might be due to invalid IL or missing references) //IL_1620: Unknown result type (might be due to invalid IL or missing references) //IL_1625: Unknown result type (might be due to invalid IL or missing references) //IL_16c8: Unknown result type (might be due to invalid IL or missing references) //IL_16cd: Unknown result type (might be due to invalid IL or missing references) //IL_1770: Unknown result type (might be due to invalid IL or missing references) //IL_1775: Unknown result type (might be due to invalid IL or missing references) //IL_1818: Unknown result type (might be due to invalid IL or missing references) //IL_181d: Unknown result type (might be due to invalid IL or missing references) //IL_18c0: Unknown result type (might be due to invalid IL or missing references) //IL_18c5: Unknown result type (might be due to invalid IL or missing references) //IL_1968: Unknown result type (might be due to invalid IL or missing references) //IL_196d: Unknown result type (might be due to invalid IL or missing references) //IL_1a10: Unknown result type (might be due to invalid IL or missing references) //IL_1a15: Unknown result type (might be due to invalid IL or missing references) //IL_1ab8: Unknown result type (might be due to invalid IL or missing references) //IL_1abd: Unknown result type (might be due to invalid IL or missing references) //IL_1b60: Unknown result type (might be due to invalid IL or missing references) //IL_1b65: Unknown result type (might be due to invalid IL or missing references) //IL_1c08: Unknown result type (might be due to invalid IL or missing references) //IL_1c0d: Unknown result type (might be due to invalid IL or missing references) //IL_1cbb: Unknown result type (might be due to invalid IL or missing references) //IL_1cc0: Unknown result type (might be due to invalid IL or missing references) //IL_1d84: Unknown result type (might be due to invalid IL or missing references) //IL_1d89: Unknown result type (might be due to invalid IL or missing references) //IL_1e2c: Unknown result type (might be due to invalid IL or missing references) //IL_1e31: Unknown result type (might be due to invalid IL or missing references) //IL_1ed4: Unknown result type (might be due to invalid IL or missing references) //IL_1ed9: Unknown result type (might be due to invalid IL or missing references) //IL_1f87: Unknown result type (might be due to invalid IL or missing references) //IL_1f8c: Unknown result type (might be due to invalid IL or missing references) //IL_203a: Unknown result type (might be due to invalid IL or missing references) //IL_203f: Unknown result type (might be due to invalid IL or missing references) //IL_20e2: Unknown result type (might be due to invalid IL or missing references) //IL_20e7: Unknown result type (might be due to invalid IL or missing references) //IL_218a: Unknown result type (might be due to invalid IL or missing references) //IL_218f: Unknown result type (might be due to invalid IL or missing references) //IL_2232: Unknown result type (might be due to invalid IL or missing references) //IL_2237: Unknown result type (might be due to invalid IL or missing references) //IL_22da: Unknown result type (might be due to invalid IL or missing references) //IL_22df: Unknown result type (might be due to invalid IL or missing references) //IL_2382: Unknown result type (might be due to invalid IL or missing references) //IL_2387: Unknown result type (might be due to invalid IL or missing references) //IL_242a: Unknown result type (might be due to invalid IL or missing references) //IL_242f: Unknown result type (might be due to invalid IL or missing references) //IL_24d2: Unknown result type (might be due to invalid IL or missing references) //IL_24d7: Unknown result type (might be due to invalid IL or missing references) //IL_261f: Unknown result type (might be due to invalid IL or missing references) //IL_2624: Unknown result type (might be due to invalid IL or missing references) //IL_26c7: Unknown result type (might be due to invalid IL or missing references) //IL_26cc: Unknown result type (might be due to invalid IL or missing references) //IL_27a6: Unknown result type (might be due to invalid IL or missing references) //IL_27ab: Unknown result type (might be due to invalid IL or missing references) //IL_284e: Unknown result type (might be due to invalid IL or missing references) //IL_2853: Unknown result type (might be due to invalid IL or missing references) //IL_28f6: Unknown result type (might be due to invalid IL or missing references) //IL_28fb: Unknown result type (might be due to invalid IL or missing references) //IL_29a9: Unknown result type (might be due to invalid IL or missing references) //IL_29ae: Unknown result type (might be due to invalid IL or missing references) //IL_2a51: Unknown result type (might be due to invalid IL or missing references) //IL_2a56: Unknown result type (might be due to invalid IL or missing references) //IL_2b04: Unknown result type (might be due to invalid IL or missing references) //IL_2b09: Unknown result type (might be due to invalid IL or missing references) //IL_2bb7: Unknown result type (might be due to invalid IL or missing references) //IL_2bbc: Unknown result type (might be due to invalid IL or missing references) //IL_2c5f: Unknown result type (might be due to invalid IL or missing references) //IL_2c64: Unknown result type (might be due to invalid IL or missing references) //IL_2d07: Unknown result type (might be due to invalid IL or missing references) //IL_2d0c: Unknown result type (might be due to invalid IL or missing references) //IL_2daf: Unknown result type (might be due to invalid IL or missing references) //IL_2db4: Unknown result type (might be due to invalid IL or missing references) //IL_2e57: Unknown result type (might be due to invalid IL or missing references) //IL_2e5c: Unknown result type (might be due to invalid IL or missing references) //IL_2eff: Unknown result type (might be due to invalid IL or missing references) //IL_2f04: Unknown result type (might be due to invalid IL or missing references) //IL_2fa7: Unknown result type (might be due to invalid IL or missing references) //IL_2fac: Unknown result type (might be due to invalid IL or missing references) //IL_304f: Unknown result type (might be due to invalid IL or missing references) //IL_3054: Unknown result type (might be due to invalid IL or missing references) //IL_30f7: Unknown result type (might be due to invalid IL or missing references) //IL_30fc: Unknown result type (might be due to invalid IL or missing references) //IL_319f: Unknown result type (might be due to invalid IL or missing references) //IL_31a4: Unknown result type (might be due to invalid IL or missing references) //IL_3247: Unknown result type (might be due to invalid IL or missing references) //IL_324c: Unknown result type (might be due to invalid IL or missing references) //IL_32ef: Unknown result type (might be due to invalid IL or missing references) //IL_32f4: Unknown result type (might be due to invalid IL or missing references) //IL_3397: Unknown result type (might be due to invalid IL or missing references) //IL_339c: Unknown result type (might be due to invalid IL or missing references) //IL_343f: Unknown result type (might be due to invalid IL or missing references) //IL_3444: Unknown result type (might be due to invalid IL or missing references) //IL_34e7: Unknown result type (might be due to invalid IL or missing references) //IL_34ec: Unknown result type (might be due to invalid IL or missing references) //IL_35b0: Unknown result type (might be due to invalid IL or missing references) //IL_35b5: Unknown result type (might be due to invalid IL or missing references) //IL_3658: Unknown result type (might be due to invalid IL or missing references) //IL_365d: Unknown result type (might be due to invalid IL or missing references) //IL_3700: Unknown result type (might be due to invalid IL or missing references) //IL_3705: Unknown result type (might be due to invalid IL or missing references) //IL_37a8: Unknown result type (might be due to invalid IL or missing references) //IL_37ad: Unknown result type (might be due to invalid IL or missing references) //IL_3850: Unknown result type (might be due to invalid IL or missing references) //IL_3855: Unknown result type (might be due to invalid IL or missing references) //IL_38f8: Unknown result type (might be due to invalid IL or missing references) //IL_38fd: Unknown result type (might be due to invalid IL or missing references) //IL_3995: Unknown result type (might be due to invalid IL or missing references) //IL_399a: Unknown result type (might be due to invalid IL or missing references) //IL_3a48: Unknown result type (might be due to invalid IL or missing references) //IL_3a4d: Unknown result type (might be due to invalid IL or missing references) //IL_3afb: Unknown result type (might be due to invalid IL or missing references) //IL_3b00: Unknown result type (might be due to invalid IL or missing references) //IL_3bae: Unknown result type (might be due to invalid IL or missing references) //IL_3bb3: Unknown result type (might be due to invalid IL or missing references) //IL_3c61: Unknown result type (might be due to invalid IL or missing references) //IL_3c66: Unknown result type (might be due to invalid IL or missing references) //IL_3cfe: Unknown result type (might be due to invalid IL or missing references) //IL_3d03: Unknown result type (might be due to invalid IL or missing references) //IL_3d9b: Unknown result type (might be due to invalid IL or missing references) //IL_3da0: Unknown result type (might be due to invalid IL or missing references) //IL_3e43: Unknown result type (might be due to invalid IL or missing references) //IL_3e48: Unknown result type (might be due to invalid IL or missing references) //IL_3eeb: Unknown result type (might be due to invalid IL or missing references) //IL_3ef0: Unknown result type (might be due to invalid IL or missing references) //IL_3f93: Unknown result type (might be due to invalid IL or missing references) //IL_3f98: Unknown result type (might be due to invalid IL or missing references) //IL_403b: Unknown result type (might be due to invalid IL or missing references) //IL_4040: Unknown result type (might be due to invalid IL or missing references) //IL_40e3: Unknown result type (might be due to invalid IL or missing references) //IL_40e8: Unknown result type (might be due to invalid IL or missing references) //IL_418b: Unknown result type (might be due to invalid IL or missing references) //IL_4190: Unknown result type (might be due to invalid IL or missing references) //IL_4233: Unknown result type (might be due to invalid IL or missing references) //IL_4238: Unknown result type (might be due to invalid IL or missing references) //IL_42db: Unknown result type (might be due to invalid IL or missing references) //IL_42e0: Unknown result type (might be due to invalid IL or missing references) //IL_4383: Unknown result type (might be due to invalid IL or missing references) //IL_4388: Unknown result type (might be due to invalid IL or missing references) //IL_442b: Unknown result type (might be due to invalid IL or missing references) //IL_4430: Unknown result type (might be due to invalid IL or missing references) //IL_44d3: Unknown result type (might be due to invalid IL or missing references) //IL_44d8: Unknown result type (might be due to invalid IL or missing references) //IL_457b: Unknown result type (might be due to invalid IL or missing references) //IL_4580: Unknown result type (might be due to invalid IL or missing references) //IL_4623: Unknown result type (might be due to invalid IL or missing references) //IL_4628: Unknown result type (might be due to invalid IL or missing references) //IL_46cb: Unknown result type (might be due to invalid IL or missing references) //IL_46d0: Unknown result type (might be due to invalid IL or missing references) //IL_4773: Unknown result type (might be due to invalid IL or missing references) //IL_4778: Unknown result type (might be due to invalid IL or missing references) //IL_481b: Unknown result type (might be due to invalid IL or missing references) //IL_4820: Unknown result type (might be due to invalid IL or missing references) //IL_48c3: Unknown result type (might be due to invalid IL or missing references) //IL_48c8: Unknown result type (might be due to invalid IL or missing references) //IL_496b: Unknown result type (might be due to invalid IL or missing references) //IL_4970: Unknown result type (might be due to invalid IL or missing references) //IL_4a13: Unknown result type (might be due to invalid IL or missing references) //IL_4a18: Unknown result type (might be due to invalid IL or missing references) //IL_4abb: Unknown result type (might be due to invalid IL or missing references) //IL_4ac0: Unknown result type (might be due to invalid IL or missing references) //IL_4b63: Unknown result type (might be due to invalid IL or missing references) //IL_4b68: Unknown result type (might be due to invalid IL or missing references) //IL_4c0b: Unknown result type (might be due to invalid IL or missing references) //IL_4c10: Unknown result type (might be due to invalid IL or missing references) //IL_4cb3: Unknown result type (might be due to invalid IL or missing references) //IL_4cb8: Unknown result type (might be due to invalid IL or missing references) //IL_4d66: Unknown result type (might be due to invalid IL or missing references) //IL_4d6b: Unknown result type (might be due to invalid IL or missing references) //IL_4e0e: Unknown result type (might be due to invalid IL or missing references) //IL_4e13: Unknown result type (might be due to invalid IL or missing references) //IL_4ec1: Unknown result type (might be due to invalid IL or missing references) //IL_4ec6: Unknown result type (might be due to invalid IL or missing references) //IL_4f69: Unknown result type (might be due to invalid IL or missing references) //IL_4f6e: Unknown result type (might be due to invalid IL or missing references) //IL_5011: Unknown result type (might be due to invalid IL or missing references) //IL_5016: Unknown result type (might be due to invalid IL or missing references) //IL_50b9: Unknown result type (might be due to invalid IL or missing references) //IL_50be: Unknown result type (might be due to invalid IL or missing references) //IL_5161: Unknown result type (might be due to invalid IL or missing references) //IL_5166: Unknown result type (might be due to invalid IL or missing references) //IL_5209: Unknown result type (might be due to invalid IL or missing references) //IL_520e: Unknown result type (might be due to invalid IL or missing references) //IL_52b1: Unknown result type (might be due to invalid IL or missing references) //IL_52b6: Unknown result type (might be due to invalid IL or missing references) //IL_5359: Unknown result type (might be due to invalid IL or missing references) //IL_535e: Unknown result type (might be due to invalid IL or missing references) //IL_5401: Unknown result type (might be due to invalid IL or missing references) //IL_5406: Unknown result type (might be due to invalid IL or missing references) //IL_54a9: Unknown result type (might be due to invalid IL or missing references) //IL_54ae: Unknown result type (might be due to invalid IL or missing references) //IL_5551: Unknown result type (might be due to invalid IL or missing references) //IL_5556: Unknown result type (might be due to invalid IL or missing references) //IL_5604: Unknown result type (might be due to invalid IL or missing references) //IL_5609: Unknown result type (might be due to invalid IL or missing references) //IL_56ac: Unknown result type (might be due to invalid IL or missing references) //IL_56b1: Unknown result type (might be due to invalid IL or missing references) //IL_575f: Unknown result type (might be due to invalid IL or missing references) //IL_5764: Unknown result type (might be due to invalid IL or missing references) //IL_581d: Unknown result type (might be due to invalid IL or missing references) //IL_5822: Unknown result type (might be due to invalid IL or missing references) //IL_58c5: Unknown result type (might be due to invalid IL or missing references) //IL_58ca: Unknown result type (might be due to invalid IL or missing references) //IL_5983: Unknown result type (might be due to invalid IL or missing references) //IL_5988: Unknown result type (might be due to invalid IL or missing references) //IL_5a2b: Unknown result type (might be due to invalid IL or missing references) //IL_5a30: Unknown result type (might be due to invalid IL or missing references) //IL_5ad3: Unknown result type (might be due to invalid IL or missing references) //IL_5ad8: Unknown result type (might be due to invalid IL or missing references) //IL_5b7b: Unknown result type (might be due to invalid IL or missing references) //IL_5b80: Unknown result type (might be due to invalid IL or missing references) //IL_5c23: Unknown result type (might be due to invalid IL or missing references) //IL_5c28: Unknown result type (might be due to invalid IL or missing references) //IL_5ccb: Unknown result type (might be due to invalid IL or missing references) //IL_5cd0: Unknown result type (might be due to invalid IL or missing references) //IL_5d73: Unknown result type (might be due to invalid IL or missing references) //IL_5d78: Unknown result type (might be due to invalid IL or missing references) //IL_5e1b: Unknown result type (might be due to invalid IL or missing references) //IL_5e20: Unknown result type (might be due to invalid IL or missing references) //IL_5ec3: Unknown result type (might be due to invalid IL or missing references) //IL_5ec8: Unknown result type (might be due to invalid IL or missing references) //IL_5f6b: Unknown result type (might be due to invalid IL or missing references) //IL_5f70: Unknown result type (might be due to invalid IL or missing references) //IL_6013: Unknown result type (might be due to invalid IL or missing references) //IL_6018: Unknown result type (might be due to invalid IL or missing references) //IL_60bb: Unknown result type (might be due to invalid IL or missing references) //IL_60c0: Unknown result type (might be due to invalid IL or missing references) //IL_6163: Unknown result type (might be due to invalid IL or missing references) //IL_6168: Unknown result type (might be due to invalid IL or missing references) //IL_620b: Unknown result type (might be due to invalid IL or missing references) //IL_6210: Unknown result type (might be due to invalid IL or missing references) //IL_62df: Unknown result type (might be due to invalid IL or missing references) //IL_62e4: Unknown result type (might be due to invalid IL or missing references) //IL_6387: Unknown result type (might be due to invalid IL or missing references) //IL_638c: Unknown result type (might be due to invalid IL or missing references) //IL_642f: Unknown result type (might be due to invalid IL or missing references) //IL_6434: Unknown result type (might be due to invalid IL or missing references) //IL_64d7: Unknown result type (might be due to invalid IL or missing references) //IL_64dc: Unknown result type (might be due to invalid IL or missing references) //IL_6595: Unknown result type (might be due to invalid IL or missing references) //IL_659a: Unknown result type (might be due to invalid IL or missing references) //IL_6648: Unknown result type (might be due to invalid IL or missing references) //IL_664d: Unknown result type (might be due to invalid IL or missing references) //IL_6706: Unknown result type (might be due to invalid IL or missing references) //IL_670b: Unknown result type (might be due to invalid IL or missing references) //IL_67c4: Unknown result type (might be due to invalid IL or missing references) //IL_67c9: Unknown result type (might be due to invalid IL or missing references) //IL_6882: Unknown result type (might be due to invalid IL or missing references) //IL_6887: Unknown result type (might be due to invalid IL or missing references) //IL_692a: Unknown result type (might be due to invalid IL or missing references) //IL_692f: Unknown result type (might be due to invalid IL or missing references) //IL_69d2: Unknown result type (might be due to invalid IL or missing references) //IL_69d7: Unknown result type (might be due to invalid IL or missing references) //IL_6a7a: Unknown result type (might be due to invalid IL or missing references) //IL_6a7f: Unknown result type (might be due to invalid IL or missing references) //IL_6b2d: Unknown result type (might be due to invalid IL or missing references) //IL_6b32: Unknown result type (might be due to invalid IL or missing references) //IL_6be0: Unknown result type (might be due to invalid IL or missing references) //IL_6be5: Unknown result type (might be due to invalid IL or missing references) //IL_6c88: Unknown result type (might be due to invalid IL or missing references) //IL_6c8d: Unknown result type (might be due to invalid IL or missing references) //IL_6d30: Unknown result type (might be due to invalid IL or missing references) //IL_6d35: Unknown result type (might be due to invalid IL or missing references) //IL_6dd8: Unknown result type (might be due to invalid IL or missing references) //IL_6ddd: Unknown result type (might be due to invalid IL or missing references) //IL_6ea1: Unknown result type (might be due to invalid IL or missing references) //IL_6ea6: Unknown result type (might be due to invalid IL or missing references) //IL_6f49: Unknown result type (might be due to invalid IL or missing references) //IL_6f4e: Unknown result type (might be due to invalid IL or missing references) //IL_6ff1: Unknown result type (might be due to invalid IL or missing references) //IL_6ff6: Unknown result type (might be due to invalid IL or missing references) //IL_7099: Unknown result type (might be due to invalid IL or missing references) //IL_709e: Unknown result type (might be due to invalid IL or missing references) //IL_714c: Unknown result type (might be due to invalid IL or missing references) //IL_7151: Unknown result type (might be due to invalid IL or missing references) //IL_71ff: Unknown result type (might be due to invalid IL or missing references) //IL_7204: Unknown result type (might be due to invalid IL or missing references) //IL_72b2: Unknown result type (might be due to invalid IL or missing references) //IL_72b7: Unknown result type (might be due to invalid IL or missing references) //IL_735a: Unknown result type (might be due to invalid IL or missing references) //IL_735f: Unknown result type (might be due to invalid IL or missing references) //IL_7402: Unknown result type (might be due to invalid IL or missing references) //IL_7407: Unknown result type (might be due to invalid IL or missing references) //IL_74b5: Unknown result type (might be due to invalid IL or missing references) //IL_74ba: Unknown result type (might be due to invalid IL or missing references) //IL_7568: Unknown result type (might be due to invalid IL or missing references) //IL_756d: Unknown result type (might be due to invalid IL or missing references) //IL_761b: Unknown result type (might be due to invalid IL or missing references) //IL_7620: Unknown result type (might be due to invalid IL or missing references) //IL_76c3: Unknown result type (might be due to invalid IL or missing references) //IL_76c8: Unknown result type (might be due to invalid IL or missing references) //IL_7781: Unknown result type (might be due to invalid IL or missing references) //IL_7786: Unknown result type (might be due to invalid IL or missing references) //IL_784a: Unknown result type (might be due to invalid IL or missing references) //IL_784f: Unknown result type (might be due to invalid IL or missing references) //IL_78fd: Unknown result type (might be due to invalid IL or missing references) //IL_7902: Unknown result type (might be due to invalid IL or missing references) //IL_79bb: Unknown result type (might be due to invalid IL or missing references) //IL_79c0: Unknown result type (might be due to invalid IL or missing references) //IL_7a63: Unknown result type (might be due to invalid IL or missing references) //IL_7a68: Unknown result type (might be due to invalid IL or missing references) //IL_7b21: Unknown result type (might be due to invalid IL or missing references) //IL_7b26: Unknown result type (might be due to invalid IL or missing references) //IL_7bea: Unknown result type (might be due to invalid IL or missing references) //IL_7bef: Unknown result type (might be due to invalid IL or missing references) //IL_7c9d: Unknown result type (might be due to invalid IL or missing references) //IL_7ca2: Unknown result type (might be due to invalid IL or missing references) //IL_7d50: Unknown result type (might be due to invalid IL or missing references) //IL_7d55: Unknown result type (might be due to invalid IL or missing references) //IL_7e03: Unknown result type (might be due to invalid IL or missing references) //IL_7e08: Unknown result type (might be due to invalid IL or missing references) //IL_7eb6: Unknown result type (might be due to invalid IL or missing references) //IL_7ebb: Unknown result type (might be due to invalid IL or missing references) //IL_7f74: Unknown result type (might be due to invalid IL or missing references) //IL_7f79: Unknown result type (might be due to invalid IL or missing references) //IL_8032: Unknown result type (might be due to invalid IL or missing references) //IL_8037: Unknown result type (might be due to invalid IL or missing references) //IL_80da: Unknown result type (might be due to invalid IL or missing references) //IL_80df: Unknown result type (might be due to invalid IL or missing references) //IL_8182: Unknown result type (might be due to invalid IL or missing references) //IL_8187: Unknown result type (might be due to invalid IL or missing references) //IL_8235: Unknown result type (might be due to invalid IL or missing references) //IL_823a: Unknown result type (might be due to invalid IL or missing references) //IL_82dd: Unknown result type (might be due to invalid IL or missing references) //IL_82e2: Unknown result type (might be due to invalid IL or missing references) //IL_8390: Unknown result type (might be due to invalid IL or missing references) //IL_8395: Unknown result type (might be due to invalid IL or missing references) //IL_8443: Unknown result type (might be due to invalid IL or missing references) //IL_8448: Unknown result type (might be due to invalid IL or missing references) //IL_84eb: Unknown result type (might be due to invalid IL or missing references) //IL_84f0: Unknown result type (might be due to invalid IL or missing references) //IL_859e: Unknown result type (might be due to invalid IL or missing references) //IL_85a3: Unknown result type (might be due to invalid IL or missing references) //IL_8651: Unknown result type (might be due to invalid IL or missing references) //IL_8656: Unknown result type (might be due to invalid IL or missing references) //IL_870f: Unknown result type (might be due to invalid IL or missing references) //IL_8714: Unknown result type (might be due to invalid IL or missing references) //IL_87c2: Unknown result type (might be due to invalid IL or missing references) //IL_87c7: Unknown result type (might be due to invalid IL or missing references) //IL_8875: Unknown result type (might be due to invalid IL or missing references) //IL_887a: Unknown result type (might be due to invalid IL or missing references) //IL_891d: Unknown result type (might be due to invalid IL or missing references) //IL_8922: Unknown result type (might be due to invalid IL or missing references) //IL_89d0: Unknown result type (might be due to invalid IL or missing references) //IL_89d5: Unknown result type (might be due to invalid IL or missing references) //IL_8a8e: Unknown result type (might be due to invalid IL or missing references) //IL_8a93: Unknown result type (might be due to invalid IL or missing references) //IL_8b41: Unknown result type (might be due to invalid IL or missing references) //IL_8b46: Unknown result type (might be due to invalid IL or missing references) //IL_8be9: Unknown result type (might be due to invalid IL or missing references) //IL_8bee: Unknown result type (might be due to invalid IL or missing references) //IL_8c91: Unknown result type (might be due to invalid IL or missing references) //IL_8c96: Unknown result type (might be due to invalid IL or missing references) //IL_8d39: Unknown result type (might be due to invalid IL or missing references) //IL_8d3e: Unknown result type (might be due to invalid IL or missing references) //IL_8dec: Unknown result type (might be due to invalid IL or missing references) //IL_8df1: Unknown result type (might be due to invalid IL or missing references) //IL_8e9f: Unknown result type (might be due to invalid IL or missing references) //IL_8ea4: Unknown result type (might be due to invalid IL or missing references) //IL_8f52: Unknown result type (might be due to invalid IL or missing references) //IL_8f57: Unknown result type (might be due to invalid IL or missing references) //IL_8ffa: Unknown result type (might be due to invalid IL or missing references) //IL_8fff: Unknown result type (might be due to invalid IL or missing references) //IL_90ad: Unknown result type (might be due to invalid IL or missing references) //IL_90b2: Unknown result type (might be due to invalid IL or missing references) //IL_9160: Unknown result type (might be due to invalid IL or missing references) //IL_9165: Unknown result type (might be due to invalid IL or missing references) //IL_9208: Unknown result type (might be due to invalid IL or missing references) //IL_920d: Unknown result type (might be due to invalid IL or missing references) //IL_92bb: Unknown result type (might be due to invalid IL or missing references) //IL_92c0: Unknown result type (might be due to invalid IL or missing references) //IL_936e: Unknown result type (might be due to invalid IL or missing references) //IL_9373: Unknown result type (might be due to invalid IL or missing references) //IL_9421: Unknown result type (might be due to invalid IL or missing references) //IL_9426: Unknown result type (might be due to invalid IL or missing references) //IL_94ea: Unknown result type (might be due to invalid IL or missing references) //IL_94ef: Unknown result type (might be due to invalid IL or missing references) //IL_959d: Unknown result type (might be due to invalid IL or missing references) //IL_95a2: Unknown result type (might be due to invalid IL or missing references) //IL_9650: Unknown result type (might be due to invalid IL or missing references) //IL_9655: Unknown result type (might be due to invalid IL or missing references) //IL_96f8: Unknown result type (might be due to invalid IL or missing references) //IL_96fd: Unknown result type (might be due to invalid IL or missing references) //IL_97ab: Unknown result type (might be due to invalid IL or missing references) //IL_97b0: Unknown result type (might be due to invalid IL or missing references) //IL_985e: Unknown result type (might be due to invalid IL or missing references) //IL_9863: Unknown result type (might be due to invalid IL or missing references) //IL_9906: Unknown result type (might be due to invalid IL or missing references) //IL_990b: Unknown result type (might be due to invalid IL or missing references) //IL_99ae: Unknown result type (might be due to invalid IL or missing references) //IL_99b3: Unknown result type (might be due to invalid IL or missing references) //IL_9a56: Unknown result type (might be due to invalid IL or missing references) //IL_9a5b: Unknown result type (might be due to invalid IL or missing references) //IL_9afe: Unknown result type (might be due to invalid IL or missing references) //IL_9b03: Unknown result type (might be due to invalid IL or missing references) //IL_9bb1: Unknown result type (might be due to invalid IL or missing references) //IL_9bb6: Unknown result type (might be due to invalid IL or missing references) //IL_9c59: Unknown result type (might be due to invalid IL or missing references) //IL_9c5e: Unknown result type (might be due to invalid IL or missing references) //IL_9d2d: Unknown result type (might be due to invalid IL or missing references) //IL_9d32: Unknown result type (might be due to invalid IL or missing references) //IL_9deb: Unknown result type (might be due to invalid IL or missing references) //IL_9df0: Unknown result type (might be due to invalid IL or missing references) //IL_9e93: Unknown result type (might be due to invalid IL or missing references) //IL_9e98: Unknown result type (might be due to invalid IL or missing references) //IL_9f3b: Unknown result type (might be due to invalid IL or missing references) //IL_9f40: Unknown result type (might be due to invalid IL or missing references) //IL_9fe3: Unknown result type (might be due to invalid IL or missing references) //IL_9fe8: Unknown result type (might be due to invalid IL or missing references) //IL_a08b: Unknown result type (might be due to invalid IL or missing references) //IL_a090: Unknown result type (might be due to invalid IL or missing references) //IL_a13e: Unknown result type (might be due to invalid IL or missing references) //IL_a143: Unknown result type (might be due to invalid IL or missing references) //IL_a1e6: Unknown result type (might be due to invalid IL or missing references) //IL_a1eb: Unknown result type (might be due to invalid IL or missing references) //IL_a28e: Unknown result type (might be due to invalid IL or missing references) //IL_a293: Unknown result type (might be due to invalid IL or missing references) //IL_a336: Unknown result type (might be due to invalid IL or missing references) //IL_a33b: Unknown result type (might be due to invalid IL or missing references) //IL_a3f4: Unknown result type (might be due to invalid IL or missing references) //IL_a3f9: Unknown result type (might be due to invalid IL or missing references) //IL_a49c: Unknown result type (might be due to invalid IL or missing references) //IL_a4a1: Unknown result type (might be due to invalid IL or missing references) //IL_a544: Unknown result type (might be due to invalid IL or missing references) //IL_a549: Unknown result type (might be due to invalid IL or missing references) //IL_a5ec: Unknown result type (might be due to invalid IL or missing references) //IL_a5f1: Unknown result type (might be due to invalid IL or missing references) //IL_a694: Unknown result type (might be due to invalid IL or missing references) //IL_a699: Unknown result type (might be due to invalid IL or missing references) //IL_a73c: Unknown result type (might be due to invalid IL or missing references) //IL_a741: Unknown result type (might be due to invalid IL or missing references) //IL_a7e4: Unknown result type (might be due to invalid IL or missing references) //IL_a7e9: Unknown result type (might be due to invalid IL or missing references) //IL_a88c: Unknown result type (might be due to invalid IL or missing references) //IL_a891: Unknown result type (might be due to invalid IL or missing references) //IL_a96b: Unknown result type (might be due to invalid IL or missing references) //IL_a970: Unknown result type (might be due to invalid IL or missing references) //IL_aa34: Unknown result type (might be due to invalid IL or missing references) //IL_aa39: Unknown result type (might be due to invalid IL or missing references) //IL_aaf2: Unknown result type (might be due to invalid IL or missing references) //IL_aaf7: Unknown result type (might be due to invalid IL or missing references) //IL_aba5: Unknown result type (might be due to invalid IL or missing references) //IL_abaa: Unknown result type (might be due to invalid IL or missing references) //IL_ac58: Unknown result type (might be due to invalid IL or missing references) //IL_ac5d: Unknown result type (might be due to invalid IL or missing references) //IL_ad0b: Unknown result type (might be due to invalid IL or missing references) //IL_ad10: Unknown result type (might be due to invalid IL or missing references) //IL_adbe: Unknown result type (might be due to invalid IL or missing references) //IL_adc3: Unknown result type (might be due to invalid IL or missing references) //IL_ae66: Unknown result type (might be due to invalid IL or missing references) //IL_ae6b: Unknown result type (might be due to invalid IL or missing references) //IL_af0e: Unknown result type (might be due to invalid IL or missing references) //IL_af13: Unknown result type (might be due to invalid IL or missing references) //IL_afb6: Unknown result type (might be due to invalid IL or missing references) //IL_afbb: Unknown result type (might be due to invalid IL or missing references) //IL_b05e: Unknown result type (might be due to invalid IL or missing references) //IL_b063: Unknown result type (might be due to invalid IL or missing references) //IL_b106: Unknown result type (might be due to invalid IL or missing references) //IL_b10b: Unknown result type (might be due to invalid IL or missing references) //IL_b1c4: Unknown result type (might be due to invalid IL or missing references) //IL_b1c9: Unknown result type (might be due to invalid IL or missing references) //IL_b26c: Unknown result type (might be due to invalid IL or missing references) //IL_b271: Unknown result type (might be due to invalid IL or missing references) //IL_b335: Unknown result type (might be due to invalid IL or missing references) //IL_b33a: Unknown result type (might be due to invalid IL or missing references) //IL_b3dd: Unknown result type (might be due to invalid IL or missing references) //IL_b3e2: Unknown result type (might be due to invalid IL or missing references) //IL_b485: Unknown result type (might be due to invalid IL or missing references) //IL_b48a: Unknown result type (might be due to invalid IL or missing references) //IL_b52d: Unknown result type (might be due to invalid IL or missing references) //IL_b532: Unknown result type (might be due to invalid IL or missing references) //IL_b5d5: Unknown result type (might be due to invalid IL or missing references) //IL_b5da: Unknown result type (might be due to invalid IL or missing references) //IL_b67d: Unknown result type (might be due to invalid IL or missing references) //IL_b682: Unknown result type (might be due to invalid IL or missing references) //IL_b725: Unknown result type (might be due to invalid IL or missing references) //IL_b72a: Unknown result type (might be due to invalid IL or missing references) //IL_b7ee: Unknown result type (might be due to invalid IL or missing references) //IL_b7f3: Unknown result type (might be due to invalid IL or missing references) //IL_b8b7: Unknown result type (might be due to invalid IL or missing references) //IL_b8bc: Unknown result type (might be due to invalid IL or missing references) //IL_b95f: Unknown result type (might be due to invalid IL or missing references) //IL_b964: Unknown result type (might be due to invalid IL or missing references) //IL_ba07: Unknown result type (might be due to invalid IL or missing references) //IL_ba0c: Unknown result type (might be due to invalid IL or missing references) //IL_baaf: Unknown result type (might be due to invalid IL or missing references) //IL_bab4: Unknown result type (might be due to invalid IL or missing references) //IL_bb57: Unknown result type (might be due to invalid IL or missing references) //IL_bb5c: Unknown result type (might be due to invalid IL or missing references) //IL_bbff: Unknown result type (might be due to invalid IL or missing references) //IL_bc04: Unknown result type (might be due to invalid IL or missing references) //IL_bca7: Unknown result type (might be due to invalid IL or missing references) //IL_bcac: Unknown result type (might be due to invalid IL or missing references) //IL_bd5a: Unknown result type (might be due to invalid IL or missing references) //IL_bd5f: Unknown result type (might be due to invalid IL or missing references) //IL_be02: Unknown result type (might be due to invalid IL or missing references) //IL_be07: Unknown result type (might be due to invalid IL or missing references) //IL_beb5: Unknown result type (might be due to invalid IL or missing references) //IL_beba: Unknown result type (might be due to invalid IL or missing references) //IL_bf7e: Unknown result type (might be due to invalid IL or missing references) //IL_bf83: Unknown result type (might be due to invalid IL or missing references) //IL_c03c: Unknown result type (might be due to invalid IL or missing references) //IL_c041: Unknown result type (might be due to invalid IL or missing references) //IL_c0ef: Unknown result type (might be due to invalid IL or missing references) //IL_c0f4: Unknown result type (might be due to invalid IL or missing references) //IL_c197: Unknown result type (might be due to invalid IL or missing references) //IL_c19c: Unknown result type (might be due to invalid IL or missing references) //IL_c23f: Unknown result type (might be due to invalid IL or missing references) //IL_c244: Unknown result type (might be due to invalid IL or missing references) //IL_c2e7: Unknown result type (might be due to invalid IL or missing references) //IL_c2ec: Unknown result type (might be due to invalid IL or missing references) //IL_c38f: Unknown result type (might be due to invalid IL or missing references) //IL_c394: Unknown result type (might be due to invalid IL or missing references) //IL_c442: Unknown result type (might be due to invalid IL or missing references) //IL_c447: Unknown result type (might be due to invalid IL or missing references) //IL_c4f5: Unknown result type (might be due to invalid IL or missing references) //IL_c4fa: Unknown result type (might be due to invalid IL or missing references) //IL_c5a8: Unknown result type (might be due to invalid IL or missing references) //IL_c5ad: Unknown result type (might be due to invalid IL or missing references) //IL_c65b: Unknown result type (might be due to invalid IL or missing references) //IL_c660: Unknown result type (might be due to invalid IL or missing references) //IL_c70e: Unknown result type (might be due to invalid IL or missing references) //IL_c713: Unknown result type (might be due to invalid IL or missing references) //IL_c7c1: Unknown result type (might be due to invalid IL or missing references) //IL_c7c6: Unknown result type (might be due to invalid IL or missing references) //IL_c869: Unknown result type (might be due to invalid IL or missing references) //IL_c86e: Unknown result type (might be due to invalid IL or missing references) //IL_c911: Unknown result type (might be due to invalid IL or missing references) //IL_c916: Unknown result type (might be due to invalid IL or missing references) //IL_c9b9: Unknown result type (might be due to invalid IL or missing references) //IL_c9be: Unknown result type (might be due to invalid IL or missing references) //IL_ca61: Unknown result type (might be due to invalid IL or missing references) //IL_ca66: Unknown result type (might be due to invalid IL or missing references) //IL_cb14: Unknown result type (might be due to invalid IL or missing references) //IL_cb19: Unknown result type (might be due to invalid IL or missing references) //IL_cbdd: Unknown result type (might be due to invalid IL or missing references) //IL_cbe2: Unknown result type (might be due to invalid IL or missing references) //IL_cc85: Unknown result type (might be due to invalid IL or missing references) //IL_cc8a: Unknown result type (might be due to invalid IL or missing references) //IL_cd38: Unknown result type (might be due to invalid IL or missing references) //IL_cd3d: Unknown result type (might be due to invalid IL or missing references) //IL_cde0: Unknown result type (might be due to invalid IL or missing references) //IL_cde5: Unknown result type (might be due to invalid IL or missing references) //IL_ce93: Unknown result type (might be due to invalid IL or missing references) //IL_ce98: Unknown result type (might be due to invalid IL or missing references) //IL_cf46: Unknown result type (might be due to invalid IL or missing references) //IL_cf4b: Unknown result type (might be due to invalid IL or missing references) //IL_cff9: Unknown result type (might be due to invalid IL or missing references) //IL_cffe: Unknown result type (might be due to invalid IL or missing references) //IL_d0c2: Unknown result type (might be due to invalid IL or missing references) //IL_d0c7: Unknown result type (might be due to invalid IL or missing references) //IL_d16a: Unknown result type (might be due to invalid IL or missing references) //IL_d16f: Unknown result type (might be due to invalid IL or missing references) //IL_d212: Unknown result type (might be due to invalid IL or missing references) //IL_d217: Unknown result type (might be due to invalid IL or missing references) //IL_d2c5: Unknown result type (might be due to invalid IL or missing references) //IL_d2ca: Unknown result type (might be due to invalid IL or missing references) //IL_d38e: Unknown result type (might be due to invalid IL or missing references) //IL_d393: Unknown result type (might be due to invalid IL or missing references) //IL_d436: Unknown result type (might be due to invalid IL or missing references) //IL_d43b: Unknown result type (might be due to invalid IL or missing references) //IL_d4de: Unknown result type (might be due to invalid IL or missing references) //IL_d4e3: Unknown result type (might be due to invalid IL or missing references) //IL_d591: Unknown result type (might be due to invalid IL or missing references) //IL_d596: Unknown result type (might be due to invalid IL or missing references) //IL_d644: Unknown result type (might be due to invalid IL or missing references) //IL_d649: Unknown result type (might be due to invalid IL or missing references) //IL_d6ec: Unknown result type (might be due to invalid IL or missing references) //IL_d6f1: Unknown result type (might be due to invalid IL or missing references) //IL_d79f: Unknown result type (might be due to invalid IL or missing references) //IL_d7a4: Unknown result type (might be due to invalid IL or missing references) //IL_d852: Unknown result type (might be due to invalid IL or missing references) //IL_d857: Unknown result type (might be due to invalid IL or missing references) //IL_d905: Unknown result type (might be due to invalid IL or missing references) //IL_d90a: Unknown result type (might be due to invalid IL or missing references) //IL_d9b8: Unknown result type (might be due to invalid IL or missing references) //IL_d9bd: Unknown result type (might be due to invalid IL or missing references) //IL_da81: Unknown result type (might be due to invalid IL or missing references) //IL_da86: Unknown result type (might be due to invalid IL or missing references) //IL_db4a: Unknown result type (might be due to invalid IL or missing references) //IL_db4f: Unknown result type (might be due to invalid IL or missing references) //IL_dc08: Unknown result type (might be due to invalid IL or missing references) //IL_dc0d: Unknown result type (might be due to invalid IL or missing references) //IL_dcc6: Unknown result type (might be due to invalid IL or missing references) //IL_dccb: Unknown result type (might be due to invalid IL or missing references) //IL_dd84: Unknown result type (might be due to invalid IL or missing references) //IL_dd89: Unknown result type (might be due to invalid IL or missing references) //IL_de37: Unknown result type (might be due to invalid IL or missing references) //IL_de3c: Unknown result type (might be due to invalid IL or missing references) //IL_dedf: Unknown result type (might be due to invalid IL or missing references) //IL_dee4: Unknown result type (might be due to invalid IL or missing references) //IL_df92: Unknown result type (might be due to invalid IL or missing references) //IL_df97: Unknown result type (might be due to invalid IL or missing references) //IL_e045: Unknown result type (might be due to invalid IL or missing references) //IL_e04a: Unknown result type (might be due to invalid IL or missing references) //IL_e0ed: Unknown result type (might be due to invalid IL or missing references) //IL_e0f2: Unknown result type (might be due to invalid IL or missing references) //IL_e195: Unknown result type (might be due to invalid IL or missing references) //IL_e19a: Unknown result type (might be due to invalid IL or missing references) //IL_e248: Unknown result type (might be due to invalid IL or missing references) //IL_e24d: Unknown result type (might be due to invalid IL or missing references) //IL_e2f0: Unknown result type (might be due to invalid IL or missing references) //IL_e2f5: Unknown result type (might be due to invalid IL or missing references) //IL_e398: Unknown result type (might be due to invalid IL or missing references) //IL_e39d: Unknown result type (might be due to invalid IL or missing references) //IL_e440: Unknown result type (might be due to invalid IL or missing references) //IL_e445: Unknown result type (might be due to invalid IL or missing references) //IL_e4f3: Unknown result type (might be due to invalid IL or missing references) //IL_e4f8: Unknown result type (might be due to invalid IL or missing references) //IL_e59b: Unknown result type (might be due to invalid IL or missing references) //IL_e5a0: Unknown result type (might be due to invalid IL or missing references) //IL_e643: Unknown result type (might be due to invalid IL or missing references) //IL_e648: Unknown result type (might be due to invalid IL or missing references) //IL_e6eb: Unknown result type (might be due to invalid IL or missing references) //IL_e6f0: Unknown result type (might be due to invalid IL or missing references) //IL_e793: Unknown result type (might be due to invalid IL or missing references) //IL_e798: Unknown result type (might be due to invalid IL or missing references) //IL_e846: Unknown result type (might be due to invalid IL or missing references) //IL_e84b: Unknown result type (might be due to invalid IL or missing references) //IL_e8ee: Unknown result type (might be due to invalid IL or missing references) //IL_e8f3: Unknown result type (might be due to invalid IL or missing references) //IL_e996: Unknown result type (might be due to invalid IL or missing references) //IL_e99b: Unknown result type (might be due to invalid IL or missing references) //IL_ea3e: Unknown result type (might be due to invalid IL or missing references) //IL_ea43: Unknown result type (might be due to invalid IL or missing references) //IL_eae6: Unknown result type (might be due to invalid IL or missing references) //IL_eaeb: Unknown result type (might be due to invalid IL or missing references) //IL_eb99: Unknown result type (might be due to invalid IL or missing references) //IL_eb9e: Unknown result type (might be due to invalid IL or missing references) //IL_ec41: Unknown result type (might be due to invalid IL or missing references) //IL_ec46: Unknown result type (might be due to invalid IL or missing references) //IL_ece9: Unknown result type (might be due to invalid IL or missing references) //IL_ecee: Unknown result type (might be due to invalid IL or missing references) AllEvents.Add(new GameEvent { id = "jackpot", name_en = "Jackpot", name_ru = "Джекпот", name_ko = "잭팟", desc_en = "x2 valuables spawned", desc_ru = "x2 ценностей на карте", desc_ko = "귀중품 2배 생성", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "empty_facility" }, onActivate = delegate { ValuableCountMultiplier = 2f; } }); AllEvents.Add(new GameEvent { id = "empty_facility", name_en = "Empty Facility", name_ru = "Пустое Здание", name_ko = "빈 시설", desc_en = "50% less valuables", desc_ru = "На 50% меньше ценностей", desc_ko = "귀중품 50% 감소", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "jackpot" }, onActivate = delegate { ValuableCountMultiplier = 0.5f; } }); AllEvents.Add(new GameEvent { id = "size_restriction", name_en = "Size Restriction", name_ru = "Ограничение Размера", name_ko = "크기 제한", desc_en = "Only one size of valuables will spawn", desc_ru = "Заспавнятся ценности только одного размера", desc_ko = "한 가지 크기의 귀중품만 생성됨", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { string[] array = new string[7] { "tiny", "small", "medium", "big", "wide", "tall", "verytall" }; SelectedSizeRestriction = array[REPOSeedManager.Range(0, array.Length)]; REPOConomyPlugin.Logger.LogInfo((object)("[SizeRestriction] Selected: " + SelectedSizeRestriction)); } }); AllEvents.Add(new GameEvent { id = "value_lottery", name_en = "Value Lottery", name_ru = "Лотерея Ценностей", name_ko = "가치 복권", desc_en = "10% items x10 value, rest -50%", desc_ru = "10% предметов x10 цены, остальные -50%", desc_ko = "10% 아이템 가치 10배, 나머지 -50%", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "level_glitch", name_en = "Level Glitch", name_ru = "Глюк Уровня", name_ko = "레벨 글리치", desc_en = "Valuables from ALL locations can spawn here.", desc_ru = "Ценности из ВСЕХ локаций могут появиться здесь.", desc_ko = "모든 지역의 귀중품이 여기서 생성될 수 있음", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LevelGlitch = true; } }); AllEvents.Add(new GameEvent { id = "valuables_unbreakable", name_en = "Unbreakable Valuables", name_ru = "Неломаемые Ценности", name_ko = "부서지지 않는 귀중품", desc_en = "Valuables never break", desc_ru = "Ценности никогда не ломаются", desc_ko = "귀중품이 절대 부서지지 않음", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "valuables_fragile", "explosive_valuables", "explosive_throw_valuables" }, onActivate = delegate { ValuablesUnbreakable = true; } }); AllEvents.Add(new GameEvent { id = "valuables_fragile", name_en = "Fragile Valuables", name_ru = "Хрупкие Ценности", name_ko = "깨지기 쉬운 귀중품", desc_en = "Valuables break twice as fast", desc_ru = "Ценности ломаются в два раза быстрее", desc_ko = "귀중품이 2배 빨리 부서짐", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "valuables_unbreakable" }, onActivate = delegate { ValuablesFragile = true; } }); AllEvents.Add(new GameEvent { id = "enemy_horde", name_en = "Enemy Horde", name_ru = "Орда Врагов", name_ko = "적의 무리", desc_en = "x2 enemies spawn", desc_ru = "x2 врагов на карте", desc_ko = "적 2배 생성", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { EnemySpawnMultiplier = 2f; } }); AllEvents.Add(new GameEvent { id = "speed_demons", name_en = "Speed Demons", name_ru = "Скоростные Демоны", name_ko = "스피드 악마", desc_en = "Enemies 50% faster", desc_ru = "Враги на 50% быстрее", desc_ko = "적 50% 빠름", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { EnemySpeedMultiplier = 1.5f; } }); AllEvents.Add(new GameEvent { id = "pacifist_mode", name_en = "Pacifist Mode", name_ru = "Режим Пацифиста", name_ko = "평화주의 모드", desc_en = "Enemies don't attack", desc_ru = "Враги не атакуют", desc_ko = "적이 공격하지 않음", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "invincible_horror", "boss_fight" }, onActivate = delegate { EnemiesPacifist = true; } }); AllEvents.Add(new GameEvent { id = "invisible_enemies", name_en = "Invisible Enemies", name_ru = "Невидимые Враги", name_ko = "투명한 적", desc_en = "Enemies are invisible", desc_ru = "Враги невидимы", desc_ko = "적이 보이지 않음", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { EnemiesInvisible = true; } }); AllEvents.Add(new GameEvent { id = "tiny_enemies", name_en = "Tiny Enemies", name_ru = "Крошечные Враги", name_ko = "작은 적", desc_en = "Enemies 50% smaller", desc_ru = "Враги в 2 раза меньше", desc_ko = "적 크기 50% 감소", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "giant_enemies" }, onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "giant_enemies", name_en = "Giant Enemies", name_ru = "Гигантские Враги", name_ko = "거대한 적", desc_en = "Enemies 30% bigger", desc_ru = "Враги на 30% больше", desc_ko = "적 크기 30% 증가", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "tiny_enemies" }, onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "boss_rush", name_en = "Boss Rush", name_ru = "Режим Боссов", name_ko = "보스 러시", desc_en = "Only Difficulty 3 enemies", desc_ru = "Только враги 3 сложности", desc_ko = "난이도 3 적만 등장", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "fast_spawn", name_en = "Fast Spawn", name_ru = "Быстрый Спавн", name_ko = "빠른 스폰", desc_en = "Enemies spawn instantly", desc_ru = "Враги спавнятся мгновенно", desc_ko = "적이 즉시 생성됨", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "too_quiet" }, onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "enemy_heavy_weight", name_en = "Heavy Enemies", name_ru = "Тяжелые Враги", name_ko = "무거운 적", desc_en = "Enemies require 2x more force to grab", desc_ru = "Враги требуют в 2 раза больше силы для захвата", desc_ko = "적을 잡으려면 2배의 힘 필요", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "enemy_light_weight" }, onActivate = delegate { EnemyHeavyWeight = true; } }); AllEvents.Add(new GameEvent { id = "enemy_light_weight", name_en = "Light Enemies", name_ru = "Легкие Враги", name_ko = "가벼운 적", desc_en = "Enemies require 3x less force to grab", desc_ru = "Враги требуют в 3 раза меньше силы для захвата", desc_ko = "적을 잡는 데 3배 적은 힘 필요", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "enemy_heavy_weight" }, onActivate = delegate { EnemyLightWeight = true; } }); AllEvents.Add(new GameEvent { id = "instant_respawn", name_en = "Faster Respawn", name_ru = "Ускоренный Респавн", name_ko = "빠른 리스폰", desc_en = "Enemies respawn 50% faster after death", desc_ru = "Враги респавнятся на 50% быстрее после смерти", desc_ko = "적이 죽은 후 50% 더 빠르게 리스폰됨", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { InstantRespawn = true; } }); AllEvents.Add(new GameEvent { id = "persistent_enemies", name_en = "Persistent Enemies", name_ru = "Стойкие Враги", name_ko = "끈질긴 적", desc_en = "Enemies never despawn", desc_ru = "Враги никогда не исчезают", desc_ko = "적이 사라지지 않음", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { PersistentEnemies = true; } }); AllEvents.Add(new GameEvent { id = "explosive_valuables", name_en = "Explosive Valuables", name_ru = "Взрывные Ценности", name_ko = "폭발하는 귀중품", desc_en = "Valuables explode when broken", desc_ru = "Ценности взрываются при разрушении", desc_ko = "귀중품이 부서지면 폭발", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "valuables_unbreakable" }, onActivate = delegate { ExplosiveValuables = true; } }); AllEvents.Add(new GameEvent { id = "hot_potato", name_en = "Hot Potato", name_ru = "Горячая Картошка", name_ko = "뜨거운 감자", desc_en = "Holding valuables too long hurts", desc_ru = "Держать ценности слишком долго больно", desc_ko = "귀중품을 오래 들고 있으면 피해", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { HotPotato = true; } }); AllEvents.Add(new GameEvent { id = "sonic_speed", name_en = "Sonic Speed", name_ru = "Скорость Соника", name_ko = "소닉 스피드", desc_en = "Players 50% faster", desc_ru = "Игроки на 50% быстрее", desc_ko = "플레이어 50% 빠름", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "turtle_mode", "tank_mode" }, onActivate = delegate { PlayerSpeedMultiplier = 1.5f; } }); AllEvents.Add(new GameEvent { id = "turtle_mode", name_en = "Turtle Mode", name_ru = "Режим Черепахи", name_ko = "거북이 모드", desc_en = "Players 25% slower", desc_ru = "Игроки на 25% медленнее", desc_ko = "플레이어 25% 느림", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "sonic_speed", "tank_mode" }, onActivate = delegate { PlayerSpeedMultiplier = 0.75f; } }); AllEvents.Add(new GameEvent { id = "low_gravity", name_en = "Low Gravity", name_ru = "Низкая Гравитация", name_ko = "저중력", desc_en = "Jump higher, fall slower", desc_ru = "Прыгаешь выше, падаешь медленнее", desc_ko = "높이 점프, 천천히 낙하", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "heavy_gravity" }, onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "heavy_gravity", name_en = "Heavy Gravity", name_ru = "Тяжелая Гравитация", name_ko = "고중력", desc_en = "Jump lower, fall faster", desc_ru = "Прыгаешь ниже, падаешь быстрее", desc_ko = "낮게 점프, 빠르게 낙하", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "low_gravity" }, onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "glass_cannon", name_en = "Glass Cannon", name_ru = "Стеклянная Пушка", name_ko = "유리 대포", desc_en = "Max health = 1", desc_ru = "Максимум здоровья = 1", desc_ko = "최대 체력 = 1", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "tank_mode", "dangerous_valuables", "toxic_air", "glass_bones" }, onActivate = delegate { PlayerHealthMultiplier = 0.01f; } }); AllEvents.Add(new GameEvent { id = "tank_mode", name_en = "Tank Mode", name_ru = "Режим Танка", name_ko = "탱크 모드", desc_en = "+100 health, -50% speed", desc_ru = "+100 здоровья, -50% скорости", desc_ko = "+100 체력, -50% 속도", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "sonic_speed", "turtle_mode", "glass_cannon" }, onActivate = delegate { PlayerHealthMultiplier = 2f; PlayerSpeedMultiplier = 0.5f; } }); AllEvents.Add(new GameEvent { id = "infinite_stamina", name_en = "Infinite Stamina", name_ru = "Бесконечная Энергия", name_ko = "무한 스태미나", desc_en = "Never run out of energy", desc_ru = "Энергия не заканчивается", desc_ko = "에너지가 다하지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "clumsy", name_en = "Clumsy", name_ru = "Неуклюжий", name_ko = "서투름", desc_en = "Random tumble every 30s", desc_ru = "Падение каждые 30 секунд", desc_ko = "30초마다 랜덤 넘어짐", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "invisible_players", name_en = "Invisible Players", name_ru = "Невидимые Игроки", name_ko = "투명한 플레이어", desc_en = "Players can't see each other", desc_ru = "Игроки не видят друг друга", desc_ko = "플레이어가 서로 보이지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { PlayersInvisible = true; } }); AllEvents.Add(new GameEvent { id = "settle_it_in_smash", name_en = "Settle it in Smash!", name_ru = "Решим это в Смэше!", name_ko = "스매시로 결판내자!", desc_en = "Attacks deal KNOCKBACK based on damage %. Only physics/pits kill", desc_ru = "Атаки наносят ОТБРАСЫВАНИЕ (%). Убивает только физика и ямы", desc_ko = "공격이 피해량%에 따라 넉백. 물리/구덩이만 처치", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill", "one_hit_kill_players", "glass_cannon", "heavy_gravity", "invincible_horror" }, onActivate = delegate { SettleItInSmash = true; } }); AllEvents.Add(new GameEvent { id = "flashlight_fail", name_en = "Flashlight Fail", name_ru = "Поломка Фонарика", name_ko = "손전등 고장", desc_en = "Flashlight doesn't work", desc_ru = "Фонарик не работает", desc_ko = "손전등이 작동하지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "disco_lights", name_en = "Disco Lights", name_ru = "Дискотека", name_ko = "디스코 조명", desc_en = "Colors constantly change", desc_ru = "Цвета постоянно меняются", desc_ko = "색상이 계속 변함", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "slippery_floor", name_en = "Slippery Floor", name_ru = "Скользкий Пол", name_ko = "미끄러운 바닥", desc_en = "Physics friction = 0", desc_ru = "Трение пола = 0", desc_ko = "물리 마찰 = 0", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { } }); AllEvents.Add(new GameEvent { id = "golden_touch", name_en = "Golden Touch", name_ru = "Золотое Прикосновение", name_ko = "황금 손", desc_en = "All valuables x2 value, -25% valuables", desc_ru = "Все ценности x2 стоимости, -25% valuables", desc_ko = "모든 귀중품 가치 2배, 귀중품 -25%", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ValuableCountMultiplier = 0.75f; GoldenTouch = true; } }); AllEvents.Add(new GameEvent { id = "random_boosts", name_en = "Random Boosts", name_ru = "Случайные Усиления", name_ko = "랜덤 부스트", desc_en = "Random stat boosts every 2 minutes", desc_ru = "Случайные усиления каждые 2 минуты", desc_ko = "2분마다 랜덤 스탯 부스트", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { RandomBoosts = true; } }); AllEvents.Add(new GameEvent { id = "foggy_vision", name_en = "Foggy Vision", name_ru = "Туманное Зрение", name_ko = "안개 낀 시야", desc_en = "Reduced visibility with fog", desc_ru = "Сниженная видимость из-за тумана", desc_ko = "안개로 시야 감소", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { FoggyVision = true; } }); AllEvents.Add(new GameEvent { id = "inverted_controls", name_en = "Inverted Controls", name_ru = "Инвертированные Управление", name_ko = "반전된 조작", desc_en = "Movement controls are reversed", desc_ru = "Управление движением перевернуто", desc_ko = "이동 조작이 반전됨", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { InvertedControls = true; } }); AllEvents.Add(new GameEvent { id = "health_regeneration", name_en = "Health Regeneration", name_ru = "Регенерация Здоровья", name_ko = "체력 재생", desc_en = "Slowly regenerate health over time", desc_ru = "Медленная регенерация здоровья со временем", desc_ko = "시간이 지나면 천천히 체력 회복", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { HealthRegeneration = true; } }); AllEvents.Add(new GameEvent { id = "frozen_enemies", name_en = "Frozen Enemies", name_ru = "Замороженные Враги", name_ko = "얼어붙은 적", desc_en = "Enemies freeze periodically", desc_ru = "Враги периодически замерзают", desc_ko = "적이 주기적으로 얼어붙음", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { FrozenEnemies = true; } }); AllEvents.Add(new GameEvent { id = "too_quiet", name_en = "Too Quiet...", name_ru = "Слишком тихо...", name_ko = "너무 조용해...", desc_en = "Enemies take a long time to appear initially", desc_ru = "Враги появляются с большой задержкой в начале", desc_ko = "적이 처음에 오래 걸려 등장", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "fast_spawn" }, onActivate = delegate { TooQuiet = true; } }); AllEvents.Add(new GameEvent { id = "invincible_horror", name_en = "Invincible Horror", name_ru = "Неуязвимый Ужас", name_ko = "무적의 공포", desc_en = "One foe is invulnerable to damage. Can still be stunned or launched", desc_ru = "Один враг неуязвим к урону. Его все еще можно оглушить или оттолкнуть", desc_ko = "한 적이 피해에 면역. 기절/밀어내기는 가능", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "pacifist_mode", "boss_fight", "settle_it_in_smash" }, onActivate = delegate { InvincibleHorror = true; } }); AllEvents.Add(new GameEvent { id = "magnetic_valuables", name_en = "Magnetic Valuables", name_ru = "Магнитные Ценности", name_ko = "자석 귀중품", desc_en = "Valuables are attracted to players", desc_ru = "Ценности притягиваются к игрокам", desc_ko = "귀중품이 플레이어에게 끌림", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { MagneticValuables = true; } }); AllEvents.Add(new GameEvent { id = "pit_immunity", name_en = "Pit Immunity", name_ru = "Иммунитет к Ямам", name_ko = "구덩이 면역", desc_en = "Players do not take damage from pits, but are now pushed out of them", desc_ru = "Игроки не получают урон от ям, но теперь выталкиваются из них", desc_ko = "플레이어가 구덩이에서 피해를 받지 않고 밀려남", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { PitImmunity = true; } }); AllEvents.Add(new GameEvent { id = "unstable_grabbing", name_en = "Unstable Grabbing", name_ru = "Нестабильный Захват", name_ko = "불안정한 그랩", desc_en = "Overcharge enabled early and when lifting heavy objects", desc_ru = "Перегрузка включается заранее на ранней стадии и при поднятии тяжестей", desc_ko = "과충전이 일찍 활성화되고 무거운 물체를 들 때도 활성화", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "stable_grip" }, onActivate = delegate { UnstableGrabbing = true; } }); AllEvents.Add(new GameEvent { id = "stable_grip", name_en = "Stable Grip", name_ru = "Стабильный Хват", name_ko = "안정적인 그립", desc_en = "Grav-gun never overcharges, even on later levels", desc_ru = "Грав-пушка никогда не перегревается, даже на поздних уровнях", desc_ko = "그래브건이 후반 레벨에서도 과충전되지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "unstable_grabbing" }, onActivate = delegate { NoOvercharge = true; } }); AllEvents.Add(new GameEvent { id = "toxic_air", name_en = "Toxic Air", name_ru = "Токсичный Воздух", name_ko = "독성 공기", desc_en = "Players take damage over time", desc_ru = "Игроки получают урон со временем", desc_ko = "플레이어가 시간이 지나면 피해를 받음", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ToxicAir = true; } }); AllEvents.Add(new GameEvent { id = "enemy_multiplication", name_en = "Enemy Multiplication", name_ru = "Размножение Врагов", name_ko = "적 증식", desc_en = "X1.5 Spawn Enemies", desc_ru = "X1.5 Спавн Врагов", desc_ko = "적 스폰 1.5배", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { EnemyMultiplication = true; } }); AllEvents.Add(new GameEvent { id = "rubber_pits", name_en = "Rubber Pits", name_ru = "Резиновые Ямы", name_ko = "고무 구덩이", desc_en = "Enemies take no damage from pits and are launched out.", desc_ru = "Враги не получают урон от ям и выталкиваются наружу.", desc_ko = "적이 구덩이에서 피해를 받지 않고 튕겨나감", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { EnemiesPitImmunity = true; } }); AllEvents.Add(new GameEvent { id = "night_vision", name_en = "Night Vision", name_ru = "Ночное Зрение", name_ko = "야간 투시", desc_en = "Enhanced visibility in darkness", desc_ru = "Улучшенная видимость в темноте", desc_ko = "어둠 속에서 시야 향상", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { NightVision = true; } }); AllEvents.Add(new GameEvent { id = "sticky_feet", name_en = "Sticky Feet", name_ru = "Липкие Ноги", name_ko = "끈적한 발", desc_en = "Players stick to surfaces randomly", desc_ru = "Игроки случайно прилипают к поверхностям", desc_ko = "플레이어가 랜덤으로 표면에 달라붙음", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { StickyFeet = true; } }); AllEvents.Add(new GameEvent { id = "time_warp", name_en = "Time Warp", name_ru = "Искажение Времени", name_ko = "시간 왜곡", desc_en = "Time slows down periodically", desc_ru = "Время замедляется периодически", desc_ko = "시간이 주기적으로 느려짐", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { TimeWarp = true; } }); AllEvents.Add(new GameEvent { id = "infinite_ammo", name_en = "Infinite Ammo", name_ru = "Бесконечные Патроны", name_ko = "무한 탄약", desc_en = "Weapons never run out of ammo", desc_ru = "Оружие никогда не кончает патроны", desc_ko = "무기 탄약이 다하지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { InfiniteAmmo = true; } }); AllEvents.Add(new GameEvent { id = "one_hit_kill", name_en = "One Hit Kill", name_ru = "Убийство с Одного Выстрела", name_ko = "원킬", desc_en = "Any damage becomes lethal for enemies", desc_ru = "Любой урон становится летальним для врагов", desc_ko = "어떤 피해든 적에게 치명적", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "settle_it_in_smash", "wounded_fury", "executioner", "bloodthirst", "executioners_edge", "first_strike", "brawler", "adrenaline_surge", "double_enemy_damage", "critical_hits", "feeble", "soft_blows", "cowards_curse", "faint_heart", "stage_fright" }, onActivate = delegate { OneHitKill = true; } }); AllEvents.Add(new GameEvent { id = "health_vampire", name_en = "Health Vampire", name_ru = "Вампир Здоровья", name_ko = "체력 흡혈", desc_en = "Killing enemies restores 10 HP", desc_ru = "Убийство врагов восстанавливает 10 HP", desc_ko = "적 처치 시 HP 10 회복", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { HealthVampire = true; } }); AllEvents.Add(new GameEvent { id = "one_hit_kill_players", name_en = "Glass Cannon Players", name_ru = "Стеклянные Игроки", name_ko = "유리 대포 플레이어", desc_en = "Any damage becomes lethal for players", desc_ru = "Любой урон становится летальным для игроков", desc_ko = "어떤 피해든 플레이어에게 치명적", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "double_player_damage", "half_player_damage", "dangerous_valuables", "toxic_air", "glass_bones" }, onActivate = delegate { OneHitKillPlayers = true; } }); AllEvents.Add(new GameEvent { id = "double_player_damage", name_en = "Double Player Damage", name_ru = "Двойной Урон Игрокам", name_ko = "플레이어 피해 2배", desc_en = "Players take double damage", desc_ru = "Игроки получают двойной урон", desc_ko = "플레이어가 2배 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { DoublePlayerDamage = true; } }); AllEvents.Add(new GameEvent { id = "double_enemy_health", name_en = "Double Enemy Health", name_ru = "Двойное Здоровье Врагов", name_ko = "적 체력 2배", desc_en = "Enemies have double health", desc_ru = "Враги имеют двойное здоровье", desc_ko = "적 체력 2배", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { DoubleEnemyHealth = true; } }); AllEvents.Add(new GameEvent { id = "half_player_damage", name_en = "Half Player Damage", name_ru = "Половина Урона Игрокам", name_ko = "플레이어 피해 50% 감소", desc_en = "Players take 50% less damage", desc_ru = "Игроки получают на 50% меньше урона", desc_ko = "플레이어가 50% 적은 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "double_player_damage" }, onActivate = delegate { HalfPlayerDamage = true; } }); AllEvents.Add(new GameEvent { id = "double_enemy_damage", name_en = "Double Enemy Damage", name_ru = "Двойной Урон Врагам", name_ko = "적에게 2배 피해", desc_en = "Enemies take double damage", desc_ru = "Враги получают двойной урон", desc_ko = "적이 2배 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { DoubleEnemyDamage = true; } }); AllEvents.Add(new GameEvent { id = "feather_weight", name_en = "Feather Weight", name_ru = "Перьевой Вес", name_ko = "깃털 무게", desc_en = "All objects are 5x lighter", desc_ru = "Все предметы в 5 раз легче", desc_ko = "모든 물체가 5배 가벼움", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "heavy_burden" }, onActivate = delegate { FeatherWeight = true; } }); AllEvents.Add(new GameEvent { id = "heavy_burden", name_en = "Heavy Burden", name_ru = "Тяжелая Ноша", name_ko = "무거운 짐", desc_en = "All objects are 3x heavier", desc_ru = "Все предметы в 3 раза тяжелее", desc_ko = "모든 물체가 3배 무거움", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "feather_weight" }, onActivate = delegate { HeavyBurden = true; } }); AllEvents.Add(new GameEvent { id = "slippery_chaos", name_en = "Slippery Chaos", name_ru = "Скользкий Хаос", name_ko = "미끄러운 혼돈", desc_en = "All objects slide forever", desc_ru = "Все предметы скользят бесконечно", desc_ko = "모든 물체가 영원히 미끄러짐", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { SlipperyChaos = true; } }); AllEvents.Add(new GameEvent { id = "zero_gravity_loot", name_en = "Zero Gravity Loot", name_ru = "Нулевая Гравитация", name_ko = "무중력 전리품", desc_en = "Objects float in zero gravity", desc_ru = "Предметы парят без гравитации", desc_ko = "물체가 무중력 상태로 떠다님", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { ZeroGravityLoot = true; } }); AllEvents.Add(new GameEvent { id = "phantom_objects", name_en = "Phantom Objects", name_ru = "Фантомные Предметы", name_ko = "유령 물체", desc_en = "Objects disappear periodically", desc_ru = "Предметы исчезают периодически", desc_ko = "물체가 주기적으로 사라짐", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { PhantomObjects = true; } }); AllEvents.Add(new GameEvent { id = "bouncy_havoc", name_en = "Bouncy Havoc", name_ru = "Прыгучий Хаос", name_ko = "통통 튀는 혼돈", desc_en = "All objects are super bouncy", desc_ru = "Все предметы супер-прыгучие", desc_ko = "모든 물체가 매우 탄력적", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { BouncyHavoc = true; } }); AllEvents.Add(new GameEvent { id = "extraction_rush", name_en = "Extraction Rush", name_ru = "Спешная Экстракция", name_ko = "추출 러시", desc_en = "Extraction time halved", desc_ru = "Время экстракции вдвое меньше", desc_ko = "추출 시간 절반", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ExtractionRush = true; } }); AllEvents.Add(new GameEvent { id = "found_map", name_en = "Found the Location Map", name_ru = "Найденная Карта", name_ko = "지도 발견", desc_en = "The entire map and all items are explored from the start", desc_ru = "Вся карта и все предметы исследованы с самого начала", desc_ko = "전체 맵과 모든 아이템이 시작부터 탐색됨", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { FoundMap = true; } }); AllEvents.Add(new GameEvent { id = "extraction_shield", name_en = "Extraction Shield", name_ru = "Щит Экстракции", name_ko = "추출 보호막", desc_en = "Players invincible during extraction warning and collecting", desc_ru = "Игроки неуязвимы во время предупреждения и сбора экстракции", desc_ko = "추출 경고 및 수집 중 플레이어 무적", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { ExtractionShield = true; } }); AllEvents.Add(new GameEvent { id = "extraction_chaos", name_en = "Extraction Chaos", name_ru = "Хаос Экстракции", name_ko = "추출 혼돈", desc_en = "Enemies attack during extraction", desc_ru = "Враги атакуют во время экстракции", desc_ko = "추출 중 적이 공격함", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ExtractionChaos = true; } }); AllEvents.Add(new GameEvent { id = "single_extraction", name_en = "Single Extraction", name_ru = "Единственная Экстракция", name_ko = "단일 추출", desc_en = "Only 1 extraction point on the level", desc_ru = "Только 1 точка экстракции на уровне", desc_ko = "레벨에 추출 지점 1개만 존재", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { SingleExtraction = true; } }); AllEvents.Add(new GameEvent { id = "player_revival", name_en = "Player Revival", name_ru = "Возрождение Игрока", name_ko = "플레이어 부활", desc_en = "Press hotkey to revive once when dead (1 HP)", desc_ru = "Нажмите горячую клавишу для возрождения один раз при смерти (1 HP)", desc_ko = "사망 시 단축키를 눌러 1회 부활 (체력 1)", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { PlayerRevival = true; } }); AllEvents.Add(new GameEvent { id = "unbreakable_doors", name_en = "Unbreakable Doors", name_ru = "Неломаемые Двери", name_ko = "부서지지 않는 문", desc_en = "Doors cannot be broken or removed", desc_ru = "Двери нельзя сломать или убрать", desc_ko = "문을 부수거나 제거할 수 없음", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { UnbreakableDoors = true; } }); AllEvents.Add(new GameEvent { id = "scale_in_cart", name_en = "Compact Storage", name_ru = "Компактное Хранение", name_ko = "소형 보관", desc_en = "Valuables shrink in carts", desc_ru = "Ценности уменьшаются в тележках", desc_ko = "귀중품이 카트에서 축소됨", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ScaleInCart = true; } }); AllEvents.Add(new GameEvent { id = "shrink_extraction_valuables", name_en = "Extraction Shrink", name_ru = "Уменьшение при Экстракции", name_ko = "추출 축소", desc_en = "Valuables shrink when in extractions", desc_ru = "Ценности уменьшаются на экстракциях", desc_ko = "귀중품이 추출 지점에서 축소됨", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ShrinkExtractionValuables = true; } }); AllEvents.Add(new GameEvent { id = "enemies_omniscient", name_en = "Omniscient Enemies", name_ru = "Всеведущие Враги", name_ko = "전지적 적", desc_en = "Enemies always know where players are", desc_ru = "Враги всегда знают, где находятся игроки", desc_ko = "적이 항상 플레이어 위치를 앎", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { EnemiesOmniscient = true; } }); AllEvents.Add(new GameEvent { id = "boss_fight", name_en = "Boss Fight!", name_ru = "Битва с Боссом!", name_ko = "보스전!", desc_en = "One enemy boss. x1.3 Size, triple HP, faster respawn, drops upgrade on first kill. Other enemies weaker.", desc_ru = "Один враг босс. x1.3 Размер, тройное HP, быстрый респавн, дает апгрейд при первом убийстве.", desc_ko = "보스 1마리. 크기 1.3배, HP 3배, 빠른 리스폰, 첫 처치 시 업그레이드. 다른 적 약화.", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "pacifist_mode", "too_quiet", "invincible_horror" }, onActivate = delegate { BossFight = true; } }); AllEvents.Add(new GameEvent { id = "super_recoil", name_en = "Heavy Recoil", name_ru = "Тяжелая Отдача", name_ko = "강한 반동", desc_en = "Guns push you back strongly when fired", desc_ru = "Оружие сильно отталкивает при стрельбе", desc_ko = "사격 시 강한 반동 발생", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { SuperRecoil = true; } }); AllEvents.Add(new GameEvent { id = "jamming_guns", name_en = "Jamming Mechanisms", name_ru = "Заклинивание", name_ko = "총기 걸림", desc_en = "Guns have a 15% chance to jam", desc_ru = "Оружие имеет 25% шанс заклинить при выстреле", desc_ko = "총기가 15% 확률로 걸림", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { JammingGuns = true; } }); AllEvents.Add(new GameEvent { id = "cheap_batteries", name_en = "Cheap Batteries", name_ru = "Дешевые Батарейки", name_ko = "싸구려 배터리", desc_en = "Battery drain x2.5 faster", desc_ru = "Батарейки разряжаются в 2.5 раза быстрее", desc_ko = "배터리가 2.5배 빨리 소모됨", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { CheapBatteries = true; } }); AllEvents.Add(new GameEvent { id = "explosive_tumble", name_en = "Volatile Impact", name_ru = "Взрывное Падение", name_ko = "폭발적인 충격", desc_en = "Hard impacts create a small explosion", desc_ru = "Сильные удары при падении создают взрыв", desc_ko = "강한 충격 시 작은 폭발 발생", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { ExplosiveTumble = true; } }); AllEvents.Add(new GameEvent { id = "glass_bones", name_en = "Glass Bones", name_ru = "Хрустальные Кости", name_ko = "유리 뼈", desc_en = "Impact damage x3", desc_ru = "Урон от падений и ударов x3", desc_ko = "충격 피해 3배", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { GlassBones = true; } }); AllEvents.Add(new GameEvent { id = "slippery_hands", name_en = "Slippery Hands", name_ru = "Скользкие Руки", name_ko = "미끄러운 손", desc_en = "Items randomly slip out of your hands", desc_ru = "Предметы случайно выпадают из рук", desc_ko = "아이템이 손에서 미끄러짐", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), onActivate = delegate { SlipperyHands = true; } }); AllEvents.Add(new GameEvent { id = "giant_player", name_en = "Giant Player", name_ru = "Гигант", name_ko = "거인", desc_en = "You are huge (Scale x1.5)", desc_ru = "Вы огромный (Размер x1.5)", desc_ko = "거대화 (크기 x1.5)", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "tiny_player" }, onActivate = delegate { GiantPlayer = true; } }); AllEvents.Add(new GameEvent { id = "tiny_player", name_en = "Tiny Player", name_ru = "Карлик", name_ko = "소인", desc_en = "You are tiny (Scale x0.6)", desc_ru = "Вы крошечный (Размер x0.6)", desc_ko = "소형화 (크기 x0.6)", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "giant_player" }, onActivate = delegate { TinyPlayer = true; } }); AllEvents.Add(new GameEvent { id = "weak_arms", name_en = "Weak Arms", name_ru = "Слабые Руки", name_ko = "약한 팔", desc_en = "Throw force reduced significantly", desc_ru = "Сила броска значительно снижена", desc_ko = "던지는 힘 크게 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "strong_arms" }, onActivate = delegate { WeakArms = true; } }); AllEvents.Add(new GameEvent { id = "strong_arms", name_en = "Strong Arms", name_ru = "Сильные Руки", name_ko = "강한 팔", desc_en = "Throw force increased x3", desc_ru = "Сила броска увеличена в 3 раза", desc_ko = "던지는 힘 3배 증가", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "weak_arms" }, onActivate = delegate { StrongArms = true; } }); AllEvents.Add(new GameEvent { id = "earthquake", name_en = "Earthquake", name_ru = "Землетрясение", name_ko = "지진", desc_en = "Periodic tremors shake the camera", desc_ru = "Периодические подземные толчки", desc_ko = "주기적인 지진", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), onActivate = delegate { Earthquake = true; } }); AllEvents.Add(new GameEvent { id = "no_jump", name_en = "Broken Legs", name_ru = "Сломанные Ноги", name_ko = "부러진 다리", desc_en = "You cannot jump", desc_ru = "Вы не можете прыгать", desc_ko = "점프 불가", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), onActivate = delegate { NoJump = true; } }); AllEvents.Add(new GameEvent { id = "total_darkness", name_en = "Total Darkness", name_ru = "Полная Тьма", name_ko = "완전한 어둠", desc_en = "Ambient light disabled", desc_ru = "Фоновое освещение отключено", desc_ko = "주변광 비활성화", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { TotalDarkness = true; } }); AllEvents.Add(new GameEvent { id = "kamikaze_enemies", name_en = "Kamikaze Enemies", name_ru = "Враги-Камикадзе", name_ko = "카미카제 적", desc_en = "Enemies explode on death", desc_ru = "Враги взрываются при смерти", desc_ko = "적이 죽으면 폭발", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { KamikazeEnemies = true; } }); AllEvents.Add(new GameEvent { id = "regenerating_enemies", name_en = "Regenerating Enemies", name_ru = "Регенерирующие Враги", name_ko = "재생하는 적", desc_en = "Enemies slowly regenerate health", desc_ru = "Враги медленно восстанавливают здоровье", desc_ko = "적이 천천히 체력 회복", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { RegeneratingEnemies = true; } }); AllEvents.Add(new GameEvent { id = "shadow_clones", name_en = "Shadow Clones", name_ru = "Теневые Клоны", name_ko = "그림자 분신", desc_en = "Killing enemies spawns a weaker clone", desc_ru = "Убийство врага порождает слабого клона", desc_ko = "적 처치 시 약한 분신 생성", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { ShadowClones = true; } }); AllEvents.Add(new GameEvent { id = "dangerous_valuables", name_en = "Dangerous Valuables", name_ru = "Опасные Ценности", name_ko = "위험한 귀중품", desc_en = "Taking a valuable item deals 5 damage (once per item)", desc_ru = "Подбор ценности наносит 5 урона (один раз за предмет)", desc_ko = "귀중품을 집으면 5의 피해를 입음 (아이템당 한 번)", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { DangerousValuables = true; } }); AllEvents.Add(new GameEvent { id = "cloaked_valuables", name_en = "Cloaked Valuables", name_ru = "Замаскированные Ценности", name_ko = "은폐된 귀중품", desc_en = "Valuables are invisible when far away", desc_ru = "Ценности невидимы издалека", desc_ko = "멀리 있는 귀중품이 보이지 않음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { CloakedValuables = true; } }); AllEvents.Add(new GameEvent { id = "runaway_valuables", name_en = "Runaway Valuables", name_ru = "Убегающие Ценности", name_ko = "도망치는 귀중품", desc_en = "Valuables run away from you!", desc_ru = "Ценности убегают от вас!", desc_ko = "귀중품이 당신에게서 도망칩니다!", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { RunawayValuables = true; } }); AllEvents.Add(new GameEvent { id = "dodge", name_en = "Dodge", name_ru = "Уклонение", name_ko = "회피", desc_en = "20% chance to completely avoid damage", desc_ru = "20% шанс полностью избежать урона", desc_ko = "20% 확률로 피해 완전 회피", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Dodge = true; } }); AllEvents.Add(new GameEvent { id = "chain_reaction", name_en = "Chain Reaction", name_ru = "Цепная Реакция", name_ko = "연쇄 반응", desc_en = "When a valuable breaks, nearby ones also take damage", desc_ru = "Когда ценность ломается, ближайшие тоже получают урон", desc_ko = "귀중품이 부서지면 주변 귀중품도 피해를 입음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ChainReaction = true; } }); AllEvents.Add(new GameEvent { id = "fake_valuables", name_en = "Fake Valuables", name_ru = "Фальшивые Ценности", name_ko = "가짜 귀중품", desc_en = "15% of valuables are fake and disappear when touched", desc_ru = "15% ценностей фальшивые и исчезают при касании", desc_ko = "귀중품의 15%가 가짜로 터치 시 사라짐", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { FakeValuables = true; } }); AllEvents.Add(new GameEvent { id = "value_decay", name_en = "Value Decay", name_ru = "Падение Стоимости", name_ko = "가치 감소", desc_en = "Valuables lose 0.1% of their value every 15 seconds", desc_ru = "Ценности теряют 0.1% стоимости каждые 15 секунд", desc_ko = "귀중품이 15초마다 가치의 0.1%를 잃음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ValueDecay = true; } }); AllEvents.Add(new GameEvent { id = "enemy_heal_on_damage", name_en = "Vampiric Enemies", name_ru = "Вампирические Враги", name_ko = "흡혈귀 적", desc_en = "Enemies heal when they deal damage to players", desc_ru = "Враги исцеляются, когда наносят урон игрокам", desc_ko = "적이 플레이어에게 피해를 줄 때 회복함", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { EnemyHealOnDamage = true; } }); AllEvents.Add(new GameEvent { id = "player_deaf", name_en = "Deaf Player", name_ru = "Глухой игрок", name_ko = "귀머거리 플레이어", desc_en = "Player cannot hear any sounds", desc_ru = "Игрок не слышит никаких звуков", desc_ko = "플레이어가 아무 소리도 듣지 못함", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { PlayerDeaf = true; } }); AllEvents.Add(new GameEvent { id = "enemies_faster_on_kill", name_en = "Bloodlust", name_ru = "Кровожадность", name_ko = "피에 굶주림", desc_en = "Enemies become faster with each enemy kill", desc_ru = "Враги становятся быстрее с каждым убитым врагом", desc_ko = "적을 죽일 때마다 적이 빨라집니다", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { EnemiesFasterOnKill = true; } }); AllEvents.Add(new GameEvent { id = "critical_hits", name_en = "Critical Hits", name_ru = "Критические удары", name_ko = "치명타", desc_en = "15% chance to deal x3 damage to enemies", desc_ru = "15% шанс нанести x3 урона врагам", desc_ko = "15% 확률로 적에게 3배 데미지", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { CriticalHits = true; } }); AllEvents.Add(new GameEvent { id = "teleporting_enemies", name_en = "Teleporting Enemies", name_ru = "Телепортирующиеся враги", name_ko = "텔레포트하는 적", desc_en = "Enemies periodically teleport to random safe locations", desc_ru = "Враги периодически телепортируются в случайные безопасные места", desc_ko = "적이 주기적으로 무작위 안전한 위치로 텔레포트합니다", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { TeleportingEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ TeleportingEnemies modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "shared_pain", name_en = "Shared Pain", name_ru = "Общая Боль", name_ko = "공유된 고통", desc_en = "When one player takes damage, everyone takes 25% damage", desc_ru = "Когда один игрок получает урон, все получают 25% урона", desc_ko = "한 플레이어가 피해를 입으면 모든 플레이어가 25% 피해를 입습니다", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { SharedPain = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ SharedPain modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "shared_healing", name_en = "Shared Healing", name_ru = "Общее Исцеление", name_ko = "공유된 치유", desc_en = "When one player heals, everyone heals for 50% of that amount", desc_ru = "Когда один игрок исцеляется, все исцеляются на 50% от этого количества", desc_ko = "한 플레이어가 치유되면 모든 플레이어가 그 양의 50%만큼 치유됩니다", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { SharedHealing = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ SharedHealing modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "low_health_speed_boost", name_en = "Adrenaline Rush", name_ru = "Адреналиновый Шторм", name_ko = "아드레날린 러시", desc_en = "Movement speed increases as health gets lower", desc_ru = "Скорость движения увеличивается по мере понижения здоровья", desc_ko = "체력이 낮아질수록 이동 속도가 증가합니다", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { LowHealthSpeedBoost = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ LowHealthSpeedBoost modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "valuable_encumbrance", name_en = "Encumbered", name_ru = "Обремененный", name_ko = "무거운 짐", desc_en = "Movement speed decreases based on weight of carried valuables", desc_ru = "Скорость движения уменьшается в зависимости от веса переносимых ценностей", desc_ko = "휴대하는 귀중품의 무게에 따라 이동 속도가 감소합니다", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ValuableEncumbrance = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ ValuableEncumbrance modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "speed_zones", name_en = "Speed Rooms", name_ru = "Комнаты Скорости", name_ko = "속도 방", desc_en = "Each room has random speed effect - boost or slowdown", desc_ru = "Каждая комната имеет случайный эффект скорости", desc_ko = "각 방마다 무작위 속도 효과", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { SpeedZones = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Speed Zones modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "random_player_teleportations", name_en = "Random Player Teleportations", name_ru = "Случайные Телепортации Игроков", name_ko = "무작위 플레이어 텔레포트", desc_en = "Players randomly teleport every 30-60 seconds", desc_ru = "Игроки случайно телепортируются каждые 60 секунд", desc_ko = "플레이어가 60초마다 무작위로 텔레포트됨", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { RandomPlayerTeleportations = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Random Player Teleportations modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "sticky_valuables", name_en = "Sticky Valuables", name_ru = "Липкие Ценности", name_ko = "끈적이는 귀중품", desc_en = "Once grabbed, valuables are hard to drop", desc_ru = "После захвата ценности трудно сбросить", desc_ko = "한 번 잡으면 귀중품을 놓기가 어려움", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { StickyValuables = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Sticky Valuables modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "explosive_throw_valuables", name_en = "Explosive Throw Valuables", name_ru = "Взрывоопасные Ценности при Броске", name_ko = "던지면 폭발하는 귀중품", desc_en = "Valuables explode if thrown too hard", desc_ru = "Ценности взрываются при сильном броске", desc_ko = "귀중품을 세게 던지면 폭발함", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "valuables_unbreakable" }, onActivate = delegate { ExplosiveThrowValuables = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Explosive Throw Valuables modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "room_gravity", name_en = "Room Gravity", name_ru = "Гравитация Комнат", name_ko = "방 중력", desc_en = "Different rooms have different gravity", desc_ru = "Разные комнаты имеют разную гравитацию", desc_ko = "각 방마다 다른 중력이 적용됨", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { RoomGravity = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Room Gravity modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "double_jump", name_en = "Double Jump", name_ru = "Двойной Прыжок", name_ko = "더블 점프", desc_en = "Press jump in air for second jump", desc_ru = "Нажмите прыжок в воздухе для второго прыжка", desc_ko = "공중에 있을 때 점프 버튼으로 더블 점프", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "no_jump" }, onActivate = delegate { DoubleJump = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Double Jump modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "no_fall_damage", name_en = "No Fall Damage", name_ru = "Без Урона От Падения", name_ko = "낙하 데미지 없음", desc_en = "No damage from falling", desc_ru = "Нет урона от падения", desc_ko = "낙하로 인한 데미지 없음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { NoFallDamage = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ No Fall Damage modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "damage_tradeoff", name_en = "Berserker", name_ru = "Берсерк", name_ko = "버서커", desc_en = "Deal x2 damage but take x1.5 damage", desc_ru = "Наносите x2 урона но получаете x1.5 урона", desc_ko = "x2 데미지를 주지만 x1.5 데미지를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { DamageTradeoff = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Damage Tradeoff modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "cursed_valuables", name_en = "Cursed Valuables", name_ru = "Проклятые Ценности", name_ko = "저주받은 귀중품", desc_en = "High value valuables deal damage when held", desc_ru = "Ценные ценности наносят урон при ношении", desc_ko = "고가치 아이템을 들고 있으면 데미지를 받음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { CursedValuables = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Cursed Valuables modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "alarm_system", name_en = "Alarm System", name_ru = "Система Тревоги", name_ko = "경보 시스템", desc_en = "Breaking valuables triggers alarm attracting enemies", desc_ru = "Разбивание ценностей вызывает тревогу, привлекая врагов", desc_ko = "귀중품을 부수면 경보가 울려 적을 끌어들임", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { AlarmSystem = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Alarm System modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "enemy_touch_shock", name_en = "Enemy Touch Shock", name_ru = "Шок от Касания Врагов", name_ko = "적 접촉 충격", desc_en = "Touching enemies shocks and stuns player briefly", desc_ru = "Касание врагов вызывает шок и кратковременное оглушение игрока", desc_ko = "적을 만지면 플레이어가 충격받아 잠시 기절함", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { EnemyTouchShock = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Enemy Touch Shock modifier activated!"); } }); AllEvents.Add(new GameEvent { id = "wounded_fury", name_en = "Wounded Fury", name_ru = "Ярость Раненого", name_ko = "상처입은 분노", desc_en = "The lower your health, the more damage you deal to enemies (up to 2.5x)", desc_ru = "Чем ниже здоровье, тем больше урона врагам (до 2.5x)", desc_ko = "체력이 낮을수록 적에게 더 큰 피해 (최대 2.5배)", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { WoundedFury = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Wounded Fury activated!"); } }); AllEvents.Add(new GameEvent { id = "executioner", name_en = "Executioner", name_ru = "Палач", name_ko = "처형자", desc_en = "Enemies below 25% health take double damage", desc_ru = "Враги с HP ниже 25% получают двойной урон", desc_ko = "체력 25% 미만의 적은 두 배의 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Executioner = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Executioner activated!"); } }); AllEvents.Add(new GameEvent { id = "lifesteal_strikes", name_en = "Lifesteal Strikes", name_ru = "Похититель Жизни", name_ko = "생명력 흡수", desc_en = "Damaging enemies heals you for a small amount", desc_ru = "Урон по врагам немного восстанавливает ваше здоровье", desc_ko = "적에게 피해를 주면 체력이 소량 회복됨", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { LifestealStrikes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lifesteal Strikes activated!"); } }); AllEvents.Add(new GameEvent { id = "last_breath", name_en = "Last Breath", name_ru = "Последний Вздох", name_ko = "마지막 숨결", desc_en = "The first lethal hit each level leaves you at 1 HP instead of killing you", desc_ru = "Первый смертельный удар за уровень оставляет 1 HP вместо смерти", desc_ko = "레벨당 첫 치명타는 죽이지 않고 체력 1로 남김", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { LastBreath = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Last Breath activated!"); } }); AllEvents.Add(new GameEvent { id = "thorns", name_en = "Thorns", name_ru = "Шипы", name_ko = "가시", desc_en = "When you take damage, the nearest enemy takes damage back", desc_ru = "Когда вы получаете урон, ближайший враг получает урон в ответ", desc_ko = "피해를 받으면 가장 가까운 적도 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Thorns = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Thorns activated!"); } }); AllEvents.Add(new GameEvent { id = "glass_enemies", name_en = "Glass Enemies", name_ru = "Стеклянные Враги", name_ko = "유리 적", desc_en = "Enemies spawn with half health", desc_ru = "Враги появляются с вдвое меньшим здоровьем", desc_ko = "적이 절반의 체력으로 생성됨", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "double_enemy_health" }, onActivate = delegate { GlassEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Enemies activated!"); } }); AllEvents.Add(new GameEvent { id = "bountiful_kills", name_en = "Bountiful Kills", name_ru = "Щедрые Убийства", name_ko = "풍요로운 처치", desc_en = "Killed enemies drop 2 bonus orbs on top of the usual drop", desc_ru = "Убитые враги роняют 2 бонусных орба сверх обычного дропа", desc_ko = "처치한 적이 일반 드롭에 더해 보너스 오브 2개를 떨어뜨림", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { BountifulKills = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bountiful Kills activated!"); } }); AllEvents.Add(new GameEvent { id = "tax_season", name_en = "Tax Season", name_ru = "Налоговый Сезон", name_ko = "세금 시즌", desc_en = "All valuables are worth 15% less", desc_ru = "Все ценности стоят на 15% меньше", desc_ko = "모든 귀중품의 가치가 15% 감소", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "risk_reward" }, onActivate = delegate { TaxSeason = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tax Season activated!"); } }); AllEvents.Add(new GameEvent { id = "risk_reward", name_en = "Risk & Reward", name_ru = "Риск и Награда", name_ko = "위험과 보상", desc_en = "Valuables are worth 35% more, but break twice as fast", desc_ru = "Ценности стоят на 35% больше, но ломаются вдвое быстрее", desc_ko = "귀중품 가치 35% 증가, 그러나 두 배 빨리 파손됨", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "tax_season", "valuables_unbreakable" }, onActivate = delegate { RiskReward = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Risk & Reward activated!"); } }); AllEvents.Add(new GameEvent { id = "bloodthirst", name_en = "Bloodthirst", name_ru = "Жажда Крови", name_ko = "피의 갈망", desc_en = "Each enemy kill grants +5% damage to enemies for the level (up to +50%)", desc_ru = "Каждое убийство даёт +5% урона врагам до конца уровня (до +50%)", desc_ko = "적 처치마다 레벨 동안 적에게 주는 피해 +5% (최대 +50%)", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Bloodthirst = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bloodthirst activated!"); } }); AllEvents.Add(new GameEvent { id = "iron_will", name_en = "Iron Will", name_ru = "Железная Воля", name_ko = "강철 의지", desc_en = "Take 65% less damage from everything", desc_ru = "Получаете на 65% меньше урона от всего", desc_ko = "모든 피해를 65% 덜 받음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { IronWill = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Iron Will!"); } }); AllEvents.Add(new GameEvent { id = "guardian_shield", name_en = "Guardian Shield", name_ru = "Щит Стража", name_ko = "수호자의 방패", desc_en = "Every 8 seconds, the next hit is fully blocked", desc_ru = "Каждые 8 секунд следующий удар полностью блокируется", desc_ko = "8초마다 다음 공격을 완전히 막음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { GuardianShield = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Guardian Shield!"); } }); AllEvents.Add(new GameEvent { id = "damage_ward", name_en = "Damage Ward", name_ru = "Оберег", name_ko = "피해 방어막", desc_en = "The first 3 hits each level deal no damage", desc_ru = "Первые 3 удара на каждом уровне не наносят урона", desc_ko = "각 레벨의 첫 3번의 공격은 피해를 주지 않음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { DamageWard = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Damage Ward!"); } }); AllEvents.Add(new GameEvent { id = "titans_vigor", name_en = "Titan's Vigor", name_ru = "Мощь Титана", name_ko = "타이탄의 활력", desc_en = "Dropping below 20% HP heals you to 50% (20s cooldown)", desc_ru = "Падение HP ниже 20% лечит вас до 50% (перезарядка 20с)", desc_ko = "체력이 20% 미만으로 떨어지면 50%까지 회복 (20초 쿨)", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { TitansVigor = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Titan's Vigor!"); } }); AllEvents.Add(new GameEvent { id = "regeneration_aura", name_en = "Regeneration Aura", name_ru = "Аура Регенерации", name_ko = "재생의 오라", desc_en = "Regenerate 1 HP every second", desc_ru = "Восстанавливаете 1 HP каждую секунду", desc_ko = "매초 체력 1 회복", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { RegenerationAura = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Regeneration Aura!"); } }); AllEvents.Add(new GameEvent { id = "bloodthirsty_healer", name_en = "Bloodthirsty Healer", name_ru = "Кровавый Лекарь", name_ko = "피의 치유사", desc_en = "Killing an enemy heals the nearest player for 20 HP", desc_ru = "Убийство врага лечит ближайшего игрока на 20 HP", desc_ko = "적 처치 시 가장 가까운 플레이어 체력 20 회복", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { BloodthirstyHealer = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bloodthirsty Healer!"); } }); AllEvents.Add(new GameEvent { id = "berserkers_resolve", name_en = "Berserker's Resolve", name_ru = "Решимость Берсерка", name_ko = "광전사의 결의", desc_en = "Below 30% HP: take 50% less damage and deal 50% more to enemies", desc_ru = "Ниже 30% HP: −50% получаемого урона и +50% урона врагам", desc_ko = "체력 30% 미만: 받는 피해 −50%, 적에게 주는 피해 +50%", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { BerserkersResolve = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Berserker's Resolve!"); } }); AllEvents.Add(new GameEvent { id = "executioners_edge", name_en = "Executioner's Edge", name_ru = "Грань Палача", name_ko = "처형자의 칼날", desc_en = "Enemies below 40% health take triple damage", desc_ru = "Враги с HP ниже 40% получают тройной урон", desc_ko = "체력 40% 미만의 적은 세 배의 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ExecutionersEdge = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Executioner's Edge!"); } }); AllEvents.Add(new GameEvent { id = "last_stand", name_en = "Last Stand", name_ru = "Последний Рубеж", name_ko = "최후의 저항", desc_en = "Last player alive (or below 50% HP solo): +100% damage to enemies, -50% damage taken", desc_ru = "Последний выживший (или ниже 50% HP в соло): +100% урона врагам, −50% получаемого урона", desc_ko = "마지막 생존자(솔로는 체력 50% 미만): 적에게 +100% 피해, 받는 피해 −50%", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LastStand = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Last Stand!"); } }); AllEvents.Add(new GameEvent { id = "second_wind", name_en = "Second Wind", name_ru = "Второе Дыхание", name_ko = "재기", desc_en = "Survive up to 2 lethal hits per level (left at 1 HP)", desc_ru = "Переживаете до 2 смертельных ударов за уровень (остаётесь с 1 HP)", desc_ko = "레벨당 치명타 2회까지 생존 (체력 1로 남음)", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { SecondWind = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Second Wind!"); } }); AllEvents.Add(new GameEvent { id = "first_strike", name_en = "First Strike", name_ru = "Первый Удар", name_ko = "선제공격", desc_en = "Enemies at 90%+ health take 50% more damage", desc_ru = "Враги с HP 90%+ получают на 50% больше урона", desc_ko = "체력 90% 이상의 적은 50% 더 많은 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { FirstStrike = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ First Strike!"); } }); AllEvents.Add(new GameEvent { id = "adrenaline_surge", name_en = "Adrenaline Surge", name_ru = "Прилив Адреналина", name_ko = "아드레날린 분출", desc_en = "For 4s after taking damage, deal 30% more to enemies", desc_ru = "В течение 4с после получения урона наносите на 30% больше врагам", desc_ko = "피해를 받은 후 4초간 적에게 30% 더 많은 피해", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { AdrenalineSurge = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Adrenaline Surge!"); } }); AllEvents.Add(new GameEvent { id = "brawler", name_en = "Brawler", name_ru = "Драчун", name_ko = "싸움꾼", desc_en = "Deal 40% more damage to enemies in close range (4m)", desc_ru = "Наносите на 40% больше урона врагам вблизи (4м)", desc_ko = "근접 거리(4m)의 적에게 40% 더 많은 피해", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Brawler = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Brawler!"); } }); AllEvents.Add(new GameEvent { id = "toughened", name_en = "Toughened", name_ru = "Закалённый", name_ko = "단련됨", desc_en = "Take 25% less damage from everything", desc_ru = "Получаете на 25% меньше урона от всего", desc_ko = "모든 피해를 25% 덜 받음", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Toughened = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Toughened!"); } }); AllEvents.Add(new GameEvent { id = "frailty", name_en = "Frailty", name_ru = "Немощь", name_ko = "허약", desc_en = "You cannot be healed", desc_ru = "Вас невозможно вылечить", desc_ko = "치유될 수 없음", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "lifesteal_strikes", "regeneration_aura", "bloodthirsty_healer", "titans_vigor" }, onActivate = delegate { Frailty = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Frailty!"); } }); AllEvents.Add(new GameEvent { id = "feeble", name_en = "Feeble", name_ru = "Слабак", name_ko = "연약함", desc_en = "You deal 60% less damage to enemies", desc_ru = "Вы наносите на 60% меньше урона врагам", desc_ko = "적에게 주는 피해 60% 감소", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { Feeble = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Feeble!"); } }); AllEvents.Add(new GameEvent { id = "glass_jaw", name_en = "Glass Jaw", name_ru = "Стеклянная Челюсть", name_ko = "유리턱", desc_en = "Every 4th hit you take deals double damage", desc_ru = "Каждый 4-й удар по вам наносит двойной урон", desc_ko = "받는 4번째 공격마다 두 배의 피해", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { GlassJaw = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Jaw!"); } }); AllEvents.Add(new GameEvent { id = "pain_amplifier", name_en = "Pain Amplifier", name_ru = "Усилитель Боли", name_ko = "고통 증폭기", desc_en = "Every hit deals at least 10 damage to you", desc_ru = "Любой удар наносит вам минимум 10 урона", desc_ko = "받는 모든 공격이 최소 10의 피해", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { PainAmplifier = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pain Amplifier!"); } }); AllEvents.Add(new GameEvent { id = "adrenaline_crash", name_en = "Adrenaline Crash", name_ru = "Адреналиновый Откат", name_ko = "아드레날린 붕괴", desc_en = "Each enemy kill deals 5 recoil damage to the nearest player", desc_ru = "Каждое убийство врага бьёт ближайшего игрока на 5 урона", desc_ko = "적 처치마다 가장 가까운 플레이어가 5의 반동 피해", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { AdrenalineCrash = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Adrenaline Crash!"); } }); AllEvents.Add(new GameEvent { id = "exhausted", name_en = "Exhausted", name_ru = "Истощённый", name_ko = "탈진", desc_en = "You have no stamina and cannot sprint", desc_ru = "У вас нет выносливости - нельзя бегать", desc_ko = "스태미나가 없어 전력질주 불가", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "infinite_stamina" }, onActivate = delegate { Exhausted = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Exhausted!"); } }); AllEvents.Add(new GameEvent { id = "recoil_strikes", name_en = "Recoil Strikes", name_ru = "Отдача", name_ko = "반동 타격", desc_en = "Damaging an enemy deals 2 damage back to you", desc_ru = "Урон по врагу бьёт вас на 2 в ответ", desc_ko = "적에게 피해를 주면 2의 반동 피해를 받음", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { RecoilStrikes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Recoil Strikes!"); } }); AllEvents.Add(new GameEvent { id = "vulnerable", name_en = "Vulnerable", name_ru = "Уязвимый", name_ko = "취약", desc_en = "You take 150% more damage from everything", desc_ru = "Вы получаете на 150% больше урона от всего", desc_ko = "모든 피해를 150% 더 받음", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "double_player_damage", "half_player_damage" }, onActivate = delegate { Vulnerable = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vulnerable!"); } }); AllEvents.Add(new GameEvent { id = "soul_drain", name_en = "Soul Drain", name_ru = "Иссушение", name_ko = "영혼 흡수", desc_en = "Lose 1 HP per second while an enemy is within 5m", desc_ru = "Теряете 1 HP в секунду, пока враг в радиусе 5м", desc_ko = "적이 5m 이내에 있으면 매초 체력 1 감소", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { SoulDrain = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Soul Drain!"); } }); AllEvents.Add(new GameEvent { id = "crippled", name_en = "Crippled", name_ru = "Покалеченный", name_ko = "불구", desc_en = "Your hits have a 30% chance to deal no damage", desc_ru = "Ваши удары с 30% шансом не наносят урона", desc_ko = "공격이 30% 확률로 피해를 주지 못함", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { Crippled = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Crippled!"); } }); AllEvents.Add(new GameEvent { id = "cowards_curse", name_en = "Coward's Curse", name_ru = "Проклятие Труса", name_ko = "겁쟁이의 저주", desc_en = "You deal 25% less damage to full-health enemies", desc_ru = "Вы наносите на 25% меньше урона врагам с полным HP", desc_ko = "체력이 가득한 적에게 주는 피해 25% 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { CowardsCurse = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Coward's Curse!"); } }); AllEvents.Add(new GameEvent { id = "faint_heart", name_en = "Faint Heart", name_ru = "Слабое Сердце", name_ko = "약한 심장", desc_en = "You deal 20% less damage while at full health", desc_ru = "Вы наносите на 20% меньше урона, пока у вас полное HP", desc_ko = "체력이 가득할 때 주는 피해 20% 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { FaintHeart = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Faint Heart!"); } }); AllEvents.Add(new GameEvent { id = "slow_healing", name_en = "Slow Healing", name_ru = "Медленное Заживление", name_ko = "느린 치유", desc_en = "All healing on you is 50% less effective", desc_ru = "Всё лечение вас на 50% слабее", desc_ko = "받는 모든 치유 효과 50% 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "frailty" }, onActivate = delegate { SlowHealing = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Slow Healing!"); } }); AllEvents.Add(new GameEvent { id = "sluggish_recovery", name_en = "Sluggish Recovery", name_ru = "Вялое Восстановление", name_ko = "둔한 회복", desc_en = "You cannot be healed for 3s after taking damage", desc_ru = "Вас нельзя лечить 3с после получения урона", desc_ko = "피해를 받은 후 3초간 치유 불가", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "frailty" }, onActivate = delegate { SluggishRecovery = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Sluggish Recovery!"); } }); AllEvents.Add(new GameEvent { id = "achilles_heel", name_en = "Achilles Heel", name_ru = "Ахиллесова Пята", name_ko = "아킬레스건", desc_en = "The first hit you take each level deals double damage", desc_ru = "Первый удар по вам за уровень наносит двойной урон", desc_ko = "각 레벨의 첫 피격이 두 배의 피해", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { AchillesHeel = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Achilles Heel!"); } }); AllEvents.Add(new GameEvent { id = "stage_fright", name_en = "Stage Fright", name_ru = "Боязнь Толпы", name_ko = "무대 공포증", desc_en = "Deal up to 40% less damage when surrounded by enemies", desc_ru = "До 40% меньше урона, когда вокруг много врагов", desc_ko = "적에게 둘러싸이면 최대 40% 적은 피해", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { StageFright = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Stage Fright!"); } }); AllEvents.Add(new GameEvent { id = "thin_skin", name_en = "Thin Skin", name_ru = "Тонкая Кожа", name_ko = "얇은 피부", desc_en = "You take 30% more damage from everything", desc_ru = "Вы получаете на 30% больше урона от всего", desc_ko = "모든 피해를 30% 더 받음", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ThinSkin = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Thin Skin!"); } }); AllEvents.Add(new GameEvent { id = "reckless_swings", name_en = "Reckless Swings", name_ru = "Безрассудные Замахи", name_ko = "무모한 휘두르기", desc_en = "20% of the damage you deal to enemies is dealt back to you", desc_ru = "20% урона, нанесённого врагам, возвращается вам", desc_ko = "적에게 준 피해의 20%가 자신에게 돌아옴", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "recoil_strikes", "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { RecklessSwings = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Reckless Swings!"); } }); AllEvents.Add(new GameEvent { id = "soft_blows", name_en = "Soft Blows", name_ru = "Мягкие Удары", name_ko = "약한 타격", desc_en = "You deal 25% less damage to enemies above 50% health", desc_ru = "Вы наносите на 25% меньше урона врагам с HP выше 50%", desc_ko = "체력 50% 이상의 적에게 주는 피해 25% 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { SoftBlows = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Soft Blows!"); } }); AllEvents.Add(new GameEvent { id = "fumble", name_en = "Fumble", name_ru = "Осечка", name_ko = "실수", desc_en = "Your hits have a 15% chance to deal no damage", desc_ru = "Ваши удары с 15% шансом не наносят урона", desc_ko = "공격이 15% 확률로 피해를 주지 못함", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { Fumble = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fumble!"); } }); AllEvents.Add(new GameEvent { id = "reckless_power", name_en = "Reckless Power", name_ru = "Безрассудная Сила", name_ko = "무모한 힘", desc_en = "Deal 40% more damage to enemies, but take 40% more damage", desc_ru = "Наносите на 40% больше урона врагам, но получаете на 40% больше", desc_ko = "적에게 40% 더 많은 피해, 그러나 받는 피해도 40% 증가", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { RecklessPower = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Reckless Power!"); } }); AllEvents.Add(new GameEvent { id = "vampiric_pact", name_en = "Vampiric Pact", name_ru = "Кровавый Пакт", name_ko = "흡혈 계약", desc_en = "Enemy kills heal the nearest player 10 HP, but you take 20% more damage", desc_ru = "Убийства лечат ближайшего игрока на 10 HP, но вы получаете на 20% больше урона", desc_ko = "적 처치 시 가장 가까운 플레이어 10 회복, 그러나 받는 피해 20% 증가", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "frailty" }, onActivate = delegate { VampiricPact = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vampiric Pact!"); } }); AllEvents.Add(new GameEvent { id = "adrenaline_cycle", name_en = "Adrenaline Cycle", name_ru = "Адреналиновый Цикл", name_ko = "아드레날린 순환", desc_en = "Deal more damage the lower your health, less the higher", desc_ru = "Чем ниже ваше HP, тем больше урона; чем выше - тем меньше", desc_ko = "체력이 낮을수록 더 큰 피해, 높을수록 적은 피해", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { AdrenalineCycle = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Adrenaline Cycle!"); } }); AllEvents.Add(new GameEvent { id = "gambler", name_en = "Gambler", name_ru = "Азартный", name_ko = "도박꾼", desc_en = "Your hits randomly deal half or double damage", desc_ru = "Ваши удары случайно наносят половину или двойной урон", desc_ko = "공격이 무작위로 절반 또는 두 배의 피해", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { Gambler = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Gambler!"); } }); AllEvents.Add(new GameEvent { id = "coin_flip_defense", name_en = "Coin Flip Defense", name_ru = "Орёл или Решка", name_ko = "동전 던지기 방어", desc_en = "Incoming damage is randomly halved or doubled", desc_ru = "Входящий урон случайно уменьшается вдвое или удваивается", desc_ko = "받는 피해가 무작위로 절반 또는 두 배", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { CoinFlipDefense = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Coin Flip Defense!"); } }); AllEvents.Add(new GameEvent { id = "berserkers_bargain", name_en = "Berserker's Bargain", name_ru = "Сделка Берсерка", name_ko = "광전사의 거래", desc_en = "Below 50% HP: deal 60% more damage but take 30% more", desc_ru = "Ниже 50% HP: +60% урона, но +30% получаемого урона", desc_ko = "체력 50% 미만: 주는 피해 +60%, 받는 피해 +30%", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { BerserkersBargain = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Berserker's Bargain!"); } }); AllEvents.Add(new GameEvent { id = "blood_price", name_en = "Blood Price", name_ru = "Цена Крови", name_ko = "피의 대가", desc_en = "Deal 50% more damage, but each hit costs you 1 HP (won't kill)", desc_ru = "Наносите на 50% больше урона, но каждый удар стоит 1 HP (не убивает)", desc_ko = "주는 피해 50% 증가, 그러나 공격마다 체력 1 소모 (죽지 않음)", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill_players" }, onActivate = delegate { BloodPrice = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Blood Price!"); } }); AllEvents.Add(new GameEvent { id = "equalizer", name_en = "Equalizer", name_ru = "Уравнитель", name_ko = "이퀄라이저", desc_en = "All your hits deal a fixed 8 damage, regardless of weapon", desc_ru = "Все ваши удары наносят фиксированные 8 урона, независимо от оружия", desc_ko = "모든 공격이 무기와 상관없이 고정 8 피해", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { Equalizer = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Equalizer!"); } }); AllEvents.Add(new GameEvent { id = "tug_of_war", name_en = "Tug of War", name_ru = "Перетягивание Каната", name_ko = "줄다리기", desc_en = "Regenerate 1 HP every 2s, but take 5 extra damage per hit", desc_ru = "Восстанавливаете 1 HP раз в 2с, но получаете +5 урона за удар", desc_ko = "2초마다 체력 1 회복, 그러나 피격당 +5 피해", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "frailty" }, onActivate = delegate { TugOfWar = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tug of War!"); } }); AllEvents.Add(new GameEvent { id = "pendulum", name_en = "Pendulum", name_ru = "Маятник", name_ko = "진자", desc_en = "Alternates every 10s: +50% damage dealt, then -50% damage taken", desc_ru = "Чередуется каждые 10с: +50% наносимого урона, затем −50% получаемого", desc_ko = "10초마다 전환: 주는 피해 +50%, 그 다음 받는 피해 −50%", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { Pendulum = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pendulum!"); } }); AllEvents.Add(new GameEvent { id = "juggernaut_enemies", name_en = "Juggernaut Enemies", name_ru = "Враги-Джаггернауты", name_ko = "저거너트 적", desc_en = "Enemies have triple health", desc_ru = "У врагов тройное здоровье", desc_ko = "적의 체력이 3배", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "one_hit_kill", "glass_enemies" }, onActivate = delegate { JuggernautEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Juggernaut Enemies!"); } }); AllEvents.Add(new GameEvent { id = "armored_hides", name_en = "Armored Hides", name_ru = "Бронированные Шкуры", name_ko = "장갑 가죽", desc_en = "Enemies take 50% less damage", desc_ru = "Враги получают на 50% меньше урона", desc_ko = "적이 받는 피해 50% 감소", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "one_hit_kill", "glass_enemies", "double_enemy_damage" }, onActivate = delegate { ArmoredHides = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Armored Hides!"); } }); AllEvents.Add(new GameEvent { id = "brutal_enemies", name_en = "Brutal Enemies", name_ru = "Жестокие Враги", name_ko = "잔혹한 적", desc_en = "Enemies deal 75% more damage to players", desc_ru = "Враги наносят игрокам на 75% больше урона", desc_ko = "적이 플레이어에게 75% 더 많은 피해", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "pacifist_mode" }, onActivate = delegate { BrutalEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Brutal Enemies!"); } }); AllEvents.Add(new GameEvent { id = "thorned_enemies", name_en = "Thorned Enemies", name_ru = "Шипастые Враги", name_ko = "가시 적", desc_en = "Hitting an enemy deals 5 damage back to you (won't kill)", desc_ru = "Удар по врагу бьёт вас на 5 в ответ (не убивает)", desc_ko = "적을 공격하면 5의 반동 피해 (죽지 않음)", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { ThornedEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Thorned Enemies!"); } }); AllEvents.Add(new GameEvent { id = "hardened_cores", name_en = "Hardened Cores", name_ru = "Закалённые Ядра", name_ko = "강화된 핵", desc_en = "Enemies ignore the first 2 hits they take", desc_ru = "Враги игнорируют первые 2 удара", desc_ko = "적이 처음 2번의 공격을 무시함", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { HardenedCores = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Hardened Cores!"); } }); AllEvents.Add(new GameEvent { id = "death_throes", name_en = "Death Throes", name_ru = "Предсмертные Судороги", name_ko = "단말마", desc_en = "Killed enemies deal 10 damage to players within 5m (won't kill)", desc_ru = "Убитые враги бьют игроков в радиусе 5м на 10 (не убивает)", desc_ko = "처치된 적이 5m 내 플레이어에게 10의 피해 (죽지 않음)", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { DeathThroes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Death Throes!"); } }); AllEvents.Add(new GameEvent { id = "plague_bearers", name_en = "Plague Bearers", name_ru = "Чумоносцы", name_ko = "역병 보균자", desc_en = "Enemy hits poison you for 1 HP/s for 4s (won't kill)", desc_ru = "Удары врагов отравляют: 1 HP/с в течение 4с (не убивает)", desc_ko = "적 공격이 4초간 초당 1의 독 피해 (죽지 않음)", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "pacifist_mode", "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { PlagueBearers = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Plague Bearers!"); } }); AllEvents.Add(new GameEvent { id = "pack_tactics", name_en = "Pack Tactics", name_ru = "Стайная Тактика", name_ko = "무리 전술", desc_en = "Enemies deal 15% more damage per nearby enemy (max 60%)", desc_ru = "Враги наносят +15% урона за каждого врага рядом (макс 60%)", desc_ko = "근처 적마다 15% 더 많은 피해 (최대 60%)", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "pacifist_mode" }, onActivate = delegate { PackTactics = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pack Tactics!"); } }); AllEvents.Add(new GameEvent { id = "phase_shield", name_en = "Phase Shield", name_ru = "Фазовый Щит", name_ko = "위상 방패", desc_en = "Enemies become immune for 0.5s after taking damage", desc_ru = "Враги становятся неуязвимы на 0.5с после получения урона", desc_ko = "적이 피해를 받은 후 0.5초간 무적", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { PhaseShield = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Phase Shield!"); } }); AllEvents.Add(new GameEvent { id = "vengeful_horde", name_en = "Vengeful Horde", name_ru = "Мстительная Орда", name_ko = "복수의 무리", desc_en = "Each enemy death heals all living enemies 25% of their max health", desc_ru = "Каждая смерть врага лечит всех живых врагов на 25% их HP", desc_ko = "적이 죽을 때마다 살아있는 모든 적의 체력 25% 회복", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { VengefulHorde = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vengeful Horde!"); } }); AllEvents.Add(new GameEvent { id = "paper_enemies", name_en = "Paper Enemies", name_ru = "Бумажные Враги", name_ko = "종이 적", desc_en = "Enemies take triple damage", desc_ru = "Враги получают тройной урон", desc_ko = "적이 3배의 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { PaperEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Paper Enemies!"); } }); AllEvents.Add(new GameEvent { id = "brittle_bones_enemies", name_en = "Brittle Bones", name_ru = "Хрупкие Кости", name_ko = "부서지는 뼈", desc_en = "Enemies have a quarter of their health", desc_ru = "У врагов четверть здоровья", desc_ko = "적의 체력이 1/4", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "one_hit_kill", "juggernaut_enemies" }, onActivate = delegate { BrittleBonesEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Brittle Bones!"); } }); AllEvents.Add(new GameEvent { id = "feeble_foes", name_en = "Feeble Foes", name_ru = "Немощные Враги", name_ko = "연약한 적", desc_en = "Enemies deal 75% less damage to players", desc_ru = "Враги наносят игрокам на 75% меньше урона", desc_ko = "적이 플레이어에게 75% 적은 피해", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "pacifist_mode", "brutal_enemies" }, onActivate = delegate { FeebleFoes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Feeble Foes!"); } }); AllEvents.Add(new GameEvent { id = "golden_enemies", name_en = "Golden Enemies", name_ru = "Золотые Враги", name_ko = "황금 적", desc_en = "Killed enemies drop a big high-value orb", desc_ru = "Убитые враги роняют большой ценный орб", desc_ko = "처치한 적이 큰 고가치 오브를 떨어뜨림", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { GoldenEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Golden Enemies!"); } }); AllEvents.Add(new GameEvent { id = "self_destruct_enemies", name_en = "Self-Destruct", name_ru = "Самоликвидация", name_ko = "자폭", desc_en = "Enemies slowly lose 1 HP per second on their own", desc_ru = "Враги сами медленно теряют 1 HP в секунду", desc_ko = "적이 스스로 매초 체력 1 감소", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { SelfDestructEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Self-Destruct!"); } }); AllEvents.Add(new GameEvent { id = "exposed_cores", name_en = "Exposed Cores", name_ru = "Открытые Ядра", name_ko = "노출된 핵", desc_en = "Enemies take 25% more damage per hit you've landed (max +100%)", desc_ru = "Враги получают +25% урона за каждый ваш удар по ним (макс +100%)", desc_ko = "적이 명중당 25% 더 많은 피해 (최대 +100%)", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { ExposedCores = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Exposed Cores!"); } }); AllEvents.Add(new GameEvent { id = "bleeding_enemies", name_en = "Bleeding Enemies", name_ru = "Кровоточащие Враги", name_ko = "출혈하는 적", desc_en = "Damaged enemies bleed, losing health over a few seconds", desc_ru = "Раненые враги кровоточат, теряя HP несколько секунд", desc_ko = "피해를 입은 적이 몇 초간 출혈로 체력을 잃음", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { BleedingEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bleeding Enemies!"); } }); AllEvents.Add(new GameEvent { id = "glass_jaw_enemies", name_en = "Glass Jaw Enemies", name_ru = "Стеклянная Челюсть Врагов", name_ko = "유리턱 적", desc_en = "Every 3rd hit on an enemy deals double damage", desc_ru = "Каждый 3-й удар по врагу наносит двойной урон", desc_ko = "적에게 가하는 3번째 공격마다 두 배의 피해", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { GlassJawEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Jaw Enemies!"); } }); AllEvents.Add(new GameEvent { id = "exposed_weakpoint", name_en = "Exposed Weakpoint", name_ru = "Слабое Место", name_ko = "약점 노출", desc_en = "Your first hit on each enemy deals quadruple damage", desc_ru = "Ваш первый удар по каждому врагу наносит четырёхкратный урон", desc_ko = "각 적에게 가하는 첫 공격이 4배의 피해", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { ExposedWeakpoint = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Exposed Weakpoint!"); } }); AllEvents.Add(new GameEvent { id = "lootsplosion", name_en = "Lootsplosion", name_ru = "Лутовзрыв", name_ko = "전리품 폭발", desc_en = "Killed enemies burst into 4 bonus orbs", desc_ru = "Убитые враги взрываются 4 бонусными орбами", desc_ko = "처치한 적이 보너스 오브 4개로 터짐", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { Lootsplosion = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lootsplosion!"); } }); AllEvents.Add(new GameEvent { id = "tough_skin", name_en = "Tough Skin", name_ru = "Жёсткая Шкура", name_ko = "질긴 가죽", desc_en = "Enemies take 25% less damage", desc_ru = "Враги получают на 25% меньше урона", desc_ko = "적이 받는 피해 25% 감소", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { ToughSkin = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tough Skin!"); } }); AllEvents.Add(new GameEvent { id = "bulky_enemies", name_en = "Bulky Enemies", name_ru = "Громилы", name_ko = "덩치 큰 적", desc_en = "Enemies have 50% more health", desc_ru = "У врагов на 50% больше здоровья", desc_ko = "적의 체력 50% 증가", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { BulkyEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bulky Enemies!"); } }); AllEvents.Add(new GameEvent { id = "aggressive_enemies", name_en = "Aggressive Enemies", name_ru = "Агрессивные Враги", name_ko = "공격적인 적", desc_en = "Enemies deal 30% more damage to players", desc_ru = "Враги наносят игрокам на 30% больше урона", desc_ko = "적이 플레이어에게 30% 더 많은 피해", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "pacifist_mode", "feeble_foes" }, onActivate = delegate { AggressiveEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Aggressive Enemies!"); } }); AllEvents.Add(new GameEvent { id = "resilient_cores", name_en = "Resilient Cores", name_ru = "Стойкие Ядра", name_ko = "탄력적인 핵", desc_en = "Enemies take 10 less damage from every hit (min 1)", desc_ru = "Враги получают на 10 меньше урона от каждого удара (мин 1)", desc_ko = "적이 모든 공격에서 10 적은 피해 (최소 1)", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { ResilientCores = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Resilient Cores!"); } }); AllEvents.Add(new GameEvent { id = "quick_recovery", name_en = "Quick Recovery", name_ru = "Быстрое Восстановление", name_ko = "빠른 회복", desc_en = "Enemies heal 10% of max health if not hit for 5s", desc_ru = "Враги лечат 10% макс. HP, если их не били 5с", desc_ko = "적이 5초간 피격되지 않으면 최대 체력 10% 회복", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { QuickRecovery = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Quick Recovery!"); } }); AllEvents.Add(new GameEvent { id = "hardy_enemies", name_en = "Hardy Enemies", name_ru = "Живучие Враги", name_ko = "강인한 적", desc_en = "Enemies ignore the first hit they take", desc_ru = "Враги игнорируют первый удар", desc_ko = "적이 첫 번째 공격을 무시함", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { HardyEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Hardy Enemies!"); } }); AllEvents.Add(new GameEvent { id = "second_skin", name_en = "Second Skin", name_ru = "Второй Слой", name_ko = "두 번째 피부", desc_en = "Your first hit on each enemy deals half damage", desc_ru = "Ваш первый удар по каждому врагу наносит половину урона", desc_ko = "각 적에게 가하는 첫 공격이 절반의 피해", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { SecondSkin = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Second Skin!"); } }); AllEvents.Add(new GameEvent { id = "vengeful_sparks", name_en = "Vengeful Sparks", name_ru = "Мстительные Искры", name_ko = "복수의 불꽃", desc_en = "25% chance hitting an enemy zaps you for 5 (won't kill)", desc_ru = "25% шанс, что удар по врагу бьёт вас на 5 (не убивает)", desc_ko = "적 공격 시 25% 확률로 5의 감전 피해 (죽지 않음)", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "glass_cannon", "one_hit_kill_players" }, onActivate = delegate { VengefulSparks = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vengeful Sparks!"); } }); AllEvents.Add(new GameEvent { id = "pack_instinct", name_en = "Pack Instinct", name_ru = "Стайный Инстинкт", name_ko = "무리 본능", desc_en = "Enemies deal 10% more damage per nearby enemy (max 30%)", desc_ru = "Враги наносят +10% урона за каждого врага рядом (макс 30%)", desc_ko = "근처 적마다 10% 더 많은 피해 (최대 30%)", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "pacifist_mode" }, onActivate = delegate { PackInstinct = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pack Instinct!"); } }); AllEvents.Add(new GameEvent { id = "evasive_enemies", name_en = "Evasive Enemies", name_ru = "Уклончивые Враги", name_ko = "회피하는 적", desc_en = "Enemies have a 20% chance to dodge your hit", desc_ru = "Враги с 20% шансом уклоняются от вашего удара", desc_ko = "적이 20% 확률로 공격을 회피함", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { EvasiveEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Evasive Enemies!"); } }); AllEvents.Add(new GameEvent { id = "berserker_enemies", name_en = "Berserker Enemies", name_ru = "Враги-Берсерки", name_ko = "광전사 적", desc_en = "Enemies deal 40% more damage but take 40% more damage", desc_ru = "Враги наносят на 40% больше урона, но и получают на 40% больше", desc_ko = "적이 40% 더 많은 피해를 주지만 40% 더 많은 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { BerserkerEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Berserker Enemies!"); } }); AllEvents.Add(new GameEvent { id = "glass_cannon_enemies", name_en = "Glass Cannon Enemies", name_ru = "Враги-Стеклопушки", name_ko = "유리 대포 적", desc_en = "Enemies have a quarter health but deal 75% more damage", desc_ru = "У врагов четверть HP, но они наносят на 75% больше урона", desc_ko = "적의 체력 1/4, 그러나 75% 더 많은 피해", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { GlassCannonEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Cannon Enemies!"); } }); AllEvents.Add(new GameEvent { id = "erratic_enemies", name_en = "Erratic Enemies", name_ru = "Хаотичные Враги", name_ko = "변덕스러운 적", desc_en = "Enemies randomly take half or double damage", desc_ru = "Враги случайно получают половину или двойной урон", desc_ko = "적이 무작위로 절반 또는 두 배의 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { ErraticEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Erratic Enemies!"); } }); AllEvents.Add(new GameEvent { id = "gambling_foes", name_en = "Gambling Foes", name_ru = "Азартные Враги", name_ko = "도박꾼 적", desc_en = "Enemies randomly deal half or double damage to players", desc_ru = "Враги случайно наносят половину или двойной урон игрокам", desc_ko = "적이 무작위로 절반 또는 두 배의 피해를 줌", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "pacifist_mode" }, onActivate = delegate { GamblingFoes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Gambling Foes!"); } }); AllEvents.Add(new GameEvent { id = "vampiric_vitality", name_en = "Vampiric Vitality", name_ru = "Вампирская Живучесть", name_ko = "흡혈 활력", desc_en = "Enemies regenerate 10% health every 3s but take 30% more damage", desc_ru = "Враги восстанавливают 10% HP каждые 3с, но получают на 30% больше урона", desc_ko = "적이 3초마다 체력 10% 회복하지만 30% 더 많은 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { VampiricFoes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vampiric Vitality!"); } }); AllEvents.Add(new GameEvent { id = "adaptive_enemies", name_en = "Adaptive Enemies", name_ru = "Адаптивные Враги", name_ko = "적응하는 적", desc_en = "Each kill heals living enemies 15%, but the slain drops a bonus orb", desc_ru = "Каждый килл лечит живых врагов на 15%, но убитый роняет бонусный орб", desc_ko = "처치마다 살아있는 적 15% 회복, 그러나 처치된 적이 보너스 오브를 떨어뜨림", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { AdaptiveEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Adaptive Enemies!"); } }); AllEvents.Add(new GameEvent { id = "volatile_cores", name_en = "Volatile Cores", name_ru = "Нестабильные Ядра", name_ko = "불안정한 핵", desc_en = "Enemies take 50% more damage but explode for 10 on death (won't kill)", desc_ru = "Враги получают на 50% больше урона, но взрываются на 10 при смерти (не убивает)", desc_ko = "적이 50% 더 많은 피해를 받지만 죽을 때 10의 폭발 (죽지 않음)", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill_players" }, onActivate = delegate { VolatileCores = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Volatile Cores!"); } }); AllEvents.Add(new GameEvent { id = "enraged_on_hit", name_en = "Enraged on Hit", name_ru = "Разъярённые при Ударе", name_ko = "피격 시 분노", desc_en = "Enemies take half damage from the first hit, but 50% more after", desc_ru = "Враги получают половину урона от первого удара, но +50% от следующих", desc_ko = "적이 첫 공격은 절반, 이후 50% 더 많은 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { EnragedOnHit = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Enraged on Hit!"); } }); AllEvents.Add(new GameEvent { id = "scavenger_enemies", name_en = "Scavenger Enemies", name_ru = "Враги-Падальщики", name_ko = "청소부 적", desc_en = "Enemies have 50% more health but drop a guaranteed orb", desc_ru = "У врагов на 50% больше HP, но они роняют гарантированный орб", desc_ko = "적의 체력 50% 증가, 그러나 확정 오브를 떨어뜨림", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { ScavengerEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Scavenger Enemies!"); } }); AllEvents.Add(new GameEvent { id = "tough_love", name_en = "Tough Love", name_ru = "Жёсткая Любовь", name_ko = "강한 사랑", desc_en = "Enemies deal double damage, but killing one heals you 15 HP", desc_ru = "Враги наносят двойной урон, но убийство одного лечит вас на 15 HP", desc_ko = "적이 두 배의 피해를 주지만 처치 시 체력 15 회복", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "frailty" }, onActivate = delegate { ToughLove = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tough Love!"); } }); AllEvents.Add(new GameEvent { id = "soft_targets", name_en = "Soft Targets", name_ru = "Мягкие Цели", name_ko = "약한 표적", desc_en = "Enemies take 50% more damage", desc_ru = "Враги получают на 50% больше урона", desc_ko = "적이 50% 더 많은 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { SoftTargets = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Soft Targets!"); } }); AllEvents.Add(new GameEvent { id = "frail_enemies", name_en = "Frail Enemies", name_ru = "Хилые Враги", name_ko = "허약한 적", desc_en = "Enemies have 30% less health", desc_ru = "У врагов на 30% меньше здоровья", desc_ko = "적의 체력 30% 감소", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { FrailEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Frail Enemies!"); } }); AllEvents.Add(new GameEvent { id = "clumsy_enemies", name_en = "Clumsy Enemies", name_ru = "Неуклюжие Враги", name_ko = "서투른 적", desc_en = "Enemies deal 40% less damage to players", desc_ru = "Враги наносят игрокам на 40% меньше урона", desc_ko = "적이 플레이어에게 40% 적은 피해", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "pacifist_mode", "aggressive_enemies", "brutal_enemies" }, onActivate = delegate { ClumsyEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Clumsy Enemies!"); } }); AllEvents.Add(new GameEvent { id = "soft_spot", name_en = "Soft Spot", name_ru = "Слабина", name_ko = "약점", desc_en = "Enemies below 50% health take 30% more damage", desc_ru = "Враги с HP ниже 50% получают на 30% больше урона", desc_ko = "체력 50% 미만의 적이 30% 더 많은 피해를 받음", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { SoftSpot = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Soft Spot!"); } }); AllEvents.Add(new GameEvent { id = "stumbling_enemies", name_en = "Stumbling Enemies", name_ru = "Спотыкающиеся Враги", name_ko = "비틀거리는 적", desc_en = "10% chance a hit knocks an enemy off balance (freezes it 2s)", desc_ru = "10% шанс, что удар сбивает врага с ног (заморозка 2с)", desc_ko = "10% 확률로 공격이 적을 넘어뜨림 (2초 빙결)", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { StumblingEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Stumbling Enemies!"); } }); AllEvents.Add(new GameEvent { id = "generous_kills", name_en = "Generous Kills", name_ru = "Щедрые Убийства", name_ko = "관대한 처치", desc_en = "50% chance a killed enemy drops a bonus orb", desc_ru = "50% шанс, что убитый враг роняет бонусный орб", desc_ko = "50% 확률로 처치된 적이 보너스 오브를 떨어뜨림", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { GenerousKills = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Generous Kills!"); } }); AllEvents.Add(new GameEvent { id = "soul_harvest", name_en = "Soul Harvest", name_ru = "Жатва Душ", name_ko = "영혼 수확", desc_en = "Killing an enemy heals the nearest player 5 HP", desc_ru = "Убийство врага лечит ближайшего игрока на 5 HP", desc_ko = "적 처치 시 가장 가까운 플레이어 5 회복", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "frailty" }, onActivate = delegate { SoulHarvest = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Soul Harvest!"); } }); AllEvents.Add(new GameEvent { id = "brittle_shells", name_en = "Brittle Shells", name_ru = "Хрупкие Панцири", name_ko = "부서지는 껍질", desc_en = "Your first hit on each enemy deals 50% more damage", desc_ru = "Ваш первый удар по каждому врагу наносит на 50% больше урона", desc_ko = "각 적에게 가하는 첫 공격이 50% 더 많은 피해", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "one_hit_kill" }, onActivate = delegate { BrittleShells = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Brittle Shells!"); } }); AllEvents.Add(new GameEvent { id = "bonanza", name_en = "Bonanza", name_ru = "Изобилие", name_ko = "노다지", desc_en = "All valuables are worth 100% more", desc_ru = "Все ценности стоят на 100% больше", desc_ko = "모든 귀중품의 가치 100% 증가", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { Bonanza = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bonanza!"); } }); AllEvents.Add(new GameEvent { id = "lucky_strike", name_en = "Lucky Strike", name_ru = "Счастливый Удар", name_ko = "행운의 일격", desc_en = "20% of valuables are worth triple", desc_ru = "20% ценностей стоят втрое дороже", desc_ko = "귀중품의 20%가 3배의 가치", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LuckyStrike = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lucky Strike!"); } }); AllEvents.Add(new GameEvent { id = "value_floor", name_en = "Value Floor", name_ru = "Гарантия Цены", name_ko = "가치 하한선", desc_en = "Every valuable is worth at least 1500", desc_ru = "Каждая ценность стоит минимум 1500", desc_ko = "모든 귀중품이 최소 1500의 가치", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ValueFloor = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Value Floor!"); } }); AllEvents.Add(new GameEvent { id = "heavyweight_bonus", name_en = "Heavyweight Bonus", name_ru = "Премия за Вес", name_ko = "중량 보너스", desc_en = "Heavy valuables are worth 50% more", desc_ru = "Тяжёлые ценности стоят на 50% больше", desc_ko = "무거운 귀중품의 가치 50% 증가", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { HeavyweightBonus = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Heavyweight Bonus!"); } }); AllEvents.Add(new GameEvent { id = "compound_interest", name_en = "Compound Interest", name_ru = "Сложный Процент", name_ko = "복리", desc_en = "Valuables slowly gain value over time", desc_ru = "Ценности медленно дорожают со временем", desc_ko = "귀중품의 가치가 시간에 따라 천천히 증가", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "value_decay" }, onActivate = delegate { CompoundInterest = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Compound Interest!"); } }); AllEvents.Add(new GameEvent { id = "treasure_sense", name_en = "Treasure Sense", name_ru = "Чутьё Сокровищ", name_ko = "보물 감지", desc_en = "Valuables glow, making them easy to spot", desc_ru = "Ценности светятся - их легко находить", desc_ko = "귀중품이 빛나서 찾기 쉬움", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { TreasureSense = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Treasure Sense!"); } }); AllEvents.Add(new GameEvent { id = "diamond_loot", name_en = "Diamond Loot", name_ru = "Алмазный Лут", name_ko = "다이아몬드 전리품", desc_en = "Valuables are unbreakable and worth 25% more", desc_ru = "Ценности не ломаются и стоят на 25% больше", desc_ko = "귀중품이 파손되지 않고 가치 25% 증가", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "valuables_fragile", "explosive_valuables", "explosive_throw_valuables", "risk_reward" }, onActivate = delegate { DiamondLoot = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Diamond Loot!"); } }); AllEvents.Add(new GameEvent { id = "salvage", name_en = "Salvage", name_ru = "Утилизация", name_ko = "회수", desc_en = "Broken valuables drop a small orb", desc_ru = "Разбитые ценности роняют небольшой орб", desc_ko = "파손된 귀중품이 작은 오브를 떨어뜨림", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "valuables_unbreakable", "diamond_loot" }, onActivate = delegate { Salvage = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Salvage!"); } }); AllEvents.Add(new GameEvent { id = "pristine_valuables", name_en = "Pristine Valuables", name_ru = "Безупречные Ценности", name_ko = "완벽한 귀중품", desc_en = "All valuables are worth 50% more", desc_ru = "Все ценности стоят на 50% больше", desc_ko = "모든 귀중품의 가치 50% 증가", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { PristineValuables = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pristine Valuables!"); } }); AllEvents.Add(new GameEvent { id = "lucky_lottery", name_en = "Lucky Lottery", name_ru = "Лотерея Удачи", name_ko = "행운의 복권", desc_en = "15% of valuables are worth 5x", desc_ru = "15% ценностей стоят в 5 раз дороже", desc_ko = "귀중품의 15%가 5배의 가치", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LuckyLottery = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lucky Lottery!"); } }); AllEvents.Add(new GameEvent { id = "bankruptcy", name_en = "Bankruptcy", name_ru = "Банкротство", name_ko = "파산", desc_en = "All valuables are worth 50% less", desc_ru = "Все ценности стоят на 50% меньше", desc_ko = "모든 귀중품의 가치 50% 감소", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { Bankruptcy = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bankruptcy!"); } }); AllEvents.Add(new GameEvent { id = "pyrite", name_en = "Pyrite", name_ru = "Золото Дураков", name_ko = "황철석", desc_en = "30% of valuables are nearly worthless", desc_ru = "30% ценностей почти ничего не стоят", desc_ko = "귀중품의 30%가 거의 무가치", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { Pyrite = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pyrite!"); } }); AllEvents.Add(new GameEvent { id = "worthless_heavies", name_en = "Worthless Heavies", name_ru = "Бесполезные Тяжести", name_ko = "쓸모없는 중량물", desc_en = "Heavy valuables are worth 50% less", desc_ru = "Тяжёлые ценности стоят на 50% меньше", desc_ko = "무거운 귀중품의 가치 50% 감소", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "heavyweight_bonus" }, onActivate = delegate { WorthlessHeavies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Worthless Heavies!"); } }); AllEvents.Add(new GameEvent { id = "crumbling_treasures", name_en = "Crumbling Treasures", name_ru = "Рассыпающиеся Сокровища", name_ko = "부서지는 보물", desc_en = "Valuables lose value quickly over time", desc_ru = "Ценности быстро теряют стоимость со временем", desc_ko = "귀중품이 시간이 지나며 빠르게 가치를 잃음", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { CrumblingTreasures = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Crumbling Treasures!"); } }); AllEvents.Add(new GameEvent { id = "leaky_value", name_en = "Leaky Value", name_ru = "Утечка Стоимости", name_ko = "가치 누수", desc_en = "Valuables lose value while you carry them", desc_ru = "Ценности теряют стоимость, пока вы их держите", desc_ko = "귀중품을 들고 있으면 가치가 줄어듦", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { LeakyValue = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Leaky Value!"); } }); AllEvents.Add(new GameEvent { id = "spoilage", name_en = "Spoilage", name_ru = "Порча", name_ko = "부패", desc_en = "Valuables in the cart slowly lose value", desc_ru = "Ценности в тележке медленно теряют стоимость", desc_ko = "카트에 있는 귀중품이 서서히 가치를 잃음", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { Spoilage = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Spoilage!"); } }); AllEvents.Add(new GameEvent { id = "glass_hoard", name_en = "Glass Hoard", name_ru = "Стеклянный Клад", name_ko = "유리 보물", desc_en = "Valuables break from the lightest impact", desc_ru = "Ценности ломаются от малейшего удара", desc_ko = "귀중품이 가벼운 충격에도 부서짐", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "valuables_unbreakable", "diamond_loot" }, onActivate = delegate { GlassHoard = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Hoard!"); } }); AllEvents.Add(new GameEvent { id = "volatile_wealth", name_en = "Volatile Wealth", name_ru = "Нестабильное Богатство", name_ko = "불안정한 재산", desc_en = "Valuable prices swing wildly like a stock market - but trend downward", desc_ru = "Цены ценностей скачут как на бирже - но в среднем падают", desc_ko = "귀중품 가격이 주식처럼 요동치지만 평균적으로 하락", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { VolatileWealth = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Volatile Wealth!"); } }); AllEvents.Add(new GameEvent { id = "diminishing_hoard", name_en = "Diminishing Hoard", name_ru = "Убывающий Клад", name_ko = "줄어드는 보물", desc_en = "All valuables are worth 30% less", desc_ru = "Все ценности стоят на 30% меньше", desc_ko = "모든 귀중품의 가치 30% 감소", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { DiminishingHoard = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Diminishing Hoard!"); } }); AllEvents.Add(new GameEvent { id = "fools_abundance", name_en = "Fool's Abundance", name_ru = "Изобилие Дурака", name_ko = "바보의 풍요", desc_en = "40% of valuables are worth a fraction of normal", desc_ru = "40% ценностей стоят лишь малую долю обычного", desc_ko = "귀중품의 40%가 정상가의 일부에 불과", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { FoolsAbundance = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fool's Abundance!"); } }); AllEvents.Add(new GameEvent { id = "windfall", name_en = "Windfall", name_ru = "Везение", name_ko = "횡재", desc_en = "All valuables are worth 20% more", desc_ru = "Все ценности стоят на 20% больше", desc_ko = "모든 귀중품의 가치 20% 증가", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { Windfall = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Windfall!"); } }); AllEvents.Add(new GameEvent { id = "lightweight_premium", name_en = "Lightweight Premium", name_ru = "Премия за Лёгкость", name_ko = "경량 프리미엄", desc_en = "Light valuables are worth 40% more", desc_ru = "Лёгкие ценности стоят на 40% больше", desc_ko = "가벼운 귀중품의 가치 40% 증가", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { LightweightPremium = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lightweight Premium!"); } }); AllEvents.Add(new GameEvent { id = "hidden_gems", name_en = "Hidden Gems", name_ru = "Скрытые Самоцветы", name_ko = "숨겨진 보석", desc_en = "20% of valuables are worth 50% more", desc_ru = "20% ценностей стоят на 50% больше", desc_ko = "귀중품의 20%가 50% 더 비쌈", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { HiddenGems = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Hidden Gems!"); } }); AllEvents.Add(new GameEvent { id = "treasure_trove", name_en = "Treasure Trove", name_ru = "Сокровищница", name_ko = "보물 창고", desc_en = "10% of valuables are worth 2.5x (rare jackpots)", desc_ru = "10% ценностей стоят в 2.5 раза дороже (редкие джекпоты)", desc_ko = "귀중품의 10%가 2.5배의 가치 (희귀 잭팟)", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { TreasureTrove = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Treasure Trove!"); } }); AllEvents.Add(new GameEvent { id = "padded_valuables", name_en = "Padded Valuables", name_ru = "Мягкая Упаковка", name_ko = "완충 포장 귀중품", desc_en = "Valuables lose half as much value when chipped", desc_ru = "Ценности теряют вдвое меньше стоимости при сколах", desc_ko = "귀중품이 손상 시 가치 손실 절반", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "valuables_fragile", "risk_reward", "valuables_unbreakable", "diamond_loot", "glass_hoard" }, onActivate = delegate { PaddedValuables = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Padded Valuables!"); } }); AllEvents.Add(new GameEvent { id = "reinforced_edges", name_en = "Reinforced Edges", name_ru = "Укреплённые Края", name_ko = "강화된 모서리", desc_en = "Valuables never fully shatter - they always keep at least 25% of their value", desc_ru = "Ценности никогда не разбиваются полностью - всегда остаётся минимум 25% стоимости", desc_ko = "귀중품이 완전히 부서지지 않음 - 항상 가치의 25% 이상 유지", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "valuables_unbreakable", "diamond_loot", "glass_hoard" }, onActivate = delegate { ReinforcedEdges = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Reinforced Edges!"); } }); AllEvents.Add(new GameEvent { id = "second_chance", name_en = "Second Chance", name_ru = "Второй Шанс", name_ko = "두 번째 기회", desc_en = "Each valuable survives its first would-be break", desc_ru = "Каждая ценность переживает свою первую поломку", desc_ko = "각 귀중품이 첫 파손을 한 번 버팀", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "valuables_unbreakable", "diamond_loot" }, onActivate = delegate { SecondChance = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Second Chance!"); } }); AllEvents.Add(new GameEvent { id = "golden_cart", name_en = "Golden Cart", name_ru = "Золотая Тележка", name_ko = "황금 카트", desc_en = "Valuables in the cart slowly gain value", desc_ru = "Ценности в тележке медленно дорожают", desc_ko = "카트에 있는 귀중품이 서서히 가치 상승", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "spoilage" }, onActivate = delegate { GoldenCart = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Golden Cart!"); } }); AllEvents.Add(new GameEvent { id = "surge_demand", name_en = "Surge Demand", name_ru = "Ажиотажный Спрос", name_ko = "급증 수요", desc_en = "Valuables gain value while you carry them", desc_ru = "Ценности дорожают, пока вы их несёте", desc_ko = "귀중품을 드는 동안 가치 상승", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "leaky_value" }, onActivate = delegate { SurgeDemand = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Surge Demand!"); } }); AllEvents.Add(new GameEvent { id = "appraisers_glow", name_en = "Appraiser's Glow", name_ru = "Свет Оценщика", name_ko = "감정사의 빛", desc_en = "Valuables glow - the more valuable, the brighter", desc_ru = "Ценности светятся - чем дороже, тем ярче", desc_ko = "귀중품이 빛남 - 비쌀수록 더 밝게", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "treasure_sense" }, onActivate = delegate { AppraisersGlow = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Appraiser's Glow!"); } }); AllEvents.Add(new GameEvent { id = "lightweight_tax", name_en = "Lightweight Tax", name_ru = "Налог на Лёгкость", name_ko = "경량 세금", desc_en = "Light valuables are worth 25% less", desc_ru = "Лёгкие ценности стоят на 25% меньше", desc_ko = "가벼운 귀중품의 가치 25% 감소", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "lightweight_premium" }, onActivate = delegate { LightweightTax = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lightweight Tax!"); } }); AllEvents.Add(new GameEvent { id = "misfortune", name_en = "Misfortune", name_ru = "Невезение", name_ko = "불운", desc_en = "15% of valuables are worth 40% less", desc_ru = "15% ценностей стоят на 40% меньше", desc_ko = "귀중품의 15%가 40% 더 쌈", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { Misfortune = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Misfortune!"); } }); AllEvents.Add(new GameEvent { id = "worn_edges", name_en = "Worn Edges", name_ru = "Потёртые Края", name_ko = "닳은 모서리", desc_en = "All valuables are worth 10% less", desc_ru = "Все ценности стоят на 10% меньше", desc_ko = "모든 귀중품의 가치 10% 감소", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { WornEdges = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Worn Edges!"); } }); AllEvents.Add(new GameEvent { id = "fading_fortune", name_en = "Fading Fortune", name_ru = "Угасающее Богатство", name_ko = "사라지는 재산", desc_en = "All valuables slowly lose value over time", desc_ru = "Все ценности медленно теряют стоимость со временем", desc_ko = "모든 귀중품이 시간이 지나며 서서히 가치를 잃음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { FadingFortune = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fading Fortune!"); } }); AllEvents.Add(new GameEvent { id = "tarnish", name_en = "Tarnish", name_ru = "Потускнение", name_ko = "변색", desc_en = "The pricier a valuable, the more value it loses to tarnish", desc_ru = "Чем дороже ценность, тем больше она теряет из-за потускнения", desc_ko = "비쌀수록 변색으로 더 많은 가치를 잃음", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { Tarnish = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tarnish!"); } }); AllEvents.Add(new GameEvent { id = "bruised_goods", name_en = "Bruised Goods", name_ru = "Помятый Товар", name_ko = "찌그러진 물건", desc_en = "Bumping a valuable chips off a little value, even without breaking it", desc_ru = "Удары по ценности откалывают немного стоимости даже без поломки", desc_ko = "귀중품을 부딪히면 부서지지 않아도 약간의 가치가 깎임", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { BruisedGoods = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bruised Goods!"); } }); AllEvents.Add(new GameEvent { id = "heavy_pockets", name_en = "Heavy Pockets", name_ru = "Тяжёлые Карманы", name_ko = "무거운 주머니", desc_en = "Valuables are noticeably heavier to carry", desc_ru = "Ценности заметно тяжелее носить", desc_ko = "귀중품을 옮기기가 눈에 띄게 무거워짐", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "feather_weight", "heavy_burden" }, onActivate = delegate { HeavyPockets = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Heavy Pockets!"); } }); AllEvents.Add(new GameEvent { id = "handling_fee", name_en = "Handling Fee", name_ru = "Плата за Обработку", name_ko = "취급 수수료", desc_en = "The first time you pick up a valuable, it loses 10% of its value", desc_ru = "При первом поднятии ценность теряет 10% стоимости", desc_ko = "귀중품을 처음 집을 때 가치의 10% 손실", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { HandlingFee = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Handling Fee!"); } }); AllEvents.Add(new GameEvent { id = "brittle_handling", name_en = "Brittle Handling", name_ru = "Хрупкое Обращение", name_ko = "취약한 취급", desc_en = "Valuables lose 50% more value when they break", desc_ru = "Ценности теряют на 50% больше стоимости при поломке", desc_ko = "귀중품이 부서질 때 가치 손실 50% 증가", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "padded_valuables", "valuables_unbreakable", "diamond_loot" }, onActivate = delegate { BrittleHandling = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Brittle Handling!"); } }); AllEvents.Add(new GameEvent { id = "boom_or_bust", name_en = "Boom or Bust", name_ru = "Пан или Пропал", name_ko = "대박 아니면 쪽박", desc_en = "Each valuable is randomly worth 50% more or 50% less", desc_ru = "Каждая ценность случайно стоит на 50% больше или на 50% меньше", desc_ko = "각 귀중품이 무작위로 50% 더 비싸거나 50% 더 쌈", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { BoomOrBust = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Boom or Bust!"); } }); AllEvents.Add(new GameEvent { id = "jackpot_gamble", name_en = "Jackpot Gamble", name_ru = "Джекпот-Авантюра", name_ko = "잭팟 도박", desc_en = "20% of valuables are worth 3x, the rest are worth 25% less", desc_ru = "20% ценностей стоят в 3 раза дороже, остальные - на 25% дешевле", desc_ko = "귀중품의 20%는 3배, 나머지는 25% 더 쌈", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { JackpotGamble = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Jackpot Gamble!"); } }); AllEvents.Add(new GameEvent { id = "counterweight", name_en = "Counterweight", name_ru = "Противовес", name_ko = "균형추", desc_en = "Heavy valuables are worth 40% more, light ones 40% less", desc_ru = "Тяжёлые ценности стоят на 40% больше, лёгкие - на 40% меньше", desc_ko = "무거운 귀중품은 40% 더 비싸고, 가벼운 것은 40% 더 쌈", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { Counterweight = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Counterweight!"); } }); AllEvents.Add(new GameEvent { id = "risk_premium", name_en = "Risk Premium", name_ru = "Премия за Риск", name_ko = "위험 프리미엄", desc_en = "Valuables are worth 50% more, but every bump chips off value", desc_ru = "Ценности стоят на 50% больше, но каждый удар скалывает стоимость", desc_ko = "귀중품 가치 50% 증가하지만, 부딪힐 때마다 가치가 깎임", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { RiskPremium = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Risk Premium!"); } }); AllEvents.Add(new GameEvent { id = "slow_inflation", name_en = "Slow Inflation", name_ru = "Медленная Инфляция", name_ko = "완만한 인플레이션", desc_en = "Valuables start 35% cheaper but slowly gain value over time", desc_ru = "Ценности начинаются на 35% дешевле, но медленно дорожают со временем", desc_ko = "귀중품이 35% 싸게 시작하지만 시간이 지나며 서서히 가치 상승", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { SlowInflation = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Slow Inflation!"); } }); AllEvents.Add(new GameEvent { id = "liquidation_sale", name_en = "Liquidation Sale", name_ru = "Распродажа", name_ko = "청산 세일", desc_en = "Valuables are worth 30% more, but slowly lose value over time", desc_ru = "Ценности стоят на 30% больше, но медленно теряют стоимость со временем", desc_ko = "귀중품 가치 30% 증가하지만 시간이 지나며 서서히 가치 하락", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { LiquidationSale = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Liquidation Sale!"); } }); AllEvents.Add(new GameEvent { id = "heads_or_tails", name_en = "Heads or Tails", name_ru = "Орёл или Решка", name_ko = "동전 던지기", desc_en = "Each valuable is randomly either unbreakable or extra-fragile", desc_ru = "Каждая ценность случайно либо небьющаяся, либо очень хрупкая", desc_ko = "각 귀중품이 무작위로 파괴 불가 또는 매우 취약", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "valuables_unbreakable", "diamond_loot", "glass_hoard" }, onActivate = delegate { HeadsOrTails = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Heads or Tails!"); } }); AllEvents.Add(new GameEvent { id = "weight_swap", name_en = "Weight Swap", name_ru = "Обмен Весом", name_ko = "무게 교환", desc_en = "Heavy valuables become light to carry, and light ones become heavy", desc_ru = "Тяжёлые ценности становятся лёгкими в переноске, а лёгкие - тяжёлыми", desc_ko = "무거운 귀중품은 가벼워지고, 가벼운 것은 무거워짐", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "feather_weight", "heavy_burden", "heavy_pockets" }, onActivate = delegate { WeightSwap = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Weight Swap!"); } }); AllEvents.Add(new GameEvent { id = "lucky_dip", name_en = "Lucky Dip", name_ru = "Лотерея Наугад", name_ko = "행운의 추첨", desc_en = "15% of valuables are worth 4x, 15% are worth almost nothing", desc_ru = "15% ценностей стоят в 4 раза дороже, 15% - почти ничего", desc_ko = "귀중품의 15%는 4배, 15%는 거의 무가치", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { LuckyDip = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lucky Dip!"); } }); AllEvents.Add(new GameEvent { id = "long_reach", name_en = "Long Reach", name_ru = "Длинные Руки", name_ko = "긴 팔", desc_en = "You can grab objects from much farther away and carry heavy ones with ease", desc_ru = "Вы хватаете предметы с гораздо большего расстояния и легко носите тяжёлые", desc_ko = "훨씬 먼 거리에서 물건을 잡고 무거운 것도 쉽게 운반", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LongReach = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Long Reach!"); } }); AllEvents.Add(new GameEvent { id = "big_lungs", name_en = "Big Lungs", name_ru = "Большие Лёгкие", name_ko = "큰 폐활량", desc_en = "Your maximum stamina is doubled", desc_ru = "Максимальная выносливость удвоена", desc_ko = "최대 스태미나가 두 배", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { BigLungs = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Big Lungs!"); } }); AllEvents.Add(new GameEvent { id = "tailwind", name_en = "Tailwind", name_ru = "Попутный Ветер", name_ko = "순풍", desc_en = "Everyone moves 25% faster", desc_ru = "Все двигаются на 25% быстрее", desc_ko = "모두 25% 더 빠르게 이동", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { Tailwind = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tailwind!"); } }); AllEvents.Add(new GameEvent { id = "springy_legs", name_en = "Springy Legs", name_ru = "Пружинистые Ноги", name_ko = "탄력 다리", desc_en = "You jump 40% higher", desc_ru = "Вы прыгаете на 40% выше", desc_ko = "40% 더 높이 점프", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { SpringyLegs = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Springy Legs!"); } }); AllEvents.Add(new GameEvent { id = "ninja_crouch", name_en = "Ninja Crouch", name_ru = "Крадущийся Ниндзя", name_ko = "닌자 웅크리기", desc_en = "You sneak while crouching at nearly full walking speed", desc_ru = "Вы крадётесь в приседе почти на полной скорости ходьбы", desc_ko = "웅크린 채로 거의 걷는 속도로 이동", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { NinjaCrouch = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Ninja Crouch!"); } }); AllEvents.Add(new GameEvent { id = "crystal_air", name_en = "Crystal Air", name_ru = "Кристальный Воздух", name_ko = "맑은 공기", desc_en = "The air is perfectly clear - the facility's fog is cleared away", desc_ru = "Воздух кристально чист - ванильный туман помещения убран", desc_ko = "공기가 매우 맑아 시설의 안개가 걷힘", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "foggy_vision" }, onActivate = delegate { CrystalAir = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Crystal Air!"); } }); AllEvents.Add(new GameEvent { id = "extraction_beacons", name_en = "Extraction Beacons", name_ru = "Маяки Эвакуации", name_ko = "탈출 신호등", desc_en = "Extraction points emit a bright glow, easy to spot from afar", desc_ru = "Точки эвакуации ярко светятся, их видно издалека", desc_ko = "탈출 지점이 밝게 빛나 멀리서도 보임", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ExtractionBeacons = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Extraction Beacons!"); } }); AllEvents.Add(new GameEvent { id = "energized_atmosphere", name_en = "Energized Atmosphere", name_ru = "Бодрящая Атмосфера", name_ko = "활기찬 분위기", desc_en = "The facility's air makes stamina recover much faster", desc_ru = "Воздух помещения ускоряет восстановление выносливости", desc_ko = "시설의 공기가 스태미나 회복을 크게 가속", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "exhausting_air" }, onActivate = delegate { EnergizedAtmosphere = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Energized Atmosphere!"); } }); AllEvents.Add(new GameEvent { id = "lunar_facility", name_en = "Lunar Facility", name_ru = "Лунный Объект", name_ko = "달 시설", desc_en = "The whole facility is weightless - absolutely everything floats in zero gravity", desc_ru = "Всё помещение в невесомости - абсолютно всё парит в нулевой гравитации", desc_ko = "시설 전체가 무중력 - 모든 것이 무중력으로 떠다님", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "room_gravity", "low_gravity", "heavy_gravity" }, onActivate = delegate { LunarFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lunar Facility!"); } }); AllEvents.Add(new GameEvent { id = "sparse_enemies", name_en = "Sparse Facility", name_ru = "Полупустой Объект", name_ko = "한산한 시설", desc_en = "Far fewer enemies roam the facility", desc_ru = "По помещению бродит гораздо меньше врагов", desc_ko = "시설을 돌아다니는 적이 훨씬 적음", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "enemy_horde", "enemy_multiplication" }, onActivate = delegate { SparseEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Sparse Facility!"); } }); AllEvents.Add(new GameEvent { id = "rich_facility", name_en = "Rich Facility", name_ru = "Богатый Объект", name_ko = "풍요로운 시설", desc_en = "Each completed extraction pays a 50% bonus on top of its haul", desc_ru = "Каждая выполненная эвакуация даёт +50% денег сверху", desc_ko = "완료된 탈출마다 50% 보너스 지급", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "empty_facility" }, onActivate = delegate { RichFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Rich Facility!"); } }); AllEvents.Add(new GameEvent { id = "quiet_facility", name_en = "Quiet Facility", name_ru = "Бодрая Тишина", name_ko = "조용한 시설", desc_en = "Enemies are slower to notice noise and investigate a smaller area", desc_ru = "Враги медленнее реагируют на шум и обыскивают меньшую зону", desc_ko = "적이 소음을 늦게 알아차리고 더 좁은 구역만 수색", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { QuietFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Quiet Facility!"); } }); AllEvents.Add(new GameEvent { id = "light_quota", name_en = "Light Quota", name_ru = "Лёгкая Квота", name_ko = "가벼운 할당량", desc_en = "Extraction points require 35% less value to complete", desc_ru = "Точкам эвакуации нужно на 35% меньше денег для выполнения", desc_ko = "탈출 지점 완료에 필요한 가치 35% 감소", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { LightQuota = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Light Quota!"); } }); AllEvents.Add(new GameEvent { id = "scattered_riches", name_en = "Scattered Riches", name_ru = "Рассыпанные Богатства", name_ko = "흩어진 부", desc_en = "Bonus value orbs of various sizes are scattered around the facility", desc_ru = "По объекту разбросаны бонусные орбы разного размера", desc_ko = "다양한 크기의 보너스 가치 오브가 시설에 흩어져 있음", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { ScatteredRiches = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Scattered Riches!"); } }); AllEvents.Add(new GameEvent { id = "fleeting_enemies", name_en = "Fleeting Enemies", name_ru = "Мимолётные Враги", name_ko = "덧없는 적", desc_en = "Defeated enemies take far longer to return - the facility stays clearer", desc_ru = "Побеждённые враги гораздо дольше не возвращаются - на уровне их меньше", desc_ko = "처치된 적이 훨씬 더 오래 돌아오지 않아 시설이 한산해짐", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { FleetingEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fleeting Enemies!"); } }); AllEvents.Add(new GameEvent { id = "generous_extraction", name_en = "Generous Extraction", name_ru = "Щедрая Эвакуация", name_ko = "넉넉한 탈출", desc_en = "Extraction points give you much more time", desc_ru = "Точки эвакуации дают намного больше времени", desc_ko = "탈출 지점이 훨씬 더 많은 시간을 줌", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List { "extraction_rush" }, onActivate = delegate { GenerousExtraction = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Generous Extraction!"); } }); AllEvents.Add(new GameEvent { id = "heavy_quota", name_en = "Heavy Quota", name_ru = "Тяжёлая Квота", name_ko = "무거운 할당량", desc_en = "Extraction points require 35% more value to complete", desc_ru = "Точкам эвакуации нужно на 35% больше денег для выполнения", desc_ko = "탈출 지점 완료에 필요한 가치 35% 증가", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "light_quota" }, onActivate = delegate { HeavyQuota = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Heavy Quota!"); } }); AllEvents.Add(new GameEvent { id = "poor_facility", name_en = "Poor Facility", name_ru = "Бедный Объект", name_ko = "가난한 시설", desc_en = "Each completed extraction pays 30% less", desc_ru = "Каждая выполненная эвакуация платит на 30% меньше", desc_ko = "완료된 탈출마다 30% 적게 지급", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "rich_facility" }, onActivate = delegate { PoorFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Poor Facility!"); } }); AllEvents.Add(new GameEvent { id = "echoing_halls", name_en = "Echoing Halls", name_ru = "Гулкие Залы", name_ko = "메아리치는 복도", desc_en = "Enemies hear noise from much farther away", desc_ru = "Враги слышат шум с гораздо большего расстояния", desc_ko = "적이 훨씬 먼 거리에서 소음을 들음", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "quiet_facility" }, onActivate = delegate { EchoingHalls = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Echoing Halls!"); } }); AllEvents.Add(new GameEvent { id = "relentless_enemies", name_en = "Relentless Enemies", name_ru = "Неустанные Враги", name_ko = "끈질긴 적", desc_en = "Defeated enemies return much faster", desc_ru = "Побеждённые враги возвращаются гораздо быстрее", desc_ko = "처치된 적이 훨씬 빨리 돌아옴", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "fleeting_enemies" }, onActivate = delegate { RelentlessEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Relentless Enemies!"); } }); AllEvents.Add(new GameEvent { id = "flickering_power", name_en = "Flickering Power", name_ru = "Мигающее Питание", name_ko = "깜빡이는 전력", desc_en = "The lights cut out to darkness at random", desc_ru = "Свет случайно гаснет до темноты", desc_ko = "조명이 무작위로 꺼져 어두워짐", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "total_darkness" }, onActivate = delegate { FlickeringPower = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Flickering Power!"); } }); AllEvents.Add(new GameEvent { id = "looted_facility", name_en = "Looted Facility", name_ru = "Разграбленный Объект", name_ko = "약탈당한 시설", desc_en = "Several valuables have already been looted and are gone", desc_ru = "Несколько ценностей уже разграблены и исчезли", desc_ko = "여러 귀중품이 이미 약탈되어 사라짐", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { LootedFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Looted Facility!"); } }); AllEvents.Add(new GameEvent { id = "exhausting_air", name_en = "Exhausting Air", name_ru = "Удушливый Воздух", name_ko = "숨막히는 공기", desc_en = "Stamina drains faster and recovers slower", desc_ru = "Выносливость тратится быстрее и восстанавливается медленнее", desc_ko = "스태미나가 빨리 소모되고 느리게 회복됨", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { ExhaustingAir = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Exhausting Air!"); } }); AllEvents.Add(new GameEvent { id = "power_surge", name_en = "Windy Facility", name_ru = "Сквозняки", name_ko = "바람 부는 시설", desc_en = "Powerful drafts shove you around at random", desc_ru = "Мощные потоки воздуха случайно толкают вас в стороны", desc_ko = "강한 바람이 무작위로 당신을 밀어냄", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { PowerSurge = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Windy Facility!"); } }); AllEvents.Add(new GameEvent { id = "hazardous_sparks", name_en = "Hazardous Sparks", name_ru = "Опасные Искры", name_ko = "위험한 불꽃", desc_en = "Faulty wiring zaps a random player from time to time", desc_ru = "Неисправная проводка время от времени бьёт случайного игрока током", desc_ko = "고장난 배선이 가끔 무작위 플레이어에게 전기 충격", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { HazardousSparks = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Hazardous Sparks!"); } }); AllEvents.Add(new GameEvent { id = "phantom_quota", name_en = "Phantom Quota", name_ru = "Призрачная Квота", name_ko = "유령 할당량", desc_en = "The required quota slowly rises the longer you take", desc_ru = "Требуемая квота медленно растёт, чем дольше вы тянете", desc_ko = "지체할수록 필요한 할당량이 서서히 증가", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "light_quota" }, onActivate = delegate { PhantomQuota = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Phantom Quota!"); } }); AllEvents.Add(new GameEvent { id = "dim_facility", name_en = "Dim Facility", name_ru = "Тусклый Объект", name_ko = "어두컴컴한 시설", desc_en = "The lights are dimmed - everything is gloomy", desc_ru = "Свет приглушён - всюду полумрак", desc_ko = "조명이 어두워져 사방이 침침함", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "total_darkness", "flickering_power", "night_vision" }, onActivate = delegate { DimFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Dim Facility!"); } }); AllEvents.Add(new GameEvent { id = "stiff_doors", name_en = "Stiff Hinges", name_ru = "Тугие Петли", name_ko = "뻑뻑한 경첩", desc_en = "Everything on a hinge - doors, drawers, lids - is heavy and stiff to move", desc_ru = "Всё на петлях - двери, тумбочки, крышки - тугое и тяжёлое", desc_ko = "문, 서랍, 뚜껑 등 경첩 달린 모든 것이 무겁고 뻑뻑함", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { StiffDoors = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Stiff Doors!"); } }); AllEvents.Add(new GameEvent { id = "aged_tubes", name_en = "Aged Tubes", name_ru = "Старые Тубы", name_ko = "낡은 튜브", desc_en = "Extraction tubes are sluggish and take longer to process", desc_ru = "Тубы эвакуации работают медленнее, дольше обрабатывают сдачу", desc_ko = "탈출 튜브가 느려 처리에 더 오래 걸림", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "generous_extraction" }, onActivate = delegate { AgedTubes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Aged Tubes!"); } }); AllEvents.Add(new GameEvent { id = "frost_creep", name_en = "Frost Creep", name_ru = "Изморозь", name_ko = "성에", desc_en = "Frost creeps over your view from time to time, narrowing it", desc_ru = "Иней периодически наползает по краям обзора, сужая его", desc_ko = "이따금 성에가 시야를 좁힘", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { FrostCreep = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Frost Creep!"); } }); AllEvents.Add(new GameEvent { id = "creaky_floors", name_en = "Creaky Floors", name_ru = "Скрипучие Полы", name_ko = "삐걱대는 바닥", desc_en = "The floors creak - enemies notice your noise from a bit farther", desc_ru = "Полы скрипят - враги замечают ваш шум чуть дальше", desc_ko = "바닥이 삐걱거려 적이 소음을 조금 더 멀리서 감지", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "quiet_facility" }, onActivate = delegate { CreakyFloors = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Creaky Floors!"); } }); AllEvents.Add(new GameEvent { id = "modest_quota", name_en = "Modest Quota", name_ru = "Скромная Квота", name_ko = "적당한 할당량", desc_en = "Extraction points require 15% more value", desc_ru = "Эвакуации требуют на 15% больше стоимости", desc_ko = "탈출 지점이 15% 더 많은 가치를 요구", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "light_quota" }, onActivate = delegate { ModestQuota = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Modest Quota!"); } }); AllEvents.Add(new GameEvent { id = "tight_budget", name_en = "Tight Budget", name_ru = "Урезанный Бюджет", name_ko = "빠듯한 예산", desc_en = "Each completed extraction pays 15% less", desc_ru = "Каждая эвакуация платит на 15% меньше", desc_ko = "완료한 탈출마다 15% 적게 지급", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "rich_facility" }, onActivate = delegate { TightBudget = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tight Budget!"); } }); AllEvents.Add(new GameEvent { id = "stuffy_air", name_en = "Stuffy Air", name_ru = "Душноватый Воздух", name_ko = "탁한 공기", desc_en = "The stale air makes stamina recover slower", desc_ru = "Спёртый воздух замедляет восстановление выносливости", desc_ko = "탁한 공기로 스태미나 회복이 느려짐", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "energized_atmosphere", "infinite_stamina", "exhausting_air" }, onActivate = delegate { StuffyAir = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Stuffy Air!"); } }); AllEvents.Add(new GameEvent { id = "cramped_facility", name_en = "Cramped Facility", name_ru = "Тесные Коридоры", name_ko = "비좁은 시설", desc_en = "The facility is a larger maze - more rooms to cover", desc_ru = "Объект - больший лабиринт, идти приходится дольше", desc_ko = "시설이 더 큰 미로 - 돌아야 할 방이 더 많음", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { CrampedFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Cramped Facility!"); } }); AllEvents.Add(new GameEvent { id = "cold_facility", name_en = "Cold Facility", name_ru = "Холодный Объект", name_ko = "추운 시설", desc_en = "Cold gusts briefly slow your movement now and then", desc_ru = "Порывы холода время от времени ненадолго замедляют движение", desc_ko = "찬 바람이 가끔 잠시 이동을 늦춤", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { ColdFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Cold Facility!"); } }); AllEvents.Add(new GameEvent { id = "colored_lights", name_en = "Colored Lighting", name_ru = "Цветное Освещение", name_ko = "색조 조명", desc_en = "The facility is bathed in a single colored hue", desc_ru = "Объект залит светом одного случайного цвета", desc_ko = "시설이 한 가지 색조로 물듦", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "disco_lights" }, onActivate = delegate { ColoredLights = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Colored Lighting!"); } }); AllEvents.Add(new GameEvent { id = "pulsing_lights", name_en = "Pulsing Lights", name_ru = "Пульсирующий Свет", name_ko = "맥동하는 조명", desc_en = "The lights slowly breathe brighter and dimmer", desc_ru = "Свет медленно «дышит» - то ярче, то тусклее", desc_ko = "조명이 천천히 밝아졌다 어두워졌다 함", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "total_darkness", "flickering_power", "dim_facility" }, onActivate = delegate { PulsingLights = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Pulsing Lights!"); } }); AllEvents.Add(new GameEvent { id = "floating_dust", name_en = "Floating Dust", name_ru = "Парящая Пыль", name_ko = "떠다니는 먼지", desc_en = "Dust motes drift through the air", desc_ru = "В воздухе висят и парят пылинки", desc_ko = "공기 중에 먼지가 떠다님", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { FloatingDust = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Floating Dust!"); } }); AllEvents.Add(new GameEvent { id = "reverb_hall", name_en = "Reverb Hall", name_ru = "Эхо-Зал", name_ko = "메아리 홀", desc_en = "Sounds echo with a heavy reverb", desc_ru = "Звуки отдаются сильным эхом и реверберацией", desc_ko = "소리가 강한 잔향과 함께 울림", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { ReverbHall = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Reverb Hall!"); } }); AllEvents.Add(new GameEvent { id = "spacious_facility", name_en = "Spacious Facility", name_ru = "Просторный Объект", name_ko = "널찍한 시설", desc_en = "The facility has fewer rooms - smaller and quicker to cover", desc_ru = "В объекте меньше комнат - он меньше и обходится быстрее", desc_ko = "시설에 방이 적어 더 작고 빠르게 돌 수 있음", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "cramped_facility" }, onActivate = delegate { SpaciousFacility = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Spacious Facility!"); } }); AllEvents.Add(new GameEvent { id = "low_stakes", name_en = "Low Stakes", name_ru = "Низкие Ставки", name_ko = "낮은 판돈", desc_en = "Quota is 20% lower, but every extraction pays 20% less", desc_ru = "Квота на 20% ниже, но и каждая эвакуация платит на 20% меньше", desc_ko = "할당량 20% 감소, 대신 탈출 보상도 20% 감소", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "high_stakes" }, onActivate = delegate { LowStakes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Low Stakes!"); } }); AllEvents.Add(new GameEvent { id = "shuffled_loot", name_en = "Shuffled Loot", name_ru = "Перемешанные Ценности", name_ko = "뒤섞인 전리품", desc_en = "Valuables turn up in unusual spots - small ones even in large display spots", desc_ru = "Ценности оказываются в непривычных местах - мелочь даже в больших местах", desc_ko = "귀중품이 평소와 다른 곳에 나타남 - 작은 것이 큰 자리에도", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { ShuffledLoot = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Shuffled Loot!"); } }); AllEvents.Add(new GameEvent { id = "weak_swarm", name_en = "Weak Swarm", name_ru = "Орда Слабаков", name_ko = "약골 무리", desc_en = "More enemies roam, but each one is frailer", desc_ru = "Врагов больше, но каждый из них слабее", desc_ko = "적이 더 많지만 각자는 더 약함", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "elite_guard" }, onActivate = delegate { WeakSwarm = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Weak Swarm!"); } }); AllEvents.Add(new GameEvent { id = "elite_guard", name_en = "Elite Guard", name_ru = "Элитная Стража", name_ko = "정예 경비", desc_en = "Fewer enemies roam, but each one is tougher", desc_ru = "Врагов меньше, но каждый из них крепче", desc_ko = "적이 더 적지만 각자는 더 강함", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "weak_swarm" }, onActivate = delegate { EliteGuard = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Elite Guard!"); } }); AllEvents.Add(new GameEvent { id = "high_stakes", name_en = "High Stakes", name_ru = "Высокие Ставки", name_ko = "높은 판돈", desc_en = "Quota is 20% higher, but every extraction pays 20% more", desc_ru = "Квота на 20% выше, но и каждая эвакуация платит на 20% больше", desc_ko = "할당량 20% 증가, 대신 탈출 보상도 20% 증가", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "low_stakes" }, onActivate = delegate { HighStakes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ High Stakes!"); } }); AllEvents.Add(new GameEvent { id = "sluggish_enemies", name_en = "Sluggish Enemies", name_ru = "Вялые Враги", name_ko = "굼뜬 적", desc_en = "The facility's air makes enemies move slower", desc_ru = "Из-за атмосферы объекта враги двигаются медленнее", desc_ko = "시설의 공기로 적의 움직임이 느려짐", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "speed_demons" }, onActivate = delegate { SluggishEnemies = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Sluggish Enemies!"); } }); AllEvents.Add(new GameEvent { id = "reduced_quota", name_en = "Reduced Quota", name_ru = "Сниженная Квота", name_ko = "줄어든 할당량", desc_en = "Extraction points require 15% less value", desc_ru = "Эвакуации требуют на 15% меньше стоимости", desc_ko = "탈출 지점이 15% 적은 가치를 요구", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "heavy_quota", "modest_quota", "high_stakes" }, onActivate = delegate { ReducedQuota = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Reduced Quota!"); } }); AllEvents.Add(new GameEvent { id = "fair_bonus", name_en = "Fair Bonus", name_ru = "Честная Надбавка", name_ko = "공정한 보너스", desc_en = "Each completed extraction pays 15% more", desc_ru = "Каждая эвакуация платит на 15% больше", desc_ko = "완료한 탈출마다 15% 더 지급", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "poor_facility", "tight_budget", "low_stakes" }, onActivate = delegate { FairBonus = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fair Bonus!"); } }); AllEvents.Add(new GameEvent { id = "fresh_air", name_en = "Fresh Air", name_ru = "Свежий Воздух", name_ko = "신선한 공기", desc_en = "The clean air makes stamina recover a bit faster", desc_ru = "Чистый воздух немного ускоряет восстановление выносливости", desc_ko = "맑은 공기로 스태미나 회복이 조금 빨라짐", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "stuffy_air", "exhausting_air" }, onActivate = delegate { FreshAir = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Fresh Air!"); } }); AllEvents.Add(new GameEvent { id = "muffled_halls", name_en = "Muffled Halls", name_ru = "Приглушённые Залы", name_ko = "방음 복도", desc_en = "The halls muffle sound - enemies notice your noise a bit less", desc_ru = "Залы глушат звук - враги чуть хуже замечают ваш шум", desc_ko = "복도가 소리를 흡수해 적이 소음을 덜 감지", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "echoing_halls", "creaky_floors" }, onActivate = delegate { MuffledHalls = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Muffled Halls!"); } }); AllEvents.Add(new GameEvent { id = "thinned_patrols", name_en = "Thinned Patrols", name_ru = "Поредевшие Патрули", name_ko = "줄어든 순찰", desc_en = "Slightly fewer enemies roam the facility", desc_ru = "По объекту бродит немного меньше врагов", desc_ko = "시설을 도는 적이 약간 적음", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "enemy_horde", "weak_swarm" }, onActivate = delegate { ThinnedPatrols = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Thinned Patrols!"); } }); AllEvents.Add(new GameEvent { id = "roomy_extractions", name_en = "Roomy Extractions", name_ru = "Просторные Эвакуации", name_ko = "여유로운 탈출", desc_en = "Extraction points give you a bit more time", desc_ru = "Точки эвакуации дают немного больше времени", desc_ko = "탈출 지점이 시간을 조금 더 줌", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "extraction_rush" }, onActivate = delegate { RoomyExtractions = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Roomy Extractions!"); } }); AllEvents.Add(new GameEvent { id = "lucky_scraps", name_en = "Lucky Scraps", name_ru = "Везучие Находки", name_ko = "행운의 조각", desc_en = "A few small bonus value orbs are scattered around", desc_ru = "По объекту разбросано несколько мелких бонус-орбов", desc_ko = "작은 보너스 가치 구슬이 몇 개 흩어져 있음", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { LuckyScraps = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lucky Scraps!"); } }); AllEvents.Add(new GameEvent { id = "swift_tubes", name_en = "Swift Tubes", name_ru = "Быстрые Тубы", name_ko = "빠른 튜브", desc_en = "Extraction tubes process much faster", desc_ru = "Тубы эвакуации обрабатывают сдачу гораздо быстрее", desc_ko = "탈출 튜브가 훨씬 빠르게 처리", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "aged_tubes" }, onActivate = delegate { SwiftTubes = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Swift Tubes!"); } }); AllEvents.Add(new GameEvent { id = "magnetic_carts", name_en = "Magnetic Carts", name_ru = "Магнитные Тележки", name_ko = "자석 카트", desc_en = "Carts pull in nearby valuables - easier hauling", desc_ru = "Тележки притягивают ближние ценности - легче собирать", desc_ko = "카트가 근처 귀중품을 끌어당겨 운반이 쉬워짐", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List { "runaway_valuables" }, onActivate = delegate { MagneticCarts = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Magnetic Carts!"); } }); AllEvents.Add(new GameEvent { id = "deaf_to_monsters", name_en = "Deaf to Monsters", name_ru = "Глухота к Монстрам", name_ko = "괴물 소리 안 들림", desc_en = "You can't hear monsters or their aggro warnings", desc_ru = "Вы не слышите монстров и их сигналы агрессии", desc_ko = "괴물 소리와 경고음이 들리지 않음", category = EventCategory.EnemyModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { DeafToMonsters = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Deaf to Monsters!"); } }); AllEvents.Add(new GameEvent { id = "adrenaline_hunters", name_en = "Adrenaline Hunters", name_ru = "Адреналиновые Охотники", name_ko = "아드레날린 사냥꾼", desc_en = "When enemies spot you they get a speed boost (bigger for weaker tiers)", desc_ru = "Заметив вас, враги ускоряются (слабые тиры - сильнее)", desc_ko = "적이 발견하면 속도 증가 (약한 등급일수록 더 큼)", category = EventCategory.EnemyModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { AdrenalineHunters = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Adrenaline Hunters!"); } }); AllEvents.Add(new GameEvent { id = "tanky_gentle", name_en = "Tanky but Gentle", name_ru = "Толстые но Мягкие", name_ko = "튼튼하지만 약한", desc_en = "Enemies deal half damage but have double health", desc_ru = "Враги наносят вдвое меньше урона, но имеют вдвое больше HP", desc_ko = "적의 피해는 절반, 체력은 두 배", category = EventCategory.EnemyModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List { "double_enemy_health" }, onActivate = delegate { TankyButGentle = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tanky but Gentle!"); } }); AllEvents.Add(new GameEvent { id = "tier_mercy", name_en = "Tier Mercy", name_ru = "Милость по Тиру", name_ko = "등급 자비", desc_en = "Enemies deal less damage based on their tier (tier 3: 3x less, tier 2: 2x less)", desc_ru = "Враги бьют слабее по их тиру (тир 3: в 3 раза меньше, тир 2: в 2 раза)", desc_ko = "적이 등급에 따라 피해 감소 (3등급 1/3, 2등급 1/2)", category = EventCategory.EnemyModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { TierMercy = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Tier Mercy!"); } }); AllEvents.Add(new GameEvent { id = "suicidal_attackers", name_en = "Suicidal Attackers", name_ru = "Враги-Смертники", name_ko = "자살 공격수", desc_en = "If an enemy attacks you, it is instantly despawned (and the hit is negated)", desc_ru = "Если враг атакует вас, он мгновенно исчезает (а удар отменяется)", desc_ko = "적이 공격하면 즉시 사라짐 (피해도 무효)", category = EventCategory.EnemyModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { SuicidalAttackers = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Suicidal Attackers!"); } }); AllEvents.Add(new GameEvent { id = "blinking_haze", name_en = "Blinking Haze", name_ru = "Моргающая Дымка", name_ko = "깜빡이는 안개", desc_en = "The facility's haze blacks out your vision for a moment every few seconds", desc_ru = "Дымка объекта на миг гасит ваше зрение каждые несколько секунд", desc_ko = "시설의 안개가 몇 초마다 잠깐 시야를 가림", category = EventCategory.EnvironmentModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List(), onActivate = delegate { BlinkingHaze = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Blinking Haze!"); } }); AllEvents.Add(new GameEvent { id = "many_extractions", name_en = "Sprawling Facility", name_ru = "Раскинувшийся Объект", name_ko = "광활한 시설", desc_en = "The facility has far more extraction points to deal with", desc_ru = "На объекте намного больше точек эвакуации", desc_ko = "시설에 탈출 지점이 훨씬 많음", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List { "single_extraction" }, onActivate = delegate { ManyExtractions = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Sprawling Facility!"); } }); AllEvents.Add(new GameEvent { id = "lone_wolf", name_en = "Lone Wolf", name_ru = "Одинокий Волк", name_ko = "외로운 늑대", desc_en = "Alone in a room you move 25% faster - sharing a room, 25% slower", desc_ru = "Один в комнате - двигаетесь на 25% быстрее, вместе - на 25% медленнее", desc_ko = "방에 혼자면 25% 빠르게, 함께면 25% 느리게", category = EventCategory.EnvironmentModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { LoneWolf = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Lone Wolf!"); } }); AllEvents.Add(new GameEvent { id = "restorative_rooms", name_en = "Restorative Rooms", name_ru = "Целебные Комнаты", name_ko = "회복의 방", desc_en = "Each new room you discover heals you 5 HP", desc_ru = "Каждая новая открытая комната лечит вас на 5 HP", desc_ko = "새로 발견하는 방마다 체력 5 회복", category = EventCategory.EnvironmentModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { RestorativeRooms = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Restorative Rooms!"); } }); AllEvents.Add(new GameEvent { id = "hostile_rooms", name_en = "Hostile Rooms", name_ru = "Враждебные Комнаты", name_ko = "적대적인 방", desc_en = "Enemies sharing a room with you take 10 damage per second (doesn't affect the Duck and Elsa)", desc_ru = "Враги в одной комнате с вами получают 10 урона в секунду (не действует на Утку и Элсу)", desc_ko = "같은 방의 적이 초당 10 피해를 받음 (오리와 엘사에게는 효과 없음)", category = EventCategory.EnvironmentModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { HostileRooms = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Hostile Rooms!"); } }); AllEvents.Add(new GameEvent { id = "map_disabled", name_en = "No Map", name_ru = "Без Карты", name_ko = "지도 없음", desc_en = "Your map is disabled - navigate the facility blind", desc_ru = "Ваша карта отключена - ориентируйтесь вслепую", desc_ko = "지도가 비활성화됨 - 시설을 맨몸으로 탐색", category = EventCategory.PlayerModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { MapDisabled = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ No Map!"); } }); AllEvents.Add(new GameEvent { id = "half_stamina", name_en = "Drained", name_ru = "Истощение", name_ko = "탈진", desc_en = "Your maximum stamina is cut in half", desc_ru = "Ваша максимальная выносливость урезана вдвое", desc_ko = "최대 스태미나가 절반으로 감소", category = EventCategory.PlayerModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "big_lungs" }, onActivate = delegate { HalfStamina = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Drained!"); } }); AllEvents.Add(new GameEvent { id = "glass_runner", name_en = "Glass Runner", name_ru = "Стеклянный Бегун", name_ko = "유리 질주자", desc_en = "-50 max health, but you move and jump 25% better", desc_ru = "-50 к макс. здоровью, но вы двигаетесь и прыгаете на 25% лучше", desc_ko = "최대 체력 -50, 그러나 이동·점프 25% 향상", category = EventCategory.PlayerModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { GlassRunner = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Glass Runner!"); } }); AllEvents.Add(new GameEvent { id = "kill_recharge", name_en = "Killing Spree", name_ru = "Серия Убийств", name_ko = "연속 처치", desc_en = "Killing an enemy recharges your held weapon's battery", desc_ru = "Убийство врага заряжает батарею оружия в ваших руках", desc_ko = "적을 처치하면 들고 있는 무기의 배터리가 충전됨", category = EventCategory.PlayerModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { KillRecharge = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Killing Spree!"); } }); AllEvents.Add(new GameEvent { id = "tripled_upgrades", name_en = "Empowered", name_ru = "Усиленный", name_ko = "강화됨", desc_en = "All the upgrades you own are tripled (except sprint speed)", desc_ru = "Все ваши апгрейды утроены (кроме скорости спринта)", desc_ko = "보유한 모든 업그레이드가 3배 (질주 속도 제외)", category = EventCategory.PlayerModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { TripledUpgrades = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Empowered!"); } }); AllEvents.Add(new GameEvent { id = "spoiling_touch", name_en = "Spoiling Touch", name_ru = "Портящее Касание", name_ko = "썩는 손길", desc_en = "Holding a valuable too long makes it lose 10% of its max value", desc_ru = "Долго держать ценность - она теряет 10% макс. стоимости", desc_ko = "귀중품을 너무 오래 들면 최대 가치의 10% 손실", category = EventCategory.LootModifier, eventType = EventType.VeryBad, color = GetEventColor(EventType.VeryBad), conflictsWith = new List(), onActivate = delegate { ValueDrainHeld = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Spoiling Touch!"); } }); AllEvents.Add(new GameEvent { id = "bulky_cargo", name_en = "Bulky Cargo", name_ru = "Громоздкий Груз", name_ko = "부피 큰 화물", desc_en = "Small valuables grow bigger once in the cart, taking up more room", desc_ru = "Мелкие ценности в тележке становятся больше, занимая больше места", desc_ko = "작은 귀중품이 카트에서 커져 공간을 더 차지", category = EventCategory.LootModifier, eventType = EventType.Bad, color = GetEventColor(EventType.Bad), conflictsWith = new List { "compact_storage" }, onActivate = delegate { BulkyCargo = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Bulky Cargo!"); } }); AllEvents.Add(new GameEvent { id = "off_grid", name_en = "Off the Grid", name_ru = "Вне Радара", name_ko = "지도 밖", desc_en = "Valuables are worth 10% more, but never appear on your map", desc_ru = "Ценности стоят на 10% больше, но не отображаются на карте", desc_ko = "귀중품 가치 10% 증가, 그러나 지도에 표시되지 않음", category = EventCategory.LootModifier, eventType = EventType.Neutral, color = GetEventColor(EventType.Neutral), conflictsWith = new List(), onActivate = delegate { OffGrid = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Off the Grid!"); } }); AllEvents.Add(new GameEvent { id = "vital_haul", name_en = "Vital Haul", name_ru = "Живительная Добыча", name_ko = "생명의 수확", desc_en = "Picking up a valuable for the first time heals you (1-7 HP by its size)", desc_ru = "Первый подъём ценности лечит вас (1-7 HP по размеру)", desc_ko = "귀중품을 처음 집으면 회복 (크기에 따라 1-7 HP)", category = EventCategory.LootModifier, eventType = EventType.Good, color = GetEventColor(EventType.Good), conflictsWith = new List(), onActivate = delegate { VitalHaul = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Vital Haul!"); } }); AllEvents.Add(new GameEvent { id = "battle_hardened", name_en = "Battle-Hardened", name_ru = "Закалённые Ценности", name_ko = "단련된 귀중품", desc_en = "Damaging a valuable raises its value (up to 50% more)", desc_ru = "Повреждение ценности повышает её стоимость (до +50%)", desc_ko = "귀중품을 손상시키면 가치 상승 (최대 +50%)", category = EventCategory.LootModifier, eventType = EventType.VeryGood, color = GetEventColor(EventType.VeryGood), conflictsWith = new List(), onActivate = delegate { BattleHardened = true; REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] ✅ Battle-Hardened!"); } }); RegisterChallengeRewardEvents(); } private static void RegisterChallengeRewardEvents() { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) AddChallengeRewardEvent("glass_dividend", "Glass Dividend", "Challenge reward: valuables gain +12% value, or +20% while Fragile Valuables is active.", EventType.Good, new Color(1f, 0.78f, 0.22f), delegate { GlassDividendReward = true; }); AddChallengeRewardEvent("pit_insurance", "Pit Insurance", "Challenge reward: valuables gain +10% value, or +18% while Pit Immunity is active.", EventType.Good, new Color(0.7f, 0.45f, 1f), delegate { PitInsuranceReward = true; }); AddChallengeRewardEvent("storm_surge", "Storm Surge", "Challenge reward: valuables gain +10% value, or +18% while Speed Demons is active.", EventType.Good, new Color(0.25f, 0.9f, 1f), delegate { StormSurgeReward = true; }); AddChallengeRewardEvent("debt_silence", "Debt Silence", "Challenge reward: valuables gain +10% value, or +18% during darkness or quiet danger.", EventType.Good, new Color(0.35f, 0.36f, 0.46f), delegate { DebtSilenceReward = true; }); AddChallengeRewardEvent("lucky_echoes", "Lucky Echoes", "Challenge reward: valuables gain +14% value after mastering clone lottery odds.", EventType.Good, new Color(0.35f, 1f, 0.55f), delegate { LuckyEchoesReward = true; }); AddChallengeRewardEvent("magnetic_margin", "Magnetic Margin", "Challenge reward: valuables gain +12% value, or +20% while Magnetic Valuables is active.", EventType.Good, new Color(0.95f, 0.35f, 0.85f), delegate { MagneticMarginReward = true; }); AddChallengeRewardEvent("final_notice", "Final Notice", "Challenge reward: valuables gain +22% value after mastering Last Invoice.", EventType.VeryGood, new Color(1f, 0.25f, 0.18f), delegate { FinalNoticeReward = true; }); AddChallengeRewardEvent("centurion_compound", "Centurion Compound", "Level 100 reward: valuables gain +35% value, or +50% on level 100 and beyond.", EventType.VeryGood, new Color(1f, 0.84f, 0.18f), delegate { CenturionCompoundReward = true; }); } private static void AddChallengeRewardEvent(string id, string name, string description, EventType eventType, Color color, Action activate) { //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) AllEvents.Add(new GameEvent { id = id, name_en = name, name_ru = name, name_ko = name, desc_en = description, desc_ru = description, desc_ko = description, category = EventCategory.LootModifier, eventType = eventType, color = color, conflictsWith = new List(), onActivate = delegate { activate?.Invoke(); REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Challenge reward modifier activated: " + id)); } }); } public static void PickEvents(bool allowRandom) { REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] Picking events (Random allowed: {allowRandom})..."); ActiveEvents.Clear(); ResetMultipliers(); if (ChallengeManager.TryApplyModifierPreset()) { return; } if (allowRandom) { InitializeForcedEvents(); foreach (GameEvent forcedEvent in ForcedEvents) { if (REPOBlackMarketManager.TryConsumeModifierBlock(forcedEvent.id, forcedEvent.name_en)) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Black market blocked forced modifier: " + forcedEvent.id)); continue; } ActiveEvents.Add(forcedEvent); forcedEvent.onActivate?.Invoke(); REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] ✅ Forced Event Activated: " + forcedEvent.id)); } } else { ForcedEvents.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] Forced modifiers skipped due to level requirement."); } if (allowRandom) { int modifierCount = REPOSeedManager.Range(REPOConfig.MinModifierCount.Value, REPOConfig.MaxModifierCount.Value + 1); if (REPOConfig.EnableSharedPool.Value) { PickEventsSharedPool(modifierCount); } else { PickEventsByCategory(modifierCount); } } else { REPOConomyPlugin.Logger.LogInfo((object)"[EventManager] Random modifiers skipped due to level requirement."); } TrackActiveModifiersForStats(); if (PhotonNetwork.IsMasterClient) { SyncModifiersToClients(); REPOConomyNetworkHandler.SyncSharedPoolToClients(); } } public static void TrackActiveModifiersForStats() { //IL_010c: Unknown result type (might be due to invalid IL or missing references) REPOStatsManager rEPOStatsManager = REPOStatsManager.EnsureInstance(); if ((Object)(object)rEPOStatsManager == (Object)null || ActiveEvents == null || ActiveEvents.Count == 0) { return; } int currentLevel = REPOConomyPlugin.GetCurrentLevel(); HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); HashSet hashSet2 = new HashSet(StringComparer.OrdinalIgnoreCase); if (ForcedEvents != null) { foreach (GameEvent forcedEvent in ForcedEvents) { if (forcedEvent != null && !string.IsNullOrWhiteSpace(forcedEvent.id)) { hashSet2.Add(forcedEvent.id); } } } foreach (GameEvent activeEvent in ActiveEvents) { if (activeEvent != null && !string.IsNullOrWhiteSpace(activeEvent.id) && !hashSet2.Contains(activeEvent.id) && hashSet.Add(activeEvent.id)) { rEPOStatsManager.TrackModifierOccurrence(activeEvent.id, activeEvent.name_en ?? activeEvent.id, activeEvent.desc_en ?? string.Empty, activeEvent.color, currentLevel, activeEvent.eventType); } } } private static void PickEventsByCategory(int modifierCount) { List list = new List(); if (REPOConfig.EnableLootModifiers.Value) { list.Add(EventCategory.LootModifier); } if (REPOConfig.EnableEnemyModifiers.Value) { list.Add(EventCategory.EnemyModifier); } if (REPOConfig.EnablePlayerModifiers.Value) { list.Add(EventCategory.PlayerModifier); } if (REPOConfig.EnableEnvironmentModifiers.Value) { list.Add(EventCategory.EnvironmentModifier); } if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[EventManager] All modifier categories are disabled!"); return; } int num = 0; int num2 = modifierCount * 10; int num3 = 0; while (num < modifierCount && num3 < num2) { num3++; GameEvent gameEvent = PickEventByCategory(list[REPOSeedManager.Range(0, list.Count)]); if (gameEvent != null && !ActiveEvents.Contains(gameEvent)) { ActiveEvents.Add(gameEvent); gameEvent.onActivate?.Invoke(); REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] ✅ Activated: " + gameEvent.id)); num++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] {ActiveEvents.Count}/{modifierCount} modifiers active (attempts: {num3})"); } private static void PickEventsSharedPool(int modifierCount) { List list = (from e in AllEvents.Where((GameEvent e) => REPOConfig.ModifierEnables["Enable " + e.id].Value).Where(IsModifierRewardUnlockedForPool).Where(IsModifierAllowedForCurrentPlayerCount) where !ForcedEvents.Contains(e) select e).ToList(); if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[EventManager] No enabled events for shared pool!"); return; } float num = 0f; Dictionary dictionary = new Dictionary(); foreach (EventType type in Enum.GetValues(typeof(EventType))) { if (list.Where((GameEvent e) => e.eventType == type).ToList().Count > 0) { float sharedPoolWeight = GetSharedPoolWeight(type); dictionary[type] = sharedPoolWeight; num += sharedPoolWeight; } } if (dictionary.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[EventManager] No event types available for shared pool!"); return; } int num2 = 0; int num3 = modifierCount * 10; int num4 = 0; while (num2 < modifierCount && num4 < num3) { num4++; float num5 = REPOSeedManager.Range(0f, num); float num6 = 0f; EventType selectedType = EventType.VeryGood; foreach (KeyValuePair item in dictionary) { num6 += item.Value; if (num5 <= num6) { selectedType = item.Key; break; } } List list2 = list.Where((GameEvent e) => e.eventType == selectedType && !HasConflict(e, ActiveEvents) && !ActiveEvents.Contains(e) && !IsEventRedundantOnThisLevel(e)).ToList(); if (list2.Count > 0) { GameEvent gameEvent = list2[REPOSeedManager.Range(0, list2.Count)]; if (REPOBlackMarketManager.TryConsumeModifierBlock(gameEvent.id, gameEvent.name_en)) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Black market prevented shared-pool modifier: " + gameEvent.id)); continue; } ActiveEvents.Add(gameEvent); gameEvent.onActivate?.Invoke(); REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] ✅ Activated (Shared Pool): {gameEvent.id} ({selectedType})"); num2++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] Shared Pool: {ActiveEvents.Count}/{modifierCount} modifiers active (attempts: {num4})"); } public static Dictionary ParseScaleSettingsByType(string settings) { //IL_009e: 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) Dictionary dictionary = new Dictionary(); if (string.IsNullOrWhiteSpace(settings)) { return dictionary; } REPOConomyPlugin.Logger.LogInfo((object)("[ParseScaleSettings] Parsing: '" + settings + "'")); string[] array = settings.Split(new char[1] { ',' }); foreach (string text in array) { try { string[] array2 = text.Trim().Split(new char[1] { ':' }); if (array2.Length == 2) { string value = array2[0].Trim(); string s = array2[1].Trim(); if (Enum.TryParse(value, ignoreCase: true, out Type result) && float.TryParse(s, NumberStyles.Float, CultureInfo.InvariantCulture, out var result2)) { dictionary[result] = result2; REPOConomyPlugin.Logger.LogInfo((object)$" ✅ {result} → {result2}"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("Error parsing scale pair '" + text + "': " + ex.Message)); } } return dictionary; } public static float GetScaleForType(Type type, Dictionary table) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (table.TryGetValue(type, out var value)) { return value; } return 1f; } public static void InitializeForcedEvents() { ForcedEvents.Clear(); cartScaleTable = ParseScaleSettingsByType(REPOConfig.ScaleInCartSettings.Value); extractionScaleTable = ParseScaleSettingsByType(REPOConfig.ExtractionShrinkSettings.Value); if (REPOConfig.ForceScaleInCart.Value) { TryAddForcedEventById("scale_in_cart", "Scale in Cart is forced"); } if (REPOConfig.ForceExtractionShrink.Value) { TryAddForcedEventById("shrink_extraction_valuables", "Extraction Shrink is forced"); } AddForcedModifierEventsFromConfig(); } private static void AddForcedModifierEventsFromConfig() { if (REPOConfig.ForceModifier == null || REPOConfig.ForceModifier.Count == 0) { return; } foreach (KeyValuePair> item in REPOConfig.ForceModifier) { if (item.Value != null && item.Value.Value) { string text = item.Key ?? string.Empty; string text2 = text.Trim(); if (text2.StartsWith("Enable ", StringComparison.OrdinalIgnoreCase)) { text2 = text2.Substring("Enable ".Length).Trim(); } if (!string.IsNullOrWhiteSpace(text2)) { TryAddForcedEventById(text2, "Forced by config: " + text); } } } } private static void TryAddForcedEventById(string eventId, string logReason) { if (string.IsNullOrWhiteSpace(eventId)) { return; } GameEvent forcedEvent = AllEvents.FirstOrDefault((GameEvent e) => string.Equals(e.id, eventId, StringComparison.OrdinalIgnoreCase)); if (forcedEvent == null) { REPOConomyPlugin.Logger.LogWarning((object)("[ForcedEvents] Event '" + eventId + "' not found, skipping force.")); } else { if (ForcedEvents.Contains(forcedEvent) || !IsModifierAllowedForCurrentPlayerCount(forcedEvent)) { return; } if (ChallengeManager.IsChallengeRewardModifier(forcedEvent.id) && !ChallengeManager.IsRewardModifierUnlocked(forcedEvent.id)) { REPOConomyPlugin.Logger.LogInfo((object)("[ForcedEvents] Challenge reward modifier '" + forcedEvent.id + "' is locked.")); return; } if (LevelMilestoneRewardManager.IsRewardModifier(forcedEvent.id) && !LevelMilestoneRewardManager.IsLevel100Unlocked()) { REPOConomyPlugin.Logger.LogInfo((object)("[ForcedEvents] Level 100 reward modifier '" + forcedEvent.id + "' is locked.")); return; } List list = ForcedEvents.Where((GameEvent existing) => AreEventsConflicting(forcedEvent, existing)).ToList(); if (list.Count > 0) { if (REPOConfig.StrictForceMode == null || !REPOConfig.StrictForceMode.Value) { REPOConomyPlugin.Logger.LogWarning((object)("[ForcedEvents] Conflict detected, cannot force '" + forcedEvent.id + "'.")); return; } foreach (GameEvent item in list) { ForcedEvents.Remove(item); REPOConomyPlugin.Logger.LogInfo((object)("[ForcedEvents] Strict mode removed conflicting forced event: " + item.id)); } } ForcedEvents.Add(forcedEvent); REPOConomyPlugin.Logger.LogInfo((object)("[ForcedEvents] " + logReason)); } } private static bool AreEventsConflicting(GameEvent a, GameEvent b) { if (a == null || b == null) { return false; } bool num = a.conflictsWith != null && a.conflictsWith.Any((string id) => string.Equals(id, b.id, StringComparison.OrdinalIgnoreCase)); bool flag = b.conflictsWith != null && b.conflictsWith.Any((string id) => string.Equals(id, a.id, StringComparison.OrdinalIgnoreCase)); return num || flag; } public static void SyncBloodlustToClients() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } try { object[] array = new object[2] { EnemiesFasterOnKillCount, EnemiesFasterOnKillMultiplier }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)187, (object)array, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[Bloodlust] \ud83d\udce4 Synced to clients: {EnemiesFasterOnKillCount} kills, x{EnemiesFasterOnKillMultiplier:F2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Bloodlust] Sync error: " + ex.Message)); } } public static void SyncModifiersToClients() { //IL_17cb: Unknown result type (might be due to invalid IL or missing references) //IL_17d0: Unknown result type (might be due to invalid IL or missing references) //IL_17d2: Unknown result type (might be due to invalid IL or missing references) //IL_17d9: Expected O, but got Unknown //IL_17e2: Unknown result type (might be due to invalid IL or missing references) string[] array = ActiveEvents.Select((GameEvent e) => e.id).ToArray(); long num = 0L; long num2 = 0L; long num3 = 0L; long num4 = 0L; long num5 = 0L; long num6 = 0L; if (EnemiesInvisible) { num |= 1; } if (PlayersInvisible) { num |= 2; } if (RandomBoosts) { num |= 4; } if (HealthRegeneration) { num |= 8; } if (ToxicAir) { num |= 0x10; } if (FoggyVision) { num |= 0x20; } if (InvertedControls) { num |= 0x40; } if (GoldenTouch) { num |= 0x80; } if (FrozenEnemies) { num |= 0x100; } if (MagneticValuables) { num |= 0x200; } if (EnemyMultiplication) { num |= 0x400; } if (SuperJump) { num |= 0x800; } if (NightVision) { num |= 0x1000; } if (LuckyFind) { num |= 0x2000; } if (StickyFeet) { num |= 0x4000; } if (TimeWarp) { num |= 0x8000; } if (InfiniteAmmo) { num |= 0x10000; } if (OneHitKill) { num |= 0x20000; } if (OneHitKillPlayers) { num |= 0x40000; } if (HealthVampire) { num |= 0x80000; } if (ExtractionRush) { num |= 0x100000; } if (ExtractionMagnet) { num |= 0x200000; } if (ExtractionShield) { num |= 0x400000; } if (ExtractionChaos) { num |= 0x800000; } if (SingleExtraction) { num |= 0x1000000; } if (DoublePlayerDamage) { num |= 0x2000000; } if (DoubleEnemyHealth) { num |= 0x4000000; } if (HalfPlayerDamage) { num |= 0x8000000; } if (DoubleEnemyDamage) { num |= 0x10000000; } if (ValuablesUnbreakable) { num |= 0x20000000; } if (ValuablesFragile) { num |= 0x40000000; } if (FeatherWeight) { num |= 0x80000000u; } if (HeavyBurden) { num |= 0x100000000L; } if (SlipperyChaos) { num |= 0x200000000L; } if (ZeroGravityLoot) { num |= 0x400000000L; } if (PhantomObjects) { num |= 0x800000000L; } if (BouncyHavoc) { num |= 0x1000000000L; } if (ScaleInCart) { num |= 0x2000000000L; } if (EnemyHeavyWeight) { num |= 0x4000000000L; } if (EnemyLightWeight) { num |= 0x8000000000L; } if (InstantRespawn) { num |= 0x10000000000L; } if (PersistentEnemies) { num |= 0x20000000000L; } if (ExplosiveValuables) { num |= 0x40000000000L; } if (HotPotato) { num |= 0x80000000000L; } if (UnbreakableDoors) { num |= 0x100000000000L; } if (PlayerRevival) { num |= 0x200000000000L; } if (ShrinkExtractionValuables) { num |= 0x400000000000L; } if (EnemiesOmniscient) { num |= 0x800000000000L; } if (BossFight) { num |= 0x1000000000000L; } if (TooQuiet) { num |= 0x2000000000000L; } if (InvincibleHorror) { num |= 0x4000000000000L; } if (PitImmunity) { num |= 0x8000000000000L; } if (EnemiesPitImmunity) { num |= 0x10000000000000L; } if (UnstableGrabbing) { num |= 0x20000000000000L; } if (NoOvercharge) { num |= 0x40000000000000L; } if (LevelGlitch) { num |= 0x80000000000000L; } if (SettleItInSmash) { num |= 0x100000000000000L; } if (FoundMap) { num |= 0x200000000000000L; } if (SuperRecoil) { num |= 0x400000000000000L; } if (JammingGuns) { num |= 0x800000000000000L; } if (CheapBatteries) { num |= 0x1000000000000000L; } if (ExplosiveTumble) { num |= 0x2000000000000000L; } if (GlassBones) { num |= 0x4000000000000000L; } if (SlipperyHands) { num2 |= 1; } if (GiantPlayer) { num2 |= 2; } if (TinyPlayer) { num2 |= 4; } if (WeakArms) { num2 |= 8; } if (StrongArms) { num2 |= 0x10; } if (Earthquake) { num2 |= 0x20; } if (NoJump) { num2 |= 0x40; } if (TotalDarkness) { num2 |= 0x80; } if (KamikazeEnemies) { num2 |= 0x100; } if (RegeneratingEnemies) { num2 |= 0x200; } if (ShadowClones) { num2 |= 0x400; } if (DangerousValuables) { num2 |= 0x800; } if (CloakedValuables) { num2 |= 0x1000; } if (RunawayValuables) { num2 |= 0x2000; } if (EnemiesFasterOnKill) { num2 |= 0x4000; } if (CriticalHits) { num2 |= 0x8000; } if (Dodge) { num2 |= 0x10000; } if (ChainReaction) { num2 |= 0x20000; } if (FakeValuables) { num2 |= 0x40000; } if (ValueDecay) { num2 |= 0x80000; } if (EnemyHealOnDamage) { num2 |= 0x100000; } if (PlayerDeaf) { num2 |= 0x200000; } if (TeleportingEnemies) { num2 |= 0x400000; } if (SharedPain) { num2 |= 0x800000; } if (SharedHealing) { num2 |= 0x1000000; } if (LowHealthSpeedBoost) { num2 |= 0x2000000; } if (ValuableEncumbrance) { num2 |= 0x4000000; } if (SpeedZones) { num2 |= 0x8000000; } if (RandomPlayerTeleportations) { num2 |= 0x10000000; } if (StickyValuables) { num2 |= 0x20000000; } if (ExplosiveThrowValuables) { num2 |= 0x40000000; } if (RoomGravity) { num2 |= 0x80000000u; } if (DoubleJump) { num3 |= 1; } if (NoFallDamage) { num3 |= 2; } if (DamageTradeoff) { num3 |= 4; } if (CursedValuables) { num3 |= 8; } if (AlarmSystem) { num3 |= 0x10; } if (EnemyTouchShock) { num3 |= 0x20; } if (WoundedFury) { num3 |= 0x40; } if (Executioner) { num3 |= 0x80; } if (LifestealStrikes) { num3 |= 0x100; } if (LastBreath) { num3 |= 0x200; } if (Thorns) { num3 |= 0x400; } if (GlassEnemies) { num3 |= 0x800; } if (BountifulKills) { num3 |= 0x1000; } if (TaxSeason) { num3 |= 0x2000; } if (RiskReward) { num3 |= 0x4000; } if (Bloodthirst) { num3 |= 0x8000; } if (IronWill) { num3 |= 0x10000; } if (GuardianShield) { num3 |= 0x20000; } if (DamageWard) { num3 |= 0x40000; } if (TitansVigor) { num3 |= 0x80000; } if (RegenerationAura) { num3 |= 0x100000; } if (BloodthirstyHealer) { num3 |= 0x200000; } if (BerserkersResolve) { num3 |= 0x400000; } if (ExecutionersEdge) { num3 |= 0x800000; } if (LastStand) { num3 |= 0x1000000; } if (SecondWind) { num3 |= 0x2000000; } if (FirstStrike) { num3 |= 0x4000000; } if (AdrenalineSurge) { num3 |= 0x8000000; } if (Brawler) { num3 |= 0x10000000; } if (Toughened) { num3 |= 0x20000000; } if (Frailty) { num3 |= 0x40000000; } if (Feeble) { num3 |= 0x80000000u; } if (GlassJaw) { num3 |= 0x100000000L; } if (PainAmplifier) { num3 |= 0x200000000L; } if (AdrenalineCrash) { num3 |= 0x400000000L; } if (Exhausted) { num3 |= 0x800000000L; } if (RecoilStrikes) { num3 |= 0x1000000000L; } if (Vulnerable) { num3 |= 0x2000000000L; } if (SoulDrain) { num3 |= 0x4000000000L; } if (Crippled) { num3 |= 0x8000000000L; } if (CowardsCurse) { num3 |= 0x10000000000L; } if (FaintHeart) { num3 |= 0x20000000000L; } if (SlowHealing) { num3 |= 0x40000000000L; } if (SluggishRecovery) { num3 |= 0x80000000000L; } if (AchillesHeel) { num3 |= 0x100000000000L; } if (StageFright) { num3 |= 0x200000000000L; } if (ThinSkin) { num3 |= 0x400000000000L; } if (RecklessSwings) { num3 |= 0x800000000000L; } if (SoftBlows) { num3 |= 0x1000000000000L; } if (Fumble) { num3 |= 0x2000000000000L; } if (RecklessPower) { num3 |= 0x4000000000000L; } if (VampiricPact) { num3 |= 0x8000000000000L; } if (AdrenalineCycle) { num3 |= 0x10000000000000L; } if (Gambler) { num3 |= 0x20000000000000L; } if (CoinFlipDefense) { num3 |= 0x40000000000000L; } if (BerserkersBargain) { num3 |= 0x80000000000000L; } if (BloodPrice) { num3 |= 0x100000000000000L; } if (Equalizer) { num3 |= 0x200000000000000L; } if (TugOfWar) { num3 |= 0x400000000000000L; } if (Pendulum) { num3 |= 0x800000000000000L; } if (JuggernautEnemies) { num4 |= 1; } if (ArmoredHides) { num4 |= 2; } if (BrutalEnemies) { num4 |= 4; } if (ThornedEnemies) { num4 |= 8; } if (HardenedCores) { num4 |= 0x10; } if (DeathThroes) { num4 |= 0x20; } if (PlagueBearers) { num4 |= 0x40; } if (PackTactics) { num4 |= 0x80; } if (PhaseShield) { num4 |= 0x100; } if (VengefulHorde) { num4 |= 0x200; } if (PaperEnemies) { num4 |= 0x400; } if (BrittleBonesEnemies) { num4 |= 0x800; } if (FeebleFoes) { num4 |= 0x1000; } if (GoldenEnemies) { num4 |= 0x2000; } if (SelfDestructEnemies) { num4 |= 0x4000; } if (ExposedCores) { num4 |= 0x8000; } if (BleedingEnemies) { num4 |= 0x10000; } if (GlassJawEnemies) { num4 |= 0x20000; } if (ExposedWeakpoint) { num4 |= 0x40000; } if (Lootsplosion) { num4 |= 0x80000; } if (ToughSkin) { num4 |= 0x100000; } if (BulkyEnemies) { num4 |= 0x200000; } if (AggressiveEnemies) { num4 |= 0x400000; } if (ResilientCores) { num4 |= 0x800000; } if (QuickRecovery) { num4 |= 0x1000000; } if (HardyEnemies) { num4 |= 0x2000000; } if (SecondSkin) { num4 |= 0x4000000; } if (VengefulSparks) { num4 |= 0x8000000; } if (PackInstinct) { num4 |= 0x10000000; } if (EvasiveEnemies) { num4 |= 0x20000000; } if (BerserkerEnemies) { num4 |= 0x40000000; } if (GlassCannonEnemies) { num4 |= 0x80000000u; } if (ErraticEnemies) { num4 |= 0x100000000L; } if (GamblingFoes) { num4 |= 0x200000000L; } if (VampiricFoes) { num4 |= 0x400000000L; } if (AdaptiveEnemies) { num4 |= 0x800000000L; } if (VolatileCores) { num4 |= 0x1000000000L; } if (EnragedOnHit) { num4 |= 0x2000000000L; } if (ScavengerEnemies) { num4 |= 0x4000000000L; } if (ToughLove) { num4 |= 0x8000000000L; } if (SoftTargets) { num4 |= 0x10000000000L; } if (FrailEnemies) { num4 |= 0x20000000000L; } if (ClumsyEnemies) { num4 |= 0x40000000000L; } if (SoftSpot) { num4 |= 0x80000000000L; } if (StumblingEnemies) { num4 |= 0x100000000000L; } if (GenerousKills) { num4 |= 0x200000000000L; } if (SoulHarvest) { num4 |= 0x400000000000L; } if (BrittleShells) { num4 |= 0x800000000000L; } if (Bonanza) { num4 |= 0x1000000000000L; } if (LuckyStrike) { num4 |= 0x2000000000000L; } if (ValueFloor) { num4 |= 0x4000000000000L; } if (HeavyweightBonus) { num4 |= 0x8000000000000L; } if (CompoundInterest) { num4 |= 0x10000000000000L; } if (TreasureSense) { num4 |= 0x20000000000000L; } if (DiamondLoot) { num4 |= 0x40000000000000L; } if (Salvage) { num4 |= 0x80000000000000L; } if (PristineValuables) { num4 |= 0x100000000000000L; } if (LuckyLottery) { num4 |= 0x200000000000000L; } if (Bankruptcy) { num5 |= 1; } if (Pyrite) { num5 |= 2; } if (WorthlessHeavies) { num5 |= 4; } if (CrumblingTreasures) { num5 |= 8; } if (LeakyValue) { num5 |= 0x10; } if (Spoilage) { num5 |= 0x20; } if (GlassHoard) { num5 |= 0x40; } if (VolatileWealth) { num5 |= 0x80; } if (DiminishingHoard) { num5 |= 0x100; } if (FoolsAbundance) { num5 |= 0x200; } if (Windfall) { num5 |= 0x400; } if (LightweightPremium) { num5 |= 0x800; } if (HiddenGems) { num5 |= 0x1000; } if (TreasureTrove) { num5 |= 0x2000; } if (PaddedValuables) { num5 |= 0x4000; } if (ReinforcedEdges) { num5 |= 0x8000; } if (SecondChance) { num5 |= 0x10000; } if (GoldenCart) { num5 |= 0x20000; } if (SurgeDemand) { num5 |= 0x40000; } if (AppraisersGlow) { num5 |= 0x80000; } if (LightweightTax) { num5 |= 0x100000; } if (Misfortune) { num5 |= 0x200000; } if (WornEdges) { num5 |= 0x400000; } if (FadingFortune) { num5 |= 0x800000; } if (Tarnish) { num5 |= 0x1000000; } if (BruisedGoods) { num5 |= 0x2000000; } if (HeavyPockets) { num5 |= 0x4000000; } if (HandlingFee) { num5 |= 0x8000000; } if (BrittleHandling) { num5 |= 0x10000000; } if (BoomOrBust) { num5 |= 0x20000000; } if (JackpotGamble) { num5 |= 0x40000000; } if (Counterweight) { num5 |= 0x80000000u; } if (RiskPremium) { num5 |= 0x100000000L; } if (SlowInflation) { num5 |= 0x200000000L; } if (LiquidationSale) { num5 |= 0x400000000L; } if (HeadsOrTails) { num5 |= 0x800000000L; } if (WeightSwap) { num5 |= 0x1000000000L; } if (LuckyDip) { num5 |= 0x2000000000L; } if (LongReach) { num5 |= 0x4000000000L; } if (BigLungs) { num5 |= 0x8000000000L; } if (Tailwind) { num5 |= 0x10000000000L; } if (SpringyLegs) { num5 |= 0x20000000000L; } if (NinjaCrouch) { num5 |= 0x40000000000L; } if (LunarFacility) { num5 |= 0x80000000000L; } if (SparseEnemies) { num5 |= 0x100000000000L; } if (CrystalAir) { num5 |= 0x200000000000L; } if (ExtractionBeacons) { num5 |= 0x400000000000L; } if (RichFacility) { num5 |= 0x1000000000000L; } if (QuietFacility) { num5 |= 0x2000000000000L; } if (LightQuota) { num5 |= 0x4000000000000L; } if (ScatteredRiches) { num5 |= 0x8000000000000L; } if (FleetingEnemies) { num5 |= 0x10000000000000L; } if (GenerousExtraction) { num5 |= 0x20000000000000L; } if (EnergizedAtmosphere) { num5 |= 0x800000000000L; } if (HeavyQuota) { num5 |= 0x40000000000000L; } if (PoorFacility) { num5 |= 0x80000000000000L; } if (EchoingHalls) { num5 |= 0x100000000000000L; } if (RelentlessEnemies) { num5 |= 0x200000000000000L; } if (FlickeringPower) { num5 |= 0x400000000000000L; } if (LootedFacility) { num5 |= 0x800000000000000L; } if (ExhaustingAir) { num5 |= 0x1000000000000000L; } if (PowerSurge) { num5 |= 0x2000000000000000L; } if (HazardousSparks) { num5 |= 0x4000000000000000L; } if (PhantomQuota) { num5 |= long.MinValue; } if (DimFacility) { num6 |= 1; } if (StiffDoors) { num6 |= 2; } if (AgedTubes) { num6 |= 4; } if (FrostCreep) { num6 |= 8; } if (CreakyFloors) { num6 |= 0x10; } if (ModestQuota) { num6 |= 0x20; } if (TightBudget) { num6 |= 0x40; } if (StuffyAir) { num6 |= 0x80; } if (CrampedFacility) { num6 |= 0x100; } if (ColdFacility) { num6 |= 0x200; } if (ColoredLights) { num6 |= 0x400; } if (PulsingLights) { num6 |= 0x800; } if (FloatingDust) { num6 |= 0x1000; } if (ReverbHall) { num6 |= 0x2000; } if (SpaciousFacility) { num6 |= 0x4000; } if (LowStakes) { num6 |= 0x8000; } if (ShuffledLoot) { num6 |= 0x10000; } if (WeakSwarm) { num6 |= 0x20000; } if (EliteGuard) { num6 |= 0x40000; } if (HighStakes) { num6 |= 0x80000; } if (SluggishEnemies) { num6 |= 0x100000; } if (ReducedQuota) { num6 |= 0x200000; } if (FairBonus) { num6 |= 0x400000; } if (FreshAir) { num6 |= 0x800000; } if (MuffledHalls) { num6 |= 0x1000000; } if (ThinnedPatrols) { num6 |= 0x2000000; } if (RoomyExtractions) { num6 |= 0x4000000; } if (LuckyScraps) { num6 |= 0x8000000; } if (SwiftTubes) { num6 |= 0x10000000; } if (MagneticCarts) { num6 |= 0x20000000; } if (DeafToMonsters) { num6 |= 0x40000000; } if (AdrenalineHunters) { num6 |= 0x80000000u; } if (TankyButGentle) { num6 |= 0x100000000L; } if (TierMercy) { num6 |= 0x200000000L; } if (SuicidalAttackers) { num6 |= 0x400000000L; } if (BlinkingHaze) { num6 |= 0x800000000L; } if (ManyExtractions) { num6 |= 0x1000000000L; } if (LoneWolf) { num6 |= 0x2000000000L; } if (RestorativeRooms) { num6 |= 0x4000000000L; } if (HostileRooms) { num6 |= 0x8000000000L; } if (MapDisabled) { num6 |= 0x10000000000L; } if (HalfStamina) { num6 |= 0x20000000000L; } if (GlassRunner) { num6 |= 0x40000000000L; } if (KillRecharge) { num6 |= 0x80000000000L; } if (TripledUpgrades) { num6 |= 0x100000000000L; } if (ValueDrainHeld) { num6 |= 0x200000000000L; } if (BulkyCargo) { num6 |= 0x400000000000L; } if (OffGrid) { num6 |= 0x800000000000L; } if (VitalHaul) { num6 |= 0x1000000000000L; } if (BattleHardened) { num6 |= 0x2000000000000L; } bool value = REPOConfig.ForceScaleInCart.Value; bool value2 = REPOConfig.ForceExtractionShrink.Value; string value3 = REPOConfig.ScaleInCartSettings.Value; string value4 = REPOConfig.ExtractionShrinkSettings.Value; object[] array2 = new object[14] { array, PlayerSpeedMultiplier, PlayerHealthMultiplier, num, num2, num3, value, value2, value3, value4, EnemiesFasterOnKillMultiplier, num4, num5, num6 }; RaiseEventOptions val = new RaiseEventOptions { Receivers = (ReceiverGroup)0 }; PhotonNetwork.RaiseEvent((byte)180, (object)array2, val, SendOptions.SendReliable); REPOConomyPlugin.Logger.LogInfo((object)$"[EventManager] \ud83d\udce4 Synced {array.Length} modifiers (compressed)"); } private static bool IsEventRedundantOnThisLevel(GameEvent e) { if (e == null) { return false; } if (e.id == "single_extraction") { RunManager instance = RunManager.instance; if ((Object)(object)instance == (Object)null) { return false; } int scaledExtractionAmount = LevelScalingImprovements.GetScaledExtractionAmount(instance.levelsCompleted); if (scaledExtractionAmount <= 0) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Skipping 'single_extraction': level already has a single extraction point " + $"(levelsCompleted={instance.levelsCompleted}, scaledExtractionAmount={scaledExtractionAmount}).")); return true; } } return false; } private static GameEvent PickEventByCategory(EventCategory category) { List list = AllEvents.Where((GameEvent e) => e.category == category).ToList(); if (list.Count == 0) { return null; } list = list.Where((GameEvent e) => REPOConfig.ModifierEnables["Enable " + e.id].Value).ToList(); list = list.Where(IsModifierRewardUnlockedForPool).ToList(); list = list.Where(IsModifierAllowedForCurrentPlayerCount).ToList(); list = list.Where((GameEvent e) => !IsEventRedundantOnThisLevel(e)).ToList(); if (list.Count == 0) { return null; } list = list.Where((GameEvent e) => !ForcedEvents.Contains(e)).ToList(); if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)$"[EventManager] All events in category {category} are either disabled or forced!"); return null; } List list2 = list.Where((GameEvent e) => !HasConflict(e, ActiveEvents)).ToList(); if (list2.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)$"[EventManager] ⚠\ufe0f All events in category {category} conflict with active events!"); return null; } float num = 0f; foreach (GameEvent item in list2) { num += GetEventWeight(item.eventType); } float num2 = REPOSeedManager.Range(0f, num); float num3 = 0f; foreach (GameEvent item2 in list2) { num3 += GetEventWeight(item2.eventType); if (num2 <= num3) { if (REPOBlackMarketManager.TryConsumeModifierBlock(item2.id, item2.name_en)) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Black market prevented modifier: " + item2.id)); return null; } return item2; } } if (REPOBlackMarketManager.TryConsumeModifierBlock(list2[0].id, list2[0].name_en)) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] Black market prevented modifier: " + list2[0].id)); return null; } return list2[0]; } public static float GetEventWeight(EventType type) { float num = REPODifficultyManager.CurrentDifficulty / REPOConfig.DifficultyMaxCap.Value; return type switch { EventType.VeryGood => Mathf.Lerp(20f, 5f, num), EventType.Good => Mathf.Lerp(30f, 15f, num), EventType.Neutral => 25f, EventType.Bad => Mathf.Lerp(15f, 30f, num), EventType.VeryBad => Mathf.Lerp(5f, 20f, num), _ => 10f, }; } public static float GetSharedPoolWeight(EventType type) { float currentDifficulty = REPODifficultyManager.CurrentDifficulty; float num = SharedPoolBaseWeights[(int)type]; float num2 = SharedPoolIncrements[(int)type]; float num3 = SharedPoolMinCaps[(int)type]; float num4 = SharedPoolMaxCaps[(int)type]; return Mathf.Clamp(num + num2 * currentDifficulty, num3, num4); } private static bool HasConflict(GameEvent newEvent, List activeEvents) { if (newEvent == null || activeEvents == null || activeEvents.Count == 0) { return false; } foreach (GameEvent activeEvent in activeEvents) { if (AreEventsConflicting(newEvent, activeEvent)) { REPOConomyPlugin.Logger.LogInfo((object)("[EventManager] ❌ Conflict: " + newEvent.id + " conflicts with " + activeEvent.id)); return true; } } return false; } public static void ResetMultipliers() { EnemySpeedMultiplier = 1f; EnemySpawnMultiplier = 1f; PlayerSpeedMultiplier = 1f; PlayerHealthMultiplier = 1f; ValuableCountMultiplier = 1f; EnemiesFasterOnKillMultiplier = 1f; EnemiesFasterOnKillCount = 0; EnemiesInvisible = false; EnemiesPacifist = false; PlayersInvisible = false; GoldenTouch = false; InvertedControls = false; FoggyVision = false; RandomBoosts = false; HealthRegeneration = false; FrozenEnemies = false; MagneticValuables = false; ToxicAir = false; EnemyMultiplication = false; SuperJump = false; NightVision = false; LuckyFind = false; StickyFeet = false; TimeWarp = false; InfiniteAmmo = false; OneHitKill = false; OneHitKillPlayers = false; HealthVampire = false; ExtractionRush = false; ExtractionMagnet = false; ExtractionShield = false; ExtractionChaos = false; SingleExtraction = false; DoublePlayerDamage = false; DoubleEnemyHealth = false; HalfPlayerDamage = false; DoubleEnemyDamage = false; ValuablesUnbreakable = false; ValuablesFragile = false; FeatherWeight = false; HeavyBurden = false; EnemyHeavyWeight = false; EnemyLightWeight = false; EnemiesFasterOnKill = false; CriticalHits = false; InstantRespawn = false; PersistentEnemies = false; ExplosiveValuables = false; SlipperyChaos = false; ZeroGravityLoot = false; PhantomObjects = false; BouncyHavoc = false; ScaleInCart = false; HotPotato = false; UnbreakableDoors = false; PlayerRevival = false; ShrinkExtractionValuables = false; EnemiesOmniscient = false; BossFight = false; TooQuiet = false; InvincibleHorror = false; PitImmunity = false; EnemiesPitImmunity = false; TeleportingEnemies = false; UnstableGrabbing = false; NoOvercharge = false; LevelGlitch = false; SettleItInSmash = false; FoundMap = false; SuperRecoil = false; JammingGuns = false; CheapBatteries = false; ExplosiveTumble = false; GlassBones = false; SlipperyHands = false; GiantPlayer = false; TinyPlayer = false; WeakArms = false; StrongArms = false; Earthquake = false; NoJump = false; TotalDarkness = false; KamikazeEnemies = false; RegeneratingEnemies = false; ShadowClones = false; DangerousValuables = false; AlarmSystem = false; EnemyTouchShock = false; CloakedValuables = false; RunawayValuables = false; Dodge = false; ChainReaction = false; FakeValuables = false; ValueDecay = false; EnemyHealOnDamage = false; PlayerDeaf = false; SharedPain = false; SharedHealing = false; LowHealthSpeedBoost = false; ValuableEncumbrance = false; SpeedZones = false; RandomPlayerTeleportations = false; StickyValuables = false; ExplosiveThrowValuables = false; RoomGravity = false; DoubleJump = false; NoFallDamage = false; DamageTradeoff = false; CursedValuables = false; WoundedFury = false; Executioner = false; LifestealStrikes = false; LastBreath = false; Thorns = false; GlassEnemies = false; BountifulKills = false; TaxSeason = false; RiskReward = false; Bloodthirst = false; IronWill = false; GuardianShield = false; DamageWard = false; TitansVigor = false; RegenerationAura = false; BloodthirstyHealer = false; BerserkersResolve = false; ExecutionersEdge = false; LastStand = false; SecondWind = false; FirstStrike = false; AdrenalineSurge = false; Brawler = false; Toughened = false; Frailty = false; Feeble = false; GlassJaw = false; PainAmplifier = false; AdrenalineCrash = false; Exhausted = false; RecoilStrikes = false; Vulnerable = false; SoulDrain = false; Crippled = false; CowardsCurse = false; FaintHeart = false; SlowHealing = false; SluggishRecovery = false; AchillesHeel = false; StageFright = false; ThinSkin = false; RecklessSwings = false; SoftBlows = false; Fumble = false; RecklessPower = false; VampiricPact = false; AdrenalineCycle = false; Gambler = false; CoinFlipDefense = false; BerserkersBargain = false; BloodPrice = false; Equalizer = false; TugOfWar = false; Pendulum = false; JuggernautEnemies = false; ArmoredHides = false; BrutalEnemies = false; ThornedEnemies = false; HardenedCores = false; DeathThroes = false; PlagueBearers = false; PackTactics = false; PhaseShield = false; VengefulHorde = false; PaperEnemies = false; BrittleBonesEnemies = false; FeebleFoes = false; GoldenEnemies = false; SelfDestructEnemies = false; ExposedCores = false; BleedingEnemies = false; GlassJawEnemies = false; ExposedWeakpoint = false; Lootsplosion = false; ToughSkin = false; BulkyEnemies = false; AggressiveEnemies = false; ResilientCores = false; QuickRecovery = false; HardyEnemies = false; SecondSkin = false; VengefulSparks = false; PackInstinct = false; EvasiveEnemies = false; BerserkerEnemies = false; GlassCannonEnemies = false; ErraticEnemies = false; GamblingFoes = false; VampiricFoes = false; AdaptiveEnemies = false; VolatileCores = false; EnragedOnHit = false; ScavengerEnemies = false; ToughLove = false; SoftTargets = false; FrailEnemies = false; ClumsyEnemies = false; SoftSpot = false; StumblingEnemies = false; GenerousKills = false; SoulHarvest = false; BrittleShells = false; Bonanza = false; LuckyStrike = false; ValueFloor = false; HeavyweightBonus = false; CompoundInterest = false; TreasureSense = false; DiamondLoot = false; Salvage = false; PristineValuables = false; LuckyLottery = false; GlassDividendReward = false; PitInsuranceReward = false; StormSurgeReward = false; DebtSilenceReward = false; LuckyEchoesReward = false; MagneticMarginReward = false; FinalNoticeReward = false; CenturionCompoundReward = false; Bankruptcy = false; Pyrite = false; WorthlessHeavies = false; CrumblingTreasures = false; LeakyValue = false; Spoilage = false; GlassHoard = false; VolatileWealth = false; DiminishingHoard = false; FoolsAbundance = false; Windfall = false; LightweightPremium = false; HiddenGems = false; TreasureTrove = false; PaddedValuables = false; ReinforcedEdges = false; SecondChance = false; GoldenCart = false; SurgeDemand = false; AppraisersGlow = false; LightweightTax = false; Misfortune = false; WornEdges = false; FadingFortune = false; Tarnish = false; BruisedGoods = false; HeavyPockets = false; HandlingFee = false; BrittleHandling = false; BoomOrBust = false; JackpotGamble = false; Counterweight = false; RiskPremium = false; SlowInflation = false; LiquidationSale = false; HeadsOrTails = false; WeightSwap = false; LuckyDip = false; LongReach = false; BigLungs = false; Tailwind = false; SpringyLegs = false; NinjaCrouch = false; CrystalAir = false; ExtractionBeacons = false; EnergizedAtmosphere = false; LunarFacility = false; SparseEnemies = false; RichFacility = false; QuietFacility = false; LightQuota = false; ScatteredRiches = false; FleetingEnemies = false; GenerousExtraction = false; HeavyQuota = false; PoorFacility = false; EchoingHalls = false; RelentlessEnemies = false; FlickeringPower = false; LootedFacility = false; ExhaustingAir = false; PowerSurge = false; HazardousSparks = false; PhantomQuota = false; DimFacility = false; StiffDoors = false; AgedTubes = false; FrostCreep = false; CreakyFloors = false; ModestQuota = false; TightBudget = false; StuffyAir = false; CrampedFacility = false; ColdFacility = false; ColoredLights = false; PulsingLights = false; FloatingDust = false; ReverbHall = false; SpaciousFacility = false; LowStakes = false; ShuffledLoot = false; WeakSwarm = false; EliteGuard = false; HighStakes = false; SluggishEnemies = false; ReducedQuota = false; FairBonus = false; FreshAir = false; MuffledHalls = false; ThinnedPatrols = false; RoomyExtractions = false; LuckyScraps = false; SwiftTubes = false; MagneticCarts = false; DeafToMonsters = false; AdrenalineHunters = false; TankyButGentle = false; TierMercy = false; SuicidalAttackers = false; BlinkingHaze = false; ManyExtractions = false; LoneWolf = false; RestorativeRooms = false; HostileRooms = false; MapDisabled = false; HalfStamina = false; GlassRunner = false; KillRecharge = false; TripledUpgrades = false; ValueDrainHeld = false; BulkyCargo = false; OffGrid = false; VitalHaul = false; BattleHardened = false; SelectedSizeRestriction = null; } public static bool IsModifierRewardUnlockedForPool(GameEvent gameEvent) { if (gameEvent == null || string.IsNullOrWhiteSpace(gameEvent.id)) { return false; } bool num = !ChallengeManager.IsChallengeRewardModifier(gameEvent.id) || ChallengeManager.IsRewardModifierUnlocked(gameEvent.id); bool flag = !LevelMilestoneRewardManager.IsRewardModifier(gameEvent.id) || LevelMilestoneRewardManager.IsLevel100Unlocked(); return num && flag; } public static float GetChallengeRewardValueMultiplier() { float num = 1f; if (GlassDividendReward) { num *= (ValuablesFragile ? 1.2f : 1.12f); } if (PitInsuranceReward) { num *= (PitImmunity ? 1.18f : 1.1f); } if (StormSurgeReward) { num *= (HasEvent("speed_demons") ? 1.18f : 1.1f); } if (DebtSilenceReward) { num *= ((TotalDarkness || TooQuiet) ? 1.18f : 1.1f); } if (LuckyEchoesReward) { num *= 1.14f; } if (MagneticMarginReward) { num *= (MagneticValuables ? 1.2f : 1.12f); } if (FinalNoticeReward) { num *= 1.22f; } if (CenturionCompoundReward) { num *= ((REPOConomyPlugin.GetCurrentLevel() >= 100) ? 1.5f : 1.35f); } return num; } public static Color GetEventColor(EventType eventType) { //IL_002b: 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_0055: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) return (Color)(eventType switch { EventType.VeryGood => new Color(0.082f, 1f, 0.075f), EventType.Good => new Color(0.047f, 0.475f, 0.114f), EventType.Neutral => new Color(1f, 1f, 1f), EventType.Bad => new Color(1f, 0f, 0f), EventType.VeryBad => new Color(0.38f, 0.02f, 0.051f), _ => new Color(0.5f, 0.5f, 0.5f), }); } public static bool HasEvent(string eventId) { return ActiveEvents.Any((GameEvent e) => e.id == eventId); } } internal static class InvisibleEnemiesHelper { internal static void HideAllVisualComponents(Transform root) { Renderer[] componentsInChildren = ((Component)root).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.enabled = false; } } ParticleSystem[] componentsInChildren2 = ((Component)root).GetComponentsInChildren(true); foreach (ParticleSystem val2 in componentsInChildren2) { if ((Object)(object)val2 != (Object)null) { ((Component)val2).gameObject.SetActive(false); } } Light[] componentsInChildren3 = ((Component)root).GetComponentsInChildren(true); foreach (Light val3 in componentsInChildren3) { if ((Object)(object)val3 != (Object)null) { ((Behaviour)val3).enabled = false; } } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_EnemyHorde { private static void Postfix(EnemyDirector __instance) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel() || REPOEventManager.EnemySpawnMultiplier == 1f) { return; } try { FieldInfo fieldInfo = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(EnemyDirector), "enemyList"); int num = (int)fieldInfo.GetValue(__instance); int num2 = Mathf.RoundToInt((float)num * REPOEventManager.EnemySpawnMultiplier); fieldInfo.SetValue(__instance, num2); List list = (List)fieldInfo2.GetValue(__instance); int count = list.Count; int num3 = num2 - num; for (int i = 0; i < num3; i++) { list.Add(list[i % count]); } REPOConomyPlugin.Logger.LogInfo((object)($"[EnemyHorde] Multiplied spawns x{REPOEventManager.EnemySpawnMultiplier}: " + $"{num} -> {num2} (enemyList: {count} -> {list.Count})")); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnemyHorde] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyNavMeshAgent), "Awake")] public static class Patch_EnemySpeed { private static HashSet processedAgents = new HashSet(); private static FieldInfo FI_Agent = AccessTools.Field(typeof(EnemyNavMeshAgent), "Agent"); private static FieldInfo FI_DefaultSpeed = AccessTools.Field(typeof(EnemyNavMeshAgent), "DefaultSpeed"); public static void Reset() { processedAgents.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[SpeedDemons] Reset processed agents"); } private static void Postfix(EnemyNavMeshAgent __instance) { } } [HarmonyPatch(typeof(Enemy), "Start")] public static class Patch_InvisibleEnemies_Start { private static FieldInfo FI_EnemyParent = AccessTools.Field(typeof(Enemy), "EnemyParent"); private static void Postfix(Enemy __instance) { if (!REPOEventManager.EnemiesInvisible || !SemiFunc.RunIsLevel()) { return; } try { object? value = FI_EnemyParent.GetValue(__instance); MonoBehaviour val = (MonoBehaviour)((value is MonoBehaviour) ? value : null); if ((Object)(object)val != (Object)null) { InvisibleEnemiesHelper.HideAllVisualComponents(((Component)val).transform); REPOConomyPlugin.Logger.LogInfo((object)("[InvisibleEnemies] Made " + ((Object)__instance).name + " invisible on Start")); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisibleEnemies] Start Error: " + ex.Message)); } } } [HarmonyPatch(typeof(Enemy), "Update")] public static class Patch_InvisibleEnemies_Update { private static FieldInfo FI_EnemyParent = AccessTools.Field(typeof(Enemy), "EnemyParent"); private static void Postfix(Enemy __instance) { if (!REPOEventManager.EnemiesInvisible || !SemiFunc.RunIsLevel()) { return; } try { object? value = FI_EnemyParent.GetValue(__instance); MonoBehaviour val = (MonoBehaviour)((value is MonoBehaviour) ? value : null); if ((Object)(object)val != (Object)null) { InvisibleEnemiesHelper.HideAllVisualComponents(((Component)val).transform); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisibleEnemies] Update Error: " + ex.Message)); } } } [HarmonyPatch] public static class PacifistPatches { private static MethodInfo MI_Shadow_UpdateState = AccessTools.Method(typeof(EnemyShadow), "UpdateState", (Type[])null, (Type[])null); private static MethodInfo MI_Tricycle_SetState = AccessTools.Method(typeof(EnemyTricycle), "SetState", (Type[])null, (Type[])null); private static MethodInfo MI_Hunter_UpdateState = AccessTools.Method(typeof(EnemyHunter), "UpdateState", (Type[])null, (Type[])null); private static FieldInfo FI_Enemy_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_ERB_OnTouch = AccessTools.Field(typeof(EnemyRigidbody), "onTouchPlayerAvatar"); private static FieldInfo FI_ERB_OnGrabbed = AccessTools.Field(typeof(EnemyRigidbody), "onGrabbedPlayerAvatar"); private static void ResetEnemyAggro(Enemy enemy, ref PlayerAvatar target) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null && REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { target = null; enemy.CurrentState = (EnemyState)2; enemy.DisableChase(1f); } } [HarmonyPatch(typeof(SemiFunc), "PlayerGetAllPlayerAvatarWithinRange")] [HarmonyPostfix] private static void SemiFunc_PlayerGetAllPlayerAvatarWithinRange_Postfix(ref List __result) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { __result.Clear(); } } [HarmonyPatch(typeof(Enemy), "SetChaseTarget")] [HarmonyPrefix] private static bool Enemy_SetChaseTarget_Prefix(PlayerAvatar playerAvatar) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { return false; } return true; } [HarmonyPatch(typeof(EnemyOnScreen), "GetOnScreen")] [HarmonyPrefix] private static bool EnemyOnScreen_GetOnScreen_Prefix(PlayerAvatar _playerAvatar) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { return false; } return true; } [HarmonyPatch(typeof(EnemyVision), "VisionTrigger")] [HarmonyPrefix] private static bool EnemyVision_VisionTrigger_Prefix(int playerID, PlayerAvatar player, EnemyVision __instance) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { if (__instance.VisionTriggered != null) { __instance.VisionTriggered[playerID] = false; } if (__instance.VisionsTriggered != null) { __instance.VisionsTriggered[playerID] = 0; } return false; } return true; } [HarmonyPatch(typeof(Enemy), "Update")] [HarmonyPrefix] private static void Enemy_Update_Prefix(Enemy __instance, ref PlayerAvatar ___TargetPlayerAvatar) { ResetEnemyAggro(__instance, ref ___TargetPlayerAvatar); } [HarmonyPatch(typeof(EnemyAnimal), "Update")] [HarmonyPrefix] private static void EnemyAnimal_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyBangDirector), "Update")] [HarmonyPrefix] private static void EnemyBangDirector_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyBeamer), "Update")] [HarmonyPrefix] private static void EnemyBeamer_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyBirthdayBoy), "Update")] [HarmonyPrefix] private static void EnemyBirthdayBoy_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyBombThrower), "Update")] [HarmonyPrefix] private static void EnemyBombThrower_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyBowtie), "Update")] [HarmonyPrefix] private static void EnemyBowtie_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyCeilingEye), "Update")] [HarmonyPrefix] private static void EnemyCeilingEye_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyElsa), "Update")] [HarmonyPrefix] private static void EnemyElsa_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyElsa), "OnHurt")] [HarmonyPrefix] private static bool EnemyElsa_OnHurt_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { ___playerTarget = null; return false; } return true; } [HarmonyPatch(typeof(EnemyFloater), "Update")] [HarmonyPrefix] private static void EnemyFloater_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyGnomeDirector), "Update")] [HarmonyPrefix] private static void EnemyGnomeDirector_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyHeadGrabber), "Update")] [HarmonyPrefix] private static void EnemyHeadGrabber_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyHeartHugger), "Update")] [HarmonyPrefix] private static void EnemyHeartHugger_Update_Prefix(Enemy __instance, ref PlayerAvatar ___currentTarget) { ResetEnemyAggro(__instance, ref ___currentTarget); } [HarmonyPatch(typeof(EnemyHidden), "Update")] [HarmonyPrefix] private static void EnemyHidden_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyOogly), "Update")] [HarmonyPrefix] private static void EnemyOogly_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyRobe), "Update")] [HarmonyPrefix] private static void EnemyRobe_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyRobe), "ChaseTimer")] [HarmonyPrefix] private static bool EnemyRobe_ChaseTimer_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { ___targetPlayer = null; return false; } return true; } [HarmonyPatch(typeof(EnemyRunner), "Update")] [HarmonyPrefix] private static void EnemyRunner_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyShadow), "Update")] [HarmonyPrefix] private static void EnemyShadow_Update_Prefix(EnemyShadow __instance, ref PlayerAvatar ___playerTarget) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel() && (Object)(object)___playerTarget != (Object)null) { ___playerTarget = null; MI_Shadow_UpdateState.Invoke(__instance, new object[1] { (object)(State)1 }); } } [HarmonyPatch(typeof(EnemyShadow), "BendLogic")] [HarmonyPrefix] private static bool EnemyShadow_BendLogic_Prefix(EnemyShadow __instance, ref PlayerAvatar ___playerTarget) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { ___playerTarget = null; return false; } return true; } [HarmonyPatch(typeof(EnemySlowMouth), "Update")] [HarmonyPrefix] private static void EnemySlowMouth_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemySlowWalker), "Update")] [HarmonyPrefix] private static void EnemySlowWalker_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemySpinny), "Update")] [HarmonyPrefix] private static void EnemySpinny_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyThinMan), "Update")] [HarmonyPrefix] private static void EnemyThinMan_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyTick), "Update")] [HarmonyPrefix] private static void EnemyTick_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyTricycle), "Update")] [HarmonyPrefix] private static void EnemyTricycle_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyTricycle), "SetState")] [HarmonyPrefix] private static void EnemyTricycle_SetState_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget, ref PlayerAvatar ___isBlockedByPlayerAvatar, ref State newState) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { ___playerTarget = null; ___isBlockedByPlayerAvatar = null; newState = (State)2; } } [HarmonyPatch(typeof(EnemyTricycle), "StateAttack")] [HarmonyPrefix] private static bool EnemyTricycle_StateAttack_Prefix(EnemyTricycle __instance, ref PlayerAvatar ___playerTarget) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { ___playerTarget = null; MI_Tricycle_SetState.Invoke(__instance, new object[1] { (object)(State)14 }); return false; } return true; } [HarmonyPatch(typeof(EnemyTricycle), "OnGrabbed")] [HarmonyPrefix] private static bool EnemyTricycle_OnGrabbed_Prefix(EnemyTricycle __instance) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { return false; } return true; } [HarmonyPatch(typeof(EnemyRobe), "MoveTowardPlayer")] [HarmonyPrefix] private static bool EnemyRobe_MoveTowardPlayer_Prefix(EnemyRobe __instance) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { FieldInfo fieldInfo = AccessTools.Field(typeof(EnemyRobe), "overrideAgentLerp"); if (fieldInfo != null) { float num = (float)fieldInfo.GetValue(__instance); fieldInfo.SetValue(__instance, Mathf.Max(0f, num - Time.deltaTime / 0.01f)); } return false; } return true; } [HarmonyPatch(typeof(EnemyRobe), "StateTargetPlayer")] [HarmonyPrefix] private static bool EnemyRobe_StateTargetPlayer_Prefix(EnemyRobe __instance) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { return false; } return true; } [HarmonyPatch(typeof(EnemyTumbler), "Update")] [HarmonyPrefix] private static void EnemyTumbler_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyUpscream), "Update")] [HarmonyPrefix] private static void EnemyUpscream_Update_Prefix(Enemy __instance, ref PlayerAvatar ___targetPlayer) { ResetEnemyAggro(__instance, ref ___targetPlayer); } [HarmonyPatch(typeof(EnemyValuableThrower), "Update")] [HarmonyPrefix] private static void EnemyValuableThrower_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyHunter), "Update")] [HarmonyPrefix] private static void EnemyHunter_Update_Prefix(EnemyHunter __instance) { if (!REPOEventManager.EnemiesPacifist || !SemiFunc.RunIsLevel()) { return; } object? value = FI_Enemy_Rigidbody.GetValue(__instance.enemy); EnemyRigidbody val = (EnemyRigidbody)((value is EnemyRigidbody) ? value : null); if ((Object)(object)val != (Object)null) { object? value2 = FI_ERB_OnTouch.GetValue(val); object value3 = FI_ERB_OnGrabbed.GetValue(val); if (value2 != null) { FI_ERB_OnTouch.SetValue(val, null); MI_Hunter_UpdateState.Invoke(__instance, new object[1] { (object)(State)2 }); } if (value3 != null) { FI_ERB_OnGrabbed.SetValue(val, null); MI_Hunter_UpdateState.Invoke(__instance, new object[1] { (object)(State)2 }); } } } [HarmonyPatch(typeof(EnemyHunter), "UpdateState")] [HarmonyPrefix] private static bool EnemyHunter_UpdateState_Prefix(EnemyHunter __instance, State _state) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0014: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel() && (int)_state == 5) { __instance.currentState = (State)2; return false; } return true; } [HarmonyPatch(typeof(EnemyDuck), "Update")] [HarmonyPrefix] private static void EnemyDuck_Update_Prefix(Enemy __instance, ref PlayerAvatar ___playerTarget) { ResetEnemyAggro(__instance, ref ___playerTarget); } [HarmonyPatch(typeof(EnemyDuck), "OnGrabbed")] [HarmonyPrefix] private static bool EnemyDuck_OnGrabbed_Prefix(EnemyDuck __instance) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { __instance.currentState = (State)2; return false; } return true; } [HarmonyPatch(typeof(EnemyDuck), "UpdateState")] [HarmonyPrefix] private static void EnemyDuck_UpdateState_Prefix(ref State _state) { if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel() && (int)_state == 11) { _state = (State)2; } } [HarmonyPatch(typeof(EnemyTick), "Update")] [HarmonyPrefix] private static bool EnemyTick_Update_Prefix(EnemyTick __instance) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.EnemiesPacifist && SemiFunc.RunIsLevel()) { if ((int)__instance.currentState == 6) { AccessTools.Field(typeof(EnemyTick), "playerTarget").SetValue(__instance, null); __instance.currentState = (State)1; } FieldInfo fieldInfo = AccessTools.Field(typeof(EnemyTick), "instantSuck"); if (fieldInfo != null) { fieldInfo.SetValue(__instance, false); } return true; } return true; } } [HarmonyPatch(typeof(Enemy), "Update")] public static class Patch_FrozenEnemies { private static float freezeTimer = 0f; private static bool isFreezePeriod = false; private static FieldInfo FI_MasterClient = AccessTools.Field(typeof(Enemy), "MasterClient"); private static void Postfix(Enemy __instance) { if (!REPOEventManager.FrozenEnemies || !SemiFunc.RunIsLevel()) { return; } try { if (!(bool)FI_MasterClient.GetValue(__instance)) { return; } freezeTimer += Time.deltaTime; if (freezeTimer >= 15f) { freezeTimer = 0f; isFreezePeriod = !isFreezePeriod; if (isFreezePeriod) { __instance.Freeze(3f); REPOConomyPlugin.Logger.LogInfo((object)("[FrozenEnemies] Froze " + ((Object)__instance).name + " for 3 seconds")); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FrozenEnemies] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_EnemyMultiplication { private static void Postfix(EnemyDirector __instance) { if (!REPOEventManager.EnemyMultiplication || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { FieldInfo fieldInfo = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(EnemyDirector), "enemyList"); int num = (int)fieldInfo.GetValue(__instance); int num2 = Mathf.RoundToInt((float)num * 1.5f); fieldInfo.SetValue(__instance, num2); List list = (List)fieldInfo2.GetValue(__instance); int count = list.Count; int num3 = num2 - num; for (int i = 0; i < num3; i++) { list.Add(list[i % count]); } REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyMultiplication] Increased spawns x1.5: {num} -> {num2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnemyMultiplication] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(Enemy), "Start")] public static class Patch_EnemySize { private static FieldInfo FI_EnemyParent = AccessTools.Field(typeof(Enemy), "EnemyParent"); private static void Postfix(Enemy __instance) { //IL_003a: 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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel()) { return; } try { object? value = FI_EnemyParent.GetValue(__instance); MonoBehaviour val = (MonoBehaviour)((value is MonoBehaviour) ? value : null); if (!((Object)(object)val == (Object)null)) { if (REPOEventManager.HasEvent("tiny_enemies")) { ((Component)val).transform.localScale = Vector3.one * 0.5f; REPOConomyPlugin.Logger.LogInfo((object)("[TinyEnemies] " + ((Object)__instance).name + " shrunk to 0.5x")); } else if (REPOEventManager.HasEvent("giant_enemies")) { ((Component)val).transform.localScale = Vector3.one * 1.3f; REPOConomyPlugin.Logger.LogInfo((object)("[GiantEnemies] " + ((Object)__instance).name + " enlarged to 1.3x")); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnemySize] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_InstantRespawn { private static void Postfix(EnemyParent __instance) { if (SemiFunc.RunIsLevel() && REPOEventManager.InstantRespawn) { float despawnedTimer = __instance.DespawnedTimer; __instance.DespawnedTimer = despawnedTimer * 0.5f; REPOConomyPlugin.Logger.LogInfo((object)$"[InstantRespawn] {__instance.enemyName}: DespawnedTimer {despawnedTimer:F2} -> {__instance.DespawnedTimer:F2} (-50%)"); } } } [HarmonyPatch(typeof(EnemyParent), "Spawn")] public static class Patch_PersistentEnemies { private static void Postfix(EnemyParent __instance) { if (SemiFunc.RunIsLevel() && REPOEventManager.PersistentEnemies) { __instance.SpawnedTimer = float.MaxValue; REPOConomyPlugin.Logger.LogInfo((object)("[PersistentEnemies] " + __instance.enemyName + ": SpawnedTimer set to infinity to prevent despawn")); } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_ExplosiveValuables_Setup { private static FieldInfo FI_DollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static Dictionary explosionParams = new Dictionary(); [HarmonyPostfix] [HarmonyPriority(0)] private static void Postfix(ValuableObject __instance) { if (REPOEventManager.ExplosiveValuables && SemiFunc.RunIsLevel()) { int instanceID = ((Object)__instance).GetInstanceID(); if (REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID)) { float num = (float)FI_DollarValueCurrent.GetValue(__instance); int num2 = 25 + Mathf.FloorToInt(num / 500f * 2.5f); float num3 = 0.5f + (float)Mathf.FloorToInt(num / 500f) * 0.025f; explosionParams[instanceID] = (num2, num3); REPOConomyPlugin.Logger.LogInfo((object)$"[ExplosiveValuables] Setup: valuable {instanceID}, value={num:F0}, damage={num2}, radius={num3:F2}"); } } } public static (int damage, float radius)? GetExplosionParams(int instanceId) { if (explosionParams.TryGetValue(instanceId, out (int, float) value)) { return value; } return null; } public static void Reset() { explosionParams.Clear(); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "DestroyObject")] public static class Patch_ExplosiveValuables_Explode { private static FieldInfo FI_ValuableObject = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "valuableObject"); private static FieldInfo FI_ExtractionPointCurrent = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent"); private static FieldInfo FI_ExtractionPointState = AccessTools.Field(typeof(ExtractionPoint), "currentState"); private static void Postfix(bool effects, PhysGrabObjectImpactDetector __instance) { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Expected O, but got Unknown //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Invalid comparison between Unknown and I4 //IL_016b: 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) if (!REPOEventManager.ExplosiveValuables || !SemiFunc.RunIsLevel() || !effects || !__instance.isValuable) { return; } ValuableObject val = (ValuableObject)FI_ValuableObject.GetValue(__instance); if ((Object)(object)val == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)"[ExplosiveValuables] ValuableObject is null"); return; } if ((Object)(object)RoundDirector.instance != (Object)null) { ExtractionPoint val2 = (ExtractionPoint)FI_ExtractionPointCurrent.GetValue(RoundDirector.instance); if ((Object)(object)val2 != (Object)null && (int)(State)FI_ExtractionPointState.GetValue(val2) == 6 && RoundDirector.instance.dollarHaulList.Contains(((Component)val).gameObject)) { REPOConomyPlugin.Logger.LogInfo((object)("[ExplosiveValuables] Skipping explosion for valuable being extracted: " + ((Object)((Component)val).gameObject).name)); return; } } int instanceID = ((Object)val).GetInstanceID(); (int, float)? explosionParams = Patch_ExplosiveValuables_Setup.GetExplosionParams(instanceID); if (!explosionParams.HasValue) { REPOConomyPlugin.Logger.LogWarning((object)$"[ExplosiveValuables] No explosion params for valuable {instanceID}"); return; } (int, float) value = explosionParams.Value; int item = value.Item1; float item2 = value.Item2; Vector3 position = ((Component)__instance).transform.position; if (SemiFunc.IsMultiplayer()) { PhotonView component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.RPC("ExplosiveValuableExplodeRPC", (RpcTarget)0, new object[3] { position, item2, item }); } else { REPOConomyPlugin.Logger.LogError((object)"[ExplosiveValuables] No PhotonView found!"); } } else { SpawnExplosion(position, item2, item); } } private static void SpawnExplosion(Vector3 pos, float radius, int damage) { //IL_0010: 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) try { ParticleScriptExplosion val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.Spawn(pos, radius, damage, damage, 1f, false, false, 1f); REPOConomyPlugin.Logger.LogInfo((object)$"[ExplosiveValuables] Spawned explosion at {pos}, damage={damage}, radius={radius:F2}"); } else { REPOConomyPlugin.Logger.LogWarning((object)"[ExplosiveValuables] No ParticleScriptExplosion found in scene"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExplosiveValuables] Spawn error: " + ex.Message)); } } public static void Reset() { } } [HarmonyPatch(typeof(ValuableObject), "Start")] public static class Patch_ValuableObject_AddExplosionRPC { private static void Postfix(ValuableObject __instance) { if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } } public class ValuableExplosionHelper : MonoBehaviourPunCallbacks { [PunRPC] public void ExplosiveValuableExplodeRPC(Vector3 pos, float radius, int damage) { //IL_0010: 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) try { ParticleScriptExplosion val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.Spawn(pos, radius, damage, damage, 1f, false, false, 1f); REPOConomyPlugin.Logger.LogInfo((object)$"[ExplosiveValuables] RPC explosion at {pos}"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExplosiveValuables] RPC error: " + ex.Message)); } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakRPC")] public static class Patch_ChainReaction { private static FieldInfo FI_ValuableObject = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "valuableObject"); private static FieldInfo FI_BreakForce = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "breakForce"); private static FieldInfo FI_Rb = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "rb"); private static FieldInfo FI_DollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static void Postfix(float valueLost, Vector3 _contactPoint, int breakLevel, bool _loseValue, PhysGrabObjectImpactDetector __instance) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown if (!REPOEventManager.ChainReaction || !SemiFunc.RunIsLevel() || !_loseValue || !__instance.isValuable) { return; } ValuableObject val = (ValuableObject)FI_ValuableObject.GetValue(__instance); if ((Object)(object)val == (Object)null || ((Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)val).gameObject))) { return; } Mathf.RoundToInt((float)FI_BreakForce.GetValue(__instance) * 0.1f); _ = 10; int num = Mathf.RoundToInt(valueLost * 0.25f); if (num < 1) { num = 1; } Collider[] array = Physics.OverlapSphere(((Component)__instance).transform.position, 5f); int num2 = 0; int num3 = 0; Collider[] array2 = array; foreach (Collider val2 in array2) { if ((Object)(object)val2 == (Object)null || (Object)(object)((Component)val2).gameObject == (Object)(object)((Component)__instance).gameObject) { continue; } PhysGrabObjectImpactDetector val3 = ((Component)val2).GetComponent(); if ((Object)(object)val3 == (Object)null) { val3 = ((Component)val2).GetComponentInParent(); } if ((Object)(object)val3 == (Object)null || !val3.isValuable || (Object)(object)val3 == (Object)(object)__instance) { continue; } num3++; ValuableObject val4 = (ValuableObject)FI_ValuableObject.GetValue(val3); if ((Object)(object)val4 == (Object)null || ((Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)val4).gameObject))) { continue; } PhysGrabObject component = ((Component)val3).GetComponent(); bool flag = (Object)(object)component != (Object)null && component.dead; if (!flag) { float num4 = (float)FI_DollarValueCurrent.GetValue(val4); if (num4 > (float)num) { FI_DollarValueCurrent.SetValue(val4, num4 - (float)num); num2++; } else { REPOConomyPlugin.Logger.LogInfo((object)$"[ChainReaction] Skipping valuable: isDead={flag}, currentValue={num4}, chainDamage={num}"); } } } } } [HarmonyPatch(typeof(PhysGrabObject), "GrabStarted")] public static class Patch_FakeValuables { private static HashSet fakeValuables = new HashSet(); private static bool fakeValuablesMarked = false; public static void Reset() { fakeValuables.Clear(); fakeValuablesMarked = false; } private static void Postfix(PhysGrabObject __instance, PhysGrabber player) { if (!REPOEventManager.FakeValuables || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } ValuableObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } if (!fakeValuablesMarked) { MarkFakeValuables(); fakeValuablesMarked = true; } if (fakeValuables.Contains(component)) { if (GameManager.instance.gameMode == 1) { PhotonNetwork.Destroy(((Component)__instance).gameObject); } else { Object.Destroy((Object)(object)((Component)__instance).gameObject); } REPOConomyPlugin.Logger.LogInfo((object)("[FakeValuables] Destroyed fake valuable: " + ((Object)((Component)__instance).gameObject).name)); } } private static void MarkFakeValuables() { fakeValuables.Clear(); ValuableObject[] array = Object.FindObjectsOfType(false); if (array.Length == 0) { return; } int num = Mathf.RoundToInt((float)array.Length * 0.15f); if (num < 1 && array.Length != 0) { num = 1; } Random random = new Random(); List list = new List(array); for (int i = 0; i < num; i++) { if (list.Count <= 0) { break; } int index = random.Next(list.Count); ValuableObject item = list[index]; fakeValuables.Add(item); list.RemoveAt(index); } REPOConomyPlugin.Logger.LogInfo((object)$"[FakeValuables] Marked {fakeValuables.Count} out of {array.Length} valuables as fake"); } } [HarmonyPatch(typeof(GameDirector), "Update")] public static class Patch_ValueDecay { private static FieldInfo FI_DollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float timeSinceLastDecay = 0f; private static readonly float DECAY_INTERVAL = 15f; private static readonly float DECAY_RATE = 0.001f; public static void Reset() { timeSinceLastDecay = 0f; } private static void Postfix() { if (!REPOEventManager.ValueDecay || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timeSinceLastDecay += Time.deltaTime; if (!(timeSinceLastDecay >= DECAY_INTERVAL)) { return; } timeSinceLastDecay = 0f; if ((Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } int num = 0; foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null || ((Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)valuable).gameObject))) { continue; } float num2 = (float)FI_DollarValueCurrent.GetValue(valuable); if (!(num2 <= 1f)) { float num3 = Mathf.Max(1f, num2 * (1f - DECAY_RATE)); if (!Mathf.Approximately(num3, num2)) { FI_DollarValueCurrent.SetValue(valuable, num3); num++; } } } if (num > 0) { REPOConomyPlugin.Logger.LogInfo((object)$"[ValueDecay] Reduced value of {num} valuables by 0.1%"); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_EnemyHealOnDamage { private static readonly FieldInfo FI_Enemy_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static readonly FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static readonly FieldInfo FI_EnemyHealth_HealthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static readonly FieldInfo FI_EnemyHealth_Health = AccessTools.Field(typeof(EnemyHealth), "health"); public static void Reset() { } private static void Postfix(int damage, bool savingGrace, int enemyIndex, PlayerHealth __instance) { //IL_0040: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Expected O, but got Unknown if (!REPOEventManager.EnemyHealOnDamage || !SemiFunc.RunIsLevel() || damage <= 0) { return; } Enemy[] array = Object.FindObjectsOfType(false); float num = float.MaxValue; Enemy val = null; Enemy[] array2 = array; foreach (Enemy val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { float num2 = Vector3.Distance(((Component)__instance).transform.position, ((Component)val2).transform.position); if (num2 < num && num2 < 20f) { num = num2; val = val2; } } } if ((Object)(object)val == (Object)null || !(bool)FI_Enemy_HasHealth.GetValue(val)) { return; } EnemyHealth val3 = (EnemyHealth)FI_Enemy_Health.GetValue(val); if ((Object)(object)val3 == (Object)null) { return; } int num3 = (int)FI_EnemyHealth_HealthCurrent.GetValue(val3); int num4 = (int)FI_EnemyHealth_Health.GetValue(val3); if (num3 < num4) { int num5 = damage; if (num3 + num5 > num4) { num5 = num4 - num3; } if (num5 > 0) { REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyHealOnDamage] Healing enemy for {num5} HP (current health: {num3}/{num4})"); val3.Heal(num5); REPOConomyPlugin.Logger.LogInfo((object)"[EnemyHealOnDamage] Enemy healed successfully"); } } } } [HarmonyPatch(typeof(LevelGenerator), "GenerateDone")] public static class Patch_SpawnGrenadeAboveTruck { private static void Postfix() { //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_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_005d: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) if ((!REPOEventManager.ExplosiveValuables && !REPOEventManager.ExplosiveTumble && !REPOEventManager.KamikazeEnemies && !REPOEventManager.ExplosiveThrowValuables) || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } try { TruckScreenText instance = TruckScreenText.instance; if ((Object)(object)instance != (Object)null) { Vector3 val = ((Component)instance).transform.position + Vector3.up * 1000f; if (GameManager.instance.gameMode == 0) { GameObject val2 = Resources.Load("Items/Item Grenade Explosive"); if ((Object)(object)val2 != (Object)null) { Object.Instantiate(val2, val, Quaternion.identity); } else { REPOConomyPlugin.Logger.LogWarning((object)"[SpawnGrenade] Grenade prefab not found in Resources"); } } else { PhotonNetwork.InstantiateRoomObject("Items/Item Grenade Explosive", val, Quaternion.identity, (byte)0, (object[])null); } } else { REPOConomyPlugin.Logger.LogWarning((object)"[SpawnGrenade] TruckScreenText.instance is null"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SpawnGrenade] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(AudioListenerFollow))] public static class Patch_PlayerDeaf { [HarmonyPatch("Update")] [HarmonyPostfix] private static void Update_Postfix() { if (REPOEventManager.PlayerDeaf && SemiFunc.RunIsLevel()) { AudioListener.volume = 0f; } else { AudioListener.volume = 1f; } } } [HarmonyPatch(typeof(Enemy), "Start")] public static class Patch_EnemyWeightModifiers { private static Dictionary originalGrabForces = new Dictionary(); private static Dictionary originalMasses = new Dictionary(); private static FieldInfo FI_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_HasRigidbody = AccessTools.Field(typeof(Enemy), "HasRigidbody"); public static void Reset() { foreach (KeyValuePair originalGrabForce in originalGrabForces) { originalGrabForce.Key.amount = originalGrabForce.Value; } originalGrabForces.Clear(); foreach (KeyValuePair originalMass in originalMasses) { if ((Object)(object)originalMass.Key != (Object)null && (Object)(object)originalMass.Key.rb != (Object)null) { originalMass.Key.massOriginal = originalMass.Value; originalMass.Key.rb.mass = originalMass.Value; } } originalMasses.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[Enemy] Reset"); } private static void Postfix(Enemy __instance) { if (!SemiFunc.RunIsLevel()) { return; } try { if (!(bool)FI_HasRigidbody.GetValue(__instance)) { return; } object? value = FI_Rigidbody.GetValue(__instance); MonoBehaviour val = (MonoBehaviour)((value is MonoBehaviour) ? value : null); if ((Object)(object)val == (Object)null) { return; } FieldInfo fieldInfo = AccessTools.Field(((object)val).GetType(), "grabForceNeeded"); if (fieldInfo == null) { return; } object? value2 = fieldInfo.GetValue(val); GrabForce val2 = (GrabForce)((value2 is GrabForce) ? value2 : null); if (!((Object)(object)val2 == (Object)null)) { if (!originalGrabForces.ContainsKey(val2)) { originalGrabForces[val2] = val2.amount; } float num = originalGrabForces[val2]; if (REPOEventManager.EnemyHeavyWeight) { float num2 = (val2.amount = num * 2f); ApplyPhysGrabMass(val, 2f); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyHeavyWeight] {((Object)__instance).name}: mass {num:F2} -> {num2:F2}"); } else if (REPOEventManager.EnemyLightWeight) { float num3 = (val2.amount = num * 0.5f); ApplyPhysGrabMass(val, 0.5f); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyLightWeight] {((Object)__instance).name}: mass {num:F2} -> {num3:F2}"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnemyWeightModifiers] Error: " + ex.Message)); } } private static void ApplyPhysGrabMass(MonoBehaviour enemyRigidbody, float multiplier) { PhysGrabObject component = ((Component)enemyRigidbody).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)component.rb == (Object)null)) { if (!originalMasses.ContainsKey(component)) { originalMasses[component] = ((component.massOriginal > 0f) ? component.massOriginal : component.rb.mass); } float num = (component.massOriginal = originalMasses[component] * multiplier); component.rb.mass = num; component.OverrideMass(num, 0.1f); } } } [HarmonyPatch(typeof(EnemyDirector), "GetEnemy")] public static class Patch_BossRush { private static void Postfix(ref EnemySetup __result, EnemyDirector __instance) { if (REPOEventManager.HasEvent("boss_rush")) { List enemiesDifficulty = __instance.enemiesDifficulty3; if (enemiesDifficulty != null && enemiesDifficulty.Count > 0) { __result = enemiesDifficulty[Random.Range(0, enemiesDifficulty.Count)]; REPOConomyPlugin.Logger.LogInfo((object)("[BossRush] Forced boss: " + ((Object)__result).name)); } } } } [HarmonyPatch(typeof(LevelGenerator), "Generate")] public static class Patch_FastSpawn { [CompilerGenerated] private sealed class d__1 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__1(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; if (!REPOEventManager.HasEvent("fast_spawn") || !((Object)(object)EnemyDirector.instance != (Object)null)) { break; } try { if ((float)FI_spawnIdlePauseTimer.GetValue(EnemyDirector.instance) > 0f) { FI_spawnIdlePauseTimer.SetValue(EnemyDirector.instance, 0f); REPOConomyPlugin.Logger.LogInfo((object)"[FastSpawn] Forced instant spawn"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FastSpawn] Error: " + ex.Message)); } break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FieldInfo FI_spawnIdlePauseTimer = AccessTools.Field(typeof(EnemyDirector), "spawnIdlePauseTimer"); [IteratorStateMachine(typeof(d__1))] private static IEnumerator Postfix(IEnumerator original, LevelGenerator __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__1(0) { original = original }; } } public static class ReflectionH { private static FieldInfo _jumpExtraField; private static FieldInfo _maxHealthField; private static FieldInfo _healthField; private static FieldInfo _playerOriginalSprintSpeedField; private static FieldInfo _upgradeTumbleClimbField; private static FieldInfo _upgradeDeathHeadBatteryField; private static FieldInfo _upgradeCrouchRestField; private static FieldInfo _upgradeTumbleWingsField; public static int GetJumpExtra(PlayerController controller) { if (_jumpExtraField == null) { _jumpExtraField = typeof(PlayerController).GetField("JumpExtra", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)_jumpExtraField?.GetValue(controller); } public static void SetJumpExtra(PlayerController controller, int value) { if (_jumpExtraField == null) { _jumpExtraField = typeof(PlayerController).GetField("JumpExtra", BindingFlags.Instance | BindingFlags.NonPublic); } _jumpExtraField?.SetValue(controller, value); } public static int GetMaxHealth(PlayerHealth playerHealth) { if (_maxHealthField == null) { _maxHealthField = typeof(PlayerHealth).GetField("maxHealth", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)_maxHealthField?.GetValue(playerHealth); } public static void SetMaxHealth(PlayerHealth playerHealth, int value) { if (_maxHealthField == null) { _maxHealthField = typeof(PlayerHealth).GetField("maxHealth", BindingFlags.Instance | BindingFlags.NonPublic); } _maxHealthField?.SetValue(playerHealth, value); } public static int GetHealth(PlayerHealth playerHealth) { if (_healthField == null) { _healthField = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)(_healthField?.GetValue(playerHealth) ?? ((object)0)); } public static void SetHealth(PlayerHealth playerHealth, int value) { if (_healthField == null) { _healthField = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); } _healthField?.SetValue(playerHealth, value); } public static float GetPlayerOriginalSprintSpeed(PlayerController controller) { if (_playerOriginalSprintSpeedField == null) { _playerOriginalSprintSpeedField = typeof(PlayerController).GetField("playerOriginalSprintSpeed", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_playerOriginalSprintSpeedField?.GetValue(controller); } public static void SetPlayerOriginalSprintSpeed(PlayerController controller, float value) { if (_playerOriginalSprintSpeedField == null) { _playerOriginalSprintSpeedField = typeof(PlayerController).GetField("playerOriginalSprintSpeed", BindingFlags.Instance | BindingFlags.NonPublic); } _playerOriginalSprintSpeedField?.SetValue(controller, value); } public static float GetUpgradeTumbleClimb(PlayerAvatar avatar) { if (_upgradeTumbleClimbField == null) { _upgradeTumbleClimbField = typeof(PlayerAvatar).GetField("upgradeTumbleClimb", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeTumbleClimbField?.GetValue(avatar); } public static void SetUpgradeTumbleClimb(PlayerAvatar avatar, float value) { if (_upgradeTumbleClimbField == null) { _upgradeTumbleClimbField = typeof(PlayerAvatar).GetField("upgradeTumbleClimb", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeTumbleClimbField?.SetValue(avatar, value); } public static float GetUpgradeDeathHeadBattery(PlayerAvatar avatar) { if (_upgradeDeathHeadBatteryField == null) { _upgradeDeathHeadBatteryField = typeof(PlayerAvatar).GetField("upgradeDeathHeadBattery", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeDeathHeadBatteryField?.GetValue(avatar); } public static void SetUpgradeDeathHeadBattery(PlayerAvatar avatar, float value) { if (_upgradeDeathHeadBatteryField == null) { _upgradeDeathHeadBatteryField = typeof(PlayerAvatar).GetField("upgradeDeathHeadBattery", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeDeathHeadBatteryField?.SetValue(avatar, value); } public static float GetUpgradeCrouchRest(PlayerAvatar avatar) { if (_upgradeCrouchRestField == null) { _upgradeCrouchRestField = typeof(PlayerAvatar).GetField("upgradeCrouchRest", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeCrouchRestField?.GetValue(avatar); } public static void SetUpgradeCrouchRest(PlayerAvatar avatar, float value) { if (_upgradeCrouchRestField == null) { _upgradeCrouchRestField = typeof(PlayerAvatar).GetField("upgradeCrouchRest", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeCrouchRestField?.SetValue(avatar, value); } public static float GetUpgradeTumbleWings(PlayerAvatar avatar) { if (_upgradeTumbleWingsField == null) { _upgradeTumbleWingsField = typeof(PlayerAvatar).GetField("upgradeTumbleWings", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeTumbleWingsField?.GetValue(avatar); } public static void SetUpgradeTumbleWings(PlayerAvatar avatar, float value) { if (_upgradeTumbleWingsField == null) { _upgradeTumbleWingsField = typeof(PlayerAvatar).GetField("upgradeTumbleWings", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeTumbleWingsField?.SetValue(avatar, value); } } [HarmonyPatch(typeof(PlayerAvatar), "LateStart")] public class PlayerAvatarPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PlayerAvatar __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } string text = SemiFunc.PlayerGetSteamID(__instance); if (text != null) { if (StatsManager.instance.playerUpgradeTumbleClimb.ContainsKey(text)) { float num = StatsManager.instance.playerUpgradeTumbleClimb[text]; float num2 = num * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); Debug.Log((object)$"[REPOConomyPlus] Tumble Climb for {text}: original value {num}, modified value {num2} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); ReflectionH.SetUpgradeTumbleClimb(__instance, num2); } if (StatsManager.instance.playerUpgradeTumbleWings.ContainsKey(text)) { float num3 = StatsManager.instance.playerUpgradeTumbleWings[text]; float num4 = num3 * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); Debug.Log((object)$"[REPOConomyPlus] Tumble Wings for {text}: original value {num3}, modified value {num4} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); ReflectionH.SetUpgradeTumbleWings(__instance, num4); } if (StatsManager.instance.playerUpgradeDeathHeadBattery.ContainsKey(text)) { float num5 = StatsManager.instance.playerUpgradeDeathHeadBattery[text]; float num6 = num5 * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); Debug.Log((object)$"[REPOConomyPlus] Death Head Battery for {text}: original value {num5}, modified value {num6} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); ReflectionH.SetUpgradeDeathHeadBattery(__instance, num6); } if (StatsManager.instance.playerUpgradeCrouchRest.ContainsKey(text)) { float num7 = StatsManager.instance.playerUpgradeCrouchRest[text]; float num8 = num7 * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); Debug.Log((object)$"[REPOConomyPlus] Crouch Rest for {text}: original value {num7}, modified value {num8} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); ReflectionH.SetUpgradeCrouchRest(__instance, num8); } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PlayerAvatar __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerController), "LateStart")] public class StaminaPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PlayerController __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } string text = SemiFunc.PlayerGetSteamID(__instance.playerAvatarScript); if (StatsManager.instance.playerUpgradeStamina.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeStamina[text]; float num2 = (float)num * 10f; float num3 = (float)num * 10f * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); float num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Stamina for {text}: original bonus +{num2} energy, modified bonus +{num3} energy (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PlayerController _instance = __instance; _instance.EnergyStart += num4; __instance.EnergyCurrent = __instance.EnergyStart; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PlayerController __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerController), "LateStart")] public class SpeedPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PlayerController __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } string text = SemiFunc.PlayerGetSteamID(__instance.playerAvatarScript); if (StatsManager.instance.playerUpgradeSpeed.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeSpeed[text]; float num2 = (float)num * 1f; float num3 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Speed for {text}: original bonus +{num2} speed, modified bonus +{num3} speed (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PlayerController _instance = __instance; _instance.SprintSpeed += num4; PlayerController _instance2 = __instance; _instance2.SprintSpeedUpgrades += num4; float playerOriginalSprintSpeed = ReflectionH.GetPlayerOriginalSprintSpeed(__instance); ReflectionH.SetPlayerOriginalSprintSpeed(__instance, playerOriginalSprintSpeed + num4); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PlayerController __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerController), "LateStart")] public class ExtraJumpLateStartPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PlayerController __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } string text = SemiFunc.PlayerGetSteamID(__instance.playerAvatarScript); if (StatsManager.instance.playerUpgradeExtraJump.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeExtraJump[text]; int num2 = num; int num3 = Mathf.FloorToInt((float)num * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f)); int num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Extra Jump for {text}: upgrade level {num}, original bonus +{num2} jumps, modified bonus +{num3} jumps, difference {num4} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); int jumpExtra = ReflectionH.GetJumpExtra(__instance); ReflectionH.SetJumpExtra(__instance, jumpExtra + num4); } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PlayerController __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerController), "Start")] public static class Patch_PlayerController_Start { [CompilerGenerated] private sealed class d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; if ((Object)(object)controller != (Object)(object)PlayerController.instance) { return false; } REPOConomyPlugin.Logger.LogInfo((object)"[EventModifiers] Applying modifiers..."); ApplySpeedModifier(controller); ApplyGravityModifier(controller); ApplyEnvStats(controller); if (REPOEventManager.HasEvent("clumsy")) { ((MonoBehaviour)controller).StartCoroutine(ClumsyCoroutine(controller)); } if (REPOEventManager.RandomBoosts) { ((MonoBehaviour)controller).StartCoroutine(RandomBoostsCoroutine(controller)); } StartOrRestartStatusCoroutines(controller, forceRestart: false); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__11 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__11(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!REPOEventManager.HasEvent("clumsy") || !SemiFunc.RunIsLevel()) { goto IL_00e7; } try { PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(controller.playerAvatarScript); if (Object.op_Implicit((Object)(object)controller.playerAvatarScript) && Object.op_Implicit((Object)(object)playerTumble) && !(bool)FI_isTumbling.GetValue(playerTumble)) { REPOConomyPlugin.Logger.LogInfo((object)"[Clumsy] Triggering tumble!"); playerTumble.TumbleRequest(true, false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Clumsy] Error: " + ex.Message)); } } else { <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[Clumsy] Started coroutine"); } if (REPOEventManager.HasEvent("clumsy")) { <>2__current = (object)new WaitForSeconds(30f); <>1__state = 1; return true; } goto IL_00e7; IL_00e7: REPOConomyPlugin.Logger.LogInfo((object)"[Clumsy] Ended coroutine"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__15 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private FieldInfo 5__2; private FieldInfo 5__3; private FieldInfo 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__15(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!REPOEventManager.HealthRegeneration) { goto IL_01d8; } if (SemiFunc.RunIsLevel()) { try { if (!((Object)(object)GameDirector.instance == (Object)null) && GameDirector.instance.PlayerList != null) { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null) && !(bool)5__2.GetValue(player)) { int num2 = (int)5__3.GetValue(player.playerHealth); int num3 = (int)5__4.GetValue(player.playerHealth); if (num2 < num3) { 5__3.SetValue(player.playerHealth, num2 + 1); REPOConomyPlugin.Logger.LogInfo((object)$"[HealthRegeneration] Regenerated {((Object)player).name}: {num2} -> {num2 + 1}"); } } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HealthRegeneration] Error: " + ex.Message)); } } } else { <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[HealthRegeneration] Started coroutine"); 5__2 = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); 5__3 = AccessTools.Field(typeof(PlayerHealth), "health"); 5__4 = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); } if (REPOEventManager.HealthRegeneration) { <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; } goto IL_01d8; IL_01d8: healthRegenerationCoroutine = null; REPOConomyPlugin.Logger.LogInfo((object)"[HealthRegeneration] Ended coroutine"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__12 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__12(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!REPOEventManager.RandomBoosts || !SemiFunc.RunIsLevel()) { goto IL_016a; } try { int num2 = Random.Range(0, 3); float delay = 30f; switch (num2) { case 0: { PlayerController obj2 = controller; obj2.MoveSpeed *= 1.5f; PlayerController obj3 = controller; obj3.SprintSpeed *= 1.5f; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Speed boost applied"); ((MonoBehaviour)controller).StartCoroutine(RemoveSpeedBoost(controller, delay)); break; } case 1: { PlayerController obj = controller; obj.JumpForce *= 1.5f; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Jump boost applied"); ((MonoBehaviour)controller).StartCoroutine(RemoveJumpBoost(controller, delay)); break; } case 2: controller.EnergyCurrent = controller.EnergyStart; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Stamina restored"); break; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RandomBoosts] Error: " + ex.Message)); } } else { <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Started coroutine"); } if (REPOEventManager.RandomBoosts) { <>2__current = (object)new WaitForSeconds(120f); <>1__state = 1; return true; } goto IL_016a; IL_016a: REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Ended coroutine"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__14 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__14(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; PlayerController obj = controller; obj.JumpForce /= 1.5f; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Jump boost removed"); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__13 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(delay); <>1__state = 1; return true; case 1: { <>1__state = -1; PlayerController obj = controller; obj.MoveSpeed /= 1.5f; PlayerController obj2 = controller; obj2.SprintSpeed /= 1.5f; REPOConomyPlugin.Logger.LogInfo((object)"[RandomBoosts] Speed boost removed"); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__6 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerController controller; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__6(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; case 2: <>1__state = -1; if ((Object)(object)controller == (Object)null || (Object)(object)controller != (Object)(object)PlayerController.instance) { return false; } StartOrRestartStatusCoroutines(controller, forceRestart: true); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__16 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; private FieldInfo 5__2; private FieldInfo 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__16(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__3 = null; <>1__state = -2; } private bool MoveNext() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!REPOEventManager.ToxicAir) { goto IL_019a; } if (SemiFunc.RunIsLevel()) { try { if (!((Object)(object)GameDirector.instance == (Object)null) && GameDirector.instance.PlayerList != null) { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)player.playerHealth) && !(bool)5__2.GetValue(player)) { int num2 = (int)5__3.GetValue(player.playerHealth); if (num2 > 1) { 5__3.SetValue(player.playerHealth, num2 - 1); REPOConomyPlugin.Logger.LogInfo((object)$"[ToxicAir] Damaged {((Object)player).name}: {num2} -> {num2 - 1}"); } } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ToxicAir] Error: " + ex.Message)); } } } else { <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[ToxicAir] Started coroutine"); 5__2 = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); 5__3 = AccessTools.Field(typeof(PlayerHealth), "health"); } if (REPOEventManager.ToxicAir) { <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; } goto IL_019a; IL_019a: toxicAirCoroutine = null; REPOConomyPlugin.Logger.LogInfo((object)"[ToxicAir] Ended coroutine"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static FieldInfo FI_isTumbling = AccessTools.Field(typeof(PlayerTumble), "isTumbling"); private static Coroutine healthRegenerationCoroutine; private static Coroutine toxicAirCoroutine; private static void Postfix(PlayerController __instance) { if (!((Object)(object)__instance != (Object)(object)PlayerController.instance)) { ((MonoBehaviour)__instance).StartCoroutine(ApplyModifiersDelayed(__instance)); } } [IteratorStateMachine(typeof(d__5))] private static IEnumerator ApplyModifiersDelayed(PlayerController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { controller = controller }; } [IteratorStateMachine(typeof(d__6))] public static IEnumerator RestartStatusCoroutinesAfterRevive(PlayerController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__6(0) { controller = controller }; } private static void StartOrRestartStatusCoroutines(PlayerController controller, bool forceRestart) { if ((Object)(object)controller == (Object)null) { return; } if (forceRestart) { if (healthRegenerationCoroutine != null) { try { ((MonoBehaviour)controller).StopCoroutine(healthRegenerationCoroutine); } catch { } healthRegenerationCoroutine = null; } if (toxicAirCoroutine != null) { try { ((MonoBehaviour)controller).StopCoroutine(toxicAirCoroutine); } catch { } toxicAirCoroutine = null; } } if (REPOEventManager.HealthRegeneration && healthRegenerationCoroutine == null) { healthRegenerationCoroutine = ((MonoBehaviour)controller).StartCoroutine(HealthRegenerationCoroutine()); } if (REPOEventManager.ToxicAir && toxicAirCoroutine == null) { toxicAirCoroutine = ((MonoBehaviour)controller).StartCoroutine(ToxicAirCoroutine()); } } private static void ApplyEnvStats(PlayerController controller) { if (!SemiFunc.RunIsLevel()) { return; } try { if (REPOEventManager.LongReach && (Object)(object)PhysGrabber.instance != (Object)null) { PhysGrabber instance = PhysGrabber.instance; instance.grabRange *= 2f; PhysGrabber instance2 = PhysGrabber.instance; instance2.grabStrength *= 1.5f; } if (REPOEventManager.BigLungs) { controller.EnergyStart *= 2f; controller.EnergyCurrent = controller.EnergyStart; } if (REPOEventManager.Tailwind) { controller.MoveSpeed *= 1.25f; controller.SprintSpeed *= 1.25f; controller.CrouchSpeed *= 1.25f; } if (REPOEventManager.SpringyLegs) { controller.JumpForce *= 1.4f; } if (REPOEventManager.NinjaCrouch) { controller.CrouchSpeed *= 2.2f; } if (REPOEventManager.EnergizedAtmosphere) { FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerController), "sprintRechargeAmount"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(PlayerController), "sprintRechargeTime"); fieldInfo.SetValue(controller, (float)fieldInfo.GetValue(controller) * 3f); fieldInfo2.SetValue(controller, (float)fieldInfo2.GetValue(controller) * 0.2f); } if (REPOEventManager.ExhaustingAir) { FieldInfo fieldInfo3 = AccessTools.Field(typeof(PlayerController), "sprintRechargeAmount"); FieldInfo fieldInfo4 = AccessTools.Field(typeof(PlayerController), "sprintRechargeTime"); controller.EnergySprintDrain *= 1.6f; fieldInfo3.SetValue(controller, (float)fieldInfo3.GetValue(controller) * 0.4f); fieldInfo4.SetValue(controller, (float)fieldInfo4.GetValue(controller) * 2f); } if (REPOEventManager.StuffyAir) { FieldInfo fieldInfo5 = AccessTools.Field(typeof(PlayerController), "sprintRechargeAmount"); FieldInfo fieldInfo6 = AccessTools.Field(typeof(PlayerController), "sprintRechargeTime"); fieldInfo5.SetValue(controller, (float)fieldInfo5.GetValue(controller) * 0.6f); fieldInfo6.SetValue(controller, (float)fieldInfo6.GetValue(controller) * 1.5f); } if (REPOEventManager.FreshAir) { FieldInfo fieldInfo7 = AccessTools.Field(typeof(PlayerController), "sprintRechargeAmount"); FieldInfo fieldInfo8 = AccessTools.Field(typeof(PlayerController), "sprintRechargeTime"); fieldInfo7.SetValue(controller, (float)fieldInfo7.GetValue(controller) * 1.5f); fieldInfo8.SetValue(controller, (float)fieldInfo8.GetValue(controller) * 0.7f); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnvStats] " + ex.Message)); } } private static void ApplySpeedModifier(PlayerController controller) { if (REPOEventManager.PlayerSpeedMultiplier == 1f || !SemiFunc.RunIsLevel()) { return; } try { float playerSpeedMultiplier = REPOEventManager.PlayerSpeedMultiplier; controller.MoveSpeed *= playerSpeedMultiplier; controller.SprintSpeed *= playerSpeedMultiplier; controller.CrouchSpeed *= playerSpeedMultiplier; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSpeed] Applied x{playerSpeedMultiplier}: Move={controller.MoveSpeed:F2}, Sprint={controller.SprintSpeed:F2}, Crouch={controller.CrouchSpeed:F2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PlayerSpeed] Error: " + ex.Message)); } } private static void ApplyGravityModifier(PlayerController controller) { if (!SemiFunc.RunIsLevel()) { return; } try { if (REPOEventManager.HasEvent("low_gravity")) { controller.CustomGravity = 10f; controller.JumpForce = 30f; REPOConomyPlugin.Logger.LogInfo((object)"[Gravity] Low gravity applied"); } else if (REPOEventManager.HasEvent("heavy_gravity")) { controller.CustomGravity = 40f; controller.JumpForce = 10f; REPOConomyPlugin.Logger.LogInfo((object)"[Gravity] Heavy gravity applied"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Gravity] Error: " + ex.Message)); } } [IteratorStateMachine(typeof(d__11))] private static IEnumerator ClumsyCoroutine(PlayerController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__11(0) { controller = controller }; } [IteratorStateMachine(typeof(d__12))] private static IEnumerator RandomBoostsCoroutine(PlayerController controller) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__12(0) { controller = controller }; } [IteratorStateMachine(typeof(d__13))] private static IEnumerator RemoveSpeedBoost(PlayerController controller, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { controller = controller, delay = delay }; } [IteratorStateMachine(typeof(d__14))] private static IEnumerator RemoveJumpBoost(PlayerController controller, float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__14(0) { controller = controller, delay = delay }; } [IteratorStateMachine(typeof(d__15))] private static IEnumerator HealthRegenerationCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__15(0); } [IteratorStateMachine(typeof(d__16))] private static IEnumerator ToxicAirCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__16(0); } } [HarmonyPatch(typeof(PlayerAvatar), "ReviveRPC")] public static class Patch_PlayerAvatar_Revive_RestartStatusCoroutines { private static readonly FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); [HarmonyPostfix] private static void Postfix(PlayerAvatar __instance) { try { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)PlayerController.instance == (Object)null) && (bool)(FI_isLocal?.GetValue(__instance) ?? ((object)false))) { ((MonoBehaviour)PlayerController.instance).StartCoroutine(Patch_PlayerController_Start.RestartStatusCoroutinesAfterRevive(PlayerController.instance)); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EventModifiers] Revive restart error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public static class Patch_SlipperyFloor_Movement { private static FieldInfo FI_VelocityRelative = AccessTools.Field(typeof(PlayerController), "VelocityRelative"); private static FieldInfo FI_VelocityRelativeNew = AccessTools.Field(typeof(PlayerController), "VelocityRelativeNew"); private static FieldInfo FI_MoveFriction = AccessTools.Field(typeof(PlayerController), "MoveFriction"); private static void Prefix(PlayerController __instance) { if (!REPOEventManager.HasEvent("slippery_floor") || !SemiFunc.RunIsLevel()) { return; } try { _ = __instance.MoveFriction; __instance.MoveFriction = 2.5f; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SlipperyFloor] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Fetch")] public class PlayerHealthPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PlayerHealth __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } PlayerAvatar component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { string text = SemiFunc.PlayerGetSteamID(component); if (StatsManager.instance.playerUpgradeHealth.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeHealth[text]; int num2 = num * 20; int num3 = Mathf.RoundToInt((float)(num * 20) * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f)); int num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Health for {text}: original bonus +{num2} HP, modified bonus +{num3} HP (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); int maxHealth = ReflectionH.GetMaxHealth(__instance); ReflectionH.SetMaxHealth(__instance, maxHealth + num4); if (ReflectionH.GetHealth(__instance) > maxHealth + num4) { ReflectionH.SetHealth(__instance, maxHealth + num4); } } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PlayerHealth __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerHealth), "Awake")] public static class Patch_PlayerHealth { [CompilerGenerated] private sealed class d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerHealth healthInstance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; goto IL_0044; case 1: <>1__state = -1; goto IL_0044; case 2: { <>1__state = -1; object? value = FI_playerAvatar.GetValue(healthInstance); PlayerAvatar val = (PlayerAvatar)((value is PlayerAvatar) ? value : null); if ((Object)(object)val == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)"[HealthModifiers] PlayerAvatar is null!"); return false; } if (!(bool)FI_isLocal.GetValue(val)) { REPOConomyPlugin.Logger.LogInfo((object)"[HealthModifiers] Not local player, skipping"); return false; } try { if (!SemiFunc.RunIsLevel()) { REPOConomyPlugin.Logger.LogInfo((object)"[HealthModifiers] Not on level, skipping"); return false; } int num = (int)FI_health.GetValue(healthInstance); int num2 = (int)FI_maxHealth.GetValue(healthInstance); REPOConomyPlugin.Logger.LogInfo((object)$"[HealthModifiers] Current state: {num}/{num2}"); if (REPOEventManager.HasEvent("glass_cannon")) { FI_maxHealth.SetValue(healthInstance, 1); FI_health.SetValue(healthInstance, 1); REPOConomyPlugin.Logger.LogInfo((object)$"[GlassCannon] Set health to 1/1 (was {num}/{num2})"); } else if (REPOEventManager.HasEvent("tank_mode")) { int num3 = num2 + 100; int num4 = Mathf.Min(num + 100, num3); FI_maxHealth.SetValue(healthInstance, num3); FI_health.SetValue(healthInstance, num4); REPOConomyPlugin.Logger.LogInfo((object)$"[TankMode] Successfully applied! {num}/{num2} -> {num4}/{num3}"); } if (REPOEventManager.GlassRunner) { int num5 = (int)FI_maxHealth.GetValue(healthInstance); int num6 = (int)FI_health.GetValue(healthInstance); int num7 = Mathf.Max(10, num5 - 50); FI_maxHealth.SetValue(healthInstance, num7); FI_health.SetValue(healthInstance, Mathf.Min(num6, num7)); REPOConomyPlugin.Logger.LogInfo((object)$"[GlassRunner] -50 max HP: {num5} -> {num7}"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HealthModifiers] Error: " + ex.Message + "\n" + ex.StackTrace)); } return false; } IL_0044: if (!LevelGenerator.Instance.Generated) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 1; return true; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 2; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FieldInfo FI_playerAvatar = AccessTools.Field(typeof(PlayerHealth), "playerAvatar"); private static FieldInfo FI_maxHealth = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); private static FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Postfix(PlayerHealth __instance) { ((MonoBehaviour)__instance).StartCoroutine(ApplyHealthModifiersDelayed(__instance)); } [IteratorStateMachine(typeof(d__5))] private static IEnumerator ApplyHealthModifiersDelayed(PlayerHealth healthInstance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { healthInstance = healthInstance }; } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_InfiniteStamina { private static void Postfix(PlayerController __instance) { if (!((Object)(object)__instance != (Object)(object)PlayerController.instance) && REPOEventManager.HasEvent("infinite_stamina") && SemiFunc.RunIsLevel()) { __instance.EnergyCurrent = __instance.EnergyStart; } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Start")] public static class Patch_InvisiblePlayers_Start { private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Postfix(PlayerAvatarVisuals __instance) { if (!REPOEventManager.PlayersInvisible) { return; } try { if (Object.op_Implicit((Object)(object)__instance.playerAvatar) && !(bool)FI_isLocal.GetValue(__instance.playerAvatar) && Object.op_Implicit((Object)(object)__instance.meshParent)) { __instance.meshParent.SetActive(false); REPOConomyPlugin.Logger.LogInfo((object)"[InvisiblePlayers] Hidden player on Start"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisiblePlayers] Start Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Update")] public static class Patch_InvisiblePlayers { private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Postfix(PlayerAvatarVisuals __instance) { if (!REPOEventManager.PlayersInvisible || !SemiFunc.RunIsLevel()) { return; } try { if (__instance.isMenuAvatar || !Object.op_Implicit((Object)(object)__instance.playerAvatar) || (bool)FI_isLocal.GetValue(__instance.playerAvatar)) { return; } if (Object.op_Implicit((Object)(object)__instance.meshParent) && __instance.meshParent.activeSelf) { __instance.meshParent.SetActive(false); } Renderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if (!Object.op_Implicit((Object)(object)((Component)val).GetComponent())) { val.enabled = false; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisiblePlayers] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerAvatarVisuals), "Revive")] public static class Patch_InvisiblePlayers_BlockRevive { private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Postfix(PlayerAvatarVisuals __instance) { if (!REPOEventManager.PlayersInvisible) { return; } try { if (Object.op_Implicit((Object)(object)__instance.playerAvatar) && !(bool)FI_isLocal.GetValue(__instance.playerAvatar) && Object.op_Implicit((Object)(object)__instance.meshParent)) { __instance.meshParent.SetActive(false); REPOConomyPlugin.Logger.LogInfo((object)"[InvisiblePlayers] Kept player hidden after Revive"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisiblePlayers] Revive Error: " + ex.Message)); } } } [HarmonyPatch(typeof(FlashlightController), "Update")] public static class Patch_FlashlightFail { private static FieldInfo FI_spotlight = AccessTools.Field(typeof(FlashlightController), "spotlight"); private static void Postfix(FlashlightController __instance) { if (REPOEventManager.HasEvent("flashlight_fail") && SemiFunc.RunIsLevel()) { object? value = FI_spotlight.GetValue(__instance); Light val = (Light)((value is Light) ? value : null); if ((Object)(object)val != (Object)null) { ((Behaviour)val).enabled = false; } } } } [HarmonyPatch(typeof(InputManager), "GetMovementX")] public static class Patch_InvertedControls_X { private static void Postfix(ref float __result) { if (REPOEventManager.InvertedControls && SemiFunc.RunIsLevel()) { __result = 0f - __result; } } } [HarmonyPatch(typeof(InputManager), "GetMovementY")] public static class Patch_InvertedControls_Y { private static void Postfix(ref float __result) { if (REPOEventManager.InvertedControls && SemiFunc.RunIsLevel()) { __result = 0f - __result; } } } [HarmonyPatch(typeof(ValuableDirector), "SpawnValuable")] public static class Patch_ValuableSpawn_Override { private static Dictionary> replacementCache = new Dictionary>(); private static Dictionary> volumeCache = new Dictionary>(); private static Dictionary> usedVolumeIds = new Dictionary>(); private static bool initialized = false; private static bool Prefix(ref PrefabRef _valuable, ref ValuableVolume _volume, string _path, ValuableDirector __instance) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClientOrSingleplayer()) { return true; } if (SemiFunc.RunIsArena()) { return true; } if (_valuable == null || (Object)(object)_valuable.Prefab == (Object)null || (Object)(object)_volume == (Object)null) { return true; } ValuableObject component = _valuable.Prefab.GetComponent(); if ((Object)(object)component == (Object)null) { return true; } if ((Object)(object)__instance == (Object)null) { return true; } if (!initialized) { InitializeReplacements(__instance); initialized = true; } string requiredType = GetRequiredType(); if (requiredType == null) { return true; } if (GetTypeFromVolumeEnum(component.volumeType) == requiredType) { return true; } if (TryGetReplacementAndVolume(requiredType, out var valuable, out var volume)) { _valuable = valuable; _volume = volume; return true; } return false; } private static bool TryGetReplacementAndVolume(string requiredType, out PrefabRef valuable, out ValuableVolume volume) { valuable = null; volume = null; if (!replacementCache.ContainsKey(requiredType) || replacementCache[requiredType].Count == 0) { return false; } if (!volumeCache.ContainsKey(requiredType) || volumeCache[requiredType].Count == 0) { return false; } if (!usedVolumeIds.ContainsKey(requiredType)) { usedVolumeIds[requiredType] = new HashSet(); } List list = volumeCache[requiredType].Where((ValuableVolume v) => (Object)(object)v != (Object)null && !usedVolumeIds[requiredType].Contains(((Object)v).GetInstanceID())).ToList(); if (list.Count == 0) { usedVolumeIds[requiredType].Clear(); list = volumeCache[requiredType].Where((ValuableVolume v) => (Object)(object)v != (Object)null).ToList(); } if (list.Count == 0) { return false; } valuable = replacementCache[requiredType][Random.Range(0, replacementCache[requiredType].Count)]; volume = list[Random.Range(0, list.Count)]; usedVolumeIds[requiredType].Add(((Object)volume).GetInstanceID()); return true; } private static string GetRequiredType() { if (REPOEventManager.HasEvent("size_restriction")) { return REPOEventManager.SelectedSizeRestriction; } return null; } private static string GetTypeFromVolumeEnum(Type volumeType) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown return (int)volumeType switch { 0 => "tiny", 1 => "small", 2 => "medium", 3 => "big", 4 => "wide", 5 => "tall", 6 => "verytall", _ => "unknown", }; } private static void InitializeReplacements(ValuableDirector instance) { replacementCache.Clear(); volumeCache.Clear(); usedVolumeIds.Clear(); try { LoadReplacementType(instance, "tiny", "tinyValuables"); LoadReplacementType(instance, "small", "smallValuables"); LoadReplacementType(instance, "medium", "mediumValuables"); LoadReplacementType(instance, "big", "bigValuables"); LoadReplacementType(instance, "wide", "wideValuables"); LoadReplacementType(instance, "tall", "tallValuables"); LoadReplacementType(instance, "verytall", "veryTallValuables"); LoadVolumes(instance); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ValuableSpawn] Init error: " + ex.Message + "\n" + ex.StackTrace)); } } private static void LoadReplacementType(ValuableDirector instance, string key, string fieldName) { try { FieldInfo fieldInfo = AccessTools.Field(typeof(ValuableDirector), fieldName); if (fieldInfo == null) { replacementCache[key] = new List(); return; } List list = (List)fieldInfo.GetValue(instance); if (list == null) { replacementCache[key] = new List(); } else { replacementCache[key] = new List(list); } } catch (Exception) { replacementCache[key] = new List(); } } private static void LoadVolumes(ValuableDirector instance) { try { LoadVolumeType(instance, "tiny", "tinyVolumes"); LoadVolumeType(instance, "small", "smallVolumes"); LoadVolumeType(instance, "medium", "mediumVolumes"); LoadVolumeType(instance, "big", "bigVolumes"); LoadVolumeType(instance, "wide", "wideVolumes"); LoadVolumeType(instance, "tall", "tallVolumes"); LoadVolumeType(instance, "verytall", "veryTallVolumes"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ValuableSpawn] Failed to load volumes: " + ex.Message + "\n" + ex.StackTrace)); } } private static void LoadVolumeType(ValuableDirector instance, string key, string fieldName) { try { FieldInfo fieldInfo = AccessTools.Field(typeof(ValuableDirector), fieldName); if (fieldInfo == null) { volumeCache[key] = new List(); return; } List list = (List)fieldInfo.GetValue(instance); if (list == null) { volumeCache[key] = new List(); return; } volumeCache[key] = list.Where((ValuableVolume v) => (Object)(object)v != (Object)null).ToList(); } catch (Exception) { volumeCache[key] = new List(); } } public static void Reset() { initialized = false; replacementCache.Clear(); volumeCache.Clear(); usedVolumeIds.Clear(); } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_ValueLottery_Fixed { private const float JackpotChance = 0.1f; private const int LotterySeedSalt = 334462; private static FieldInfo FI_dollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static FieldInfo FI_dollarValueSet = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processedByLottery = new HashSet(); private static HashSet jackpotValuables = new HashSet(); private static bool lotterySelectionInitialized = false; [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!REPOEventManager.HasEvent("value_lottery") || !SemiFunc.RunIsLevel()) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processedByLottery.Contains(instanceID) || !(bool)FI_dollarValueSet.GetValue(__instance)) { return; } try { EnsureLotterySelection(); processedByLottery.Add(instanceID); float num = (float)FI_dollarValueCurrent.GetValue(__instance); float num2; if (jackpotValuables.Contains(instanceID)) { num2 = num * 10f; REPOConomyPlugin.Logger.LogInfo((object)$"[ValueLottery] 🎰 JACKPOT! {((Object)((Component)__instance).gameObject).name}: {num:F0} -> {num2:F0}"); } else { num2 = num * 0.5f; REPOConomyPlugin.Logger.LogInfo((object)$"[ValueLottery] 💸 Loss. {((Object)((Component)__instance).gameObject).name}: {num:F0} -> {num2:F0}"); } num2 = Mathf.Round(num2); FI_dollarValueCurrent.SetValue(__instance, num2); REPOConomyPlugin.EconomyAdjustedValues[instanceID] = num2; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ValueLottery] Error: " + ex.Message)); } } private static void EnsureLotterySelection() { if (lotterySelectionInitialized) { return; } lotterySelectionInitialized = true; jackpotValuables.Clear(); List levelValuables = GetLevelValuables(); if (levelValuables.Count != 0) { int num = Mathf.Clamp(Mathf.RoundToInt((float)levelValuables.Count * 0.1f), 1, levelValuables.Count); Random random = new Random(REPOSeedManager.GetCurrentHash() ^ 0x51A7E); List list = levelValuables.OrderBy((ValuableObject v) => GetStableLotteryKey(v)).ToList(); for (int num2 = list.Count - 1; num2 > 0; num2--) { int index = random.Next(num2 + 1); ValuableObject value = list[num2]; list[num2] = list[index]; list[index] = value; } for (int i = 0; i < num; i++) { jackpotValuables.Add(((Object)list[i]).GetInstanceID()); } REPOConomyPlugin.Logger.LogInfo((object)$"[ValueLottery] Selected {num}/{levelValuables.Count} jackpot valuables ({(float)num / (float)levelValuables.Count * 100f:F1}%)"); } } private static List GetLevelValuables() { if ((Object)(object)ValuableDirector.instance != (Object)null && ValuableDirector.instance.valuableList != null) { return ValuableDirector.instance.valuableList.Where((ValuableObject v) => (Object)(object)v != (Object)null).ToList(); } return (from v in Object.FindObjectsOfType() where (Object)(object)v != (Object)null select v).ToList(); } private static string GetStableLotteryKey(ValuableObject valuable) { //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_0031: 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_004d: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)valuable).transform.position; return string.Format("{0}_{1:F2}_{2:F2}_{3:F2}", ((Object)valuable).name.Replace("(Clone)", ""), position.x, position.y, position.z); } public static void Reset() { processedByLottery.Clear(); jackpotValuables.Clear(); lotterySelectionInitialized = false; REPOConomyPlugin.Logger.LogInfo((object)"[ValueLottery] Reset processed valuables"); } } [HarmonyPatch(typeof(ValuableObject), "Update")] public static class Patch_MagneticValuables { private static HashSet touchedValuables = new HashSet(); private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); private static FieldInfo FI_rb = AccessTools.Field(typeof(ValuableObject), "rb"); private static FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private const float MagnetRadius = 9f; private const float PullForce = 7f; private static void Postfix(ValuableObject __instance) { //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: 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_01a8: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: 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_01fe: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.MagneticValuables || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { object? value = FI_physGrabObject.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((value is PhysGrabObject) ? value : null); object? value2 = FI_rb.GetValue(__instance); Rigidbody val2 = (Rigidbody)((value2 is Rigidbody) ? value2 : null); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { return; } int instanceID = ((Object)__instance).GetInstanceID(); bool num = val.playerGrabbing != null && val.playerGrabbing.Count > 0; bool flag = Patch_ScaleInCart_TrackCart.IsInCart(val); bool flag2 = (Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)__instance).gameObject); if (num && !touchedValuables.Contains(instanceID)) { touchedValuables.Add(instanceID); val.ResetIndestructible(); } if (num || flag || flag2) { return; } PlayerAvatar val3 = null; float num2 = float.MaxValue; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !(bool)FI_isDisabled.GetValue(player)) { float num3 = Vector3.Distance(((Component)__instance).transform.position, ((Component)player).transform.position); if (num3 < num2) { num2 = num3; val3 = player; } } } if (Object.op_Implicit((Object)(object)val3) && num2 <= 9f) { if (!touchedValuables.Contains(instanceID)) { val.OverrideIndestructible(0.2f); } Vector3 val4 = ((Component)val3).transform.position - ((Component)__instance).transform.position; Vector3 normalized = ((Vector3)(ref val4)).normalized; normalized += Vector3.up * 0.2f; float num4 = Mathf.Lerp(1f, 3f, num2 / 9f); val2.AddForce(normalized * 7f * num4 * Time.deltaTime * 60f, (ForceMode)0); } } catch (Exception) { } } public static void Reset() { touchedValuables.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[MagneticValuables] Reset touched list"); } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_GoldenTouch { private static FieldInfo FI_dollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static FieldInfo FI_dollarValueSet = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processedByGoldenTouch = new HashSet(); [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!REPOEventManager.GoldenTouch || !SemiFunc.RunIsLevel()) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processedByGoldenTouch.Contains(instanceID) || !(bool)FI_dollarValueSet.GetValue(__instance)) { return; } try { processedByGoldenTouch.Add(instanceID); float num = (float)FI_dollarValueCurrent.GetValue(__instance); float num2 = num * 2f; FI_dollarValueCurrent.SetValue(__instance, Mathf.Round(num2)); REPOConomyPlugin.Logger.LogInfo((object)$"[GoldenTouch] {((Object)((Component)__instance).gameObject).name}: {num:F0} -> {num2:F0}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[GoldenTouch] Error: " + ex.Message)); } } public static void Reset() { processedByGoldenTouch.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[GoldenTouch] Reset processed valuables"); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakHeavy")] public static class Patch_ValuablesFragile_Heavy { private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float minimumValue) { if (SemiFunc.RunIsLevel() && (REPOEventManager.ValuablesFragile || REPOEventManager.RiskReward) && __instance.isValuable) { minimumValue *= 2f; } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakMedium")] public static class Patch_ValuablesFragile_Medium { private static void Prefix(PhysGrabObjectImpactDetector __instance) { if (SemiFunc.RunIsLevel() && REPOEventManager.ValuablesFragile) { _ = __instance.isValuable; } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakLight")] public static class Patch_ValuablesFragile_Light { private static void Prefix(PhysGrabObjectImpactDetector __instance) { if (SemiFunc.RunIsLevel() && REPOEventManager.ValuablesFragile) { _ = __instance.isValuable; } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_ValuablesFragile_Value { private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost) { if (SemiFunc.RunIsLevel() && (REPOEventManager.ValuablesFragile || REPOEventManager.RiskReward) && __instance.isValuable) { valueLost *= 2f; REPOConomyPlugin.Logger.LogInfo((object)$"[ValuablesFragile] Doubled value loss: {valueLost} for {((Object)((Component)__instance).gameObject).name}"); } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_ValuablesUnbreakable { private static bool Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost, ref Vector3 _contactPoint, ref int breakLevel, ref bool _forceBreak) { if (!SemiFunc.RunIsLevel()) { return true; } if ((REPOEventManager.ValuablesUnbreakable || REPOEventManager.DiamondLoot) && __instance.isValuable) { return false; } return true; } } [HarmonyPatch(typeof(ExtractionPoint), "StateWarning")] public static class Patch_ExtractionRush { private static void Postfix(ExtractionPoint __instance) { if (!REPOEventManager.ExtractionRush || !SemiFunc.RunIsLevel()) { return; } try { FieldInfo fieldInfo = AccessTools.Field(typeof(ExtractionPoint), "stateTimer"); if ((float)fieldInfo.GetValue(__instance) > 1.5f) { fieldInfo.SetValue(__instance, 1.5f); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExtractionRush] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ExtractionPoint), "Update")] public static class Patch_ExtractionMagnet { private static int frameCounter; private static void Postfix(ExtractionPoint __instance) { //IL_0077: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00cb: 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) if (!REPOEventManager.ExtractionMagnet || !SemiFunc.RunIsLevel()) { return; } frameCounter++; if (frameCounter % 3 != 0) { return; } try { if ((int)AccessTools.Field(typeof(ExtractionPoint), "currentState").GetValue(__instance) != 2) { return; } ValuableObject[] array = Object.FindObjectsOfType(); foreach (ValuableObject val in array) { if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((Component)val).GetComponent())) { Vector3 val2 = ((Component)__instance).transform.position - ((Component)val).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num = Vector3.Distance(((Component)__instance).transform.position, ((Component)val).transform.position); if (num > 1f && num <= 10f) { ((Component)val).GetComponent().AddForce(normalized * 5f, (ForceMode)5); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExtractionMagnet] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Update")] public static class Patch_ExtractionShield { private static FieldInfo FI_playerAvatar = AccessTools.Field(typeof(PlayerHealth), "playerAvatar"); private static FieldInfo FI_extractionPointCurrent = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent"); private static FieldInfo FI_currentState = AccessTools.Field(typeof(ExtractionPoint), "currentState"); private static void Postfix(PlayerHealth __instance) { if (!REPOEventManager.ExtractionShield || !SemiFunc.RunIsLevel()) { return; } try { object? value = FI_playerAvatar.GetValue(__instance); if (!Object.op_Implicit((Object)((value is PlayerAvatar) ? value : null)) || !Object.op_Implicit((Object)(object)RoundDirector.instance)) { return; } object? value2 = FI_extractionPointCurrent.GetValue(RoundDirector.instance); ExtractionPoint val = (ExtractionPoint)((value2 is ExtractionPoint) ? value2 : null); if ((Object)(object)val != (Object)null) { int num = (int)FI_currentState.GetValue(val); if (num == 4 || num == 6) { __instance.InvincibleSet(1f); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExtractionShield] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ExtractionPoint), "StateExtracting")] public static class Patch_ExtractionChaos { private static void Postfix(ExtractionPoint __instance) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ExtractionChaos || !SemiFunc.RunIsLevel()) { return; } try { if ((int)AccessTools.Field(typeof(ExtractionPoint), "currentState").GetValue(__instance) != 5) { return; } Enemy[] array = Object.FindObjectsOfType(); foreach (Enemy val in array) { if (Object.op_Implicit((Object)(object)val) && !val.IsStunned()) { SemiFunc.EnemyInvestigate(((Component)__instance).transform.position, float.MaxValue, false); } } REPOConomyPlugin.Logger.LogInfo((object)"[ExtractionChaos] Enemies activated during extraction"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExtractionChaos] Error: " + ex.Message)); } } } internal static class SingleExtractionHelper { private static int primaryPhotonViewId = -1; private static readonly FieldInfo FI_extractionPointList = AccessTools.Field(typeof(RoundDirector), "extractionPointList"); private static readonly FieldInfo FI_extractionPoints = AccessTools.Field(typeof(RoundDirector), "extractionPoints"); internal static void Reset() { primaryPhotonViewId = -1; } internal static void Apply(RoundDirector roundDirector) { if ((Object)(object)roundDirector == (Object)null || !REPOEventManager.SingleExtraction || !SemiFunc.RunIsLevel()) { return; } if (!(FI_extractionPointList.GetValue(roundDirector) is List list) || list.Count == 0) { FI_extractionPoints.SetValue(roundDirector, 1); return; } list.RemoveAll((GameObject go) => (Object)(object)go == (Object)null || (Object)(object)go.GetComponent() == (Object)null); GameObject val = FindPrimaryExtractionPoint(list); if ((Object)(object)val == (Object)null) { return; } PhotonView component = val.GetComponent(); primaryPhotonViewId = (((Object)(object)component != (Object)null) ? component.ViewID : ((Object)val).GetInstanceID()); foreach (GameObject item in list.ToList()) { if ((Object)(object)item == (Object)null || (Object)(object)item == (Object)(object)val) { continue; } ExtractionPoint component2 = item.GetComponent(); if (!((Object)(object)component2 == (Object)null)) { component2.isLocked = true; if ((Object)(object)component2.buttonGrabObject != (Object)null) { ((Behaviour)component2.buttonGrabObject).enabled = false; } } } list.Clear(); list.Add(val); FI_extractionPoints.SetValue(roundDirector, 1); REPOConomyPlugin.Logger.LogInfo((object)$"[SingleExtraction] Primary extraction locked to {((Object)val).name} (ViewID {primaryPhotonViewId}); extra extraction buttons disabled."); } internal static bool IsAllowed(ExtractionPoint extractionPoint) { if (!REPOEventManager.SingleExtraction || !SemiFunc.RunIsLevel() || (Object)(object)extractionPoint == (Object)null) { return true; } EnsurePrimarySelected(); PhotonView component = ((Component)extractionPoint).GetComponent(); int num = (((Object)(object)component != (Object)null) ? component.ViewID : ((Object)((Component)extractionPoint).gameObject).GetInstanceID()); if (primaryPhotonViewId > 0) { return num == primaryPhotonViewId; } return true; } internal static bool IsAllowedPhotonView(int photonViewID) { if (!REPOEventManager.SingleExtraction || !SemiFunc.RunIsLevel()) { return true; } EnsurePrimarySelected(); if (primaryPhotonViewId > 0) { return photonViewID == primaryPhotonViewId; } return true; } private static void EnsurePrimarySelected() { if (primaryPhotonViewId <= 0 && !((Object)(object)RoundDirector.instance == (Object)null)) { Apply(RoundDirector.instance); } } private static GameObject FindPrimaryExtractionPoint(List list) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) TruckDoor[] array = Object.FindObjectsOfType(); if (array != null && array.Length != 0) { GameObject val = null; float num = float.MaxValue; foreach (GameObject item in list) { if ((Object)(object)item == (Object)null) { continue; } TruckDoor[] array2 = array; foreach (TruckDoor val2 in array2) { if (!((Object)(object)val2 == (Object)null)) { float num2 = Vector3.SqrMagnitude(item.transform.position - ((Component)val2).transform.position); if (num2 < num) { num = num2; val = item; } } } } if ((Object)(object)val != (Object)null) { return val; } } return list.Where((GameObject go) => (Object)(object)go != (Object)null).OrderBy(delegate(GameObject go) { PhotonView component = go.GetComponent(); return (!((Object)(object)component != (Object)null)) ? ((Object)go).GetInstanceID() : component.ViewID; }).FirstOrDefault(); } } [HarmonyPatch(typeof(RoundDirector), "StartRoundLogic")] public static class Patch_SingleExtraction { private static void Postfix(RoundDirector __instance, int value) { if (!REPOEventManager.SingleExtraction || !SemiFunc.RunIsLevel()) { return; } try { SingleExtractionHelper.Apply(__instance); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SingleExtraction] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ExtractionPoint), "OnClick")] public static class Patch_SingleExtraction_OnClick { private static bool Prefix(ExtractionPoint __instance) { if (SingleExtractionHelper.IsAllowed(__instance)) { return true; } __instance.isLocked = true; if ((Object)(object)__instance.buttonGrabObject != (Object)null) { ((Behaviour)__instance.buttonGrabObject).enabled = false; } REPOConomyPlugin.Logger.LogInfo((object)"[SingleExtraction] Blocked extra extraction point click."); return false; } } [HarmonyPatch(typeof(RoundDirector), "RequestExtractionPointActivationRPC")] public static class Patch_SingleExtraction_RequestActivationRPC { private static bool Prefix(int photonViewID) { bool num = SingleExtractionHelper.IsAllowedPhotonView(photonViewID); if (!num) { REPOConomyPlugin.Logger.LogInfo((object)"[SingleExtraction] Blocked extra extraction point activation request."); } return num; } } [HarmonyPatch(typeof(RoundDirector), "ExtractionPointActivateRPC")] public static class Patch_SingleExtraction_ActivateRPC { private static bool Prefix(int photonViewID) { bool num = SingleExtractionHelper.IsAllowedPhotonView(photonViewID); if (!num) { REPOConomyPlugin.Logger.LogInfo((object)"[SingleExtraction] Blocked extra extraction point activation RPC."); } return num; } } [HarmonyPatch(typeof(PhysGrabObject), "Update")] public static class Patch_HotPotato { private static Dictionary hotPotatoTimers = new Dictionary(); private static FieldInfo FI_isValuable = AccessTools.Field(typeof(PhysGrabObject), "isValuable"); private static FieldInfo FI_grabbed = AccessTools.Field(typeof(PhysGrabObject), "grabbed"); private static FieldInfo FI_lastPlayerGrabbing = AccessTools.Field(typeof(PhysGrabObject), "lastPlayerGrabbing"); private static void Postfix(PhysGrabObject __instance) { if (!REPOEventManager.HasEvent("hot_potato") || !SemiFunc.RunIsLevel()) { return; } try { if (!(bool)FI_isValuable.GetValue(__instance)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if ((bool)FI_grabbed.GetValue(__instance) && __instance.playerGrabbing != null && __instance.playerGrabbing.Count > 0) { if (!hotPotatoTimers.ContainsKey(instanceID)) { hotPotatoTimers[instanceID] = 0f; } hotPotatoTimers[instanceID] += Time.deltaTime; if (!(hotPotatoTimers[instanceID] >= 3.5f)) { return; } hotPotatoTimers[instanceID] = 0f; { foreach (PhysGrabber item in __instance.playerGrabbing) { if ((Object)(object)item != (Object)null && (Object)(object)item.playerAvatar != (Object)null && (Object)(object)item.playerAvatar.playerHealth != (Object)null) { item.playerAvatar.playerHealth.Hurt(5, false, -1, false); REPOConomyPlugin.Logger.LogInfo((object)("[HotPotato] Player " + ((Object)item.playerAvatar).name + " took 5 damage from holding valuable")); } } return; } } if (hotPotatoTimers.ContainsKey(instanceID)) { hotPotatoTimers[instanceID] = 0f; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HotPotato] Error: " + ex.Message)); } } public static void Reset() { hotPotatoTimers.Clear(); } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_ValuableWeightModifiers { private static Dictionary originalMasses = new Dictionary(); private static Dictionary appliedMasses = new Dictionary(); private static FieldInfo FI_rb = AccessTools.Field(typeof(ValuableObject), "rb"); private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); private static FieldInfo FI_physAttributePreset = AccessTools.Field(typeof(ValuableObject), "physAttributePreset"); private static FieldInfo FI_physAttributeMass = AccessTools.Field(typeof(PhysAttribute), "mass"); public static void Reset() { originalMasses.Clear(); appliedMasses.Clear(); } [HarmonyPriority(600)] private static void Postfix(ValuableObject __instance) { Apply(__instance, log: true); } internal static void Apply(ValuableObject valuable, bool log) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if (!SemiFunc.RunIsLevel() || (!REPOEventManager.FeatherWeight && !REPOEventManager.HeavyBurden && !REPOEventManager.ZeroGravityLoot && !REPOEventManager.HeavyPockets && !REPOEventManager.WeightSwap)) { return; } try { Rigidbody val = (Rigidbody)FI_rb.GetValue(valuable); if ((Object)(object)val == (Object)null) { return; } object? value = FI_physGrabObject.GetValue(valuable); PhysGrabObject val2 = (PhysGrabObject)((value is PhysGrabObject) ? value : null); int instanceID = ((Object)valuable).GetInstanceID(); if (!originalMasses.ContainsKey(instanceID)) { originalMasses[instanceID] = GetBaseMass(valuable, val2, val); } float num = originalMasses[instanceID]; if (REPOEventManager.FeatherWeight) { float targetMass = num / 5f; ApplyValuableMass(val2, val, targetMass); LogMassChange(instanceID, log, "FeatherWeight", ((Object)((Component)valuable).gameObject).name, num, targetMass); } else if (REPOEventManager.HeavyBurden) { float targetMass2 = num * 3f; ApplyValuableMass(val2, val, targetMass2); LogMassChange(instanceID, log, "HeavyBurden", ((Object)((Component)valuable).gameObject).name, num, targetMass2); } else if (REPOEventManager.HeavyPockets) { float targetMass3 = num * 1.8f; ApplyValuableMass(val2, val, targetMass3); LogMassChange(instanceID, log, "HeavyPockets", ((Object)((Component)valuable).gameObject).name, num, targetMass3); } else if (REPOEventManager.WeightSwap) { float num2 = num; if (num >= 4f) { num2 = num / 3f; } else if (num < 2f) { num2 = num * 3f; } if (!Mathf.Approximately(num2, num)) { ApplyValuableMass(val2, val, num2); LogMassChange(instanceID, log, "WeightSwap", ((Object)((Component)valuable).gameObject).name, num, num2); } } if (REPOEventManager.ZeroGravityLoot) { if (!((Object)(object)val2 != (Object)null) || !Patch_ScaleInCart_TrackCart.IsInCart(val2)) { val.useGravity = false; } else { val.useGravity = true; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ValuableWeightModifiers] Error: " + ex.Message)); } } private static float GetBaseMass(ValuableObject valuable, PhysGrabObject physGrab, Rigidbody rb) { object obj = FI_physAttributePreset?.GetValue(valuable); if (obj != null && FI_physAttributeMass != null) { float num = (float)FI_physAttributeMass.GetValue(obj); if (num > 0f) { return num; } } if ((Object)(object)physGrab != (Object)null && physGrab.massOriginal > 0f) { return physGrab.massOriginal; } return rb.mass; } private static void LogMassChange(int id, bool log, string modifierName, string objectName, float originalMass, float targetMass) { if (log && (!appliedMasses.TryGetValue(id, out var value) || !Mathf.Approximately(value, targetMass))) { appliedMasses[id] = targetMass; REPOConomyPlugin.Logger.LogInfo((object)$"[{modifierName}] {objectName}: {originalMass:F2} -> {targetMass:F2}"); } } private static void ApplyValuableMass(PhysGrabObject physGrab, Rigidbody rb, float targetMass) { rb.mass = targetMass; if (!((Object)(object)physGrab == (Object)null)) { physGrab.massOriginal = targetMass; physGrab.OverrideMass(targetMass, 0.1f); } } } [HarmonyPatch(typeof(PhysGrabObject), "Update")] public static class Patch_ValuableWeightModifiers_PhysGrabObjectUpdate { private static void Postfix(PhysGrabObject __instance) { if (!((Object)(object)__instance == (Object)null)) { ValuableObject component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { Patch_ValuableWeightModifiers.Apply(component, log: false); } } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_SlipperyChaos { private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (!REPOEventManager.SlipperyChaos || !SemiFunc.RunIsLevel()) { return; } try { object? value = FI_physGrabObject.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((value is PhysGrabObject) ? value : null); if ((Object)(object)val == (Object)null) { return; } PhysicMaterial val2 = new PhysicMaterial("SlipperyMaterial"); val2.dynamicFriction = 0f; val2.staticFriction = 0f; val2.frictionCombine = (PhysicMaterialCombine)2; val2.bounciness = 0f; val2.bounceCombine = (PhysicMaterialCombine)2; Collider[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if ((Object)(object)val3 != (Object)null) { val3.material = val2; } } val.rb.drag = 0f; val.rb.angularDrag = 0f; REPOConomyPlugin.Logger.LogInfo((object)("[SlipperyChaos] Made valuable " + ((Object)((Component)__instance).gameObject).name + " very slippery")); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SlipperyChaos] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PhysGrabObject), "Update")] public static class Patch_PhantomObjects { [CompilerGenerated] private sealed class d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PhysGrabObject obj; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: <>1__state = -1; try { obj.rb.isKinematic = false; ((Component)obj).gameObject.SetActive(true); REPOConomyPlugin.Logger.LogInfo((object)("[PhantomObjects] Restored " + ((Object)((Component)obj).gameObject).name)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PhantomObjects] Restore error: " + ex.Message)); } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Dictionary phantomTimers = new Dictionary(); private static FieldInfo FI_isKinematic = AccessTools.Field(typeof(PhysGrabObject), "isKinematic"); private static FieldInfo FI_isValuable = AccessTools.Field(typeof(PhysGrabObject), "isValuable"); public static void Reset() { phantomTimers.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[PhantomObjects] Reset phantom timers"); } private static void Postfix(PhysGrabObject __instance) { if (!REPOEventManager.PhantomObjects || !SemiFunc.RunIsLevel()) { return; } try { if (!(bool)FI_isValuable.GetValue(__instance) || Patch_ScaleInCart_TrackCart.IsInCart(__instance)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!phantomTimers.ContainsKey(instanceID)) { phantomTimers[instanceID] = 0f; } phantomTimers[instanceID] += Time.deltaTime; if (phantomTimers[instanceID] >= 15f) { phantomTimers[instanceID] = 0f; __instance.rb.isKinematic = true; ((Component)__instance).gameObject.SetActive(false); if ((Object)(object)EconomyController.Instance != (Object)null) { ((MonoBehaviour)EconomyController.Instance).StartCoroutine(RestorePhantom(__instance)); } else { ((MonoBehaviour)__instance).StartCoroutine(RestorePhantom(__instance)); } REPOConomyPlugin.Logger.LogInfo((object)("[PhantomObjects] Made " + ((Object)((Component)__instance).gameObject).name + " phantom")); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PhantomObjects] Error: " + ex.Message)); } } [IteratorStateMachine(typeof(d__5))] private static IEnumerator RestorePhantom(PhysGrabObject obj) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0) { obj = obj }; } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_BouncyHavoc { private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Expected O, but got Unknown if (!REPOEventManager.BouncyHavoc || !SemiFunc.RunIsLevel()) { return; } try { object? value = FI_physGrabObject.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((value is PhysGrabObject) ? value : null); if ((Object)(object)val == (Object)null) { return; } PhysicMaterial val2 = new PhysicMaterial("SuperBouncyMaterial"); val2.bounciness = 1f; val2.bounceCombine = (PhysicMaterialCombine)3; Collider[] componentsInChildren = ((Component)val).GetComponentsInChildren(); foreach (Collider val3 in componentsInChildren) { if ((Object)(object)val3 != (Object)null) { val3.material = val2; } } val.rb.drag = 0.1f; val.rb.angularDrag = 0.1f; REPOConomyPlugin.Logger.LogInfo((object)("[BouncyHavoc] Made valuable " + ((Object)((Component)__instance).gameObject).name + " super bouncy")); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BouncyHavoc] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public static class Patch_SuperJump { private static void Prefix(PlayerController __instance) { if (!REPOEventManager.SuperJump || !SemiFunc.RunIsLevel()) { return; } try { __instance.JumpForce = 60f; __instance.CustomGravity = 10f; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SuperJump] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] public static class Patch_NightVision { private static Dictionary originalIntensities = new Dictionary(); private static Dictionary originalRanges = new Dictionary(); private static float originalAmbient = -1f; private static bool isApplied = false; private static void Postfix() { if (!REPOEventManager.NightVision || !SemiFunc.RunIsLevel()) { return; } try { if (originalAmbient == -1f) { originalAmbient = RenderSettings.ambientIntensity; } RenderSettings.ambientIntensity = 2f; isApplied = true; Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null) && !originalIntensities.ContainsKey(val)) { originalIntensities[val] = val.intensity; originalRanges[val] = val.range; if (val.intensity < 100f) { val.intensity *= 2f; val.range *= 1.5f; } } } REPOConomyPlugin.Logger.LogInfo((object)$"[NightVision] Applied: Enhanced visibility. Tracked lights: {originalIntensities.Count}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[NightVision] Error: " + ex.Message)); } } public static void Reset() { try { foreach (KeyValuePair originalIntensity in originalIntensities) { Light key = originalIntensity.Key; if ((Object)(object)key != (Object)null) { key.intensity = originalIntensity.Value; if (originalRanges.ContainsKey(key)) { key.range = originalRanges[key]; } } } if (isApplied && originalAmbient != -1f) { RenderSettings.ambientIntensity = originalAmbient; REPOConomyPlugin.Logger.LogInfo((object)$"[NightVision] Reset ambient to {originalAmbient}"); } originalIntensities.Clear(); originalRanges.Clear(); originalAmbient = -1f; isApplied = false; REPOConomyPlugin.Logger.LogInfo((object)"[NightVision] Full Reset Complete"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[NightVision] Reset Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ValuableDirector), "SetupHost")] public static class Patch_LuckyFind { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public ValuableDirector __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; if (REPOEventManager.LuckyFind && SemiFunc.IsMasterClientOrSingleplayer() && !SemiFunc.RunIsArena()) { break; } goto IL_005d; case 1: <>1__state = -1; goto IL_005d; case 2: { <>1__state = -1; break; } IL_005d: if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } return false; } if (original.MoveNext()) { object current = original.Current; if (current == null && Random.value < 0.1f) { try { List list = (List)AccessTools.Field(typeof(ValuableDirector), "smallValuables").GetValue(__instance); List list2 = (List)AccessTools.Field(typeof(ValuableDirector), "smallVolumes").GetValue(__instance); if (list != null && list.Count > 0 && list2 != null && list2.Count > 0) { PrefabRef val = list[Random.Range(0, list.Count)]; ValuableVolume val2 = list2[Random.Range(0, list2.Count)]; if (val != null && (Object)(object)val2 != (Object)null) { AccessTools.Method(typeof(ValuableDirector), "SpawnValuable", (Type[])null, (Type[])null).Invoke(__instance, new object[3] { val, val2, "02 Small" }); REPOConomyPlugin.Logger.LogInfo((object)"[LuckyFind] Spawned random valuable in Small volume"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LuckyFind] Error: " + ex.Message)); } } <>2__current = current; <>1__state = 2; return true; } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, ValuableDirector __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public static class Patch_StickyFeet { private static float stickyTimer; private static void Postfix(PlayerController __instance) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.StickyFeet || !SemiFunc.RunIsLevel()) { return; } try { stickyTimer += Time.fixedDeltaTime; if (stickyTimer >= 5f) { stickyTimer = 0f; if (Random.value < 0.2f) { __instance.MoveForce(Vector3.zero, 0f, 2f); REPOConomyPlugin.Logger.LogInfo((object)"[StickyFeet] Player stuck for 2 seconds"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[StickyFeet] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(GameDirector), "Update")] public static class Patch_TimeWarp { [CompilerGenerated] private sealed class d__3 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public float delay; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__3(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSecondsRealtime(delay); <>1__state = 1; return true; case 1: <>1__state = -1; Time.timeScale = 1f; REPOConomyPlugin.Logger.LogInfo((object)"[TimeWarp] Time scale restored"); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static float warpTimer; private static bool isWarped; private static void Postfix(GameDirector __instance) { if (!REPOEventManager.TimeWarp || !SemiFunc.RunIsLevel()) { return; } try { warpTimer += Time.deltaTime; if (warpTimer >= 30f) { warpTimer = 0f; isWarped = !isWarped; if (isWarped) { Time.timeScale = 0.5f; ((MonoBehaviour)__instance).StartCoroutine(RestoreTimeScale(5f)); REPOConomyPlugin.Logger.LogInfo((object)"[TimeWarp] Time slowed down for 5 seconds"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TimeWarp] Error: " + ex.Message)); } } [IteratorStateMachine(typeof(d__3))] private static IEnumerator RestoreTimeScale(float delay) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__3(0) { delay = delay }; } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_RemoveSpawnValuableLimit { private static void Postfix(EnemyHealth __instance) { try { __instance.spawnValuableMax = 999; REPOConomyPlugin.Logger.LogInfo((object)("[RemoveSpawnValuableLimit] Set spawnValuableMax to 999 for " + ((Object)((Component)__instance).gameObject).name)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RemoveSpawnValuableLimit] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_OneHitKill { private static FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static MethodInfo MI_Death = AccessTools.Method(typeof(EnemyHealth), "Death", (Type[])null, (Type[])null); private static void Postfix(int _damage, Vector3 _hurtDirection, EnemyHealth __instance) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.OneHitKill || !SemiFunc.RunIsLevel()) { return; } try { if (REPOEventManager.InvincibleHorror) { Enemy componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && ((Object)((Component)componentInParent).gameObject).GetInstanceID() == InvincibleHorrorManager.EnemyID) { return; } } int num = (int)FI_healthCurrent.GetValue(__instance); if (num > 0) { FI_healthCurrent.SetValue(__instance, 0); MI_Death.Invoke(__instance, new object[1] { _hurtDirection }); REPOConomyPlugin.Logger.LogInfo((object)$"[OneHitKill] Killed enemy with {num} HP remaining"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[OneHitKill] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Death")] public static class Patch_HealthVampire { private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.HealthVampire || !SemiFunc.RunIsLevel()) { return; } try { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && Object.op_Implicit((Object)(object)player.playerHealth)) { FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerHealth), "health"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); int num = (int)fieldInfo.GetValue(player.playerHealth); int num2 = (int)fieldInfo2.GetValue(player.playerHealth); int num3 = Mathf.Min(num + 10, num2); fieldInfo.SetValue(player.playerHealth, num3); REPOConomyPlugin.Logger.LogInfo((object)$"[HealthVampire] Restored 10 HP to {((Object)player).name}: {num} -> {num3}"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HealthVampire] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Death")] public static class Patch_EnemiesFasterOnKill { public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[Bloodlust] Reset"); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.EnemiesFasterOnKill || !SemiFunc.RunIsLevel()) { return; } try { REPOEventManager.EnemiesFasterOnKillCount++; REPOEventManager.EnemiesFasterOnKillMultiplier = 1f + (float)REPOEventManager.EnemiesFasterOnKillCount * 0.05f; UpdateAllEnemySpeeds(); REPOEventManager.SyncBloodlustToClients(); REPOConomyPlugin.Logger.LogInfo((object)($"[Bloodlust] Enemy killed! Count: {REPOEventManager.EnemiesFasterOnKillCount}, " + $"Speed multiplier: {REPOEventManager.EnemiesFasterOnKillMultiplier:F2}")); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Bloodlust] Error: " + ex.Message)); } } private static void UpdateAllEnemySpeeds() { } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_DoublePlayerDamage { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.DoublePlayerDamage || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { damage *= 2; REPOConomyPlugin.Logger.LogInfo((object)$"[DoublePlayerDamage] Damage doubled: {damage}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[DoublePlayerDamage] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_DoubleEnemyHealth { private static FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.DoubleEnemyHealth || !SemiFunc.RunIsLevel()) { return; } try { __instance.health *= 2; FI_healthCurrent.SetValue(__instance, __instance.health); REPOConomyPlugin.Logger.LogInfo((object)$"[DoubleEnemyHealth] Enemy health doubled: {__instance.health}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[DoubleEnemyHealth] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_HalfPlayerDamage { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.HalfPlayerDamage || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } if (SmashBrosManager.IsDeathPitFrame) { REPOConomyPlugin.Logger.LogInfo((object)"[HalfPlayerDamage] Ignored pit damage (Instant Kill)"); return; } try { damage = Mathf.RoundToInt((float)damage * 0.5f); REPOConomyPlugin.Logger.LogInfo((object)$"[HalfPlayerDamage] Damage reduced by 50%: {damage}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HalfPlayerDamage] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_OneHitKill_Player { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.OneHitKillPlayers || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { damage = 9999; REPOConomyPlugin.Logger.LogInfo((object)$"[OneHitKill_Player] Set damage to lethal: {damage}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[OneHitKill_Player] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Dodge { public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[Dodge] Reset"); } private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.Dodge || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { if (Random.value < 0.2f) { int num = damage; damage = 0; REPOConomyPlugin.Logger.LogInfo((object)$"[Dodge] DODGED! {num} damage avoided completely"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Dodge] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_DoubleEnemyDamage { private static void Prefix(ref int _damage) { if (!REPOEventManager.DoubleEnemyDamage || !SemiFunc.RunIsLevel()) { return; } try { _damage *= 2; REPOConomyPlugin.Logger.LogInfo((object)$"[DoubleEnemyDamage] Damage doubled: {_damage}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[DoubleEnemyDamage] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_CriticalHits { public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[CriticalHits] Reset"); } private static void Prefix(ref int _damage) { if (!REPOEventManager.CriticalHits || !SemiFunc.RunIsLevel()) { return; } try { if (Random.value < 0.15f) { int num = _damage; _damage *= 3; if (_damage > 1000) { _damage = 1000; REPOConomyPlugin.Logger.LogInfo((object)$"[CriticalHits] CRITICAL! {num} -> {_damage} (capped to prevent bugs)"); } else { REPOConomyPlugin.Logger.LogInfo((object)$"[CriticalHits] CRITICAL! {num} -> {_damage} (x3)"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[CriticalHits] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ItemGun), "ShootRPC")] public static class Patch_InfiniteAmmo_ShootRPC { private static void Prefix(ItemGun __instance, PhotonMessageInfo _info) { if (!REPOEventManager.HasEvent("infinite_ammo") || !SemiFunc.RunIsLevel()) { return; } try { object? value = AccessTools.Field(typeof(ItemGun), "itemBattery").GetValue(__instance); ItemBattery val = (ItemBattery)((value is ItemBattery) ? value : null); if ((Object)(object)val != (Object)null) { FieldInfo fieldInfo = AccessTools.Field(typeof(ItemBattery), "batteryLife"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(ItemBattery), "batteryLifeInt"); int num = (int)AccessTools.Field(typeof(ItemBattery), "batteryBars").GetValue(val); fieldInfo.SetValue(val, 100f); fieldInfo2.SetValue(val, num); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InfiniteAmmo] ShootRPC Error: " + ex.Message)); } } } [HarmonyPatch(typeof(ItemGun), "StateShooting")] public static class Patch_InfiniteAmmo_StateShooting { private static void Prefix(ItemGun __instance, bool _fixedUpdate) { if (!REPOEventManager.HasEvent("infinite_ammo") || !SemiFunc.RunIsLevel() || _fixedUpdate) { return; } try { object? value = AccessTools.Field(typeof(ItemGun), "itemBattery").GetValue(__instance); ItemBattery val = (ItemBattery)((value is ItemBattery) ? value : null); if ((Object)(object)val != (Object)null) { FieldInfo fieldInfo = AccessTools.Field(typeof(ItemBattery), "batteryLife"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(ItemBattery), "batteryLifeInt"); int num = (int)AccessTools.Field(typeof(ItemBattery), "batteryBars").GetValue(val); fieldInfo.SetValue(val, 100f); fieldInfo2.SetValue(val, num); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InfiniteAmmo] StateShooting Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Death")] public static class Patch_PlayerRevival_Death { private static Dictionary playerHasRevived = new Dictionary(); private static void Postfix(PlayerHealth __instance) { if (!REPOEventManager.PlayerRevival || !SemiFunc.RunIsLevel()) { return; } try { PlayerAvatar componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)"[PlayerRevival] PlayerAvatar not found"); return; } string text = (string)AccessTools.Field(typeof(PlayerAvatar), "steamID").GetValue(componentInParent); if (string.IsNullOrEmpty(text)) { REPOConomyPlugin.Logger.LogWarning((object)"[PlayerRevival] SteamID is null"); } else if (!playerHasRevived.ContainsKey(text) || !playerHasRevived[text]) { playerHasRevived[text] = false; REPOConomyPlugin.Logger.LogInfo((object)("[PlayerRevival] Player " + text + " died, can revive once with hotkey")); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PlayerRevival] Death Error: " + ex.Message + "\n" + ex.StackTrace)); } } public static void Reset() { playerHasRevived.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[PlayerRevival] Reset revival tracking"); } public static bool CanPlayerRevive(string steamID) { if (string.IsNullOrEmpty(steamID)) { return false; } if (playerHasRevived.ContainsKey(steamID)) { return !playerHasRevived[steamID]; } return false; } public static void MarkPlayerRevived(string steamID) { if (playerHasRevived.ContainsKey(steamID)) { playerHasRevived[steamID] = true; } } } [HarmonyPatch(typeof(PlayerDeathHead), "Update")] public static class Patch_PlayerRevival_Input { private static void Postfix(PlayerDeathHead __instance) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.PlayerRevival || !SemiFunc.RunIsLevel()) { return; } try { if ((Object)(object)__instance.playerAvatar == (Object)null || !(bool)AccessTools.Field(typeof(PlayerAvatar), "isLocal").GetValue(__instance.playerAvatar) || !(bool)AccessTools.Field(typeof(PlayerDeathHead), "triggered").GetValue(__instance)) { return; } string text = (string)AccessTools.Field(typeof(PlayerAvatar), "steamID").GetValue(__instance.playerAvatar); if (!string.IsNullOrEmpty(text) && Patch_PlayerRevival_Death.CanPlayerRevive(text) && Input.GetKeyDown(REPOConfig.PlayerRevivalHotkey.Value)) { REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerRevival] ========== HOTKEY {REPOConfig.PlayerRevivalHotkey.Value} PRESSED =========="); if (SemiFunc.IsMultiplayer()) { ((Component)__instance.playerAvatar).GetComponent().RPC("PlayerRevivalRequestRPC", (RpcTarget)2, new object[1] { text }); } else { __instance.playerAvatar.Revive(false); Patch_PlayerRevival_Death.MarkPlayerRevived(text); } REPOConomyPlugin.Logger.LogInfo((object)("[PlayerRevival] Revival requested for " + text)); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PlayerRevival] Input Error: " + ex.Message + "\n" + ex.StackTrace)); } } } [HarmonyPatch(typeof(PlayerAvatar), "Start")] public static class Patch_PlayerAvatar_AddRevivalRPC { private static void Postfix(PlayerAvatar __instance) { if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } } public class PlayerRevivalHelper : MonoBehaviourPunCallbacks { private PlayerAvatar playerAvatar; private void Awake() { playerAvatar = ((Component)this).GetComponent(); } [PunRPC] public void PlayerRevivalRequestRPC(string steamID, PhotonMessageInfo info) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.IsMasterClient()) { return; } REPOConomyPlugin.Logger.LogInfo((object)("[PlayerRevival] 🔥 Host received revival request for " + steamID + " from " + info.Sender.NickName)); if (!Patch_PlayerRevival_Death.CanPlayerRevive(steamID)) { REPOConomyPlugin.Logger.LogWarning((object)("[PlayerRevival] Player " + steamID + " already used revival!")); return; } string text = (string)AccessTools.Field(typeof(PlayerAvatar), "steamID").GetValue(playerAvatar); if (text != steamID) { REPOConomyPlugin.Logger.LogWarning((object)("[PlayerRevival] SteamID mismatch: " + text + " != " + steamID)); return; } playerAvatar.Revive(false); Patch_PlayerRevival_Death.MarkPlayerRevived(steamID); REPOConomyPlugin.Logger.LogInfo((object)("[PlayerRevival] Host successfully revived player " + steamID)); } } [HarmonyPatch(typeof(ItemGun), "ShootRPC")] public static class Patch_SuperRecoil { private static void Postfix(ItemGun __instance) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.SuperRecoil || !SemiFunc.RunIsLevel()) { return; } PhysGrabObject component = ((Component)__instance).GetComponent(); if (!((Object)(object)component != (Object)null) || component.playerGrabbing.Count <= 0) { return; } foreach (PhysGrabber item in component.playerGrabbing) { if (item.isLocal) { Vector3 val = -__instance.gunMuzzle.forward; PlayerController.instance.rb.AddForce(val * 25f, (ForceMode)1); GameDirector.instance.CameraImpact.Shake(1f, 0.2f); } } } } [HarmonyPatch(typeof(ItemGun), "Shoot")] public static class Patch_GunJam { private static bool Prefix(ItemGun __instance) { //IL_002e: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.JammingGuns && SemiFunc.RunIsLevel() && Random.value < 0.25f) { if (__instance.soundNoAmmoClick != null) { __instance.soundNoAmmoClick.Play(((Component)__instance).transform.position, 1f, 1f, 1f, 1f); } SemiFunc.CameraShakeImpact(0.5f, 0.1f); return false; } return true; } } [HarmonyPatch(typeof(ItemBattery), "Update")] public static class Patch_BatteryDrain_Passive { private static FieldInfo FI_isCharging = AccessTools.Field(typeof(ItemBattery), "isCharging"); private static void Prefix(ItemBattery __instance) { if (REPOEventManager.CheapBatteries && SemiFunc.RunIsLevel()) { bool flag = (bool)FI_isCharging.GetValue(__instance); if (__instance.batteryActive && __instance.autoDrain && !flag) { float num = __instance.batteryDrainRate * 1.5f * Time.deltaTime; __instance.batteryLife -= num; } } } } [HarmonyPatch(typeof(ItemBattery), "RemoveFullBar")] public static class Patch_BatteryDrain_Active { private static void Prefix(ref int _bars) { if (REPOEventManager.CheapBatteries && SemiFunc.RunIsLevel()) { _bars *= 2; } } } [HarmonyPatch(typeof(PlayerTumble), "BreakImpact")] public static class Patch_ExplosiveTumble { private static FieldInfo FI_impactHurtTimer = AccessTools.Field(typeof(PlayerTumble), "impactHurtTimer"); private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Prefix(PlayerTumble __instance) { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ExplosiveTumble || !((Object)(object)__instance.playerAvatar != (Object)null) || !(bool)FI_isLocal.GetValue(__instance.playerAvatar) || !((float)FI_impactHurtTimer.GetValue(__instance) > 0f)) { return; } try { ParticleScriptExplosion val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { val.Spawn(((Component)__instance).transform.position, 3f, 15, 15, 1f, false, false, 1f); REPOConomyNetworkHandler.SyncExplosionToClients(((Component)__instance).transform.position, 3f, 15, 15); REPOConomyPlugin.Logger.LogInfo((object)"[ExplosiveTumble] Impact BOOM!"); } } catch { } } } [HarmonyPatch(typeof(PlayerTumble), "ImpactHurtSetRPC")] public static class Patch_GlassBones { private static void Prefix(ref int _damage) { if (REPOEventManager.GlassBones && SemiFunc.RunIsLevel()) { _damage *= 3; } } } [HarmonyPatch(typeof(PhysGrabHinge), "FixedUpdate")] public static class Patch_UnbreakableDoors { private static void Postfix(PhysGrabHinge __instance) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Expected O, but got Unknown if (!REPOEventManager.UnbreakableDoors || !SemiFunc.RunIsLevel()) { return; } try { if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { return; } FieldInfo field = typeof(PhysGrabHinge).GetField("joint", BindingFlags.Instance | BindingFlags.NonPublic); if (field != null) { HingeJoint val = (HingeJoint)field.GetValue(__instance); if ((Object)(object)val != (Object)null && ((Joint)val).breakForce != float.PositiveInfinity) { ((Joint)val).breakForce = float.PositiveInfinity; ((Joint)val).breakTorque = float.PositiveInfinity; } } SetField(__instance, "broken", false); SetField(__instance, "dead", false); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[UnbreakableDoors] Error: " + ex.Message)); } } private static void SetField(object obj, string name, object value) { obj.GetType().GetField(name, BindingFlags.Instance | BindingFlags.NonPublic)?.SetValue(obj, value); } } [HarmonyPatch(typeof(EnvironmentDirector), "Update")] public static class Patch_DiscoLights { private static float timer; private static void Postfix() { //IL_0056: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.HasEvent("disco_lights") || !SemiFunc.RunIsLevel()) { return; } timer += Time.deltaTime; if (timer > 0.5f) { timer = 0f; Light[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { array[i].color = new Color(Random.value, Random.value, Random.value); } } } } public static class BossFightManager { public static EnemyParent BossEnemy; public static bool BossUpgradeDropped; private static FieldInfo FI_EnemyParent; private static FieldInfo FI_Spawned; public static void Reset() { BossEnemy = null; BossUpgradeDropped = false; REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] Reset boss state"); } public static bool IsBoss(EnemyParent enemy) { if ((Object)(object)BossEnemy != (Object)null) { return (Object)(object)enemy == (Object)(object)BossEnemy; } return false; } public static EnemyParent GetEnemyParent(Enemy enemy) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown if (FI_EnemyParent == null) { FI_EnemyParent = AccessTools.Field(typeof(Enemy), "EnemyParent"); } return (EnemyParent)(FI_EnemyParent?.GetValue(enemy)); } public static bool IsEnemySpawned(EnemyParent enemy) { if (FI_Spawned == null) { FI_Spawned = AccessTools.Field(typeof(EnemyParent), "Spawned"); } return (bool)(FI_Spawned?.GetValue(enemy) ?? ((object)false)); } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_BossFight_ModifyEnemyList { private static void Postfix(EnemyDirector __instance) { if (!REPOEventManager.BossFight || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { List list = (List)AccessTools.Field(typeof(EnemyDirector), "enemyList").GetValue(__instance); int num = 0; for (int i = 0; i < list.Count; i++) { if ((Object)(object)list[i] != (Object)null && __instance.enemiesDifficulty3.Contains(list[i])) { num++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] Found {num} level 3 enemies in spawn list (total {list.Count})"); if (num > 0) { int num2 = Random.Range(0, num); int num3 = 0; for (int j = 0; j < list.Count; j++) { if ((Object)(object)list[j] != (Object)null && __instance.enemiesDifficulty3.Contains(list[j])) { if (num3 != num2) { EnemySetup value = ((Random.value < 0.5f && __instance.enemiesDifficulty1.Count > 0) ? __instance.enemiesDifficulty1[Random.Range(0, __instance.enemiesDifficulty1.Count)] : ((__instance.enemiesDifficulty2.Count <= 0) ? __instance.enemiesDifficulty1[Random.Range(0, __instance.enemiesDifficulty1.Count)] : __instance.enemiesDifficulty2[Random.Range(0, __instance.enemiesDifficulty2.Count)])); list[j] = value; REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] Replaced level 3 enemy at index {j}"); } else { REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] Kept boss at index {j}"); } num3++; } } } else if (__instance.enemiesDifficulty3.Count > 0) { EnemySetup val = __instance.enemiesDifficulty3[Random.Range(0, __instance.enemiesDifficulty3.Count)]; list.Insert(0, val); FieldInfo fieldInfo = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); int num4 = (int)fieldInfo.GetValue(__instance); fieldInfo.SetValue(__instance, num4 + 1); REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] Added boss to spawn list: " + ((Object)val).name)); } else { REPOConomyPlugin.Logger.LogWarning((object)"[BossFight] No difficulty 3 enemies available!"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Modify enemy list error: " + ex.Message + "\n" + ex.StackTrace)); } } } [HarmonyPatch(typeof(EnemyParent), "Awake")] public static class Patch_BossFight_MarkBoss { private static void Postfix(EnemyParent __instance) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 if (REPOEventManager.BossFight && (int)__instance.difficulty == 2 && (Object)(object)BossFightManager.BossEnemy == (Object)null) { BossFightManager.BossEnemy = __instance; REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] в\u00adђ Boss marked EARLY: " + __instance.enemyName)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_BossFight_TripleHealth { private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.BossFight) { return; } try { EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); if (Object.op_Implicit((Object)(object)componentInParent) && BossFightManager.IsBoss(componentInParent)) { __instance.health *= 3; AccessTools.Field(typeof(EnemyHealth), "healthCurrent").SetValue(__instance, __instance.health); REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] рџ’Є Boss health set to {__instance.health}"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Triple health error: " + ex.Message)); } } } [HarmonyPatch(typeof(Enemy), "Start")] public static class Patch_BossFight_BossSize { private static void Postfix(Enemy __instance) { //IL_002d: 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 (!REPOEventManager.BossFight || !SemiFunc.RunIsLevel()) { return; } try { EnemyParent enemyParent = BossFightManager.GetEnemyParent(__instance); if (Object.op_Implicit((Object)(object)enemyParent) && BossFightManager.IsBoss(enemyParent)) { ((Component)enemyParent).transform.localScale = Vector3.one * 1.3f; REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] рџ‘№ Boss scaled to 1.3x"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Boss size error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Update")] public static class Patch_BossFight_FastRespawn { private static void Postfix(EnemyParent __instance) { if (!REPOEventManager.BossFight || !SemiFunc.RunIsLevel()) { return; } try { if (BossFightManager.IsBoss(__instance) && !BossFightManager.IsEnemySpawned(__instance) && __instance.DespawnedTimer > 60f) { __instance.DespawnedTimerSet(60f, false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Fast respawn error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Update")] public static class Patch_BossFight_KeepAlive { private static FieldInfo FI_forceLeave = AccessTools.Field(typeof(EnemyParent), "forceLeave"); private static void Postfix(EnemyParent __instance) { if (!REPOEventManager.BossFight || !SemiFunc.IsMasterClientOrSingleplayer() || !BossFightManager.IsBoss(__instance)) { return; } try { if (__instance.SpawnedTimer < 1000f) { __instance.SpawnedTimer = 3600f; } if ((bool)FI_forceLeave.GetValue(__instance)) { FI_forceLeave.SetValue(__instance, false); REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] Prevented boss " + __instance.enemyName + " from being forced to leave.")); } } catch (Exception) { } } } [HarmonyPatch(typeof(HurtCollider), "EnemyHurt")] public static class Patch_BossFight_PitExactLogic { private static FieldInfo FI_applyForce = AccessTools.Field(typeof(HurtCollider), "applyForce"); private static FieldInfo FI_applyTorque = AccessTools.Field(typeof(HurtCollider), "applyTorque"); private static FieldInfo FI_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static FieldInfo FI_Health = AccessTools.Field(typeof(Enemy), "Health"); private static FieldInfo FI_HasRigidbody = AccessTools.Field(typeof(Enemy), "HasRigidbody"); private static FieldInfo FI_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_StateStunned = AccessTools.Field(typeof(Enemy), "StateStunned"); private static FieldInfo FI_deathPitCooldown = AccessTools.Field(typeof(EnemyHealth), "deathPitCooldown"); private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject"); private static MethodInfo MI_PhysObjectHurt = AccessTools.Method(typeof(HurtCollider), "PhysObjectHurt", new Type[7] { typeof(PhysGrabObject), typeof(BreakImpact), typeof(float), typeof(float), typeof(bool), typeof(bool), typeof(Enemy) }, (Type[])null); private static bool Prefix(HurtCollider __instance, Enemy _enemy) { //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_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) if (!__instance.deathPit) { return true; } if (!REPOEventManager.BossFight) { return true; } try { EnemyParent enemyParent = BossFightManager.GetEnemyParent(_enemy); if ((Object)(object)enemyParent == (Object)null || !BossFightManager.IsBoss(enemyParent)) { return true; } REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] рџ›ЎпёЏ Boss hit"); if ((bool)FI_HasHealth.GetValue(_enemy)) { object? value = FI_Health.GetValue(_enemy); EnemyHealth val = (EnemyHealth)((value is EnemyHealth) ? value : null); if ((Object)(object)val != (Object)null) { if ((float)FI_deathPitCooldown.GetValue(val) <= 0f) { val.DeathPitCooldown(); object value2 = FI_StateStunned.GetValue(_enemy); value2?.GetType().GetMethod("Set").Invoke(value2, new object[1] { 3f }); if ((bool)FI_HasRigidbody.GetValue(_enemy)) { object? value3 = FI_Rigidbody.GetValue(_enemy); EnemyRigidbody val2 = (EnemyRigidbody)((value3 is EnemyRigidbody) ? value3 : null); if ((Object)(object)val2 != (Object)null) { object? value4 = FI_physGrabObject.GetValue(val2); PhysGrabObject val3 = (PhysGrabObject)((value4 is PhysGrabObject) ? value4 : null); if ((Object)(object)val3 != (Object)null) { MI_PhysObjectHurt.Invoke(__instance, new object[7] { val3, (object)(BreakImpact)3, 0.1f, 0.1f, false, true, _enemy }); Vector3 val4 = (Vector3)FI_applyForce.GetValue(__instance); Vector3 val5 = (Vector3)FI_applyTorque.GetValue(__instance); val2.FreezeForces(val4 * 10f, val5 * 10f); _enemy.Freeze(0.2f); REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] Boss pushed"); } } } } else { REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] вЏ±пёЏ Boss on death pit cooldown, skipping"); } } } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Pit exact logic error: " + ex.Message + "\n" + ex.StackTrace)); return true; } } } [HarmonyPatch(typeof(EnemyHealth), "DeathImpulseRPC")] public static class Patch_BossFight_UpgradeDrop { private static void Postfix(EnemyHealth __instance) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Invalid comparison between Unknown and I4 //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Invalid comparison between Unknown and I4 //IL_03c3: 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_0330: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0266: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Invalid comparison between Unknown and I4 if (!REPOEventManager.BossFight || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { EnemyParent componentInParent = ((Component)__instance).GetComponentInParent(); if (!Object.op_Implicit((Object)(object)componentInParent) || !BossFightManager.IsBoss(componentInParent) || BossFightManager.BossUpgradeDropped) { return; } BossFightManager.BossUpgradeDropped = true; Vector3 val = ((Component)__instance).transform.position + Vector3.up * 1f; REPOConomyPlugin.Logger.LogInfo((object)"[BossFight] рџЋЇ Boss defeated! Searching for upgrade..."); REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] itemDictionary total items: {StatsManager.instance.itemDictionary.Count}"); List list = new List(); foreach (KeyValuePair item in StatsManager.instance.itemDictionary) { Item value = item.Value; if ((int)value.itemType == 4) { REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] Found player_upgrade: '" + item.Key + "', " + $"disabled={value.disabled}, " + "itemName='" + value.itemName + "', prefab=" + ((value.prefab != null) ? "exists" : "NULL"))); if (!value.disabled) { list.Add(value); } } } REPOConomyPlugin.Logger.LogInfo((object)$"[BossFight] Found {list.Count} enabled player upgrades"); if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[BossFight] No player_upgrade found! Trying item_upgrade..."); foreach (KeyValuePair item2 in StatsManager.instance.itemDictionary) { Item value2 = item2.Value; if ((int)value2.itemType == 3 && !value2.disabled) { REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] Found item_upgrade: '" + item2.Key + "'")); list.Add(value2); } } } if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[BossFight] Still no upgrades! Dropping power crystal instead..."); foreach (KeyValuePair item3 in StatsManager.instance.itemDictionary) { Item value3 = item3.Value; if ((int)value3.itemType == 5 && !value3.disabled) { list.Add(value3); break; } } } if (list.Count == 0) { REPOConomyPlugin.Logger.LogError((object)"[BossFight] вќЊ Could not find ANY suitable item to drop!"); return; } Item val2 = list[Random.Range(0, list.Count)]; REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] Selected upgrade: '" + ((Object)val2).name + "' (" + val2.itemName + ")")); if (GameManager.instance.gameMode == 0) { GameObject prefab = val2.prefab.Prefab; if ((Object)(object)prefab != (Object)null) { ItemAttributes component = Object.Instantiate(prefab, val, Quaternion.identity).GetComponent(); if ((Object)(object)component != (Object)null) { StatsManager.instance.ItemAdd(((Object)val2).name, component, -1); REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] рџЋЃ Boss dropped upgrade: " + val2.itemName)); } else { REPOConomyPlugin.Logger.LogError((object)"[BossFight] Spawned object has no ItemAttributes!"); } } else { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Prefab is NULL for " + ((Object)val2).name)); } } else { string resourcePath = val2.prefab.ResourcePath; if (!string.IsNullOrEmpty(resourcePath)) { PhotonNetwork.InstantiateRoomObject(resourcePath, val, Quaternion.identity, (byte)0, (object[])null); REPOConomyPlugin.Logger.LogInfo((object)("[BossFight] рџЋЃ Boss dropped upgrade: " + val2.itemName)); } else { REPOConomyPlugin.Logger.LogError((object)("[BossFight] ResourcePath is empty for " + ((Object)val2).name)); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BossFight] Upgrade drop error: " + ex.Message + "\n" + ex.StackTrace)); } } } [HarmonyPatch(typeof(EnemyParent), "Update")] public static class Patch_TooQuiet_EnforceDelay { private static HashSet processedEnemies = new HashSet(); private static FieldInfo FI_Spawned = AccessTools.Field(typeof(EnemyParent), "Spawned"); public static void Reset() { processedEnemies.Clear(); } private static void Postfix(EnemyParent __instance) { if (!REPOEventManager.TooQuiet || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel() || Time.timeSinceLevelLoad > 15f) { return; } try { if (!(bool)FI_Spawned.GetValue(__instance) && __instance.DespawnedTimer < 30f) { int instanceID = ((Object)__instance).GetInstanceID(); float num = (__instance.DespawnedTimer = Random.Range(60f, 150f)); if (!processedEnemies.Contains(instanceID)) { processedEnemies.Add(instanceID); REPOConomyPlugin.Logger.LogInfo((object)$"[TooQuiet] 🤫 Shhh... Forced delay on {__instance.enemyName}: {num:F1}s"); } } } catch (Exception) { } } } [HarmonyPatch(typeof(PhysGrabber), "PhysGrabOverCharge")] public static class Patch_UnstableGrabbing_Unlock { private static FieldInfo FI_overrideOverchargeDisableTimer = AccessTools.Field(typeof(PhysGrabber), "overrideOverchargeDisableTimer"); private static FieldInfo FI_physGrabBeamOverChargeAmount = AccessTools.Field(typeof(PhysGrabber), "physGrabBeamOverChargeAmount"); private static FieldInfo FI_physGrabBeamOverchargeInitialBoostCooldown = AccessTools.Field(typeof(PhysGrabber), "physGrabBeamOverchargeInitialBoostCooldown"); private static FieldInfo FI_physGrabBeamOverChargeFloat = AccessTools.Field(typeof(PhysGrabber), "physGrabBeamOverChargeFloat"); private static FieldInfo FI_physGrabBeamOverChargeTimer = AccessTools.Field(typeof(PhysGrabber), "physGrabBeamOverChargeTimer"); private static FieldInfo FI_physGrabBeamOverchargeDecreaseCooldown = AccessTools.Field(typeof(PhysGrabber), "physGrabBeamOverchargeDecreaseCooldown"); private static bool Prefix(PhysGrabber __instance, float _amount, float _multiplier) { if (!REPOEventManager.UnstableGrabbing) { return true; } try { if ((float)FI_overrideOverchargeDisableTimer.GetValue(__instance) > 0f) { return false; } if (PlayerController.instance.DebugDisableOvercharge) { return false; } float num = 1f; if (SemiFunc.MoonLevel() == 3) { num = 1.25f; } else if (SemiFunc.MoonLevel() >= 4) { num = 1.5f; } float num2 = (float)FI_physGrabBeamOverChargeAmount.GetValue(__instance); float num3 = (float)FI_physGrabBeamOverchargeInitialBoostCooldown.GetValue(__instance); float num4 = (float)FI_physGrabBeamOverChargeFloat.GetValue(__instance); if (num2 == 0f && num3 <= 0f) { FI_physGrabBeamOverchargeInitialBoostCooldown.SetValue(__instance, 1f); float num5 = num4 + 0.1f * _multiplier * num; FI_physGrabBeamOverChargeFloat.SetValue(__instance, num5); } FI_physGrabBeamOverChargeAmount.SetValue(__instance, _amount * num); FI_physGrabBeamOverChargeTimer.SetValue(__instance, 0.2f); FI_physGrabBeamOverchargeDecreaseCooldown.SetValue(__instance, 1.5f); return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[UnstableGrabbing] Unlock Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(PhysGrabber), "FixedUpdate")] public static class Patch_UnstableGrabbing_HeavyLifting { private static FieldInfo FI_grabbedPhysGrabObject = AccessTools.Field(typeof(PhysGrabber), "grabbedPhysGrabObject"); private static void Postfix(PhysGrabber __instance) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown if (!REPOEventManager.UnstableGrabbing || !__instance.isLocal) { return; } try { PhysGrabObject val = (PhysGrabObject)FI_grabbedPhysGrabObject.GetValue(__instance); if (__instance.grabbed && (Object)(object)val != (Object)null && !((Object)(object)((Component)val).GetComponent() != (Object)null) && !((Object)(object)val.rb == (Object)null)) { float mass = val.rb.mass; float num = __instance.grabStrength * 2.5f; if (mass > num) { float num2 = Mathf.Clamp((mass - num) * 0.05f, 0.02f, 0.2f); __instance.PhysGrabOverCharge(num2, 1f); } } } catch (Exception) { } } } [HarmonyPatch(typeof(PhysGrabber), "PhysGrabOverCharge")] public static class Patch_NoOvercharge { [HarmonyPriority(600)] private static bool Prefix() { if (REPOEventManager.NoOvercharge) { return false; } return true; } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] public static class Patch_FoggyVision { private const float FogMultiplier = 0.3f; private static float lastBaseStartDistance = -1f; private static float lastBaseEndDistance = -1f; private static float lastAppliedStartDistance = -1f; private static float lastAppliedEndDistance = -1f; private static bool loggedThisLevel = false; private static bool originalCaptured = false; private static bool originalFog; private static float originalFogStartDistance; private static float originalFogEndDistance; private static float originalFarClipPlane; private static readonly FieldInfo FI_playerDeadSet = AccessTools.Field(typeof(PlayerAvatar), "deadSet"); private static readonly FieldInfo FI_playerSpectating = AccessTools.Field(typeof(PlayerAvatar), "spectating"); [HarmonyPostfix] private static void SetupP(ref Camera ___MainCamera) { if (!REPOEventManager.FoggyVision || !SemiFunc.RunIsLevel()) { return; } try { loggedThisLevel = false; Apply(___MainCamera); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FoggyVision] Error: " + ex.Message)); } } public static void Apply(Camera mainCamera) { CaptureOriginal(mainCamera); if (IsLocalPlayerSpectatingOrDead()) { DisableForSpectate(mainCamera); return; } float fogStartDistance = RenderSettings.fogStartDistance; float fogEndDistance = RenderSettings.fogEndDistance; if (Mathf.Approximately(fogStartDistance, lastAppliedStartDistance) && Mathf.Approximately(fogEndDistance, lastAppliedEndDistance) && lastBaseEndDistance > 0f) { fogStartDistance = lastBaseStartDistance; fogEndDistance = lastBaseEndDistance; } lastBaseStartDistance = fogStartDistance; lastBaseEndDistance = fogEndDistance; float num = Mathf.Max(0f, fogStartDistance * 0.3f); float num2 = Mathf.Max(num + 1f, fogEndDistance * 0.3f); RenderSettings.fog = true; RenderSettings.fogStartDistance = num; RenderSettings.fogEndDistance = num2; lastAppliedStartDistance = num; lastAppliedEndDistance = num2; if ((Object)(object)mainCamera != (Object)null) { mainCamera.farClipPlane = Mathf.Max(originalFarClipPlane, num2 + 1f); } if (!loggedThisLevel) { loggedThisLevel = true; REPOConomyPlugin.Logger.LogInfo((object)$"[FoggyVision] Applied dense fog: {fogStartDistance:F1}-{fogEndDistance:F1} -> {num:F1}-{num2:F1}"); } } public static void Reset() { RestoreOriginal(((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.MainCamera : null); lastBaseStartDistance = -1f; lastBaseEndDistance = -1f; lastAppliedStartDistance = -1f; lastAppliedEndDistance = -1f; loggedThisLevel = false; originalCaptured = false; } private static void CaptureOriginal(Camera mainCamera) { if (!originalCaptured) { originalCaptured = true; originalFog = RenderSettings.fog; originalFogStartDistance = RenderSettings.fogStartDistance; originalFogEndDistance = RenderSettings.fogEndDistance; originalFarClipPlane = (((Object)(object)mainCamera != (Object)null) ? mainCamera.farClipPlane : 1000f); } } private static void RestoreOriginal(Camera mainCamera) { if (originalCaptured) { RenderSettings.fog = originalFog; RenderSettings.fogStartDistance = originalFogStartDistance; RenderSettings.fogEndDistance = originalFogEndDistance; if ((Object)(object)mainCamera != (Object)null) { mainCamera.farClipPlane = originalFarClipPlane; } } } public static void DisableForSpectate(Camera mainCamera) { RenderSettings.fog = false; RenderSettings.fogStartDistance = 0f; RenderSettings.fogEndDistance = 100000f; if ((Object)(object)mainCamera != (Object)null) { mainCamera.farClipPlane = Mathf.Max(originalCaptured ? originalFarClipPlane : mainCamera.farClipPlane, 90f); } } private static bool IsLocalPlayerSpectatingOrDead() { PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)SpectateCamera.instance != (Object)null) { return true; } if ((Object)(object)instance == (Object)null) { return false; } bool num = (bool)(FI_playerDeadSet?.GetValue(instance) ?? ((object)false)); bool flag = (bool)(FI_playerSpectating?.GetValue(instance) ?? ((object)false)); return num || flag; } } [HarmonyPatch(typeof(SpectateCamera), "LateUpdate")] public static class Patch_FoggyVision_SpectateCameraLateUpdate { [HarmonyPostfix] private static void Postfix() { if (REPOEventManager.FoggyVision && SemiFunc.RunIsLevel()) { Patch_FoggyVision.DisableForSpectate(((Object)(object)GameDirector.instance != (Object)null) ? GameDirector.instance.MainCamera : Camera.main); } } } [HarmonyPatch(typeof(EnvironmentDirector), "Update")] public static class Patch_FoggyVision_Update { [HarmonyPostfix] private static void Postfix(ref Camera ___MainCamera) { if (!REPOEventManager.FoggyVision || !SemiFunc.RunIsLevel()) { return; } try { Patch_FoggyVision.Apply(___MainCamera); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FoggyVision] Update error: " + ex.Message)); } } } [HarmonyPatch(typeof(PhysGrabCart))] internal class Patch_ScaleInCart_TrackCart { private static Dictionary grabObjectsInCarts = new Dictionary(); [HarmonyPatch("ObjectsInCart")] [HarmonyPostfix] private static void ObjectsInCart(PhysGrabCart __instance, List ___itemsInCart) { try { List list = new List(); foreach (PhysGrabObject item in ___itemsInCart) { if ((Object)(object)item != (Object)null && (bool)AccessTools.Field(typeof(PhysGrabObject), "isValuable").GetValue(item)) { list.Add(item); } } grabObjectsInCarts[__instance] = list.ToArray(); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PhantomObjects] TrackCart error: " + ex.Message)); } } public static bool IsInCart(PhysGrabObject obj) { foreach (KeyValuePair grabObjectsInCart in grabObjectsInCarts) { PhysGrabObject[] value = grabObjectsInCart.Value; for (int i = 0; i < value.Length; i++) { if ((Object)(object)value[i] == (Object)(object)obj) { return true; } } } return false; } public static void Reset() { grabObjectsInCarts.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[ScaleInCart] Reset carts"); } } [HarmonyPatch(typeof(PhysGrabObject), "Update")] public static class Patch_ValuableScaling_Unified { private const float CartCompressionBoost = 0.85f; private static Dictionary originalScales = new Dictionary(); private static Dictionary originalMasses = new Dictionary(); private static HashSet loggedObjects = new HashSet(); private static FieldInfo FI_isValuable = AccessTools.Field(typeof(PhysGrabObject), "isValuable"); private static FieldInfo FI_roomVolumeCheck = AccessTools.Field(typeof(ValuableObject), "roomVolumeCheck"); private static FieldInfo FI_inExtractionPoint = AccessTools.Field(typeof(RoomVolumeCheck), "inExtractionPoint"); public static void Reset() { originalScales.Clear(); originalMasses.Clear(); loggedObjects.Clear(); } private static void Postfix(PhysGrabObject __instance) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Expected O, but got Unknown //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_011a: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Invalid comparison between Unknown and I4 //IL_020b: 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_0212: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: 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_0244: Unknown result type (might be due to invalid IL or missing references) //IL_024b: Unknown result type (might be due to invalid IL or missing references) //IL_026b: 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_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: 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_02dd: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel() || !(bool)FI_isValuable.GetValue(__instance)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!originalScales.ContainsKey(instanceID)) { originalScales[instanceID] = ((Component)__instance).transform.localScale; } Vector3 val = originalScales[instanceID]; float num = 1f; bool flag = false; bool flag2 = false; bool num2 = REPOEventManager.ScaleInCart || REPOConfig.ForceScaleInCart.Value || REPOEventManager.BulkyCargo; bool flag3 = REPOEventManager.ShrinkExtractionValuables || REPOConfig.ForceExtractionShrink.Value; if (num2 && Patch_ScaleInCart_TrackCart.IsInCart(__instance)) { flag = true; } ValuableObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component == (Object)null) { return; } if (flag3) { RoomVolumeCheck val2 = (RoomVolumeCheck)FI_roomVolumeCheck.GetValue(component); if ((Object)(object)val2 != (Object)null && (bool)FI_inExtractionPoint.GetValue(val2)) { flag2 = true; } } Type volumeType = component.volumeType; if (flag) { num = (REPOEventManager.BulkyCargo ? (((int)volumeType == 0 || (int)volumeType == 1) ? 1.6f : 1f) : ((!REPOConfig.ForceScaleInCart.Value) ? GetDefaultCartScale(volumeType) : (REPOEventManager.GetScaleForType(volumeType, REPOEventManager.cartScaleTable) * 0.85f))); } else if (flag2) { num = ((!REPOConfig.ForceExtractionShrink.Value) ? GetDefaultExtractionScale(volumeType) : REPOEventManager.GetScaleForType(volumeType, REPOEventManager.extractionScaleTable)); } if (flag || flag2) { if (!loggedObjects.Contains(instanceID)) { string text = (flag ? "Cart" : "Extraction"); REPOConomyPlugin.Logger.LogInfo((object)("[ScaleDebug] рџ“Џ Shrinking '" + ((Object)((Component)__instance).gameObject).name + "' in " + text + ". " + $"Type: {volumeType} -> Scale: {num:F2}x")); loggedObjects.Add(instanceID); } } else if (loggedObjects.Contains(instanceID)) { loggedObjects.Remove(instanceID); } Vector3 val3 = val * num; Vector3 val4 = ((Component)__instance).transform.localScale - val3; if (((Vector3)(ref val4)).sqrMagnitude > 0.0001f) { float num3 = 0.45f * Mathf.Pow(val.x * val.y * val.z, 1f / 3f) * Time.deltaTime; val4 = ((Component)__instance).transform.localScale - val3; float magnitude = ((Vector3)(ref val4)).magnitude; float num4 = ((magnitude > 0f) ? Mathf.Clamp01(num3 / magnitude) : 1f); ((Component)__instance).transform.localScale = Vector3.Lerp(((Component)__instance).transform.localScale, val3, num4); } float scaleFactor = ((val.x > 0.0001f) ? (((Component)__instance).transform.localScale.x / val.x) : num); ApplyCartMass(__instance, scaleFactor); } private static void ApplyCartMass(PhysGrabObject physGrabObject, float scaleFactor) { if ((Object)(object)physGrabObject == (Object)null || (Object)(object)physGrabObject.rb == (Object)null) { return; } int instanceID = ((Object)physGrabObject).GetInstanceID(); if (scaleFactor >= 0.999f) { if (originalMasses.TryGetValue(instanceID, out var value) && !Mathf.Approximately(physGrabObject.massOriginal, value)) { physGrabObject.massOriginal = value; } return; } if (!originalMasses.ContainsKey(instanceID)) { originalMasses[instanceID] = physGrabObject.rb.mass; } float num = originalMasses[instanceID] * scaleFactor; if (!Mathf.Approximately(physGrabObject.rb.mass, num) || !Mathf.Approximately(physGrabObject.massOriginal, num)) { physGrabObject.massOriginal = num; physGrabObject.rb.mass = num; physGrabObject.OverrideMass(num, 0.1f); } } private static float GetDefaultCartScale(Type type) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown return (int)type switch { 0 => 0.63750005f, 1 => 0.5525f, 2 => 0.46750003f, 3 => 0.3825f, 4 => 0.2975f, 5 => 0.25500003f, 6 => 0.2125f, _ => 0.51000005f, }; } private static float GetDefaultExtractionScale(Type type) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown return (int)type switch { 0 => 0.85f, 1 => 0.75f, 2 => 0.65f, 3 => 0.55f, 4 => 0.45f, 5 => 0.35f, 6 => 0.3f, _ => 0.65f, }; } } [HarmonyPatch(typeof(ValuableObject), "Update")] public static class Patch_ZeroGravityLoot_Update { private static FieldInfo FI_rb = AccessTools.Field(typeof(ValuableObject), "rb"); private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); private static void Postfix(ValuableObject __instance) { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown if (!REPOEventManager.ZeroGravityLoot || !SemiFunc.RunIsLevel()) { return; } try { Rigidbody val = (Rigidbody)FI_rb.GetValue(__instance); if (!((Object)(object)val == (Object)null)) { object? value = FI_physGrabObject.GetValue(__instance); PhysGrabObject val2 = (PhysGrabObject)((value is PhysGrabObject) ? value : null); bool flag = (Object)(object)val2 != (Object)null && Patch_ScaleInCart_TrackCart.IsInCart(val2); if (flag && !val.useGravity) { val.useGravity = true; } else if (!flag && val.useGravity) { val.useGravity = false; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ZeroGravityLoot] Update Error: " + ex.Message)); } } } public static class InvincibleHorrorManager { public static int EnemyID = -1; public static void Reset() { EnemyID = -1; REPOConomyPlugin.Logger.LogInfo((object)"[InvincibleHorror] Reset selected enemy"); } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_InvincibleHorror_Selection { private static float checkTimer = 0f; private static FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static FieldInfo FI_Spawned = AccessTools.Field(typeof(EnemyParent), "Spawned"); private static void Postfix(EnemyDirector __instance) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_026d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.InvincibleHorror || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } checkTimer += Time.deltaTime; if (checkTimer < 2f) { return; } checkTimer = 0f; bool flag = false; if (InvincibleHorrorManager.EnemyID != -1) { foreach (EnemyParent item in __instance.enemiesSpawned) { if (!((Object)(object)item == (Object)null)) { Enemy val = (Enemy)FI_Enemy.GetValue(item); bool flag2 = (bool)FI_Spawned.GetValue(item); if ((Object)(object)val != (Object)null && ((Object)((Component)val).gameObject).GetInstanceID() == InvincibleHorrorManager.EnemyID && flag2) { flag = true; break; } } } } if (flag || __instance.enemiesSpawned.Count <= 0) { return; } List list = new List(); foreach (EnemyParent item2 in __instance.enemiesSpawned) { if (!((Object)(object)item2 == (Object)null)) { bool num = (bool)FI_Spawned.GetValue(item2); Enemy val2 = (Enemy)FI_Enemy.GetValue(item2); if (num && (Object)(object)val2 != (Object)null) { list.Add(item2); } } } if (list.Count <= 0) { return; } List list2 = list.Where((EnemyParent e) => (int)e.difficulty == 2).ToList(); List list3 = list.Where((EnemyParent e) => (int)e.difficulty == 1).ToList(); EnemyParent val3 = ((list2.Count > 0) ? list2[Random.Range(0, list2.Count)] : ((list3.Count <= 0) ? list[Random.Range(0, list.Count)] : list3[Random.Range(0, list3.Count)])); InvincibleHorrorManager.EnemyID = ((Object)((Component)(Enemy)FI_Enemy.GetValue(val3)).gameObject).GetInstanceID(); Renderer[] componentsInChildren = ((Component)val3).GetComponentsInChildren(); foreach (Renderer val4 in componentsInChildren) { if (val4.material.HasProperty("_Color")) { val4.material.color = Color.black; } } REPOConomyPlugin.Logger.LogInfo((object)$"[InvincibleHorror] рџ‘№ New Horror Selected: {val3.enemyName} (ID: {InvincibleHorrorManager.EnemyID})"); } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_InvincibleHorror_Damage { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (!REPOEventManager.InvincibleHorror || !SemiFunc.RunIsLevel()) { return; } try { Enemy componentInParent = ((Component)__instance).GetComponentInParent(); if (!((Object)(object)componentInParent == (Object)null) && ((Object)((Component)componentInParent).gameObject).GetInstanceID() == InvincibleHorrorManager.EnemyID) { _damage = 0; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvincibleHorror] Damage Error: " + ex.Message)); } } } [HarmonyPatch(typeof(HurtCollider), "EnemyHurt")] public static class Patch_InvincibleHorror_PitLogic { private static FieldInfo FI_applyForce = AccessTools.Field(typeof(HurtCollider), "applyForce"); private static FieldInfo FI_applyTorque = AccessTools.Field(typeof(HurtCollider), "applyTorque"); private static MethodInfo MI_PhysObjectHurt = AccessTools.Method(typeof(HurtCollider), "PhysObjectHurt", new Type[7] { typeof(PhysGrabObject), typeof(BreakImpact), typeof(float), typeof(float), typeof(bool), typeof(bool), typeof(Enemy) }, (Type[])null); private static FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static FieldInfo FI_Enemy_StateStunned = AccessTools.Field(typeof(Enemy), "StateStunned"); private static FieldInfo FI_Enemy_HasRigidbody = AccessTools.Field(typeof(Enemy), "HasRigidbody"); private static FieldInfo FI_Enemy_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_Health_DeathPitCooldown = AccessTools.Field(typeof(EnemyHealth), "deathPitCooldown"); private static FieldInfo FI_ERB_PhysGrabObject = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject"); private static bool Prefix(HurtCollider __instance, Enemy _enemy) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Expected O, but got Unknown //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.InvincibleHorror || !__instance.deathPit) { return true; } if (!SemiFunc.RunIsLevel()) { return true; } if ((Object)(object)_enemy == (Object)null || ((Object)((Component)_enemy).gameObject).GetInstanceID() != InvincibleHorrorManager.EnemyID) { return true; } try { EnemyHealth val = (EnemyHealth)FI_Enemy_Health.GetValue(_enemy); if ((Object)(object)val == (Object)null) { return true; } if ((float)FI_Health_DeathPitCooldown.GetValue(val) <= 0f) { val.DeathPitCooldown(); EnemyStateStunned val2 = (EnemyStateStunned)FI_Enemy_StateStunned.GetValue(_enemy); if ((Object)(object)val2 != (Object)null) { val2.Set(5f); } if ((bool)FI_Enemy_HasRigidbody.GetValue(_enemy)) { EnemyRigidbody val3 = (EnemyRigidbody)FI_Enemy_Rigidbody.GetValue(_enemy); if ((Object)(object)val3 != (Object)null) { PhysGrabObject val4 = (PhysGrabObject)FI_ERB_PhysGrabObject.GetValue(val3); if ((Object)(object)val4 != (Object)null) { MI_PhysObjectHurt.Invoke(__instance, new object[7] { val4, (object)(BreakImpact)3, 0.1f, 0.1f, false, true, _enemy }); Vector3 val5 = (Vector3)FI_applyForce.GetValue(__instance); Vector3 val6 = (Vector3)FI_applyTorque.GetValue(__instance); val3.FreezeForces(val5 * 10f, val6 * 10f); _enemy.Freeze(0.2f); REPOConomyPlugin.Logger.LogInfo((object)"[InvincibleHorror] рџ•іпёЏ Enemy fell in pit! Launching out..."); } } } } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvincibleHorror] Pit Logic Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(HurtCollider), "PlayerHurt")] public static class Patch_PitImmunity_Player { private static Dictionary playerPitCooldowns = new Dictionary(); public static void Reset() { playerPitCooldowns.Clear(); } private static bool Prefix(HurtCollider __instance, PlayerAvatar _player) { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_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_009c: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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 (!REPOEventManager.PitImmunity || !__instance.deathPit || !Object.op_Implicit((Object)(object)_player)) { return true; } if (!SemiFunc.RunIsLevel()) { return true; } try { int instanceID = ((Object)_player).GetInstanceID(); if (playerPitCooldowns.TryGetValue(instanceID, out var value) && Time.time < value) { return false; } PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(_player); if ((Object)(object)playerTumble != (Object)null) { playerPitCooldowns[instanceID] = Time.time + 1f; playerTumble.TumbleRequest(true, false); Vector3 val = Vector3.up * 60f + Random.insideUnitSphere * 10f; playerTumble.TumbleForce(val); playerTumble.TumbleTorque(Random.insideUnitSphere * 15f); PhysGrabObject component = ((Component)_player).GetComponent(); if ((Object)(object)component != (Object)null) { component.DeathPitEffectCreate(); } REPOConomyPlugin.Logger.LogInfo((object)"[PitImmunity] рџљЂ Launched"); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PitImmunity] Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(HurtCollider), "EnemyHurt")] public static class Patch_EnemiesPitImmunity { private static FieldInfo FI_applyForce = AccessTools.Field(typeof(HurtCollider), "applyForce"); private static FieldInfo FI_applyTorque = AccessTools.Field(typeof(HurtCollider), "applyTorque"); private static MethodInfo MI_PhysObjectHurt = AccessTools.Method(typeof(HurtCollider), "PhysObjectHurt", new Type[7] { typeof(PhysGrabObject), typeof(BreakImpact), typeof(float), typeof(float), typeof(bool), typeof(bool), typeof(Enemy) }, (Type[])null); private static FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static FieldInfo FI_Enemy_StateStunned = AccessTools.Field(typeof(Enemy), "StateStunned"); private static FieldInfo FI_Enemy_HasRigidbody = AccessTools.Field(typeof(Enemy), "HasRigidbody"); private static FieldInfo FI_Enemy_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_Health_DeathPitCooldown = AccessTools.Field(typeof(EnemyHealth), "deathPitCooldown"); private static FieldInfo FI_ERB_PhysGrabObject = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject"); private static bool Prefix(HurtCollider __instance, Enemy _enemy) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0150: 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_015c: 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) if (!REPOEventManager.EnemiesPitImmunity || !__instance.deathPit || (Object)(object)_enemy == (Object)null) { return true; } if (!SemiFunc.RunIsLevel()) { return true; } try { EnemyHealth val = (EnemyHealth)FI_Enemy_Health.GetValue(_enemy); if ((Object)(object)val == (Object)null) { return true; } if ((float)FI_Health_DeathPitCooldown.GetValue(val) <= 0f) { val.DeathPitCooldown(); EnemyStateStunned val2 = (EnemyStateStunned)FI_Enemy_StateStunned.GetValue(_enemy); if ((Object)(object)val2 != (Object)null) { val2.Set(5f); } if ((bool)FI_Enemy_HasRigidbody.GetValue(_enemy)) { EnemyRigidbody val3 = (EnemyRigidbody)FI_Enemy_Rigidbody.GetValue(_enemy); if ((Object)(object)val3 != (Object)null) { PhysGrabObject val4 = (PhysGrabObject)FI_ERB_PhysGrabObject.GetValue(val3); if ((Object)(object)val4 != (Object)null) { MI_PhysObjectHurt.Invoke(__instance, new object[7] { val4, (object)(BreakImpact)3, 0.1f, 0.1f, false, true, _enemy }); Vector3 val5 = (Vector3)FI_applyForce.GetValue(__instance); Vector3 val6 = (Vector3)FI_applyTorque.GetValue(__instance); val3.FreezeForces(val5 * 10f, val6 * 10f); _enemy.Freeze(0.2f); REPOConomyPlugin.Logger.LogInfo((object)("[RubberPits] Saved enemy " + ((Object)_enemy).name + " from pit!")); } } } } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RubberPits] Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(ValuableDirector), "SetupHost")] public static class Patch_LevelGlitch { private static void Prefix(ValuableDirector __instance) { if (!REPOEventManager.LevelGlitch || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } try { REPOConomyPlugin.Logger.LogInfo((object)"[LevelGlitch] рџ‘ѕ Initializing Glitch... Injecting ALL items into pool."); LevelValuables[] array = Resources.FindObjectsOfTypeAll(); if (array == null || array.Length == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[LevelGlitch] No LevelValuables found in Resources!"); return; } List list = (List)AccessTools.Field(typeof(ValuableDirector), "tinyValuables").GetValue(__instance); List list2 = (List)AccessTools.Field(typeof(ValuableDirector), "smallValuables").GetValue(__instance); List list3 = (List)AccessTools.Field(typeof(ValuableDirector), "mediumValuables").GetValue(__instance); List list4 = (List)AccessTools.Field(typeof(ValuableDirector), "bigValuables").GetValue(__instance); List list5 = (List)AccessTools.Field(typeof(ValuableDirector), "wideValuables").GetValue(__instance); List list6 = (List)AccessTools.Field(typeof(ValuableDirector), "tallValuables").GetValue(__instance); List list7 = (List)AccessTools.Field(typeof(ValuableDirector), "veryTallValuables").GetValue(__instance); int num = 0; LevelValuables[] array2 = array; foreach (LevelValuables val in array2) { if (!((Object)(object)val == (Object)null)) { if (val.tiny != null) { list.AddRange(val.tiny); } if (val.small != null) { list2.AddRange(val.small); } if (val.medium != null) { list3.AddRange(val.medium); } if (val.big != null) { list4.AddRange(val.big); } if (val.wide != null) { list5.AddRange(val.wide); } if (val.tall != null) { list6.AddRange(val.tall); } if (val.veryTall != null) { list7.AddRange(val.veryTall); } num++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[LevelGlitch] 🧬 Injected presets from {num} sources. Loot pool is now corrupted/expanded!"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LevelGlitch] Error: " + ex.Message)); } } } public static class SmashBrosManager { private static Dictionary damagePercentages = new Dictionary(); public static bool IsDeathPitFrame = false; public static void Reset() { damagePercentages.Clear(); IsDeathPitFrame = false; REPOConomyPlugin.Logger.LogInfo((object)"[SmashBros] Reset percentages"); } public static float AddDamage(int id, float damage) { if (!damagePercentages.ContainsKey(id)) { damagePercentages[id] = 0f; } damagePercentages[id] += damage; return damagePercentages[id]; } public static float GetMultiplier(int id) { if (!damagePercentages.ContainsKey(id)) { return 1f; } return damagePercentages[id] / 50f + 1f; } } [HarmonyPatch(typeof(HurtCollider), "PlayerHurt")] public static class Patch_Smash_PitCheck_Player { private static void Prefix(HurtCollider __instance) { if (__instance.deathPit) { SmashBrosManager.IsDeathPitFrame = true; } } private static void Postfix() { SmashBrosManager.IsDeathPitFrame = false; } } [HarmonyPatch(typeof(HurtCollider), "EnemyHurt")] public static class Patch_Smash_PitCheck_Enemy { private static void Prefix(HurtCollider __instance) { if (__instance.deathPit) { SmashBrosManager.IsDeathPitFrame = true; } } private static void Postfix() { SmashBrosManager.IsDeathPitFrame = false; } } public static class HealTransferState { public static bool IsHealingTransferActive; } [HarmonyPatch(typeof(PlayerHealth), "HealOther")] public static class Patch_PlayerHealth_HealOther_Tracker { [HarmonyPrefix] private static void Prefix() { HealTransferState.IsHealingTransferActive = true; } [HarmonyPostfix] private static void Postfix() { HealTransferState.IsHealingTransferActive = false; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Smash_PlayerHurt { private static bool Prefix(PlayerHealth __instance, int damage, bool savingGrace, bool hurtByHeal = false) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0159: 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) if (!REPOEventManager.SettleItInSmash || !SemiFunc.RunIsLevel() || damage <= 0) { return true; } if (hurtByHeal) { return true; } if (HealTransferState.IsHealingTransferActive) { return true; } try { if (SmashBrosManager.IsDeathPitFrame) { return true; } PlayerAvatar val = ((Component)__instance).GetComponent(); if ((Object)(object)val == (Object)null) { val = (PlayerAvatar)AccessTools.Field(typeof(PlayerHealth), "playerAvatar").GetValue(__instance); } if ((Object)(object)val == (Object)null) { return true; } bool flag = false; PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(val); if ((Object)(object)playerTumble != (Object)null) { FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerTumble), "impactHurtTimer"); if (fieldInfo != null && (float)fieldInfo.GetValue(playerTumble) > 0f) { flag = true; } } if (flag) { return true; } int instanceID = ((Object)val).GetInstanceID(); float num = SmashBrosManager.AddDamage(instanceID, damage); float multiplier = SmashBrosManager.GetMultiplier(instanceID); if ((Object)(object)playerTumble != (Object)null) { playerTumble.TumbleRequest(true, false); Vector3 val2 = Vector3.up * 0.5f; Vector3 insideUnitSphere = Random.insideUnitSphere; Vector3 val3 = val2 + ((Vector3)(ref insideUnitSphere)).normalized; ((Vector3)(ref val3)).Normalize(); float num2 = (10f + (float)damage * 0.2f) * multiplier * 2f; num2 = Mathf.Min(num2, 200f); playerTumble.TumbleForce(val3 * num2); playerTumble.TumbleTorque(Random.insideUnitSphere * num2 * 2f); REPOConomyPlugin.Logger.LogInfo((object)$"[Smash] Player {((Object)val).name} SMASHED! Dmg: {damage}, Total%: {num}, Force: {num2:F1}"); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Smash] Player Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Smash_EnemyHurt { private static FieldInfo FI_Enemy_Rigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static FieldInfo FI_ERB_PhysGrabObject = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject"); private static FieldInfo FI_PGO_ImpactHappenedTimer = AccessTools.Field(typeof(PhysGrabObject), "impactHappenedTimer"); private static bool Prefix(EnemyHealth __instance, int _damage, Vector3 _hurtDirection) { //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Expected O, but got Unknown //IL_0119: 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_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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0189: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.SettleItInSmash || !SemiFunc.RunIsLevel() || _damage <= 0) { return true; } try { if (SmashBrosManager.IsDeathPitFrame) { return true; } Enemy componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { return true; } EnemyRigidbody val = (EnemyRigidbody)FI_Enemy_Rigidbody.GetValue(componentInParent); bool flag = false; if ((Object)(object)val != (Object)null) { PhysGrabObject val2 = (PhysGrabObject)FI_ERB_PhysGrabObject.GetValue(val); if ((Object)(object)val2 != (Object)null && (float)FI_PGO_ImpactHappenedTimer.GetValue(val2) > 0f) { flag = true; } } if (flag) { return true; } int instanceID = ((Object)((Component)componentInParent).gameObject).GetInstanceID(); float num = SmashBrosManager.AddDamage(instanceID, _damage); float multiplier = SmashBrosManager.GetMultiplier(instanceID); object value = AccessTools.Field(typeof(Enemy), "StateStunned").GetValue(componentInParent); if (value != null) { MethodInfo? method = value.GetType().GetMethod("Set"); float num2 = 1f + multiplier * 0.5f; method.Invoke(value, new object[1] { num2 }); } if ((Object)(object)val != (Object)null) { Vector3 val3 = ((!(_hurtDirection != Vector3.zero)) ? Random.onUnitSphere : ((Vector3)(ref _hurtDirection)).normalized); val3 += Vector3.up * 0.8f; ((Vector3)(ref val3)).Normalize(); float num3 = (20f + (float)_damage * 0.2f) * multiplier; num3 = Mathf.Min(num3, 200f); val.FreezeForces(val3 * num3, Random.insideUnitSphere * num3 * 2f); componentInParent.Freeze(0.1f); REPOConomyPlugin.Logger.LogInfo((object)$"[Smash] Enemy {((Object)componentInParent).name} SMASHED! Total%: {num}, Force: {num3:F1}"); } return false; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Smash] Enemy Error: " + ex.Message)); return true; } } } [HarmonyPatch(typeof(PlayerAvatar), "Start")] public static class Patch_FoundMap_RevealAll { [CompilerGenerated] private sealed class d__5 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__5(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(10f); <>1__state = 1; return true; case 1: { <>1__state = -1; int num = 0; int num2 = 0; try { RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val in array) { if ((Object)(object)val != (Object)null) { val.SetExplored(); num++; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FoundMap] Rooms error: " + ex.Message)); } try { ValuableObject[] array2 = Object.FindObjectsOfType(); foreach (ValuableObject val2 in array2) { if ((Object)(object)val2 != (Object)null && !(bool)FI_discovered.GetValue(val2)) { val2.Discover((State)1); num2++; } } } catch (Exception ex2) { REPOConomyPlugin.Logger.LogError((object)("[FoundMap] Items error: " + ex2.Message)); } REPOConomyPlugin.Logger.LogInfo((object)$"[FoundMap] вњ… Revealed {num} rooms and {num2} items!"); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__8 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__8(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; case 1: { <>1__state = -1; int num = 0; int num2 = 0; try { RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val in array) { if ((Object)(object)val != (Object)null) { val.SetExplored(); num++; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FoundMap] Rooms error (network): " + ex.Message)); } try { ValuableObject[] array2 = Object.FindObjectsOfType(); foreach (ValuableObject val2 in array2) { if ((Object)(object)val2 != (Object)null && !(bool)FI_discovered.GetValue(val2)) { val2.Discover((State)1); num2++; } } } catch (Exception ex2) { REPOConomyPlugin.Logger.LogError((object)("[FoundMap] Items error (network): " + ex2.Message)); } REPOConomyPlugin.Logger.LogInfo((object)$"[FoundMap] вњ… Network reveal: {num} rooms and {num2} items!"); return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static FieldInfo FI_discovered = AccessTools.Field(typeof(ValuableObject), "discovered"); private static bool mapAlreadyRevealed = false; private static void Postfix(PlayerAvatar __instance) { if (REPOEventManager.FoundMap && SemiFunc.RunIsLevel() && (bool)FI_isLocal.GetValue(__instance) && !mapAlreadyRevealed) { mapAlreadyRevealed = true; RevealMapNow(); } } public static void RevealMapNow() { if ((Object)(object)PlayerController.instance != (Object)null) { ((MonoBehaviour)PlayerController.instance).StartCoroutine(RevealEverythingRoutine()); } else { REPOConomyPlugin.Logger.LogWarning((object)"[FoundMap] PlayerController not ready"); } } [IteratorStateMachine(typeof(d__5))] private static IEnumerator RevealEverythingRoutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__5(0); } public static void Reset() { mapAlreadyRevealed = false; REPOConomyPlugin.Logger.LogInfo((object)"[FoundMap] Reset"); } public static void TriggerRevealFromNetwork() { if (mapAlreadyRevealed) { REPOConomyPlugin.Logger.LogInfo((object)"[FoundMap] Already revealed, skipping network trigger"); return; } mapAlreadyRevealed = true; if ((Object)(object)PlayerController.instance != (Object)null) { ((MonoBehaviour)PlayerController.instance).StartCoroutine(RevealEverythingRoutineFromNetwork()); } else { REPOConomyPlugin.Logger.LogWarning((object)"[FoundMap] PlayerController not ready for network trigger"); } } [IteratorStateMachine(typeof(d__8))] private static IEnumerator RevealEverythingRoutineFromNetwork() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__8(0); } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_EnemiesOmniscient { private static float updateTimer = 0f; private static float updateInterval = 2f; private static FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); public static void Reset() { updateTimer = 0f; REPOConomyPlugin.Logger.LogInfo((object)"[EnemiesOmniscient] Reset timer"); } private static void Postfix(EnemyDirector __instance) { //IL_0082: 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_00cb: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.EnemiesOmniscient || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } updateTimer += Time.deltaTime; if (!(updateTimer >= updateInterval)) { return; } updateTimer = 0f; try { PlayerAvatar val = null; float num = float.MaxValue; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !(bool)FI_isDisabled.GetValue(player)) { float num2 = Vector3.Distance(((Component)player).transform.position, ((Component)__instance).transform.position); if (num2 < num) { num = num2; val = player; } } } if ((Object)(object)val != (Object)null) { SemiFunc.EnemyInvestigate(((Component)val).transform.position, float.MaxValue, false); REPOConomyPlugin.Logger.LogInfo((object)"[EnemiesOmniscient] All enemies notified of player position"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EnemiesOmniscient] Error: " + ex.Message)); } } } public static class REPOEventPatchesReset { public static void ResetAll() { try { Patch_RoundDirector_StartRoundLogic.IsHaulScaled = false; Patch_ValuableSpawn_Override.Reset(); REPOEventManager.ResetMultipliers(); REPOEventManager.ActiveEvents.Clear(); Patch_EnemySpeed.Reset(); Patch_EnemiesFasterOnKill.Reset(); Patch_CriticalHits.Reset(); Patch_Dodge.Reset(); Patch_FakeValuables.Reset(); Patch_ValueDecay.Reset(); Patch_EnemyHealOnDamage.Reset(); Patch_EnemyWeightModifiers.Reset(); Patch_ValuableWeightModifiers.Reset(); Patch_ValueLottery_Fixed.Reset(); BossFightManager.Reset(); Patch_GoldenTouch.Reset(); Patch_ExplosiveValuables_Setup.Reset(); Patch_ExplosiveValuables_Explode.Reset(); Patch_PhantomObjects.Reset(); Patch_ScaleInCart_TrackCart.Reset(); Patch_ValuableScaling_Unified.Reset(); Patch_FoggyVision.Reset(); Patch_HotPotato.Reset(); Patch_PlayerRevival_Death.Reset(); Patch_TooQuiet_EnforceDelay.Reset(); ResetInvisiblePlayers(); Patch_EnemiesOmniscient.Reset(); Patch_PitImmunity_Player.Reset(); InvincibleHorrorManager.Reset(); Patch_MagneticValuables.Reset(); SmashBrosManager.Reset(); Patch_FoundMap_RevealAll.Reset(); Patch_Earthquake.Reset(); Patch_NightVision.Reset(); Patch_ShadowClones.Reset(); EnemyScaling.Patch_EnemyHealth_OnSpawn.Reset(); REPOConomyNetworkHandler.ResetClientFlags(); Patch_PlayerSizeModifiers.Reset(); Patch_ArmStrengthModifiers.Reset(); Patch_TotalDarkness.Reset(); Patch_DangerousValuables.Reset(); Patch_CloakedValuables.Reset(); Patch_RunawayValuables.Reset(); Patch_TeleportingEnemies.Reset(); Patch_SharedPain.Reset(); Patch_ExplosiveThrowValuables.Reset(); Patch_SharedHealing.Reset(); Patch_LowHealthSpeedBoost.Reset(); Patch_RoomGravity.Reset(); Patch_ValuableEncumbrance.Reset(); Patch_SpeedRooms.Reset(); Patch_EnemyTouchShock.Reset(); Patch_DoubleJump.Reset(); Patch_RandomPlayerTeleportations.Reset(); Patch_CursedValuables.Reset(); Patch_StickyValuables.Reset(); SingleExtractionHelper.Reset(); Patch_LastBreath.Reset(); Patch_ValueModifiers_Batch1.Reset(); Patch_Bloodthirst.Reset(); Patch_GlassEnemies.Reset(); Patch_GuardianShield.Reset(); Patch_DamageWard.Reset(); Patch_TitansVigor.Reset(); Patch_RegenerationAura.Reset(); Patch_BloodthirstyHealer.Reset(); Patch_SecondWind.Reset(); Patch_AdrenalineSurge_Monitor.Reset(); Patch_GlassJaw.Reset(); Patch_AdrenalineCrash.Reset(); Patch_SoulDrain.Reset(); Patch_SluggishRecovery_Track.Reset(); Patch_AchillesHeel.Reset(); Patch_VampiricPact_Heal.Reset(); Patch_TugOfWar_Regen.Reset(); Patch_JuggernautEnemies.Reset(); Patch_HardenedCores.Reset(); Patch_PlagueBearers_Apply.Reset(); Patch_PhaseShield.Reset(); Patch_VengefulHorde.Reset(); Patch_BrittleBonesEnemies.Reset(); Patch_SelfDestructEnemies.Reset(); Patch_ExposedCores.Reset(); Patch_BleedingEnemies_Apply.Reset(); Patch_BleedingEnemies_Tick.Reset(); Patch_GlassJawEnemies.Reset(); Patch_ExposedWeakpoint.Reset(); Patch_BulkyEnemies.Reset(); Patch_QuickRecovery_Track.Reset(); Patch_QuickRecovery_Tick.Reset(); Patch_HardyEnemies.Reset(); Patch_SecondSkin.Reset(); Patch_GlassCannonEnemies_HP.Reset(); Patch_VampiricVitality_Regen.Reset(); Patch_AdaptiveEnemies.Reset(); Patch_EnragedOnHit.Reset(); Patch_ScavengerEnemies_HP.Reset(); Patch_ToughLove_Heal.Reset(); Patch_FrailEnemies.Reset(); Patch_SoulHarvest.Reset(); Patch_BrittleShells.Reset(); Patch_LootValue_Batch12.Reset(); Patch_CompoundInterest.Reset(); Patch_TreasureSense.Reset(); Patch_LootValue_Batch13.Reset(); Patch_LootDecay_Batch13.Reset(); Patch_LootValue_Batch14.Reset(); Patch_LootGain_Batch14.Reset(); Patch_SecondChance.Reset(); Patch_AppraisersGlow.Reset(); Patch_ReinforcedBaseline.Reset(); Patch_LootValue_Batch15.Reset(); Patch_LootDecay_Batch15.Reset(); Patch_LootValue_Batch16.Reset(); Patch_LootTrade_Batch16.Reset(); Patch_HeadsOrTails.Reset(); Patch_ExtractionBeacons.Reset(); Patch_EnvExtraction_Batch17.Reset(); Patch_RichFacility_Bonus.Reset(); Patch_ScatteredRiches.Reset(); Patch_CrystalAir.Reset(); Patch_FlickeringPower.Reset(); Patch_PowerSurge.Reset(); Patch_LootedFacility.Reset(); Patch_HazardousSparks.Reset(); Patch_PhantomQuota.Reset(); Patch_DimFacility.Reset(); Patch_FrostCreep.Reset(); Patch_ColdFacility.Reset(); Patch_StiffDoors.Reset(); Patch_AgedTubes.Reset(); Patch_ColoredLights.Reset(); Patch_PulsingLights.Reset(); Patch_FloatingDust.Reset(); Patch_ReverbHall.Reset(); Patch_ShuffledLoot.Reset(); Patch_LuckyScraps.Reset(); Patch_MagneticCarts.Reset(); Patch_DeafToMonsters.Reset(); Patch_EnemySpeedUniversal.Reset(); Patch_EnemyRBSpeed.Reset(); Patch_BlinkingHaze.Reset(); Patch_LoneWolf.Reset(); Patch_RestorativeRooms.Reset(); Patch_HostileRooms.Reset(); Patch_PlayerStatMods.Reset(); Patch_KillRecharge.Reset(); Patch_VitalHaul.Reset(); Patch_OffGridMap.Reset(); Patch_BattleHardened.Reset(); REPOConomyPlugin.Logger.LogInfo((object)"[EventPatches] All patches reset for new level"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[EventPatches] Reset error: " + ex.Message)); } } private static void ResetInvisiblePlayers() { try { if ((Object)(object)GameDirector.instance == (Object)null || GameDirector.instance.PlayerList == null) { REPOConomyPlugin.Logger.LogWarning((object)"[InvisiblePlayers] GameDirector or PlayerList is null during reset"); return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if ((Object)(object)player == (Object)null || (Object)(object)player.playerAvatarVisuals == (Object)null) { continue; } if ((Object)(object)player.playerAvatarVisuals.meshParent != (Object)null) { player.playerAvatarVisuals.meshParent.SetActive(true); } Renderer[] componentsInChildren = ((Component)player.playerAvatarVisuals).GetComponentsInChildren(true); foreach (Renderer val in componentsInChildren) { if ((Object)(object)val != (Object)null) { val.enabled = true; } } } REPOConomyPlugin.Logger.LogInfo((object)"[InvisiblePlayers] Reset - all players visible"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[InvisiblePlayers] Reset error: " + ex.Message + "\n" + ex.StackTrace)); } } } [HarmonyPatch(typeof(PhysGrabber), "Update")] public static class Patch_SlipperyHands { private static float dropTimer = 0f; private static float dropInterval = 5f; private static void Postfix(PhysGrabber __instance) { if (!REPOEventManager.SlipperyHands || !SemiFunc.RunIsLevel() || !__instance.isLocal) { return; } try { dropTimer += Time.deltaTime; if (dropTimer >= dropInterval) { dropTimer = 0f; if (Random.value < 0.675f && __instance.grabbed) { __instance.ReleaseObject(-1, 0.1f); REPOConomyPlugin.Logger.LogInfo((object)"[SlipperyHands] Player dropped item due to slippery hands!"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SlipperyHands] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerAvatar), "LateStart")] public static class Patch_PlayerSizeModifiers_Visuals { private static Dictionary originalVisualScales = new Dictionary(); private static void Postfix(PlayerAvatar __instance) { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) if (!SemiFunc.RunIsLevel()) { return; } try { float num = 1f; if (REPOEventManager.GiantPlayer) { num = 1.5f; } else if (REPOEventManager.TinyPlayer) { num = 0.5f; } if (num != 1f) { int instanceID = ((Object)__instance).GetInstanceID(); if ((Object)(object)__instance.playerAvatarVisuals != (Object)null && !originalVisualScales.ContainsKey(instanceID)) { originalVisualScales[instanceID] = ((Component)__instance.playerAvatarVisuals).transform.localScale; ((Component)__instance.playerAvatarVisuals).transform.localScale = originalVisualScales[instanceID] * num; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] Scaled visuals x{num} for avatar {instanceID}"); } } } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[PlayerSize] Visuals error: {arg}"); } } public static void ResetVisuals() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) try { foreach (KeyValuePair originalVisualScale in originalVisualScales) { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if ((Object)(object)player != (Object)null && ((Object)player).GetInstanceID() == originalVisualScale.Key && (Object)(object)player.playerAvatarVisuals != (Object)null) { ((Component)player.playerAvatarVisuals).transform.localScale = originalVisualScale.Value; break; } } } originalVisualScales.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] Visuals reset"); } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[PlayerSize] Visuals reset error: {arg}"); } } } [HarmonyPatch(typeof(PlayerCollision), "Awake")] public static class Patch_SaveOriginalColliderScales { private static bool saved; private static void Postfix(PlayerCollision __instance) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_007e: Unknown result type (might be due to invalid IL or missing references) if (!saved) { saved = true; if ((Object)(object)__instance.StandCollision != (Object)null) { Patch_PlayerSizeModifiers_LocalPlayer.TrulyOriginalStandScale = __instance.StandCollision.localScale; REPOConomyPlugin.Logger.LogInfo((object)$"[ColliderDebug] рџ“ќ TRULY Original StandCollision: {__instance.StandCollision.localScale}"); } if ((Object)(object)__instance.CrouchCollision != (Object)null) { Patch_PlayerSizeModifiers_LocalPlayer.TrulyOriginalCrouchScale = __instance.CrouchCollision.localScale; REPOConomyPlugin.Logger.LogInfo((object)$"[ColliderDebug] рџ“ќ TRULY Original CrouchCollision: {__instance.CrouchCollision.localScale}"); } } } public static void Reset() { saved = false; } } [HarmonyPatch(typeof(PlayerCollisionStand), "Awake")] public static class Patch_SaveOriginalStandCheckScale { private static bool saved; private static void Postfix(PlayerCollisionStand __instance) { //IL_0014: 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_002e: Unknown result type (might be due to invalid IL or missing references) if (!saved) { saved = true; Patch_PlayerSizeModifiers_LocalPlayer.TrulyOriginalStandCheckScale = ((Component)__instance).transform.localScale; REPOConomyPlugin.Logger.LogInfo((object)$"[ColliderDebug] рџ“ќ TRULY Original StandCheck: {((Component)__instance).transform.localScale}"); } } public static void Reset() { saved = false; } } [HarmonyPatch(typeof(PlayerAvatar), "Start")] public static class Patch_PlayerSizeModifiers_LocalPlayer { [CompilerGenerated] private sealed class d__9 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public PlayerAvatar avatar; private float 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__9(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Expected O, but got Unknown //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: 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_0199: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_0292: 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_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_030b: Unknown result type (might be due to invalid IL or missing references) //IL_0316: Unknown result type (might be due to invalid IL or missing references) //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_02fc: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0223: 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_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1f); <>1__state = 1; return true; case 1: <>1__state = -1; if (!(bool)FI_isLocal.GetValue(avatar)) { REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] вЏ\u00adпёЏ Skipping - not local player"); return false; } if (localPlayerScaled) { REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] вЏ\u00adпёЏ Already scaled"); return false; } 5__2 = 1f; if (REPOEventManager.GiantPlayer) { 5__2 = 1.5f; } else if (REPOEventManager.TinyPlayer) { 5__2 = 0.5f; } REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] рџ”Ќ Giant={REPOEventManager.GiantPlayer}, Tiny={REPOEventManager.TinyPlayer}, Factor={5__2}"); if (5__2 == 1f) { REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] Scale is 1.0, skipping"); return false; } localPlayerScaled = true; goto IL_0127; case 2: <>1__state = -1; goto IL_0127; case 3: { <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] рџљЂ SCALING LOCAL PLAYER x{5__2}"); try { if ((Object)(object)PlayerCollision.instance != (Object)null) { if ((Object)(object)PlayerCollision.instance.StandCollision != (Object)null && TrulyOriginalStandScale != Vector3.zero) { PlayerCollision.instance.StandCollision.localScale = TrulyOriginalStandScale * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… StandCollision: {PlayerCollision.instance.StandCollision.localScale} (from {TrulyOriginalStandScale})"); } if ((Object)(object)PlayerCollision.instance.CrouchCollision != (Object)null && TrulyOriginalCrouchScale != Vector3.zero) { PlayerCollision.instance.CrouchCollision.localScale = TrulyOriginalCrouchScale * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… CrouchCollision: {PlayerCollision.instance.CrouchCollision.localScale} (from {TrulyOriginalCrouchScale})"); } } if ((Object)(object)PlayerCollisionStand.instance != (Object)null && TrulyOriginalStandCheckScale != Vector3.zero) { ((Component)PlayerCollisionStand.instance).transform.localScale = TrulyOriginalStandCheckScale * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… StandCheck: {((Component)PlayerCollisionStand.instance).transform.localScale} (from {TrulyOriginalStandCheckScale})"); } if ((Object)(object)CameraPosition.instance != (Object)null) { if (originalCameraOffset == Vector3.zero) { originalCameraOffset = CameraPosition.instance.playerOffset; } CameraPosition.instance.playerOffset = originalCameraOffset * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… Camera: {CameraPosition.instance.playerOffset}"); } if ((Object)(object)CameraCrouchPosition.instance != (Object)null) { if (originalCrouchCamPos == 0f) { originalCrouchCamPos = CameraCrouchPosition.instance.Position; } CameraCrouchPosition.instance.Position = originalCrouchCamPos * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… Crouch cam: {CameraCrouchPosition.instance.Position:F2}"); } CameraCrawlPosition val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { if (originalCrawlCamPos == 0f) { originalCrawlCamPos = val.Position; } val.Position = originalCrawlCamPos * 5__2; REPOConomyPlugin.Logger.LogInfo((object)$"[PlayerSize] вњ… Crawl cam: {val.Position:F2}"); } REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] рџЋ‰ COMPLETE!"); } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[PlayerSize] Error: {arg}"); } return false; } IL_0127: if (!LevelGenerator.Instance.Generated) { <>2__current = null; <>1__state = 2; return true; } <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 3; return true; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static Vector3 TrulyOriginalStandScale = Vector3.zero; public static Vector3 TrulyOriginalCrouchScale = Vector3.zero; public static Vector3 TrulyOriginalStandCheckScale = Vector3.zero; private static Vector3 originalCameraOffset = Vector3.zero; private static float originalCrouchCamPos = 0f; private static float originalCrawlCamPos = 0f; private static bool localPlayerScaled = false; private static FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static void Postfix(PlayerAvatar __instance) { ((MonoBehaviour)__instance).StartCoroutine(WaitAndScale(__instance)); } [IteratorStateMachine(typeof(d__9))] private static IEnumerator WaitAndScale(PlayerAvatar avatar) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__9(0) { avatar = avatar }; } public static void ResetColliders() { //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) try { if (localPlayerScaled) { if ((Object)(object)PlayerCollision.instance != (Object)null) { if ((Object)(object)PlayerCollision.instance.StandCollision != (Object)null && TrulyOriginalStandScale != Vector3.zero) { PlayerCollision.instance.StandCollision.localScale = TrulyOriginalStandScale; } if ((Object)(object)PlayerCollision.instance.CrouchCollision != (Object)null && TrulyOriginalCrouchScale != Vector3.zero) { PlayerCollision.instance.CrouchCollision.localScale = TrulyOriginalCrouchScale; } } if ((Object)(object)PlayerCollisionStand.instance != (Object)null && TrulyOriginalStandCheckScale != Vector3.zero) { ((Component)PlayerCollisionStand.instance).transform.localScale = TrulyOriginalStandCheckScale; } if ((Object)(object)CameraPosition.instance != (Object)null && originalCameraOffset != Vector3.zero) { CameraPosition.instance.playerOffset = originalCameraOffset; } if ((Object)(object)CameraCrouchPosition.instance != (Object)null && originalCrouchCamPos != 0f) { CameraCrouchPosition.instance.Position = originalCrouchCamPos; } CameraCrawlPosition val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null && originalCrawlCamPos != 0f) { val.Position = originalCrawlCamPos; } } localPlayerScaled = false; originalCameraOffset = Vector3.zero; originalCrouchCamPos = 0f; originalCrawlCamPos = 0f; Patch_SaveOriginalColliderScales.Reset(); Patch_SaveOriginalStandCheckScale.Reset(); REPOConomyPlugin.Logger.LogInfo((object)"[PlayerSize] Reset"); } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[PlayerSize] Reset error: {arg}"); } } } public static class Patch_PlayerSizeModifiers { public static void Reset() { Patch_PlayerSizeModifiers_Visuals.ResetVisuals(); Patch_PlayerSizeModifiers_LocalPlayer.ResetColliders(); } } [HarmonyPatch(typeof(PhysGrabber), "LateStart")] public static class Patch_ArmStrengthModifiers { private static Dictionary originalThrowStrengths = new Dictionary(); private static void Postfix(PhysGrabber __instance) { if (!SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!originalThrowStrengths.ContainsKey(instanceID)) { originalThrowStrengths[instanceID] = __instance.throwStrength; } float num = originalThrowStrengths[instanceID]; if (REPOEventManager.WeakArms) { if (num == 0f) { __instance.throwStrength = -0.67f; REPOConomyPlugin.Logger.LogInfo((object)"[WeakArms] No upgrades, set to -0.67 (will reduce base strength)"); } else { __instance.throwStrength = num / 3f; REPOConomyPlugin.Logger.LogInfo((object)$"[WeakArms] Reduced to {__instance.throwStrength:F2} (was {num:F2})"); } } else if (REPOEventManager.StrongArms) { if (num == 0f) { __instance.throwStrength = 3f; REPOConomyPlugin.Logger.LogInfo((object)$"[StrongArms] No upgrades, set base 1.0 * 3 = {__instance.throwStrength:F2}"); } else { __instance.throwStrength = num * 3f; REPOConomyPlugin.Logger.LogInfo((object)$"[StrongArms] Increased to {__instance.throwStrength:F2} (was {num:F2})"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ArmStrengthModifiers] Error: " + ex.Message)); } } public static void Reset() { originalThrowStrengths.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[ArmStrengthModifiers] Reset"); } } [HarmonyPatch(typeof(PlayerController), "Start")] public static class Patch_Earthquake { [CompilerGenerated] private sealed class d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Invalid comparison between Unknown and I4 //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Invalid comparison between Unknown and I4 //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Started earthquake coroutine"); goto IL_004a; case 1: <>1__state = -1; goto IL_004a; case 2: { <>1__state = -1; if (!REPOEventManager.Earthquake || !SemiFunc.RunIsLevel()) { break; } if ((int)GameDirector.instance.currentState == 2) { try { float num = Random.Range(0.5f, 1.5f); float num2 = Random.Range(0.5f, 1.5f); if ((Object)(object)GameDirector.instance.CameraShake != (Object)null) { CameraShake cameraShake = GameDirector.instance.CameraShake; cameraShake.Strength = Mathf.Max(cameraShake.Strength, 5f * num); cameraShake.StrengthLossDelay = Mathf.Max(num2, cameraShake.StrengthLossDelay); cameraShake.SetInstant(); } if ((Object)(object)GameDirector.instance.CameraImpact != (Object)null) { CameraShake cameraImpact = GameDirector.instance.CameraImpact; cameraImpact.Strength = Mathf.Max(cameraImpact.Strength, 10f * num); cameraImpact.StrengthLossDelay = Mathf.Max(num2 * 0.5f, cameraImpact.StrengthLossDelay); cameraImpact.SetInstant(); } REPOConomyPlugin.Logger.LogInfo((object)$"[Earthquake] Forced shake: strength={num:F2}, duration={num2:F2}s"); if (Object.op_Implicit((Object)(object)PlayerController.instance) && Object.op_Implicit((Object)(object)PlayerController.instance.playerAvatarScript) && Random.value < 0.3f) { PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(PlayerController.instance.playerAvatarScript); if ((Object)(object)playerTumble != (Object)null) { playerTumble.TumbleRequest(true, false); REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Player lost balance!"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Earthquake] Error: " + ex.Message + "\n" + ex.StackTrace)); } } goto IL_0227; } IL_004a: if ((Object)(object)GameDirector.instance == (Object)null || (int)GameDirector.instance.currentState != 2) { <>2__current = null; <>1__state = 1; return true; } goto IL_0227; IL_0227: if (REPOEventManager.Earthquake && SemiFunc.RunIsLevel()) { <>2__current = (object)new WaitForSeconds(Random.Range(8f, 15f)); <>1__state = 2; return true; } break; } REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Ended earthquake coroutine"); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static bool earthquakeStarted; private static void Postfix(PlayerController __instance) { if (REPOEventManager.Earthquake && SemiFunc.RunIsLevel() && !((Object)(object)__instance != (Object)(object)PlayerController.instance) && !earthquakeStarted) { earthquakeStarted = true; ((MonoBehaviour)__instance).StartCoroutine(EarthquakeCoroutine()); } } public static void TriggerEarthquakeFromNetwork() { if (earthquakeStarted) { REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Already started, skipping network trigger"); return; } if ((Object)(object)PlayerController.instance == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)"[Earthquake] PlayerController not ready for network trigger"); return; } earthquakeStarted = true; ((MonoBehaviour)PlayerController.instance).StartCoroutine(EarthquakeCoroutine()); REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Started from network trigger"); } public static void Reset() { earthquakeStarted = false; REPOConomyPlugin.Logger.LogInfo((object)"[Earthquake] Reset"); } [IteratorStateMachine(typeof(d__4))] private static IEnumerator EarthquakeCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0); } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_NoJump { private static FieldInfo FI_JumpImpulse = AccessTools.Field(typeof(PlayerController), "JumpImpulse"); private static void Postfix(PlayerController __instance) { if (!REPOEventManager.NoJump || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } try { FI_JumpImpulse.SetValue(__instance, false); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[NoJump] Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnvironmentDirector), "Setup")] public static class Patch_TotalDarkness { private static Dictionary originalIntensities = new Dictionary(); private static Dictionary originalRanges = new Dictionary(); private static float originalAmbientIntensity = -1f; private static bool isApplied = false; private static void Postfix() { if (!REPOEventManager.TotalDarkness || !SemiFunc.RunIsLevel()) { return; } try { if (originalAmbientIntensity == -1f) { originalAmbientIntensity = RenderSettings.ambientIntensity; } RenderSettings.ambientIntensity = 0f; isApplied = true; Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null)) { if (!originalIntensities.ContainsKey(val)) { originalIntensities[val] = val.intensity; originalRanges[val] = val.range; } val.intensity = 0f; val.range = 0f; } } REPOConomyPlugin.Logger.LogInfo((object)$"[TotalDarkness] Applied: All lights disabled. Tracked lights: {originalIntensities.Count}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TotalDarkness] Error: " + ex.Message)); } } public static void Reset() { try { foreach (KeyValuePair originalIntensity in originalIntensities) { Light key = originalIntensity.Key; if ((Object)(object)key != (Object)null) { key.intensity = originalIntensity.Value; if (originalRanges.ContainsKey(key)) { key.range = originalRanges[key]; } } } if (isApplied && originalAmbientIntensity != -1f) { RenderSettings.ambientIntensity = originalAmbientIntensity; REPOConomyPlugin.Logger.LogInfo((object)$"[TotalDarkness] Reset ambient to {originalAmbientIntensity}"); } originalIntensities.Clear(); originalRanges.Clear(); originalAmbientIntensity = -1f; isApplied = false; REPOConomyPlugin.Logger.LogInfo((object)"[TotalDarkness] Full Reset Complete"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TotalDarkness] Reset Error: " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "DeathImpulseRPC")] public static class Patch_KamikazeEnemies { private static readonly FieldInfo FI_enemy = AccessTools.Field(typeof(EnemyHealth), "enemy"); private static readonly FieldInfo FI_enemyRigidbody = AccessTools.Field(typeof(Enemy), "Rigidbody"); private static readonly FieldInfo FI_physGrabObject = AccessTools.Field(typeof(EnemyRigidbody), "physGrabObject"); private static readonly FieldInfo FI_rb = AccessTools.Field(typeof(EnemyRigidbody), "rb"); private static void Postfix(EnemyHealth __instance) { //IL_0019: 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_001f: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.KamikazeEnemies || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { Vector3 val = ResolveEnemyExplosionPosition(__instance); REPOConomyNetworkHandler.SpawnExplosionLocal(val, 0.9f, 50, 50, 2f); REPOConomyNetworkHandler.SyncExplosionToClients(val, 0.9f, 50, 50, 2f); REPOConomyPlugin.Logger.LogInfo((object)$"[KamikazeEnemies] Enemy exploded at {val}!"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[KamikazeEnemies] Error: " + ex.Message)); } } private static Vector3 ResolveEnemyExplosionPosition(EnemyHealth enemyHealth) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) Vector3 result = (((Object)(object)enemyHealth != (Object)null) ? ((Component)enemyHealth).transform.position : Vector3.zero); object? obj = FI_enemy?.GetValue(enemyHealth); Enemy val = (Enemy)((obj is Enemy) ? obj : null); if ((Object)(object)val == (Object)null) { return result; } object? obj2 = FI_enemyRigidbody?.GetValue(val); EnemyRigidbody val2 = (EnemyRigidbody)((obj2 is EnemyRigidbody) ? obj2 : null); if ((Object)(object)val2 != (Object)null) { object? obj3 = FI_physGrabObject?.GetValue(val2); PhysGrabObject val3 = (PhysGrabObject)((obj3 is PhysGrabObject) ? obj3 : null); if ((Object)(object)val3 != (Object)null && val3.centerPoint != Vector3.zero) { return val3.centerPoint; } object? obj4 = FI_rb?.GetValue(val2); Rigidbody val4 = (Rigidbody)((obj4 is Rigidbody) ? obj4 : null); if ((Object)(object)val4 != (Object)null) { return val4.position; } } if ((Object)(object)val.CenterTransform != (Object)null) { return val.CenterTransform.position; } return result; } } [HarmonyPatch(typeof(EnemyHealth), "OnSpawn")] public static class Patch_RegeneratingEnemies_Start { [CompilerGenerated] private sealed class d__4 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public EnemyHealth health; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (!((Object)(object)health == (Object)null)) { bool num2 = (bool)FI_dead.GetValue(health); bool flag = (bool)FI_deadImpulse.GetValue(health); if (!(num2 || flag)) { int num3 = (int)FI_healthCurrent.GetValue(health); int num4 = health.health; if (num3 < num4) { int num5 = num4 - num3; int num6 = Mathf.Min(10, num5); health.Heal(num6); REPOConomyPlugin.Logger.LogInfo((object)$"[RegeneratingEnemies] +{num6} HP ({num3 + num6}/{num4})"); } goto IL_00fb; } } goto IL_0113; } <>1__state = -1; REPOConomyPlugin.Logger.LogInfo((object)"[RegeneratingEnemies] рџ’љ Started regen"); goto IL_00fb; IL_0113: REPOConomyPlugin.Logger.LogInfo((object)"[RegeneratingEnemies] Stopped"); return false; IL_00fb: if ((Object)(object)health != (Object)null && REPOEventManager.RegeneratingEnemies) { <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; } goto IL_0113; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static FieldInfo FI_dead = AccessTools.Field(typeof(EnemyHealth), "dead"); private static FieldInfo FI_deadImpulse = AccessTools.Field(typeof(EnemyHealth), "deadImpulse"); private static FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.RegeneratingEnemies || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { if ((Object)(object)GameDirector.instance != (Object)null) { ((MonoBehaviour)GameDirector.instance).StartCoroutine(RegenerationCoroutine(__instance)); } else if ((Object)(object)PlayerController.instance != (Object)null) { ((MonoBehaviour)PlayerController.instance).StartCoroutine(RegenerationCoroutine(__instance)); } else { REPOConomyPlugin.Logger.LogWarning((object)"[RegeneratingEnemies] No active object to start coroutine"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RegeneratingEnemies] Start error: " + ex.Message)); } } [IteratorStateMachine(typeof(d__4))] private static IEnumerator RegenerationCoroutine(EnemyHealth health) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { health = health }; } } [HarmonyPatch(typeof(EnemyHealth), "DeathRPC")] public static class Patch_ShadowClones { [CompilerGenerated] private sealed class d__19 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public string enemyName; public Difficulty difficulty; public int count; public Vector3 spawnPos; public int cloneHP; private EnemySetup 5__2; private int 5__3; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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_0134: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_034d: Expected O, but got Unknown //IL_0249: 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_0293: Expected O, but got Unknown switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = (object)new WaitForSeconds(1.5f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = null; try { 5__2 = FindEnemySetup(enemyName, difficulty); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ShadowClones] FindEnemySetup error: " + ex.Message)); return false; } if ((Object)(object)5__2 == (Object)null || 5__2.spawnObjects == null || 5__2.spawnObjects.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)("[ShadowClones] Could not find EnemySetup for: " + enemyName)); return false; } REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] Spawning {count}x {enemyName}"); 5__3 = 0; goto IL_036f; case 2: { <>1__state = -1; goto IL_035d; } IL_036f: if (5__3 < count) { Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Random.Range(-1f, 1f), 0f, Random.Range(-1f, 1f)); Vector3 val2 = spawnPos + val; PrefabRef val3 = 5__2.spawnObjects[0]; if (val3 != null && val3.IsValid()) { GameObject val4 = null; spawning = true; try { val4 = ((!SemiFunc.IsMultiplayer()) ? Object.Instantiate(val3.Prefab, val2, Quaternion.identity) : PhotonNetwork.InstantiateRoomObject(val3.ResourcePath, val2, Quaternion.identity, (byte)0, (object[])null)); } catch (Exception ex2) { spawning = false; REPOConomyPlugin.Logger.LogError((object)("[ShadowClones] Instantiate error: " + ex2.Message)); goto IL_035d; } if (!((Object)(object)val4 == (Object)null)) { REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] Spawned: {((Object)val4).name} ({5__3 + 1}/{count})"); EnemyParent component = val4.GetComponent(); if ((Object)(object)component != (Object)null) { FI_SetupDone.SetValue(component, true); Enemy componentInChildren = val4.GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.EnemyTeleported(val2); } EnemyDirector.instance.FirstSpawnPointAdd(component); if (!EnemyDirector.instance.enemiesSpawned.Contains(component)) { EnemyDirector.instance.enemiesSpawned.Add(component); } Enemy val5 = (Enemy)FI_Enemy.GetValue(component); if ((Object)(object)val5 != (Object)null) { foreach (PlayerAvatar item in SemiFunc.PlayerGetAll()) { val5.PlayerAdded(item.photonView.ViewID); } } cloneParents.Add(component); EnemyHealth val6 = ((componentInChildren != null) ? ((Component)componentInChildren).GetComponent() : null); if ((Object)(object)val6 != (Object)null) { cloneInstanceIDs.Add(((Object)val6).GetInstanceID()); val6.health = cloneHP; FI_healthCurrent.SetValue(val6, cloneHP); } } <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } spawning = false; } goto IL_035d; } REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] рџ‘Ґ Clone spawn complete! ({count} enemies)"); return false; IL_035d: 5__3++; goto IL_036f; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static Dictionary hasSpawnedClone = new Dictionary(); private static Dictionary enemySetupCache = new Dictionary(); private static HashSet cloneInstanceIDs = new HashSet(); public static HashSet cloneParents = new HashSet(); public static bool spawning = false; private static Dictionary groupDeathCounts = new Dictionary(); private static Dictionary groupTotalCounts = new Dictionary(); private static Dictionary groupLastDeathPosition = new Dictionary(); private static FieldInfo FI_enemy = AccessTools.Field(typeof(EnemyHealth), "enemy"); private static FieldInfo FI_EnemyParent = AccessTools.Field(typeof(Enemy), "EnemyParent"); private static FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static FieldInfo FI_SetupDone = AccessTools.Field(typeof(EnemyParent), "SetupDone"); private static FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static readonly HashSet groupEnemyNames = new HashSet { "Gnome", "Bang" }; private static void Postfix(EnemyHealth __instance) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Expected O, but got Unknown //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ShadowClones || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (cloneInstanceIDs.Contains(instanceID)) { REPOConomyPlugin.Logger.LogInfo((object)"[ShadowClones] Clone died, removing from spawn list"); try { Enemy val = (Enemy)FI_enemy.GetValue(__instance); if ((Object)(object)val != (Object)null) { EnemyParent val2 = (EnemyParent)FI_EnemyParent.GetValue(val); if ((Object)(object)val2 != (Object)null && cloneParents.Contains(val2)) { cloneParents.Remove(val2); } } return; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ShadowClones] Error removing clone: " + ex.Message)); return; } } if (hasSpawnedClone.ContainsKey(instanceID) && hasSpawnedClone[instanceID]) { return; } hasSpawnedClone[instanceID] = true; try { Enemy val3 = (Enemy)FI_enemy.GetValue(__instance); if ((Object)(object)val3 == (Object)null) { return; } EnemyParent val4 = (EnemyParent)FI_EnemyParent.GetValue(val3); if ((Object)(object)val4 == (Object)null) { return; } string enemyName = val4.enemyName; Vector3 position = ((Component)__instance).transform.position; int num = Mathf.Max(10, Mathf.RoundToInt((float)__instance.health * 0.5f)); Difficulty difficulty = val4.difficulty; if (IsGroupEnemy(enemyName)) { HandleGroupEnemyDeath(enemyName, position, num, difficulty); return; } REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] Enemy died: {enemyName} at {position}, will spawn clone with {num} HP"); if ((Object)(object)GameDirector.instance != (Object)null) { ((MonoBehaviour)GameDirector.instance).StartCoroutine(SpawnNewEnemyCoroutine(enemyName, position, num, difficulty, 1)); } } catch (Exception ex2) { REPOConomyPlugin.Logger.LogError((object)("[ShadowClones] Error: " + ex2.Message)); } } private static bool IsGroupEnemy(string enemyName) { foreach (string groupEnemyName in groupEnemyNames) { if (enemyName.Contains(groupEnemyName)) { return true; } } return false; } private static void HandleGroupEnemyDeath(string enemyName, Vector3 deathPos, int cloneHP, Difficulty difficulty) { //IL_0051: 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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) string groupKey = GetGroupKey(enemyName); int groupTotalCount = GetGroupTotalCount(groupKey); if (!groupDeathCounts.ContainsKey(groupKey)) { groupDeathCounts[groupKey] = 0; groupTotalCounts[groupKey] = groupTotalCount; } groupDeathCounts[groupKey]++; groupLastDeathPosition[groupKey] = deathPos; REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] Group enemy '{groupKey}' died: {groupDeathCounts[groupKey]}/{groupTotalCounts[groupKey]}"); if (groupDeathCounts[groupKey] >= groupTotalCounts[groupKey]) { REPOConomyPlugin.Logger.LogInfo((object)("[ShadowClones] All " + groupKey + " dead! Spawning clone group!")); int count = groupTotalCounts[groupKey]; Vector3 spawnPos = groupLastDeathPosition[groupKey]; groupDeathCounts[groupKey] = 0; if ((Object)(object)GameDirector.instance != (Object)null) { ((MonoBehaviour)GameDirector.instance).StartCoroutine(SpawnNewEnemyCoroutine(groupKey, spawnPos, cloneHP, difficulty, count)); } } } private static string GetGroupKey(string enemyName) { if (enemyName.Contains("Gnome")) { return "Gnome"; } if (enemyName.Contains("Bang")) { return "Bang"; } return enemyName; } private static int GetGroupTotalCount(string groupKey) { if (groupKey == "Gnome" && (Object)(object)EnemyGnomeDirector.instance != (Object)null) { return EnemyGnomeDirector.instance.gnomes.Count; } if (groupKey == "Bang" && (Object)(object)EnemyBangDirector.instance != (Object)null) { return EnemyBangDirector.instance.units.Count; } return 1; } [IteratorStateMachine(typeof(d__19))] private static IEnumerator SpawnNewEnemyCoroutine(string enemyName, Vector3 spawnPos, int cloneHP, Difficulty difficulty, int count) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { enemyName = enemyName, spawnPos = spawnPos, cloneHP = cloneHP, difficulty = difficulty, count = count }; } private static EnemySetup FindEnemySetup(string enemyName, Difficulty difficulty) { if (enemySetupCache.TryGetValue(enemyName, out var value)) { return value; } if ((Object)(object)EnemyDirector.instance == (Object)null) { return null; } List list = new List(); if (EnemyDirector.instance.enemiesDifficulty1 != null) { list.AddRange(EnemyDirector.instance.enemiesDifficulty1); } if (EnemyDirector.instance.enemiesDifficulty2 != null) { list.AddRange(EnemyDirector.instance.enemiesDifficulty2); } if (EnemyDirector.instance.enemiesDifficulty3 != null) { list.AddRange(EnemyDirector.instance.enemiesDifficulty3); } foreach (EnemySetup item in list) { if ((Object)(object)item == (Object)null || item.spawnObjects == null) { continue; } foreach (PrefabRef spawnObject in item.spawnObjects) { if (spawnObject == null || !spawnObject.IsValid()) { continue; } string prefabName = spawnObject.PrefabName; if (string.IsNullOrEmpty(prefabName)) { continue; } if (prefabName.Contains(enemyName) || enemyName.Contains(prefabName)) { enemySetupCache[enemyName] = item; return item; } try { GameObject prefab = spawnObject.Prefab; if ((Object)(object)prefab != (Object)null) { EnemyParent component = prefab.GetComponent(); if ((Object)(object)component != (Object)null && component.enemyName.Contains(enemyName)) { enemySetupCache[enemyName] = item; return item; } } } catch { } } } return null; } public static void Reset() { hasSpawnedClone.Clear(); enemySetupCache.Clear(); cloneInstanceIDs.Clear(); cloneParents.Clear(); groupDeathCounts.Clear(); groupTotalCounts.Clear(); groupLastDeathPosition.Clear(); spawning = false; REPOConomyPlugin.Logger.LogInfo((object)"[ShadowClones] Reset"); } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_ShadowClones_BlockDespawn { private static bool Prefix(EnemyParent __instance, ref float ___SpawnedTimer) { if (Patch_ShadowClones.spawning) { Patch_ShadowClones.spawning = false; ___SpawnedTimer = Random.Range(__instance.SpawnedTimeMin, __instance.SpawnedTimeMax); REPOConomyPlugin.Logger.LogInfo((object)$"[ShadowClones] Blocked Despawn, SpawnedTimer = {___SpawnedTimer}"); return false; } return true; } } [HarmonyPatch(typeof(EnemyParent), "Spawn")] public static class Patch_ShadowClones_BlockRespawn { private static bool Prefix(EnemyParent __instance) { if (Patch_ShadowClones.cloneParents.Contains(__instance)) { REPOConomyPlugin.Logger.LogInfo((object)("[ShadowClones] Blocked respawn for clone: " + __instance.enemyName)); Patch_ShadowClones.cloneParents.Remove(__instance); EnemyDirector.instance.enemiesSpawned.Remove(__instance); Object.Destroy((Object)(object)((Component)__instance).gameObject); return false; } return true; } } [HarmonyPatch(typeof(PhysGrabber), "PhysGrabStarted")] public static class Patch_DangerousValuables { public static HashSet damagedValuables = new HashSet(); private static void Postfix(PhysGrabber __instance) { if (!REPOEventManager.DangerousValuables || !SemiFunc.RunIsLevel() || !__instance.isLocal) { return; } FieldInfo fieldInfo = AccessTools.Field(typeof(PhysGrabber), "grabbedPhysGrabObject"); if (fieldInfo == null) { PropertyInfo propertyInfo = AccessTools.Property(typeof(PhysGrabber), "grabbedPhysGrabObject"); if (propertyInfo != null) { object? value = propertyInfo.GetValue(__instance, null); ProcessValuable((Component)((value is Component) ? value : null), __instance); } } else { object? value2 = fieldInfo.GetValue(__instance); ProcessValuable((Component)((value2 is Component) ? value2 : null), __instance); } } private static void ProcessValuable(Component grabbed, PhysGrabber __instance) { if ((Object)(object)grabbed == (Object)null) { return; } ValuableObject component = grabbed.GetComponent(); if (!((Object)(object)component == (Object)null) && !IsEnemyOrb(component)) { int valuableNetworkId = GetValuableNetworkId(grabbed); if (!damagedValuables.Contains(valuableNetworkId) && (Object)(object)__instance.playerAvatar != (Object)null && (Object)(object)__instance.playerAvatar.playerHealth != (Object)null) { __instance.playerAvatar.playerHealth.Hurt(5, false, -1, false); MarkValuableSpent(valuableNetworkId); REPOConomyPlugin.Logger.LogInfo((object)$"[DangerousValuables] Player took 5 damage from {((Object)component).name} ({valuableNetworkId})"); } } } private static void MarkValuableSpent(int valuableId) { damagedValuables.Add(valuableId); REPOConomyNetworkHandler.SyncDangerousValuableSpentToClients(valuableId); } public static void RegisterSpent(int valuableId) { damagedValuables.Add(valuableId); } private static int GetValuableNetworkId(Component valuableComponent) { PhotonView component = valuableComponent.GetComponent(); if ((Object)(object)component != (Object)null && component.ViewID != 0) { return component.ViewID; } return ((Object)valuableComponent).GetInstanceID(); } private static bool IsEnemyOrb(ValuableObject valuable) { if ((Object)(object)valuable == (Object)null) { return false; } AssetManager instance = AssetManager.instance; if ((Object)(object)instance == (Object)null) { return false; } string name = ((Object)((Component)valuable).gameObject).name; if (!NamePrefixMatches(name, instance.enemyValuableSmall) && !NamePrefixMatches(name, instance.enemyValuableMedium)) { return NamePrefixMatches(name, instance.enemyValuableBig); } return true; } private static bool NamePrefixMatches(string instanceName, GameObject prefab) { if ((Object)(object)prefab == (Object)null || string.IsNullOrEmpty(instanceName)) { return false; } return instanceName.StartsWith(((Object)prefab).name, StringComparison.OrdinalIgnoreCase); } public static void Reset() { damagedValuables.Clear(); } } [HarmonyPatch(typeof(ValuableObject), "Start")] public static class Patch_CloakedValuables { private static void Postfix(ValuableObject __instance) { if ((Object)(object)((Component)__instance).GetComponent() == (Object)null) { ((Component)__instance).gameObject.AddComponent(); } } public static void Reset() { } } public class CloakedValuableComponent : MonoBehaviour { private ValuableObject valuable; private Renderer[] renderers; private PlayerAvatar localPlayer; private float checkTimer; private bool isHidden; private void Start() { valuable = ((Component)this).GetComponent(); renderers = ((Component)this).GetComponentsInChildren(); } private void Update() { //IL_0105: 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) if (!REPOEventManager.CloakedValuables || !SemiFunc.RunIsLevel()) { if (isHidden) { Show(); } return; } checkTimer += Time.deltaTime; if (checkTimer < 0.2f) { return; } checkTimer = 0f; if ((Object)(object)localPlayer == (Object)null && (Object)(object)localPlayer == (Object)null) { PlayerAvatar[] array = Object.FindObjectsOfType(); foreach (PlayerAvatar obj in array) { PropertyInfo propertyInfo = AccessTools.Property(typeof(PlayerAvatar), "isLocal"); if (propertyInfo != null && (bool)propertyInfo.GetValue(obj, null)) { localPlayer = obj; break; } FieldInfo fieldInfo = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); if (fieldInfo != null && (bool)fieldInfo.GetValue(obj)) { localPlayer = obj; break; } } } if ((Object)(object)localPlayer == (Object)null) { return; } if (Vector3.Distance(((Component)this).transform.position, ((Component)localPlayer).transform.position) > 5f) { if (!isHidden) { Hide(); } } else if (isHidden) { Show(); } } private void Hide() { Renderer[] array = renderers; foreach (Renderer val in array) { if ((Object)(object)val != (Object)null) { val.enabled = false; } } isHidden = true; } private void Show() { Renderer[] array = renderers; foreach (Renderer val in array) { if ((Object)(object)val != (Object)null) { val.enabled = true; } } isHidden = false; } } [HarmonyPatch(typeof(ValuableObject), "Update")] public static class Patch_RunawayValuables { private static FieldInfo FI_physGrabObject = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); private static FieldInfo FI_rb = AccessTools.Field(typeof(ValuableObject), "rb"); private static FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private const float RunawayRadius = 3f; private const float PushForce = 5f; private static void Postfix(ValuableObject __instance) { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.RunawayValuables || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { object? value = FI_physGrabObject.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((value is PhysGrabObject) ? value : null); object? value2 = FI_rb.GetValue(__instance); Rigidbody val2 = (Rigidbody)((value2 is Rigidbody) ? value2 : null); if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null) { return; } bool num = val.playerGrabbing != null && val.playerGrabbing.Count > 0; bool flag = Patch_ScaleInCart_TrackCart.IsInCart(val); bool flag2 = (Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)__instance).gameObject); if (num || flag || flag2) { return; } PlayerAvatar val3 = null; float num2 = float.MaxValue; foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (Object.op_Implicit((Object)(object)player) && !(bool)FI_isDisabled.GetValue(player)) { float num3 = Vector3.Distance(((Component)__instance).transform.position, ((Component)player).transform.position); if (num3 < num2) { num2 = num3; val3 = player; } } } if (Object.op_Implicit((Object)(object)val3) && num2 <= 3f) { if (val2.isKinematic) { val2.isKinematic = false; } Vector3 val4 = ((Component)__instance).transform.position - ((Component)val3).transform.position; Vector3 normalized = ((Vector3)(ref val4)).normalized; normalized.y = 0f; float num4 = Mathf.Lerp(1f, 3f, 1f - num2 / 3f); val2.AddForce(normalized * 5f * num4 * Time.deltaTime * 60f, (ForceMode)0); } } catch (Exception) { } } public static void Reset() { } } [HarmonyPatch(typeof(EnemyParent), "Update")] public static class Patch_TeleportingEnemies { private static readonly Dictionary teleportTimers; private static readonly float TELEPORT_INTERVAL; private static readonly int MAX_TELEPORT_ATTEMPTS; private static FieldInfo spawnedField; private static FieldInfo enemyField; private static FieldInfo hasNavMeshAgentField; private static FieldInfo navMeshAgentField; static Patch_TeleportingEnemies() { teleportTimers = new Dictionary(); TELEPORT_INTERVAL = 30f; MAX_TELEPORT_ATTEMPTS = 10; spawnedField = null; enemyField = null; hasNavMeshAgentField = null; navMeshAgentField = null; spawnedField = AccessTools.Field(typeof(EnemyParent), "Spawned"); enemyField = AccessTools.Field(typeof(EnemyParent), "Enemy"); hasNavMeshAgentField = AccessTools.Field(typeof(Enemy), "HasNavMeshAgent"); navMeshAgentField = AccessTools.Field(typeof(Enemy), "NavMeshAgent"); REPOConomyPlugin.Logger.LogInfo((object)"[TeleportingEnemies] Patch initialized"); } private static void Postfix(EnemyParent __instance) { //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Invalid comparison between Unknown and I4 if (!REPOEventManager.TeleportingEnemies || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } if (!(spawnedField != null) || !(bool)(spawnedField.GetValue(__instance) ?? ((object)false))) { teleportTimers.Remove(__instance); return; } object? obj = enemyField?.GetValue(__instance); Enemy val = (Enemy)((obj is Enemy) ? obj : null); if ((Object)(object)val == (Object)null || (int)val.CurrentState == 11) { teleportTimers.Remove(__instance); return; } if (!teleportTimers.ContainsKey(__instance)) { teleportTimers[__instance] = Random.Range(0f, TELEPORT_INTERVAL); } teleportTimers[__instance] += Time.deltaTime; if (teleportTimers[__instance] >= TELEPORT_INTERVAL) { teleportTimers[__instance] = 0f; TryTeleportEnemy(val, __instance.enemyName); } } private static bool GetHasNavMeshAgent(Enemy enemy) { if (hasNavMeshAgentField == null) { return false; } return (bool)(hasNavMeshAgentField.GetValue(enemy) ?? ((object)false)); } private static EnemyNavMeshAgent GetNavMeshAgent(Enemy enemy) { if (navMeshAgentField == null) { return null; } object? value = navMeshAgentField.GetValue(enemy); return (EnemyNavMeshAgent)((value is EnemyNavMeshAgent) ? value : null); } private static void TryTeleportEnemy(Enemy enemy, string enemyName) { //IL_0034: 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_003a: 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_006f: 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_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Invalid comparison between Unknown and I4 //IL_00c6: 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_00e2: 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_009e: Invalid comparison between Unknown and I4 //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Invalid comparison between Unknown and I4 //IL_00ab: Unknown result type (might be due to invalid IL or missing references) bool hasNavMeshAgent = GetHasNavMeshAgent(enemy); EnemyNavMeshAgent navMeshAgent = GetNavMeshAgent(enemy); if (!hasNavMeshAgent || (Object)(object)navMeshAgent == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)("[TeleportingEnemies] " + enemyName + " has no NavMeshAgent")); return; } Vector3 val = FindSafeTeleportPosition(enemy); if (val == Vector3.zero) { REPOConomyPlugin.Logger.LogWarning((object)("[TeleportingEnemies] No safe position for " + enemyName)); return; } navMeshAgent.ResetPath(); navMeshAgent.Stop(0.5f); enemy.EnemyTeleported(val); navMeshAgent.Warp(val, true); navMeshAgent.ResetPath(); navMeshAgent.Stop(0f); if ((int)enemy.CurrentState != 4 && (int)enemy.CurrentState != 3 && (int)enemy.CurrentState != 1) { enemy.CurrentState = (EnemyState)2; } REPOConomyPlugin.Logger.LogInfo((object)$"[TeleportingEnemies] {enemyName} в†’ ({val.x:F1}, {val.y:F1}, {val.z:F1})"); } private static Vector3 FindSafeTeleportPosition(Enemy enemy) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: 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_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_00d3: 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_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_0053: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) List list = new List(); Vector3 position = ((Component)enemy).transform.position; List list2 = SemiFunc.LevelPointsGetPlayerDistance(position, 15f, 50f, false); if (list2 != null && list2.Count > 0) { foreach (LevelPoint item in list2) { if ((Object)(object)item != (Object)null && IsPositionSafe(((Component)item).transform.position, enemy)) { list.Add(((Component)item).transform.position); } } } if (list.Count > 0) { return list[Random.Range(0, list.Count)]; } for (int i = 0; i < MAX_TELEPORT_ATTEMPTS; i++) { Vector3 val = Random.insideUnitSphere * 30f; val.y = 0f; Vector3 val2 = position + val; if (IsPositionSafe(val2, enemy)) { return val2; } } NavMeshHit val3 = default(NavMeshHit); for (int j = 0; j < 5; j++) { if (NavMesh.SamplePosition(position + Random.insideUnitSphere * 25f, ref val3, 15f, -1) && IsPositionSafe(((NavMeshHit)(ref val3)).position, enemy)) { return ((NavMeshHit)(ref val3)).position; } } return Vector3.zero; } private static bool IsPositionSafe(Vector3 position, Enemy enemy) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0064: 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) EnemyNavMeshAgent navMeshAgent = GetNavMeshAgent(enemy); if (GetHasNavMeshAgent(enemy) && (Object)(object)navMeshAgent != (Object)null && !navMeshAgent.OnNavmesh(position, 5f, true)) { return false; } if (!Physics.Raycast(position + Vector3.up * 2f, Vector3.down, 8f, LayerMask.GetMask(new string[1] { "Default" }))) { return false; } Collider[] array = Physics.OverlapSphere(position, 3f); for (int i = 0; i < array.Length; i++) { HurtCollider componentInParent = ((Component)array[i]).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && componentInParent.deathPit) { return false; } } return true; } public static void Reset() { teleportTimers.Clear(); } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_SharedPain { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static readonly FieldInfo FI_playerAvatar = AccessTools.Field(typeof(PlayerHealth), "playerAvatar"); private static readonly FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo FI_playerName = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static void Postfix(PlayerHealth __instance, int damage, bool savingGrace, int enemyIndex = -1) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_00f8: Unknown result type (might be due to invalid IL or missing references) try { if (!REPOEventManager.SharedPain || !SemiFunc.RunIsLevel() || (GameManager.Multiplayer() && !PhotonNetwork.IsMasterClient) || damage <= 0) { return; } PlayerAvatar val = (PlayerAvatar)FI_playerAvatar.GetValue(__instance); if ((Object)(object)val == (Object)null) { return; } int num = (int)FI_health.GetValue(__instance); bool flag = (bool)FI_isDisabled.GetValue(val); if (num <= 0 || flag) { return; } int num2 = Mathf.CeilToInt((float)damage * 0.25f); if (num2 <= 0) { return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!((Object)(object)player == (Object)(object)val)) { bool num3 = (bool)FI_isDisabled.GetValue(player); int num4 = (int)FI_health.GetValue(player.playerHealth); if (!num3 && num4 > 0) { player.playerHealth.HurtOther(num2, Vector3.zero, false, enemyIndex, false); string arg = (string)FI_playerName.GetValue(val); string arg2 = (string)FI_playerName.GetValue(player); REPOConomyPlugin.Logger.LogInfo((object)$"[SharedPain] рџ’” {arg} shared {num2} damage with {arg2}"); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SharedPain] Error in Hurt patch: " + ex.Message)); } } public static void Reset() { } } [HarmonyPatch(typeof(PlayerHealth), "Heal")] public static class Patch_SharedHealing { private static readonly FieldInfo FI_playerAvatar = AccessTools.Field(typeof(PlayerHealth), "playerAvatar"); private static readonly FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo FI_playerName = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static void Postfix(PlayerHealth __instance, int healAmount, bool effect) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown try { if (!REPOEventManager.SharedHealing || !SemiFunc.RunIsLevel() || (GameManager.Multiplayer() && !PhotonNetwork.IsMasterClient) || healAmount <= 0) { return; } PlayerAvatar val = (PlayerAvatar)FI_playerAvatar.GetValue(__instance); if ((Object)(object)val == (Object)null || (bool)FI_isDisabled.GetValue(val)) { return; } int num = Mathf.FloorToInt((float)healAmount * 0.5f); if (num <= 0) { return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (!((Object)(object)player == (Object)(object)val) && !(bool)FI_isDisabled.GetValue(player)) { player.playerHealth.HealOther(num, effect); string arg = (string)FI_playerName.GetValue(val); string arg2 = (string)FI_playerName.GetValue(player); REPOConomyPlugin.Logger.LogInfo((object)$"[SharedHealing] рџ’љ {arg} shared {num} healing with {arg2}"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SharedHealing] Error in Heal patch: " + ex.Message)); } } public static void Reset() { } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public static class Patch_LowHealthSpeedBoost { private static readonly FieldInfo FI_playerAvatarScript = AccessTools.Field(typeof(PlayerController), "playerAvatarScript"); private static readonly FieldInfo FI_MoveSpeed = AccessTools.Field(typeof(PlayerController), "MoveSpeed"); private static readonly FieldInfo FI_SprintSpeed = AccessTools.Field(typeof(PlayerController), "SprintSpeed"); private static readonly FieldInfo FI_CrouchSpeed = AccessTools.Field(typeof(PlayerController), "CrouchSpeed"); private static readonly FieldInfo FI_playerOriginalMoveSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalMoveSpeed"); private static readonly FieldInfo FI_playerOriginalSprintSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalSprintSpeed"); private static readonly FieldInfo FI_playerOriginalCrouchSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalCrouchSpeed"); private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static readonly FieldInfo FI_maxHealth = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); private static readonly FieldInfo FI_playerName = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static readonly FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static float lastHealthPercent = -1f; private static void Postfix(PlayerController __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown try { if (!REPOEventManager.LowHealthSpeedBoost || !SemiFunc.RunIsLevel()) { return; } PlayerAvatar val = (PlayerAvatar)FI_playerAvatarScript.GetValue(__instance); if ((Object)(object)val == (Object)null) { if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogInfo((object)"[ValuableEncumbrance] Player avatar is null"); } return; } if ((Object)(object)val.playerHealth == (Object)null) { if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogInfo((object)"[ValuableEncumbrance] Player health is null"); } return; } if (!(bool)FI_isLocal.GetValue(val)) { if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogInfo((object)"[ValuableEncumbrance] Not local player"); } return; } int num = (int)FI_health.GetValue(val.playerHealth); int num2 = (int)FI_maxHealth.GetValue(val.playerHealth); float num3 = (float)num / (float)num2; if (Mathf.Abs(num3 - lastHealthPercent) < 0.01f) { return; } lastHealthPercent = num3; float num4 = Mathf.Lerp(1f, 2.5f, 1f - num3); if (float.IsNaN(num4) || float.IsInfinity(num4) || num4 <= 0f) { REPOConomyPlugin.Logger.LogWarning((object)$"[LowHealthSpeedBoost] Invalid speedMultiplier: {num4}, healthPercent: {num3}"); return; } float num5 = (float)FI_playerOriginalMoveSpeed.GetValue(__instance); float num6 = (float)FI_playerOriginalSprintSpeed.GetValue(__instance); float num7 = (float)FI_playerOriginalCrouchSpeed.GetValue(__instance); if (!(num5 <= 0f) && !(num6 <= 0f) && !(num7 <= 0f)) { float num8 = num5 * num4; float num9 = num6 * num4; float num10 = num7 * num4; FI_MoveSpeed.SetValue(__instance, num8); FI_SprintSpeed.SetValue(__instance, num9); FI_CrouchSpeed.SetValue(__instance, num10); if (Mathf.Abs(num4 - 1f) > 0.01f) { string text = (string)FI_playerName.GetValue(val); REPOConomyPlugin.Logger.LogInfo((object)$"[LowHealthSpeedBoost] {text}: {num}/{num2} ({num3:P0}) в†’ {num4:F2}x speed"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LowHealthSpeedBoost] Error in FixedUpdate patch: " + ex.Message)); } } public static void Reset() { lastHealthPercent = -1f; } } [HarmonyPatch(typeof(PlayerController), "FixedUpdate")] public static class Patch_ValuableEncumbrance { private static readonly FieldInfo FI_playerAvatarScript; private static readonly FieldInfo FI_MoveSpeed; private static readonly FieldInfo FI_SprintSpeed; private static readonly FieldInfo FI_CrouchSpeed; private static readonly FieldInfo FI_playerOriginalMoveSpeed; private static readonly FieldInfo FI_playerOriginalSprintSpeed; private static readonly FieldInfo FI_playerOriginalCrouchSpeed; private static readonly FieldInfo FI_isLocal; private static readonly FieldInfo FI_physGrabber; private static FieldInfo FI_grabbedObject; static Patch_ValuableEncumbrance() { FI_playerAvatarScript = AccessTools.Field(typeof(PlayerController), "playerAvatarScript"); FI_MoveSpeed = AccessTools.Field(typeof(PlayerController), "MoveSpeed"); FI_SprintSpeed = AccessTools.Field(typeof(PlayerController), "SprintSpeed"); FI_CrouchSpeed = AccessTools.Field(typeof(PlayerController), "CrouchSpeed"); FI_playerOriginalMoveSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalMoveSpeed"); FI_playerOriginalSprintSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalSprintSpeed"); FI_playerOriginalCrouchSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalCrouchSpeed"); FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); FI_physGrabber = AccessTools.Field(typeof(PlayerAvatar), "physGrabber"); FI_grabbedObject = AccessTools.Field(typeof(PhysGrabber), "grabbedPhysGrabObject"); REPOConomyPlugin.Logger.LogInfo((object)$"[ValuableEncumbrance] grabbedObject field found: {FI_grabbedObject != null}"); } private static void Postfix(PlayerController __instance) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Expected O, but got Unknown try { if (!REPOEventManager.ValuableEncumbrance || !SemiFunc.RunIsLevel()) { return; } PlayerAvatar val = (PlayerAvatar)FI_playerAvatarScript.GetValue(__instance); if ((Object)(object)val == (Object)null || !(bool)FI_isLocal.GetValue(val)) { return; } float num = 0f; float num2 = 0f; try { PhysGrabber val2 = (PhysGrabber)(FI_physGrabber?.GetValue(val)); if ((Object)(object)val2 == (Object)null) { if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogInfo((object)"[ValuableEncumbrance] PhysGrabber is null"); } return; } if (FI_grabbedObject == null) { if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[ValuableEncumbrance] grabbedObject field not found"); } return; } object value = FI_grabbedObject.GetValue(val2); if (value != null) { PhysGrabObject val3 = null; val3 = (PhysGrabObject)((value is PhysGrabObject) ? value : null); if ((Object)(object)val3 == (Object)null) { Rigidbody val4 = (Rigidbody)((value is Rigidbody) ? value : null); if (val4 != null) { val3 = ((Component)val4).GetComponent(); if ((Object)(object)val3 != (Object)null) { REPOConomyPlugin.Logger.LogInfo((object)"[ValuableEncumbrance] Found PhysGrabObject from Rigidbody"); } } } if ((Object)(object)val3 == (Object)null) { REPOConomyPlugin.Logger.LogWarning((object)$"[ValuableEncumbrance] Could not get PhysGrabObject from grabbed object: {value.GetType()}"); } else { ValuableObject component = ((Component)val3).GetComponent(); if ((Object)(object)component != (Object)null) { float mass = val3.rb.mass; num += mass; float num3 = (float)AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent").GetValue(component); num2 += num3; REPOConomyPlugin.Logger.LogInfo((object)$"[ValuableEncumbrance] Found valuable: {((Object)val3).name}, mass {mass:F1}kg, value ${num3:F0}"); } else if (Time.frameCount % 300 == 0) { REPOConomyPlugin.Logger.LogInfo((object)("[ValuableEncumbrance] Object " + ((Object)val3).name + " is not valuable")); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[ValuableEncumbrance] Error accessing grabbed object: " + ex.Message)); } float num4 = Mathf.Min(num, 8f); float num5 = Mathf.Lerp(1f, 0.25f, num4 / 8f); float num6 = (float)FI_playerOriginalMoveSpeed.GetValue(__instance); float num7 = (float)FI_playerOriginalSprintSpeed.GetValue(__instance); float num8 = (float)FI_playerOriginalCrouchSpeed.GetValue(__instance); if (!(num6 <= 0f) && !(num7 <= 0f) && !(num8 <= 0f)) { float num9 = num6 * num5; float num10 = num7 * num5; float num11 = num8 * num5; FI_MoveSpeed.SetValue(__instance, num9); FI_SprintSpeed.SetValue(__instance, num10); FI_CrouchSpeed.SetValue(__instance, num11); if (num > 0f) { REPOConomyPlugin.Logger.LogInfo((object)$"[ValuableEncumbrance] Total mass: {num:F1}kg, Total value: ${num2:F0} в†’ {num5:F2}x speed"); } } } catch (Exception ex2) { REPOConomyPlugin.Logger.LogError((object)("[ValuableEncumbrance] Error in FixedUpdate patch: " + ex2.Message)); } } public static void Reset() { } } [HarmonyPatch(typeof(GameDirector), "Update")] public static class Patch_SpeedRooms { private static Dictionary roomSpeedMultipliers = new Dictionary(); private static RoomVolume lastRoom = null; private static bool initialized = false; private static gameState lastGameState = (gameState)0; private static readonly FieldInfo FI_MoveSpeed = AccessTools.Field(typeof(PlayerController), "MoveSpeed"); private static readonly FieldInfo FI_SprintSpeed = AccessTools.Field(typeof(PlayerController), "SprintSpeed"); private static readonly FieldInfo FI_CrouchSpeed = AccessTools.Field(typeof(PlayerController), "CrouchSpeed"); private static readonly FieldInfo FI_playerOriginalMoveSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalMoveSpeed"); private static readonly FieldInfo FI_playerOriginalSprintSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalSprintSpeed"); private static readonly FieldInfo FI_playerOriginalCrouchSpeed = AccessTools.Field(typeof(PlayerController), "playerOriginalCrouchSpeed"); private static readonly FieldInfo FI_StartRoom = AccessTools.Field(typeof(Module), "StartRoom"); private static void Postfix(GameDirector __instance) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 try { if ((int)lastGameState != 2 && (int)__instance.currentState == 2 && REPOEventManager.SpeedZones && SemiFunc.RunIsLevel()) { InitializeRooms(); } lastGameState = __instance.currentState; if (initialized && (int)__instance.currentState == 2 && SemiFunc.RunIsLevel()) { CheckPlayerRoom(); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SpeedRooms] Error: " + ex.Message)); } } private static bool IsStartRoom(Module module) { if ((Object)(object)module == (Object)null || FI_StartRoom == null) { return false; } try { return (bool)FI_StartRoom.GetValue(module); } catch { return false; } } private static void InitializeRooms() { roomSpeedMultipliers.Clear(); lastRoom = null; initialized = false; RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val in array) { if (!val.Truck && !val.Extraction && !IsStartRoom(val.Module)) { float num = Random.Range(0.5f, 2f); roomSpeedMultipliers[val] = num; string arg = ((num > 1f) ? "SPEED" : "SLOW"); REPOConomyPlugin.Logger.LogInfo((object)$"[SpeedRooms] Room '{((Object)val).name}': {num:F2}x ({arg})"); } } initialized = true; REPOConomyPlugin.Logger.LogInfo((object)$"[SpeedRooms] вњ… Initialized {roomSpeedMultipliers.Count} rooms"); } private static void CheckPlayerRoom() { if ((Object)(object)PlayerController.instance == (Object)null) { return; } PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null) { return; } RoomVolumeCheck componentInChildren = ((Component)instance).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null) { return; } RoomVolume val = null; float num = 1f; if (componentInChildren.CurrentRooms != null && componentInChildren.CurrentRooms.Count > 0) { foreach (RoomVolume currentRoom in componentInChildren.CurrentRooms) { if (roomSpeedMultipliers.TryGetValue(currentRoom, out var value)) { val = currentRoom; num = value; break; } } } if ((Object)(object)val != (Object)(object)lastRoom) { if ((Object)(object)val != (Object)null) { string arg = ((num > 1f) ? "вљЎ SPEED" : "рџђЊ SLOW"); REPOConomyPlugin.Logger.LogInfo((object)$"[SpeedRooms] {arg} {num:F2}x"); } else if ((Object)(object)lastRoom != (Object)null) { REPOConomyPlugin.Logger.LogInfo((object)"[SpeedRooms] Normal speed"); } lastRoom = val; } if ((Object)(object)val != (Object)null) { ApplySpeedMultiplier(num); } else { ResetSpeed(); } } private static void ApplySpeedMultiplier(float multiplier) { if ((Object)(object)PlayerController.instance == (Object)null) { return; } try { float num = (float)FI_playerOriginalMoveSpeed.GetValue(PlayerController.instance); float num2 = (float)FI_playerOriginalSprintSpeed.GetValue(PlayerController.instance); float num3 = (float)FI_playerOriginalCrouchSpeed.GetValue(PlayerController.instance); if (!(num <= 0f) && !(num2 <= 0f) && !(num3 <= 0f)) { FI_MoveSpeed.SetValue(PlayerController.instance, num * multiplier); FI_SprintSpeed.SetValue(PlayerController.instance, num2 * multiplier); FI_CrouchSpeed.SetValue(PlayerController.instance, num3 * multiplier); } } catch { } } private static void ResetSpeed() { if ((Object)(object)PlayerController.instance == (Object)null) { return; } try { float num = (float)FI_playerOriginalMoveSpeed.GetValue(PlayerController.instance); float num2 = (float)FI_playerOriginalSprintSpeed.GetValue(PlayerController.instance); float num3 = (float)FI_playerOriginalCrouchSpeed.GetValue(PlayerController.instance); if (!(num <= 0f) && !(num2 <= 0f) && !(num3 <= 0f)) { FI_MoveSpeed.SetValue(PlayerController.instance, num); FI_SprintSpeed.SetValue(PlayerController.instance, num2); FI_CrouchSpeed.SetValue(PlayerController.instance, num3); } } catch { } } public static void Reset() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) roomSpeedMultipliers.Clear(); lastRoom = null; initialized = false; lastGameState = (gameState)0; ResetSpeed(); REPOConomyPlugin.Logger.LogInfo((object)"[SpeedRooms] Reset complete"); } } [HarmonyPatch(typeof(PlayerAvatar), "Update")] public static class Patch_RandomPlayerTeleportations { private static readonly Dictionary teleportTimers = new Dictionary(); private static readonly Dictionary nextTeleportIntervals = new Dictionary(); private const float MIN_TELEPORT_INTERVAL = 30f; private const float MAX_TELEPORT_INTERVAL = 60f; private const int MAX_TELEPORT_ATTEMPTS = 20; private static readonly FieldInfo FI_isLocal = AccessTools.Field(typeof(PlayerAvatar), "isLocal"); private static readonly FieldInfo FI_isDisabled = AccessTools.Field(typeof(PlayerAvatar), "isDisabled"); private static readonly FieldInfo FI_deadSet = AccessTools.Field(typeof(PlayerAvatar), "deadSet"); private static readonly FieldInfo FI_playerName = AccessTools.Field(typeof(PlayerAvatar), "playerName"); private static readonly FieldInfo FI_LastNavmeshPosition = AccessTools.Field(typeof(PlayerAvatar), "LastNavmeshPosition"); private static readonly FieldInfo FI_LastNavMeshPositionTimer = AccessTools.Field(typeof(PlayerAvatar), "LastNavMeshPositionTimer"); private static readonly FieldInfo FI_playerRb = AccessTools.Field(typeof(PlayerAvatar), "rb"); private static readonly FieldInfo FI_clientPosition = AccessTools.Field(typeof(PlayerAvatar), "clientPosition"); private static readonly FieldInfo FI_clientPositionCurrent = AccessTools.Field(typeof(PlayerAvatar), "clientPositionCurrent"); private static readonly FieldInfo FI_clientRotation = AccessTools.Field(typeof(PlayerAvatar), "clientRotation"); private static readonly FieldInfo FI_clientRotationCurrent = AccessTools.Field(typeof(PlayerAvatar), "clientRotationCurrent"); private static readonly FieldInfo FI_inTruck = AccessTools.Field(typeof(RoomVolumeCheck), "inTruck"); private static readonly FieldInfo FI_inExtractionPoint = AccessTools.Field(typeof(RoomVolumeCheck), "inExtractionPoint"); private static readonly FieldInfo FI_tumble_physGrabObject = AccessTools.Field(typeof(PlayerTumble), "physGrabObject"); private static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static void Postfix(PlayerAvatar __instance) { if (!REPOEventManager.RandomPlayerTeleportations || !SemiFunc.RunIsLevel() || (Object)(object)__instance == (Object)null || !(bool)(FI_isLocal?.GetValue(__instance) ?? ((object)false)) || (bool)(FI_isDisabled?.GetValue(__instance) ?? ((object)false)) || (bool)(FI_deadSet?.GetValue(__instance) ?? ((object)false))) { return; } if ((Object)(object)__instance.RoomVolumeCheck != (Object)null) { bool num = (bool)(FI_inTruck?.GetValue(__instance.RoomVolumeCheck) ?? ((object)false)); bool flag = (bool)(FI_inExtractionPoint?.GetValue(__instance.RoomVolumeCheck) ?? ((object)false)); if (num || flag) { return; } } if (!teleportTimers.ContainsKey(__instance)) { teleportTimers[__instance] = 0f; nextTeleportIntervals[__instance] = GetRandomTeleportInterval(); } teleportTimers[__instance] += Time.deltaTime; float value; float num2 = (nextTeleportIntervals.TryGetValue(__instance, out value) ? value : GetRandomTeleportInterval()); if (teleportTimers[__instance] >= num2) { teleportTimers[__instance] = 0f; nextTeleportIntervals[__instance] = GetRandomTeleportInterval(); TryTeleportPlayer(__instance); } } private static void TryTeleportPlayer(PlayerAvatar playerAvatar) { //IL_0001: 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_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) Vector3 val = FindSafeTeleportPosition(playerAvatar); if (val == Vector3.zero) { string text = (string)(FI_playerName?.GetValue(playerAvatar) ?? "Unknown"); REPOConomyPlugin.Logger.LogWarning((object)("[RandomTeleport] No safe position for " + text)); } else { TeleportPlayer(playerAvatar, val); string text2 = (string)(FI_playerName?.GetValue(playerAvatar) ?? "Unknown"); REPOConomyPlugin.Logger.LogInfo((object)("[RandomTeleport] " + text2 + " teleported!")); } } private static void TeleportPlayer(PlayerAvatar playerAvatar, Vector3 position) { //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_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_000f: 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_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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_0085: 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_0095: 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_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: 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_00fd: 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_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019c: 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_01ec: Unknown result type (might be due to invalid IL or missing references) try { Quaternion rotation = ((Component)playerAvatar).transform.rotation; Vector3 val = position + Vector3.up * 0.3f; PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(playerAvatar); if ((Object)(object)playerTumble != (Object)null) { object? obj = FI_tumble_physGrabObject?.GetValue(playerTumble); PhysGrabObject val2 = (PhysGrabObject)((obj is PhysGrabObject) ? obj : null); if ((Object)(object)val2 != (Object)null) { val2.Teleport(val, rotation); } } object? obj2 = FI_playerRb?.GetValue(playerAvatar); Rigidbody val3 = (Rigidbody)((obj2 is Rigidbody) ? obj2 : null); if ((Object)(object)val3 != (Object)null) { val3.position = position; val3.rotation = rotation; val3.velocity = Vector3.zero; val3.angularVelocity = Vector3.zero; } ((Component)playerAvatar).transform.position = position; ((Component)playerAvatar).transform.rotation = rotation; FI_clientPosition?.SetValue(playerAvatar, position); FI_clientPositionCurrent?.SetValue(playerAvatar, position); FI_clientRotation?.SetValue(playerAvatar, rotation); FI_clientRotationCurrent?.SetValue(playerAvatar, rotation); if ((Object)(object)PlayerController.instance != (Object)null) { ((Component)PlayerController.instance).transform.position = position; ((Component)PlayerController.instance).transform.rotation = rotation; if ((Object)(object)PlayerController.instance.rb != (Object)null) { PlayerController.instance.rb.position = position; PlayerController.instance.rb.rotation = rotation; PlayerController.instance.rb.velocity = Vector3.zero; PlayerController.instance.rb.angularVelocity = Vector3.zero; } } playerAvatar.FallDamageResetSet(2f); if ((Object)(object)playerTumble != (Object)null) { playerTumble.TumbleRequest(false, false); } if ((Object)(object)AssetManager.instance != (Object)null && (Object)(object)AssetManager.instance.prefabTeleportEffect != (Object)null) { Object.Instantiate(AssetManager.instance.prefabTeleportEffect, position, Quaternion.identity); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RandomTeleport] Error: " + ex.Message)); } } private static Vector3 FindSafeTeleportPosition(PlayerAvatar playerAvatar) { //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_0012: Unknown result type (might be due to invalid IL or missing references) //IL_00db: 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_00e7: 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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_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_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_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_0196: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: 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_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)playerAvatar).transform.position; List list = new List(); List list2 = SemiFunc.LevelPointsGetPlayerDistance(position, 10f, 120f, false); if (list2 != null && list2.Count > 0) { NavMeshHit val = default(NavMeshHit); foreach (LevelPoint item in list2) { if (!((Object)(object)item == (Object)null) && !((Object)(object)item.Room == (Object)null) && NavMesh.SamplePosition(((Component)item).transform.position, ref val, 4f, -1) && IsPositionSafe(((NavMeshHit)(ref val)).position)) { list.Add(((NavMeshHit)(ref val)).position + Vector3.up * 0.2f); } } } if (list.Count > 0) { return list[Random.Range(0, list.Count)]; } NavMeshHit val3 = default(NavMeshHit); for (int i = 0; i < 20; i++) { Vector3 val2 = position + Random.insideUnitSphere * 65f; val2.y = position.y; if (NavMesh.SamplePosition(val2, ref val3, 8f, -1) && IsPositionSafe(((NavMeshHit)(ref val3)).position)) { return ((NavMeshHit)(ref val3)).position + Vector3.up * 0.2f; } } float num = (float)(FI_LastNavMeshPositionTimer?.GetValue(playerAvatar) ?? ((object)999f)); Vector3 val4 = (Vector3)(FI_LastNavmeshPosition?.GetValue(playerAvatar) ?? ((object)Vector3.zero)); if (num < 45f && val4 != Vector3.zero && IsPositionSafe(val4)) { return val4 + Vector3.up * 0.2f; } NavMeshHit val5 = default(NavMeshHit); if (NavMesh.SamplePosition(position, ref val5, 12f, -1)) { return ((NavMeshHit)(ref val5)).position + Vector3.up * 0.2f; } return Vector3.zero; } private static bool IsPositionSafe(Vector3 position) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0034: 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_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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_0096: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) if (float.IsNaN(position.x) || float.IsInfinity(position.x) || float.IsNaN(position.y) || float.IsInfinity(position.y) || float.IsNaN(position.z) || float.IsInfinity(position.z)) { return false; } if (position.y < -50f || position.y > 200f) { return false; } NavMeshHit val = default(NavMeshHit); if (!NavMesh.SamplePosition(position, ref val, 2f, -1)) { return false; } Vector3 position2 = ((NavMeshHit)(ref val)).position; if (!Physics.Raycast(position2 + Vector3.up * 1.5f, Vector3.down, 4f, LayerMask.GetMask(new string[1] { "Default" }))) { return false; } Collider[] array = Physics.OverlapSphere(position2, 2.5f); foreach (Collider val2 in array) { HurtCollider componentInParent = ((Component)val2).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null && componentInParent.deathPit) { return false; } if ((Object)(object)((Component)val2).GetComponentInParent() != (Object)null) { return false; } } if ((Object)(object)EnemyDirector.instance != (Object)null && EnemyDirector.instance.enemiesSpawned != null) { foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item != (Object)null) { object? obj = FI_Enemy?.GetValue(item); Enemy val3 = (Enemy)((obj is Enemy) ? obj : null); if ((Object)(object)val3 != (Object)null && Vector3.Distance(position2, ((Component)val3).transform.position) < 6f) { return false; } } } } array = Physics.OverlapSphere(position2, 1.5f); foreach (Collider val4 in array) { RoomVolume val5 = ((Component)val4).GetComponent(); if ((Object)(object)val5 == (Object)null) { val5 = ((Component)val4).GetComponentInParent(); } if ((Object)(object)val5 != (Object)null && (val5.Truck || val5.Extraction)) { return false; } } return true; } private static float GetRandomTeleportInterval() { return Random.Range(30f, 60f); } public static void Reset() { teleportTimers.Clear(); nextTeleportIntervals.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[RandomTeleport] Reset"); } } [HarmonyPatch(typeof(PhysGrabber), "ReleaseObject")] public static class Patch_StickyValuables { private static readonly Dictionary stickyEndTime = new Dictionary(); private static readonly Dictionary stickyNotified = new Dictionary(); private static readonly float STICKY_CHANCE = 0.45f; private static readonly float MIN_STICKY_TIME = 0.4f; private static readonly float MAX_STICKY_TIME = 1.8f; private static readonly FieldInfo FI_grabbed = AccessTools.Field(typeof(PhysGrabber), "grabbed"); private static readonly FieldInfo FI_grabbedPhysGrabObject = AccessTools.Field(typeof(PhysGrabber), "grabbedPhysGrabObject"); private static readonly FieldInfo FI_isLocal = AccessTools.Field(typeof(PhysGrabber), "isLocal"); private static readonly FieldInfo FI_toggleGrab = AccessTools.Field(typeof(PhysGrabber), "toggleGrab"); private static readonly FieldInfo FI_isValuable = AccessTools.Field(typeof(PhysGrabObject), "isValuable"); private static bool Prefix(PhysGrabber __instance, int _releaseObjectViewID, float _disableTimer) { try { if (!REPOEventManager.StickyValuables || !SemiFunc.RunIsLevel()) { return true; } if (!(bool)(FI_isLocal?.GetValue(__instance) ?? ((object)false))) { return true; } if (!(bool)(FI_grabbed?.GetValue(__instance) ?? ((object)false))) { return true; } object? obj = FI_grabbedPhysGrabObject?.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((obj is PhysGrabObject) ? obj : null); if ((Object)(object)val == (Object)null) { return true; } if (!(bool)(FI_isValuable?.GetValue(val) ?? ((object)false))) { return true; } if (stickyEndTime.TryGetValue(__instance, out var value)) { if (Time.time < value) { if (!stickyNotified.ContainsKey(__instance) || !stickyNotified[__instance]) { stickyNotified[__instance] = true; REPOConomyPlugin.Logger.LogInfo((object)$"[StickyValuables] рџ«\u00a0 Blocked release! {value - Time.time:F2}s remaining"); } FI_toggleGrab?.SetValue(__instance, true); return false; } stickyEndTime.Remove(__instance); stickyNotified.Remove(__instance); REPOConomyPlugin.Logger.LogInfo((object)"[StickyValuables] вњ… Sticky time ended, releasing..."); return true; } if (Random.Range(0f, 1f) < STICKY_CHANCE) { float num = Random.Range(MIN_STICKY_TIME, MAX_STICKY_TIME); stickyEndTime[__instance] = Time.time + num; stickyNotified[__instance] = false; REPOConomyPlugin.Logger.LogInfo((object)$"[StickyValuables] рџ«\u00a0 Valuable stuck for {num:F2}s!"); __instance.OverrideColorToPurple(num); FI_toggleGrab?.SetValue(__instance, true); return false; } return true; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[StickyValuables] Error in Prefix: " + ex.Message)); return true; } } public static void Reset() { stickyEndTime.Clear(); stickyNotified.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[StickyValuables] Reset"); } } [HarmonyPatch] public static class Patch_ExplosiveThrowValuables { private const int BREAK_LEVEL_HEAVY = 0; private const int BREAK_LEVEL_MEDIUM = 1; private const int BREAK_LEVEL_LIGHT = 2; private static readonly float EXPLOSION_SIZE_HEAVY = 0.5f; private static readonly float EXPLOSION_SIZE_MEDIUM = 0.3f; private static readonly int EXPLOSION_DAMAGE_HEAVY = 40; private static readonly int EXPLOSION_DAMAGE_MEDIUM = 20; private static readonly int EXPLOSION_ENEMY_DAMAGE_HEAVY = 80; private static readonly int EXPLOSION_ENEMY_DAMAGE_MEDIUM = 40; private static readonly Dictionary explosionCooldown = new Dictionary(); private static ParticleScriptExplosion cachedExplosionScript = null; private static readonly FieldInfo FI_isValuable = AccessTools.Field(typeof(PhysGrabObjectImpactDetector), "isValuable"); [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakRPC")] [HarmonyPostfix] private static void BreakRPC_Postfix(PhysGrabObjectImpactDetector __instance, float valueLost, Vector3 _contactPoint, int breakLevel, bool _loseValue) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (_loseValue && !(valueLost <= 0f)) { switch (breakLevel) { case 0: TryExplode(__instance, _contactPoint, EXPLOSION_SIZE_HEAVY, EXPLOSION_DAMAGE_HEAVY, EXPLOSION_ENEMY_DAMAGE_HEAVY, "Heavy"); break; case 1: TryExplode(__instance, _contactPoint, EXPLOSION_SIZE_MEDIUM, EXPLOSION_DAMAGE_MEDIUM, EXPLOSION_ENEMY_DAMAGE_MEDIUM, "Medium"); break; default: _ = 2; break; } } } private static void TryExplode(PhysGrabObjectImpactDetector instance, Vector3 contactPoint, float explosionSize, int damage, int enemyDamage, string impactType) { //IL_00ac: 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_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) try { if (!((Object)(object)instance == (Object)null) && REPOEventManager.ExplosiveThrowValuables && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && (bool)(FI_isValuable?.GetValue(instance) ?? ((object)false)) && !instance.inCart && (!explosionCooldown.TryGetValue(instance, out var value) || !(Time.time - value < 1f))) { explosionCooldown[instance] = Time.time; REPOConomyPlugin.Logger.LogInfo((object)("[ExplosiveThrowValuables] " + impactType + " break triggered explosion!")); CreateExplosion((contactPoint != Vector3.zero) ? contactPoint : ((Component)instance).transform.position, explosionSize, damage, enemyDamage); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExplosiveThrowValuables] Error: " + ex.Message)); } } private static ParticleScriptExplosion GetExplosionScript() { if ((Object)(object)cachedExplosionScript != (Object)null) { return cachedExplosionScript; } cachedExplosionScript = Object.FindObjectOfType(); if ((Object)(object)cachedExplosionScript != (Object)null) { REPOConomyPlugin.Logger.LogInfo((object)"[ExplosiveThrowValuables] Found ParticleScriptExplosion in scene"); return cachedExplosionScript; } ItemGrenadeExplosive val = Object.FindObjectOfType(); if ((Object)(object)val != (Object)null) { cachedExplosionScript = ((Component)val).GetComponent(); if ((Object)(object)cachedExplosionScript != (Object)null) { REPOConomyPlugin.Logger.LogInfo((object)"[ExplosiveThrowValuables] Found ParticleScriptExplosion on grenade"); return cachedExplosionScript; } } ParticleScriptExplosion[] array = Resources.FindObjectsOfTypeAll(); if (array.Length != 0) { cachedExplosionScript = array[0]; REPOConomyPlugin.Logger.LogInfo((object)"[ExplosiveThrowValuables] Found ParticleScriptExplosion via Resources"); return cachedExplosionScript; } REPOConomyPlugin.Logger.LogWarning((object)"[ExplosiveThrowValuables] Could not find ParticleScriptExplosion!"); return null; } private static void CreateExplosion(Vector3 explosionPos, float size, int damage, int enemyDamage) { //IL_007b: 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_0010: 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_0045: Unknown result type (might be due to invalid IL or missing references) try { ParticleScriptExplosion explosionScript = GetExplosionScript(); if ((Object)(object)explosionScript != (Object)null) { explosionScript.Spawn(explosionPos, size, damage, enemyDamage, 1.5f, false, false, 1f); REPOConomyNetworkHandler.SyncExplosionToClients(explosionPos, size, damage, enemyDamage, 1.5f); REPOConomyPlugin.Logger.LogInfo((object)$"[ExplosiveThrowValuables] Explosion spawned at {explosionPos}"); } else { FallbackExplosion(explosionPos, size); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExplosiveThrowValuables] Explosion error: " + ex.Message)); FallbackExplosion(explosionPos, size); } } private static void FallbackExplosion(Vector3 explosionPos, float size) { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_009c: 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_00a2: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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_00f9: 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) if ((Object)(object)GameDirector.instance != (Object)null) { float num = size * 10f; GameDirector.instance.CameraImpact.ShakeDistance(num, 4f, 8f, explosionPos, 0.2f); GameDirector.instance.CameraShake.ShakeDistance(num, 4f, 8f, explosionPos, 0.4f); } if ((Object)(object)AssetManager.instance != (Object)null) { AssetManager.instance.PhysImpactEffect(explosionPos); } Collider[] array = Physics.OverlapSphere(explosionPos, 3f); foreach (Collider val in array) { Rigidbody componentInParent = ((Component)val).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { Vector3 val2 = ((Component)val).transform.position - explosionPos; Vector3 normalized = ((Vector3)(ref val2)).normalized; float num2 = Vector3.Distance(((Component)val).transform.position, explosionPos); float num3 = Mathf.Lerp(8f, 1f, num2 / 3f) * size * 2f; componentInParent.AddForce((normalized + Vector3.up * 0.2f) * num3, (ForceMode)1); } } } public static void Reset() { explosionCooldown.Clear(); cachedExplosionScript = null; REPOConomyPlugin.Logger.LogInfo((object)"[ExplosiveThrowValuables] Reset"); } } [HarmonyPatch(typeof(GameDirector), "Update")] public static class Patch_RoomGravity { private static Dictionary roomGravityMultipliers = new Dictionary(); private static RoomVolume lastRoom = null; private static bool initialized = false; private static gameState lastGameState = (gameState)0; private static readonly FieldInfo FI_StartRoom = AccessTools.Field(typeof(Module), "StartRoom"); private static readonly FieldInfo FI_CustomGravity = AccessTools.Field(typeof(PlayerController), "CustomGravity"); private static readonly FieldInfo FI_playerOriginalCustomGravity = AccessTools.Field(typeof(PlayerController), "playerOriginalCustomGravity"); private static void Postfix(GameDirector __instance) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Invalid comparison between Unknown and I4 //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Invalid comparison between Unknown and I4 //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Invalid comparison between Unknown and I4 try { if ((int)lastGameState != 2 && (int)__instance.currentState == 2 && REPOEventManager.RoomGravity && SemiFunc.RunIsLevel()) { InitializeRooms(); } lastGameState = __instance.currentState; if (initialized && (int)__instance.currentState == 2 && SemiFunc.RunIsLevel()) { CheckPlayerRoom(); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RoomGravity] Error: " + ex.Message)); } } private static bool IsStartRoom(Module module) { if ((Object)(object)module == (Object)null || FI_StartRoom == null) { return false; } try { return (bool)FI_StartRoom.GetValue(module); } catch { return false; } } private static void InitializeRooms() { roomGravityMultipliers.Clear(); lastRoom = null; initialized = false; RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val in array) { if (!val.Truck && !val.Extraction && !IsStartRoom(val.Module)) { float num = Random.Range(0.3f, 2f); roomGravityMultipliers[val] = num; string arg = ((num < 1f) ? "LOW GRAVITY" : "HIGH GRAVITY"); REPOConomyPlugin.Logger.LogInfo((object)$"[RoomGravity] Room '{((Object)val).name}': {num:F2}x ({arg})"); } } initialized = true; REPOConomyPlugin.Logger.LogInfo((object)$"[RoomGravity] вњ… Initialized {roomGravityMultipliers.Count} rooms"); } private static void CheckPlayerRoom() { if ((Object)(object)PlayerController.instance == (Object)null) { return; } PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null) { return; } RoomVolumeCheck roomVolumeCheck = instance.RoomVolumeCheck; if ((Object)(object)roomVolumeCheck == (Object)null) { return; } RoomVolume val = null; float num = 1f; if (roomVolumeCheck.CurrentRooms != null && roomVolumeCheck.CurrentRooms.Count > 0) { foreach (RoomVolume currentRoom in roomVolumeCheck.CurrentRooms) { if (roomGravityMultipliers.TryGetValue(currentRoom, out var value)) { val = currentRoom; num = value; break; } } } if ((Object)(object)val != (Object)(object)lastRoom) { if ((Object)(object)val != (Object)null) { string arg = ((num < 1f) ? "рџЄ¶ LOW GRAVITY" : "рџЄЁ HIGH GRAVITY"); REPOConomyPlugin.Logger.LogInfo((object)$"[RoomGravity] {arg} {num:F2}x"); } else if ((Object)(object)lastRoom != (Object)null) { REPOConomyPlugin.Logger.LogInfo((object)"[RoomGravity] Normal gravity"); } lastRoom = val; } if ((Object)(object)val != (Object)null) { ApplyGravityMultiplier(num); } else { ResetGravity(); } } private static void ApplyGravityMultiplier(float multiplier) { if ((Object)(object)PlayerController.instance == (Object)null) { return; } try { float num = (float)(FI_playerOriginalCustomGravity?.GetValue(PlayerController.instance) ?? ((object)20f)); if (!(num <= 0f)) { FI_CustomGravity?.SetValue(PlayerController.instance, num * multiplier); } } catch { } } private static void ResetGravity() { if ((Object)(object)PlayerController.instance == (Object)null) { return; } try { float num = (float)(FI_playerOriginalCustomGravity?.GetValue(PlayerController.instance) ?? ((object)20f)); if (!(num <= 0f)) { FI_CustomGravity?.SetValue(PlayerController.instance, num); } } catch { } } public static void Reset() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) roomGravityMultipliers.Clear(); lastRoom = null; initialized = false; lastGameState = (gameState)0; ResetGravity(); REPOConomyPlugin.Logger.LogInfo((object)"[RoomGravity] Reset complete"); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPriority(0)] public static class Patch_DoubleJump { private static readonly FieldInfo FI_JumpExtra = AccessTools.Field(typeof(PlayerController), "JumpExtra"); [HarmonyPostfix] private static void Postfix(ref bool __result) { if (!__result && REPOEventManager.DoubleJump && SemiFunc.RunIsLevel() && !((Object)(object)PlayerController.instance == (Object)null)) { int num = (int)(FI_JumpExtra?.GetValue(PlayerController.instance) ?? ((object)0)); FI_JumpExtra?.SetValue(PlayerController.instance, num + 1); REPOConomyPlugin.Logger.LogInfo((object)$"[DoubleJump] вњ… +1 extra jump! Total: {num + 1}"); } } public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[DoubleJump] Reset"); } } [HarmonyPatch(typeof(PlayerTumble), "ImpactHurtSetRPC")] public static class Patch_NoFallDamage { [HarmonyPrefix] private static bool Prefix() { if (!REPOEventManager.NoFallDamage) { return true; } if (!SemiFunc.RunIsLevel()) { return true; } REPOConomyPlugin.Logger.LogInfo((object)"[NoFallDamage] рџ›ЎпёЏ Fall damage blocked!"); return false; } public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[NoFallDamage] Reset"); } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_DamageTradeoff_PlayerTakeDamage { [HarmonyPrefix] private static void Prefix(ref int damage, bool hurtByHeal = false) { if (REPOEventManager.DamageTradeoff && SemiFunc.RunIsLevel() && !hurtByHeal) { int num = damage; damage = Mathf.RoundToInt((float)damage * 1.5f); REPOConomyPlugin.Logger.LogInfo((object)$"[DamageTradeoff] 🔴 Player takes MORE damage: {num} -> {damage} (x1.5)"); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_DamageTradeoff_EnemyTakeDamage { [HarmonyPrefix] private static void Prefix(ref int _damage) { if (REPOEventManager.DamageTradeoff && SemiFunc.RunIsLevel()) { int num = _damage; _damage *= 2; REPOConomyPlugin.Logger.LogInfo((object)$"[DamageTradeoff] рџџў Enemy takes MORE damage: {num} -> {_damage} (x2)"); } } } [HarmonyPatch(typeof(PhysGrabber), "Update")] public static class Patch_CursedValuables { private const float VALUE_THRESHOLD = 5000f; private const float DAMAGE_PER_SECOND = 2.5f; private static Dictionary damageTimers = new Dictionary(); private static readonly FieldInfo FI_grabbedPhysGrabObject = AccessTools.Field(typeof(PhysGrabber), "grabbedPhysGrabObject"); private static readonly FieldInfo FI_dollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); [HarmonyPostfix] private static void Postfix(PhysGrabber __instance) { if (!REPOEventManager.CursedValuables || !SemiFunc.RunIsLevel() || !__instance.isLocal) { return; } if (!__instance.grabbed) { if (damageTimers.ContainsKey(__instance)) { damageTimers[__instance] = 0f; } return; } object? obj = FI_grabbedPhysGrabObject?.GetValue(__instance); PhysGrabObject val = (PhysGrabObject)((obj is PhysGrabObject) ? obj : null); if ((Object)(object)val == (Object)null) { if (damageTimers.ContainsKey(__instance)) { damageTimers[__instance] = 0f; } return; } ValuableObject component = ((Component)val).GetComponent(); if ((Object)(object)component == (Object)null) { return; } float num = 0f; object obj2 = FI_dollarValueCurrent?.GetValue(component); if (obj2 != null) { num = (float)obj2; } if (num < 5000f) { return; } if (!damageTimers.ContainsKey(__instance)) { damageTimers[__instance] = 0f; } damageTimers[__instance] += Time.deltaTime; if (damageTimers[__instance] >= 3f) { damageTimers[__instance] = 0f; PlayerAvatar playerAvatar = __instance.playerAvatar; PlayerHealth val2 = ((playerAvatar != null) ? ((Component)playerAvatar).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { int num2 = Mathf.RoundToInt(2.5f * (num / 5000f)); num2 = Mathf.Clamp(num2, 1, 20); val2.Hurt(num2, false, -1, false); REPOConomyPlugin.Logger.LogInfo((object)$"[CursedValuables] рџ’Ђ Holding valuable worth ${num} - took {num2} damage!"); } } } public static void Reset() { damageTimers.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[CursedValuables] Reset"); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "BreakRPC")] public static class Patch_AlarmSystem { private const float ALARM_RADIUS = 30f; [HarmonyPostfix] private static void Postfix(PhysGrabObjectImpactDetector __instance, float valueLost, Vector3 _contactPoint, int breakLevel, bool _loseValue) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_005b: 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: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.AlarmSystem && SemiFunc.RunIsLevel() && _loseValue && __instance.isValuable) { float num = 30f; num = breakLevel switch { 0 => 40f, 1 => 30f, _ => 20f, }; Vector3 val = ((_contactPoint != Vector3.zero) ? _contactPoint : ((Component)__instance).transform.position); SemiFunc.EnemyInvestigate(val, num, false); REPOConomyPlugin.Logger.LogInfo((object)$"[AlarmSystem] рџљЁ ALARM TRIGGERED! Radius: {num}m at {val}"); } } public static void Reset() { REPOConomyPlugin.Logger.LogInfo((object)"[AlarmSystem] Reset"); } } [HarmonyPatch(typeof(PhysGrabObject), "GrabStarted")] public static class Patch_EnemyTouchShock { private static Dictionary shockCooldowns = new Dictionary(); private const float SHOCK_COOLDOWN = 1.5f; private const int ENEMY_DAMAGE = 15; private const int PLAYER_DAMAGE = 5; private const float TUMBLE_TIME = 1.5f; private static readonly FieldInfo FI_isEnemy = AccessTools.Field(typeof(PhysGrabObject), "isEnemy"); private static readonly FieldInfo FI_enemyRigidbody = AccessTools.Field(typeof(PhysGrabObject), "enemyRigidbody"); private static readonly FieldInfo FI_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static readonly FieldInfo FI_Health = AccessTools.Field(typeof(Enemy), "Health"); private static readonly FieldInfo FI_dead = AccessTools.Field(typeof(EnemyHealth), "dead"); private static readonly FieldInfo FI_toggleGrab = AccessTools.Field(typeof(PhysGrabber), "toggleGrab"); private static readonly FieldInfo FI_grabDisableTimer = AccessTools.Field(typeof(PhysGrabber), "grabDisableTimer"); private static HashSet pendingShocks = new HashSet(); private static Dictionary pendingEnemies = new Dictionary(); [HarmonyPostfix] private static void Postfix(PhysGrabObject __instance, PhysGrabber player) { if (REPOEventManager.EnemyTouchShock && SemiFunc.RunIsLevel() && player.isLocal && (bool)(FI_isEnemy?.GetValue(__instance) ?? ((object)false)) && (!shockCooldowns.ContainsKey(player) || !(Time.time - shockCooldowns[player] < 1.5f))) { shockCooldowns[player] = Time.time; pendingShocks.Add(player); pendingEnemies[player] = __instance; REPOConomyPlugin.Logger.LogInfo((object)"[EnemyTouchShock] вљЎ Shock pending..."); } } public static void ProcessPendingShocks() { //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0103: 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_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) if (pendingShocks.Count == 0) { return; } foreach (PhysGrabber item in pendingShocks.ToList()) { if ((Object)(object)item == (Object)null || !item.grabbed) { pendingShocks.Remove(item); pendingEnemies.Remove(item); continue; } PhysGrabObject val = (pendingEnemies.ContainsKey(item) ? pendingEnemies[item] : null); item.ReleaseObject(-1, 0.5f); FI_toggleGrab?.SetValue(item, false); FI_grabDisableTimer?.SetValue(item, 1f); PlayerAvatar playerAvatar = item.playerAvatar; PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(playerAvatar); Vector3 val2; if ((Object)(object)playerAvatar != (Object)null && (Object)(object)playerTumble != (Object)null) { playerTumble.TumbleRequest(true, false); playerTumble.TumbleOverrideTime(1.5f); if ((Object)(object)val != (Object)null) { val2 = ((Component)playerAvatar).transform.position - ((Component)val).transform.position; Vector3 normalized = ((Vector3)(ref val2)).normalized; playerTumble.TumbleForce(normalized * 8f); } playerTumble.TumbleTorque(Random.insideUnitSphere * 5f); } if ((Object)(object)val != (Object)null) { object? obj = FI_enemyRigidbody?.GetValue(val); EnemyRigidbody val3 = (EnemyRigidbody)((obj is EnemyRigidbody) ? obj : null); if ((Object)(object)val3 != (Object)null && (Object)(object)val3.enemy != (Object)null && (bool)(FI_HasHealth?.GetValue(val3.enemy) ?? ((object)false))) { object? obj2 = FI_Health?.GetValue(val3.enemy); EnemyHealth val4 = (EnemyHealth)((obj2 is EnemyHealth) ? obj2 : null); if ((Object)(object)val4 != (Object)null && !(bool)(FI_dead?.GetValue(val4) ?? ((object)false))) { Vector3 val5; if (!((Object)(object)playerAvatar != (Object)null)) { val5 = Vector3.up; } else { val2 = ((Component)val).transform.position - ((Component)playerAvatar).transform.position; val5 = ((Vector3)(ref val2)).normalized; } Vector3 val6 = val5; val4.Hurt(15, val6); REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyTouchShock] вљЎ Enemy took {15} damage!"); } } } if ((Object)(object)playerAvatar != (Object)null) { PlayerHealth component = ((Component)playerAvatar).GetComponent(); if ((Object)(object)component != (Object)null) { component.Hurt(5, false, -1, false); } } if ((Object)(object)GameDirector.instance != (Object)null) { GameDirector.instance.CameraImpact.Shake(3f, 0.2f); GameDirector.instance.CameraShake.Shake(2f, 0.3f); } REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyTouchShock] вљЎ SHOCKED! Player stunned for {1.5f}s"); pendingShocks.Remove(item); pendingEnemies.Remove(item); } } public static void Reset() { shockCooldowns.Clear(); pendingShocks.Clear(); pendingEnemies.Clear(); REPOConomyPlugin.Logger.LogInfo((object)"[EnemyTouchShock] Reset"); } } [HarmonyPatch(typeof(PhysGrabber), "Update")] public static class Patch_EnemyTouchShock_Processor { [HarmonyPostfix] private static void Postfix(PhysGrabber __instance) { if (__instance.isLocal) { Patch_EnemyTouchShock.ProcessPendingShocks(); } } } internal static class Batch1MP { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static readonly FieldInfo FI_maxHealth = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); public static PlayerHealth GetNearestPlayerHealth(Vector3 pos) { //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null) { return null; } PlayerHealth result = null; float num = float.MaxValue; foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null)) { Vector3 val = ((Component)player).transform.position - pos; float sqrMagnitude = ((Vector3)(ref val)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; result = player.playerHealth; } } } return result; } public static float HealthRatio(PlayerHealth ph) { if ((Object)(object)ph == (Object)null) { return 1f; } int num = (int)FI_health.GetValue(ph); int num2 = (int)FI_maxHealth.GetValue(ph); if (num2 <= 0) { return 1f; } return Mathf.Clamp01((float)num / (float)num2); } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_WoundedFury { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.WoundedFury || !SemiFunc.RunIsLevel()) { return; } try { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if (!((Object)(object)nearestPlayerHealth == (Object)null)) { float num = Batch1MP.HealthRatio(nearestPlayerHealth); float num2 = 1f + (1f - num) * 1.5f; _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num2)); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[WoundedFury] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Executioner { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Prefix(EnemyHealth __instance, ref int _damage) { if (!REPOEventManager.Executioner || !SemiFunc.RunIsLevel()) { return; } try { if (__instance.health > 0 && (float)(int)FI_healthCurrent.GetValue(__instance) / (float)__instance.health <= 0.25f) { _damage = Mathf.Max(1, _damage * 2); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Executioner] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_LifestealStrikes { private static void Postfix(EnemyHealth __instance, ref int _damage) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.LifestealStrikes || !SemiFunc.RunIsLevel()) { return; } try { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if (!((Object)(object)nearestPlayerHealth == (Object)null)) { int num = Mathf.Clamp(_damage / 4, 1, 5); nearestPlayerHealth.HealOther(num, true); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LifestealStrikes] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_LastBreath { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static HashSet usedThisLevel = new HashSet(); public static void Reset() { usedThisLevel.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.LastBreath || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!usedThisLevel.Contains(instanceID)) { int num = (int)FI_health.GetValue(__instance); if (num > 0 && damage >= num) { damage = num - 1; usedThisLevel.Add(instanceID); REPOConomyPlugin.Logger.LogInfo((object)"[LastBreath] Lethal hit survived at 1 HP"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LastBreath] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Thorns { private const int THORNS_DAMAGE = 5; private const float THORNS_RANGE_SQR = 100f; private static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static readonly FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static readonly FieldInfo FI_Enemy_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static void Postfix(PlayerHealth __instance, bool hurtByHeal = false) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.Thorns || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.playerAvatarScript == (Object)null) { return; } PlayerHealth component = ((Component)instance.playerAvatarScript).GetComponent(); if ((Object)(object)__instance != (Object)(object)component) { return; } EnemyDirector instance2 = EnemyDirector.instance; if ((Object)(object)instance2 == (Object)null || instance2.enemiesSpawned == null) { return; } Vector3 position = ((Component)instance).transform.position; Enemy val = null; float num = float.MaxValue; Vector3 val3; foreach (EnemyParent item in instance2.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = FI_Enemy.GetValue(item); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)FI_Enemy_HasHealth.GetValue(val2)) { continue; } Transform centerTransform = val2.CenterTransform; if (!((Object)(object)centerTransform == (Object)null)) { val3 = centerTransform.position - position; float sqrMagnitude = ((Vector3)(ref val3)).sqrMagnitude; if (sqrMagnitude < num) { num = sqrMagnitude; val = val2; } } } if ((Object)(object)val != (Object)null && num <= 100f) { object? value2 = FI_Enemy_Health.GetValue(val); EnemyHealth val4 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val4 != (Object)null) { val3 = val.CenterTransform.position - position; Vector3 normalized = ((Vector3)(ref val3)).normalized; val4.Hurt(5, normalized); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Thorns] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_GlassEnemies { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.GlassEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, __instance.health / 2); FI_healthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[GlassEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_BountifulKills { private const int EXTRA_ORBS = 2; private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static readonly FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static readonly FieldInfo FI_Enemy_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static void Postfix(EnemyParent __instance) { //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Invalid comparison between Unknown and I4 //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (!REPOEventManager.BountifulKills || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { object? value = FI_Enemy.GetValue(__instance); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || !(bool)FI_Enemy_HasHealth.GetValue(val)) { return; } object? value2 = FI_Enemy_Health.GetValue(val); EnemyHealth val2 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val2 == (Object)null || (int)FI_healthCurrent.GetValue(val2) > 0) { return; } Transform val3 = (((Object)(object)val.CustomValuableSpawnTransform != (Object)null) ? val.CustomValuableSpawnTransform : val.CenterTransform); if ((Object)(object)val3 == (Object)null) { return; } GameObject val4 = AssetManager.instance.enemyValuableSmall; if ((int)__instance.difficulty == 1) { val4 = AssetManager.instance.enemyValuableMedium; } else if ((int)__instance.difficulty == 2) { val4 = AssetManager.instance.enemyValuableBig; } if ((Object)(object)val4 == (Object)null) { return; } for (int i = 0; i < 2; i++) { if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(val4, val3.position, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)val4).name, val3.position, Quaternion.identity, (byte)0, (object[])null); } } REPOConomyPlugin.Logger.LogInfo((object)$"[BountifulKills] Dropped {2} extra orbs ({((Object)val4).name})"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BountifulKills] " + ex.Message)); } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_ValueModifiers_Batch1 { private static readonly FieldInfo FI_DollarValueCurrent = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_dollarValueSet = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.TaxSeason && !REPOEventManager.RiskReward && !REPOEventManager.Tarnish)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_dollarValueSet.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_DollarValueCurrent.GetValue(__instance); float num2 = 1f; if (REPOEventManager.TaxSeason) { num2 *= 0.85f; } else if (REPOEventManager.RiskReward) { num2 *= 1.35f; } if (REPOEventManager.Tarnish) { num2 *= 1f - Mathf.Clamp(num / 150000f, 0f, 0.3f); } float num3 = Mathf.Round(num * num2); FI_DollarValueCurrent.SetValue(__instance, num3); REPOConomyPlugin.Logger.LogInfo((object)$"[ValueModifiers] {num:F0} -> {num3:F0} (x{num2:F3})"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ValueModifiers] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Bloodthirst { private const int MAX_STACKS = 10; private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static int kills = 0; private static HashSet countedDead = new HashSet(); public static void Reset() { kills = 0; countedDead.Clear(); } private static void Prefix(ref int _damage) { if (REPOEventManager.Bloodthirst && SemiFunc.RunIsLevel()) { int num = Mathf.Min(kills, 10); if (num > 0) { float num2 = 1f + 0.05f * (float)num; _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num2)); } } } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.Bloodthirst || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) <= 0) { int instanceID = ((Object)__instance).GetInstanceID(); if (!countedDead.Contains(instanceID)) { countedDead.Add(instanceID); kills++; REPOConomyPlugin.Logger.LogInfo((object)$"[Bloodthirst] Kill #{kills} -> +{Mathf.Min(kills, 10) * 5}% enemy damage"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Bloodthirst] " + ex.Message)); } } } internal static class Batch2Util { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static readonly FieldInfo FI_maxHealth = AccessTools.Field(typeof(PlayerHealth), "maxHealth"); private static readonly FieldInfo FI_enemyHealthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); public static int GetHealth(PlayerHealth ph) { return (int)FI_health.GetValue(ph); } public static int GetMaxHealth(PlayerHealth ph) { return (int)FI_maxHealth.GetValue(ph); } public static void HurtOtherCapped(PlayerHealth ph, int amount) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)ph == (Object)null) && amount > 0) { int num = Mathf.Min(amount, GetHealth(ph) - 1); if (num > 0) { ph.HurtOther(num, Vector3.zero, false, -1, false); } } } public static float PlayerRatio(PlayerHealth ph) { int maxHealth = GetMaxHealth(ph); if (maxHealth <= 0) { return 1f; } return Mathf.Clamp01((float)GetHealth(ph) / (float)maxHealth); } public static float EnemyRatio(EnemyHealth eh) { if (eh.health <= 0) { return 0f; } return (float)(int)FI_enemyHealthCurrent.GetValue(eh) / (float)eh.health; } public static bool LastStandActive() { GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null || instance.PlayerList.Count == 0) { return false; } if (instance.PlayerList.Count >= 2) { int num = 0; foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null) && GetHealth(player.playerHealth) > 0) { num++; } } return num == 1; } foreach (PlayerAvatar player2 in instance.PlayerList) { if (!((Object)(object)player2 == (Object)null) && !((Object)(object)player2.playerHealth == (Object)null)) { return GetHealth(player2.playerHealth) > 0 && PlayerRatio(player2.playerHealth) < 0.5f; } } return false; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_IronWill { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.IronWill || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.35f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_GuardianShield { private const float COOLDOWN = 8f; private static Dictionary nextReady = new Dictionary(); public static void Reset() { nextReady.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.GuardianShield || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); float time = Time.time; if (!nextReady.TryGetValue(instanceID, out var value)) { value = 0f; } if (time >= value) { damage = 0; nextReady[instanceID] = time + 8f; REPOConomyPlugin.Logger.LogInfo((object)"[GuardianShield] Hit blocked"); } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_DamageWard { private const int FREE_HITS = 3; private static Dictionary used = new Dictionary(); public static void Reset() { used.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.DamageWard || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); used.TryGetValue(instanceID, out var value); if (value < 3) { used[instanceID] = value + 1; damage = 0; REPOConomyPlugin.Logger.LogInfo((object)$"[DamageWard] Free hit {value + 1}/{3}"); } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_TitansVigor { private const float COOLDOWN = 20f; private static Dictionary nextReady = new Dictionary(); public static void Reset() { nextReady.Clear(); } private static void Postfix(PlayerHealth __instance, bool hurtByHeal = false) { if (!REPOEventManager.TitansVigor || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { int health = Batch2Util.GetHealth(__instance); int maxHealth = Batch2Util.GetMaxHealth(__instance); if (health <= 0 || maxHealth <= 0 || (float)health / (float)maxHealth > 0.2f) { return; } int num = maxHealth / 2; if (health < num) { int instanceID = ((Object)__instance).GetInstanceID(); float time = Time.time; if (!nextReady.TryGetValue(instanceID, out var value)) { value = 0f; } if (!(time < value)) { nextReady[instanceID] = time + 20f; __instance.HealOther(num - health, true); REPOConomyPlugin.Logger.LogInfo((object)"[TitansVigor] Emergency heal to 50%"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TitansVigor] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_RegenerationAura { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.RegenerationAura || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; try { PlayerHealth val = (((Object)(object)__instance.playerAvatarScript != (Object)null) ? ((Component)__instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val != (Object)null) { val.Heal(1, false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RegenerationAura] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BloodthirstyHealer { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.BloodthirstyHealer || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!counted.Contains(instanceID)) { counted.Add(instanceID); PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HealOther(20, true); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BloodthirstyHealer] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_BerserkersResolve_Defense { private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.BerserkersResolve || !SemiFunc.RunIsLevel() || hurtByHeal) && Batch2Util.PlayerRatio(__instance) <= 0.3f) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.5f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BerserkersResolve_Offense { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.BerserkersResolve && SemiFunc.RunIsLevel()) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null && Batch1MP.HealthRatio(nearestPlayerHealth) <= 0.3f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ExecutionersEdge { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.ExecutionersEdge && SemiFunc.RunIsLevel() && Batch2Util.EnemyRatio(__instance) <= 0.4f) { _damage = Mathf.Max(1, _damage * 3); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_LastStand_Defense { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.LastStand || !SemiFunc.RunIsLevel() || hurtByHeal) && Batch2Util.LastStandActive()) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.5f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_LastStand_Offense { private static void Prefix(ref int _damage) { if (REPOEventManager.LastStand && SemiFunc.RunIsLevel() && Batch2Util.LastStandActive()) { _damage = Mathf.Max(1, _damage * 2); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_SecondWind { private const int CHARGES = 2; private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static Dictionary used = new Dictionary(); public static void Reset() { used.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!REPOEventManager.SecondWind || !SemiFunc.RunIsLevel() || hurtByHeal) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); used.TryGetValue(instanceID, out var value); if (value < 2) { int num = (int)FI_health.GetValue(__instance); if (num > 0 && damage >= num) { damage = num - 1; used[instanceID] = value + 1; REPOConomyPlugin.Logger.LogInfo((object)$"[SecondWind] Survived lethal hit ({value + 1}/{2})"); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SecondWind] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_FirstStrike { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.FirstStrike && SemiFunc.RunIsLevel() && Batch2Util.EnemyRatio(__instance) >= 0.9f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_AdrenalineSurge_Monitor { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); public static Dictionary lastHit = new Dictionary(); private static Dictionary prevHealth = new Dictionary(); public static void Reset() { lastHit.Clear(); prevHealth.Clear(); } private static void Postfix() { if (!REPOEventManager.AdrenalineSurge || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null) { return; } foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null)) { int instanceID = ((Object)player.playerHealth).GetInstanceID(); int num = (int)FI_health.GetValue(player.playerHealth); if (prevHealth.TryGetValue(instanceID, out var value) && num < value) { lastHit[instanceID] = Time.time; } prevHealth[instanceID] = num; } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_AdrenalineSurge_Damage { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.AdrenalineSurge && SemiFunc.RunIsLevel()) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if (!((Object)(object)nearestPlayerHealth == (Object)null) && Patch_AdrenalineSurge_Monitor.lastHit.TryGetValue(((Object)nearestPlayerHealth).GetInstanceID(), out var value) && Time.time - value <= 4f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.3f)); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Brawler { private const float RANGE_SQR = 16f; private static void Prefix(EnemyHealth __instance, ref int _damage) { //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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.Brawler || !SemiFunc.RunIsLevel()) { return; } GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null) { return; } Vector3 position = ((Component)__instance).transform.position; foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null)) { Vector3 val = ((Component)player).transform.position - position; if (((Vector3)(ref val)).sqrMagnitude <= 16f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.4f)); break; } } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Toughened { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.Toughened || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.75f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Heal")] public static class Patch_Frailty { private static bool Prefix() { if (REPOEventManager.Frailty) { return !SemiFunc.RunIsLevel(); } return true; } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Feeble { private static void Prefix(ref int _damage) { if (REPOEventManager.Feeble && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.4f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_GlassJaw { private static Dictionary hits = new Dictionary(); public static void Reset() { hits.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.GlassJaw || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); hits.TryGetValue(instanceID, out var value); value++; hits[instanceID] = value; if (value % 4 == 0) { damage = Mathf.Max(1, damage * 2); } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_PainAmplifier { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.PainAmplifier || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0 && damage < 10) { damage = 10; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_AdrenalineCrash { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.AdrenalineCrash || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!counted.Contains(instanceID)) { counted.Add(instanceID); PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HurtOther(5, Vector3.zero, false, -1, false); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[AdrenalineCrash] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_Exhausted { private static void Postfix(PlayerController __instance) { if (REPOEventManager.Exhausted && SemiFunc.RunIsLevel() && !((Object)(object)__instance != (Object)(object)PlayerController.instance)) { __instance.EnergyCurrent = 0f; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_RecoilStrikes { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance) { //IL_002b: 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) if (!REPOEventManager.RecoilStrikes || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HurtOther(2, Vector3.zero, false, -1, false); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RecoilStrikes] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Vulnerable { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.Vulnerable || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 2.5f)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_SoulDrain { private const float RANGE_SQR = 25f; private static float timer; private static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static readonly FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); private static readonly FieldInfo FI_Enemy_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); private static readonly FieldInfo FI_enemyHealthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static readonly FieldInfo FI_playerHealth = AccessTools.Field(typeof(PlayerHealth), "health"); public static void Reset() { timer = 0f; } private static void Postfix() { //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.SoulDrain || !SemiFunc.RunIsLevel()) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; try { PlayerController instance = PlayerController.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.playerAvatarScript == (Object)null) { return; } PlayerHealth component = ((Component)instance.playerAvatarScript).GetComponent(); if ((Object)(object)component == (Object)null) { return; } int num = (int)FI_playerHealth.GetValue(component); if (num <= 1) { return; } EnemyDirector instance2 = EnemyDirector.instance; if ((Object)(object)instance2 == (Object)null || instance2.enemiesSpawned == null) { return; } Vector3 position = ((Component)instance).transform.position; foreach (EnemyParent item in instance2.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = FI_Enemy.GetValue(item); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || (Object)(object)val.CenterTransform == (Object)null || !(bool)FI_Enemy_HasHealth.GetValue(val)) { continue; } object? value2 = FI_Enemy_Health.GetValue(val); EnemyHealth val2 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if (!((Object)(object)val2 == (Object)null) && (int)FI_enemyHealthCurrent.GetValue(val2) > 0) { Vector3 val3 = val.CenterTransform.position - position; if (((Vector3)(ref val3)).sqrMagnitude <= 25f) { FI_playerHealth.SetValue(component, num - 1); break; } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SoulDrain] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Crippled { private static void Prefix(ref int _damage) { if (REPOEventManager.Crippled && SemiFunc.RunIsLevel() && Random.value < 0.3f) { _damage = 0; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_CowardsCurse { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.CowardsCurse && SemiFunc.RunIsLevel() && Batch2Util.EnemyRatio(__instance) >= 0.9f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.75f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_FaintHeart { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.FaintHeart && SemiFunc.RunIsLevel()) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null && Batch1MP.HealthRatio(nearestPlayerHealth) >= 0.9f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.8f)); } } } } [HarmonyPatch(typeof(PlayerHealth), "Heal")] public static class Patch_SlowHealing { private static void Prefix(ref int healAmount) { if (REPOEventManager.SlowHealing && SemiFunc.RunIsLevel() && healAmount > 1) { healAmount = Mathf.Max(1, healAmount / 2); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_SluggishRecovery_Track { public static Dictionary lastHit = new Dictionary(); public static void Reset() { lastHit.Clear(); } private static void Postfix(PlayerHealth __instance, bool hurtByHeal = false) { if (!(!REPOEventManager.SluggishRecovery || !SemiFunc.RunIsLevel() || hurtByHeal)) { lastHit[((Object)__instance).GetInstanceID()] = Time.time; } } } [HarmonyPatch(typeof(PlayerHealth), "Heal")] public static class Patch_SluggishRecovery_Block { private static bool Prefix(PlayerHealth __instance) { if (!REPOEventManager.SluggishRecovery || !SemiFunc.RunIsLevel()) { return true; } if (Patch_SluggishRecovery_Track.lastHit.TryGetValue(((Object)__instance).GetInstanceID(), out var value) && Time.time - value < 3f) { return false; } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_AchillesHeel { private static HashSet used = new HashSet(); public static void Reset() { used.Clear(); } private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.AchillesHeel || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); if (!used.Contains(instanceID)) { used.Add(instanceID); damage = Mathf.Max(1, damage * 2); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_StageFright { private const float RANGE_SQR = 36f; private static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); private static void Prefix(EnemyHealth __instance, ref int _damage) { //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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.StageFright || !SemiFunc.RunIsLevel()) { return; } EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } Vector3 position = ((Component)__instance).transform.position; int num = 0; foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = FI_Enemy.GetValue(item); Enemy val = (Enemy)((value is Enemy) ? value : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.CenterTransform == (Object)null)) { Vector3 val2 = val.CenterTransform.position - position; if (((Vector3)(ref val2)).sqrMagnitude <= 36f) { num++; } } } int num2 = Mathf.Clamp(num - 1, 0, 4); if (num2 > 0) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * (1f - 0.1f * (float)num2))); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_ThinSkin { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.ThinSkin || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.3f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_RecklessSwings { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance, int _damage) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.RecklessSwings || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { int amount = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.2f)); Batch2Util.HurtOtherCapped(Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position), amount); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[RecklessSwings] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_SoftBlows { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.SoftBlows && SemiFunc.RunIsLevel() && Batch2Util.EnemyRatio(__instance) > 0.5f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.75f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Fumble { private static void Prefix(ref int _damage) { if (REPOEventManager.Fumble && SemiFunc.RunIsLevel() && Random.value < 0.15f) { _damage = 0; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_RecklessPower_Offense { private static void Prefix(ref int _damage) { if (REPOEventManager.RecklessPower && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.4f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_RecklessPower_Defense { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.RecklessPower || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.4f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_VampiricPact_Heal { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.VampiricPact || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!counted.Contains(instanceID)) { counted.Add(instanceID); PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HealOther(10, true); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[VampiricPact] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_VampiricPact_Defense { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.VampiricPact || !SemiFunc.RunIsLevel() || hurtByHeal)) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.2f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_AdrenalineCycle { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.AdrenalineCycle && SemiFunc.RunIsLevel()) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if (!((Object)(object)nearestPlayerHealth == (Object)null)) { float num = Batch1MP.HealthRatio(nearestPlayerHealth); float num2 = Mathf.Clamp(1.5f - num, 0.5f, 1.5f); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num2)); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Gambler { private static void Prefix(ref int _damage) { if (REPOEventManager.Gambler && SemiFunc.RunIsLevel()) { float num = ((Random.value < 0.5f) ? 0.5f : 2f); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_CoinFlipDefense { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.CoinFlipDefense || !SemiFunc.RunIsLevel() || hurtByHeal)) { float num = ((Random.value < 0.5f) ? 0.5f : 2f); damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * num)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BerserkersBargain_Offense { private static void Prefix(EnemyHealth __instance, ref int _damage) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) if (REPOEventManager.BerserkersBargain && SemiFunc.RunIsLevel()) { PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null && Batch1MP.HealthRatio(nearestPlayerHealth) < 0.5f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.6f)); } } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_BerserkersBargain_Defense { private static void Prefix(PlayerHealth __instance, ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.BerserkersBargain || !SemiFunc.RunIsLevel() || hurtByHeal) && Batch2Util.PlayerRatio(__instance) < 0.5f) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.3f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BloodPrice { private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Prefix(ref int _damage) { if (REPOEventManager.BloodPrice && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } private static void Postfix(EnemyHealth __instance) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.BloodPrice || !SemiFunc.RunIsLevel()) { return; } try { if ((int)FI_healthCurrent.GetValue(__instance) > 0) { Batch2Util.HurtOtherCapped(Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position), 1); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BloodPrice] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Equalizer { private static void Prefix(ref int _damage) { if (REPOEventManager.Equalizer && SemiFunc.RunIsLevel() && _damage > 0) { _damage = 8; } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_TugOfWar_Regen { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.TugOfWar || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } timer += Time.deltaTime; if (timer < 2f) { return; } timer -= 2f; try { PlayerHealth val = (((Object)(object)__instance.playerAvatarScript != (Object)null) ? ((Component)__instance.playerAvatarScript).GetComponent() : null); if ((Object)(object)val != (Object)null) { val.Heal(1, false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TugOfWar] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_TugOfWar_Vuln { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.TugOfWar || !SemiFunc.RunIsLevel() || hurtByHeal) && damage > 0) { damage += 5; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_Pendulum_Offense { private static void Prefix(ref int _damage) { if (REPOEventManager.Pendulum && SemiFunc.RunIsLevel() && (int)(Time.time / 10f) % 2 == 0) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_Pendulum_Defense { private static void Prefix(ref int damage, bool hurtByHeal = false) { if (!(!REPOEventManager.Pendulum || !SemiFunc.RunIsLevel() || hurtByHeal) && (int)(Time.time / 10f) % 2 != 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.5f)); } } } internal static class Batch7Util { public static readonly FieldInfo FI_Enemy = AccessTools.Field(typeof(EnemyParent), "Enemy"); public static readonly FieldInfo FI_Enemy_Health = AccessTools.Field(typeof(Enemy), "Health"); public static readonly FieldInfo FI_Enemy_HasHealth = AccessTools.Field(typeof(Enemy), "HasHealth"); public static readonly FieldInfo FI_enemyHealthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); public static readonly FieldInfo FI_playerHealth = AccessTools.Field(typeof(PlayerHealth), "health"); public static void SpawnEnemyOrbs(EnemyParent ep, int count, bool forceBig) { //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Invalid comparison between Unknown and I4 //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Invalid comparison between Unknown and I4 //IL_00d7: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) try { object? value = FI_Enemy.GetValue(ep); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null) { return; } Transform val2 = (((Object)(object)val.CustomValuableSpawnTransform != (Object)null) ? val.CustomValuableSpawnTransform : val.CenterTransform); if ((Object)(object)val2 == (Object)null || (Object)(object)AssetManager.instance == (Object)null) { return; } GameObject val3; if (forceBig) { val3 = AssetManager.instance.enemyValuableBig; } else { val3 = AssetManager.instance.enemyValuableSmall; if ((int)ep.difficulty == 1) { val3 = AssetManager.instance.enemyValuableMedium; } else if ((int)ep.difficulty == 2) { val3 = AssetManager.instance.enemyValuableBig; } } if ((Object)(object)val3 == (Object)null) { return; } for (int i = 0; i < count; i++) { if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(val3, val2.position, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)val3).name, val2.position, Quaternion.identity, (byte)0, (object[])null); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SpawnEnemyOrbs] " + ex.Message)); } } public static bool EnemyDead(EnemyParent ep) { object? value = FI_Enemy.GetValue(ep); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || !(bool)FI_Enemy_HasHealth.GetValue(val)) { return false; } object? value2 = FI_Enemy_Health.GetValue(val); EnemyHealth val2 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val2 != (Object)null) { return (int)FI_enemyHealthCurrent.GetValue(val2) <= 0; } return false; } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_JuggernautEnemies { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.JuggernautEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, __instance.health * 3); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[JuggernautEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ArmoredHides { private static void Prefix(ref int _damage) { if (REPOEventManager.ArmoredHides && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.5f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_BrutalEnemies { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.BrutalEnemies || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.75f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ThornedEnemies { private static void Postfix(EnemyHealth __instance) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ThornedEnemies || !SemiFunc.RunIsLevel()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { Batch2Util.HurtOtherCapped(Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position), 5); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ThornedEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_HardenedCores { private static Dictionary hits = new Dictionary(); public static void Reset() { hits.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.HardenedCores && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); hits.TryGetValue(instanceID, out var value); value++; hits[instanceID] = value; if (value <= 2) { _damage = 0; } } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_DeathThroes { private const float RANGE_SQR = 25f; private static void Postfix(EnemyParent __instance) { //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: 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_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.DeathThroes || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { object? value = Batch7Util.FI_Enemy.GetValue(__instance); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val)) { return; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val); EnemyHealth val2 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val2 == (Object)null || (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val2) > 0) { return; } Transform centerTransform = val.CenterTransform; if ((Object)(object)centerTransform == (Object)null) { return; } Vector3 position = centerTransform.position; GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null) { return; } foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null)) { Vector3 val3 = ((Component)player).transform.position - position; if (((Vector3)(ref val3)).sqrMagnitude <= 25f) { Batch2Util.HurtOtherCapped(player.playerHealth, 10); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[DeathThroes] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_PlagueBearers_Apply { public static float poisonUntil; public static void Reset() { poisonUntil = 0f; } private static void Postfix(int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.PlagueBearers || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { poisonUntil = Time.time + 4f; } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_PlagueBearers_Tick { private static float timer; private static void Postfix(PlayerController __instance) { if (!REPOEventManager.PlagueBearers || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance || Time.time > Patch_PlagueBearers_Apply.poisonUntil) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; try { PlayerHealth val = (((Object)(object)__instance.playerAvatarScript != (Object)null) ? ((Component)__instance.playerAvatarScript).GetComponent() : null); if (!((Object)(object)val == (Object)null)) { int num = (int)Batch7Util.FI_playerHealth.GetValue(val); if (num > 1) { Batch7Util.FI_playerHealth.SetValue(val, num - 1); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[PlagueBearers] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_PackTactics { private const float RANGE_SQR = 36f; private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.PackTactics || !SemiFunc.RunIsLevel() || hurtByHeal || enemyIndex < 0) { return; } PlayerController instance = PlayerController.instance; EnemyDirector instance2 = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance2 == (Object)null || instance2.enemiesSpawned == null) { return; } Vector3 position = ((Component)instance).transform.position; int num = 0; foreach (EnemyParent item in instance2.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(item); Enemy val = (Enemy)((value is Enemy) ? value : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.CenterTransform == (Object)null)) { Vector3 val2 = val.CenterTransform.position - position; if (((Vector3)(ref val2)).sqrMagnitude <= 36f) { num++; } } } int num2 = Mathf.Clamp(num, 0, 4); if (num2 > 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * (1f + 0.15f * (float)num2))); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_PhaseShield { private const float IFRAME = 0.5f; private static Dictionary lastHit = new Dictionary(); public static void Reset() { lastHit.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.PhaseShield && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); float time = Time.time; if (lastHit.TryGetValue(instanceID, out var value) && time - value < 0.5f) { _damage = 0; } else { lastHit[instanceID] = time; } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_VengefulHorde { private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.VengefulHorde || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (counted.Contains(instanceID)) { return; } counted.Add(instanceID); EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } foreach (EnemyParent item in instance.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(item); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val); EnemyHealth val2 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if (!((Object)(object)val2 == (Object)null)) { int num = (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val2); if (num > 0) { int num2 = Mathf.Min(val2.health, num + Mathf.Max(1, val2.health / 4)); Batch7Util.FI_enemyHealthCurrent.SetValue(val2, num2); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[VengefulHorde] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_PaperEnemies { private static void Prefix(ref int _damage) { if (REPOEventManager.PaperEnemies && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, _damage * 3); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_BrittleBonesEnemies { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.BrittleBonesEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, __instance.health / 4); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BrittleBones] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_FeebleFoes { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.FeebleFoes || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.25f)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_GoldenEnemies { private static void Postfix(EnemyParent __instance) { if (REPOEventManager.GoldenEnemies && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && Batch7Util.EnemyDead(__instance)) { Batch7Util.SpawnEnemyOrbs(__instance, 1, forceBig: true); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_SelfDestructEnemies { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { //IL_00e0: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.SelfDestructEnemies || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent[] array = instance.enemiesSpawned.ToArray(); foreach (EnemyParent val in array) { if ((Object)(object)val == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(val); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val2)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val2); EnemyHealth val3 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if (!((Object)(object)val3 == (Object)null) && (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val3) > 0) { try { val3.Hurt(1, Vector3.zero); } catch { } } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ExposedCores { private static Dictionary hits = new Dictionary(); public static void Reset() { hits.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.ExposedCores && SemiFunc.RunIsLevel()) { int instanceID = ((Object)__instance).GetInstanceID(); hits.TryGetValue(instanceID, out var value); float num = 1f + 0.25f * (float)Mathf.Min(value, 4); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num)); hits[instanceID] = value + 1; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BleedingEnemies_Apply { public static Dictionary bleedUntil = new Dictionary(); public static void Reset() { bleedUntil.Clear(); } private static void Postfix(EnemyHealth __instance) { if (REPOEventManager.BleedingEnemies && SemiFunc.RunIsLevel() && (int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { bleedUntil[((Object)__instance).GetInstanceID()] = Time.time + 3f; } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_BleedingEnemies_Tick { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { //IL_0105: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.BleedingEnemies || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent[] array = instance.enemiesSpawned.ToArray(); foreach (EnemyParent val in array) { if ((Object)(object)val == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(val); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val2)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val2); EnemyHealth val3 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val3 == (Object)null) { continue; } int instanceID = ((Object)val3).GetInstanceID(); if (Patch_BleedingEnemies_Apply.bleedUntil.TryGetValue(instanceID, out var value3) && !(Time.time > value3) && (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val3) > 0) { try { val3.Hurt(1, Vector3.zero); } catch { } } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_GlassJawEnemies { private static Dictionary hits = new Dictionary(); public static void Reset() { hits.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.GlassJawEnemies && SemiFunc.RunIsLevel()) { int instanceID = ((Object)__instance).GetInstanceID(); hits.TryGetValue(instanceID, out var value); value++; hits[instanceID] = value; if (value % 3 == 0) { _damage = Mathf.Max(1, _damage * 2); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ExposedWeakpoint { private static HashSet hit = new HashSet(); public static void Reset() { hit.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.ExposedWeakpoint && SemiFunc.RunIsLevel()) { int instanceID = ((Object)__instance).GetInstanceID(); if (!hit.Contains(instanceID)) { hit.Add(instanceID); _damage = Mathf.Max(1, _damage * 4); } } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_Lootsplosion { private static void Postfix(EnemyParent __instance) { if (REPOEventManager.Lootsplosion && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && Batch7Util.EnemyDead(__instance)) { Batch7Util.SpawnEnemyOrbs(__instance, 4, forceBig: false); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ToughSkin { private static void Prefix(ref int _damage) { if (REPOEventManager.ToughSkin && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.75f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_BulkyEnemies { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.BulkyEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, Mathf.RoundToInt((float)__instance.health * 1.5f)); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[BulkyEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_AggressiveEnemies { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.AggressiveEnemies || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.3f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ResilientCores { private static void Prefix(ref int _damage) { if (REPOEventManager.ResilientCores && SemiFunc.RunIsLevel() && _damage > 0) { _damage = Mathf.Max(1, _damage - 10); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_QuickRecovery_Track { public static Dictionary lastHit = new Dictionary(); public static void Reset() { lastHit.Clear(); } private static void Postfix(EnemyHealth __instance) { if (REPOEventManager.QuickRecovery && SemiFunc.RunIsLevel()) { lastHit[((Object)__instance).GetInstanceID()] = Time.time; } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_QuickRecovery_Tick { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { if (!REPOEventManager.QuickRecovery || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer -= 1f; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent[] array = instance.enemiesSpawned.ToArray(); foreach (EnemyParent val in array) { if ((Object)(object)val == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(val); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val2)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val2); EnemyHealth val3 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if ((Object)(object)val3 == (Object)null) { continue; } int num = (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val3); if (num > 0 && num < val3.health) { int instanceID = ((Object)val3).GetInstanceID(); if (!Patch_QuickRecovery_Track.lastHit.TryGetValue(instanceID, out var value3) || !(Time.time - value3 < 5f)) { int num2 = Mathf.Min(val3.health, num + Mathf.Max(1, val3.health / 10)); Batch7Util.FI_enemyHealthCurrent.SetValue(val3, num2); } } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_HardyEnemies { private static HashSet used = new HashSet(); public static void Reset() { used.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.HardyEnemies && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); if (!used.Contains(instanceID)) { used.Add(instanceID); _damage = 0; } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_SecondSkin { private static HashSet used = new HashSet(); public static void Reset() { used.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.SecondSkin && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); if (!used.Contains(instanceID)) { used.Add(instanceID); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 0.5f)); } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_VengefulSparks { private static void Postfix(EnemyHealth __instance) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.VengefulSparks || !SemiFunc.RunIsLevel()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0 && !(Random.value >= 0.25f)) { Batch2Util.HurtOtherCapped(Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position), 5); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[VengefulSparks] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_PackInstinct { private const float RANGE_SQR = 36f; private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.PackInstinct || !SemiFunc.RunIsLevel() || hurtByHeal || enemyIndex < 0) { return; } PlayerController instance = PlayerController.instance; EnemyDirector instance2 = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance2 == (Object)null || instance2.enemiesSpawned == null) { return; } Vector3 position = ((Component)instance).transform.position; int num = 0; foreach (EnemyParent item in instance2.enemiesSpawned) { if ((Object)(object)item == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(item); Enemy val = (Enemy)((value is Enemy) ? value : null); if (!((Object)(object)val == (Object)null) && !((Object)(object)val.CenterTransform == (Object)null)) { Vector3 val2 = val.CenterTransform.position - position; if (((Vector3)(ref val2)).sqrMagnitude <= 36f) { num++; } } } int num2 = Mathf.Clamp(num, 0, 3); if (num2 > 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * (1f + 0.1f * (float)num2))); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_EvasiveEnemies { private static void Prefix(ref int _damage) { if (REPOEventManager.EvasiveEnemies && SemiFunc.RunIsLevel() && Random.value < 0.2f) { _damage = 0; } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BerserkerEnemies_Taken { private static void Prefix(ref int _damage) { if (REPOEventManager.BerserkerEnemies && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.4f)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_BerserkerEnemies_Dealt { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.BerserkerEnemies || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.4f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_GlassCannonEnemies_HP { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.GlassCannonEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, __instance.health / 4); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[GlassCannonEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_GlassCannonEnemies_Dmg { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.GlassCannonEnemies || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 1.75f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ErraticEnemies { private static void Prefix(ref int _damage) { if (REPOEventManager.ErraticEnemies && SemiFunc.RunIsLevel()) { float num = ((Random.value < 0.5f) ? 0.5f : 2f); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * num)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_GamblingFoes { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.GamblingFoes || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { float num = ((Random.value < 0.5f) ? 0.5f : 2f); damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * num)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_VampiricVitality_Taken { private static void Prefix(ref int _damage) { if (REPOEventManager.VampiricFoes && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.3f)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_VampiricVitality_Regen { private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { if (!REPOEventManager.VampiricFoes || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 3f) { return; } timer -= 3f; EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent[] array = instance.enemiesSpawned.ToArray(); foreach (EnemyParent val in array) { if ((Object)(object)val == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(val); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val2)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val2); EnemyHealth val3 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if (!((Object)(object)val3 == (Object)null)) { int num = (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val3); if (num > 0 && num < val3.health) { Batch7Util.FI_enemyHealthCurrent.SetValue(val3, Mathf.Min(val3.health, num + Mathf.Max(1, val3.health / 10))); } } } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_AdaptiveEnemies { private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.AdaptiveEnemies || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (counted.Contains(instanceID)) { return; } counted.Add(instanceID); EnemyDirector instance = EnemyDirector.instance; if ((Object)(object)instance == (Object)null || instance.enemiesSpawned == null) { return; } EnemyParent[] array = instance.enemiesSpawned.ToArray(); foreach (EnemyParent val in array) { if ((Object)(object)val == (Object)null) { continue; } object? value = Batch7Util.FI_Enemy.GetValue(val); Enemy val2 = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val2 == (Object)null || !(bool)Batch7Util.FI_Enemy_HasHealth.GetValue(val2)) { continue; } object? value2 = Batch7Util.FI_Enemy_Health.GetValue(val2); EnemyHealth val3 = (EnemyHealth)((value2 is EnemyHealth) ? value2 : null); if (!((Object)(object)val3 == (Object)null)) { int num = (int)Batch7Util.FI_enemyHealthCurrent.GetValue(val3); if (num > 0) { Batch7Util.FI_enemyHealthCurrent.SetValue(val3, Mathf.Min(val3.health, num + Mathf.Max(1, val3.health * 15 / 100))); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[AdaptiveEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_AdaptiveEnemies_Loot { private static void Postfix(EnemyParent __instance) { if (REPOEventManager.AdaptiveEnemies && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && Batch7Util.EnemyDead(__instance)) { Batch7Util.SpawnEnemyOrbs(__instance, 1, forceBig: false); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_VolatileCores_Taken { private static void Prefix(ref int _damage) { if (REPOEventManager.VolatileCores && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_VolatileCores_Explode { private const float RANGE_SQR = 25f; private static void Postfix(EnemyParent __instance) { //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //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_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.VolatileCores || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || !Batch7Util.EnemyDead(__instance)) { return; } try { object? value = Batch7Util.FI_Enemy.GetValue(__instance); Enemy val = (Enemy)((value is Enemy) ? value : null); if ((Object)(object)val == (Object)null || (Object)(object)val.CenterTransform == (Object)null) { return; } Vector3 position = val.CenterTransform.position; GameDirector instance = GameDirector.instance; if ((Object)(object)instance == (Object)null || instance.PlayerList == null) { return; } foreach (PlayerAvatar player in instance.PlayerList) { if (!((Object)(object)player == (Object)null) && !((Object)(object)player.playerHealth == (Object)null)) { Vector3 val2 = ((Component)player).transform.position - position; if (((Vector3)(ref val2)).sqrMagnitude <= 25f) { Batch2Util.HurtOtherCapped(player.playerHealth, 10); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[VolatileCores] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_EnragedOnHit { private static Dictionary hits = new Dictionary(); public static void Reset() { hits.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.EnragedOnHit && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); hits.TryGetValue(instanceID, out var value); value++; hits[instanceID] = value; _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * ((value == 1) ? 0.5f : 1.5f))); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_ScavengerEnemies_HP { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.ScavengerEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, Mathf.RoundToInt((float)__instance.health * 1.5f)); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ScavengerEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_ScavengerEnemies_Loot { private static void Postfix(EnemyParent __instance) { if (REPOEventManager.ScavengerEnemies && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && Batch7Util.EnemyDead(__instance)) { Batch7Util.SpawnEnemyOrbs(__instance, 1, forceBig: false); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_ToughLove_Dmg { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.ToughLove || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, damage * 2); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_ToughLove_Heal { private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ToughLove || !SemiFunc.RunIsLevel()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!counted.Contains(instanceID)) { counted.Add(instanceID); PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HealOther(15, true); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ToughLove] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_SoftTargets { private static void Prefix(ref int _damage) { if (REPOEventManager.SoftTargets && SemiFunc.RunIsLevel()) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_FrailEnemies { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.FrailEnemies || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); __instance.health = Mathf.Max(1, Mathf.RoundToInt((float)__instance.health * 0.7f)); Batch7Util.FI_enemyHealthCurrent.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FrailEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_ClumsyEnemies { private static void Prefix(ref int damage, int enemyIndex, bool hurtByHeal = false) { if (!(!REPOEventManager.ClumsyEnemies || !SemiFunc.RunIsLevel() || hurtByHeal) && enemyIndex >= 0) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.6f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_SoftSpot { private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.SoftSpot && SemiFunc.RunIsLevel() && Batch2Util.EnemyRatio(__instance) < 0.5f) { _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.3f)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_StumblingEnemies { private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.StumblingEnemies || !SemiFunc.RunIsLevel()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0 && !(Random.value >= 0.1f)) { Enemy component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { component.Freeze(2f); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[StumblingEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyParent), "Despawn")] public static class Patch_GenerousKills { private static void Postfix(EnemyParent __instance) { if (REPOEventManager.GenerousKills && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && Batch7Util.EnemyDead(__instance) && Random.value < 0.5f) { Batch7Util.SpawnEnemyOrbs(__instance, 1, forceBig: false); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_SoulHarvest { private static HashSet counted = new HashSet(); public static void Reset() { counted.Clear(); } private static void Postfix(EnemyHealth __instance) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.SoulHarvest || !SemiFunc.RunIsLevel()) { return; } try { if ((int)Batch7Util.FI_enemyHealthCurrent.GetValue(__instance) > 0) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!counted.Contains(instanceID)) { counted.Add(instanceID); PlayerHealth nearestPlayerHealth = Batch1MP.GetNearestPlayerHealth(((Component)__instance).transform.position); if ((Object)(object)nearestPlayerHealth != (Object)null) { nearestPlayerHealth.HealOther(5, true); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SoulHarvest] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Hurt")] public static class Patch_BrittleShells { private static HashSet hit = new HashSet(); public static void Reset() { hit.Clear(); } private static void Prefix(EnemyHealth __instance, ref int _damage) { if (REPOEventManager.BrittleShells && SemiFunc.RunIsLevel() && _damage > 0) { int instanceID = ((Object)__instance).GetInstanceID(); if (!hit.Contains(instanceID)) { hit.Add(instanceID); _damage = Mathf.Max(1, Mathf.RoundToInt((float)_damage * 1.5f)); } } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_LootValue_Batch12 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.Bonanza && !REPOEventManager.PristineValuables && !REPOEventManager.LuckyStrike && !REPOEventManager.LuckyLottery && !REPOEventManager.ValueFloor && !REPOEventManager.HeavyweightBonus && !REPOEventManager.DiamondLoot)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_set.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_val.GetValue(__instance); if (REPOEventManager.Bonanza) { num *= 2f; } if (REPOEventManager.PristineValuables) { num *= 1.5f; } if (REPOEventManager.DiamondLoot) { num *= 1.25f; } if (REPOEventManager.HeavyweightBonus) { PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.rb != (Object)null && component.rb.mass >= 4f) { num *= 1.5f; } } if (REPOEventManager.LuckyStrike && Random.value < 0.2f) { num *= 3f; } if (REPOEventManager.LuckyLottery && Random.value < 0.15f) { num *= 5f; } if (REPOEventManager.ValueFloor) { num = Mathf.Max(num, 1500f); } FI_val.SetValue(__instance, Mathf.Round(num)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootValueB12] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_CompoundInterest { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { if (!REPOEventManager.CompoundInterest || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 5f) { return; } timer -= 5f; if ((Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if (!((Object)(object)valuable == (Object)null)) { float num = (float)FI_val.GetValue(valuable); if (!(num < 1f)) { FI_val.SetValue(valuable, Mathf.Round(num * 1.005f)); } } } } } [HarmonyPatch(typeof(ValuableObject), "Start")] public static class Patch_TreasureSense { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(ValuableObject __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.TreasureSense || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); GameObject val = new GameObject("TreasureSenseGlow"); val.transform.SetParent(((Component)__instance).transform, false); val.transform.localPosition = Vector3.zero; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.range = 7f; obj.intensity = 3f; obj.color = new Color(1f, 0.82f, 0.15f); obj.shadows = (LightShadows)0; PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null) { val.AddComponent().target = component; } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TreasureSense] " + ex.Message)); } } } public class TreasureSenseFollow : MonoBehaviour { public PhysGrabObject target; private void LateUpdate() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)target == (Object)null)) { ((Component)this).transform.position = target.midPoint; } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "DestroyObject")] public static class Patch_Salvage { private static bool IsEnemyOrb(string objName) { AssetManager instance = AssetManager.instance; if ((Object)(object)instance == (Object)null || string.IsNullOrEmpty(objName)) { return false; } if ((!((Object)(object)instance.enemyValuableSmall != (Object)null) || !objName.StartsWith(((Object)instance.enemyValuableSmall).name, StringComparison.OrdinalIgnoreCase)) && (!((Object)(object)instance.enemyValuableMedium != (Object)null) || !objName.StartsWith(((Object)instance.enemyValuableMedium).name, StringComparison.OrdinalIgnoreCase))) { if ((Object)(object)instance.enemyValuableBig != (Object)null) { return objName.StartsWith(((Object)instance.enemyValuableBig).name, StringComparison.OrdinalIgnoreCase); } return false; } return true; } private static void Postfix(PhysGrabObjectImpactDetector __instance) { //IL_007e: 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_0083: 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_0097: 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_00bf: 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_00a1: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.Salvage || !SemiFunc.RunIsLevel() || !__instance.isValuable || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } try { if (IsEnemyOrb(((Object)((Component)__instance).gameObject).name)) { return; } GameObject val = (((Object)(object)AssetManager.instance != (Object)null) ? AssetManager.instance.enemyValuableSmall : null); if (!((Object)(object)val == (Object)null)) { PhysGrabObject component = ((Component)__instance).GetComponent(); Vector3 val2 = (((Object)(object)component != (Object)null) ? component.midPoint : ((Component)__instance).transform.position) + Vector3.up * 0.4f; if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(val, val2, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)val).name, val2, Quaternion.identity, (byte)0, (object[])null); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Salvage] " + ex.Message)); } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_LootValue_Batch13 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.Bankruptcy && !REPOEventManager.DiminishingHoard && !REPOEventManager.WorthlessHeavies && !REPOEventManager.Pyrite && !REPOEventManager.FoolsAbundance)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_set.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_val.GetValue(__instance); if (REPOEventManager.Bankruptcy) { num *= 0.5f; } if (REPOEventManager.DiminishingHoard) { num *= 0.7f; } if (REPOEventManager.WorthlessHeavies) { PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.rb != (Object)null && component.rb.mass >= 4f) { num *= 0.5f; } } if (REPOEventManager.Pyrite && Random.value < 0.3f) { num *= 0.1f; } if (REPOEventManager.FoolsAbundance && Random.value < 0.4f) { num *= 0.25f; } FI_val.SetValue(__instance, Mathf.Round(num)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootValueB13] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LootDecay_Batch13 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float crumbleTimer; private static float leakyTimer; private static float spoilTimer; private static float volatileTimer; private static Dictionary heldTime = new Dictionary(); private static Dictionary spoilBase = new Dictionary(); public static void Reset() { crumbleTimer = (leakyTimer = (spoilTimer = (volatileTimer = 0f))); heldTime.Clear(); spoilBase.Clear(); } private static void Postfix() { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.CrumblingTreasures && !REPOEventManager.LeakyValue && !REPOEventManager.Spoilage && !REPOEventManager.VolatileWealth && !REPOEventManager.ValueDrainHeld) || !SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } float deltaTime = Time.deltaTime; bool flag = false; bool flag2 = false; bool flag3 = false; bool flag4 = false; if (REPOEventManager.CrumblingTreasures) { crumbleTimer += deltaTime; if (crumbleTimer >= 10f) { crumbleTimer -= 10f; flag = true; } } if (REPOEventManager.LeakyValue) { leakyTimer += deltaTime; if (leakyTimer >= 3f) { leakyTimer -= 3f; flag2 = true; } } if (REPOEventManager.Spoilage) { spoilTimer += deltaTime; if (spoilTimer >= 5f) { spoilTimer -= 5f; flag3 = true; } } if (REPOEventManager.VolatileWealth) { volatileTimer += deltaTime; if (volatileTimer >= 4f) { volatileTimer -= 4f; flag4 = true; } } bool flag5 = flag || flag2 || flag3 || flag4; if (!flag5 && !REPOEventManager.ValueDrainHeld) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null) { continue; } float num = (float)FI_val.GetValue(valuable); if (num < 1f) { continue; } PhysGrabObject component = ((Component)valuable).GetComponent(); if (REPOEventManager.ValueDrainHeld && (Object)(object)component != (Object)null) { int instanceID = ((Object)valuable).GetInstanceID(); if (!spoilBase.TryGetValue(instanceID, out var value)) { value = num; spoilBase[instanceID] = value; } if (component.playerGrabbing != null && component.playerGrabbing.Count > 0) { heldTime.TryGetValue(instanceID, out var value2); value2 += deltaTime; heldTime[instanceID] = value2; if (value2 >= 6f) { heldTime[instanceID] = value2 - 6f; float num2 = value * 0.5f; if (num > num2) { num = Mathf.Max(num2, num - value * 0.1f); FI_val.SetValue(valuable, Mathf.Round(num)); REPOConomyPlugin.Logger.LogInfo((object)$"[SpoilingTouch] '{((Object)valuable).name}' held -> -10% ({num})"); } } } else { heldTime[instanceID] = 0f; } } if (!flag5) { continue; } float num3 = num; if (flag) { num3 *= 0.99f; } if ((Object)(object)component != (Object)null) { if (flag2 && component.playerGrabbing != null && component.playerGrabbing.Count > 0) { num3 *= 0.975f; } if (flag3 && Patch_ScaleInCart_TrackCart.IsInCart(component)) { num3 *= 0.995f; } } if (flag4) { num3 *= Random.Range(0.88f, 1.06f); } if (Mathf.Abs(num3 - num) >= 1f) { FI_val.SetValue(valuable, Mathf.Round(num3)); } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_GlassHoard_InstantBreak { private static void Postfix(PhysGrabObjectImpactDetector __instance) { if (SemiFunc.RunIsLevel() && REPOEventManager.GlassHoard && __instance.isValuable && SemiFunc.IsMasterClientOrSingleplayer()) { __instance.DestroyObject(true); } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_LootValue_Batch14 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.Windfall && !REPOEventManager.LightweightPremium && !REPOEventManager.HiddenGems && !REPOEventManager.TreasureTrove && !REPOEventManager.OffGrid)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_set.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_val.GetValue(__instance); if (REPOEventManager.Windfall) { num *= 1.2f; } if (REPOEventManager.LightweightPremium) { PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.rb != (Object)null && component.rb.mass < 2f) { num *= 1.4f; } } if (REPOEventManager.HiddenGems && Random.value < 0.2f) { num *= 1.5f; } if (REPOEventManager.TreasureTrove && Random.value < 0.1f) { num *= 2.5f; } if (REPOEventManager.OffGrid) { num *= 1.1f; } FI_val.SetValue(__instance, Mathf.Round(num)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootValueB14] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LootGain_Batch14 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float cartTimer; private static float heldTimer; public static void Reset() { cartTimer = (heldTimer = 0f); } private static void Postfix() { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.GoldenCart && !REPOEventManager.SurgeDemand) || !SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } float deltaTime = Time.deltaTime; bool flag = false; bool flag2 = false; if (REPOEventManager.GoldenCart) { cartTimer += deltaTime; if (cartTimer >= 10f) { cartTimer -= 10f; flag = true; } } if (REPOEventManager.SurgeDemand) { heldTimer += deltaTime; if (heldTimer >= 5f) { heldTimer -= 5f; flag2 = true; } } if (!flag && !flag2) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null) { continue; } PhysGrabObject component = ((Component)valuable).GetComponent(); if ((Object)(object)component == (Object)null) { continue; } float num = (float)FI_val.GetValue(valuable); if (!(num < 1f)) { float num2 = num; if (flag && Patch_ScaleInCart_TrackCart.IsInCart(component)) { num2 *= 1.005f; } if (flag2 && component.playerGrabbing != null && component.playerGrabbing.Count > 0) { num2 *= 1.005f; } if (num2 > num) { FI_val.SetValue(valuable, Mathf.Round(num2)); } } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_PaddedValuables { private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost) { if (SemiFunc.RunIsLevel() && REPOEventManager.PaddedValuables && __instance.isValuable) { valueLost *= 0.5f; } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_SecondChance { private static HashSet saved = new HashSet(); public static void Reset() { saved.Clear(); } private static bool Prefix(PhysGrabObjectImpactDetector __instance) { if (!SemiFunc.RunIsLevel() || !REPOEventManager.SecondChance || !__instance.isValuable) { return true; } int instanceID = ((Object)__instance).GetInstanceID(); if (saved.Contains(instanceID)) { return true; } saved.Add(instanceID); return false; } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_ReinforcedBaseline { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); public static Dictionary MaxValue = new Dictionary(); public static void Reset() { MaxValue.Clear(); } private static void Postfix() { if (!REPOEventManager.ReinforcedEdges || !SemiFunc.RunIsLevel() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if (!((Object)(object)valuable == (Object)null)) { int instanceID = ((Object)valuable).GetInstanceID(); float num = (float)FI_val.GetValue(valuable); if (!MaxValue.TryGetValue(instanceID, out var value) || num > value) { MaxValue[instanceID] = num; } } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_ReinforcedEdges_Break { private static readonly FieldInfo FI_cur = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost) { if (!SemiFunc.RunIsLevel() || !REPOEventManager.ReinforcedEdges || !__instance.isValuable) { return; } ValuableObject component = ((Component)__instance).GetComponent(); if (!((Object)(object)component == (Object)null)) { float num = (float)FI_cur.GetValue(component); if (!Patch_ReinforcedBaseline.MaxValue.TryGetValue(((Object)component).GetInstanceID(), out var value) || value <= 0f) { value = ValuableEconomyPhysicsPatch.GetBreakValueBaseline(component); } float num2 = value * 0.25f; float num3 = Mathf.Max(0f, num - num2); if (valueLost > num3) { valueLost = num3; } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "DestroyObject")] public static class Patch_ReinforcedEdges_Destroy { private static bool Prefix(PhysGrabObjectImpactDetector __instance) { if (!SemiFunc.RunIsLevel() || !REPOEventManager.ReinforcedEdges || !__instance.isValuable) { return true; } return false; } } [HarmonyPatch(typeof(ValuableObject), "Start")] public static class Patch_AppraisersGlow { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(ValuableObject __instance) { //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0061: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.AppraisersGlow || !SemiFunc.RunIsLevel()) { return; } try { int instanceID = ((Object)__instance).GetInstanceID(); if (!processed.Contains(instanceID)) { processed.Add(instanceID); GameObject val = new GameObject("AppraiserGlow"); val.transform.SetParent(((Component)__instance).transform, false); val.transform.localPosition = Vector3.zero; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.shadows = (LightShadows)0; AppraiserGlow appraiserGlow = val.AddComponent(); appraiserGlow.target = ((Component)__instance).GetComponent(); appraiserGlow.valuable = __instance; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[AppraisersGlow] " + ex.Message)); } } } public class AppraiserGlow : MonoBehaviour { public PhysGrabObject target; public ValuableObject valuable; private Light light; private float timer; private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private void Awake() { light = ((Component)this).GetComponent(); } private void LateUpdate() { //IL_001a: 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_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target != (Object)null) { ((Component)this).transform.position = target.midPoint; } if (!((Object)(object)light == (Object)null) && !((Object)(object)valuable == (Object)null)) { timer += Time.deltaTime; if (!(timer < 0.5f)) { timer = 0f; float num = (float)FI_val.GetValue(valuable); float num2 = Mathf.Clamp01(Mathf.InverseLerp(Mathf.Log10(600f), Mathf.Log10(55000f), Mathf.Log10(Mathf.Max(num, 1f)))); light.intensity = Mathf.Lerp(0.4f, 6f, num2); light.range = Mathf.Lerp(4f, 11f, num2); light.color = Color.Lerp(new Color(0.85f, 0.95f, 1f), new Color(1f, 0.8f, 0.1f), num2); } } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_LootValue_Batch15 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.LightweightTax && !REPOEventManager.Misfortune && !REPOEventManager.WornEdges)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_set.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_val.GetValue(__instance); if (REPOEventManager.WornEdges) { num *= 0.9f; } if (REPOEventManager.LightweightTax) { PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.rb != (Object)null && component.rb.mass < 2f) { num *= 0.75f; } } if (REPOEventManager.Misfortune && Random.value < 0.15f) { num *= 0.6f; } FI_val.SetValue(__instance, Mathf.Round(num)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootValueB15] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LootDecay_Batch15 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float fadeTimer; private static HashSet feeApplied = new HashSet(); public static void Reset() { fadeTimer = 0f; feeApplied.Clear(); } private static void Postfix() { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.FadingFortune && !REPOEventManager.HandlingFee) || !SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } float deltaTime = Time.deltaTime; bool flag = false; if (REPOEventManager.FadingFortune) { fadeTimer += deltaTime; if (fadeTimer >= 15f) { fadeTimer -= 15f; flag = true; } } bool handlingFee = REPOEventManager.HandlingFee; if (!flag && !handlingFee) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null) { continue; } PhysGrabObject component = ((Component)valuable).GetComponent(); float num = (float)FI_val.GetValue(valuable); if (num < 1f) { continue; } float num2 = num; if (flag) { num2 *= 0.995f; } if (handlingFee && (Object)(object)component != (Object)null && component.playerGrabbing != null && component.playerGrabbing.Count > 0) { int instanceID = ((Object)valuable).GetInstanceID(); if (!feeApplied.Contains(instanceID)) { feeApplied.Add(instanceID); num2 *= 0.9f; } } if (Mathf.Abs(num2 - num) >= 1f) { FI_val.SetValue(valuable, Mathf.Round(num2)); } } } } public static class BruisedGoodsUtil { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); public static void Bruise(PhysGrabObjectImpactDetector det) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.BruisedGoods && !REPOEventManager.RiskPremium) || (Object)(object)det == (Object)null || !det.isValuable || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } PhysGrabObject component = ((Component)det).GetComponent(); if ((Object)(object)component != (Object)null && Patch_ScaleInCart_TrackCart.IsInCart(component)) { return; } ValuableObject component2 = ((Component)det).GetComponent(); if (!((Object)(object)component2 == (Object)null)) { float num = (float)FI_val.GetValue(component2); if (!(num < 1f)) { FI_val.SetValue(component2, Mathf.Round(num * 0.99f)); } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "ImpactLight")] public static class Patch_BruisedGoods_Light { private static void Postfix(PhysGrabObjectImpactDetector __instance) { BruisedGoodsUtil.Bruise(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "ImpactMedium")] public static class Patch_BruisedGoods_Medium { private static void Postfix(PhysGrabObjectImpactDetector __instance) { BruisedGoodsUtil.Bruise(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "ImpactHeavy")] public static class Patch_BruisedGoods_Heavy { private static void Postfix(PhysGrabObjectImpactDetector __instance) { BruisedGoodsUtil.Bruise(__instance); } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_BrittleHandling { private static void Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost) { if (SemiFunc.RunIsLevel() && REPOEventManager.BrittleHandling && __instance.isValuable) { valueLost *= 1.5f; } } } [HarmonyPatch(typeof(ValuableObject), "DollarValueSetLogic")] public static class Patch_LootValue_Batch16 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static readonly FieldInfo FI_set = AccessTools.Field(typeof(ValuableObject), "dollarValueSet"); private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } [HarmonyPriority(200)] private static void Postfix(ValuableObject __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.BoomOrBust && !REPOEventManager.JackpotGamble && !REPOEventManager.Counterweight && !REPOEventManager.RiskPremium && !REPOEventManager.SlowInflation && !REPOEventManager.LiquidationSale && !REPOEventManager.LuckyDip)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!REPOConomyPlugin.ProcessedByEconomy.Contains(instanceID) || processed.Contains(instanceID) || !(bool)FI_set.GetValue(__instance)) { return; } try { processed.Add(instanceID); float num = (float)FI_val.GetValue(__instance); if (REPOEventManager.RiskPremium) { num *= 1.5f; } if (REPOEventManager.LiquidationSale) { num *= 1.3f; } if (REPOEventManager.SlowInflation) { num *= 0.65f; } if (REPOEventManager.Counterweight) { PhysGrabObject component = ((Component)__instance).GetComponent(); if ((Object)(object)component != (Object)null && (Object)(object)component.rb != (Object)null) { if (component.rb.mass >= 4f) { num *= 1.4f; } else if (component.rb.mass < 2f) { num *= 0.6f; } } } if (REPOEventManager.BoomOrBust) { num *= ((Random.value < 0.5f) ? 1.5f : 0.5f); } if (REPOEventManager.JackpotGamble) { num *= ((Random.value < 0.2f) ? 3f : 0.75f); } if (REPOEventManager.LuckyDip) { float value = Random.value; if (value < 0.15f) { num *= 4f; } else if (value > 0.85f) { num *= 0.1f; } } FI_val.SetValue(__instance, Mathf.Round(num)); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootValueB16] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LootTrade_Batch16 { private static readonly FieldInfo FI_val = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static float inflTimer; private static float liqTimer; public static void Reset() { inflTimer = (liqTimer = 0f); } private static void Postfix() { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.SlowInflation && !REPOEventManager.LiquidationSale) || !SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } float deltaTime = Time.deltaTime; bool flag = false; bool flag2 = false; if (REPOEventManager.SlowInflation) { inflTimer += deltaTime; if (inflTimer >= 10f) { inflTimer -= 10f; flag = true; } } if (REPOEventManager.LiquidationSale) { liqTimer += deltaTime; if (liqTimer >= 10f) { liqTimer -= 10f; flag2 = true; } } if (!flag && !flag2) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null) { continue; } float num = (float)FI_val.GetValue(valuable); if (!(num < 1f)) { float num2 = num; if (flag) { num2 *= 1.01f; } if (flag2) { num2 *= 0.995f; } if (Mathf.Abs(num2 - num) >= 1f) { FI_val.SetValue(valuable, Mathf.Round(num2)); } } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_HeadsOrTails { private static Dictionary coin = new Dictionary(); public static void Reset() { coin.Clear(); } private static bool Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost) { if (!SemiFunc.RunIsLevel() || !REPOEventManager.HeadsOrTails || !__instance.isValuable) { return true; } int instanceID = ((Object)__instance).GetInstanceID(); if (!coin.TryGetValue(instanceID, out var value)) { value = Random.value < 0.5f; coin[instanceID] = value; } if (value) { return false; } valueLost *= 2f; return true; } } [HarmonyPatch(typeof(ExtractionPoint), "Update")] public static class Patch_EnvExtraction_Batch17 { private static readonly FieldInfo FI_stateTimer = AccessTools.Field(typeof(ExtractionPoint), "stateTimer"); private static readonly FieldInfo FI_rdHaulGoal = AccessTools.Field(typeof(RoundDirector), "haulGoal"); private static bool globalQuotaDone; public static void Reset() { globalQuotaDone = false; } private static void Postfix(ExtractionPoint __instance) { if (!SemiFunc.RunIsLevel()) { return; } float num = 1f; if (REPOEventManager.LightQuota) { num *= 0.65f; } if (REPOEventManager.HeavyQuota) { num *= 1.35f; } if (REPOEventManager.ModestQuota) { num *= 1.15f; } if (REPOEventManager.LowStakes) { num *= 0.8f; } if (REPOEventManager.HighStakes) { num *= 1.2f; } if (REPOEventManager.ReducedQuota) { num *= 0.85f; } if (num != 1f && !globalQuotaDone && (Object)(object)RoundDirector.instance != (Object)null) { int num2 = (int)FI_rdHaulGoal.GetValue(RoundDirector.instance); if (num2 > 0) { globalQuotaDone = true; FI_rdHaulGoal.SetValue(RoundDirector.instance, Mathf.Max(1, Mathf.RoundToInt((float)num2 * num))); } } if (REPOEventManager.GenerousExtraction) { float num3 = (float)FI_stateTimer.GetValue(__instance); if (num3 > 0f) { FI_stateTimer.SetValue(__instance, num3 + Time.deltaTime * 0.5f); } } else if (REPOEventManager.RoomyExtractions) { float num4 = (float)FI_stateTimer.GetValue(__instance); if (num4 > 0f) { FI_stateTimer.SetValue(__instance, num4 + Time.deltaTime * 0.25f); } } } } internal static class RichPoorShared { public static HashSet done = new HashSet(); public static void Reset() { done.Clear(); } public static bool Active() { if (!REPOEventManager.RichFacility && !REPOEventManager.PoorFacility && !REPOEventManager.TightBudget && !REPOEventManager.LowStakes && !REPOEventManager.HighStakes) { return REPOEventManager.FairBonus; } return true; } public static float PayMul() { float num = 1f; if (REPOEventManager.RichFacility) { num *= 1.5f; } if (REPOEventManager.PoorFacility) { num *= 0.7f; } if (REPOEventManager.TightBudget) { num *= 0.85f; } if (REPOEventManager.LowStakes) { num *= 0.8f; } if (REPOEventManager.HighStakes) { num *= 1.2f; } if (REPOEventManager.FairBonus) { num *= 1.15f; } return num; } } [HarmonyPatch(typeof(ExtractionPoint), "StateTaxReturn")] public static class Patch_RichFacility_BonusTax { private static readonly FieldInfo FI_stateStart = AccessTools.Field(typeof(ExtractionPoint), "stateStart"); private static readonly FieldInfo FI_isShop = AccessTools.Field(typeof(ExtractionPoint), "isShop"); private static readonly FieldInfo FI_extractionHaul = AccessTools.Field(typeof(ExtractionPoint), "extractionHaul"); private static void Prefix(ExtractionPoint __instance) { if (!RichPoorShared.Active() || !SemiFunc.RunIsLevel() || !(bool)FI_stateStart.GetValue(__instance) || (bool)FI_isShop.GetValue(__instance)) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (!RichPoorShared.done.Contains(instanceID)) { int num = (int)FI_extractionHaul.GetValue(__instance); if (num > 0) { RichPoorShared.done.Add(instanceID); float num2 = RichPoorShared.PayMul(); int num3 = Mathf.Max(0, Mathf.RoundToInt((float)num * num2)); FI_extractionHaul.SetValue(__instance, num3); REPOConomyPlugin.Logger.LogInfo((object)$"[RichPoor] (tax) extractionHaul {num} -> {num3} (x{num2:F2})"); } } } } [HarmonyPatch(typeof(ExtractionPoint), "StateComplete")] public static class Patch_RichFacility_Bonus { private static readonly FieldInfo FI_stateStart = AccessTools.Field(typeof(ExtractionPoint), "stateStart"); private static readonly FieldInfo FI_isShop = AccessTools.Field(typeof(ExtractionPoint), "isShop"); private static readonly FieldInfo FI_taxReturn = AccessTools.Field(typeof(ExtractionPoint), "taxReturn"); private static readonly FieldInfo FI_extractionHaul = AccessTools.Field(typeof(ExtractionPoint), "extractionHaul"); private static HashSet payFrame = new HashSet(); public static void Reset() { payFrame.Clear(); RichPoorShared.Reset(); } private static void Prefix(ExtractionPoint __instance) { int instanceID = ((Object)__instance).GetInstanceID(); payFrame.Remove(instanceID); if (RichPoorShared.Active() && SemiFunc.RunIsLevel() && (bool)FI_stateStart.GetValue(__instance) && !(bool)FI_isShop.GetValue(__instance) && !(bool)FI_taxReturn.GetValue(__instance)) { payFrame.Add(instanceID); } } private static void Postfix(ExtractionPoint __instance) { int instanceID = ((Object)__instance).GetInstanceID(); if (!payFrame.Contains(instanceID)) { return; } payFrame.Remove(instanceID); if (RichPoorShared.Active() && !RichPoorShared.done.Contains(instanceID)) { int num = (int)FI_extractionHaul.GetValue(__instance); if (num > 0) { RichPoorShared.done.Add(instanceID); int num2 = SemiFunc.StatGetRunCurrency(); int num3 = Mathf.RoundToInt((float)num * (RichPoorShared.PayMul() - 1f)); SemiFunc.StatSetRunCurrency(Mathf.Max(0, num2 + num3)); REPOConomyPlugin.Logger.LogInfo((object)string.Format("[RichPoor] {0}{1}K (haul {2}K)", (num3 >= 0) ? "+" : "", num3, num)); } } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_ScatteredRiches { private static bool done; public static void Reset() { done = false; } private static void Postfix() { //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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ScatteredRiches || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || done) { return; } ValuableVolume[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { return; } done = true; try { AssetManager instance = AssetManager.instance; if ((Object)(object)instance == (Object)null) { return; } int num = Mathf.Min(Random.Range(3, 10), array.Length); for (int i = 0; i < num; i++) { ValuableVolume val = array[Random.Range(0, array.Length)]; if ((Object)(object)val == (Object)null) { continue; } float value = Random.value; GameObject val2 = ((value < 0.6f) ? instance.enemyValuableSmall : ((value < 0.9f) ? instance.enemyValuableMedium : instance.enemyValuableBig)); if ((Object)(object)val2 == (Object)null) { val2 = instance.enemyValuableSmall; } if (!((Object)(object)val2 == (Object)null)) { Vector3 val3 = ((Component)val).transform.position + Vector3.up * 0.3f; if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(val2, val3, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)val2).name, val3, Quaternion.identity, (byte)0, (object[])null); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ScatteredRiches] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_FleetingEnemies { private static readonly FieldInfo FI = AccessTools.Field(typeof(EnemyDirector), "despawnedTimeMultiplier"); private static void Postfix(EnemyDirector __instance) { if (!SemiFunc.RunIsLevel() || (!REPOEventManager.FleetingEnemies && !REPOEventManager.RelentlessEnemies)) { return; } try { float num = (float)FI.GetValue(__instance); if (REPOEventManager.FleetingEnemies) { num *= 2.5f; } if (REPOEventManager.RelentlessEnemies) { num *= 0.3f; } FI.SetValue(__instance, num); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Fleeting/Relentless] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_LunarFloat_Player { private static void Postfix(PlayerController __instance) { if (REPOEventManager.LunarFacility && SemiFunc.RunIsLevel() && !((Object)(object)__instance != (Object)(object)PlayerController.instance)) { __instance.AntiGravity(0.1f); } } } [HarmonyPatch(typeof(PhysGrabObject), "Update")] public static class Patch_LunarFloat_Objects { private static void Postfix(PhysGrabObject __instance) { if (REPOEventManager.LunarFacility && SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer()) { __instance.OverrideZeroGravity(0.1f); __instance.OverrideDrag(1f, 0.1f); __instance.OverrideAngularDrag(10f, 0.1f); } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_SparseEnemies { private static readonly FieldInfo FI_total = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); private static readonly FieldInfo FI_list = AccessTools.Field(typeof(EnemyDirector), "enemyList"); private static void Postfix(EnemyDirector __instance) { if (!REPOEventManager.SparseEnemies || !SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } try { int num = (int)FI_total.GetValue(__instance); int num2 = Mathf.Max(1, num / 2); FI_total.SetValue(__instance, num2); if (FI_list.GetValue(__instance) is IList list) { while (list.Count > num2) { list.RemoveAt(list.Count - 1); } } REPOConomyPlugin.Logger.LogInfo((object)$"[SparseEnemies] Enemies {num} -> {num2}"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SparseEnemies] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "SetInvestigate")] public static class Patch_QuietFacility { private static void Prefix(ref float radius, bool pathfindOnly) { if (SemiFunc.RunIsLevel() && !pathfindOnly && !(radius >= float.MaxValue)) { if (REPOEventManager.QuietFacility) { radius *= 0.4f; } else if (REPOEventManager.EchoingHalls) { radius *= 2.5f; } else if (REPOEventManager.CreakyFloors) { radius *= 1.5f; } else if (REPOEventManager.MuffledHalls) { radius *= 0.7f; } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_CrystalAir { private static bool camCap; private static Color origBg; private static float origFar; private static Camera capCam; public static void Reset() { //IL_0019: Unknown result type (might be due to invalid IL or missing references) if (camCap && (Object)(object)capCam != (Object)null) { capCam.backgroundColor = origBg; capCam.farClipPlane = origFar; } camCap = false; capCam = null; } private static void Postfix(PlayerController __instance) { //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.CrystalAir || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } RenderSettings.fog = false; Camera main = Camera.main; if ((Object)(object)main != (Object)null) { if (!camCap) { origBg = main.backgroundColor; origFar = main.farClipPlane; capCam = main; camCap = true; } main.farClipPlane = 50f; main.backgroundColor = new Color(0.42f, 0.47f, 0.55f); } } } [HarmonyPatch(typeof(ExtractionPoint), "Update")] public static class Patch_ExtractionBeacons { private static HashSet processed = new HashSet(); public static void Reset() { processed.Clear(); } private static void Postfix(ExtractionPoint __instance) { //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.ExtractionBeacons || !SemiFunc.RunIsLevel()) { return; } int instanceID = ((Object)__instance).GetInstanceID(); if (processed.Contains(instanceID)) { return; } processed.Add(instanceID); try { GameObject val = new GameObject("ExtractionBeacon"); val.transform.SetParent(((Component)__instance).transform, false); val.transform.localPosition = Vector3.up * 1.5f; Light obj = val.AddComponent(); obj.type = (LightType)2; obj.range = 18f; obj.intensity = 5f; obj.color = new Color(0.3f, 1f, 0.5f); obj.shadows = (LightShadows)0; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ExtractionBeacons] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_FlickeringPower { private static Dictionary origIntensity = new Dictionary(); private static float origAmbient = -1f; private static float timer; private static bool dark; public static void Reset() { RestoreLights(); if (origAmbient >= 0f) { RenderSettings.ambientIntensity = origAmbient; } origAmbient = -1f; timer = 0f; dark = false; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.FlickeringPower || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } if (origAmbient < 0f) { origAmbient = RenderSettings.ambientIntensity; } timer -= Time.deltaTime; if (timer > 0f) { return; } dark = !dark; if (dark) { origIntensity.Clear(); Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null)) { origIntensity[val] = val.intensity; val.intensity = 0f; } } RenderSettings.ambientIntensity = 0f; timer = Random.Range(1f, 3f); } else { RestoreLights(); RenderSettings.ambientIntensity = origAmbient; timer = Random.Range(1f, 5f); } } private static void RestoreLights() { foreach (KeyValuePair item in origIntensity) { if ((Object)(object)item.Key != (Object)null) { item.Key.intensity = item.Value; } } origIntensity.Clear(); } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_PowerSurge { private static float timer; private static float nextGust = Random.Range(3f, 7f); public static void Reset() { timer = 0f; nextGust = Random.Range(3f, 7f); } private static void Postfix(PlayerController __instance) { //IL_0081: 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) if (REPOEventManager.PowerSurge && SemiFunc.RunIsLevel() && !((Object)(object)__instance != (Object)(object)PlayerController.instance)) { timer += Time.deltaTime; if (!(timer < nextGust)) { timer = 0f; nextGust = Random.Range(3f, 7f); float num = Random.Range(0f, (float)Math.PI * 2f); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Cos(num), 0f, Mathf.Sin(num)); __instance.ForceImpulse(val * Random.Range(11.25f, 18.75f)); } } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LootedFacility { private static bool done; public static void Reset() { done = false; } private static void Postfix() { if (!REPOEventManager.LootedFacility || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || done || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } List valuableList = ValuableDirector.instance.valuableList; if (valuableList.Count == 0) { return; } done = true; try { int num = Mathf.Min(Random.Range(3, 7), valuableList.Count - 1); for (int i = 0; i < num; i++) { ValuableObject val = valuableList[Random.Range(0, valuableList.Count)]; if (!((Object)(object)val == (Object)null)) { PhysGrabObjectImpactDetector component = ((Component)val).GetComponent(); if ((Object)(object)component != (Object)null) { component.DestroyObject(false); } } } REPOConomyPlugin.Logger.LogInfo((object)$"[LootedFacility] Removed {num} valuables"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LootedFacility] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_HazardousSparks { private static readonly FieldInfo FI_health = AccessTools.Field(typeof(PlayerHealth), "health"); private static float timer; private static float nextInterval = Random.Range(10f, 20f); public static void Reset() { timer = 0f; nextInterval = Random.Range(10f, 20f); } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.HazardousSparks || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } timer += Time.deltaTime; if (timer < nextInterval) { return; } timer = 0f; nextInterval = Random.Range(10f, 20f); PlayerHealth val = (((Object)(object)PlayerAvatar.instance != (Object)null) ? PlayerAvatar.instance.playerHealth : null); if ((Object)(object)val == (Object)null) { return; } try { int num = Random.Range(1, 10); if ((int)FI_health.GetValue(val) > num) { val.Hurt(num, false, -1, false); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HazardousSparks] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_PhantomQuota { private static readonly FieldInfo FI_rdHaulGoal = AccessTools.Field(typeof(RoundDirector), "haulGoal"); private static readonly FieldInfo FI_extractionCurrent = AccessTools.Field(typeof(RoundDirector), "extractionPointCurrent"); private static readonly MethodInfo MI_HaulGoalSet = AccessTools.Method(typeof(ExtractionPoint), "HaulGoalSet", (Type[])null, (Type[])null); private static float timer; public static void Reset() { timer = 0f; } private static void Postfix() { if (!REPOEventManager.PhantomQuota || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 30f) { return; } timer -= 30f; RoundDirector instance = RoundDirector.instance; if (!((Object)(object)instance == (Object)null)) { int num = (int)FI_rdHaulGoal.GetValue(instance); if (num > 0) { FI_rdHaulGoal.SetValue(instance, Mathf.RoundToInt((float)num * 1.025f)); } object? value = FI_extractionCurrent.GetValue(instance); ExtractionPoint val = (ExtractionPoint)((value is ExtractionPoint) ? value : null); if ((Object)(object)val != (Object)null && val.haulGoal > 0 && MI_HaulGoalSet != null) { MI_HaulGoalSet.Invoke(val, new object[1] { Mathf.RoundToInt((float)val.haulGoal * 1.025f) }); } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_DimFacility { private static Dictionary orig = new Dictionary(); private static float scanTimer; public static void Reset() { foreach (KeyValuePair item in orig) { if ((Object)(object)item.Key != (Object)null) { item.Key.intensity = item.Value; } } orig.Clear(); scanTimer = 0f; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.DimFacility || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } scanTimer -= Time.deltaTime; if (scanTimer > 0f) { return; } scanTimer = 1f; Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null) && !orig.ContainsKey(val)) { orig[val] = val.intensity; val.intensity *= 0.5f; } } } } [HarmonyPatch(typeof(CameraZoom), "Update")] public static class Patch_FrostCreep { private static float timer = Random.Range(6f, 12f); private static float activeTimer; private static float frost; private static bool active; public static void Reset() { timer = Random.Range(6f, 12f); activeTimer = 0f; active = false; frost = 0f; } private static void Postfix(CameraZoom __instance) { if (!REPOEventManager.FrostCreep || !SemiFunc.RunIsLevel()) { frost = 0f; return; } float deltaTime = Time.deltaTime; if (active) { frost = Mathf.MoveTowards(frost, 1f, deltaTime * 0.8f); activeTimer -= deltaTime; if (activeTimer <= 0f) { active = false; timer = Random.Range(6f, 12f); } } else { frost = Mathf.MoveTowards(frost, 0f, deltaTime * 0.8f); timer -= deltaTime; if (timer <= 0f) { active = true; activeTimer = Random.Range(2.5f, 4.5f); } } if (frost <= 0f || __instance.cams == null) { return; } float num = 1f - 0.3f * frost; foreach (Camera cam in __instance.cams) { if ((Object)(object)cam != (Object)null) { cam.fieldOfView *= num; } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_ColdFacility { private static float timer = Random.Range(6f, 17f); private static float gustTimer; private static bool gusting; private static float savedMove; private static float savedSprint; public static void Reset() { if (gusting && (Object)(object)PlayerController.instance != (Object)null) { PlayerController.instance.MoveSpeed = savedMove; PlayerController.instance.SprintSpeed = savedSprint; } timer = Random.Range(6f, 17f); gustTimer = 0f; gusting = false; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.ColdFacility || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } float deltaTime = Time.deltaTime; if (gusting) { gustTimer -= deltaTime; if (gustTimer <= 0f) { __instance.MoveSpeed = savedMove; __instance.SprintSpeed = savedSprint; gusting = false; timer = Random.Range(6f, 17f); } return; } timer -= deltaTime; if (timer <= 0f) { savedMove = __instance.MoveSpeed; savedSprint = __instance.SprintSpeed; float num = Random.Range(0.3f, 0.9f); __instance.MoveSpeed *= num; __instance.SprintSpeed *= num; gusting = true; gustTimer = Random.Range(2.5f, 5f); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_StiffDoors { private static readonly FieldInfo FI_openForce = AccessTools.Field(typeof(PhysGrabHinge), "openForceNeeded"); private static HashSet stiffened = new HashSet(); private static float scanTimer; public static void Reset() { stiffened.Clear(); scanTimer = 0f; } private static void Postfix() { if (!REPOEventManager.StiffDoors || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } scanTimer -= Time.deltaTime; if (scanTimer > 0f) { return; } scanTimer = 1f; try { int num = 0; PhysGrabHinge[] array = Object.FindObjectsOfType(); foreach (PhysGrabHinge val in array) { if ((Object)(object)val == (Object)null) { continue; } int instanceID = ((Object)val).GetInstanceID(); if (!stiffened.Contains(instanceID)) { stiffened.Add(instanceID); val.drag = 13f; if (FI_openForce != null) { FI_openForce.SetValue(val, 0.195f); } num++; } } if (num > 0) { REPOConomyPlugin.Logger.LogInfo((object)$"[StiffDoors] Stiffened {num} new doors (drag=13, openForce=0.195)"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[StiffDoors] " + ex.Message)); } } } [HarmonyPatch(typeof(ExtractionPoint), "Update")] public static class Patch_AgedTubes { private static readonly FieldInfo FI_eval = AccessTools.Field(typeof(ExtractionPoint), "tubeSlamDownEval"); private static Dictionary last = new Dictionary(); public static void Reset() { last.Clear(); } private static void Postfix(ExtractionPoint __instance) { bool agedTubes = REPOEventManager.AgedTubes; bool swiftTubes = REPOEventManager.SwiftTubes; if ((agedTubes || swiftTubes) && SemiFunc.RunIsLevel() && !(FI_eval == null) && SemiFunc.IsMasterClientOrSingleplayer()) { int instanceID = ((Object)__instance).GetInstanceID(); float num = (float)FI_eval.GetValue(__instance); if (last.TryGetValue(instanceID, out var value) && num > value) { float num2 = (agedTubes ? 0.2f : 3f); num = Mathf.Clamp01(value + (num - value) * num2); FI_eval.SetValue(__instance, num); } last[instanceID] = num; } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_ColoredLights { private static Dictionary orig = new Dictionary(); private static float scanTimer; private static Color tint = Color.white; private static bool tintChosen; public static void Reset() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) foreach (KeyValuePair item in orig) { if ((Object)(object)item.Key != (Object)null) { item.Key.color = item.Value; } } orig.Clear(); scanTimer = 0f; tintChosen = false; } private static void Postfix(PlayerController __instance) { //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_0095: 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) if (!REPOEventManager.ColoredLights || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } if (!tintChosen) { tint = Color.HSVToRGB(Random.value, 0.7f, 1f); tintChosen = true; } scanTimer -= Time.deltaTime; if (scanTimer > 0f) { return; } scanTimer = 1f; Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if (!((Object)(object)val == (Object)null) && !orig.ContainsKey(val)) { orig[val] = val.color; val.color = tint; } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_PulsingLights { private static Dictionary baseInt = new Dictionary(); private static float scanTimer; public static void Reset() { foreach (KeyValuePair item in baseInt) { if ((Object)(object)item.Key != (Object)null) { item.Key.intensity = item.Value; } } baseInt.Clear(); scanTimer = 0f; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.PulsingLights || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } scanTimer -= Time.deltaTime; if (scanTimer <= 0f) { scanTimer = 1f; Light[] array = Object.FindObjectsOfType(); foreach (Light val in array) { if ((Object)(object)val != (Object)null && !baseInt.ContainsKey(val)) { baseInt[val] = val.intensity; } } } float num = 0.65f + 0.35f * Mathf.Sin(Time.time * 1.5f); foreach (KeyValuePair item in baseInt) { if ((Object)(object)item.Key != (Object)null) { item.Key.intensity = item.Value * num; } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_FloatingDust { private static List emitters = new List(); private static HashSet processed = new HashSet(); private static float scanTimer; public static void Reset() { foreach (GameObject emitter in emitters) { if ((Object)(object)emitter != (Object)null) { Object.Destroy((Object)(object)emitter); } } emitters.Clear(); processed.Clear(); scanTimer = 0f; } private static void Postfix(PlayerController __instance) { //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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0161: Expected O, but got Unknown //IL_016a: 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_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d1: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Unknown result type (might be due to invalid IL or missing references) //IL_023c: Unknown result type (might be due to invalid IL or missing references) //IL_0248: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_0284: Unknown result type (might be due to invalid IL or missing references) //IL_028e: Expected O, but got Unknown if (!REPOEventManager.FloatingDust || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } scanTimer -= Time.deltaTime; if (scanTimer > 0f) { return; } scanTimer = 1.5f; try { Shader val = Shader.Find("Sprites/Default") ?? Shader.Find("Particles/Standard Unlit"); int num = 0; RoomVolume[] array = Object.FindObjectsOfType(); foreach (RoomVolume val2 in array) { if ((Object)(object)val2 == (Object)null) { continue; } int instanceID = ((Object)val2).GetInstanceID(); if (processed.Contains(instanceID)) { continue; } Collider[] componentsInChildren = ((Component)val2).GetComponentsInChildren(); if (componentsInChildren.Length != 0) { Bounds bounds = componentsInChildren[0].bounds; for (int j = 1; j < componentsInChildren.Length; j++) { ((Bounds)(ref bounds)).Encapsulate(componentsInChildren[j].bounds); } processed.Add(instanceID); Vector3 size = ((Bounds)(ref bounds)).size; size.x = Mathf.Min(size.x, 50f); size.y = Mathf.Min(size.y, 22f); size.z = Mathf.Min(size.z, 50f); size *= 0.85f; float num2 = size.x * size.z; GameObject val3 = new GameObject("REPOFloatingDust"); val3.transform.position = ((Bounds)(ref bounds)).center; ParticleSystem obj = val3.AddComponent(); MainModule main = obj.main; ((MainModule)(ref main)).startSize = MinMaxCurve.op_Implicit(0.035f); ((MainModule)(ref main)).startSpeed = MinMaxCurve.op_Implicit(0.07f); ((MainModule)(ref main)).startLifetime = MinMaxCurve.op_Implicit(9f); ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(new Color(0.82f, 0.79f, 0.7f, 0.28f)); ((MainModule)(ref main)).maxParticles = Mathf.Clamp(Mathf.RoundToInt(num2 * 0.6f), 40, 500); ((MainModule)(ref main)).simulationSpace = (ParticleSystemSimulationSpace)1; ((MainModule)(ref main)).cullingMode = (ParticleSystemCullingMode)0; EmissionModule emission = obj.emission; ((EmissionModule)(ref emission)).rateOverTime = MinMaxCurve.op_Implicit(Mathf.Clamp(num2 * 0.07f, 5f, 60f)); ShapeModule shape = obj.shape; ((ShapeModule)(ref shape)).shapeType = (ParticleSystemShapeType)5; ((ShapeModule)(ref shape)).scale = size; VelocityOverLifetimeModule velocityOverLifetime = obj.velocityOverLifetime; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).enabled = true; ((VelocityOverLifetimeModule)(ref velocityOverLifetime)).y = new MinMaxCurve(0.04f); ParticleSystemRenderer component = val3.GetComponent(); if ((Object)(object)val != (Object)null) { ((Renderer)component).material = new Material(val); } emitters.Add(val3); num++; } } if (num > 0) { REPOConomyPlugin.Logger.LogInfo((object)$"[FloatingDust] Spawned dust in {num} new rooms (total {emitters.Count})"); } else if (emitters.Count > 0) { scanTimer = 999f; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[FloatingDust] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_ReverbHall { private static GameObject zone; public static void Reset() { if ((Object)(object)zone != (Object)null) { Object.Destroy((Object)(object)zone); } zone = null; } private static void Postfix(PlayerController __instance) { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown if (!REPOEventManager.ReverbHall || !SemiFunc.RunIsLevel()) { if ((Object)(object)zone != (Object)null) { Object.Destroy((Object)(object)zone); zone = null; } } else { if ((Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } if (!((Object)(object)zone != (Object)null)) { try { zone = new GameObject("REPOReverbHall"); AudioReverbZone obj = zone.AddComponent(); obj.minDistance = 35f; obj.maxDistance = 70f; obj.reverbPreset = (AudioReverbPreset)13; return; } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[ReverbHall] " + ex.Message)); zone = null; return; } } zone.transform.position = ((Component)__instance).transform.position; } } } [HarmonyPatch(typeof(EnemyDirector), "AmountSetup")] public static class Patch_SwarmGuard_Count { private static readonly FieldInfo FI_total = AccessTools.Field(typeof(EnemyDirector), "totalAmount"); private static readonly FieldInfo FI_list = AccessTools.Field(typeof(EnemyDirector), "enemyList"); private static void Postfix(EnemyDirector __instance) { if (!SemiFunc.IsMasterClientOrSingleplayer() || !SemiFunc.RunIsLevel()) { return; } float num = 1f; if (REPOEventManager.WeakSwarm) { num *= 1.5f; } if (REPOEventManager.EliteGuard) { num *= 0.6f; } if (REPOEventManager.ThinnedPatrols) { num *= 0.7f; } if (num == 1f) { return; } try { int num2 = (int)FI_total.GetValue(__instance); int num3 = Mathf.Max(1, Mathf.RoundToInt((float)num2 * num)); FI_total.SetValue(__instance, num3); List list = (List)FI_list.GetValue(__instance); int count = list.Count; if (count > 0) { if (num3 > num2) { for (int i = 0; i < num3 - num2; i++) { list.Add(list[i % count]); } } else { for (int j = 0; j < num2 - num3; j++) { if (list.Count <= 1) { break; } list.RemoveAt(list.Count - 1); } } } REPOConomyPlugin.Logger.LogInfo((object)$"[SwarmGuard] count x{num}: {num2} -> {num3} (list {count} -> {list.Count})"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SwarmGuard] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_SwarmGuard_HP { private static readonly FieldInfo FI_hpCur = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance) { if (!SemiFunc.RunIsLevel()) { return; } float num = (REPOEventManager.WeakSwarm ? 0.6f : (REPOEventManager.EliteGuard ? 1.6f : 1f)); if (num == 1f) { return; } try { __instance.health = Mathf.Max(1, Mathf.RoundToInt((float)__instance.health * num)); FI_hpCur.SetValue(__instance, __instance.health); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SwarmGuardHP] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_ShuffledLoot { private static bool done; private static float delay = 3f; public static void Reset() { done = false; delay = 3f; } private static void Postfix() { } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_LuckyScraps { private static bool done; public static void Reset() { done = false; } private static void Postfix() { //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.LuckyScraps || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || done) { return; } ValuableVolume[] array = Object.FindObjectsOfType(); if (array == null || array.Length == 0) { return; } done = true; try { AssetManager instance = AssetManager.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.enemyValuableSmall == (Object)null) { return; } int num = Mathf.Min(Random.Range(2, 4), array.Length); for (int i = 0; i < num; i++) { ValuableVolume val = array[Random.Range(0, array.Length)]; if (!((Object)(object)val == (Object)null)) { Vector3 val2 = ((Component)val).transform.position + Vector3.up * 0.3f; if (!SemiFunc.IsMultiplayer()) { Object.Instantiate(instance.enemyValuableSmall, val2, Quaternion.identity); } else { PhotonNetwork.InstantiateRoomObject("Valuables/" + ((Object)instance.enemyValuableSmall).name, val2, Quaternion.identity, (byte)0, (object[])null); } } } REPOConomyPlugin.Logger.LogInfo((object)$"[LuckyScraps] Spawned {num} bonus orbs"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LuckyScraps] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_MagneticCarts { private static PhysGrabCart[] carts = (PhysGrabCart[])(object)new PhysGrabCart[0]; private static float scanTimer; public static void Reset() { carts = (PhysGrabCart[])(object)new PhysGrabCart[0]; scanTimer = 0f; } private static void Postfix() { //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_018e: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: 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_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.MagneticCarts || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } scanTimer -= Time.deltaTime; if (scanTimer <= 0f) { scanTimer = 1f; carts = Object.FindObjectsOfType(); } if (carts.Length == 0) { return; } try { foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if ((Object)(object)valuable == (Object)null) { continue; } PhysGrabObject component = ((Component)valuable).GetComponent(); Rigidbody component2 = ((Component)valuable).GetComponent(); if ((Object)(object)component == (Object)null || (Object)(object)component2 == (Object)null) { continue; } bool num = component.playerGrabbing != null && component.playerGrabbing.Count > 0; bool flag = Patch_ScaleInCart_TrackCart.IsInCart(component); bool flag2 = (Object)(object)RoundDirector.instance != (Object)null && RoundDirector.instance.dollarHaulList.Contains(((Component)valuable).gameObject); if (num || flag || flag2) { continue; } Vector3 position = ((Component)valuable).transform.position; PhysGrabCart val = null; float num2 = 4f; PhysGrabCart[] array = carts; foreach (PhysGrabCart val2 in array) { if (!((Object)(object)val2 == (Object)null)) { float num3 = Vector3.Distance(position, ((Component)val2).transform.position); if (num3 < num2) { num2 = num3; val = val2; } } } if (!((Object)(object)val == (Object)null)) { component.OverrideIndestructible(0.2f); Vector3 val3 = ((Component)val).transform.position + Vector3.up * 0.5f - position; Vector3 normalized = ((Vector3)(ref val3)).normalized; component2.AddForce(normalized * 5f * Time.deltaTime * 60f, (ForceMode)0); } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[MagneticCarts] " + ex.Message)); } } } internal static class EnemyDamageMods { private static readonly FieldInfo FI_difficulty = AccessTools.Field(typeof(EnemyParent), "difficulty"); public static int GetTier(EnemyParent ep) { if (FI_difficulty == null || (Object)(object)ep == (Object)null) { return 1; } try { string text = FI_difficulty.GetValue(ep).ToString(); if (text.Contains("3")) { return 3; } if (text.Contains("2")) { return 2; } } catch { } return 1; } public static bool Handle(ref int damage, int enemyIndex) { if (enemyIndex < 0) { return true; } if (!REPOEventManager.TankyButGentle && !REPOEventManager.TierMercy && !REPOEventManager.SuicidalAttackers) { return true; } Enemy val = SemiFunc.EnemyGetFromIndex(enemyIndex); EnemyParent val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponentInParent() : null); if (REPOEventManager.SuicidalAttackers) { if ((Object)(object)val2 != (Object)null && SemiFunc.IsMasterClientOrSingleplayer()) { try { val2.Despawn(); } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[SuicidalAttackers] " + ex.Message)); } } return false; } if (REPOEventManager.TankyButGentle) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage * 0.5f)); } if (REPOEventManager.TierMercy && (Object)(object)val2 != (Object)null) { int tier = GetTier(val2); if (tier > 1) { damage = Mathf.Max(1, Mathf.RoundToInt((float)damage / (float)tier)); } } return true; } } [HarmonyPatch(typeof(PlayerHealth), "Hurt")] public static class Patch_EnemyDmgMods_Hurt { private static bool Prefix(ref int damage, int enemyIndex) { return EnemyDamageMods.Handle(ref damage, enemyIndex); } } [HarmonyPatch(typeof(PlayerHealth), "HurtOther")] public static class Patch_EnemyDmgMods_HurtOther { private static bool Prefix(ref int damage, int enemyIndex) { return EnemyDamageMods.Handle(ref damage, enemyIndex); } } [HarmonyPatch(typeof(EnemyHealth), "Awake")] public static class Patch_TankyHP { private static readonly FieldInfo FI_hpCur = AccessTools.Field(typeof(EnemyHealth), "healthCurrent"); private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.TankyButGentle || !SemiFunc.RunIsLevel()) { return; } try { __instance.health *= 2; if (FI_hpCur != null) { FI_hpCur.SetValue(__instance, __instance.health); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[TankyHP] " + ex.Message)); } } } internal static class DeafHelper { private static readonly HashSet enemySounds = new HashSet(); private static readonly Dictionary soundFieldsCache = new Dictionary(); private static float scanT; private static float lastLog; public static void Reset() { enemySounds.Clear(); scanT = 0f; } private static FieldInfo[] SoundFields(Type t) { if (!soundFieldsCache.TryGetValue(t, out var value)) { List list = new List(); FieldInfo[] fields = t.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); foreach (FieldInfo fieldInfo in fields) { if (fieldInfo.FieldType == typeof(Sound)) { list.Add(fieldInfo); } } value = list.ToArray(); soundFieldsCache[t] = value; } return value; } private static void Rescan() { enemySounds.Clear(); MonoBehaviour[] array = Object.FindObjectsOfType(); foreach (MonoBehaviour val in array) { if ((Object)(object)val == (Object)null) { continue; } Type type = ((object)val).GetType(); if (!type.Name.StartsWith("Enemy")) { continue; } FieldInfo[] array2 = SoundFields(type); for (int j = 0; j < array2.Length; j++) { object? value = array2[j].GetValue(val); Sound val2 = (Sound)((value is Sound) ? value : null); if (val2 != null) { enemySounds.Add(val2); } } } } public static void TryMute(Sound snd, AudioSource result) { if (REPOEventManager.DeafToMonsters && SemiFunc.RunIsLevel() && snd != null && !((Object)(object)result == (Object)null)) { if (Time.time - scanT > 1f) { scanT = Time.time; Rescan(); } if (enemySounds.Contains(snd)) { result.mute = true; } } } } [HarmonyPatch(typeof(Sound), "Play", new Type[] { typeof(Vector3), typeof(float), typeof(float), typeof(float), typeof(float) })] public static class Patch_DeafToMonsters { public static void Reset() { DeafHelper.Reset(); } private static void Postfix(Sound __instance, AudioSource __result) { DeafHelper.TryMute(__instance, __result); } } internal static class EnemySpeedScale { private static readonly FieldInfo FI_VisionsTriggered = AccessTools.Field(typeof(EnemyVision), "VisionsTriggered"); private static readonly FieldInfo FI_VisionsToTrigger = AccessTools.Field(typeof(EnemyVision), "VisionsToTrigger"); public static bool Chasing(EnemyParent ep) { if ((Object)(object)ep == (Object)null) { return false; } EnemyVision componentInChildren = ((Component)ep).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || FI_VisionsTriggered == null) { return false; } try { int num = ((!(FI_VisionsToTrigger != null)) ? 1 : Convert.ToInt32(FI_VisionsToTrigger.GetValue(componentInChildren))); if (num < 1) { num = 1; } if (!(FI_VisionsTriggered.GetValue(componentInChildren) is IDictionary dictionary)) { return false; } foreach (object value in dictionary.Values) { if (value is int num2 && num2 >= num) { return true; } } } catch { } return false; } public static bool AnyActive() { if (!REPOEventManager.SluggishEnemies && !REPOEventManager.AdrenalineHunters && REPOEventManager.EnemySpeedMultiplier == 1f) { return REPOEventManager.EnemiesFasterOnKillMultiplier != 1f; } return true; } public static float Mul(EnemyParent ep) { float num = REPOEventManager.EnemySpeedMultiplier * REPOEventManager.EnemiesFasterOnKillMultiplier; if (REPOEventManager.SluggishEnemies) { num *= 0.7f; } if (REPOEventManager.AdrenalineHunters && Chasing(ep)) { num *= EnemyDamageMods.GetTier(ep) switch { 2 => 1.4f, 3 => 1.3f, _ => 1.5f, }; } return num; } } [HarmonyPatch(typeof(EnemyRigidbody), "Update")] public static class Patch_EnemyRBSpeed { private static readonly FieldInfo FI_positionSpeed = AccessTools.Field(typeof(EnemyRigidbody), "positionSpeed"); private static float lastLog; public static void Reset() { } private static void Postfix(EnemyRigidbody __instance) { if (SemiFunc.RunIsLevel() && SemiFunc.IsMasterClientOrSingleplayer() && EnemySpeedScale.AnyActive() && !(FI_positionSpeed == null)) { float num = EnemySpeedScale.Mul(((Component)__instance).GetComponentInParent()); if (num != 1f) { float num2 = (float)FI_positionSpeed.GetValue(__instance); FI_positionSpeed.SetValue(__instance, num2 * num); } } } } [HarmonyPatch(typeof(EnemyNavMeshAgent), "Update")] public static class Patch_EnemySpeedUniversal { private static readonly FieldInfo FI_Agent = AccessTools.Field(typeof(EnemyNavMeshAgent), "Agent"); private static readonly FieldInfo FI_DefaultSpeed = AccessTools.Field(typeof(EnemyNavMeshAgent), "DefaultSpeed"); private static Dictionary baseSpeed = new Dictionary(); private static Dictionary lastApplied = new Dictionary(); private static Dictionary baseDef = new Dictionary(); private static Dictionary lastDef = new Dictionary(); public static void Reset() { baseSpeed.Clear(); lastApplied.Clear(); baseDef.Clear(); lastDef.Clear(); } private static void Postfix(EnemyNavMeshAgent __instance) { if (!SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer() || !EnemySpeedScale.AnyActive()) { return; } NavMeshAgent val = (NavMeshAgent)((FI_Agent != null) ? /*isinst with value type is only supported in some contexts*/: null); if ((Object)(object)val == (Object)null) { return; } int instanceID = ((Object)__instance).GetInstanceID(); float num = EnemySpeedScale.Mul(((Component)__instance).GetComponentInParent()); float speed = val.speed; if (!lastApplied.TryGetValue(instanceID, out var value) || Mathf.Abs(speed - value) > 0.05f) { baseSpeed[instanceID] = speed; } float value2 = (val.speed = baseSpeed[instanceID] * num); lastApplied[instanceID] = value2; if (FI_DefaultSpeed != null) { float num3 = (float)FI_DefaultSpeed.GetValue(__instance); if (!lastDef.TryGetValue(instanceID, out var value3) || Mathf.Abs(num3 - value3) > 0.05f) { baseDef[instanceID] = num3; } float num4 = baseDef[instanceID] * num; FI_DefaultSpeed.SetValue(__instance, num4); lastDef[instanceID] = num4; } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_BlinkingHaze { private static GameObject overlayGO; private static Image overlayImg; private static float timer; public static void Reset() { timer = 0f; if ((Object)(object)overlayImg != (Object)null) { ((Behaviour)overlayImg).enabled = false; } } private static void Ensure() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_0047: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)overlayGO != (Object)null)) { overlayGO = new GameObject("REPOBlinkOverlay"); Object.DontDestroyOnLoad((Object)(object)overlayGO); Canvas obj = overlayGO.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 30000; GameObject val = new GameObject("Img"); val.transform.SetParent(overlayGO.transform, false); overlayImg = val.AddComponent(); ((Graphic)overlayImg).color = Color.black; RectTransform rectTransform = ((Graphic)overlayImg).rectTransform; rectTransform.anchorMin = Vector2.zero; rectTransform.anchorMax = Vector2.one; rectTransform.offsetMin = Vector2.zero; rectTransform.offsetMax = Vector2.zero; ((Behaviour)overlayImg).enabled = false; } } private static void Postfix(PlayerController __instance) { if ((Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } if (!REPOEventManager.BlinkingHaze || !SemiFunc.RunIsLevel()) { if ((Object)(object)overlayImg != (Object)null) { ((Behaviour)overlayImg).enabled = false; } } else { Ensure(); timer += Time.deltaTime; ((Behaviour)overlayImg).enabled = timer % 5f >= 4f; } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_LoneWolf { private static readonly FieldInfo FI_MoveSpeed = AccessTools.Field(typeof(PlayerController), "MoveSpeed"); private static readonly FieldInfo FI_SprintSpeed = AccessTools.Field(typeof(PlayerController), "SprintSpeed"); private static readonly FieldInfo FI_origMove = AccessTools.Field(typeof(PlayerController), "playerOriginalMoveSpeed"); private static readonly FieldInfo FI_origSprint = AccessTools.Field(typeof(PlayerController), "playerOriginalSprintSpeed"); public static void Reset() { } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.LoneWolf || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null) { return; } float num = 1f; RoomVolumeCheck componentInChildren = ((Component)instance).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null && componentInChildren.CurrentRooms != null && componentInChildren.CurrentRooms.Count > 0) { bool flag = false; if ((Object)(object)GameDirector.instance != (Object)null) { foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if ((Object)(object)player == (Object)null || (Object)(object)player == (Object)(object)instance) { continue; } RoomVolumeCheck componentInChildren2 = ((Component)player).GetComponentInChildren(); if ((Object)(object)componentInChildren2 == (Object)null || componentInChildren2.CurrentRooms == null) { continue; } foreach (RoomVolume currentRoom in componentInChildren2.CurrentRooms) { if ((Object)(object)currentRoom != (Object)null && componentInChildren.CurrentRooms.Contains(currentRoom)) { flag = true; break; } } if (flag) { break; } } } num = (flag ? 0.75f : 1.25f); } try { float num2 = (float)FI_origMove.GetValue(__instance); float num3 = (float)FI_origSprint.GetValue(__instance); if (!(num2 <= 0f) && !(num3 <= 0f)) { FI_MoveSpeed.SetValue(__instance, num2 * num); FI_SprintSpeed.SetValue(__instance, num3 * num); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LoneWolf] " + ex.Message)); } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_RestorativeRooms { private static HashSet visitedModules = new HashSet(); public static void Reset() { visitedModules.Clear(); } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.RestorativeRooms || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.playerHealth == (Object)null) { return; } RoomVolumeCheck componentInChildren = ((Component)instance).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || componentInChildren.CurrentRooms == null) { return; } foreach (RoomVolume currentRoom in componentInChildren.CurrentRooms) { if (!((Object)(object)currentRoom == (Object)null) && !((Object)(object)currentRoom.Module == (Object)null) && visitedModules.Add(((Object)currentRoom.Module).GetInstanceID())) { instance.playerHealth.Heal(5, true); REPOConomyPlugin.Logger.LogInfo((object)("[RestorativeRooms] New module '" + ((Object)currentRoom.Module).name + "' +5 HP")); } } } } [HarmonyPatch(typeof(EnemyDirector), "Update")] public static class Patch_HostileRooms { private static float timer; public static void Reset() { timer = 0f; } private static bool RoomContains(RoomVolume room, Vector3 pos) { //IL_0019: 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_0021: Unknown result type (might be due to invalid IL or missing references) Collider[] componentsInChildren = ((Component)room).GetComponentsInChildren(); foreach (Collider val in componentsInChildren) { if ((Object)(object)val != (Object)null) { Bounds bounds = val.bounds; if (((Bounds)(ref bounds)).Contains(pos)) { return true; } } } return false; } private static void Postfix() { //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.HostileRooms || !SemiFunc.RunIsLevel() || !SemiFunc.IsMasterClientOrSingleplayer()) { return; } timer += Time.deltaTime; if (timer < 1f) { return; } timer = 0f; if ((Object)(object)EnemyDirector.instance == (Object)null || (Object)(object)GameDirector.instance == (Object)null) { return; } HashSet hashSet = new HashSet(); foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if ((Object)(object)player == (Object)null) { continue; } RoomVolumeCheck componentInChildren = ((Component)player).GetComponentInChildren(); if ((Object)(object)componentInChildren == (Object)null || componentInChildren.CurrentRooms == null) { continue; } foreach (RoomVolume currentRoom in componentInChildren.CurrentRooms) { if ((Object)(object)currentRoom != (Object)null) { hashSet.Add(currentRoom); } } } if (hashSet.Count == 0) { return; } try { foreach (EnemyParent item in EnemyDirector.instance.enemiesSpawned) { if ((Object)(object)item == (Object)null || (Object)(object)((Component)item).GetComponentInChildren() != (Object)null || (Object)(object)((Component)item).GetComponentInChildren() != (Object)null) { continue; } EnemyRigidbody componentInChildren2 = ((Component)item).GetComponentInChildren(); Vector3 pos = (((Object)(object)componentInChildren2 != (Object)null) ? ((Component)componentInChildren2).transform.position : ((Component)item).transform.position); bool flag = false; foreach (RoomVolume item2 in hashSet) { if (RoomContains(item2, pos)) { flag = true; break; } } if (flag) { EnemyHealth componentInChildren3 = ((Component)item).GetComponentInChildren(); if ((Object)(object)componentInChildren3 != (Object)null) { componentInChildren3.Hurt(10, Vector3.up); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[HostileRooms] " + ex.Message)); } } } [HarmonyPatch(typeof(MapToolController), "Update")] public static class Patch_MapDisabled { private static bool Prefix() { if (REPOEventManager.MapDisabled) { return !SemiFunc.RunIsLevel(); } return true; } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_PlayerStatMods { private static readonly FieldInfo FI_MoveSpeed = AccessTools.Field(typeof(PlayerController), "MoveSpeed"); private static readonly FieldInfo FI_SprintSpeed = AccessTools.Field(typeof(PlayerController), "SprintSpeed"); private static readonly FieldInfo FI_origMove = AccessTools.Field(typeof(PlayerController), "playerOriginalMoveSpeed"); private static readonly FieldInfo FI_origSprint = AccessTools.Field(typeof(PlayerController), "playerOriginalSprintSpeed"); private static readonly FieldInfo FI_JumpForce = AccessTools.Field(typeof(PlayerController), "JumpForce"); private static readonly FieldInfo FI_JumpExtra = AccessTools.Field(typeof(PlayerController), "JumpExtra"); private static readonly FieldInfo FI_EnergyStart = AccessTools.Field(typeof(PlayerController), "EnergyStart"); private static readonly FieldInfo FI_EnergyCurrent = AccessTools.Field(typeof(PlayerController), "EnergyCurrent"); private static bool appliedOnce; public static void Reset() { appliedOnce = false; } private static void Postfix(PlayerController __instance) { if (!SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } _ = PlayerAvatar.instance; if (REPOEventManager.HalfStamina && FI_EnergyStart != null && FI_EnergyCurrent != null) { float num = (float)FI_EnergyStart.GetValue(__instance); if ((float)FI_EnergyCurrent.GetValue(__instance) > num * 0.5f) { FI_EnergyCurrent.SetValue(__instance, num * 0.5f); } } if (REPOEventManager.GlassRunner) { try { float num2 = (float)FI_origMove.GetValue(__instance); float num3 = (float)FI_origSprint.GetValue(__instance); if (num2 > 0f && num3 > 0f) { FI_MoveSpeed.SetValue(__instance, num2 * 1.25f); FI_SprintSpeed.SetValue(__instance, num3 * 1.25f); } } catch { } } if (!REPOEventManager.GlassRunner || appliedOnce) { return; } appliedOnce = true; try { if (FI_JumpForce != null) { FI_JumpForce.SetValue(__instance, (float)FI_JumpForce.GetValue(__instance) * 1.25f); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[GlassRunner] " + ex.Message)); } } } [HarmonyPatch(typeof(EnemyHealth), "Death")] public static class Patch_KillRecharge { public static void Reset() { } private static void Postfix(EnemyHealth __instance) { if (!REPOEventManager.KillRecharge || !SemiFunc.RunIsLevel()) { return; } int num = EnemyDamageMods.GetTier(((Component)__instance).GetComponentInParent()); if (num < 1) { num = 1; } try { ItemGun[] array = Object.FindObjectsOfType(); foreach (ItemGun val in array) { if ((Object)(object)val == (Object)null) { continue; } PhysGrabObject component = ((Component)val).GetComponent(); if (!((Object)(object)component == (Object)null) && component.playerGrabbing != null && component.playerGrabbing.Count != 0) { ItemBattery component2 = ((Component)val).GetComponent(); if (!((Object)(object)component2 == (Object)null) && component2.batteryBars > 0) { float num2 = 100f / (float)component2.batteryBars; int num3 = Mathf.RoundToInt(component2.batteryLife / num2); float num4 = (float)Mathf.Min(component2.batteryBars, num3 + num) * num2; component2.batteryLife = Mathf.Max(1f, num4); component2.SetBatteryLife(Mathf.RoundToInt(num4)); } } } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[KillRecharge] " + ex.Message)); } } } internal static class ValuableRef { public static readonly FieldInfo FI_cur = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); public static readonly FieldInfo FI_orig = AccessTools.Field(typeof(ValuableObject), "dollarValueOriginal"); public static readonly FieldInfo FI_pgo = AccessTools.Field(typeof(ValuableObject), "physGrabObject"); public static float Cur(ValuableObject v) { return (float)FI_cur.GetValue(v); } public static void SetCur(ValuableObject v, float val) { FI_cur.SetValue(v, val); } public static float Orig(ValuableObject v) { return (float)FI_orig.GetValue(v); } public static PhysGrabObject Pgo(ValuableObject v) { if (!(FI_pgo != null)) { return null; } object? value = FI_pgo.GetValue(v); return (PhysGrabObject)((value is PhysGrabObject) ? value : null); } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_VitalHaul { private static HashSet grabbed = new HashSet(); public static void Reset() { grabbed.Clear(); } private static int HealBySize(Type t) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected I4, but got Unknown return (int)t switch { 0 => 1, 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6, 6 => 7, _ => 1, }; } private static void Postfix(PlayerController __instance) { //IL_00a8: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.VitalHaul || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } PlayerAvatar instance = PlayerAvatar.instance; if ((Object)(object)instance == (Object)null || (Object)(object)instance.playerHealth == (Object)null || (Object)(object)ValuableDirector.instance == (Object)null || ValuableDirector.instance.valuableList == null) { return; } foreach (ValuableObject valuable in ValuableDirector.instance.valuableList) { if (!((Object)(object)valuable == (Object)null)) { PhysGrabObject val = ValuableRef.Pgo(valuable); if (!((Object)(object)val == (Object)null) && val.grabbedLocal && grabbed.Add(((Object)valuable).GetInstanceID())) { instance.playerHealth.Heal(HealBySize(valuable.volumeType), true); } } } } } [HarmonyPatch(typeof(PlayerController), "Update")] public static class Patch_OffGridMap { private static float scanT; public static void Reset() { scanT = 0f; } private static void Postfix(PlayerController __instance) { if (!REPOEventManager.OffGrid || !SemiFunc.RunIsLevel() || (Object)(object)__instance != (Object)(object)PlayerController.instance) { return; } scanT -= Time.deltaTime; if (scanT > 0f) { return; } scanT = 1f; MapValuable[] array = Object.FindObjectsOfType(); foreach (MapValuable val in array) { if ((Object)(object)val != (Object)null && (Object)(object)val.spriteRenderer != (Object)null) { ((Renderer)val.spriteRenderer).enabled = false; } } } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector), "Break")] public static class Patch_BattleHardened { private static readonly FieldInfo FI_cur = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent"); private static Dictionary effMax = new Dictionary(); public static void Reset() { effMax.Clear(); } private static bool Prefix(PhysGrabObjectImpactDetector __instance, ref float valueLost, Vector3 _contactPoint) { //IL_00bf: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.BattleHardened || !SemiFunc.RunIsLevel() || !__instance.isValuable) { return true; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { return false; } ValuableObject componentInParent = ((Component)__instance).GetComponentInParent(); if ((Object)(object)componentInParent == (Object)null) { return false; } float num = (float)FI_cur.GetValue(componentInParent); int instanceID = ((Object)componentInParent).GetInstanceID(); if (!effMax.TryGetValue(instanceID, out var value)) { value = num; effMax[instanceID] = value; } float num2 = value * 1.5f; float num3 = 0f; if (num < num2 && valueLost > 0f) { num3 = Mathf.Min(valueLost, num2 - num); FI_cur.SetValue(componentInParent, Mathf.Round(num + num3)); } try { if ((Object)(object)WorldSpaceUIParent.instance != (Object)null) { WorldSpaceUIParent.instance.ValueLostCreate(_contactPoint, Mathf.RoundToInt(num3)); } } catch { } return false; } } [HarmonyPatch(typeof(WorldSpaceUIValueLost), "Start")] public static class Patch_BattleHardenedPopup { private static readonly FieldInfo FI_textColor = AccessTools.Field(typeof(WorldSpaceUIValueLost), "textColor"); private static readonly FieldInfo FI_value = AccessTools.Field(typeof(WorldSpaceUIValueLost), "value"); private static readonly Color green = new Color(0.3f, 1f, 0.35f, 1f); private static void Postfix(WorldSpaceUIValueLost __instance) { //IL_006a: Unknown result type (might be due to invalid IL or missing references) if (!REPOEventManager.BattleHardened || !SemiFunc.RunIsLevel()) { return; } try { TextMeshProUGUI component = ((Component)__instance).GetComponent(); int num = ((FI_value != null) ? Convert.ToInt32(FI_value.GetValue(__instance)) : 0); if ((Object)(object)component != (Object)null) { ((TMP_Text)component).text = "+$" + SemiFunc.DollarGetString(num); } if (FI_textColor != null) { FI_textColor.SetValue(__instance, green); } } catch { } } } public static class REPOSeedManager { private static Random _random; private static Random _shopRandom; private static Random _levelRandom; private static Random _mapRandom; private static Random _enemyRandom; private static Random _valuableRandom; private static Random _truckRandom; private static Random _objectRandom; public static Dictionary ItemSeeds = new Dictionary(); public static Dictionary EnemyOrbSeeds = new Dictionary(); public static int? ScheduledOrbSeed = null; public static string CurrentSeed { get; private set; } = "N/A"; private static int GetDeterministicHashCode(string str) { int num = 5381; int num2 = num; for (int i = 0; i < str.Length && str[i] != 0; i += 2) { num = ((num << 5) + num) ^ str[i]; if (i == str.Length - 1 || str[i + 1] == '\0') { break; } num2 = ((num2 << 5) + num2) ^ str[i + 1]; } return num + num2 * 1566083941; } public static int GetCurrentHash() { if (REPOConfig.UseLevelBasedSeed.Value && (Object)(object)RunManager.instance != (Object)null) { return GetDeterministicHashCode(CurrentSeed + "_Lvl_" + RunManager.instance.levelsCompleted); } return GetDeterministicHashCode(CurrentSeed); } public static void Initialize() { string text; if (REPOConfig.RandomizeSeedEachLevel.Value) { text = Guid.NewGuid().ToString().Substring(0, 8) .ToUpper(); REPOConfig.CustomSeedValue.Value = text; REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83c\udfb2 Generated NEW random seed: " + text)); } else if (REPOConfig.UseCustomSeed.Value && !string.IsNullOrEmpty(REPOConfig.CustomSeedValue.Value)) { text = REPOConfig.CustomSeedValue.Value; REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83c\udfb2 Using custom seed: " + text)); } else { text = Guid.NewGuid().ToString().Substring(0, 8) .ToUpper(); REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83c\udfb2 Generated temporary seed: " + text)); } CurrentSeed = text; int currentHash = GetCurrentHash(); REPOConomyPlugin.Logger.LogInfo((object)$"[SeedManager] ✅ Initialized all randoms with hash: {currentHash}"); _random = new Random(currentHash); _shopRandom = new Random(currentHash + 999); _levelRandom = new Random(currentHash + 1337); _mapRandom = new Random(currentHash + 777); _enemyRandom = new Random(currentHash + 666); _valuableRandom = new Random(currentHash + 555); _truckRandom = new Random(currentHash + 444); _objectRandom = new Random(currentHash + 333); } public static void SetRemoteSeed(string seed) { CurrentSeed = seed; int deterministicHashCode = GetDeterministicHashCode(seed); _random = new Random(deterministicHashCode); _shopRandom = new Random(deterministicHashCode + 999); _levelRandom = new Random(deterministicHashCode + 1337); _mapRandom = new Random(deterministicHashCode + 777); _enemyRandom = new Random(deterministicHashCode + 666); _valuableRandom = new Random(deterministicHashCode + 555); _truckRandom = new Random(deterministicHashCode + 444); _objectRandom = new Random(deterministicHashCode + 333); REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83d\udce1 Received remote seed: " + CurrentSeed)); } public static void LoadSeedFromConfig() { if (!string.IsNullOrEmpty(REPOConfig.CustomSeedValue.Value)) { CurrentSeed = REPOConfig.CustomSeedValue.Value; REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83d\udcd6 Loaded seed from config: " + CurrentSeed)); } else { CurrentSeed = "N/A"; REPOConomyPlugin.Logger.LogInfo((object)"[SeedManager] ℹ\ufe0f No seed in config, using N/A"); } } public static void ReloadFromConfigIfNeeded() { string text = (REPOConfig.UseCustomSeed.Value ? REPOConfig.CustomSeedValue.Value : null); if (REPOConfig.UseCustomSeed.Value && !string.IsNullOrEmpty(text) && text != CurrentSeed) { REPOConomyPlugin.Logger.LogInfo((object)("[SeedManager] \ud83d\udd04 Seed changed in config: " + CurrentSeed + " -> " + text + ", reinitializing...")); Initialize(); } else if (!REPOConfig.UseCustomSeed.Value && CurrentSeed != "N/A" && _random != null) { REPOConomyPlugin.Logger.LogInfo((object)"[SeedManager] \ud83d\udd04 Use custom seed disabled, will regenerate on next init"); } } public static int TruckNext() { if (_truckRandom == null) { Initialize(); } return _truckRandom.Next(); } public static void ResetTruckRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _truckRandom = new Random(GetCurrentHash() + 444); } } public static int ShopNext() { if (_shopRandom == null) { Initialize(); } return _shopRandom.Next(); } public static void ResetShopRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _shopRandom = new Random(GetCurrentHash() + 999); } } public static int LevelNext() { if (_levelRandom == null) { Initialize(); } return _levelRandom.Next(); } public static void ResetLevelRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _levelRandom = new Random(GetCurrentHash() + 1337); } } public static int MapNext() { if (_mapRandom == null) { Initialize(); } return _mapRandom.Next(); } public static void ResetMapRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _mapRandom = new Random(GetCurrentHash() + 777); } } public static int EnemyNext() { if (_enemyRandom == null) { Initialize(); } return _enemyRandom.Next(); } public static void ResetEnemyRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _enemyRandom = new Random(GetCurrentHash() + 666); } } public static int ValuableNext() { if (_valuableRandom == null) { Initialize(); } return _valuableRandom.Next(); } public static void ResetValuableRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); return; } _valuableRandom = new Random(GetCurrentHash() + 555); ItemSeeds.Clear(); EnemyOrbSeeds.Clear(); ScheduledOrbSeed = null; } public static void ResetObjectRandom() { if (string.IsNullOrEmpty(CurrentSeed) || CurrentSeed == "N/A") { Initialize(); } else { _objectRandom = new Random(GetCurrentHash() + 333); } } public static int ObjectRange(int min, int max) { if (_objectRandom == null) { Initialize(); } if (min >= max) { return min; } return _objectRandom.Next(min, max); } public static float ObjectRange(float min, float max) { if (_objectRandom == null) { Initialize(); } return (float)(_objectRandom.NextDouble() * (double)(max - min) + (double)min); } public static int ObjectNext() { if (_objectRandom == null) { Initialize(); } return _objectRandom.Next(); } public static int Range(int min, int max) { if (_random == null) { Initialize(); } if (min >= max) { return min; } return _random.Next(min, max); } public static float Range(float min, float max) { if (_random == null) { Initialize(); } return (float)(_random.NextDouble() * (double)(max - min) + (double)min); } public static float Value() { if (_random == null) { Initialize(); } return (float)_random.NextDouble(); } } [HarmonyPatch(typeof(RunManager))] public static class RunManagerSeededPatch { [HarmonyPatch("SetRunLevel")] [HarmonyPrefix] public static bool SetRunLevelPrefix(RunManager __instance) { if (!SemiFunc.RunIsShop()) { REPOSeedManager.Initialize(); } ValuableDirectorSeededPatch.ResetCache(); int num = REPOSeedManager.GetCurrentHash() + 777; Random.InitState(num); List field = GetField>(__instance, "levels"); Level field2 = GetField(__instance, "previousRunLevel"); if (field.Count > 0) { bool value = REPOConfig.RandomizeSeedEachLevel.Value; if (value) { Level val = field2; int num2 = 0; while ((Object)(object)val == (Object)(object)field2 && num2 < 50) { int index = Random.Range(0, field.Count); val = field[index]; num2++; } __instance.levelCurrent = val; } else { int index2 = Random.Range(0, field.Count); __instance.levelCurrent = field[index2]; REPOConomyPlugin.Logger.LogInfo((object)"[SetRunLevel] Deterministic mode: Ignoring previousRunLevel check."); } REPOConomyPlugin.Logger.LogInfo((object)("[SetRunLevel] Selected level: " + ((Object)__instance.levelCurrent).name + " " + string.Format("(Seed logic: {0}, Seed: {1})", value ? "Random (Avoid Previous)" : "Deterministic (Ignore Previous)", num))); } return false; } private static T GetField(object instance, string fieldName) { return (T)AccessTools.Field(instance.GetType(), fieldName).GetValue(instance); } } public enum ShopEconomyType { NormalPrices, BlackFriday, ClearanceSale, HappyHour, Charity, MemberDiscount, FlashSale, LoyaltyReward, BulkDiscount, SeasonalSale, GrandOpening, Inflation, LuxuryTax, Monopoly, EconomicCrisis, SupplyShortage, ImportTax, PremiumPricing, DemandSurge, MarketManipulation, ScarcityPanic, UpgradeDiscount, HealthcareSubsidy, CrystalCraze, UpgradeTax, MedicalCrisis, CrystalScarcity, WildMarket, InvertedPrices, GamblersDream, CouponStorm, SupplierFestival, TechRebate, MedBayDonations, CrystalOverflow, PawnshopDeals, SurplusCrates, LoyaltyWeekend, ContractorDiscount, VaultLiquidation, BureaucraticFees, HyperInflation, EnergySurcharge, ContractorStrike, LogisticMeltdown, PatentLockdown, InsuranceHike, CounterfeitClampdown, SecurityTax, BlackoutTariff, SplitMarket, UpgradeBoom, FirstAidRush, CrystalSpeculation, PriceFreeze, PriceCascade, TightBudget, JackpotShop, ReverseAuction, ChaoticCoupons, CollectorsVaultSale, HazardPayMarket, AdrenalineClearance, BlackoutWholesale, DuplicateDiscount, PolarizedPricing, JudgementLiquidation, CenturionSupply } public static class ShopEconomyManager { public static bool ShopEconomyInitialized; private static Random shopEconomyRandom; public static void InitializeShopEconomy() { if (ShopEconomyInitialized) { REPOConomyPlugin.Logger.LogInfo((object)"[ShopEconomy] Already initialized. Skipping."); return; } if (!SemiFunc.RunIsShop()) { REPOConomyPlugin.Logger.LogInfo((object)"[ShopEconomy] Not in shop. Skipping."); return; } if (!SemiFunc.IsMasterClientOrSingleplayer()) { REPOConomyPlugin.Logger.LogInfo((object)"[ShopEconomy] Not master client. Waiting for sync."); return; } ShopEconomyInitialized = true; REPOBlackMarketManager.BeginShopRoll(); int currentHash = REPOSeedManager.GetCurrentHash(); int num = (((Object)(object)RunManager.instance != (Object)null) ? RunManager.instance.levelsCompleted : 0); int num2 = currentHash ^ (num * 73856093) ^ 0xBDE31; shopEconomyRandom = new Random(num2); REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Deterministic seed: {num2} (shopIndex={num})"); bool value = REPOConfig.ForceNormalShopPrices.Value; int value2 = REPOConfig.ShopEconomyChance.Value; if (ChallengeManager.TryApplyShopEconomyPreset(shopEconomyRandom)) { return; } if (value) { ApplyShopEconomy(ShopEconomyType.NormalPrices, shopEconomyRandom); REPOBlackMarketManager.ConsumePendingShopEconomyBlocksAfterGeneration(); REPOConomyPlugin.Logger.LogInfo((object)"[ShopEconomy] Normal prices applied (no event)."); return; } ShopEconomyType? forcedShopEconomy = GetForcedShopEconomy(shopEconomyRandom); if (forcedShopEconomy.HasValue) { ApplyShopEconomy(forcedShopEconomy.Value, shopEconomyRandom, trackInStats: false); REPOBlackMarketManager.ConsumePendingShopEconomyBlocksAfterGeneration(); REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Forced shop economy applied: {forcedShopEconomy.Value}"); } else if (shopEconomyRandom.Next(1, 101) > value2) { ApplyShopEconomy(ShopEconomyType.NormalPrices, shopEconomyRandom); REPOBlackMarketManager.ConsumePendingShopEconomyBlocksAfterGeneration(); REPOConomyPlugin.Logger.LogInfo((object)"[ShopEconomy] Normal prices applied (no event)."); } else { ShopEconomyType shopEconomyType = PickRandomShopEconomy(shopEconomyRandom); ApplyShopEconomy(shopEconomyType, shopEconomyRandom); REPOBlackMarketManager.ConsumePendingShopEconomyBlocksAfterGeneration(); REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Applied: {shopEconomyType}"); } } public static void ResetShopEconomy() { ShopEconomyInitialized = false; REPOConomyPlugin.CurrentShopEconomy = ShopEconomyType.NormalPrices; REPOConomyPlugin.HasShopEconomy = false; REPOConomyPlugin.ShopPriceMultiplier = 1f; REPOConomyPlugin.ShopUpgradeMultiplier = 1f; REPOConomyPlugin.ShopHealthPackMultiplier = 1f; REPOConomyPlugin.ShopConsumableMultiplier = 1f; } private static ShopEconomyType? GetForcedShopEconomy(Random rng) { if (REPOConfig.ForceEconomy == null || REPOConfig.ForceEconomy.Count == 0) { return null; } List list = new List(); foreach (KeyValuePair> item in REPOConfig.ForceEconomy) { if (item.Value == null || !item.Value.Value) { continue; } string text = (item.Key ?? string.Empty).Trim(); if (!text.StartsWith("Enable Shop ", StringComparison.OrdinalIgnoreCase)) { continue; } if (!Enum.TryParse(text.Substring("Enable Shop ".Length).Trim(), ignoreCase: true, out var result)) { REPOConomyPlugin.Logger.LogWarning((object)("[ShopEconomy] Invalid forced shop economy key: '" + item.Key + "'")); } else if (result != 0) { if (ChallengeManager.IsChallengeRewardShopEconomy(result) && !ChallengeManager.IsRewardShopEconomyUnlocked(result)) { REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Forced challenge reward shop economy '{result}' is locked."); } else if (LevelMilestoneRewardManager.IsRewardShopEconomy(result) && !LevelMilestoneRewardManager.IsLevel100Unlocked()) { REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Forced level 100 reward shop economy '{result}' is locked."); } else if (REPOBlackMarketManager.TryConsumeShopEconomyBlock(result.ToString(), GetShopEconomyName(result, "English"))) { REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Black market prevented forced shop economy: {result}"); } else if (!list.Contains(result)) { list.Add(result); } } } if (list.Count == 0) { return null; } return list[rng.Next(0, list.Count)]; } private static ShopEconomyType PickRandomShopEconomy(Random rng) { List list = new List(); foreach (ShopEconomyType value2 in Enum.GetValues(typeof(ShopEconomyType))) { if (value2 != 0 && (!ChallengeManager.IsChallengeRewardShopEconomy(value2) || ChallengeManager.IsRewardShopEconomyUnlocked(value2)) && (!LevelMilestoneRewardManager.IsRewardShopEconomy(value2) || LevelMilestoneRewardManager.IsLevel100Unlocked())) { string key = $"Enable Shop {value2}"; if (REPOConfig.ShopEconomyEnables.TryGetValue(key, out var value) && value.Value) { list.Add(value2); } } } if (list.Count == 0) { REPOConomyPlugin.Logger.LogWarning((object)"[ShopEconomy] No shop economies enabled, using NormalPrices."); return ShopEconomyType.NormalPrices; } while (list.Count > 0) { int index = rng.Next(0, list.Count); ShopEconomyType shopEconomyType2 = list[index]; if (REPOBlackMarketManager.TryConsumeShopEconomyBlock(shopEconomyType2.ToString(), GetShopEconomyName(shopEconomyType2, "English"))) { REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Black market prevented shop economy: {shopEconomyType2}"); list.RemoveAt(index); continue; } return shopEconomyType2; } REPOConomyPlugin.Logger.LogWarning((object)"[ShopEconomy] All rolled shop economies were blocked, using NormalPrices."); return ShopEconomyType.NormalPrices; } private static float RangeFloat(Random rng, float min, float max) { return (float)((double)min + rng.NextDouble() * (double)(max - min)); } private static void ApplyShopEconomy(ShopEconomyType type, Random rng, bool trackInStats = true) { //IL_0e08: Unknown result type (might be due to invalid IL or missing references) REPOConomyPlugin.CurrentShopEconomy = type; REPOConomyPlugin.HasShopEconomy = true; float num = 1f; float shopUpgradeMultiplier = 1f; float shopHealthPackMultiplier = 1f; float shopConsumableMultiplier = 1f; switch (type) { case ShopEconomyType.BlackFriday: num = RangeFloat(rng, 0.5f, 0.7f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.ClearanceSale: num = RangeFloat(rng, 0.4f, 0.6f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.HappyHour: num = RangeFloat(rng, 0.6f, 0.8f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.Charity: shopHealthPackMultiplier = RangeFloat(rng, 0.3f, 0.5f); break; case ShopEconomyType.MemberDiscount: num = RangeFloat(rng, 0.75f, 0.85f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.FlashSale: num = RangeFloat(rng, 0.3f, 0.5f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.LoyaltyReward: shopUpgradeMultiplier = RangeFloat(rng, 0.5f, 0.7f); break; case ShopEconomyType.BulkDiscount: num = RangeFloat(rng, 0.7f, 0.85f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.SeasonalSale: num = RangeFloat(rng, 0.55f, 0.75f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.GrandOpening: num = RangeFloat(rng, 0.4f, 0.6f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.Inflation: num = RangeFloat(rng, 1.3f, 1.6f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.LuxuryTax: shopUpgradeMultiplier = RangeFloat(rng, 1.5f, 2f); break; case ShopEconomyType.Monopoly: num = RangeFloat(rng, 1.4f, 1.8f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.EconomicCrisis: num = RangeFloat(rng, 1.8f, 2.5f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.SupplyShortage: num = RangeFloat(rng, 1.3f, 1.5f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = RangeFloat(rng, 1.5f, 2f); shopConsumableMultiplier = num; break; case ShopEconomyType.ImportTax: num = RangeFloat(rng, 1.2f, 1.4f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.PremiumPricing: shopUpgradeMultiplier = RangeFloat(rng, 1.8f, 2.2f); shopConsumableMultiplier = RangeFloat(rng, 1.5f, 1.8f); break; case ShopEconomyType.DemandSurge: num = RangeFloat(rng, 1.4f, 1.7f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.MarketManipulation: num = RangeFloat(rng, 1.5f, 2f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.ScarcityPanic: num = RangeFloat(rng, 1.6f, 2.2f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.UpgradeDiscount: shopUpgradeMultiplier = RangeFloat(rng, 0.4f, 0.6f); break; case ShopEconomyType.HealthcareSubsidy: shopHealthPackMultiplier = RangeFloat(rng, 0.2f, 0.4f); break; case ShopEconomyType.CrystalCraze: shopConsumableMultiplier = RangeFloat(rng, 0.3f, 0.5f); break; case ShopEconomyType.UpgradeTax: shopUpgradeMultiplier = RangeFloat(rng, 1.8f, 2.5f); break; case ShopEconomyType.MedicalCrisis: shopHealthPackMultiplier = RangeFloat(rng, 2f, 3f); break; case ShopEconomyType.CrystalScarcity: shopConsumableMultiplier = RangeFloat(rng, 2f, 2.5f); break; case ShopEconomyType.WildMarket: num = RangeFloat(rng, 0.3f, 2.5f); shopUpgradeMultiplier = RangeFloat(rng, 0.3f, 2.5f); shopHealthPackMultiplier = RangeFloat(rng, 0.3f, 2.5f); shopConsumableMultiplier = RangeFloat(rng, 0.3f, 2.5f); break; case ShopEconomyType.InvertedPrices: shopUpgradeMultiplier = RangeFloat(rng, 0.4f, 0.6f); shopHealthPackMultiplier = RangeFloat(rng, 1.5f, 2f); shopConsumableMultiplier = RangeFloat(rng, 1.5f, 2f); break; case ShopEconomyType.GamblersDream: if (RangeFloat(rng, 0f, 1f) < 0.5f) { num = RangeFloat(rng, 0.2f, 0.5f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; } else { num = RangeFloat(rng, 1.5f, 2.5f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; } break; case ShopEconomyType.CouponStorm: num = RangeFloat(rng, 0.45f, 0.65f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.SupplierFestival: num = RangeFloat(rng, 0.6f, 0.8f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.TechRebate: shopUpgradeMultiplier = RangeFloat(rng, 0.35f, 0.55f); break; case ShopEconomyType.MedBayDonations: shopHealthPackMultiplier = RangeFloat(rng, 0.2f, 0.45f); break; case ShopEconomyType.CrystalOverflow: shopConsumableMultiplier = RangeFloat(rng, 0.25f, 0.5f); break; case ShopEconomyType.PawnshopDeals: num = RangeFloat(rng, 0.7f, 0.85f); shopUpgradeMultiplier = RangeFloat(rng, 0.8f, 0.95f); shopHealthPackMultiplier = RangeFloat(rng, 0.65f, 0.8f); shopConsumableMultiplier = RangeFloat(rng, 0.75f, 0.9f); break; case ShopEconomyType.SurplusCrates: shopHealthPackMultiplier = RangeFloat(rng, 0.55f, 0.75f); shopConsumableMultiplier = RangeFloat(rng, 0.55f, 0.75f); break; case ShopEconomyType.LoyaltyWeekend: num = RangeFloat(rng, 0.65f, 0.8f); shopUpgradeMultiplier = RangeFloat(rng, 0.55f, 0.75f); break; case ShopEconomyType.ContractorDiscount: shopUpgradeMultiplier = RangeFloat(rng, 0.5f, 0.7f); shopHealthPackMultiplier = RangeFloat(rng, 0.75f, 0.9f); shopConsumableMultiplier = RangeFloat(rng, 0.75f, 0.9f); break; case ShopEconomyType.VaultLiquidation: num = RangeFloat(rng, 0.4f, 0.6f); shopUpgradeMultiplier = RangeFloat(rng, 0.65f, 0.85f); shopHealthPackMultiplier = RangeFloat(rng, 0.5f, 0.7f); shopConsumableMultiplier = RangeFloat(rng, 0.5f, 0.7f); break; case ShopEconomyType.BureaucraticFees: num = RangeFloat(rng, 1.2f, 1.4f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.HyperInflation: num = RangeFloat(rng, 1.9f, 2.7f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.EnergySurcharge: num = RangeFloat(rng, 1.25f, 1.6f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = RangeFloat(rng, 1.35f, 1.8f); shopConsumableMultiplier = RangeFloat(rng, 1.35f, 1.8f); break; case ShopEconomyType.ContractorStrike: num = RangeFloat(rng, 1.15f, 1.35f); shopUpgradeMultiplier = RangeFloat(rng, 1.8f, 2.4f); break; case ShopEconomyType.LogisticMeltdown: num = RangeFloat(rng, 1.5f, 2.1f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = RangeFloat(rng, 1.7f, 2.4f); shopConsumableMultiplier = RangeFloat(rng, 1.7f, 2.4f); break; case ShopEconomyType.PatentLockdown: shopUpgradeMultiplier = RangeFloat(rng, 2.1f, 2.8f); shopConsumableMultiplier = RangeFloat(rng, 1.4f, 1.9f); break; case ShopEconomyType.InsuranceHike: num = RangeFloat(rng, 1.15f, 1.4f); shopHealthPackMultiplier = RangeFloat(rng, 2.2f, 3f); break; case ShopEconomyType.CounterfeitClampdown: num = RangeFloat(rng, 1.1f, 1.35f); shopConsumableMultiplier = RangeFloat(rng, 2.1f, 2.9f); break; case ShopEconomyType.SecurityTax: num = RangeFloat(rng, 1.35f, 1.75f); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.BlackoutTariff: num = RangeFloat(rng, 1.45f, 1.95f); shopUpgradeMultiplier = RangeFloat(rng, 1.25f, 1.55f); shopHealthPackMultiplier = RangeFloat(rng, 1.6f, 2.1f); shopConsumableMultiplier = RangeFloat(rng, 1.6f, 2.1f); break; case ShopEconomyType.SplitMarket: num = RangeFloat(rng, 0.8f, 1.2f); shopUpgradeMultiplier = RangeFloat(rng, 0.45f, 0.75f); shopHealthPackMultiplier = RangeFloat(rng, 1.4f, 1.9f); shopConsumableMultiplier = RangeFloat(rng, 1.4f, 1.9f); break; case ShopEconomyType.UpgradeBoom: num = RangeFloat(rng, 1.1f, 1.35f); shopUpgradeMultiplier = RangeFloat(rng, 0.3f, 0.5f); shopHealthPackMultiplier = RangeFloat(rng, 1.05f, 1.25f); shopConsumableMultiplier = RangeFloat(rng, 1.05f, 1.25f); break; case ShopEconomyType.FirstAidRush: num = RangeFloat(rng, 1.1f, 1.35f); shopUpgradeMultiplier = RangeFloat(rng, 1.05f, 1.25f); shopHealthPackMultiplier = RangeFloat(rng, 0.3f, 0.55f); shopConsumableMultiplier = RangeFloat(rng, 1.05f, 1.25f); break; case ShopEconomyType.CrystalSpeculation: shopConsumableMultiplier = ((!(RangeFloat(rng, 0f, 1f) < 0.5f)) ? RangeFloat(rng, 1.6f, 2.4f) : RangeFloat(rng, 0.35f, 0.65f)); break; case ShopEconomyType.PriceFreeze: num = RangeFloat(rng, 0.95f, 1.05f); shopUpgradeMultiplier = RangeFloat(rng, 0.95f, 1.05f); shopHealthPackMultiplier = RangeFloat(rng, 0.95f, 1.05f); shopConsumableMultiplier = RangeFloat(rng, 0.95f, 1.05f); break; case ShopEconomyType.PriceCascade: num = RangeFloat(rng, 0.6f, 1.8f); shopUpgradeMultiplier = RangeFloat(rng, 0.6f, 1.8f); shopHealthPackMultiplier = RangeFloat(rng, 0.6f, 1.8f); shopConsumableMultiplier = RangeFloat(rng, 0.6f, 1.8f); break; case ShopEconomyType.TightBudget: num = RangeFloat(rng, 0.85f, 1.05f); shopUpgradeMultiplier = RangeFloat(rng, 1.4f, 2f); shopHealthPackMultiplier = RangeFloat(rng, 1.4f, 2f); shopConsumableMultiplier = RangeFloat(rng, 1.4f, 2f); break; case ShopEconomyType.JackpotShop: num = ((!(RangeFloat(rng, 0f, 1f) < 0.35f)) ? RangeFloat(rng, 1.35f, 2.1f) : RangeFloat(rng, 0.35f, 0.65f)); shopUpgradeMultiplier = num; shopHealthPackMultiplier = num; shopConsumableMultiplier = num; break; case ShopEconomyType.ReverseAuction: num = RangeFloat(rng, 0.55f, 0.8f); shopUpgradeMultiplier = RangeFloat(rng, 1.3f, 1.8f); shopHealthPackMultiplier = RangeFloat(rng, 0.55f, 0.8f); shopConsumableMultiplier = RangeFloat(rng, 1.3f, 1.8f); break; case ShopEconomyType.ChaoticCoupons: num = ((RangeFloat(rng, 0f, 1f) < 0.5f) ? RangeFloat(rng, 0.45f, 0.8f) : RangeFloat(rng, 1.25f, 2f)); shopUpgradeMultiplier = ((RangeFloat(rng, 0f, 1f) < 0.5f) ? RangeFloat(rng, 0.45f, 0.8f) : RangeFloat(rng, 1.25f, 2f)); shopHealthPackMultiplier = ((RangeFloat(rng, 0f, 1f) < 0.5f) ? RangeFloat(rng, 0.45f, 0.8f) : RangeFloat(rng, 1.25f, 2f)); shopConsumableMultiplier = ((RangeFloat(rng, 0f, 1f) < 0.5f) ? RangeFloat(rng, 0.45f, 0.8f) : RangeFloat(rng, 1.25f, 2f)); break; case ShopEconomyType.CollectorsVaultSale: num = RangeFloat(rng, 0.72f, 0.88f); shopUpgradeMultiplier = RangeFloat(rng, 0.7f, 0.85f); shopHealthPackMultiplier = RangeFloat(rng, 0.85f, 1f); shopConsumableMultiplier = RangeFloat(rng, 0.75f, 0.9f); break; case ShopEconomyType.HazardPayMarket: num = RangeFloat(rng, 0.85f, 1f); shopUpgradeMultiplier = RangeFloat(rng, 0.95f, 1.1f); shopHealthPackMultiplier = RangeFloat(rng, 0.45f, 0.65f); shopConsumableMultiplier = RangeFloat(rng, 0.65f, 0.85f); break; case ShopEconomyType.AdrenalineClearance: num = RangeFloat(rng, 0.78f, 0.92f); shopUpgradeMultiplier = RangeFloat(rng, 0.55f, 0.72f); shopHealthPackMultiplier = RangeFloat(rng, 0.95f, 1.1f); shopConsumableMultiplier = RangeFloat(rng, 0.7f, 0.88f); break; case ShopEconomyType.BlackoutWholesale: num = RangeFloat(rng, 0.85f, 1f); shopUpgradeMultiplier = RangeFloat(rng, 0.95f, 1.15f); shopHealthPackMultiplier = RangeFloat(rng, 0.68f, 0.84f); shopConsumableMultiplier = RangeFloat(rng, 0.45f, 0.62f); break; case ShopEconomyType.DuplicateDiscount: num = RangeFloat(rng, 0.68f, 0.84f); shopUpgradeMultiplier = RangeFloat(rng, 0.78f, 0.92f); shopHealthPackMultiplier = RangeFloat(rng, 0.78f, 0.92f); shopConsumableMultiplier = RangeFloat(rng, 0.78f, 0.92f); break; case ShopEconomyType.PolarizedPricing: num = RangeFloat(rng, 0.95f, 1.15f); shopUpgradeMultiplier = RangeFloat(rng, 0.45f, 0.62f); shopHealthPackMultiplier = RangeFloat(rng, 1.2f, 1.45f); shopConsumableMultiplier = RangeFloat(rng, 0.62f, 0.78f); break; case ShopEconomyType.JudgementLiquidation: num = RangeFloat(rng, 0.55f, 0.72f); shopUpgradeMultiplier = RangeFloat(rng, 0.6f, 0.78f); shopHealthPackMultiplier = RangeFloat(rng, 1.05f, 1.3f); shopConsumableMultiplier = RangeFloat(rng, 1.05f, 1.3f); break; case ShopEconomyType.CenturionSupply: num = RangeFloat(rng, 0.48f, 0.68f); shopUpgradeMultiplier = RangeFloat(rng, 0.38f, 0.58f); shopHealthPackMultiplier = RangeFloat(rng, 0.58f, 0.78f); shopConsumableMultiplier = RangeFloat(rng, 0.52f, 0.72f); break; } REPOConomyPlugin.ShopPriceMultiplier = num; REPOConomyPlugin.ShopUpgradeMultiplier = shopUpgradeMultiplier; REPOConomyPlugin.ShopHealthPackMultiplier = shopHealthPackMultiplier; REPOConomyPlugin.ShopConsumableMultiplier = shopConsumableMultiplier; if (trackInStats) { REPOStatsManager.EnsureInstance()?.TrackShopEconomyOccurrence(type.ToString(), GetShopEconomyName(type, "English"), GetShopEconomyDescription(type, "English"), GetShopEconomyColor(type), REPOConomyPlugin.GetCurrentLevel()); } else { REPOConomyPlugin.Logger.LogInfo((object)$"[Stats] Skipped shop economy tracking for forced shop economy: {type}"); } } public static void ApplyChallengeShopEconomy(ShopEconomyType type, Random rng) { ApplyShopEconomy(type, rng); } public static string GetShopEconomyName(ShopEconomyType type, string lang) { bool flag = lang == "Russian"; bool flag2 = lang == "Korean"; return type switch { ShopEconomyType.NormalPrices => flag ? "Стандартные цены" : (flag2 ? "표준 가격" : "Normal Prices"), ShopEconomyType.BlackFriday => flag ? "Чёрная пятница" : (flag2 ? "블랙 프라이데이" : "Black Friday"), ShopEconomyType.ClearanceSale => flag ? "Распродажа" : (flag2 ? "클리어런스 세일" : "Clearance Sale"), ShopEconomyType.HappyHour => flag ? "Счастливый час" : (flag2 ? "해피 아워" : "Happy Hour"), ShopEconomyType.Charity => flag ? "Благотворительность" : (flag2 ? "자선 행사" : "Charity Event"), ShopEconomyType.MemberDiscount => flag ? "Скидка для участников" : (flag2 ? "회원 할인" : "Member Discount"), ShopEconomyType.FlashSale => flag ? "Молниеносная распродажа" : (flag2 ? "플래시 세일" : "Flash Sale"), ShopEconomyType.LoyaltyReward => flag ? "Награда лояльности" : (flag2 ? "충성도 보상" : "Loyalty Reward"), ShopEconomyType.BulkDiscount => flag ? "Оптовая скидка" : (flag2 ? "대량 할인" : "Bulk Discount"), ShopEconomyType.SeasonalSale => flag ? "Сезонная распродажа" : (flag2 ? "시즌 세일" : "Seasonal Sale"), ShopEconomyType.GrandOpening => flag ? "Грандиозное открытие" : (flag2 ? "그랜드 오프닝" : "Grand Opening"), ShopEconomyType.Inflation => flag ? "Инфляция" : (flag2 ? "인플레이션" : "Inflation"), ShopEconomyType.LuxuryTax => flag ? "Налог на роскошь" : (flag2 ? "사치세" : "Luxury Tax"), ShopEconomyType.Monopoly => flag ? "Монополия" : (flag2 ? "독점" : "Monopoly"), ShopEconomyType.EconomicCrisis => flag ? "Экономический кризис" : (flag2 ? "경제 위기" : "Economic Crisis"), ShopEconomyType.SupplyShortage => flag ? "Дефицит товаров" : (flag2 ? "공급 부족" : "Supply Shortage"), ShopEconomyType.ImportTax => flag ? "Импортный налог" : (flag2 ? "수입세" : "Import Tax"), ShopEconomyType.PremiumPricing => flag ? "Премиум-цены" : (flag2 ? "프리미엄 가격" : "Premium Pricing"), ShopEconomyType.DemandSurge => flag ? "Всплеск спроса" : (flag2 ? "수요 급증" : "Demand Surge"), ShopEconomyType.MarketManipulation => flag ? "Манипуляция рынком" : (flag2 ? "시장 조작" : "Market Manipulation"), ShopEconomyType.ScarcityPanic => flag ? "Паника дефицита" : (flag2 ? "부족 패닉" : "Scarcity Panic"), ShopEconomyType.UpgradeDiscount => flag ? "Скидка на апгрейды" : (flag2 ? "업그레이드 할인" : "Upgrade Discount"), ShopEconomyType.HealthcareSubsidy => flag ? "Субсидия на лечение" : (flag2 ? "의료 보조금" : "Healthcare Subsidy"), ShopEconomyType.CrystalCraze => flag ? "Кристальная лихорадка" : (flag2 ? "크리스탈 열풍" : "Crystal Craze"), ShopEconomyType.UpgradeTax => flag ? "Налог на апгрейды" : (flag2 ? "업그레이드 세금" : "Upgrade Tax"), ShopEconomyType.MedicalCrisis => flag ? "Медицинский кризис" : (flag2 ? "의료 위기" : "Medical Crisis"), ShopEconomyType.CrystalScarcity => flag ? "Дефицит кристаллов" : (flag2 ? "크리스탈 부족" : "Crystal Scarcity"), ShopEconomyType.WildMarket => flag ? "Дикий рынок" : (flag2 ? "와일드 마켓" : "Wild Market"), ShopEconomyType.InvertedPrices => flag ? "Перевёрнутые цены" : (flag2 ? "역전된 가격" : "Inverted Prices"), ShopEconomyType.GamblersDream => flag ? "Мечта игрока" : (flag2 ? "도박꾼의 꿈" : "Gambler's Dream"), ShopEconomyType.CouponStorm => flag ? "Шторм купонов" : (flag2 ? "쿠폰 스톰" : "Coupon Storm"), ShopEconomyType.SupplierFestival => flag ? "Фестиваль поставок" : (flag2 ? "공급 축제" : "Supplier Festival"), ShopEconomyType.TechRebate => flag ? "Тех-ребейт" : (flag2 ? "기술 리베이트" : "Tech Rebate"), ShopEconomyType.MedBayDonations => flag ? "Пожертвования медблоку" : (flag2 ? "메드베이 기부" : "MedBay Donations"), ShopEconomyType.CrystalOverflow => flag ? "Переизбыток кристаллов" : (flag2 ? "크리스탈 과잉" : "Crystal Overflow"), ShopEconomyType.PawnshopDeals => flag ? "Ломбардные сделки" : (flag2 ? "전당포 거래" : "Pawnshop Deals"), ShopEconomyType.SurplusCrates => flag ? "Избыточные ящики" : (flag2 ? "잉여 상자" : "Surplus Crates"), ShopEconomyType.LoyaltyWeekend => flag ? "Выходные лояльности" : (flag2 ? "충성도 주말" : "Loyalty Weekend"), ShopEconomyType.ContractorDiscount => flag ? "Скидка подрядчика" : (flag2 ? "계약자 할인" : "Contractor Discount"), ShopEconomyType.VaultLiquidation => flag ? "Ликвидация склада" : (flag2 ? "금고 정리 세일" : "Vault Liquidation"), ShopEconomyType.BureaucraticFees => flag ? "Бюрократические сборы" : (flag2 ? "관료적 수수료" : "Bureaucratic Fees"), ShopEconomyType.HyperInflation => flag ? "Гиперинфляция" : (flag2 ? "하이퍼 인플레이션" : "Hyper Inflation"), ShopEconomyType.EnergySurcharge => flag ? "Энергетическая надбавка" : (flag2 ? "에너지 할증" : "Energy Surcharge"), ShopEconomyType.ContractorStrike => flag ? "Забастовка подрядчиков" : (flag2 ? "계약자 파업" : "Contractor Strike"), ShopEconomyType.LogisticMeltdown => flag ? "Логистический коллапс" : (flag2 ? "물류 붕괴" : "Logistic Meltdown"), ShopEconomyType.PatentLockdown => flag ? "Патентная блокада" : (flag2 ? "특허 봉쇄" : "Patent Lockdown"), ShopEconomyType.InsuranceHike => flag ? "Рост страховых тарифов" : (flag2 ? "보험료 폭등" : "Insurance Hike"), ShopEconomyType.CounterfeitClampdown => flag ? "Борьба с подделками" : (flag2 ? "위조 단속" : "Counterfeit Clampdown"), ShopEconomyType.SecurityTax => flag ? "Налог безопасности" : (flag2 ? "보안세" : "Security Tax"), ShopEconomyType.BlackoutTariff => flag ? "Тариф отключений" : (flag2 ? "정전 관세" : "Blackout Tariff"), ShopEconomyType.SplitMarket => flag ? "Разделённый рынок" : (flag2 ? "분할 시장" : "Split Market"), ShopEconomyType.UpgradeBoom => flag ? "Бум апгрейдов" : (flag2 ? "업그레이드 붐" : "Upgrade Boom"), ShopEconomyType.FirstAidRush => flag ? "Ажиотаж первой помощи" : (flag2 ? "응급처치 러시" : "First Aid Rush"), ShopEconomyType.CrystalSpeculation => flag ? "Кристальная спекуляция" : (flag2 ? "크리스탈 투기" : "Crystal Speculation"), ShopEconomyType.PriceFreeze => flag ? "Заморозка цен" : (flag2 ? "가격 동결" : "Price Freeze"), ShopEconomyType.PriceCascade => flag ? "Каскад цен" : (flag2 ? "가격 캐스케이드" : "Price Cascade"), ShopEconomyType.TightBudget => flag ? "Жёсткий бюджет" : (flag2 ? "긴축 예산" : "Tight Budget"), ShopEconomyType.JackpotShop => flag ? "Джекпот-магазин" : (flag2 ? "잭팟 상점" : "Jackpot Shop"), ShopEconomyType.ReverseAuction => flag ? "Обратный аукцион" : (flag2 ? "역경매" : "Reverse Auction"), ShopEconomyType.ChaoticCoupons => flag ? "Хаотичные купоны" : (flag2 ? "혼돈 쿠폰" : "Chaotic Coupons"), ShopEconomyType.CollectorsVaultSale => "Collector's Vault Sale", ShopEconomyType.HazardPayMarket => "Hazard Pay Market", ShopEconomyType.AdrenalineClearance => "Adrenaline Clearance", ShopEconomyType.BlackoutWholesale => "Blackout Wholesale", ShopEconomyType.DuplicateDiscount => "Duplicate Discount", ShopEconomyType.PolarizedPricing => "Polarized Pricing", ShopEconomyType.JudgementLiquidation => "Judgement Liquidation", ShopEconomyType.CenturionSupply => "Centurion Supply", _ => type.ToString(), }; } public static string GetShopEconomyDescription(ShopEconomyType type, string lang) { bool flag = lang == "Russian"; bool flag2 = lang == "Korean"; return type switch { ShopEconomyType.NormalPrices => flag ? "Цены без изменений." : (flag2 ? "가격 변동 없음." : "Prices unchanged."), ShopEconomyType.BlackFriday => flag ? "Огромные скидки на всё!" : (flag2 ? "모든 것에 큰 할인!" : "Huge discounts on everything!"), ShopEconomyType.ClearanceSale => flag ? "Всё должно уйти! Максимальные скидки!" : (flag2 ? "모든 것이 사라져야 합니다!" : "Everything must go! Maximum discounts!"), ShopEconomyType.HappyHour => flag ? "Приятные скидки на всё!" : (flag2 ? "모든 것에 좋은 할인!" : "Nice discounts on everything!"), ShopEconomyType.Charity => flag ? "Аптечки почти бесплатно!" : (flag2 ? "건강 팩 거의 무료!" : "Health packs almost free!"), ShopEconomyType.MemberDiscount => flag ? "Скидка для постоянных клиентов." : (flag2 ? "단골 고객 할인." : "Discount for regular customers."), ShopEconomyType.FlashSale => flag ? "Срочная распродажа! Скидки огромны!" : (flag2 ? "긴급 판매! 엄청난 할인!" : "Urgent sale! Discounts are huge!"), ShopEconomyType.LoyaltyReward => flag ? "Апгрейды со скидкой!" : (flag2 ? "업그레이드 할인!" : "Upgrades discounted!"), ShopEconomyType.BulkDiscount => flag ? "Скидки за объём!" : (flag2 ? "대량 할인!" : "Volume discounts!"), ShopEconomyType.SeasonalSale => flag ? "Сезонные скидки!" : (flag2 ? "시즌 할인!" : "Seasonal discounts!"), ShopEconomyType.GrandOpening => flag ? "Праздничное открытие! Всё дёшево!" : (flag2 ? "축제 오프닝! 모든 것이 저렴!" : "Celebration opening! Everything cheap!"), ShopEconomyType.Inflation => flag ? "Цены выросли..." : (flag2 ? "가격이 올랐습니다..." : "Prices have risen..."), ShopEconomyType.LuxuryTax => flag ? "Апгрейды стоят дороже!" : (flag2 ? "업그레이드가 더 비쌉니다!" : "Upgrades cost more!"), ShopEconomyType.Monopoly => flag ? "Один поставщик — высокие цены!" : (flag2 ? "독점 공급자 - 높은 가격!" : "One supplier - high prices!"), ShopEconomyType.EconomicCrisis => flag ? "Кризис! Всё очень дорого!" : (flag2 ? "위기! 모든 것이 매우 비쌉니다!" : "Crisis! Everything very expensive!"), ShopEconomyType.SupplyShortage => flag ? "Дефицит товаров, особенно аптечек!" : (flag2 ? "공급 부족, 특히 건강 팩!" : "Supply shortage, especially health packs!"), ShopEconomyType.ImportTax => flag ? "Налог на импорт всех товаров." : (flag2 ? "모든 상품에 수입세." : "Import tax on all goods."), ShopEconomyType.PremiumPricing => flag ? "Премиум-товары по премиум-ценам!" : (flag2 ? "프리미엄 상품, 프리미엄 가격!" : "Premium goods at premium prices!"), ShopEconomyType.DemandSurge => flag ? "Высокий спрос — высокие цены!" : (flag2 ? "높은 수요 - 높은 가격!" : "High demand - high prices!"), ShopEconomyType.MarketManipulation => flag ? "Цены искусственно завышены!" : (flag2 ? "가격이 인위적으로 부풀려짐!" : "Prices artificially inflated!"), ShopEconomyType.ScarcityPanic => flag ? "Паника! Все скупают!" : (flag2 ? "패닉! 모두가 사재기!" : "Panic! Everyone hoarding!"), ShopEconomyType.UpgradeDiscount => flag ? "Только апгрейды со скидкой!" : (flag2 ? "업그레이드만 할인!" : "Only upgrades discounted!"), ShopEconomyType.HealthcareSubsidy => flag ? "Субсидия на медикаменты!" : (flag2 ? "의료 보조금!" : "Medical subsidies!"), ShopEconomyType.CrystalCraze => flag ? "Кристаллы почти бесплатно!" : (flag2 ? "크리스탈 거의 무료!" : "Crystals almost free!"), ShopEconomyType.UpgradeTax => flag ? "Налог на улучшения!" : (flag2 ? "업그레이드 세금!" : "Tax on upgrades!"), ShopEconomyType.MedicalCrisis => flag ? "Аптечки очень дороги!" : (flag2 ? "건강 팩 매우 비쌉니다!" : "Health packs very expensive!"), ShopEconomyType.CrystalScarcity => flag ? "Кристаллы в дефиците!" : (flag2 ? "크리스탈 부족!" : "Crystals in shortage!"), ShopEconomyType.WildMarket => flag ? "Цены абсолютно случайны!" : (flag2 ? "완전히 무작위 가격!" : "Prices completely random!"), ShopEconomyType.InvertedPrices => flag ? "Апгрейды дёшевы, остальное дорого!" : (flag2 ? "업그레이드 저렴, 나머지 비쌈!" : "Upgrades cheap, rest expensive!"), ShopEconomyType.GamblersDream => flag ? "50/50: или скидка, или наценка!" : (flag2 ? "50/50: 할인 또는 추가 요금!" : "50/50: discount or markup!"), ShopEconomyType.CouponStorm => flag ? "Купоны повсюду: большие скидки на всё." : (flag2 ? "쿠폰 폭풍: 전 품목 대폭 할인." : "Coupons everywhere: deep discounts across the board."), ShopEconomyType.SupplierFestival => flag ? "Поставщики соревнуются, цены падают." : (flag2 ? "공급업체 경쟁으로 가격 하락." : "Suppliers compete, pushing prices down."), ShopEconomyType.TechRebate => flag ? "Апгрейды получили крупный ребейт." : (flag2 ? "업그레이드 대규모 리베이트." : "Major rebate on upgrades."), ShopEconomyType.MedBayDonations => flag ? "Медблок получил пожертвования: аптечки дешевле." : (flag2 ? "메드베이 기부로 치료품 할인." : "MedBay donations make healing items much cheaper."), ShopEconomyType.CrystalOverflow => flag ? "Кристаллов слишком много, цены обвалились." : (flag2 ? "크리스탈 과잉 공급." : "Crystal oversupply crashes their prices."), ShopEconomyType.PawnshopDeals => flag ? "Ломбардные сделки: выгодно, но не идеально." : (flag2 ? "전당포 특가: 전반적 할인." : "Pawnshop-style deals lower most prices."), ShopEconomyType.SurplusCrates => flag ? "Избыток расходников: лечение и кристаллы дешевле." : (flag2 ? "소모품 과잉: 치료/크리스탈 할인." : "Consumable surplus lowers health and crystal costs."), ShopEconomyType.LoyaltyWeekend => flag ? "Выходные лояльности: скидки и бонусы на апгрейды." : (flag2 ? "충성 고객 주말 세일." : "Loyalty weekend discounts, especially on upgrades."), ShopEconomyType.ContractorDiscount => flag ? "Подрядчики сбили цену на улучшения." : (flag2 ? "계약자 할인으로 업그레이드 저렴." : "Contractors slash upgrade prices."), ShopEconomyType.VaultLiquidation => flag ? "Склад распродают: много дешёвых позиций." : (flag2 ? "창고 정리: 대규모 세일." : "Warehouse liquidation drops many prices hard."), ShopEconomyType.BureaucraticFees => flag ? "Дополнительные сборы подняли все цены." : (flag2 ? "행정 수수료로 전반적 인상." : "Administrative fees increase all prices."), ShopEconomyType.HyperInflation => flag ? "Гиперинфляция: всё резко подорожало." : (flag2 ? "하이퍼 인플레이션으로 폭등." : "Hyper inflation sends prices through the roof."), ShopEconomyType.EnergySurcharge => flag ? "Энергосбор: расходники особенно дорогие." : (flag2 ? "에너지 할증으로 소모품 급등." : "Energy surcharge hits consumables the hardest."), ShopEconomyType.ContractorStrike => flag ? "Забастовка подрядчиков: апгрейды дорогие." : (flag2 ? "파업으로 업그레이드 가격 상승." : "Contractor strike makes upgrades expensive."), ShopEconomyType.LogisticMeltdown => flag ? "Логистика сломана: поставки в кризисе." : (flag2 ? "물류 붕괴로 공급 위기." : "Logistics collapse causes severe markups."), ShopEconomyType.PatentLockdown => flag ? "Патентная блокада: технологии и кристаллы дороже." : (flag2 ? "특허 봉쇄로 기술/크리스탈 인상." : "Patent lockdown inflates tech and crystal prices."), ShopEconomyType.InsuranceHike => flag ? "Страховка выросла: лечение сильно дороже." : (flag2 ? "보험료 인상으로 치료비 급등." : "Insurance hike makes health items very expensive."), ShopEconomyType.CounterfeitClampdown => flag ? "Борьба с подделками: кристаллы дорожают." : (flag2 ? "위조 단속으로 크리스탈 인상." : "Counterfeit crackdown spikes crystal costs."), ShopEconomyType.SecurityTax => flag ? "Налог безопасности поднял цены магазина." : (flag2 ? "보안세로 전 품목 인상." : "Security tax adds markup to nearly everything."), ShopEconomyType.BlackoutTariff => flag ? "Тариф отключений: база и расходники дороже." : (flag2 ? "정전 관세로 기본/소모품 인상." : "Blackout tariff raises base and consumable costs."), ShopEconomyType.SplitMarket => flag ? "Рынок разделился: апгрейды дешевле, расходники дороже." : (flag2 ? "분할 시장: 업글↓ 소모품↑." : "Split market: upgrades cheaper, consumables pricier."), ShopEconomyType.UpgradeBoom => flag ? "Бум апгрейдов: улучшения дешёвые, остальное дороже." : (flag2 ? "업그레이드 붐: 업글 할인, 기타 인상." : "Upgrade boom discounts upgrades while other items climb."), ShopEconomyType.FirstAidRush => flag ? "Ажиотаж помощи: лечение дешёвое, остальное дороже." : (flag2 ? "응급품 러시: 치료 할인, 기타 인상." : "First aid rush discounts health items, others increase."), ShopEconomyType.CrystalSpeculation => flag ? "Спекуляция кристаллами: или скидка, или взлёт." : (flag2 ? "크리스탈 투기: 폭락 혹은 폭등." : "Crystal speculation can crash or spike crystal prices."), ShopEconomyType.PriceFreeze => flag ? "Цены почти заморожены около нормы." : (flag2 ? "가격이 기준 근처로 고정." : "Prices are nearly frozen around normal."), ShopEconomyType.PriceCascade => flag ? "Каскад цен: всё меняется в широком диапазоне." : (flag2 ? "가격 폭포: 넓은 변동폭." : "Price cascade creates broad randomized swings."), ShopEconomyType.TightBudget => flag ? "Жёсткий бюджет: база норм, спецтовары дорогие." : (flag2 ? "긴축 예산: 기본 유지, 특수품 비쌈." : "Tight budget keeps base near normal but inflates specialties."), ShopEconomyType.JackpotShop => flag ? "Джекпот-магазин: редкая суперскидка или жёсткая наценка." : (flag2 ? "잭팟 상점: 대할인 또는 대폭 인상." : "Jackpot shop: rare huge discount, otherwise heavy markup."), ShopEconomyType.ReverseAuction => flag ? "Обратный аукцион: часть категорий дешевеет, часть дорожает." : (flag2 ? "역경매: 일부 할인, 일부 인상." : "Reverse auction flips discounts and markups by category."), ShopEconomyType.ChaoticCoupons => flag ? "Хаотичные купоны: каждая категория живёт по своим правилам." : (flag2 ? "혼돈 쿠폰: 카테고리별 랜덤 할인/인상." : "Chaotic coupons randomize each category independently."), ShopEconomyType.CollectorsVaultSale => "Challenge reward: stable discounts on loot-supporting gear and upgrades.", ShopEconomyType.HazardPayMarket => "Challenge reward: survival supplies are heavily subsidized after pit contracts.", ShopEconomyType.AdrenalineClearance => "Challenge reward: upgrades and consumables drop in price for fast runs.", ShopEconomyType.BlackoutWholesale => "Challenge reward: crystals and supplies are cheap during blackout logistics.", ShopEconomyType.DuplicateDiscount => "Challenge reward: broad clone-market discounts across most categories.", ShopEconomyType.PolarizedPricing => "Challenge reward: upgrades and crystals get cheap while healing costs more.", ShopEconomyType.JudgementLiquidation => "Challenge reward: final-invoice liquidation cuts base and upgrade prices.", ShopEconomyType.CenturionSupply => "Level 100 reward: prestige supply contracts heavily discount every shop category.", _ => "", }; } public static Color GetShopEconomyColor(ShopEconomyType type) { //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_0144: Unknown result type (might be due to invalid IL or missing references) //IL_0149: 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_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0219: 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_0233: Unknown result type (might be due to invalid IL or missing references) //IL_0248: 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_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0296: Unknown result type (might be due to invalid IL or missing references) //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02b5: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0332: Unknown result type (might be due to invalid IL or missing references) //IL_0337: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0380: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_03b4: Unknown result type (might be due to invalid IL or missing references) //IL_03b9: 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_03d3: 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_0402: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_041c: Unknown result type (might be due to invalid IL or missing references) //IL_0421: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_043b: Unknown result type (might be due to invalid IL or missing references) //IL_0450: Unknown result type (might be due to invalid IL or missing references) //IL_0455: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0484: Unknown result type (might be due to invalid IL or missing references) //IL_0489: Unknown result type (might be due to invalid IL or missing references) //IL_049e: Unknown result type (might be due to invalid IL or missing references) //IL_04a3: Unknown result type (might be due to invalid IL or missing references) //IL_04b8: Unknown result type (might be due to invalid IL or missing references) //IL_04bd: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_04d7: Unknown result type (might be due to invalid IL or missing references) //IL_04ec: Unknown result type (might be due to invalid IL or missing references) //IL_04f1: Unknown result type (might be due to invalid IL or missing references) //IL_0506: Unknown result type (might be due to invalid IL or missing references) //IL_050b: Unknown result type (might be due to invalid IL or missing references) //IL_0520: Unknown result type (might be due to invalid IL or missing references) //IL_0525: Unknown result type (might be due to invalid IL or missing references) //IL_053a: Unknown result type (might be due to invalid IL or missing references) //IL_053f: Unknown result type (might be due to invalid IL or missing references) //IL_0554: Unknown result type (might be due to invalid IL or missing references) //IL_0559: Unknown result type (might be due to invalid IL or missing references) //IL_056e: Unknown result type (might be due to invalid IL or missing references) //IL_0573: Unknown result type (might be due to invalid IL or missing references) //IL_0588: Unknown result type (might be due to invalid IL or missing references) //IL_058d: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_05bc: Unknown result type (might be due to invalid IL or missing references) //IL_05c1: Unknown result type (might be due to invalid IL or missing references) //IL_05d6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) //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_060a: Unknown result type (might be due to invalid IL or missing references) //IL_060f: 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_0629: Unknown result type (might be due to invalid IL or missing references) //IL_063e: Unknown result type (might be due to invalid IL or missing references) //IL_0643: Unknown result type (might be due to invalid IL or missing references) //IL_0658: Unknown result type (might be due to invalid IL or missing references) //IL_065d: Unknown result type (might be due to invalid IL or missing references) //IL_0672: Unknown result type (might be due to invalid IL or missing references) //IL_0677: Unknown result type (might be due to invalid IL or missing references) //IL_068c: Unknown result type (might be due to invalid IL or missing references) //IL_0691: Unknown result type (might be due to invalid IL or missing references) //IL_06a6: Unknown result type (might be due to invalid IL or missing references) //IL_06ab: Unknown result type (might be due to invalid IL or missing references) //IL_06c0: Unknown result type (might be due to invalid IL or missing references) //IL_06c5: Unknown result type (might be due to invalid IL or missing references) //IL_06da: Unknown result type (might be due to invalid IL or missing references) //IL_06df: Unknown result type (might be due to invalid IL or missing references) //IL_06f4: Unknown result type (might be due to invalid IL or missing references) //IL_06f9: Unknown result type (might be due to invalid IL or missing references) //IL_070e: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Unknown result type (might be due to invalid IL or missing references) //IL_0728: Unknown result type (might be due to invalid IL or missing references) //IL_072d: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Unknown result type (might be due to invalid IL or missing references) //IL_0747: Unknown result type (might be due to invalid IL or missing references) //IL_075c: Unknown result type (might be due to invalid IL or missing references) //IL_0761: Unknown result type (might be due to invalid IL or missing references) //IL_0776: Unknown result type (might be due to invalid IL or missing references) //IL_077b: Unknown result type (might be due to invalid IL or missing references) //IL_078d: Unknown result type (might be due to invalid IL or missing references) //IL_0792: Unknown result type (might be due to invalid IL or missing references) //IL_07a4: Unknown result type (might be due to invalid IL or missing references) //IL_07a9: Unknown result type (might be due to invalid IL or missing references) //IL_07bb: Unknown result type (might be due to invalid IL or missing references) //IL_07c0: Unknown result type (might be due to invalid IL or missing references) //IL_07d2: Unknown result type (might be due to invalid IL or missing references) //IL_07d7: Unknown result type (might be due to invalid IL or missing references) //IL_07e9: Unknown result type (might be due to invalid IL or missing references) //IL_07ee: Unknown result type (might be due to invalid IL or missing references) //IL_07f7: Unknown result type (might be due to invalid IL or missing references) //IL_07f1: Unknown result type (might be due to invalid IL or missing references) //IL_07f6: Unknown result type (might be due to invalid IL or missing references) return (Color)(type switch { ShopEconomyType.NormalPrices => new Color(0.7f, 0.7f, 0.7f), ShopEconomyType.BlackFriday => new Color(0.1f, 0.1f, 0.1f), ShopEconomyType.ClearanceSale => new Color(0.2f, 0.8f, 0.2f), ShopEconomyType.HappyHour => new Color(1f, 0.84f, 0f), ShopEconomyType.Charity => new Color(1f, 0.4f, 0.7f), ShopEconomyType.MemberDiscount => new Color(0.3f, 0.7f, 1f), ShopEconomyType.FlashSale => new Color(1f, 0.5f, 0f), ShopEconomyType.LoyaltyReward => new Color(0.6f, 0.3f, 0.9f), ShopEconomyType.BulkDiscount => new Color(0.4f, 0.8f, 0.4f), ShopEconomyType.SeasonalSale => new Color(0.5f, 0.9f, 0.5f), ShopEconomyType.GrandOpening => new Color(1f, 0.8f, 0.2f), ShopEconomyType.Inflation => new Color(0.9f, 0.4f, 0.1f), ShopEconomyType.LuxuryTax => new Color(0.8f, 0.6f, 0.2f), ShopEconomyType.Monopoly => new Color(0.5f, 0.1f, 0.1f), ShopEconomyType.EconomicCrisis => new Color(0.8f, 0.1f, 0.1f), ShopEconomyType.SupplyShortage => new Color(0.7f, 0.3f, 0.1f), ShopEconomyType.ImportTax => new Color(0.6f, 0.4f, 0.2f), ShopEconomyType.PremiumPricing => new Color(0.9f, 0.7f, 0.1f), ShopEconomyType.DemandSurge => new Color(0.9f, 0.5f, 0.2f), ShopEconomyType.MarketManipulation => new Color(0.6f, 0.1f, 0.3f), ShopEconomyType.ScarcityPanic => new Color(0.7f, 0.2f, 0.2f), ShopEconomyType.UpgradeDiscount => new Color(0.3f, 0.9f, 0.6f), ShopEconomyType.HealthcareSubsidy => new Color(0.2f, 0.8f, 0.9f), ShopEconomyType.CrystalCraze => new Color(0.8f, 0.3f, 1f), ShopEconomyType.UpgradeTax => new Color(0.9f, 0.4f, 0.4f), ShopEconomyType.MedicalCrisis => new Color(0.9f, 0.2f, 0.4f), ShopEconomyType.CrystalScarcity => new Color(0.6f, 0.2f, 0.8f), ShopEconomyType.WildMarket => new Color(0.9f, 0.1f, 0.9f), ShopEconomyType.InvertedPrices => new Color(0.2f, 0.6f, 0.9f), ShopEconomyType.GamblersDream => new Color(1f, 0.85f, 0f), ShopEconomyType.CouponStorm => new Color(0.2f, 0.9f, 0.7f), ShopEconomyType.SupplierFestival => new Color(0.3f, 0.8f, 0.5f), ShopEconomyType.TechRebate => new Color(0.2f, 0.7f, 1f), ShopEconomyType.MedBayDonations => new Color(0.25f, 0.85f, 0.95f), ShopEconomyType.CrystalOverflow => new Color(0.75f, 0.45f, 1f), ShopEconomyType.PawnshopDeals => new Color(0.6f, 0.75f, 0.45f), ShopEconomyType.SurplusCrates => new Color(0.45f, 0.9f, 0.65f), ShopEconomyType.LoyaltyWeekend => new Color(0.4f, 0.75f, 1f), ShopEconomyType.ContractorDiscount => new Color(0.35f, 0.85f, 0.8f), ShopEconomyType.VaultLiquidation => new Color(0.2f, 1f, 0.55f), ShopEconomyType.BureaucraticFees => new Color(0.8f, 0.55f, 0.35f), ShopEconomyType.HyperInflation => new Color(1f, 0.15f, 0.1f), ShopEconomyType.EnergySurcharge => new Color(0.95f, 0.45f, 0.1f), ShopEconomyType.ContractorStrike => new Color(0.85f, 0.3f, 0.25f), ShopEconomyType.LogisticMeltdown => new Color(0.9f, 0.25f, 0.15f), ShopEconomyType.PatentLockdown => new Color(0.75f, 0.2f, 0.45f), ShopEconomyType.InsuranceHike => new Color(0.95f, 0.25f, 0.45f), ShopEconomyType.CounterfeitClampdown => new Color(0.7f, 0.2f, 0.7f), ShopEconomyType.SecurityTax => new Color(0.8f, 0.3f, 0.3f), ShopEconomyType.BlackoutTariff => new Color(0.55f, 0.15f, 0.1f), ShopEconomyType.SplitMarket => new Color(0.95f, 0.75f, 0.25f), ShopEconomyType.UpgradeBoom => new Color(0.2f, 0.95f, 0.55f), ShopEconomyType.FirstAidRush => new Color(0.3f, 0.95f, 0.85f), ShopEconomyType.CrystalSpeculation => new Color(0.7f, 0.35f, 1f), ShopEconomyType.PriceFreeze => new Color(0.65f, 0.8f, 1f), ShopEconomyType.PriceCascade => new Color(1f, 0.45f, 0.75f), ShopEconomyType.TightBudget => new Color(0.95f, 0.65f, 0.3f), ShopEconomyType.JackpotShop => new Color(1f, 0.82f, 0.1f), ShopEconomyType.ReverseAuction => new Color(0.35f, 0.65f, 0.95f), ShopEconomyType.ChaoticCoupons => new Color(0.95f, 0.25f, 0.95f), ShopEconomyType.CollectorsVaultSale => new Color(1f, 0.78f, 0.22f), ShopEconomyType.HazardPayMarket => new Color(0.7f, 0.45f, 1f), ShopEconomyType.AdrenalineClearance => new Color(0.25f, 0.9f, 1f), ShopEconomyType.BlackoutWholesale => new Color(0.35f, 0.36f, 0.46f), ShopEconomyType.DuplicateDiscount => new Color(0.35f, 1f, 0.55f), ShopEconomyType.PolarizedPricing => new Color(0.95f, 0.35f, 0.85f), ShopEconomyType.JudgementLiquidation => new Color(1f, 0.25f, 0.18f), ShopEconomyType.CenturionSupply => new Color(1f, 0.84f, 0.18f), _ => Color.white, }); } public static string GetPriceModifierText(string lang) { bool flag = lang == "Russian"; bool flag2 = lang == "Korean"; List list = new List(); if (Math.Abs(REPOConomyPlugin.ShopPriceMultiplier - 1f) > 0.01f) { string text = (flag ? "Базовые: " : (flag2 ? "기본: " : "Base: ")); list.Add(text + FormatMultiplier(REPOConomyPlugin.ShopPriceMultiplier)); } if (Math.Abs(REPOConomyPlugin.ShopUpgradeMultiplier - REPOConomyPlugin.ShopPriceMultiplier) > 0.01f) { string text2 = (flag ? "Апгрейды: " : (flag2 ? "업그레이드: " : "Upgrades: ")); list.Add(text2 + FormatMultiplier(REPOConomyPlugin.ShopUpgradeMultiplier)); } if (Math.Abs(REPOConomyPlugin.ShopHealthPackMultiplier - REPOConomyPlugin.ShopPriceMultiplier) > 0.01f) { string text3 = (flag ? "Аптечки: " : (flag2 ? "건강 팩: " : "Health: ")); list.Add(text3 + FormatMultiplier(REPOConomyPlugin.ShopHealthPackMultiplier)); } if (Math.Abs(REPOConomyPlugin.ShopConsumableMultiplier - REPOConomyPlugin.ShopPriceMultiplier) > 0.01f) { string text4 = (flag ? "Кристаллы: " : (flag2 ? "크리스탈: " : "Crystals: ")); list.Add(text4 + FormatMultiplier(REPOConomyPlugin.ShopConsumableMultiplier)); } if (list.Count == 0) { return FormatMultiplier(REPOConomyPlugin.ShopPriceMultiplier); } return string.Join(", ", list); } private static string FormatMultiplier(float mult) { if (mult < 1f) { int num = Mathf.RoundToInt((1f - mult) * 100f); return $"-{num}%"; } if (mult > 1f) { int num2 = Mathf.RoundToInt((mult - 1f) * 100f); return $"+{num2}%"; } return "0%"; } } public static class ShopManagerSeededPatches { [HarmonyPatch(typeof(ShopManager), "ShopInitialize")] public static class Patch_ShopInitialize { [HarmonyPrefix] public static void Prefix() { REPOSeedManager.ReloadFromConfigIfNeeded(); ShopEconomyManager.ResetShopEconomy(); EconomyController.ShopEconomyUIShownOnce = false; EconomyController.BlackMarketHintShownOnce = false; REPOSeedManager.ResetShopRandom(); } } [HarmonyPatch(typeof(ShopManager), "Update")] public static class Patch_ShopManager_Update { [HarmonyPostfix] public static void Postfix() { REPOBlackMarketManager.TickHotkeyFromGame(); } } [HarmonyPatch(typeof(RunManager), "ChangeLevel")] public static class Patch_RunManager_ChangeLevel_BlackMarket { [HarmonyPrefix] public static void Prefix(bool _completedLevel, bool _levelFailed, ChangeLevelType _changeLevelType, out ChangeLevelSeedState __state) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Invalid comparison between Unknown and I4 //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Invalid comparison between Unknown and I4 __state = new ChangeLevelSeedState { RandomState = Random.state, RestoreRandomState = false }; if (ShouldSeedShopLevel(_completedLevel, _levelFailed, _changeLevelType)) { int num = REPOSeedManager.ShopNext(); Random.InitState(num); __state.RestoreRandomState = true; REPOConomyPlugin.Logger.LogInfo((object)$"[ShopSeed] Seeded shop level selection: {num}"); } if (_completedLevel && SemiFunc.RunIsLevel()) { REPOBlackMarketManager.CommitConsumedBlocksAfterLevelCompleted(); return; } if (!_completedLevel && !SemiFunc.RunIsShop()) { REPOBlackMarketManager.DiscardUncommittedConsumedBlocks(); } if (SemiFunc.RunIsShop() && (int)_changeLevelType == 0) { REPOBlackMarketManager.CommitShopPurchasesForRunStart(); } else if (!_completedLevel && ((int)_changeLevelType == 4 || (int)_changeLevelType == 3)) { REPOBlackMarketManager.DiscardUncommittedRunChanges(); } } [HarmonyPostfix] public static void Postfix(ChangeLevelSeedState __state) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (__state.RestoreRandomState) { Random.state = __state.RandomState; } } } [HarmonyPatch(typeof(StatsManager), "SaveFileDelete")] public static class Patch_StatsManager_SaveFileDelete_BlackMarket { [HarmonyPrefix] public static void Prefix(string saveFileName) { try { REPOBlackMarketManager.DeleteForSaveAndReset(saveFileName, "vanilla save deleted"); } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[BlackMarket] Save reset hook failed: " + ex.Message)); } } } [HarmonyPatch(typeof(ShopManager), "UpgradeValueGet")] public static class Patch_UpgradeValueGet { [HarmonyPostfix] public static void Postfix(ref float __result) { if (REPOConomyPlugin.HasShopEconomy) { __result *= REPOConomyPlugin.ShopUpgradeMultiplier; } } } [HarmonyPatch(typeof(ShopManager), "HealthPackValueGet")] public static class Patch_HealthPackValueGet { [HarmonyPostfix] public static void Postfix(ref float __result) { if (REPOConomyPlugin.HasShopEconomy) { __result *= REPOConomyPlugin.ShopHealthPackMultiplier; } } } [HarmonyPatch(typeof(ShopManager), "CrystalValueGet")] public static class Patch_CrystalValueGet { [HarmonyPostfix] public static void Postfix(ref float __result) { if (REPOConomyPlugin.HasShopEconomy) { __result *= REPOConomyPlugin.ShopConsumableMultiplier; } } } [HarmonyPatch(typeof(ItemAttributes), "GetValue")] public static class Patch_ItemAttributes_GetValue { [HarmonyPrefix] public static void Prefix(ItemAttributes __instance, out ChangeLevelSeedState __state) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) __state = new ChangeLevelSeedState { RandomState = Random.state, RestoreRandomState = false }; if (SemiFunc.RunIsShop() && !((Object)(object)__instance == (Object)null) && !((Object)(object)__instance.item == (Object)null)) { Random.InitState(GetDeterministicShopItemValueSeed(__instance)); __state.RestoreRandomState = true; } } [HarmonyPostfix] public static void Postfix(ItemAttributes __instance, ChangeLevelSeedState __state) { //IL_0009: 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_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Invalid comparison between Unknown and I4 //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Invalid comparison between Unknown and I4 //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Invalid comparison between Unknown and I4 if (__state.RestoreRandomState) { Random.state = __state.RandomState; } if (!REPOConomyPlugin.HasShopEconomy || !SemiFunc.RunIsShop()) { return; } FieldInfo fieldInfo = AccessTools.Field(typeof(ItemAttributes), "shopItem"); FieldInfo fieldInfo2 = AccessTools.Field(typeof(ItemAttributes), "value"); FieldInfo fieldInfo3 = AccessTools.Field(typeof(ItemAttributes), "itemName"); if (!(bool)fieldInfo.GetValue(__instance)) { return; } Item item = __instance.item; if (!((Object)(object)item == (Object)null)) { itemType itemType = item.itemType; if ((int)itemType != 3 && (int)itemType != 8 && (int)itemType != 5) { int num = (int)fieldInfo2.GetValue(__instance); int num2 = (int)Mathf.Ceil((float)num * REPOConomyPlugin.ShopPriceMultiplier); fieldInfo2.SetValue(__instance, num2); string text = (string)fieldInfo3.GetValue(__instance); REPOConomyPlugin.Logger.LogInfo((object)$"[ShopEconomy] Item '{text}' price: {num} -> {num2} (x{REPOConomyPlugin.ShopPriceMultiplier:F2})"); } } } } [HarmonyPatch(typeof(ShopManager), "GetAllItemsFromStatsManager")] public static class Patch_GetAllItemsFromStatsManager { [HarmonyPrefix] public static bool Prefix(ShopManager __instance) { //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0212: Invalid comparison between Unknown and I4 //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Invalid comparison between Unknown and I4 //IL_0263: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Invalid comparison between Unknown and I4 //IL_0307: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Invalid comparison between Unknown and I4 //IL_031b: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Invalid comparison between Unknown and I4 //IL_032f: Unknown result type (might be due to invalid IL or missing references) //IL_0335: Invalid comparison between Unknown and I4 //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) int num = REPOSeedManager.ShopNext(); Random.InitState(num); PocketCartPlusCompat.ReseedRandom(num); if (REPOConfig.EnableShopEconomy.Value && SemiFunc.IsMasterClientOrSingleplayer() && !ShopEconomyManager.ShopEconomyInitialized) { ShopEconomyManager.InitializeShopEconomy(); REPOConomyNetworkHandler.SyncShopEconomyToClients(); REPOConomyPlugin.Logger.LogInfo((object)($"[ShopEconomy] Initialized: {REPOConomyPlugin.CurrentShopEconomy} " + $"(Base: x{REPOConomyPlugin.ShopPriceMultiplier:F2}, " + $"Upgrades: x{REPOConomyPlugin.ShopUpgradeMultiplier:F2}, " + $"Health: x{REPOConomyPlugin.ShopHealthPackMultiplier:F2}, " + $"Crystals: x{REPOConomyPlugin.ShopConsumableMultiplier:F2})")); } if (SemiFunc.IsNotMasterClient()) { return false; } List field = GetField>(__instance, "potentialItems"); List field2 = GetField>(__instance, "potentialItemConsumables"); List field3 = GetField>(__instance, "potentialItemUpgrades"); List field4 = GetField>(__instance, "potentialItemHealthPacks"); Dictionary> field5 = GetField>>(__instance, "potentialSecretItems"); float field6 = GetField(__instance, "itemValueMultiplier"); int field7 = GetField(__instance, "totalCurrency"); field.Clear(); field2.Clear(); field3.Clear(); field4.Clear(); field5.Clear(); int num2 = Random.Range(4, 6); SetField(__instance, "itemConsumablesAmount", num2); Item[] array = MoreUpgradesCompat.FilterDisabledItems(ItemBundlesCompat.GetShopItems().Values).ToArray(); Array.Sort(array, (Item a, Item b) => string.Compare(((Object)a).name, ((Object)b).name, StringComparison.Ordinal)); bool flag = REPOConfig.UseCustomSeed.Value && !REPOConfig.RandomizeSeedEachLevel.Value; if (flag) { REPOConomyPlugin.Logger.LogInfo((object)"[ShopItems] Deterministic mode: ignoring money check"); } Item[] array2 = array; foreach (Item val in array2) { int num3 = SemiFunc.StatGetItemsPurchased(((Object)val).name); float itemPriceMultiplier = MoreUpgradesCompat.GetItemPriceMultiplier(val, field6); float num4 = val.value.valueMax / 1000f * itemPriceMultiplier; if ((int)val.itemType == 3) { num4 = CallMethod(__instance, "UpgradeValueGet", new object[2] { num4, val }); } else if ((int)val.itemType == 8) { num4 = CallMethod(__instance, "HealthPackValueGet", new object[1] { num4 }); } else if ((int)val.itemType == 5) { num4 = CallMethod(__instance, "CrystalValueGet", new object[1] { num4 }); } else if (REPOConomyPlugin.HasShopEconomy) { num4 *= REPOConomyPlugin.ShopPriceMultiplier; } float num5 = Mathf.Clamp(num4, 1f, num4); int maxAmountInShop = val.maxAmountInShop; if (num3 >= maxAmountInShop || (val.maxPurchase && StatsManager.instance.GetItemsUpgradesPurchasedTotal(((Object)val).name) >= val.maxPurchaseAmount) || (!flag && !(num5 <= (float)field7) && Random.Range(0, 100) >= 25)) { continue; } for (int j = 0; j < maxAmountInShop - num3; j++) { if ((int)val.itemType == 3) { field3.Add(val); continue; } if ((int)val.itemType == 8) { field4.Add(val); continue; } if ((int)val.itemType == 5) { field2.Add(val); continue; } if ((int)val.itemSecretShopType == 0) { field.Add(val); continue; } if (!field5.ContainsKey(val.itemSecretShopType)) { field5.Add(val.itemSecretShopType, new List()); } field5[val.itemSecretShopType].Add(val); } } ListExtension.Shuffle((IList)field); ListExtension.Shuffle((IList)field2); ListExtension.Shuffle((IList)field3); ListExtension.Shuffle((IList)field4); foreach (List value in field5.Values) { ListExtension.Shuffle((IList)value); } return false; } } [HarmonyPatch(typeof(ShopManager), "GetAllItemVolumesInScene")] public static class Patch_GetAllItemVolumesInScene { [HarmonyPrefix] public static bool Prefix(ShopManager __instance) { //IL_006f: 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_00a4: 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) int num = REPOSeedManager.ShopNext(); Random.InitState(num); PocketCartPlusCompat.ReseedRandom(num); if (SemiFunc.IsNotMasterClient()) { return false; } List field = GetField>(__instance, "itemVolumes"); Dictionary> field2 = GetField>>(__instance, "secretItemVolumes"); field.Clear(); field2.Clear(); ItemVolume[] array = Object.FindObjectsOfType(); Array.Sort(array, CompareItemVolumesDeterministically); ItemVolume[] array2 = array; foreach (ItemVolume val in array2) { if ((int)val.itemSecretShopType == 0) { field.Add(val); continue; } if (!field2.ContainsKey(val.itemSecretShopType)) { field2.Add(val.itemSecretShopType, new List()); } field2[val.itemSecretShopType].Add(val); } ListExtension.Shuffle((IList)field); foreach (List value in field2.Values) { ListExtension.Shuffle((IList)value); } return false; } } [HarmonyPatch(typeof(UpgradeStand), "StatePressSucceed")] public static class Patch_UpgradeStand_StatePressSucceed { [HarmonyPrefix] public static void Prefix(UpgradeStand __instance, out ChangeLevelSeedState __state) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) __state = new ChangeLevelSeedState { RandomState = Random.state, RestoreRandomState = false }; if (UpgradeStandStateStartField == null || (bool)UpgradeStandStateStartField.GetValue(__instance)) { Random.InitState(REPOSeedManager.ShopNext()); __state.RestoreRandomState = true; } } [HarmonyPostfix] public static void Postfix(ChangeLevelSeedState __state) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) if (__state.RestoreRandomState) { Random.state = __state.RandomState; } } } [HarmonyPatch(typeof(UpgradeStand), "CacheAndDestroyUpgrades")] public static class Patch_UpgradeStand_CacheAndDestroyUpgrades { [HarmonyPostfix] public static void Postfix(UpgradeStand __instance) { SortUpgradeStandCache(__instance); } } [HarmonyPatch(typeof(UpgradeStand), "SpawnNewUpgrades")] public static class Patch_UpgradeStand_SpawnNewUpgrades { [HarmonyPrefix] public static void Prefix(UpgradeStand __instance) { SortUpgradeStandCache(__instance); } } [HarmonyPatch(typeof(UpgradeStand), "GetWeightedUpgradeExcluding")] public static class Patch_UpgradeStand_GetWeightedUpgradeExcluding { [HarmonyPrefix] public static bool Prefix(Item excludeItem, Dictionary displayedCounts, Dictionary selectedDuringReroll, ref Item __result) { __result = GetDeterministicWeightedUpgrade(excludeItem, displayedCounts, selectedDuringReroll); return false; } } public struct ChangeLevelSeedState { public State RandomState; public bool RestoreRandomState; } private static readonly FieldInfo UpgradeStandStateStartField = AccessTools.Field(typeof(UpgradeStand), "stateStart"); private static readonly FieldInfo UpgradeStandCachedUpgradesField = AccessTools.Field(typeof(UpgradeStand), "cachedUpgrades"); private static bool ShouldSeedShopLevel(bool completedLevel, bool levelFailed, ChangeLevelType changeLevelType) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Invalid comparison between Unknown and I4 if (levelFailed || (Object)(object)RunManager.instance == (Object)null) { return false; } if ((int)changeLevelType == 5) { return true; } if (completedLevel) { return SemiFunc.RunIsLevel(); } return false; } private static int CompareItemVolumesDeterministically(ItemVolume a, ItemVolume b) { //IL_0023: 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_004f: Unknown result type (might be due to invalid IL or missing references) if (a == b) { return 0; } if ((Object)(object)a == (Object)null) { return -1; } if ((Object)(object)b == (Object)null) { return 1; } int num = ((Enum)(itemSecretShopType)(ref a.itemSecretShopType)).CompareTo((object?)b.itemSecretShopType); if (num != 0) { return num; } int num2 = CompareVector(((Component)a).transform.position, ((Component)b).transform.position); if (num2 != 0) { return num2; } return string.Compare(GetHierarchyPath(((Component)a).transform), GetHierarchyPath(((Component)b).transform), StringComparison.Ordinal); } private static int CompareVector(Vector3 a, Vector3 b) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) int num = a.x.CompareTo(b.x); if (num != 0) { return num; } num = a.y.CompareTo(b.y); if (num != 0) { return num; } return a.z.CompareTo(b.z); } private static string GetHierarchyPath(Transform transform) { if ((Object)(object)transform == (Object)null) { return string.Empty; } Stack stack = new Stack(); while ((Object)(object)transform != (Object)null) { stack.Push(((Object)transform).name); transform = transform.parent; } return string.Join("/", stack.ToArray()); } private static void SortUpgradeStandCache(UpgradeStand stand) { if (!(UpgradeStandCachedUpgradesField?.GetValue(stand) is IList list) || list.Count <= 1) { return; } List list2 = (from object entry in list orderby Quantize(GetCachedUpgradeLocalPosition(stand, entry).x), Quantize(GetCachedUpgradeLocalPosition(stand, entry).y), Quantize(GetCachedUpgradeLocalPosition(stand, entry).z) select entry).ThenBy(GetCachedUpgradeItemName, StringComparer.Ordinal).ToList(); list.Clear(); foreach (object item in list2) { list.Add(item); } } private static Vector3 GetCachedUpgradePosition(object cachedUpgrade) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) if (cachedUpgrade == null) { return Vector3.zero; } FieldInfo fieldInfo = AccessTools.Field(cachedUpgrade.GetType(), "position"); if (!(fieldInfo != null)) { return Vector3.zero; } return (Vector3)fieldInfo.GetValue(cachedUpgrade); } private static Vector3 GetCachedUpgradeLocalPosition(UpgradeStand stand, object cachedUpgrade) { //IL_0001: 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_0018: 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_0010: Unknown result type (might be due to invalid IL or missing references) Vector3 cachedUpgradePosition = GetCachedUpgradePosition(cachedUpgrade); if (!((Object)(object)stand != (Object)null)) { return cachedUpgradePosition; } return ((Component)stand).transform.InverseTransformPoint(cachedUpgradePosition); } private static string GetCachedUpgradeItemName(object cachedUpgrade) { if (cachedUpgrade == null) { return string.Empty; } object? obj = AccessTools.Field(cachedUpgrade.GetType(), "itemData")?.GetValue(cachedUpgrade); Item val = (Item)((obj is Item) ? obj : null); if (!((Object)(object)val != (Object)null)) { return string.Empty; } return ((Object)val).name; } private static int GetDeterministicShopItemValueSeed(ItemAttributes attributes) { //IL_0028: 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_009f: 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_00c5: Unknown result type (might be due to invalid IL or missing references) string text = (((Object)(object)attributes.item != (Object)null) ? ((Object)attributes.item).name : ((Object)attributes).name); Vector3 shopRelativePosition = GetShopRelativePosition(((Component)attributes).transform); return StableHash(string.Join("|", REPOSeedManager.CurrentSeed, ((Object)(object)RunManager.instance != (Object)null) ? RunManager.instance.levelsCompleted.ToString() : "0", ((Object)(object)RunManager.instance?.levelCurrent != (Object)null) ? ((Object)RunManager.instance.levelCurrent).name : "NoLevel", text, Quantize(shopRelativePosition.x), Quantize(shopRelativePosition.y), Quantize(shopRelativePosition.z))); } private static Vector3 GetShopRelativePosition(Transform transform) { //IL_0009: 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_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) if ((Object)(object)transform == (Object)null) { return Vector3.zero; } UpgradeStand componentInParent = ((Component)transform).GetComponentInParent(); if ((Object)(object)componentInParent != (Object)null) { return ((Component)componentInParent).transform.InverseTransformPoint(transform.position); } return transform.position; } private static int Quantize(float value) { return Mathf.RoundToInt(value * 1000f); } private static int StableHash(string value) { int num = 23; for (int i = 0; i < value.Length; i++) { num = num * 31 + value[i]; } return num; } private static Item GetDeterministicWeightedUpgrade(Item excludeItem, Dictionary displayedCounts, Dictionary selectedDuringReroll) { //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0025: 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_00ae: Invalid comparison between Unknown and I4 if ((Object)(object)StatsManager.instance == (Object)null || StatsManager.instance.itemDictionary == null) { return null; } int num = REPOSeedManager.ShopNext(); State state = Random.state; Random.InitState(num); try { List list = new List(); int num2 = SemiFunc.StatGetRunCurrency(); foreach (Item item in StatsManager.instance.itemDictionary.Values.Where((Item item) => (Object)(object)item != (Object)null).OrderBy((Item item) => ((Object)item).name, StringComparer.Ordinal)) { if ((int)item.itemType == 3 && !((Object)(object)item == (Object)(object)excludeItem)) { string name = ((Object)item).name; int itemsUpgradesPurchased = StatsManager.instance.GetItemsUpgradesPurchased(name); int num3 = ((displayedCounts != null && displayedCounts.ContainsKey(name)) ? displayedCounts[name] : 0); int num4 = ((selectedDuringReroll != null && selectedDuringReroll.ContainsKey(name)) ? selectedDuringReroll[name] : 0); int num5 = itemsUpgradesPurchased + num3 + num4; bool num6 = item.maxAmountInShop <= 0 || num5 < item.maxAmountInShop; bool flag = !item.maxPurchase || StatsManager.instance.GetItemsUpgradesPurchasedTotal(name) < item.maxPurchaseAmount; bool flag2 = item.minPlayerCount <= 1 || GameDirector.instance.PlayerList.Count >= item.minPlayerCount; bool flag3 = (Object)(object)ShopManager.instance == (Object)null || ShopManager.instance.UpgradeValueGet(item.value.valueMax / 1000f * 4f, item) <= (float)num2 || Random.Range(0, 4) == 0; if (num6 && flag && flag2 && flag3) { list.Add(item); } } } if (list.Count == 0) { return null; } return list[Random.Range(0, list.Count)]; } finally { Random.state = state; } } private static T GetField(object instance, string fieldName) { return (T)AccessTools.Field(instance.GetType(), fieldName).GetValue(instance); } private static void SetField(object instance, string fieldName, object value) { AccessTools.Field(instance.GetType(), fieldName).SetValue(instance, value); } private static T CallMethod(object instance, string methodName, params object[] parameters) { return (T)AccessTools.Method(instance.GetType(), methodName, (Type[])null, (Type[])null).Invoke(instance, parameters); } } [HarmonyPatch(typeof(TruckScreenText))] public static class TruckScreenTextSeededPatch { [HarmonyPatch("NextLine")] [HarmonyPrefix] public static void NextLinePrefix() { Random.InitState(REPOSeedManager.TruckNext()); } } public static class UILocalization { public static string Get(string key) { string value = REPOConfig.UILanguage.Value; return key switch { "UI_Event" => (value == "Korean") ? "경제" : ((!(value == "Russian")) ? "Economy" : "Экономика"), "UI_Range" => (value == "Korean") ? "범위" : ((!(value == "Russian")) ? "Range" : "Диапазон"), "UI_Level" => (value == "Korean") ? "레벨" : ((!(value == "Russian")) ? "Level" : "Уровень"), _ => key, }; } } public static class ReflectionHelper { private static FieldInfo _jumpExtraField; private static FieldInfo _maxHealthField; private static FieldInfo _healthField; private static FieldInfo _playerOriginalSprintSpeedField; private static FieldInfo _upgradeTumbleClimbField; private static FieldInfo _upgradeDeathHeadBatteryField; private static FieldInfo _upgradeCrouchRestField; private static FieldInfo _upgradeTumbleWingsField; private static FieldInfo _tumbleLaunchField; private static FieldInfo _playerAvatarTumbleField; private static FieldInfo _valuableDirectorSetupCompleteField; public static int GetJumpExtra(PlayerController controller) { if (_jumpExtraField == null) { _jumpExtraField = typeof(PlayerController).GetField("JumpExtra", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)_jumpExtraField?.GetValue(controller); } public static void SetJumpExtra(PlayerController controller, int value) { if (_jumpExtraField == null) { _jumpExtraField = typeof(PlayerController).GetField("JumpExtra", BindingFlags.Instance | BindingFlags.NonPublic); } _jumpExtraField?.SetValue(controller, value); } public static int GetMaxHealth(PlayerHealth playerHealth) { if (_maxHealthField == null) { _maxHealthField = typeof(PlayerHealth).GetField("maxHealth", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)_maxHealthField?.GetValue(playerHealth); } public static void SetMaxHealth(PlayerHealth playerHealth, int value) { if (_maxHealthField == null) { _maxHealthField = typeof(PlayerHealth).GetField("maxHealth", BindingFlags.Instance | BindingFlags.NonPublic); } _maxHealthField?.SetValue(playerHealth, value); } public static int GetHealth(PlayerHealth playerHealth) { if (_healthField == null) { _healthField = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)(_healthField?.GetValue(playerHealth) ?? ((object)0)); } public static void SetHealth(PlayerHealth playerHealth, int value) { if (_healthField == null) { _healthField = typeof(PlayerHealth).GetField("health", BindingFlags.Instance | BindingFlags.NonPublic); } _healthField?.SetValue(playerHealth, value); } public static float GetPlayerOriginalSprintSpeed(PlayerController controller) { if (_playerOriginalSprintSpeedField == null) { _playerOriginalSprintSpeedField = typeof(PlayerController).GetField("playerOriginalSprintSpeed", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_playerOriginalSprintSpeedField?.GetValue(controller); } public static void SetPlayerOriginalSprintSpeed(PlayerController controller, float value) { if (_playerOriginalSprintSpeedField == null) { _playerOriginalSprintSpeedField = typeof(PlayerController).GetField("playerOriginalSprintSpeed", BindingFlags.Instance | BindingFlags.NonPublic); } _playerOriginalSprintSpeedField?.SetValue(controller, value); } public static float GetUpgradeTumbleClimb(PlayerAvatar avatar) { if (_upgradeTumbleClimbField == null) { _upgradeTumbleClimbField = typeof(PlayerAvatar).GetField("upgradeTumbleClimb", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeTumbleClimbField?.GetValue(avatar); } public static void SetUpgradeTumbleClimb(PlayerAvatar avatar, float value) { if (_upgradeTumbleClimbField == null) { _upgradeTumbleClimbField = typeof(PlayerAvatar).GetField("upgradeTumbleClimb", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeTumbleClimbField?.SetValue(avatar, value); } public static float GetUpgradeDeathHeadBattery(PlayerAvatar avatar) { if (_upgradeDeathHeadBatteryField == null) { _upgradeDeathHeadBatteryField = typeof(PlayerAvatar).GetField("upgradeDeathHeadBattery", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeDeathHeadBatteryField?.GetValue(avatar); } public static void SetUpgradeDeathHeadBattery(PlayerAvatar avatar, float value) { if (_upgradeDeathHeadBatteryField == null) { _upgradeDeathHeadBatteryField = typeof(PlayerAvatar).GetField("upgradeDeathHeadBattery", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeDeathHeadBatteryField?.SetValue(avatar, value); } public static float GetUpgradeCrouchRest(PlayerAvatar avatar) { if (_upgradeCrouchRestField == null) { _upgradeCrouchRestField = typeof(PlayerAvatar).GetField("upgradeCrouchRest", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeCrouchRestField?.GetValue(avatar); } public static void SetUpgradeCrouchRest(PlayerAvatar avatar, float value) { if (_upgradeCrouchRestField == null) { _upgradeCrouchRestField = typeof(PlayerAvatar).GetField("upgradeCrouchRest", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeCrouchRestField?.SetValue(avatar, value); } public static float GetUpgradeTumbleWings(PlayerAvatar avatar) { if (_upgradeTumbleWingsField == null) { _upgradeTumbleWingsField = typeof(PlayerAvatar).GetField("upgradeTumbleWings", BindingFlags.Instance | BindingFlags.NonPublic); } return (float)_upgradeTumbleWingsField?.GetValue(avatar); } public static void SetUpgradeTumbleWings(PlayerAvatar avatar, float value) { if (_upgradeTumbleWingsField == null) { _upgradeTumbleWingsField = typeof(PlayerAvatar).GetField("upgradeTumbleWings", BindingFlags.Instance | BindingFlags.NonPublic); } _upgradeTumbleWingsField?.SetValue(avatar, value); } public static int GetTumbleLaunch(PlayerTumble tumble) { if (_tumbleLaunchField == null) { _tumbleLaunchField = typeof(PlayerTumble).GetField("tumbleLaunch", BindingFlags.Instance | BindingFlags.NonPublic); } return (int)_tumbleLaunchField?.GetValue(tumble); } public static void SetTumbleLaunch(PlayerTumble tumble, int value) { if (_tumbleLaunchField == null) { _tumbleLaunchField = typeof(PlayerTumble).GetField("tumbleLaunch", BindingFlags.Instance | BindingFlags.NonPublic); } _tumbleLaunchField?.SetValue(tumble, value); } public static PlayerTumble GetPlayerTumble(PlayerAvatar playerAvatar) { if ((Object)(object)playerAvatar == (Object)null) { return null; } if (_playerAvatarTumbleField == null) { _playerAvatarTumbleField = typeof(PlayerAvatar).GetField("tumble", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } object? obj = _playerAvatarTumbleField?.GetValue(playerAvatar); return (PlayerTumble)((obj is PlayerTumble) ? obj : null); } public static void SetValuableDirectorSetupComplete(ValuableDirector valuableDirector, bool value) { if (!((Object)(object)valuableDirector == (Object)null)) { if (_valuableDirectorSetupCompleteField == null) { _valuableDirectorSetupCompleteField = typeof(ValuableDirector).GetField("setupComplete", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } _valuableDirectorSetupCompleteField?.SetValue(valuableDirector, value); } } } [HarmonyPatch(typeof(PunManager), "UpdateExtraJumpRightAway")] public class ExtraJumpPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f && (Object)(object)SemiFunc.PlayerAvatarGetFromSteamID(_steamID) == (Object)(object)SemiFunc.PlayerAvatarLocal()) { int num = (StatsManager.instance.playerUpgradeExtraJump.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeExtraJump[_steamID] : 0); int num2 = Mathf.FloorToInt((float)num * REPOConfig.GlobalUpgradesMultiplier.Value); int num3 = Mathf.FloorToInt((float)(num + value) * REPOConfig.GlobalUpgradesMultiplier.Value); int num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Extra Jump upgrade for {_steamID}: current level {num}, adding {value} levels, current total {num2}, new total {num3}, difference +{num4} jumps (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); int num5 = value; int jumpExtra = ReflectionHelper.GetJumpExtra(PlayerController.instance); ReflectionHelper.SetJumpExtra(PlayerController.instance, jumpExtra - num5 + num4); } } } [HarmonyPatch(typeof(PunManager), "UpdateHealthRightAway")] public class HealthPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value == 1f) { return; } PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val != (Object)null) { int num = (StatsManager.instance.playerUpgradeHealth.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeHealth[_steamID] : 0); float num2 = (float)num * 20f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 20f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Health upgrade for {_steamID}: current level {num}, adding {value} levels, difference +{num3} HP (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); float num4 = 20f * (float)value; int maxHealth = ReflectionHelper.GetMaxHealth(val.playerHealth); ReflectionHelper.SetMaxHealth(val.playerHealth, (int)((float)maxHealth - num4 + num3)); if ((Object)(object)val == (Object)(object)SemiFunc.PlayerAvatarLocal() && value >= 0) { val.playerHealth.Heal((int)(num3 - num4), false); } } } } [HarmonyPatch(typeof(PunManager), "UpdateEnergyRightAway")] public class StaminaPunPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f && (Object)(object)SemiFunc.PlayerAvatarGetFromSteamID(_steamID) == (Object)(object)SemiFunc.PlayerAvatarLocal()) { int num = (StatsManager.instance.playerUpgradeStamina.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeStamina[_steamID] : 0); float num2 = (float)num * 10f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 10f * REPOConfig.GlobalUpgradesMultiplier.Value; float num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Stamina upgrade for {_steamID}: current level {num}, adding {value} levels, current total {num2}, new total {num3}, difference +{num4} energy (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PlayerController.instance.EnergyStart = PlayerController.instance.EnergyStart - 10f * (float)value + num4; PlayerController.instance.EnergyCurrent = PlayerController.instance.EnergyStart; } } } [HarmonyPatch(typeof(PunManager), "UpdateSprintSpeedRightAway")] public class SpeedPunPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f && (Object)(object)SemiFunc.PlayerAvatarGetFromSteamID(_steamID) == (Object)(object)SemiFunc.PlayerAvatarLocal()) { int num = (StatsManager.instance.playerUpgradeSpeed.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeSpeed[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Speed upgrade for {_steamID}: current level {num}, adding {value} levels, difference +{num3} speed (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); float num4 = value; PlayerController.instance.SprintSpeed = PlayerController.instance.SprintSpeed - num4 + num3; PlayerController.instance.SprintSpeedUpgrades = PlayerController.instance.SprintSpeedUpgrades - num4 + num3; float playerOriginalSprintSpeed = ReflectionHelper.GetPlayerOriginalSprintSpeed(PlayerController.instance); ReflectionHelper.SetPlayerOriginalSprintSpeed(PlayerController.instance, playerOriginalSprintSpeed - num4 + num3); } } } [HarmonyPatch(typeof(PhysGrabber), "LateStart")] public class PhysGrabberPatch { [CompilerGenerated] private sealed class d__0 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public IEnumerator original; public PhysGrabber __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__0(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; break; case 1: <>1__state = -1; break; } if (original.MoveNext()) { <>2__current = original.Current; <>1__state = 1; return true; } if (!SemiFunc.RunIsLevel() && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsLobby()) { return false; } if ((Object)(object)__instance.playerAvatar != (Object)null) { string text = SemiFunc.PlayerGetSteamID(__instance.playerAvatar); if (StatsManager.instance.playerUpgradeStrength.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeStrength[text]; float num2 = (float)num * 0.2f; float num3 = (float)num * 0.2f * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); float num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Grab Strength for {text}: original bonus +{num2} strength, modified bonus +{num3} strength (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PhysGrabber _instance = __instance; _instance.grabStrength += num4; } if (StatsManager.instance.playerUpgradeThrow.ContainsKey(text)) { int num5 = StatsManager.instance.playerUpgradeThrow[text]; float num6 = (float)num5 * 0.3f; float num7 = (float)num5 * 0.3f * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); float num8 = num7 - num6; Debug.Log((object)$"[REPOConomyPlus] Throw Strength for {text}: original bonus +{num6} strength, modified bonus +{num7} strength (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PhysGrabber _instance2 = __instance; _instance2.throwStrength += num8; } if (StatsManager.instance.playerUpgradeRange.ContainsKey(text)) { int num9 = StatsManager.instance.playerUpgradeRange[text]; float num10 = (float)num9 * 1f; float num11 = (float)num9 * 1f * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f); float num12 = num11 - num10; Debug.Log((object)$"[REPOConomyPlus] Grab Range for {text}: original bonus +{num10} range, modified bonus +{num11} range (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); PhysGrabber _instance3 = __instance; _instance3.grabRange += num12; } } return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [IteratorStateMachine(typeof(d__0))] private static IEnumerator Postfix(IEnumerator original, PhysGrabber __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__0(0) { original = original, __instance = __instance }; } } [HarmonyPatch(typeof(PunManager), "UpdateGrabStrengthRightAway")] public class GrabStrengthPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val?.physGrabber != (Object)null) { int num = (StatsManager.instance.playerUpgradeStrength.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeStrength[_steamID] : 0); float num2 = (float)num * 0.2f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 0.2f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Grab Strength upgrade for {_steamID}: difference +{num3}"); float num4 = 0.2f * (float)value; val.physGrabber.grabStrength = val.physGrabber.grabStrength - num4 + num3; } } } } [HarmonyPatch(typeof(PunManager), "UpdateThrowStrengthRightAway")] public class ThrowStrengthPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val?.physGrabber != (Object)null) { int num = (StatsManager.instance.playerUpgradeThrow.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeThrow[_steamID] : 0); float num2 = (float)num * 0.3f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 0.3f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Throw Strength upgrade for {_steamID}: difference +{num3}"); float num4 = 0.3f * (float)value; val.physGrabber.throwStrength = val.physGrabber.throwStrength - num4 + num3; } } } } [HarmonyPatch(typeof(PunManager), "UpdateGrabRangeRightAway")] public class GrabRangePatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val?.physGrabber != (Object)null) { int num = (StatsManager.instance.playerUpgradeRange.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeRange[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Grab Range upgrade for {_steamID}: difference +{num3}"); float num4 = value; val.physGrabber.grabRange = val.physGrabber.grabRange - num4 + num3; } } } } [HarmonyPatch(typeof(PlayerTumble), "SetupDone")] public class PlayerTumblePatch { private static void Postfix(PlayerTumble __instance) { if ((SemiFunc.RunIsLevel() || SemiFunc.RunIsArena() || SemiFunc.RunIsShop() || SemiFunc.RunIsLobby()) && (Object)(object)__instance.playerAvatar != (Object)null) { string text = SemiFunc.PlayerGetSteamID(__instance.playerAvatar); if (StatsManager.instance.playerUpgradeLaunch.ContainsKey(text)) { int num = StatsManager.instance.playerUpgradeLaunch[text]; int num2 = Mathf.FloorToInt((float)num * REPOConfig.GlobalUpgradesMultiplier.Value * (REPOEventManager.TripledUpgrades ? 3f : 1f)); Debug.Log((object)$"[REPOConomyPlus] Tumble Launch for {text}: upgrade level {num}, original value {num}, modified value {num2} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); ReflectionHelper.SetTumbleLaunch(__instance, num2); } } } } [HarmonyPatch(typeof(PunManager), "UpdateTumbleLaunchRightAway")] public class TumbleLaunchPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerTumble playerTumble = ReflectionHelper.GetPlayerTumble(SemiFunc.PlayerAvatarGetFromSteamID(_steamID)); if ((Object)(object)playerTumble != (Object)null) { int num = (StatsManager.instance.playerUpgradeLaunch.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeLaunch[_steamID] : 0); int num2 = Mathf.FloorToInt((float)num * REPOConfig.GlobalUpgradesMultiplier.Value); int num3 = Mathf.FloorToInt((float)(num + value) * REPOConfig.GlobalUpgradesMultiplier.Value); int num4 = num3 - num2; Debug.Log((object)$"[REPOConomyPlus] Tumble Launch upgrade for {_steamID}: current level {num}, adding {value} levels, current total {num2}, new total {num3}, difference +{num4} (multiplier {REPOConfig.GlobalUpgradesMultiplier.Value})"); int num5 = value; int tumbleLaunch = ReflectionHelper.GetTumbleLaunch(playerTumble); ReflectionHelper.SetTumbleLaunch(playerTumble, tumbleLaunch - num5 + num4); } } } } [HarmonyPatch(typeof(PunManager), "UpdateTumbleClimbRightAway")] public class TumbleClimbPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val != (Object)null) { int num = (StatsManager.instance.playerUpgradeTumbleClimb.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeTumbleClimb[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Tumble Climb upgrade for {_steamID}: difference +{num3}"); float num4 = value; float upgradeTumbleClimb = ReflectionHelper.GetUpgradeTumbleClimb(val); ReflectionHelper.SetUpgradeTumbleClimb(val, upgradeTumbleClimb - num4 + num3); } } } } [HarmonyPatch(typeof(PunManager), "UpdateTumbleWingsRightAway")] public class TumbleWingsPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val != (Object)null) { int num = (StatsManager.instance.playerUpgradeTumbleWings.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeTumbleWings[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Tumble Wings upgrade for {_steamID}: difference +{num3}"); float num4 = value; float upgradeTumbleWings = ReflectionHelper.GetUpgradeTumbleWings(val); ReflectionHelper.SetUpgradeTumbleWings(val, upgradeTumbleWings - num4 + num3); } } } } [HarmonyPatch(typeof(PunManager), "UpdateDeathHeadBatteryRightAway")] public class DeathHeadBatteryPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val != (Object)null) { int num = (StatsManager.instance.playerUpgradeDeathHeadBattery.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeDeathHeadBattery[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Death Head Battery upgrade for {_steamID}: difference +{num3}"); float num4 = value; float upgradeDeathHeadBattery = ReflectionHelper.GetUpgradeDeathHeadBattery(val); ReflectionHelper.SetUpgradeDeathHeadBattery(val, upgradeDeathHeadBattery - num4 + num3); } } } } [HarmonyPatch(typeof(PunManager), "UpdateCrouchRestRightAway")] public class CrouchRestPatch { private static void Prefix(string _steamID, ref int value) { if (REPOConfig.GlobalUpgradesMultiplier.Value != 1f) { PlayerAvatar val = SemiFunc.PlayerAvatarGetFromSteamID(_steamID); if ((Object)(object)val != (Object)null) { int num = (StatsManager.instance.playerUpgradeCrouchRest.ContainsKey(_steamID) ? StatsManager.instance.playerUpgradeCrouchRest[_steamID] : 0); float num2 = (float)num * 1f * REPOConfig.GlobalUpgradesMultiplier.Value; float num3 = (float)(num + value) * 1f * REPOConfig.GlobalUpgradesMultiplier.Value - num2; Debug.Log((object)$"[REPOConomyPlus] Crouch Rest upgrade for {_steamID}: difference +{num3}"); float num4 = value; float upgradeCrouchRest = ReflectionHelper.GetUpgradeCrouchRest(val); ReflectionHelper.SetUpgradeCrouchRest(val, upgradeCrouchRest - num4 + num3); } } } } [HarmonyPatch(typeof(ValuableDirector))] public static class ValuableDirectorSeededPatch { [CompilerGenerated] private sealed class d__2 : IEnumerator, IDisposable, IEnumerator { private int <>1__state; private object <>2__current; public ValuableDirector vd; private string[] <_names>5__2; private int[] <_maxAmount>5__3; private List[] <_volumes>5__4; private string[] <_path>5__5; private int[] <_chance>5__6; private List[] <_valuables>5__7; private int[] <_volumeIndex>5__8; private int 5__9; private int 5__10; private int 5__11; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__2(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <_names>5__2 = null; <_maxAmount>5__3 = null; <_volumes>5__4 = null; <_path>5__5 = null; <_chance>5__6 = null; <_valuables>5__7 = null; <_volumeIndex>5__8 = null; <>1__state = -2; } private bool MoveNext() { //IL_1208: Unknown result type (might be due to invalid IL or missing references) //IL_1212: Expected O, but got Unknown //IL_1639: Unknown result type (might be due to invalid IL or missing references) //IL_1643: Expected O, but got Unknown //IL_168a: Unknown result type (might be due to invalid IL or missing references) //IL_1694: Expected O, but got Unknown //IL_13f9: Unknown result type (might be due to invalid IL or missing references) int field4; object field5; string text2; switch (<>1__state) { default: return false; case 0: { <>1__state = -1; if (SemiFunc.RunGetDifficultyMultiplier2() > 0f && !SemiFunc.RunIsArena()) { float num6 = SemiFunc.RunGetDifficultyMultiplier2(); SetField(vd, "totalMaxValue", (float)Mathf.RoundToInt(vd.totalMaxValueCurve2.Evaluate(num6))); SetField(vd, "tinyMaxAmount", Mathf.RoundToInt(vd.tinyMaxAmountCurve2.Evaluate(num6))); SetField(vd, "smallMaxAmount", Mathf.RoundToInt(vd.smallMaxAmountCurve2.Evaluate(num6))); SetField(vd, "mediumMaxAmount", Mathf.RoundToInt(vd.mediumMaxAmountCurve2.Evaluate(num6))); SetField(vd, "bigMaxAmount", Mathf.RoundToInt(vd.bigMaxAmountCurve2.Evaluate(num6))); SetField(vd, "wideMaxAmount", Mathf.RoundToInt(vd.wideMaxAmountCurve2.Evaluate(num6))); SetField(vd, "tallMaxAmount", Mathf.RoundToInt(vd.tallMaxAmountCurve2.Evaluate(num6))); SetField(vd, "veryTallMaxAmount", Mathf.RoundToInt(vd.veryTallMaxAmountCurve2.Evaluate(num6))); } else { float num7 = SemiFunc.RunGetDifficultyMultiplier1(); if (SemiFunc.RunIsArena()) { num7 = 0.75f; } SetField(vd, "totalMaxValue", (float)Mathf.RoundToInt(vd.totalMaxValueCurve1.Evaluate(num7))); SetField(vd, "tinyMaxAmount", Mathf.RoundToInt(vd.tinyMaxAmountCurve1.Evaluate(num7))); SetField(vd, "smallMaxAmount", Mathf.RoundToInt(vd.smallMaxAmountCurve1.Evaluate(num7))); SetField(vd, "mediumMaxAmount", Mathf.RoundToInt(vd.mediumMaxAmountCurve1.Evaluate(num7))); SetField(vd, "bigMaxAmount", Mathf.RoundToInt(vd.bigMaxAmountCurve1.Evaluate(num7))); SetField(vd, "wideMaxAmount", Mathf.RoundToInt(vd.wideMaxAmountCurve1.Evaluate(num7))); SetField(vd, "tallMaxAmount", Mathf.RoundToInt(vd.tallMaxAmountCurve1.Evaluate(num7))); SetField(vd, "veryTallMaxAmount", Mathf.RoundToInt(vd.veryTallMaxAmountCurve1.Evaluate(num7))); } ApplyMapValueScaling(vd); if (SemiFunc.RunIsArena()) { SetField(vd, "totalMaxAmount", GetField(vd, "totalMaxAmount") / 2); SetField(vd, "tinyMaxAmount", GetField(vd, "tinyMaxAmount") / 3); SetField(vd, "smallMaxAmount", GetField(vd, "smallMaxAmount") / 3); SetField(vd, "mediumMaxAmount", GetField(vd, "mediumMaxAmount") / 3); SetField(vd, "bigMaxAmount", GetField(vd, "bigMaxAmount") / 3); SetField(vd, "wideMaxAmount", GetField(vd, "wideMaxAmount") / 2); SetField(vd, "tallMaxAmount", GetField(vd, "tallMaxAmount") / 2); SetField(vd, "veryTallMaxAmount", GetField(vd, "veryTallMaxAmount") / 2); } ClearLists(vd); foreach (LevelValuables valuablePreset in LevelGenerator.Instance.Level.ValuablePresets) { GetList(vd, "tinyValuables").AddRange(valuablePreset.tiny); GetList(vd, "smallValuables").AddRange(valuablePreset.small); GetList(vd, "mediumValuables").AddRange(valuablePreset.medium); GetList(vd, "bigValuables").AddRange(valuablePreset.big); GetList(vd, "wideValuables").AddRange(valuablePreset.wide); GetList(vd, "tallValuables").AddRange(valuablePreset.tall); GetList(vd, "veryTallValuables").AddRange(valuablePreset.veryTall); } if (REPOEventManager.LevelGlitch && SemiFunc.IsMasterClientOrSingleplayer()) { try { REPOConomyPlugin.Logger.LogInfo((object)"[LevelGlitch] \ud83d\udc7e Initializing Glitch... Injecting ALL items into pool."); LevelValuables[] array = Resources.FindObjectsOfTypeAll(); if (array != null && array.Length != 0) { int num8 = 0; LevelValuables[] array2 = array; foreach (LevelValuables val2 in array2) { if (!((Object)(object)val2 == (Object)null) && !LevelGenerator.Instance.Level.ValuablePresets.Contains(val2)) { if (val2.tiny != null) { GetList(vd, "tinyValuables").AddRange(val2.tiny); } if (val2.small != null) { GetList(vd, "smallValuables").AddRange(val2.small); } if (val2.medium != null) { GetList(vd, "mediumValuables").AddRange(val2.medium); } if (val2.big != null) { GetList(vd, "bigValuables").AddRange(val2.big); } if (val2.wide != null) { GetList(vd, "wideValuables").AddRange(val2.wide); } if (val2.tall != null) { GetList(vd, "tallValuables").AddRange(val2.tall); } if (val2.veryTall != null) { GetList(vd, "veryTallValuables").AddRange(val2.veryTall); } num8++; } } REPOConomyPlugin.Logger.LogInfo((object)$"[LevelGlitch] \ud83e\uddec Injected presets from {num8} additional sources. Loot pool is now corrupted/expanded!"); } else { REPOConomyPlugin.Logger.LogWarning((object)"[LevelGlitch] No LevelValuables found in Resources!"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[LevelGlitch] Error: " + ex.Message)); } } SortPrefabsList(vd, "tinyValuables"); SortPrefabsList(vd, "smallValuables"); SortPrefabsList(vd, "mediumValuables"); SortPrefabsList(vd, "bigValuables"); SortPrefabsList(vd, "wideValuables"); SortPrefabsList(vd, "tallValuables"); SortPrefabsList(vd, "veryTallValuables"); List list = Object.FindObjectsOfType().ToList(); list.Sort(delegate(ValuableVolume a, ValuableVolume b) { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: 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_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) int num13 = ((Component)a).transform.position.x.CompareTo(((Component)b).transform.position.x); if (num13 != 0) { return num13; } int num14 = ((Component)a).transform.position.y.CompareTo(((Component)b).transform.position.y); if (num14 != 0) { return num14; } int num15 = ((Component)a).transform.position.z.CompareTo(((Component)b).transform.position.z); return (num15 != 0) ? num15 : string.Compare(((Object)a).name, ((Object)b).name, StringComparison.Ordinal); }); SetList(vd, "tinyVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 0).ToList()); SetList(vd, "smallVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 1).ToList()); SetList(vd, "mediumVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 2).ToList()); SetList(vd, "bigVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 3).ToList()); SetList(vd, "wideVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 4).ToList()); SetList(vd, "tallVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 5).ToList()); SetList(vd, "veryTallVolumes", list.Where((ValuableVolume x) => (int)x.VolumeType == 6).ToList()); ShuffleListWithSeed(vd, "tinyVolumes"); ShuffleListWithSeed(vd, "smallVolumes"); ShuffleListWithSeed(vd, "mediumVolumes"); ShuffleListWithSeed(vd, "bigVolumes"); ShuffleListWithSeed(vd, "wideVolumes"); ShuffleListWithSeed(vd, "tallVolumes"); ShuffleListWithSeed(vd, "veryTallVolumes"); string? text = GetField(vd, "valuableDebug").ToString(); if (text == "All") { SetField(vd, "totalMaxAmount", list.Count); SetField(vd, "totalMaxValue", 99999f); SetField(vd, "tinyMaxAmount", GetList(vd, "tinyVolumes").Count); SetField(vd, "smallMaxAmount", GetList(vd, "smallVolumes").Count); SetField(vd, "mediumMaxAmount", GetList(vd, "mediumVolumes").Count); SetField(vd, "bigMaxAmount", GetList(vd, "bigVolumes").Count); SetField(vd, "wideMaxAmount", GetList(vd, "wideVolumes").Count); SetField(vd, "tallMaxAmount", GetList(vd, "tallVolumes").Count); SetField(vd, "veryTallMaxAmount", GetList(vd, "veryTallVolumes").Count); } if (text == "None" || LevelGenerator.Instance.Level.ValuablePresets.Count <= 0) { SetField(vd, "totalMaxAmount", 0); SetField(vd, "tinyMaxAmount", 0); SetField(vd, "smallMaxAmount", 0); SetField(vd, "mediumMaxAmount", 0); SetField(vd, "bigMaxAmount", 0); SetField(vd, "wideMaxAmount", 0); SetField(vd, "tallMaxAmount", 0); SetField(vd, "veryTallMaxAmount", 0); } SetField(vd, "valuableTargetAmount", 0); <_names>5__2 = new string[7] { "Tiny", "Small", "Medium", "Big", "Wide", "Tall", "Very Tall" }; <_maxAmount>5__3 = new int[7] { GetField(vd, "tinyMaxAmount"), GetField(vd, "smallMaxAmount"), GetField(vd, "mediumMaxAmount"), GetField(vd, "bigMaxAmount"), GetField(vd, "wideMaxAmount"), GetField(vd, "tallMaxAmount"), GetField(vd, "veryTallMaxAmount") }; <_volumes>5__4 = new List[7] { GetList(vd, "tinyVolumes"), GetList(vd, "smallVolumes"), GetList(vd, "mediumVolumes"), GetList(vd, "bigVolumes"), GetList(vd, "wideVolumes"), GetList(vd, "tallVolumes"), GetList(vd, "veryTallVolumes") }; <_path>5__5 = new string[7] { GetField(vd, "tinyPath"), GetField(vd, "smallPath"), GetField(vd, "mediumPath"), GetField(vd, "bigPath"), GetField(vd, "widePath"), GetField(vd, "tallPath"), GetField(vd, "veryTallPath") }; <_chance>5__6 = new int[7] { vd.tinyChance, vd.smallChance, vd.mediumChance, vd.bigChance, vd.wideChance, vd.tallChance, vd.veryTallChance }; <_valuables>5__7 = new List[7] { GetList(vd, "tinyValuables"), GetList(vd, "smallValuables"), GetList(vd, "mediumValuables"), GetList(vd, "bigValuables"), GetList(vd, "wideValuables"), GetList(vd, "tallValuables"), GetList(vd, "veryTallValuables") }; <_volumeIndex>5__8 = new int[7]; 5__9 = 0; goto IL_1121; } case 1: <>1__state = -1; 5__9++; goto IL_1121; case 2: <>1__state = -1; goto IL_1222; case 3: <>1__state = -1; goto IL_1426; case 4: <>1__state = -1; SpawnCosmeticWorldObject(vd, (Rarity)1, <_volumeIndex>5__8, <_volumes>5__4); <>2__current = null; <>1__state = 5; return true; case 5: <>1__state = -1; SpawnCosmeticWorldObject(vd, (Rarity)2, <_volumeIndex>5__8, <_volumes>5__4); <>2__current = null; <>1__state = 6; return true; case 6: <>1__state = -1; SpawnCosmeticWorldObject(vd, (Rarity)3, <_volumeIndex>5__8, <_volumes>5__4); <>2__current = null; <>1__state = 7; return true; case 7: <>1__state = -1; goto IL_155a; case 8: { <>1__state = -1; int field = GetField(vd, "cosmeticWorldObjectSpawnPlayerReady"); SetField(vd, "cosmeticWorldObjectSpawnPlayerReady", field + 1); goto IL_1654; } case 9: <>1__state = -1; goto IL_1654; case 10: { <>1__state = -1; break; } IL_1654: if (SemiFunc.IsMultiplayer() && GetField(vd, "cosmeticWorldObjectSpawnPlayerReady") < PhotonNetwork.CurrentRoom.PlayerCount) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 9; return true; } vd.VolumesAndSwitchSetup(); break; IL_1438: if (5__11 <= 5__10) { float num = ((5__11 < 5__9) ? 1f : ((float)(RunManager.instance.levelsCompleted % vd.cosmeticWorldObjectsLevelLoop) / (float)vd.cosmeticWorldObjectsLevelLoop)); int num2 = Mathf.RoundToInt(vd.cosmeticWorldObjectsSpawnCurve.Evaluate(num) * 100f); int field2 = GetField(RunManager.instance, "cosmeticWorldObjectBadLuckCount"); if (field2 > 0) { num2 += Mathf.RoundToInt((float)field2 * 20f); } Random.InitState(REPOSeedManager.ObjectNext()); if (Random.Range(0, 100) < num2) { CosmeticWorldObjectSetup val = null; float num3 = -1f; foreach (CosmeticWorldObjectSetup cosmeticWorldObjectSetup in vd.cosmeticWorldObjectSetups) { int num4 = Mathf.RoundToInt(cosmeticWorldObjectSetup.chanceCurve.Evaluate(num) * 100f); if (num4 > 0) { Random.InitState(REPOSeedManager.ObjectNext()); int num5 = Random.Range(0, num4); if ((float)num5 > num3) { num3 = num5; val = cosmeticWorldObjectSetup; } } } if (val != null) { SpawnCosmeticWorldObject(vd, val.rarity, <_volumeIndex>5__8, <_volumes>5__4); <>2__current = null; <>1__state = 3; return true; } } goto IL_1426; } if (GetField(vd, "cosmeticWorldObjectTargetAmount") <= 0) { int field3 = GetField(RunManager.instance, "cosmeticWorldObjectBadLuckCount"); SetField(RunManager.instance, "cosmeticWorldObjectBadLuckCount", field3 + 1); } goto IL_155a; IL_155a: if (SemiFunc.IsMultiplayer()) { AccessTools.Method(typeof(PhotonView), "RPC", new Type[3] { typeof(string), typeof(RpcTarget), typeof(object[]) }, (Type[])null).Invoke(((Component)vd).GetComponent(), new object[3] { "CosmeticWorldObjectTargetSetRPC", (object)(RpcTarget)0, new object[1] { GetField(vd, "cosmeticWorldObjectTargetAmount") } }); } <>2__current = null; <>1__state = 8; return true; IL_1121: if (5__9 < GetField(vd, "totalMaxAmount")) { float num9 = -1f; int num10 = -1; Random.InitState(REPOSeedManager.ObjectNext()); for (int j = 0; j < <_names>5__2.Length; j++) { if (<_volumeIndex>5__8[j] < <_maxAmount>5__3[j] && <_volumeIndex>5__8[j] < <_volumes>5__4[j].Count) { int num11 = Random.Range(0, <_chance>5__6[j]); if ((float)num11 > num9) { num9 = num11; num10 = j; } } } if (num10 != -1) { ValuableVolume volume = <_volumes>5__4[num10][<_volumeIndex>5__8[num10]]; int num12 = num10; if (REPOEventManager.ShuffledLoot) { Random.InitState(REPOSeedManager.ObjectNext()); List list2 = new List(); for (int k = 0; k <= num10; k++) { if (<_valuables>5__7[k].Count > 0) { list2.Add(k); } } if (list2.Count > 0) { num12 = list2[Random.Range(0, list2.Count)]; } } List list3 = <_valuables>5__7[num12]; if (list3.Count > 0) { Random.InitState(REPOSeedManager.ObjectNext()); PrefabRef valuable = list3[Random.Range(0, list3.Count)]; SpawnMethod(vd, valuable, volume, <_path>5__5[num12]); } <_volumeIndex>5__8[num10]++; <>2__current = null; <>1__state = 1; return true; } } if (GameManager.instance.gameMode == 1) { AccessTools.Method(typeof(PhotonView), "RPC", new Type[3] { typeof(string), typeof(RpcTarget), typeof(object[]) }, (Type[])null).Invoke(((Component)vd).GetComponent(), new object[3] { "ValuablesTargetSetRPC", (object)(RpcTarget)0, new object[1] { GetField(vd, "valuableTargetAmount") } }); } field4 = GetField(vd, "valuableSpawnPlayerReady"); SetField(vd, "valuableSpawnPlayerReady", field4 + 1); goto IL_1222; IL_1222: if (GameManager.instance.gameMode == 1 && GetField(vd, "valuableSpawnPlayerReady") < PhotonNetwork.CurrentRoom.PlayerCount) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 2; return true; } SetField(vd, "cosmeticWorldObjectTargetAmount", 0); field5 = GetField(vd, "cosmeticWorldObjectDebug"); text2 = ((field5 != null) ? field5.ToString() : "Normal"); if (text2 == "Normal" && SemiFunc.RunIsLevel()) { 5__9 = vd.CosmeticWorldObjectLevelLoopsGet(); 5__10 = vd.CosmeticWorldObjectLevelLoopsClampedGet(); 5__11 = 0; goto IL_1438; } if (text2 == "All") { SpawnCosmeticWorldObject(vd, (Rarity)0, <_volumeIndex>5__8, <_volumes>5__4); <>2__current = null; <>1__state = 4; return true; } goto IL_155a; IL_1426: 5__11++; goto IL_1438; } if (GameManager.instance.gameMode == 1 && GetField(vd, "switchSetupPlayerReady") < PhotonNetwork.CurrentRoom.PlayerCount) { <>2__current = (object)new WaitForSeconds(0.1f); <>1__state = 10; return true; } ReflectionHelper.SetValuableDirectorSetupComplete(vd, value: true); REPOConomyPlugin.Logger.LogInfo((object)"[SeedPatch] ✅ SetupHost Replacement Completed."); return false; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public static void ResetCache() { } [HarmonyPatch("SetupHost")] [HarmonyPrefix] public static bool SetupHostPrefix(ValuableDirector __instance, ref IEnumerator __result) { REPOSeedManager.ResetValuableRandom(); REPOSeedManager.ResetObjectRandom(); __result = SetupHostReplacement(__instance); return false; } [IteratorStateMachine(typeof(d__2))] private static IEnumerator SetupHostReplacement(ValuableDirector vd) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__2(0) { vd = vd }; } [HarmonyPatch("SpawnValuable")] [HarmonyPrefix] public static void SpawnPrefix() { Random.InitState(REPOSeedManager.ValuableNext()); } private static void ClearLists(ValuableDirector vd) { GetList(vd, "tinyValuables").Clear(); GetList(vd, "smallValuables").Clear(); GetList(vd, "mediumValuables").Clear(); GetList(vd, "bigValuables").Clear(); GetList(vd, "wideValuables").Clear(); GetList(vd, "tallValuables").Clear(); GetList(vd, "veryTallValuables").Clear(); } private static T GetField(object instance, string fieldName) { return (T)AccessTools.Field(instance.GetType(), fieldName).GetValue(instance); } private static void SetField(object instance, string fieldName, object value) { AccessTools.Field(instance.GetType(), fieldName).SetValue(instance, value); } private static List GetList(object instance, string fieldName) { return GetField>(instance, fieldName); } private static void SetList(object instance, string fieldName, List value) { SetField(instance, fieldName, value); } private static void IsListAndAdd(this object listObj, IEnumerable collection) { listObj?.GetType().GetMethod("AddRange").Invoke(listObj, new object[1] { collection }); } private static void SortPrefabsList(ValuableDirector instance, string fieldName) { List list = GetList(instance, fieldName); if (list != null) { List collection = (from x in list where x != null orderby GetPrefabKey(x) select x).ToList(); list.Clear(); list.AddRange(collection); } } private static void ShuffleListWithSeed(ValuableDirector instance, string fieldName) { List list = GetList(instance, fieldName); if (list != null && list.Count > 1) { Random.InitState(REPOSeedManager.ObjectRange(0, 999999)); int num = list.Count; while (num > 1) { num--; int index = Random.Range(0, num + 1); T value = list[index]; list[index] = list[num]; list[num] = value; } } } private static void SpawnMethod(ValuableDirector vd, PrefabRef valuable, ValuableVolume volume, string path) { AccessTools.Method(typeof(ValuableDirector), "SpawnValuable", (Type[])null, (Type[])null).Invoke(vd, new object[3] { valuable, volume, path }); } private static void SpawnCosmeticWorldObject(ValuableDirector vd, Rarity rarity, int[] volumeIndex, List[] volumes) { //IL_0050: Unknown result type (might be due to invalid IL or missing references) AccessTools.Method(typeof(ValuableDirector), "SpawnCosmeticWorldObject", new Type[3] { typeof(Rarity), typeof(int[]), typeof(List[]) }, (Type[])null)?.Invoke(vd, new object[3] { rarity, volumeIndex, volumes }); } private static string GetPrefabKey(PrefabRef prefabRef) { if (prefabRef == null) { return "null"; } if (!string.IsNullOrEmpty(prefabRef.ResourcePath)) { return prefabRef.ResourcePath; } if ((Object)(object)prefabRef.Prefab != (Object)null) { return "prefab_" + ((Object)prefabRef.Prefab).name; } if (!string.IsNullOrEmpty(prefabRef.PrefabName)) { return "name_" + prefabRef.PrefabName; } return "hash_" + ((object)prefabRef).GetHashCode(); } private static void ApplyMapValueScaling(ValuableDirector vd) { if (SemiFunc.RunIsLevel()) { float scalingMultiplier = GetScalingMultiplier(); float field = GetField(vd, "totalMaxValue"); float num = field * scalingMultiplier; SetField(vd, "totalMaxValue", num); REPOConomyPlugin.Logger.LogInfo((object)$"[MapValueScaling] totalMaxValue: {field:F0} -> {num:F0} (base x{scalingMultiplier:F3}, event x{REPOEventManager.ValuableCountMultiplier:F2})"); int field2 = GetField(vd, "totalMaxAmount"); int num2 = Mathf.RoundToInt((float)field2 * scalingMultiplier); if (REPOEventManager.HasEvent("size_restriction")) { int num3 = num2; num2 *= 20; REPOConomyPlugin.Logger.LogInfo((object)$"[MapValueScaling] \ud83c\udfaf Size Restriction: totalMaxAmount: {field2} -> {num3} (scaling x{scalingMultiplier:F3}) -> {num2} (extra x20)"); } else { REPOConomyPlugin.Logger.LogInfo((object)$"[MapValueScaling] totalMaxAmount: {field2} -> {num2} (base x{scalingMultiplier:F3}, event x{REPOEventManager.ValuableCountMultiplier:F2})"); } SetField(vd, "totalMaxAmount", num2); ScaleCategory(vd, "tinyMaxAmount", scalingMultiplier); ScaleCategory(vd, "smallMaxAmount", scalingMultiplier); ScaleCategory(vd, "mediumMaxAmount", scalingMultiplier); ScaleCategory(vd, "bigMaxAmount", scalingMultiplier); ScaleCategory(vd, "wideMaxAmount", scalingMultiplier); ScaleCategory(vd, "tallMaxAmount", scalingMultiplier); ScaleCategory(vd, "veryTallMaxAmount", scalingMultiplier); } } private static void ScaleCategory(ValuableDirector vd, string fieldName, float multiplier) { int field = GetField(vd, fieldName); int num = Mathf.RoundToInt((float)field * multiplier); if (REPOEventManager.HasEvent("size_restriction")) { int num2 = num; num *= 20; REPOConomyPlugin.Logger.LogInfo((object)$"[MapValueScaling] \ud83c\udfaf Size Restriction {fieldName}: {field} -> {num2} (x{multiplier:F3}) -> {num} (x20)"); } else { REPOConomyPlugin.Logger.LogInfo((object)$"[MapValueScaling] {fieldName}: {field} -> {num} (x{multiplier:F3})"); } SetField(vd, fieldName, num); } private static float GetScalingMultiplier() { float num = 1f; if (REPOConfig.EnableMapValueScaling.Value && (Object)(object)RunManager.instance != (Object)null) { int num2 = RunManager.instance.levelsCompleted + 1; int value = REPOConfig.MapValueStartLevel.Value; int value2 = REPOConfig.MapValueScalingLevelCap.Value; int num3 = Mathf.Min(num2, value2); if (num3 >= value) { num = ((!REPOConfig.MapValueUseExponentialScaling.Value) ? (1f + (float)(num3 - value) * (REPOConfig.MapValueMultiplier.Value - 1f)) : Mathf.Pow(REPOConfig.MapValueMultiplier.Value, (float)(num3 - value + 1))); } } float valuableCountMultiplier = REPOEventManager.ValuableCountMultiplier; return num * valuableCountMultiplier; } } [HarmonyPatch(typeof(PhysGrabObjectImpactDetector))] internal static class ValuableEconomyPhysicsPatch { [CompilerGenerated] private sealed class d__7 : IEnumerable, IEnumerable, IEnumerator, IDisposable, IEnumerator { private int <>1__state; private CodeInstruction <>2__current; private int <>l__initialThreadId; private IEnumerable instructions; public IEnumerable <>3__instructions; private MethodInfo replacement; public MethodInfo <>3__replacement; private IEnumerator <>7__wrap1; CodeInstruction IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__7(int <>1__state) { this.<>1__state = <>1__state; <>l__initialThreadId = Environment.CurrentManagedThreadId; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || (uint)(num - 1) <= 1u) { try { } finally { <>m__Finally1(); } } <>7__wrap1 = null; <>1__state = -2; } private bool MoveNext() { //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Expected O, but got Unknown try { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>7__wrap1 = instructions.GetEnumerator(); <>1__state = -3; break; case 1: <>1__state = -3; break; case 2: <>1__state = -3; break; } if (<>7__wrap1.MoveNext()) { CodeInstruction current = <>7__wrap1.Current; if (current.opcode == OpCodes.Ldfld && object.Equals(current.operand, FI_dollarValueOriginal)) { <>2__current = new CodeInstruction(OpCodes.Call, (object)replacement); <>1__state = 1; return true; } <>2__current = current; <>1__state = 2; return true; } <>m__Finally1(); <>7__wrap1 = null; return false; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; if (<>7__wrap1 != null) { <>7__wrap1.Dispose(); } } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { d__7 d__; if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId) { <>1__state = 0; d__ = this; } else { d__ = new d__7(0); } d__.instructions = <>3__instructions; d__.replacement = <>3__replacement; return d__; } [DebuggerHidden] IEnumerator IEnumerable.GetEnumerator() { return ((IEnumerable)this).GetEnumerator(); } } private const float DestroyValueFloor = 35f; private const float VanillaDestroyPercent = 0.15f; private static readonly FieldInfo FI_dollarValueOriginal = AccessTools.Field(typeof(ValuableObject), "dollarValueOriginal"); [HarmonyPatch("BreakLight")] [HarmonyTranspiler] private static IEnumerable BreakLightTranspiler(IEnumerable instructions) { return ReplaceDollarValueOriginal(instructions, AccessTools.Method(typeof(ValuableEconomyPhysicsPatch), "GetBreakValueBaseline", (Type[])null, (Type[])null)); } [HarmonyPatch("BreakMedium")] [HarmonyTranspiler] private static IEnumerable BreakMediumTranspiler(IEnumerable instructions) { return ReplaceDollarValueOriginal(instructions, AccessTools.Method(typeof(ValuableEconomyPhysicsPatch), "GetBreakValueBaseline", (Type[])null, (Type[])null)); } [HarmonyPatch("BreakHeavy")] [HarmonyTranspiler] private static IEnumerable BreakHeavyTranspiler(IEnumerable instructions) { return ReplaceDollarValueOriginal(instructions, AccessTools.Method(typeof(ValuableEconomyPhysicsPatch), "GetBreakValueBaseline", (Type[])null, (Type[])null)); } [HarmonyPatch("BreakRPC")] [HarmonyTranspiler] private static IEnumerable BreakRPCTranspiler(IEnumerable instructions) { return ReplaceDollarValueOriginal(instructions, AccessTools.Method(typeof(ValuableEconomyPhysicsPatch), "GetDestroyValueBaseline", (Type[])null, (Type[])null)); } [IteratorStateMachine(typeof(d__7))] private static IEnumerable ReplaceDollarValueOriginal(IEnumerable instructions, MethodInfo replacement) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__7(-2) { <>3__instructions = instructions, <>3__replacement = replacement }; } public static float GetBreakValueBaseline(ValuableObject valuable) { return GetEconomyAdjustedValue(valuable, includeDestroyFloor: false); } public static float GetDestroyValueBaseline(ValuableObject valuable) { float economyAdjustedValue = GetEconomyAdjustedValue(valuable, includeDestroyFloor: false); if (economyAdjustedValue <= 0f) { return 0f; } float num = 233.33333f; return Mathf.Max(economyAdjustedValue, num); } private static float GetEconomyAdjustedValue(ValuableObject valuable, bool includeDestroyFloor) { if ((Object)(object)valuable == (Object)null || FI_dollarValueOriginal == null) { if (!includeDestroyFloor) { return 0f; } return 35f; } int instanceID = ((Object)valuable).GetInstanceID(); if (REPOConomyPlugin.EconomyAdjustedValues.TryGetValue(instanceID, out var value)) { return Mathf.Max(0f, value); } return Convert.ToSingle(FI_dollarValueOriginal.GetValue(valuable)); } } [HarmonyPatch(typeof(ValuableObject))] public static class ValuableObjectSeededPatch { private static readonly Dictionary PreviousRandomStates = new Dictionary(); private static string GetDeterministicKey(ValuableObject obj) { //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_0033: 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_004f: Unknown result type (might be due to invalid IL or missing references) Vector3 position = ((Component)obj).transform.position; string text = ((Object)obj).name.Replace("(Clone)", ""); return $"{text}_{position.x:F2}_{position.y:F2}_{position.z:F2}"; } private static int GetStableHash(string str) { int num = 5381; foreach (char c in str) { num = ((num << 5) + num) ^ c; } return num; } [HarmonyPatch("DollarValueSetLogic")] [HarmonyPrefix] public static void DollarValueSetLogicPrefix(ValuableObject __instance) { //IL_0059: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null) { return; } bool flag = (bool)AccessTools.Field(typeof(ValuableObject), "dollarValueSet").GetValue(__instance); if ((int)AccessTools.Field(typeof(ValuableObject), "dollarValueOverride").GetValue(__instance) == 0) { int instanceID = ((Object)__instance).GetInstanceID(); PreviousRandomStates[instanceID] = Random.state; int num; if (!flag && REPOSeedManager.ScheduledOrbSeed.HasValue) { num = REPOSeedManager.ScheduledOrbSeed.Value; REPOSeedManager.ScheduledOrbSeed = null; } else { int stableHash = GetStableHash(GetDeterministicKey(__instance)); num = REPOSeedManager.GetCurrentHash() ^ stableHash; } Random.InitState(num); } } [HarmonyPatch("DollarValueSetLogic")] [HarmonyPostfix] [HarmonyPriority(0)] public static void DollarValueSetLogicPostfix(ValuableObject __instance) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance == (Object)null)) { int instanceID = ((Object)__instance).GetInstanceID(); if (PreviousRandomStates.TryGetValue(instanceID, out var value)) { Random.state = value; PreviousRandomStates.Remove(instanceID); } } } } } namespace REPOConomyMod.Stats { public class REPOStatsManager : MonoBehaviour { public static REPOStatsManager instance; private const string StatsEs3Key = "REPOConomyPlusStats"; private static readonly string StatsEs3Path = Path.Combine(Application.persistentDataPath, "saves", "REPOConomyPlus", "statistics.es3"); private static readonly string LegacyStatsPath = Path.Combine(Paths.ConfigPath, "REPOConomyPlus", "statistics.json"); public PlayerStatistics stats = new PlayerStatistics(); private static Type es3Type; private static Type es3SettingsType; private static Type es3LocationType; private static bool es3ReflectionInitialized; private int lastObservedRunTotalHaul = -1; public static REPOStatsManager EnsureInstance() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Expected O, but got Unknown if ((Object)(object)instance != (Object)null) { return instance; } instance = Object.FindObjectOfType(); if ((Object)(object)instance != (Object)null) { return instance; } GameObject val = GameObject.Find("REPOStatsManager"); if ((Object)(object)val == (Object)null) { val = new GameObject("REPOStatsManager"); } instance = val.GetComponent(); if ((Object)(object)instance == (Object)null) { instance = val.AddComponent(); } Object.DontDestroyOnLoad((Object)(object)val); return instance; } private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); LoadStats(); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void TrackEconomyOccurrence(string economyId, string economyName, string economyDescription = null, Color? economyColor = null, int? level = null) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(economyId)) { if (EnsureDiscovered(stats.discoveredEconomies, economyId)) { REPOConomyPlugin.Logger.LogInfo((object)("[Stats] New economy discovered: " + economyName)); int level2 = ResolveDiscoveryProgressionLevel(level ?? REPOConomyPlugin.GetCurrentLevel()); SetFirstSeenLevel(stats.economyFirstSeenLevel, economyId, level2); } Increment(stats.economyOccurrences, economyId); stats.totalEconomiesTriggered++; SetMeta(stats.economyNames, economyId, economyName); SetMeta(stats.economyDescriptions, economyId, economyDescription); SetMeta(stats.economyColors, economyId, SerializeColor((Color)(((??)economyColor) ?? Color.white))); SaveStats(); } } public void TrackModifierOccurrence(string modifierId, string modifierName, string modifierDescription = null, Color? modifierColor = null, int? level = null, EventType? modifierType = null) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(modifierId)) { if (EnsureDiscovered(stats.discoveredModifiers, modifierId)) { REPOConomyPlugin.Logger.LogInfo((object)("[Stats] New modifier discovered: " + modifierName)); int level2 = ResolveDiscoveryProgressionLevel(level ?? REPOConomyPlugin.GetCurrentLevel()); SetFirstSeenLevel(stats.modifierFirstSeenLevel, modifierId, level2); } Increment(stats.modifierOccurrences, modifierId); stats.totalModifiersTriggered++; SetMeta(stats.modifierNames, modifierId, modifierName); SetMeta(stats.modifierDescriptions, modifierId, modifierDescription); SetMeta(stats.modifierColors, modifierId, SerializeColor((Color)(((??)modifierColor) ?? Color.white))); if (modifierType.HasValue) { stats.modifierTypes[modifierId] = (int)modifierType.Value; } SaveStats(); } } public void TrackShopEconomyOccurrence(string shopEconomyId, string shopEconomyName, string shopEconomyDescription = null, Color? shopEconomyColor = null, int? level = null) { //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrWhiteSpace(shopEconomyId)) { if (EnsureDiscovered(stats.discoveredShopEconomies, shopEconomyId)) { REPOConomyPlugin.Logger.LogInfo((object)("[Stats] New shop economy discovered: " + shopEconomyName)); int level2 = ResolveDiscoveryProgressionLevel(level ?? REPOConomyPlugin.GetCurrentLevel()); SetFirstSeenLevel(stats.shopEconomyFirstSeenLevel, shopEconomyId, level2); } Increment(stats.shopEconomyOccurrences, shopEconomyId); stats.totalShopEconomiesTriggered++; SetMeta(stats.shopEconomyNames, shopEconomyId, shopEconomyName); SetMeta(stats.shopEconomyDescriptions, shopEconomyId, shopEconomyDescription); SetMeta(stats.shopEconomyColors, shopEconomyId, SerializeColor((Color)(((??)shopEconomyColor) ?? Color.white))); SaveStats(); } } public void TrackLevelCompleted(int level) { stats.totalLevelsPlayed++; if (level > stats.maxLevelReached) { stats.maxLevelReached = level; } SaveStats(); } public void TrackHaulCollected(int haul) { stats.totalHaulCollected += haul; if (haul > stats.maxSingleHaul) { stats.maxSingleHaul = haul; } SaveStats(); } public void SyncRunTotalHaul(int currentRunTotalHaul) { if (currentRunTotalHaul < 0) { return; } if (lastObservedRunTotalHaul < 0) { lastObservedRunTotalHaul = currentRunTotalHaul; if (currentRunTotalHaul > stats.maxSingleHaul) { stats.maxSingleHaul = currentRunTotalHaul; SaveStats(); } return; } if (currentRunTotalHaul < lastObservedRunTotalHaul) { lastObservedRunTotalHaul = currentRunTotalHaul; if (currentRunTotalHaul > stats.maxSingleHaul) { stats.maxSingleHaul = currentRunTotalHaul; SaveStats(); } return; } int num = currentRunTotalHaul - lastObservedRunTotalHaul; bool flag = false; if (num > 0) { stats.totalHaulCollected += num; flag = true; } if (currentRunTotalHaul > stats.maxSingleHaul) { stats.maxSingleHaul = currentRunTotalHaul; flag = true; } lastObservedRunTotalHaul = currentRunTotalHaul; if (flag) { SaveStats(); } } public void SyncRunTotalHaulFromGame() { try { if (StatsManager.instance?.runStats != null && StatsManager.instance.runStats.TryGetValue("totalHaul", out var value)) { SyncRunTotalHaul(value); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Stats] Failed to sync run total haul: " + ex.Message)); } } public bool IsEconomyDiscovered(string economyId) { return stats.discoveredEconomies.Contains(economyId); } public bool IsModifierDiscovered(string modifierId) { return stats.discoveredModifiers.Contains(modifierId); } public bool IsShopEconomyDiscovered(string shopEconomyId) { return stats.discoveredShopEconomies.Contains(shopEconomyId); } public int GetEconomyOccurrences(string economyId) { if (!stats.economyOccurrences.TryGetValue(economyId, out var value)) { return 0; } return value; } public int GetModifierOccurrences(string modifierId) { if (!stats.modifierOccurrences.TryGetValue(modifierId, out var value)) { return 0; } return value; } public int GetShopEconomyOccurrences(string shopEconomyId) { if (!stats.shopEconomyOccurrences.TryGetValue(shopEconomyId, out var value)) { return 0; } return value; } public int GetEconomyFirstSeenLevel(string economyId) { if (!stats.economyFirstSeenLevel.TryGetValue(economyId, out var value)) { return 0; } return value; } public int GetModifierFirstSeenLevel(string modifierId) { if (!stats.modifierFirstSeenLevel.TryGetValue(modifierId, out var value)) { return 0; } return value; } public int GetShopEconomyFirstSeenLevel(string shopEconomyId) { if (!stats.shopEconomyFirstSeenLevel.TryGetValue(shopEconomyId, out var value)) { return 0; } return value; } public string GetEconomyName(string economyId) { return GetMeta(stats.economyNames, economyId); } public string GetModifierName(string modifierId) { return GetMeta(stats.modifierNames, modifierId); } public string GetShopEconomyName(string shopEconomyId) { return GetMeta(stats.shopEconomyNames, shopEconomyId); } public string GetEconomyDescription(string economyId) { return GetMeta(stats.economyDescriptions, economyId); } public string GetModifierDescription(string modifierId) { return GetMeta(stats.modifierDescriptions, modifierId); } public string GetShopEconomyDescription(string shopEconomyId) { return GetMeta(stats.shopEconomyDescriptions, shopEconomyId); } public Color GetEconomyColor(string economyId, Color fallback) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return DeserializeColor(GetMeta(stats.economyColors, economyId), fallback); } public Color GetModifierColor(string modifierId, Color fallback) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return DeserializeColor(GetMeta(stats.modifierColors, modifierId), fallback); } public Color GetShopEconomyColor(string shopEconomyId, Color fallback) { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) return DeserializeColor(GetMeta(stats.shopEconomyColors, shopEconomyId), fallback); } public EventType? GetModifierType(string modifierId) { if (stats.modifierTypes.TryGetValue(modifierId, out var value)) { return (EventType)value; } return null; } public int GetDiscoveredEconomiesCount() { return stats.discoveredEconomies.Count; } public int GetDiscoveredModifiersCount() { return stats.discoveredModifiers.Count; } public int GetDiscoveredShopEconomiesCount() { return stats.discoveredShopEconomies.Count; } public int GetMaxLevelReached() { return stats.maxLevelReached; } public int GetTotalLevelsPlayed() { return stats.totalLevelsPlayed; } public long GetTotalHaulCollected() { return stats.totalHaulCollected; } public int GetMaxSingleHaul() { return stats.maxSingleHaul; } public int GetTotalEconomiesTriggered() { return stats.totalEconomiesTriggered; } public int GetTotalModifiersTriggered() { return stats.totalModifiersTriggered; } public int GetTotalShopEconomiesTriggered() { return stats.totalShopEconomiesTriggered; } public int GetTotalChallengeTierCompletions() { return stats.totalChallengeTierCompletions; } public void LoadStats() { try { if (TryLoadFromEs3(out var loaded)) { stats = loaded ?? new PlayerStatistics(); NormalizeStats(); REPOConomyPlugin.Logger.LogInfo((object)"[Stats] Loaded statistics via ES3"); } else if (File.Exists(LegacyStatsPath)) { string text = File.ReadAllText(LegacyStatsPath); stats = JsonConvert.DeserializeObject(text) ?? new PlayerStatistics(); NormalizeStats(); REPOConomyPlugin.Logger.LogInfo((object)"[Stats] Loaded legacy JSON statistics"); SaveStats(); } else { stats = new PlayerStatistics(); NormalizeStats(); REPOConomyPlugin.Logger.LogInfo((object)"[Stats] No statistics file found, starting fresh"); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Stats] Failed to load statistics: " + ex.Message)); stats = new PlayerStatistics(); NormalizeStats(); } } public void SaveStats() { try { NormalizeStats(); if (!TrySaveToEs3()) { string directoryName = Path.GetDirectoryName(LegacyStatsPath); if (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } string contents = JsonConvert.SerializeObject((object)stats, (Formatting)1); File.WriteAllText(LegacyStatsPath, contents); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogError((object)("[Stats] Failed to save statistics: " + ex.Message)); } } public void ResetStats() { stats = new PlayerStatistics(); NormalizeStats(); SaveStats(); REPOConomyPlugin.Logger.LogInfo((object)"[Stats] Statistics reset"); } private static bool EnsureDiscovered(List discoveredList, string id) { if (discoveredList == null) { return false; } if (discoveredList.Contains(id)) { return false; } discoveredList.Add(id); return true; } private static void Increment(Dictionary dictionary, string id) { if (dictionary != null) { if (dictionary.TryGetValue(id, out var value)) { dictionary[id] = value + 1; } else { dictionary[id] = 1; } } } private static void SetFirstSeenLevel(Dictionary dictionary, string id, int level) { if (dictionary != null && !string.IsNullOrWhiteSpace(id) && !dictionary.ContainsKey(id)) { dictionary[id] = Mathf.Max(1, level); } } private static void SetMeta(Dictionary dictionary, string id, string value) { if (dictionary != null && !string.IsNullOrWhiteSpace(id) && !string.IsNullOrWhiteSpace(value)) { dictionary[id] = value; } } private static string GetMeta(Dictionary dictionary, string id) { if (dictionary == null || string.IsNullOrWhiteSpace(id)) { return string.Empty; } if (!dictionary.TryGetValue(id, out var value)) { return string.Empty; } return value ?? string.Empty; } private static string SerializeColor(Color color) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) return string.Format(CultureInfo.InvariantCulture, "{0:F4},{1:F4},{2:F4},{3:F4}", color.r, color.g, color.b, color.a); } private static Color DeserializeColor(string raw, Color fallback) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0087: 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) if (string.IsNullOrWhiteSpace(raw)) { return fallback; } string[] array = raw.Split(new char[1] { ',' }); if (array.Length != 4) { return fallback; } if (float.TryParse(array[0], NumberStyles.Float, CultureInfo.InvariantCulture, out var result) && float.TryParse(array[1], NumberStyles.Float, CultureInfo.InvariantCulture, out var result2) && float.TryParse(array[2], NumberStyles.Float, CultureInfo.InvariantCulture, out var result3) && float.TryParse(array[3], NumberStyles.Float, CultureInfo.InvariantCulture, out var result4)) { return new Color(result, result2, result3, result4); } return fallback; } private void NormalizeStats() { if (stats == null) { stats = new PlayerStatistics(); } stats.version = Mathf.Max(stats.version, 2); PlayerStatistics playerStatistics = stats; if (playerStatistics.discoveredEconomies == null) { playerStatistics.discoveredEconomies = new List(); } playerStatistics = stats; if (playerStatistics.discoveredModifiers == null) { playerStatistics.discoveredModifiers = new List(); } playerStatistics = stats; if (playerStatistics.discoveredShopEconomies == null) { playerStatistics.discoveredShopEconomies = new List(); } playerStatistics = stats; if (playerStatistics.economyOccurrences == null) { playerStatistics.economyOccurrences = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierOccurrences == null) { playerStatistics.modifierOccurrences = new Dictionary(); } playerStatistics = stats; if (playerStatistics.shopEconomyOccurrences == null) { playerStatistics.shopEconomyOccurrences = new Dictionary(); } playerStatistics = stats; if (playerStatistics.economyFirstSeenLevel == null) { playerStatistics.economyFirstSeenLevel = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierFirstSeenLevel == null) { playerStatistics.modifierFirstSeenLevel = new Dictionary(); } playerStatistics = stats; if (playerStatistics.shopEconomyFirstSeenLevel == null) { playerStatistics.shopEconomyFirstSeenLevel = new Dictionary(); } playerStatistics = stats; if (playerStatistics.economyNames == null) { playerStatistics.economyNames = new Dictionary(); } playerStatistics = stats; if (playerStatistics.economyDescriptions == null) { playerStatistics.economyDescriptions = new Dictionary(); } playerStatistics = stats; if (playerStatistics.economyColors == null) { playerStatistics.economyColors = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierNames == null) { playerStatistics.modifierNames = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierDescriptions == null) { playerStatistics.modifierDescriptions = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierColors == null) { playerStatistics.modifierColors = new Dictionary(); } playerStatistics = stats; if (playerStatistics.modifierTypes == null) { playerStatistics.modifierTypes = new Dictionary(); } playerStatistics = stats; if (playerStatistics.shopEconomyNames == null) { playerStatistics.shopEconomyNames = new Dictionary(); } playerStatistics = stats; if (playerStatistics.shopEconomyDescriptions == null) { playerStatistics.shopEconomyDescriptions = new Dictionary(); } playerStatistics = stats; if (playerStatistics.shopEconomyColors == null) { playerStatistics.shopEconomyColors = new Dictionary(); } playerStatistics = stats; if (playerStatistics.challengeCompletedTiers == null) { playerStatistics.challengeCompletedTiers = new Dictionary(); } playerStatistics = stats; if (playerStatistics.challengeRewardUnlockAnnouncements == null) { playerStatistics.challengeRewardUnlockAnnouncements = new Dictionary(); } playerStatistics = stats; if (playerStatistics.activeChallengeId == null) { playerStatistics.activeChallengeId = string.Empty; } playerStatistics = stats; if (playerStatistics.activeChallengeRunSaveKey == null) { playerStatistics.activeChallengeRunSaveKey = string.Empty; } } private int ResolveDiscoveryProgressionLevel(int providedLevel) { int num = Mathf.Max(1, providedLevel); int num2 = Mathf.Max(0, stats?.totalLevelsPlayed ?? 0); if (num2 <= 0) { return num; } return Mathf.Max(num2, num); } private static void EnsureEs3Reflection() { if (!es3ReflectionInitialized) { es3ReflectionInitialized = true; es3Type = (from a in AppDomain.CurrentDomain.GetAssemblies() select a.GetType("ES3")).FirstOrDefault((Type t) => t != null); es3SettingsType = (from a in AppDomain.CurrentDomain.GetAssemblies() select a.GetType("ES3Settings")).FirstOrDefault((Type t) => t != null); es3LocationType = es3Type?.GetNestedType("Location", BindingFlags.Public | BindingFlags.NonPublic); } } private static object CreateEs3Settings() { EnsureEs3Reflection(); if (es3SettingsType == null) { return null; } try { if (es3LocationType != null) { ConstructorInfo constructor = es3SettingsType.GetConstructor(new Type[2] { typeof(string), typeof(Enum[]) }); if (constructor != null) { object obj = Enum.Parse(es3LocationType, "File"); Enum[] array = new Enum[1] { (Enum)obj }; return constructor.Invoke(new object[2] { StatsEs3Path, array }); } } ConstructorInfo constructor2 = es3SettingsType.GetConstructor(new Type[1] { typeof(string) }); if (constructor2 != null) { return constructor2.Invoke(new object[1] { StatsEs3Path }); } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Stats] ES3 settings creation failed: " + ex.Message)); } return null; } private bool TrySaveToEs3() { EnsureEs3Reflection(); if (es3Type == null) { return false; } try { string directoryName = Path.GetDirectoryName(StatsEs3Path); if (!string.IsNullOrEmpty(directoryName) && !Directory.Exists(directoryName)) { Directory.CreateDirectory(directoryName); } object obj = CreateEs3Settings(); if (InvokeGeneric(es3Type, "Save", typeof(PlayerStatistics), new object[3] { "REPOConomyPlusStats", stats, obj }, (ParameterInfo[] p) => p.Length == 3 && p[0].ParameterType == typeof(string) && p[2].Name.Contains("ES3Settings"))) { InvokeStoreCachedFile(obj); return true; } if (InvokeGeneric(es3Type, "Save", typeof(PlayerStatistics), new object[3] { "REPOConomyPlusStats", stats, StatsEs3Path }, (ParameterInfo[] p) => p.Length == 3 && p[0].ParameterType == typeof(string) && p[2].ParameterType == typeof(string))) { return true; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Stats] ES3 save failed: " + ex.Message)); } return false; } private bool TryLoadFromEs3(out PlayerStatistics loaded) { loaded = null; EnsureEs3Reflection(); if (es3Type == null) { return false; } if (!File.Exists(StatsEs3Path)) { return false; } try { object obj = CreateEs3Settings(); if (TryInvokeGenericWithResult(es3Type, "Load", typeof(PlayerStatistics), new object[2] { "REPOConomyPlusStats", obj }, (ParameterInfo[] p) => p.Length == 2 && p[0].ParameterType == typeof(string) && p[1].Name.Contains("ES3Settings"), out var result)) { loaded = result as PlayerStatistics; return loaded != null; } if (TryInvokeGenericWithResult(es3Type, "Load", typeof(PlayerStatistics), new object[2] { "REPOConomyPlusStats", StatsEs3Path }, (ParameterInfo[] p) => p.Length == 2 && p[0].ParameterType == typeof(string) && p[1].ParameterType == typeof(string), out result)) { loaded = result as PlayerStatistics; return loaded != null; } if (TryInvokeGenericWithResult(es3Type, "Load", typeof(PlayerStatistics), new object[4] { "REPOConomyPlusStats", null, new PlayerStatistics(), obj }, (ParameterInfo[] p) => p.Length == 4 && p[0].ParameterType == typeof(string) && p[3].Name.Contains("ES3Settings"), out result)) { loaded = result as PlayerStatistics; return loaded != null; } } catch (Exception ex) { REPOConomyPlugin.Logger.LogWarning((object)("[Stats] ES3 load failed: " + ex.Message)); } return false; } private static void InvokeStoreCachedFile(object settings) { if (settings == null || es3Type == null) { return; } try { es3Type.GetMethods(BindingFlags.Static | BindingFlags.Public).FirstOrDefault((MethodInfo m) => m.Name == "StoreCachedFile" && m.GetParameters().Length == 1 && (m.GetParameters()[0].Name ?? string.Empty).IndexOf("settings", StringComparison.OrdinalIgnoreCase) >= 0)?.Invoke(null, new object[1] { settings }); } catch { } } private static bool InvokeGeneric(Type staticType, string methodName, Type genericArg, object[] args, Func parameterFilter) { if (staticType == null) { return false; } MethodInfo[] methods = staticType.GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (!methodInfo.IsGenericMethodDefinition || methodInfo.Name != methodName) { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameterFilter(parameters) && CanInvoke(parameters, args)) { try { methodInfo.MakeGenericMethod(genericArg).Invoke(null, args); return true; } catch { } } } return false; } private static bool TryInvokeGenericWithResult(Type staticType, string methodName, Type genericArg, object[] args, Func parameterFilter, out object result) { result = null; if (staticType == null) { return false; } MethodInfo[] methods = staticType.GetMethods(BindingFlags.Static | BindingFlags.Public); foreach (MethodInfo methodInfo in methods) { if (!methodInfo.IsGenericMethodDefinition || methodInfo.Name != methodName) { continue; } ParameterInfo[] parameters = methodInfo.GetParameters(); if (parameterFilter(parameters) && CanInvoke(parameters, args)) { try { result = methodInfo.MakeGenericMethod(genericArg).Invoke(null, args); return true; } catch { } } } return false; } private static bool CanInvoke(ParameterInfo[] parameters, object[] args) { if (parameters.Length != args.Length) { return false; } for (int i = 0; i < parameters.Length; i++) { object obj = args[i]; Type parameterType = parameters[i].ParameterType; if (obj == null) { if (parameterType.IsValueType && Nullable.GetUnderlyingType(parameterType) == null) { return false; } } else if (!parameterType.IsInstanceOfType(obj)) { return false; } } return true; } } [Serializable] public class PlayerStatistics { public int version = 2; public List discoveredEconomies = new List(); public List discoveredModifiers = new List(); public List discoveredShopEconomies = new List(); public Dictionary economyOccurrences = new Dictionary(); public Dictionary modifierOccurrences = new Dictionary(); public Dictionary shopEconomyOccurrences = new Dictionary(); public Dictionary economyFirstSeenLevel = new Dictionary(); public Dictionary modifierFirstSeenLevel = new Dictionary(); public Dictionary shopEconomyFirstSeenLevel = new Dictionary(); public Dictionary economyNames = new Dictionary(); public Dictionary economyDescriptions = new Dictionary(); public Dictionary economyColors = new Dictionary(); public Dictionary modifierNames = new Dictionary(); public Dictionary modifierDescriptions = new Dictionary(); public Dictionary modifierColors = new Dictionary(); public Dictionary modifierTypes = new Dictionary(); public Dictionary shopEconomyNames = new Dictionary(); public Dictionary shopEconomyDescriptions = new Dictionary(); public Dictionary shopEconomyColors = new Dictionary(); public int totalLevelsPlayed; public int maxLevelReached; public long totalHaulCollected; public int maxSingleHaul; public int totalEconomiesTriggered; public int totalModifiersTriggered; public int totalShopEconomiesTriggered; public string activeChallengeId = string.Empty; public int activeChallengeTarget; public bool activeChallengeRunStarted; public string activeChallengeRunSaveKey = string.Empty; public Dictionary challengeCompletedTiers = new Dictionary(); public Dictionary challengeRewardUnlockAnnouncements = new Dictionary(); public int totalChallengeTierCompletions; } } namespace REPOConomyMod.Menu { public class REPOMenuManager : MonoBehaviour { private sealed class ToggleBinding { public ConfigEntry configEntry; public REPOToggle toggle; } private sealed class SearchEntry { public REPOScrollViewElement element; public string sectionKey; public string text; } private sealed class EconomyStatsDescriptor { public string id; public string fallbackName; public string fallbackDescription; public Color fallbackColor; } private sealed class ShopStatsDescriptor { public string id; public ShopEconomyType type; public string fallbackName; public string fallbackDescription; public Color fallbackColor; } private sealed class CreditEntry { public string name; public string description; public Color color; } private sealed class PulseTextColor : MonoBehaviour { public TextMeshProUGUI target; public Color colorA = Color.white; public Color colorB = Color.yellow; public float speed = 4f; private void Update() { //IL_003a: 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_0046: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)target == (Object)null) { Object.Destroy((Object)(object)this); return; } float num = (Mathf.Sin(Time.unscaledTime * speed) + 1f) * 0.5f; ((Graphic)target).color = Color.Lerp(colorA, colorB, num); } } private sealed class ConfigCategoryDefinition { public string title; public string[] sections; public ConfigCategoryDefinition(string title, params string[] sections) { this.title = title; this.sections = sections ?? Array.Empty(); } } public static REPOMenuManager instance; private const float CompactPopupSpacing = 1f; private const float CompactToggleTopPadding = 1f; private const float CompactToggleBottomPadding = 1f; private const float CompactLabelTopPadding = 2f; private const float CompactLabelBottomPadding = 1f; private const float CompactButtonTopPadding = 1f; private const float CompactButtonBottomPadding = 1f; private const float PopupButtonsFallbackCenterX = 120f; private const float PopupButtonsCenterXCorrection = 57f; private const float PopupButtonsGap = 12f; private const float PopupButtonHeight = 24f; private const float PopupResetTopPadding = 7f; private const float PopupConfirmMinButtonWidth = 64f; private const float PopupResetCenterOffsetX = -21f; private static readonly Dictionary ConfigCategoryDefinitions; private static readonly KeyCode[] KeyCodeCycleOrder; private static readonly HashSet ForceModifiersHiddenIds; private static readonly List CreditsEntries; private MenuPage repoMenuPage; private GameObject repoMenuPageObject; private bool isOpen; private static int customPageIndexCounter; private static FieldInfo currentMenuPageField; private static FieldInfo currentMenuPageIndexField; private static FieldInfo pageUnderThisPageField; private static FieldInfo pageIsOnTopField; private static FieldInfo buttonTextField; private static FieldInfo addedPageOnTopField; private static FieldInfo addedPagesOnTopField; private static FieldInfo menuIdField; private static FieldInfo selectableParentPageField; private static FieldInfo selectableRectTransformField; private static FieldInfo selectableIsInScrollBoxField; private static FieldInfo selectableMenuScrollBoxField; private static FieldInfo buttonParentPageField; private static FieldInfo buttonPopUpField; private static FieldInfo buttonRectTransformField; private static FieldInfo buttonMenuSelectableElementField; private static FieldInfo buttonMenuScrollBoxField; private static FieldInfo buttonScrollRectField; private static FieldInfo allMenuButtonsField; private static FieldInfo selectableElementsField; private static MethodInfo pageInactiveAddMethod; private static MethodInfo lateStartMethod; private static MethodInfo popupReinitializeSelectableElementsMethod; static REPOMenuManager() { //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: 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_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: 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_0245: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_024f: 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_0291: 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_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: 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_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0312: Unknown result type (might be due to invalid IL or missing references) //IL_034a: Unknown result type (might be due to invalid IL or missing references) //IL_034f: 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_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0396: Unknown result type (might be due to invalid IL or missing references) //IL_03cd: Unknown result type (might be due to invalid IL or missing references) //IL_03d2: Unknown result type (might be due to invalid IL or missing references) //IL_03d7: Unknown result type (might be due to invalid IL or missing references) //IL_040b: Unknown result type (might be due to invalid IL or missing references) //IL_0410: Unknown result type (might be due to invalid IL or missing references) //IL_0415: Unknown result type (might be due to invalid IL or missing references) ConfigCategoryDefinitions = new Dictionary(StringComparer.OrdinalIgnoreCase) { { "EconomyModifiers", new ConfigCategoryDefinition("Economy/Modifiers", "Economy", "LevelScale", "Limit", "EconomyChance", "CustomEconomyChance", "Event Modifiers", "Forced Modifiers") }, { "Difficulty", new ConfigCategoryDefinition("Difficulty", "Difficulty System", "Enemy HP Scaling", "Enemy Cap Scaling", "Map Value Scaling", "Upgrades Rework") }, { "LevelShop", new ConfigCategoryDefinition("Level/Shop", "Level Scaling", "Moon Scaling", "Shop Economy", "Seed Settings") }, { "UI", new ConfigCategoryDefinition("UI Settings", "UI Settings", "Player Revival", "Debug") } }; KeyCode[] array = new KeyCode[20]; RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/); KeyCodeCycleOrder = (KeyCode[])(object)array; ForceModifiersHiddenIds = new HashSet(StringComparer.OrdinalIgnoreCase) { "scale_in_cart", "shrink_extraction_valuables" }; CreditsEntries = new List { new CreditEntry { name = "Pxntxrez", description = "Main developer of REPOConomyPlus. Recreated this mod from a friend's idea for an economy mod, and it grew into the large REPOConomyPlus project. Thank you all for the support.", color = Color32.op_Implicit(new Color32((byte)0, (byte)122, byte.MaxValue, byte.MaxValue)) }, new CreditEntry { name = "McHorse", description = "Thank you for making videos with my mod, giving advice, and helping promote it.\n\nThank you, Horse!\nYouTube: @HORSIQ", color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)20, (byte)147, byte.MaxValue)) }, new CreditEntry { name = "Darkmega", description = "Thank you for streaming with my mod, helping improve it with advice, and reporting bugs.\n\nYouTube: @DarkmegaGaming", color = Color32.op_Implicit(new Color32((byte)126, (byte)87, (byte)194, byte.MaxValue)) }, new CreditEntry { name = "larion", description = "My friend. Thank you for helping test the mod for bugs and errors, and for sharing useful feedback.", color = Color32.op_Implicit(new Color32((byte)38, (byte)198, (byte)218, byte.MaxValue)) }, new CreditEntry { name = "Crony", description = "Thank you for advice on improving the mod and for reporting bugs.", color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)167, (byte)38, byte.MaxValue)) }, new CreditEntry { name = "Jettcodey", description = "Thank you for allowing me to improve REPORoles_Classic so it does not conflict with my mod.", color = Color32.op_Implicit(new Color32((byte)102, (byte)187, (byte)106, byte.MaxValue)) }, new CreditEntry { name = "garrett", description = "Thank you for reporting bugs.", color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)202, (byte)40, byte.MaxValue)) }, new CreditEntry { name = "Lorchibo", description = "Thank you for reporting bugs too. Sad that you left my Discord server.", color = Color32.op_Implicit(new Color32((byte)120, (byte)144, (byte)156, byte.MaxValue)) }, new CreditEntry { name = "SikkiNixxs", description = "Thank you for reporting bugs and for giving advice that helps improve my mod.", color = Color32.op_Implicit(new Color32((byte)171, (byte)71, (byte)188, byte.MaxValue)) }, new CreditEntry { name = "butcher_cka", description = "The friend who gave me the original idea for creating an economy mod, which later became the large REPOConomyPlus project.", color = Color32.op_Implicit(new Color32(byte.MaxValue, (byte)179, (byte)0, byte.MaxValue)) }, new CreditEntry { name = "nowylaptopjakuba", description = "Thank you for taking part in the beta test and reporting bugs, and for the awesome ideas that became a whole pack of new modifiers!", color = Color32.op_Implicit(new Color32((byte)0, (byte)200, (byte)83, byte.MaxValue)) } }; customPageIndexCounter = -100; currentMenuPageField = AccessTools.Field(typeof(MenuManager), "currentMenuPage"); currentMenuPageIndexField = AccessTools.Field(typeof(MenuManager), "currentMenuPageIndex"); addedPagesOnTopField = AccessTools.Field(typeof(MenuManager), "addedPagesOnTop"); pageUnderThisPageField = AccessTools.Field(typeof(MenuPage), "pageUnderThisPage"); pageIsOnTopField = AccessTools.Field(typeof(MenuPage), "pageIsOnTopOfOtherPage"); addedPageOnTopField = AccessTools.Field(typeof(MenuPage), "addedPageOnTop"); buttonTextField = AccessTools.Field(typeof(MenuButton), "buttonText"); menuIdField = AccessTools.Field(typeof(MenuSelectableElement), "menuID"); selectableParentPageField = AccessTools.Field(typeof(MenuSelectableElement), "parentPage"); selectableRectTransformField = AccessTools.Field(typeof(MenuSelectableElement), "rectTransform"); selectableIsInScrollBoxField = AccessTools.Field(typeof(MenuSelectableElement), "isInScrollBox"); selectableMenuScrollBoxField = AccessTools.Field(typeof(MenuSelectableElement), "menuScrollBox"); buttonParentPageField = AccessTools.Field(typeof(MenuButton), "parentPage"); buttonPopUpField = AccessTools.Field(typeof(MenuButton), "menuButtonPopUp"); buttonRectTransformField = AccessTools.Field(typeof(MenuButton), "rectTransform"); buttonMenuSelectableElementField = AccessTools.Field(typeof(MenuButton), "menuSelectableElement"); buttonMenuScrollBoxField = AccessTools.Field(typeof(MenuButton), "menuScrollBox"); buttonScrollRectField = AccessTools.Field(typeof(MenuButton), "scrollRect"); allMenuButtonsField = AccessTools.Field(typeof(MenuManager), "allMenuButtons"); selectableElementsField = AccessTools.Field(typeof(MenuPage), "selectableElements"); pageInactiveAddMethod = AccessTools.Method(typeof(MenuManager), "PageInactiveAdd", (Type[])null, (Type[])null); lateStartMethod = AccessTools.Method(typeof(MenuPage), "LateStart", (Type[])null, (Type[])null); popupReinitializeSelectableElementsMethod = AccessTools.Method(typeof(REPOPopupPage), "ReinitializeSelectableElements", (Type[])null, (Type[])null); } private static REPOLabel AddLabelElement(REPOPopupPage page, string text, float fontSize = 18f) { //IL_000e: 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) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) REPOLabel rEPOLabel = REPOUIFactory.CreateLabel(text, (Transform)(object)page.menuScrollBox.scroller); if ((Object)(object)rEPOLabel != (Object)null && (Object)(object)rEPOLabel.labelTMP != (Object)null) { ((TMP_Text)rEPOLabel.labelTMP).fontSize = fontSize; ((TMP_Text)rEPOLabel.labelTMP).enableWordWrapping = true; ((TMP_Text)rEPOLabel.labelTMP).overflowMode = (TextOverflowModes)0; ((TMP_Text)rEPOLabel.labelTMP).alignment = (TextAlignmentOptions)513; Vector2 preferredValues = ((TMP_Text)rEPOLabel.labelTMP).GetPreferredValues(text ?? string.Empty, 235f, 0f); rEPOLabel.rectTransform.sizeDelta = new Vector2(235f, Mathf.Max(rEPOLabel.rectTransform.sizeDelta.y, preferredValues.y + 6f)); ((TMP_Text)rEPOLabel.labelTMP).rectTransform.sizeDelta = rEPOLabel.rectTransform.sizeDelta; page.AddElementToScrollView(rEPOLabel.rectTransform, Vector2.zero, 2f, 1f); } page.scrollView.UpdateElements(); return rEPOLabel; } private static void AddLabel(REPOPopupPage page, string text, float fontSize = 18f) { AddLabelElement(page, text, fontSize); } private static REPOScrollViewElement AddSpacer(REPOPopupPage page, float height) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) RectTransform val = new GameObject("Spacer").AddComponent(); val.sizeDelta = new Vector2(100f, height); page.AddElementToScrollView(val, Vector2.zero); page.scrollView.UpdateElements(); return ((Component)val).GetComponent(); } private static REPOToggle AddToggle(REPOPopupPage page, string text, bool defaultValue, Action onToggle) { //IL_000d: 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) REPOToggle rEPOToggle = REPOUIFactory.CreateToggle(text, onToggle, (Transform)(object)page.menuScrollBox.scroller, Vector2.zero, "ON", "OFF", defaultValue); if ((Object)(object)rEPOToggle != (Object)null) { page.AddElementToScrollView(rEPOToggle.rectTransform, Vector2.zero, 1f, 1f); } page.scrollView.UpdateElements(); return rEPOToggle; } private static REPOSlider AddSlider(REPOPopupPage page, string text, string description, float min, float max, float defaultValue, Action onValueChanged, int precision = 2, string prefix = "", string postfix = "") { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) REPOSlider rEPOSlider = REPOUIFactory.CreateSlider(text, description ?? string.Empty, onValueChanged, (Transform)(object)page.menuScrollBox.scroller, min, max, defaultValue, Vector2.zero, precision, prefix, postfix); if ((Object)(object)rEPOSlider != (Object)null) { page.AddElementToScrollView(rEPOSlider.rectTransform, Vector2.zero, 1f, 1f); } page.scrollView.UpdateElements(); return rEPOSlider; } private static REPOInputField AddInputField(REPOPopupPage page, string text, string placeholder, string defaultValue, Action onValueChanged, bool onlyNotifyOnSubmit = true) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) REPOInputField rEPOInputField = REPOUIFactory.CreateInputField(text, placeholder, onValueChanged, (Transform)(object)page.menuScrollBox.scroller, defaultValue ?? string.Empty, Vector2.zero); if ((Object)(object)rEPOInputField != (Object)null) { if ((Object)(object)rEPOInputField.inputStringSystem != (Object)null) { rEPOInputField.inputStringSystem.onlyNotifyOnSubmit = onlyNotifyOnSubmit; } page.AddElementToScrollView(rEPOInputField.rectTransform, Vector2.zero, 1f, 1f); } page.scrollView.UpdateElements(); return rEPOInputField; } private static MenuButton AddMenuButton(REPOPopupPage page, string text, Action onClick, Vector2 localPosition = default(Vector2), Vector2? overrideSize = null, float? topPadding = null, float? bottomPadding = null) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) MenuButton val = REPOUIFactory.CreateMenuButtonNative(text, onClick, (Transform)(object)page.menuScrollBox.scroller, localPosition, overrideSize); RectTransform val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { page.AddElementToScrollView(val2, localPosition, topPadding.GetValueOrDefault(1f), bottomPadding.GetValueOrDefault(1f)); ((Transform)val2).localScale = Vector3.one; } page.scrollView.UpdateElements(); return val; } private static void SetMenuButtonText(MenuButton menuButton, string text) { if (!((Object)(object)menuButton == (Object)null)) { menuButton.buttonTextString = text ?? string.Empty; object? obj = buttonTextField?.GetValue(menuButton); TextMeshProUGUI val = (TextMeshProUGUI)((obj is TextMeshProUGUI) ? obj : null); if ((Object)(object)val == (Object)null) { val = ((Component)menuButton).GetComponentInChildren(); } if ((Object)(object)val != (Object)null) { ((TMP_Text)val).text = text ?? string.Empty; } ResizeMenuButtonToText(menuButton, val, ((Object)(object)val != (Object)null) ? ((TMP_Text)val).text : text); } } private static void ResizeMenuButtonToText(MenuButton menuButton, TextMeshProUGUI tmp, string text) { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0047: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)menuButton == (Object)null)) { RectTransform component = ((Component)menuButton).GetComponent(); if (!((Object)(object)component == (Object)null) && !((Object)(object)tmp == (Object)null)) { Vector2 preferredValues = ((TMP_Text)tmp).GetPreferredValues(text ?? string.Empty); component.sizeDelta = new Vector2(preferredValues.x, component.sizeDelta.y); menuButton.rectTransformSelection = component; } } } private static RectTransform AddButton(REPOPopupPage page, string text, Action onClick, Vector2 localPosition = default(Vector2), Vector2? overrideSize = null, float? topPadding = null, float? bottomPadding = null) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) MenuButton val = REPOUIFactory.CreateMenuButtonNative(text, onClick, (Transform)(object)page.menuScrollBox.scroller, localPosition, overrideSize); RectTransform val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { page.AddElementToScrollView(val2, localPosition, topPadding.GetValueOrDefault(1f), bottomPadding.GetValueOrDefault(1f)); ((Transform)val2).localScale = Vector3.one; } page.scrollView.UpdateElements(); return val2; } private static void AddBinding(List bindings, ConfigEntry configEntry, REPOToggle toggle) { if (bindings != null && configEntry != null && !((Object)(object)toggle == (Object)null)) { bindings.Add(new ToggleBinding { configEntry = configEntry, toggle = toggle }); } } private static void AddSectionElements(Dictionary> sectionElements, string sectionKey, params REPOScrollViewElement[] elements) { if (sectionElements == null || string.IsNullOrWhiteSpace(sectionKey) || elements == null) { return; } if (!sectionElements.TryGetValue(sectionKey, out var value)) { value = (sectionElements[sectionKey] = new List()); } foreach (REPOScrollViewElement rEPOScrollViewElement in elements) { if ((Object)(object)rEPOScrollViewElement != (Object)null) { value.Add(rEPOScrollViewElement); } } } private static string BuildSearchText(string rawText) { if (string.IsNullOrWhiteSpace(rawText)) { return string.Empty; } string text = FormatConfigKey(rawText); if (string.Equals(text, rawText, StringComparison.OrdinalIgnoreCase)) { return text; } return rawText + " " + text; } private static bool ShouldHideFromForceModifiers(string modifierKey) { if (string.IsNullOrWhiteSpace(modifierKey)) { return false; } string text = modifierKey.Trim(); if (text.StartsWith("Enable ", StringComparison.OrdinalIgnoreCase)) { text = text.Substring("Enable ".Length).Trim(); } return ForceModifiersHiddenIds.Contains(text); } private static void RegisterSearchEntry(List entries, string sectionKey, string text, RectTransform rectTransform) { if (entries != null && !((Object)(object)rectTransform == (Object)null)) { REPOScrollViewElement component = ((Component)rectTransform).GetComponent(); if (!((Object)(object)component == (Object)null)) { entries.Add(new SearchEntry { element = component, sectionKey = sectionKey, text = BuildSearchText(text) }); } } } private static void ApplySearchFilter(string query, List entries, Dictionary> sectionElements = null) { if (entries == null) { return; } string text = (query ?? string.Empty).Trim(); bool flag = text.Length == 0; HashSet hashSet = (flag ? null : new HashSet(StringComparer.OrdinalIgnoreCase)); foreach (SearchEntry entry in entries) { if (!((Object)(object)entry?.element == (Object)null)) { bool flag2 = flag || (!string.IsNullOrEmpty(entry.text) && entry.text.IndexOf(text, StringComparison.OrdinalIgnoreCase) >= 0); entry.element.visibility = flag2; if (flag2 && hashSet != null && !string.IsNullOrWhiteSpace(entry.sectionKey)) { hashSet.Add(entry.sectionKey); } } } if (sectionElements == null) { return; } foreach (KeyValuePair> sectionElement in sectionElements) { bool visibility = flag || (hashSet?.Contains(sectionElement.Key) ?? false); foreach (REPOScrollViewElement item in sectionElement.Value) { if ((Object)(object)item != (Object)null) { item.visibility = visibility; } } } } private static REPOInputField AddSearchField(REPOPopupPage page, string placeholder, List entries, Dictionary> sectionElements = null) { return AddInputField(page, "Search", placeholder, string.Empty, delegate(string query) { ApplySearchFilter(query, entries, sectionElements); }, onlyNotifyOnSubmit: false); } private static void SetAllToggleValues(List bindings, bool? fixedValue = null, bool resetToDefault = false) { if (bindings == null) { return; } foreach (ToggleBinding binding in bindings) { if (binding?.configEntry != null) { bool flag = (resetToDefault ? ((bool)((ConfigEntryBase)binding.configEntry).DefaultValue) : fixedValue.GetValueOrDefault()); binding.configEntry.Value = flag; binding.toggle?.SetState(flag, invokeCallback: false); } } } private static RectTransform CreateButtonRow(REPOPopupPage page, float topPadding = 0f, float bottomPadding = 0f) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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_006a: 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_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_008d: 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_00aa: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)page == (Object)null || (Object)(object)page.menuScrollBox == (Object)null) { return null; } GameObject val = new GameObject("Bulk Buttons Row", new Type[1] { typeof(RectTransform) }); RectTransform component = val.GetComponent(); ((Transform)component).SetParent((Transform)(object)page.menuScrollBox.scroller, false); Vector2 val2 = default(Vector2); ((Vector2)(ref val2))..ctor(0f, 0f); component.pivot = val2; Vector2 anchorMin = (component.anchorMax = val2); component.anchorMin = anchorMin; ((Transform)component).localScale = Vector3.one; component.sizeDelta = new Vector2(360f, 24f); ((Transform)component).localPosition = Vector3.zero; val.AddComponent(); page.AddElementToScrollView(component, Vector2.zero, topPadding, bottomPadding); return component; } private static float GetPopupButtonsCenterX(REPOPopupPage page) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)page?.maskRectTransform == (Object)null) { return 120f; } return page.maskRectTransform.sizeDelta.x * 0.5f - 57f; } private static void RefreshPopupSelectables(REPOPopupPage page) { if (!((Object)(object)page == (Object)null)) { popupReinitializeSelectableElementsMethod?.Invoke(page, null); } } private static RectTransform AddInlineButton(Transform parent, string text, Action onClick, Vector2 localPosition, Vector2? overrideSize = null) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_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) MenuButton val = REPOUIFactory.CreateMenuButtonNative(text, onClick, parent, localPosition, overrideSize); RectTransform val2 = (((Object)(object)val != (Object)null) ? ((Component)val).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { ((Transform)val2).localScale = Vector3.one; ((Transform)val2).localPosition = new Vector3(localPosition.x, localPosition.y, ((Transform)val2).localPosition.z); } return val2; } private static float GetButtonWidth(RectTransform rt, float fallback = 100f) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_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_0021: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)rt == (Object)null) { return fallback; } Rect rect = rt.rect; if (!(((Rect)(ref rect)).width > 0f)) { return rt.sizeDelta.x; } rect = rt.rect; return ((Rect)(ref rect)).width; } private static void ShowResetAllConfirmation(string title, Action onConfirm) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) REPOPopupPage confirmPage = REPOUIFactory.CreatePopupPage(title, pageDimmerVisibility: false, 1f, (Vector2?)new Vector2(40f, 0f)); if ((Object)(object)confirmPage == (Object)null) { onConfirm?.Invoke(); return; } AddLabel(confirmPage, "Reset all settings?", 20f); AddLabel(confirmPage, "Are you sure?", 20f); AddSpacer(confirmPage, 4f); RectTransform val = CreateButtonRow(confirmPage, 1f, 1f); if ((Object)(object)val != (Object)null) { float popupButtonsCenterX = GetPopupButtonsCenterX(confirmPage); RectTransform val2 = AddInlineButton((Transform)(object)val, "YES", (Action)delegate { onConfirm?.Invoke(); confirmPage.ClosePage(); }, Vector2.zero, (Vector2?)new Vector2(64f, 24f)); RectTransform val3 = AddInlineButton((Transform)(object)val, "NO", (Action)delegate { confirmPage.ClosePage(); }, Vector2.zero, (Vector2?)new Vector2(64f, 24f)); float buttonWidth = GetButtonWidth(val2, 64f); float buttonWidth2 = GetButtonWidth(val3, 64f); float num = popupButtonsCenterX - 6f - buttonWidth * 0.5f; float num2 = popupButtonsCenterX + 6f + buttonWidth2 * 0.5f; if ((Object)(object)val2 != (Object)null) { ((Transform)val2).localPosition = new Vector3(num, 0f, ((Transform)val2).localPosition.z); } if ((Object)(object)val3 != (Object)null) { ((Transform)val3).localPosition = new Vector3(num2, 0f, ((Transform)val3).localPosition.z); } } RefreshPopupSelectables(confirmPage); confirmPage.scrollView.UpdateElements(); ShowPage(confirmPage); } private static void AddBulkButtons(REPOPopupPage page, List bindings, string confirmTitle, Action resetAllAction = null) { //IL_004e: 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_00e9: 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_0088: 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_015e: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) float popupButtonsCenterX = GetPopupButtonsCenterX(page); RectTransform val = CreateButtonRow(page, 7f, 1f); if ((Object)(object)val != (Object)null) { RectTransform val2 = AddInlineButton((Transform)(object)val, "RESET TO DEFAULT", delegate { ShowResetAllConfirmation(confirmTitle, delegate { if (resetAllAction != null) { resetAllAction(); } else { SetAllToggleValues(bindings, null, resetToDefault: true); } }); }, Vector2.zero); if ((Object)(object)val2 != (Object)null) { ((Transform)val2).localPosition = new Vector3(popupButtonsCenterX + -21f, 0f, ((Transform)val2).localPosition.z); } } RectTransform val3 = CreateButtonRow(page, 0f, 1f); if ((Object)(object)val3 != (Object)null) { RectTransform val4 = AddInlineButton((Transform)(object)val3, "DISABLE ALL", delegate { SetAllToggleValues(bindings, false); }, Vector2.zero); RectTransform val5 = AddInlineButton((Transform)(object)val3, "ENABLE ALL", delegate { SetAllToggleValues(bindings, true); }, Vector2.zero); float buttonWidth = GetButtonWidth(val4, 120f); float buttonWidth2 = GetButtonWidth(val5, 120f); float num = popupButtonsCenterX - 6f - buttonWidth * 0.5f; float num2 = popupButtonsCenterX + 6f + buttonWidth2 * 0.5f; if ((Object)(object)val4 != (Object)null) { ((Transform)val4).localPosition = new Vector3(num, 0f, ((Transform)val4).localPosition.z); } if ((Object)(object)val5 != (Object)null) { ((Transform)val5).localPosition = new Vector3(num2, 0f, ((Transform)val5).localPosition.z); } } RefreshPopupSelectables(page); page.scrollView.UpdateElements(); } private static void ApplyMenuButtonColors(MenuButton button, Color normalColor) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0045: 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_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) //IL_0088: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)button == (Object)null)) { button.customColors = true; button.colorNormal = normalColor; button.colorHover = Color.Lerp(normalColor, Color.white, 0.35f); Color val = default(Color); ((Color)(ref val))..ctor(1f, 0.9f, 0.3f); button.colorClick = Color.Lerp(normalColor, val, 0.5f); object? obj = buttonTextField?.GetValue(button); TextMeshProUGUI val2 = (TextMeshProUGUI)((obj is TextMeshProUGUI) ? obj : null); if ((Object)(object)val2 == (Object)null) { val2 = ((Component)button).GetComponentInChildren(); } if ((Object)(object)val2 != (Object)null) { ((Graphic)val2).color = normalColor; } } } private static void ApplyMenuButtonPulse(MenuButton button, Color colorA, Color colorB, float speed = 4f) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)button == (Object)null) { return; } object? obj = buttonTextField?.GetValue(button); TextMeshProUGUI val = (TextMeshProUGUI)((obj is TextMeshProUGUI) ? obj : null); if ((Object)(object)val == (Object)null) { val = ((Component)button).GetComponentInChildren(); } if (!((Object)(object)val == (Object)null)) { PulseTextColor pulseTextColor = ((Component)button).gameObject.GetComponent(); if ((Object)(object)pulseTextColor == (Object)null) { pulseTextColor = ((Component)button).gameObject.AddComponent(); } pulseTextColor.target = val; pulseTextColor.colorA = colorA; pulseTextColor.colorB = colorB; pulseTextColor.speed = speed; } } private static Color GetChallengeProgressColor(int completedTiers, bool active) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_005f: 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_0089: Unknown result type (might be due to invalid IL or missing references) if (active) { return new Color(0.25f, 0.9f, 1f); } if (completedTiers >= ChallengeManager.Targets.Length) { return new Color(0.2f, 1f, 0.35f); } return (Color)(Mathf.Clamp(completedTiers, 0, ChallengeManager.Targets.Length) switch { 1 => new Color(1f, 0.52f, 0.16f), 2 => new Color(1f, 0.86f, 0.22f), _ => new Color(0.62f, 0.68f, 0.78f), }); } private static string GetChallengeStatusText(int completedTiers, bool active) { string text = ((completedTiers >= ChallengeManager.Targets.Length) ? "MASTERED" : $"{Mathf.Clamp(completedTiers, 0, ChallengeManager.Targets.Length)}/{ChallengeManager.Targets.Length}"); if (!active) { return text; } return "ACTIVE -> " + text; } private static string FormatCompactMoney(long value) { if (value > int.MaxValue) { return "$" + value.ToString("#,0", new CultureInfo("de-DE")) + "K"; } if (value < int.MinValue) { return "$" + value.ToString("#,0", new CultureInfo("de-DE")) + "K"; } return "$" + SemiFunc.DollarGetString((int)value) + "K"; } private static string GetChallengeContextText() { ChallengeDefinition activeChallenge = ChallengeManager.ActiveChallenge; if (activeChallenge == null) { return "Challenge: none"; } return $"Challenge: {activeChallenge.name} -> Level {ChallengeManager.ActiveTarget}"; } private static REPOLabel AddChallengeInfoLabel(REPOPopupPage page, string text, float fontSize, Color color, float height) { //IL_000e: 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) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: 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) REPOLabel rEPOLabel = REPOUIFactory.CreateLabel(text, (Transform)(object)page.menuScrollBox.scroller); if ((Object)(object)rEPOLabel != (Object)null && (Object)(object)rEPOLabel.labelTMP != (Object)null) { ((TMP_Text)rEPOLabel.labelTMP).fontSize = fontSize; ((TMP_Text)rEPOLabel.labelTMP).enableWordWrapping = true; ((TMP_Text)rEPOLabel.labelTMP).overflowMode = (TextOverflowModes)2; ((TMP_Text)rEPOLabel.labelTMP).alignment = (TextAlignmentOptions)513; ((Graphic)rEPOLabel.labelTMP).color = color; rEPOLabel.rectTransform.sizeDelta = new Vector2(235f, height); ((TMP_Text)rEPOLabel.labelTMP).rectTransform.sizeDelta = rEPOLabel.rectTransform.sizeDelta; page.AddElementToScrollView(rEPOLabel.rectTransform, Vector2.zero, 1f, 2f); } page.scrollView.UpdateElements(); return rEPOLabel; } private static bool TryGetEconomyIdFromConfigKey(string configKey, out string economyId, out bool isCustom) { economyId = string.Empty; isCustom = false; if (string.IsNullOrWhiteSpace(configKey)) { return false; } string text = configKey.Trim(); if (text.StartsWith("Enable Custom ", StringComparison.OrdinalIgnoreCase)) { isCustom = true; economyId = text.Substring("Enable Custom ".Length).Trim(); return !string.IsNullOrWhiteSpace(economyId); } if (text.StartsWith("Enable ", StringComparison.OrdinalIgnoreCase)) { economyId = text.Substring("Enable ".Length).Trim(); return !string.IsNullOrWhiteSpace(economyId); } economyId = text; return !string.IsNullOrWhiteSpace(economyId); } private static bool TryGetShopTypeFromConfigKey(string configKey, out ShopEconomyType type) { type = ShopEconomyType.NormalPrices; if (string.IsNullOrWhiteSpace(configKey)) { return false; } string text = configKey.Trim(); if (text.StartsWith("Enable Shop ", StringComparison.OrdinalIgnoreCase)) { text = text.Substring("Enable Shop ".Length).Trim(); } return Enum.TryParse(text, ignoreCase: true, out type); } private static Color GetCustomEconomyColor(CustomEconomyData custom, Color fallback) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (custom?.color == null || custom.color.Length < 3) { return fallback; } return new Color(custom.color[0] / 255f, custom.color[1] / 255f, custom.color[2] / 255f); } private static string GetEnglishCustomEconomyName(CustomEconomyData custom) { if (custom == null) { return string.Empty; } return custom.name_en ?? string.Empty; } private static string GetEnglishCustomEconomyDescription(CustomEconomyData custom) { if (custom == null) { return string.Empty; } return custom.desc_en ?? string.Empty; } private static string FirstNonEmpty(params string[] values) { if (values == null) { return string.Empty; } foreach (string text in values) { if (!string.IsNullOrWhiteSpace(text)) { return text; } } return string.Empty; } private static string BuildLockedEntryMessage(string entryType) { return "You have not unlocked this " + entryType + " yet.\n\nKeep playing to discover it."; } private static string BuildStatsDetailsMessage(int firstSeenLevel, int occurrences, string description) { string text = ((firstSeenLevel > 0) ? firstSeenLevel.ToString() : "Unknown"); string text2 = (string.IsNullOrWhiteSpace(description) ? "No description available." : description); return "First discovered at progression level: " + text + "\n" + $"Occurrences: {occurrences}\n\n" + text2; } private static List BuildEconomyStatsDescriptors() { //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) List list = new List(); if (REPOConfig.EconomyEnables == null) { return list; } HashSet hashSet = new HashSet(StringComparer.OrdinalIgnoreCase); foreach (string item in REPOConfig.EconomyEnables.Keys.OrderBy((string k) => k, StringComparer.OrdinalIgnoreCase)) { if (TryGetEconomyIdFromConfigKey(item, out var economyId, out var _) && hashSet.Add(economyId)) { string fallbackName = FirstNonEmpty(REPOConomyPlugin.GetEconomyNameForId(economyId), FormatConfigKey(economyId)); string fallbackDescription = FirstNonEmpty(REPOConomyPlugin.GetEconomyFlavorForId(economyId), "Economy event affecting value range."); Color economyColorForId = REPOConomyPlugin.GetEconomyColorForId(economyId, Color.white); list.Add(new EconomyStatsDescriptor { id = economyId, fallbackName = fallbackName, fallbackDescription = fallbackDescription, fallbackColor = economyColorForId }); } } return list; } private static List BuildShopStatsDescriptors() { List result = new List(); HashSet seenIds = new HashSet(StringComparer.OrdinalIgnoreCase); AddDescriptor(ShopEconomyType.NormalPrices); if (REPOConfig.ShopEconomyEnables == null) { return result; } foreach (string item in REPOConfig.ShopEconomyEnables.Keys.OrderBy((string k) => k, StringComparer.OrdinalIgnoreCase)) { if (TryGetShopTypeFromConfigKey(item, out var type2)) { AddDescriptor(type2); } } return result; void AddDescriptor(ShopEconomyType type) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) string text = type.ToString(); if (seenIds.Add(text)) { result.Add(new ShopStatsDescriptor { id = text, type = type, fallbackName = ShopEconomyManager.GetShopEconomyName(type, "English"), fallbackDescription = ShopEconomyManager.GetShopEconomyDescription(type, "English"), fallbackColor = ShopEconomyManager.GetShopEconomyColor(type) }); } } } private static string GetModifierTypeLabel(EventType type) { return type switch { EventType.VeryBad => "Very Bad", EventType.Bad => "Bad", EventType.Neutral => "Neutral", EventType.Good => "Good", EventType.VeryGood => "Very Good", _ => type.ToString(), }; } private static void ShowPage(REPOPopupPage page) { ((Component)page).gameObject.SetActive(true); page.OpenPage(openOnTop: true); page.scrollView.UpdateElements(); } private void Awake() { if ((Object)(object)instance == (Object)null) { instance = this; Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject); REPOConomyPlugin.Logger.LogInfo((object)"[Menu] REPOMenuManager instance created"); } else { Object.Destroy((Object)(object)((Component)this).gameObject); } } public void OpenMenu() { REPOConomyPlugin.Logger.LogInfo((object)"[Menu] OpenMenu() called"); if ((Object)(object)MenuManager.instance == (Object)null) { REPOConomyPlugin.Logger.LogError((object)"[Menu] MenuManager.instance is null!"); return; } if ((Object)(object)MenuHolder.instance == (Object)null) { REPOConomyPlugin.Logger.LogError((object)"[Menu] MenuHolder.instance is null!"); return; } try { CreateMenuPage(); if ((Object)(object)repoMenuPage != (Object)null) { isOpen = true; REPOConomyPlugin.Logger.LogInfo((object)"[Menu] REPOConomyPlus menu opened successfully!"); } } catch (Exception arg) { REPOConomyPlugin.Logger.LogError((object)$"[Menu] Failed to open menu: {arg}"); } } private void CreateMenuPage() { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Invalid comparison between Unknown and I4 //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) REPOConomyPlugin.Logger.LogInfo((object)"[Menu] Creating menu page by cloning Settings page..."); GameObject val = null; foreach (MenuPages menuPage in MenuManager.instance.menuPages) { if ((int)menuPage.menuPageIndex == 2) { val = menuPage.menuPage; break; } } if ((Object)(object)val == (Object)null) { REPOConomyPlugin.Logger.LogError((object)"[Menu] Settings page prefab not found!"); return; } REPOConomyPlugin.Logger.LogInfo((object)("[Menu] Found Settings prefab: " + ((Object)val).name)); repoMenuPageObject = Object.Instantiate(val, ((Component)MenuHolder.instance).transform, true); ((Object)repoMenuPageObject).name = "Menu Page - REPOConomyPlus"; RectTransform component = repoMenuPageObject.GetComponent(); ((Transform)component).localPosition = Vector3.zero; ((Transform)component).localScale = Vector3.one; repoMenuPage = repoMenuPageObject.GetComponent(); if ((Object)(object)repoMenuPage.menuHeader != (Object)null) { ((TMP_Text)repoMenuPage.menuHeader).text = "REPOConomyPlus"; repoMenuPage.menuHeaderName = "REPOConomyPlus"; } MenuPageSettings component2 = repoMenuPageObject.GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } StripNativeSettingsHandlers(repoMenuPageObject); repoMenuPage.menuPageIndex = (MenuPageIndex)(customPageIndexCounter--); ConfigureButtons(); ShowPageOnTop(repoMenuPage, repoMenuPageObject); REPOConomyPlugin.Logger.LogInfo((object)"[Menu] Menu page created and configured!"); } private void ConfigureButtons() { REPOConomyPlugin.Logger.LogInfo((object)"[Menu] Configuring buttons..."); MenuButton[] componentsInChildren = repoMenuPageObject.GetComponentsInChildren(true); REPOConomyPlugin.Logger.LogInfo((object)$"[Menu] Found {componentsInChildren.Length} buttons"); string[] array = new string[6] { "Statistics", "Challenges", "Config", "Economy/Modifiers", "Credits", "Close" }; Action[] array2 = new Action[6] { delegate { OpenSubPage("Statistics"); }, delegate { OpenSubPage("Challenges"); }, delegate { OpenSubPage("Config"); }, delegate { OpenSubPage("EconomyModifiers"); }, delegate { OpenSubPage("Credits"); }, delegate { CloseMenu(); } }; componentsInChildren = EnsureButtonCount(repoMenuPageObject, componentsInChildren, array.Length); for (int i = 0; i < componentsInChildren.Length && i < array.Length; i++) { ConfigureButton(componentsInChildren[i], array[i], array2[i]); } NormalizeMainButtonSpacing(componentsInChildren, array.Length); for (int j = array.Length; j < componentsInChildren.Length; j++) { ((Component)componentsInChildren[j]).gameObject.SetActive(false); } ReinitializeSelectableElements(); } private static MenuButton[] EnsureButtonCount(GameObject pageObject, MenuButton[] buttons, int needed) { //IL_0079: 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_0096: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)pageObject == (Object)null || buttons == null || buttons.Length == 0 || buttons.Length >= needed) { return buttons; } MenuButton val = buttons[^1]; Transform parent = ((Component)val).transform.parent; RectTransform component = ((Component)val).GetComponent(); for (int i = buttons.Length; i < needed; i++) { GameObject obj = Object.Instantiate(((Component)val).gameObject, parent); ((Object)obj).name = $"Menu Button - Extra {i}"; RectTransform component2 = obj.GetComponent(); if ((Object)(object)component2 != (Object)null && (Object)(object)component != (Object)null) { component2.anchoredPosition = component.anchoredPosition + new Vector2(0f, -25f * (float)(i - buttons.Length + 1)); } obj.SetActive(true); } return pageObject.GetComponentsInChildren(true); } private static void NormalizeMainButtonSpacing(MenuButton[] buttons, int count) { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00bb: Unknown result type (might be due to invalid IL or missing references) if (buttons == null || buttons.Length == 0) { return; } int num = Mathf.Min(count, buttons.Length); MenuButton obj = buttons[0]; RectTransform val = ((obj != null) ? ((Component)obj).GetComponent() : null); if ((Object)(object)val == (Object)null) { return; } float num2 = 34f; if (num > 1) { MenuButton obj2 = buttons[1]; RectTransform val2 = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); if ((Object)(object)val2 != (Object)null) { num2 = Mathf.Max(34f, Mathf.Abs(val.anchoredPosition.y - val2.anchoredPosition.y)); } } Vector2 anchoredPosition = val.anchoredPosition; for (int i = 0; i < num; i++) { MenuButton obj3 = buttons[i]; RectTransform val3 = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); if (!((Object)(object)val3 == (Object)null)) { val3.anchoredPosition = new Vector2(val3.anchoredPosition.x, anchoredPosition.y - num2 * (float)i); } } } private void ConfigureButton(MenuButton menuButton, string text, Action onClick) { //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0173: Expected O, but got Unknown if ((Object)(object)menuButton == (Object)null) { return; } menuButton.buttonTextString = text; MenuButtonPopUp component = ((Component)menuButton).GetComponent(); if ((Object)(object)component != (Object)null) { Object.DestroyImmediate((Object)(object)component); } MenuButtonEsc component2 = ((Component)menuButton).GetComponent(); if ((Object)(object)component2 != (Object)null) { Object.DestroyImmediate((Object)(object)component2); } LocalizationChangedEvent[] componentsInChildren = ((Component)menuButton).GetComponentsInChildren(true); for (int i = 0; i < componentsInChildren.Length; i++) { Object.DestroyImmediate((Object)(object)componentsInChildren[i]); } buttonPopUpField?.SetValue(menuButton, null); object? obj = buttonTextField?.GetValue(menuButton); TextMeshProUGUI val = (TextMeshProUGUI)((obj is TextMeshProUGUI) ? obj : null); if ((Object)(object)val != (Object)null) { ((TMP_Text)val).text = text; } else { TextMeshProUGUI componentInChildren = ((Component)menuButton).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { ((TMP_Text)componentInChildren).text = text; } } TextMeshProUGUI[] componentsInChildren2 = ((Component)menuButton).GetComponentsInChildren(true); foreach (TextMeshProUGUI obj2 in componentsInChildren2) { ((TMP_Text)obj2).text = text; ((TMP_Text)obj2).enableWordWrapping = false; ((TMP_Text)obj2).overflowMode = (TextOverflowModes)0; } ((Object)((Component)menuButton).gameObject).name = "Menu Button - " + text; Button component3 = ((Component)menuButton).GetComponent