Decompiled source of REPOConomy v1.2.4

plugins/REPOConomy.dll

Decompiled 2 months ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json;
using Photon.Pun;
using Photon.Realtime;
using UnityEngine;
using UnityEngine.SceneManagement;

[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("REPOConomy")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("REPOConomy")]
[assembly: AssemblyTitle("REPOConomy")]
[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 REPOConomyMod
{
	[Serializable]
	public class CustomEconomyData
	{
		public string id;

		public string name_en;

		public string name_ru;

		public string desc_en;

		public string desc_ru;

		public float[] color;

		public float min;

		public float max;

		public bool useDelta;
	}
	public static class CustomEconomyLoader
	{
		public static List<CustomEconomyData> CustomEvents = new List<CustomEconomyData>();

		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<CustomEconomyData> list = JsonConvert.DeserializeObject<List<CustomEconomyData>>(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;

		private bool economyResetPending = true;

		private bool showGUI;

		private float displayTimer = 8f;

		private string lastSceneType = "";

		private void Awake()
		{
			Instance = this;
		}

		private void Update()
		{
			if (Input.GetKeyDown((KeyCode)103))
			{
				showGUI = !showGUI;
				displayTimer = 8f;
			}
			string currentSceneType = GetCurrentSceneType();
			if (currentSceneType != lastSceneType)
			{
				lastSceneType = currentSceneType;
				if ((currentSceneType == "Level" || currentSceneType == "Lobby") ? true : false)
				{
					economyResetPending = true;
					UIShownOnce = false;
					showGUI = false;
				}
			}
			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 == "Level")
			{
				displayTimer -= Time.deltaTime;
				if (displayTimer <= 0f)
				{
					showGUI = false;
				}
			}
		}

		private string GetCurrentSceneType()
		{
			if (SemiFunc.RunIsLevel())
			{
				return "Level";
			}
			if (SemiFunc.RunIsLobby())
			{
				return "Lobby";
			}
			return "Other";
		}

		public void ResetGUI()
		{
			showGUI = true;
			displayTimer = 8f;
		}

		public void ShowGUI()
		{
			showGUI = true;
			displayTimer = 8f;
		}

		private float ClampToStep(float value, float step = 0.1f)
		{
			return Mathf.Round(value / step) * step;
		}

		private void OnGUI()
		{
			//IL_0185: 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_0192: 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_01a0: 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_01b0: Expected O, but got Unknown
			//IL_01b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Expected O, but got Unknown
			//IL_01d2: 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_01ed: Expected O, but got Unknown
			//IL_01e8: 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_0203: Expected O, but got Unknown
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Expected O, but got Unknown
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: 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_02a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d2: Unknown result type (might be due to invalid IL or missing references)
			if (showGUI && REPOConomyPlugin.HasEconomy && SemiFunc.RunIsLevel())
			{
				int currentLevel = REPOConomyPlugin.GetCurrentLevel();
				float num3;
				float num4;
				if (PhotonNetwork.IsMasterClient)
				{
					float num = ClampToStep(REPOConfig.LevelScaleMin.Value);
					float num2 = ClampToStep(REPOConfig.LevelScaleMax.Value);
					num3 = (float)(currentLevel - 1) * num;
					num4 = (float)(currentLevel - 1) * num2;
				}
				else
				{
					num3 = REPOConomyPlugin.ClientDeltaMin;
					num4 = REPOConomyPlugin.ClientDeltaMax;
				}
				string economyName = REPOConomyPlugin.GetEconomyName();
				string text = REPOConomyPlugin.MinPercent.ToString("+#0.##;-#0.##;0");
				string text2 = REPOConomyPlugin.MaxPercent.ToString("+#0.##;-#0.##;0");
				string text3 = UILocalization.Get("UI_Event") + ": " + economyName;
				string text4 = UILocalization.Get("UI_Range") + ": " + text + "% - " + text2 + "%";
				string text5 = (Mathf.Approximately(num3, num4) ? string.Format("{0}: {1} ({2:+0.##;-0.##;0}%)", UILocalization.Get("UI_Level"), currentLevel, num3) : string.Format("{0}: {1} ({2:+0.##;-0.##;0}% {3:+0.##;-0.##;0}%)", UILocalization.Get("UI_Level"), currentLevel, num3, num4));
				string economyFlavor = REPOConomyPlugin.GetEconomyFlavor();
				float num5 = (float)Screen.width / 2f;
				float num6 = (float)Screen.height * 0.15f;
				GUIStyle val = new GUIStyle(GUI.skin.label)
				{
					fontSize = 26,
					fontStyle = (FontStyle)1,
					alignment = (TextAnchor)1,
					richText = true,
					wordWrap = true
				};
				val.normal.textColor = REPOConomyPlugin.CurrentEconomyColor;
				float num7 = Mathf.Clamp(Mathf.Max(new float[4]
				{
					val.CalcSize(new GUIContent(text3)).x,
					val.CalcSize(new GUIContent(text4)).x,
					val.CalcSize(new GUIContent(text5)).x,
					val.CalcSize(new GUIContent(economyFlavor)).x
				}) + 40f, 400f, (float)Screen.width * 0.9f);
				DropShadowLabel(new Rect(num5 - num7 / 2f, num6, num7, 40f), text3, val);
				DropShadowLabel(new Rect(num5 - num7 / 2f, num6 + 30f, num7, 35f), text4, val);
				DropShadowLabel(new Rect(num5 - num7 / 2f, num6 + 60f, num7, 35f), text5, val);
				DropShadowLabel(new Rect(num5 - num7 / 2f, num6 + 90f, num7, 50f), economyFlavor, val);
			}
		}

		private void DropShadowLabel(Rect position, string content, GUIStyle style)
		{
			//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_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			Color textColor = style.normal.textColor;
			style.normal.textColor = Color.black;
			GUI.Label(new Rect(((Rect)(ref position)).x + 2f, ((Rect)(ref position)).y + 2f, ((Rect)(ref position)).width, ((Rect)(ref position)).height), content, style);
			style.normal.textColor = textColor;
			GUI.Label(position, content, style);
		}
	}
	public static class REPOConfig
	{
		public static ConfigEntry<float> DefaultBaseMin;

		public static ConfigEntry<float> DefaultBaseMax;

		public static ConfigEntry<float> LevelScaleMin;

		public static ConfigEntry<float> LevelScaleMax;

		public static ConfigEntry<float> MinClampLimit;

		public static ConfigEntry<float> MaxClampLimit;

		public static ConfigEntry<bool> ForceStableEconomy;

		public static ConfigEntry<int> EventStartLevel;

		public static ConfigEntry<bool> UseEventChance;

		public static ConfigEntry<int> EventChance;

		public static ConfigEntry<bool> ShowTotalMapValue;

		public static ConfigEntry<bool> UseSeparateModifiers;

		public static ConfigEntry<string> UILanguage;

		public static ConfigEntry<string> RollMode;

		public static ConfigEntry<bool> EnableCustomEvents;

		public static ConfigEntry<bool> DisableVanillaEvents;

		public static ConfigEntry<bool> UseCustomEventChance;

		public static ConfigEntry<int> CustomEventChance;

		public static void Init(ConfigFile config)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Expected O, but got Unknown
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Expected O, but got Unknown
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Expected O, but got Unknown
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Expected O, but got Unknown
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0182: Expected O, but got Unknown
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Expected O, but got Unknown
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Expected O, but got Unknown
			//IL_0277: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Expected O, but got Unknown
			//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Expected O, but got Unknown
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Expected O, but got Unknown
			DefaultBaseMin = config.Bind<float>("Economy", "DefaultBaseMin", 5f, new ConfigDescription("Base minimum (-%) value without modifiers.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			DefaultBaseMax = config.Bind<float>("Economy", "DefaultBaseMax", 10f, new ConfigDescription("Base maximum (+%) value without modifiers.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			UseSeparateModifiers = config.Bind<bool>("Economy", "UseTwoStepPercentRoll", false, "Use separate positive and negative percent rolls. Result = (base - rollMin) + rollMax.");
			RollMode = config.Bind<string>("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<string>(new string[4] { "Random", "Stable", "Volatile", "Dynamic" }), Array.Empty<object>()));
			LevelScaleMin = config.Bind<float>("LevelScale", "LevelScaleMin", 1f, new ConfigDescription("How much to add to the minimum (-%) for each level.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			LevelScaleMax = config.Bind<float>("LevelScale", "LevelScaleMax", 1f, new ConfigDescription("How much to add to the maximum (+%) for each level.", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			MinClampLimit = config.Bind<float>("Limit", "ClampMinLimit", 100f, new ConfigDescription("Maximum reduction limit (for example: -100%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 500f), Array.Empty<object>()));
			MaxClampLimit = config.Bind<float>("Limit", "ClampMaxLimit", 1000f, new ConfigDescription("Maximum increase limit (for example: +1000%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10000f), Array.Empty<object>()));
			EventStartLevel = config.Bind<int>("Events", "EventsStartLevel", 2, new ConfigDescription("At what level will events start (1–12). 1 = immediately, 2 = from the second level, etc.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 12), Array.Empty<object>()));
			ForceStableEconomy = config.Bind<bool>("Events", "NoEvents", false, "Force enable a stable economy (without events).");
			DisableVanillaEvents = config.Bind<bool>("Events", "DisableVanillaEvents", false, "If true, disables all built-in vanilla events. Only custom events will be used, if EnableCustomEvents enabled.");
			EnableCustomEvents = config.Bind<bool>("Events", "EnableCustomEvents", true, "Enable loading of custom economy events from JSON files to appear in-game.");
			UseEventChance = config.Bind<bool>("EventsChance", "UseEventsChance", true, "Enable the event drop system based on chance.");
			EventChance = config.Bind<int>("EventsChance", "EventChance", 50, new ConfigDescription("Chance (1–100) for an event to occur instead of a stable economy.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>()));
			UseCustomEventChance = config.Bind<bool>("Custom Events Chance", "UseCustomEventChance", true, "Enable a separate chance check for custom events (only applies if UseEventsChance is true). If this feature is disabled, there will be a 50/50 chance of either a vanilla event or a custom event occurring.");
			CustomEventChance = config.Bind<int>("Custom Events Chance", "CustomEventChance", 50, new ConfigDescription("Chance (1–100%) for custom events to occur instead of vanilla events if UseCustomEventChance is enabled.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>()));
			ShowTotalMapValue = config.Bind<bool>("Debug", "ShowTotalMapValue", false, "Show total value of all valuables on the map in logs.");
			UILanguage = config.Bind<string>("UI Settings", "UILanguage", "English", new ConfigDescription("Language used for the economy UI.", (AcceptableValueBase)(object)new AcceptableValueList<string>(new string[2] { "English", "Russian" }), Array.Empty<object>()));
		}
	}
	public class REPOConomyNetworkHandler : MonoBehaviour
	{
		private const byte ECONOMY_SYNC_EVENT = 179;

		private void Start()
		{
			PhotonNetwork.NetworkingClient.EventReceived += OnEvent;
		}

		private void OnDestroy()
		{
			PhotonNetwork.NetworkingClient.EventReceived -= OnEvent;
		}

		private void OnEvent(EventData evt)
		{
			//IL_013b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			if (evt.Code != 179)
			{
				return;
			}
			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] Handler.OnEvent: {arg}");
			}
		}
	}
	[BepInPlugin("PxntxrezStudio.REPOConomy", "REPOConomy", "1.2.4")]
	public class REPOConomyPlugin : BaseUnityPlugin
	{
		[HarmonyPatch(typeof(LevelGenerator), "Start")]
		public static class Patch_LevelGenerator_Start
		{
			public static void Postfix()
			{
				if (SemiFunc.RunIsLevel())
				{
					Logger.LogInfo((object)"[REPOConomy] Start Generating InitializeEconomy.");
					InitializeEconomy();
				}
			}
		}

		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
		}

		public enum PercentRollMode
		{
			Random,
			Stable,
			Volatile,
			Dynamic
		}

		[HarmonyPatch(typeof(TruckScreenText), "ArrowPointAtGoalLogic")]
		public static class EconomyUITriggerPatch
		{
			[HarmonyPostfix]
			public static void ShowEconomyUI()
			{
				if (!EconomyController.UIShownOnce && SemiFunc.RunIsLevel() && (Object)(object)EconomyController.Instance != (Object)null && HasEconomy)
				{
					EconomyController.Instance.ShowGUI();
					EconomyController.UIShownOnce = true;
					LogTotalMapValue();
				}
			}
		}

		[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<ValuableObject> 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);
				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);
					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);
					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);
					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);
					return;
				}
				if (CurrentEconomy == EconomyType.MarketKraken)
				{
					if (!krakenInitialized)
					{
						krakenList = Object.FindObjectsOfType<ValuableObject>().ToList();
						foreach (ValuableObject kraken in krakenList)
						{
							SetCurrent(kraken, 0f);
						}
						krakenBoostCount = Mathf.CeilToInt((float)krakenList.Count * 0.3f);
						krakenInitialized = true;
					}
					if (krakenBoostCount > 0 && krakenList.Count > 0)
					{
						int index = Random.Range(0, krakenList.Count);
						ValuableObject inst = krakenList[index];
						SetCurrent(inst, Mathf.Round(GetOriginal(inst) * 4f));
						krakenList.RemoveAt(index);
						krakenBoostCount--;
					}
					MarkSet(__instance);
					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.##}%)");
				}
				SetCurrent(__instance, num2);
				MarkSet(__instance);
			}

			public static void ResetKraken()
			{
				krakenInitialized = false;
				krakenList = null;
				krakenBoostCount = 0;
			}
		}

		internal static ManualLogSource Logger;

		private static readonly List<ValuableObject> pendingValuables = new List<ValuableObject>();

		public static string CurrentEconomyName = "Stability";

		public static string CurrentEconomyFlavor = "Economy by default";

		private static readonly FieldInfo FI_current = AccessTools.Field(typeof(ValuableObject), "dollarValueCurrent");

		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;


		private void Awake()
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			Logger = ((BaseUnityPlugin)this).Logger;
			new Harmony("PxntxrezStudio.REPOConomy").PatchAll();
			REPOConfig.Init(((BaseUnityPlugin)this).Config);
			SceneManager.sceneLoaded += OnSceneLoaded;
			CustomEconomyLoader.LoadCustomEvents();
		}

		private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
		{
			//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_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Expected O, but got Unknown
			if (!SemiFunc.RunIsLobby() && !SemiFunc.RunIsShop() && !SemiFunc.RunIsArena() && (Object)(object)EconomyController.Instance == (Object)null)
			{
				GameObject val = new GameObject("EconomyUI");
				EconomyController.Instance = val.AddComponent<EconomyController>();
				val.AddComponent<REPOConomyNetworkHandler>();
				Object.DontDestroyOnLoad((Object)val);
			}
		}

		public static void InitializeEconomy()
		{
			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;
			}
			EconomyInitialized = true;
			int currentLevel = GetCurrentLevel();
			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 || Random.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;
			if (value || !flag || !flag2)
			{
				ApplyVanillaEconomy(EconomyType.Stable);
				flag4 = true;
			}
			if (!flag4 && flag3 && value2)
			{
				PickRandomCustomEvent();
				flag4 = true;
			}
			if (!flag4 && flag3 && value3)
			{
				if (Random.Range(1, 101) <= value4)
				{
					PickRandomCustomEvent();
				}
				else
				{
					ApplyVanillaEconomy(GetRandomVanillaType());
				}
				flag4 = true;
			}
			if (!flag4 && flag3)
			{
				if (!value2 && Random.Range(0, 2) == 1)
				{
					ApplyVanillaEconomy(GetRandomVanillaType());
				}
				else
				{
					PickRandomCustomEvent();
				}
				flag4 = true;
			}
			if (!flag4)
			{
				ApplyVanillaEconomy(GetRandomVanillaType());
				flag4 = true;
			}
			string value5 = REPOConfig.RollMode.Value;
			if (value5 == "Dynamic")
			{
				PercentRollMode[] array = new PercentRollMode[3]
				{
					PercentRollMode.Random,
					PercentRollMode.Stable,
					PercentRollMode.Volatile
				};
				CurrentRollMode = array[Random.Range(0, array.Length)];
			}
			else
			{
				CurrentRollMode = (PercentRollMode)Enum.Parse(typeof(PercentRollMode), value5);
			}
			foreach (ValuableObject pendingValuable in pendingValuables)
			{
				ValuablePatch.ApplyRandomValue(pendingValuable);
			}
			pendingValuables.Clear();
		}

		private static bool PickRandomCustomEvent()
		{
			//IL_011a: 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_0303: 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_030a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0311: Expected O, but got Unknown
			//IL_031a: Unknown result type (might be due to invalid IL or missing references)
			List<CustomEconomyData> customEvents = CustomEconomyLoader.CustomEvents;
			CustomEconomyData customEconomyData = customEvents[Random.Range(0, customEvents.Count)];
			_ = REPOConfig.UILanguage.Value == "Russian";
			CurrentCustomEconomy = customEconomyData;
			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 (customEconomyData.useDelta)
			{
				num3 += customEconomyData.min;
				num4 += customEconomyData.max;
			}
			else
			{
				num3 = customEconomyData.min + ClientDeltaMin;
				num4 = customEconomyData.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)((customEconomyData.color != null && customEconomyData.color.Length == 3) ? new Color(customEconomyData.color[0] / 255f, customEconomyData.color[1] / 255f, customEconomyData.color[2] / 255f) : Color.white);
			HasEconomy = true;
			Logger.LogInfo((object)("[Economy] Picked custom event: " + customEconomyData.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_0c27: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c2e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c35: Expected O, but got Unknown
			//IL_0c3e: 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.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 += Random.Range(-25f, 0f);
				num4 += Random.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 num18 = Random.Range(-30f, 30f);
				num3 += num18;
				num4 += num18;
				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 num17 = Random.Range(-50f, 50f);
				num3 += num17;
				num4 += num17;
				break;
			}
			case EconomyType.SpeculationBubble:
				num3 -= 20f;
				num4 += 100f;
				break;
			case EconomyType.ColdStorage:
				num3 -= 10f;
				num4 -= 10f;
				break;
			case EconomyType.PriceWhirlwind:
				num3 += Random.Range(-60f, 0f);
				num4 += Random.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 + Random.Range(-5f, 5f), 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value);
				num4 = Mathf.Clamp(MaxPercent + Random.Range(-5f, 5f), 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value);
				break;
			case EconomyType.LoopbackSpike:
			{
				float num15 = MinPercent * 2f;
				float num16 = MaxPercent * 2f;
				num3 = Mathf.Clamp(num15, 0f - REPOConfig.MinClampLimit.Value, REPOConfig.MaxClampLimit.Value);
				num4 = Mathf.Clamp(num16, 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 num14 = Random.Range(-50f, 150f);
				num3 = num14 / 2f;
				num4 = num14;
				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 num13 = num3;
				num3 = 0f - num4;
				num4 = 0f - num13;
				break;
			}
			case EconomyType.SyntheticDemand:
				num3 += Random.Range(0f, 30f);
				num4 += Random.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 num12 = Random.Range(-50f, 100f);
				num3 += num12;
				num4 += num12;
				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 += Random.Range(-20f, 0f);
				num4 += Random.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 num11 = Random.Range(-40f, 40f);
				num3 += num11;
				num4 += num11;
				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 num10 = Random.Range(-25f, 25f);
				num3 += num10;
				num4 += num10;
				break;
			}
			case EconomyType.BarterBonanza:
				num3 -= 20f;
				num4 += 15f;
				break;
			case EconomyType.SeasonalShift:
				num3 += 15f;
				num4 -= 5f;
				break;
			case EconomyType.BlackoutSale:
			{
				float num9 = Random.Range(-50f, -30f);
				num3 += num9;
				num4 += num9;
				break;
			}
			case EconomyType.InflationEbb:
				num3 -= 20f;
				num4 -= 10f;
				break;
			case EconomyType.FoolsGold:
			{
				float num8 = Random.Range(0f, 50f);
				num3 = num3 - 10f + num8;
				num4 = num4 - 10f + num8;
				break;
			}
			case EconomyType.HoardersHavoc:
				num3 -= 40f;
				num4 += 10f;
				break;
			case EconomyType.PennyPinch:
			{
				float num7 = Random.Range(-60f, -40f);
				num3 += num7;
				num4 += num7;
				break;
			}
			case EconomyType.Trendsetter:
			{
				float num6 = Random.Range(30f, 60f);
				num3 += num6;
				num4 += num6;
				break;
			}
			case EconomyType.PriceSpike:
				num3 += 40f;
				num4 += 80f;
				break;
			case EconomyType.Clearance:
				num3 -= 60f;
				num4 -= 20f;
				break;
			case EconomyType.BoomerangMarket:
				num3 += Random.Range(-20f, 10f);
				num4 += Random.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 num5 = Random.Range(-30f, 30f);
				num3 += num5;
				num4 += num5;
				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;
			}
			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);
			}
		}

		private static EconomyType GetRandomVanillaType()
		{
			Array values = Enum.GetValues(typeof(EconomyType));
			int index = Random.Range(1, values.Length);
			return (EconomyType)values.GetValue(index);
		}

		private static void LogTotalMapValue()
		{
			if (REPOConfig.ShowTotalMapValue.Value)
			{
				float num = 0f;
				ValuableObject[] array = Object.FindObjectsOfType<ValuableObject>();
				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()
		{
			if (!HasEconomy)
			{
				return "Stability";
			}
			bool flag = REPOConfig.UILanguage.Value == "Russian";
			if (CurrentCustomEconomy != null)
			{
				if (!flag || string.IsNullOrWhiteSpace(CurrentCustomEconomy.name_ru))
				{
					return CurrentCustomEconomy.name_en;
				}
				return CurrentCustomEconomy.name_ru;
			}
			if (REPOConfig.EnableCustomEvents.Value)
			{
				CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData e) => e.id == CurrentCustomEconomy?.id);
				if (customEconomyData != null)
				{
					if (!flag || string.IsNullOrWhiteSpace(customEconomyData.name_ru))
					{
						return customEconomyData.name_en;
					}
					return customEconomyData.name_ru;
				}
			}
			return CurrentEconomy switch
			{
				EconomyType.Stable => flag ? "Стабильность" : "Stability", 
				EconomyType.Deflation => flag ? "Дефляция" : "Deflation", 
				EconomyType.Inflation => flag ? "Инфляция" : "Inflation", 
				EconomyType.Chaos => flag ? "Хаос" : "Chaos", 
				EconomyType.FreezeMarket => flag ? "Заморозка" : "Freeze Market", 
				EconomyType.BlackMarketSurge => flag ? "Черный Рынок" : "Black Market Surge", 
				EconomyType.Overload => flag ? "Перегруз" : "Overload", 
				EconomyType.RareBoom => flag ? "Редкий бум" : "Rare Boom", 
				EconomyType.CommonCrash => flag ? "Обычный Краш" : "Common Crash", 
				EconomyType.LegendaryOnlyMatters => flag ? "Только Легенды" : "Legendary Only Matters", 
				EconomyType.EchoMarket => flag ? "Рынок Эха" : "Echo Market", 
				EconomyType.ReverseInflation => flag ? "Обратная Инфляция" : "Reverse Inflation", 
				EconomyType.LuxuryHunt => flag ? "Охота За Роскошью" : "Luxury Hunt", 
				EconomyType.DumpsterDive => flag ? "Мусорная Находка" : "Dumpster Dive", 
				EconomyType.ExtraProfit => flag ? "Доп. Прибыль" : "Extra Profit", 
				EconomyType.ScamSeason => flag ? "Сезон Скама" : "Scam Season", 
				EconomyType.SuddenDrop => flag ? "Резкое Падение" : "Sudden Drop", 
				EconomyType.TreasureRush => flag ? "Охота За Сокровищами" : "Treasure Rush", 
				EconomyType.ZeroGravity => flag ? "Невесомость Цен" : "Zero Gravity", 
				EconomyType.Turbulence => flag ? "Турбулентность" : "Turbulence", 
				EconomyType.BubbleBurst => flag ? "Лопнувший Пузырь" : "Bubble Burst", 
				EconomyType.CollectorsFrenzy => flag ? "Коллекционная Лихорадка" : "Collectors Frenzy", 
				EconomyType.PanicSale => flag ? "Паническая Распродажа" : "Panic Sale", 
				EconomyType.EconomicTwister => flag ? "Экономический Твистер" : "Economic Twister", 
				EconomyType.TaxAudit => flag ? "Налоговая Проверка" : "Tax Audit", 
				EconomyType.CrashAndBurn => flag ? "Краш & Выгорание" : "Crash & Burn", 
				EconomyType.GoldenHour => flag ? "Золотой Час" : "Golden Hour", 
				EconomyType.CrystalBubble => flag ? "Хрустальный Пузырь" : "Crystal Bubble", 
				EconomyType.CoinDecay => flag ? "Обесценивание" : "Coin Decay", 
				EconomyType.EchoCrash => flag ? "Эхо-Краш" : "Echo Crash", 
				EconomyType.SpeculationBubble => flag ? "Спекулятивный Пузырь" : "Speculation Bubble", 
				EconomyType.ColdStorage => flag ? "Холодное Хранение" : "Cold Storage", 
				EconomyType.PriceWhirlwind => flag ? "Ценовой Вихрь" : "Price Whirlwind", 
				EconomyType.ExperimentalPricing => flag ? "Экспериментальные Цены" : "Experimental Pricing", 
				EconomyType.ShadowMarket => flag ? "Теневой Рынок" : "Shadow Market", 
				EconomyType.AuctionFever => flag ? "Аукционная Лихорадка" : "Auction Fever", 
				EconomyType.MemoryMarket => flag ? "Рынок Памяти" : "Memory Market", 
				EconomyType.LoopbackSpike => flag ? "Петля Резонанса" : "Loopback Spike", 
				EconomyType.GlitchedGoldrush => flag ? "Глитч Золотой Лихорадки" : "Glitched Goldrush", 
				EconomyType.MarketEclipse => flag ? "Экономическое затмение" : "Market Eclipse", 
				EconomyType.JackpotMirage => flag ? "Мираж Джекпота" : "Jackpot Mirage", 
				EconomyType.CollectorsVoid => flag ? "Пустота Коллекционеров" : "Collector's Void", 
				EconomyType.VolatileExperiment => flag ? "Экспериментальный Хаос" : "Volatile Experiment", 
				EconomyType.CleanSweep => flag ? "Чистая Полоса" : "Clean Sweep", 
				EconomyType.ValueVortex => flag ? "Вихрь Цен" : "Value Vortex", 
				EconomyType.TemporalSurge => flag ? "Всплеск Времени" : "Temporal Surge", 
				EconomyType.EchoOfWealth => flag ? "Отголоски Богатства" : "Echo of Wealth", 
				EconomyType.ArtifactBloat => flag ? "Артефактная Накрутка" : "Artifact Bloat", 
				EconomyType.MarketDrain => flag ? "Слив Рынка" : "Market Drain", 
				EconomyType.InversionProtocol => flag ? "Протокол Инверсии" : "Inversion Protocol", 
				EconomyType.SyntheticDemand => flag ? "Синтетический Спрос" : "Synthetic Demand", 
				EconomyType.TaxFrenzy => flag ? "Налоговая лихорадка" : "Taxman's Frenzy", 
				EconomyType.AssetDump => flag ? "Слитые активы" : "Asset Dump", 
				EconomyType.SmugglersSurge => flag ? "Контрабандный всплеск" : "Smugglers Surge", 
				EconomyType.CollectorsCraze => flag ? "Коллекционный бум" : "Collectors Craze", 
				EconomyType.MarketKraken => flag ? "Кракен на бирже" : "Market Kraken", 
				EconomyType.MarketBoom => flag ? "Рынок Бум" : "Market Boom", 
				EconomyType.PriceLockdown => flag ? "Ценовой Локдаун" : "Price Lockdown", 
				EconomyType.WildSpeculation => flag ? "Безумная Спекуляция" : "Wild Speculation", 
				EconomyType.SilentAuction => flag ? "Тихий Аукцион" : "Silent Auction", 
				EconomyType.FlashCrash => flag ? "Молниеносный Краш" : "Flash Crash", 
				EconomyType.CryptoSurge => flag ? "КриптоПрорыв" : "Crypto Surge", 
				EconomyType.ResourceRush => flag ? "Ресурсный Бум" : "Resource Rush", 
				EconomyType.DemandSpike => flag ? "Всплеск Спроса" : "Demand Spike", 
				EconomyType.SupplyShortage => flag ? "Дефицит Предложений" : "Supply Shortage", 
				EconomyType.ConsumerConfidence => flag ? "Доверие Потребителей" : "Consumer Confidence", 
				EconomyType.MarketMeltup => flag ? "Рыночный Взлет" : "Market Melt-up", 
				EconomyType.BargainHunt => flag ? "Охота за Скидками" : "Bargain Hunt", 
				EconomyType.MarketRebound => flag ? "Отскок Рынка" : "Market Rebound", 
				EconomyType.PriceCascade => flag ? "Ценовой Каскад" : "Price Cascade", 
				EconomyType.BullRun => flag ? "Бычий Рывок" : "Bull Run", 
				EconomyType.BearTrap => flag ? "Медвежья Ловушка" : "Bear Trap", 
				EconomyType.PanicBuying => flag ? "Паническая Покупка" : "Panic Buying", 
				EconomyType.SupplyGlut => flag ? "Избыток Предложений" : "Supply Glut", 
				EconomyType.SpeculatorFrenzy => flag ? "Бешенство Спекулянтов" : "Speculator Frenzy", 
				EconomyType.ValueStabilizer => flag ? "Стабилизатор Цен" : "Value Stabilizer", 
				EconomyType.MarketMirroring => flag ? "Зеркало Рынка" : "Market Mirroring", 
				EconomyType.InflationSpike => flag ? "Всплеск Инфляции" : "Inflation Spike", 
				EconomyType.DeflationDip => flag ? "Провал Дефляции" : "Deflation Dip", 
				EconomyType.EconomicEquilibrium => flag ? "Экономическое Равновесие" : "Economic Equilibrium", 
				EconomyType.PriceSurge => flag ? "Резкий Рост Цен" : "Price Surge", 
				EconomyType.BargainBlitz => flag ? "Скидочный Блиц" : "Bargain Blitz", 
				EconomyType.CollectorCarnival => flag ? "Карнавал Коллекционеров" : "Collector Carnival", 
				EconomyType.GhostPrices => flag ? "Призрачные Цены" : "Ghost Prices", 
				EconomyType.BarterBonanza => flag ? "Бартёрное Безумие" : "Barter Bonanza", 
				EconomyType.SeasonalShift => flag ? "Сезонный Сдвиг" : "Seasonal Shift", 
				EconomyType.BlackoutSale => flag ? "Чёрная Распродажа" : "Blackout Sale", 
				EconomyType.InflationEbb => flag ? "Утихание Инфляции" : "Inflation Ebb", 
				EconomyType.FoolsGold => flag ? "Дурачье Золото" : "Fool’s Gold", 
				EconomyType.HoardersHavoc => flag ? "Хаос Накопителей" : "Hoarder's Havoc", 
				EconomyType.PennyPinch => flag ? "Щепотка Рублей" : "Penny Pinch", 
				EconomyType.Trendsetter => flag ? "Законодатель Трендов" : "Trendsetter", 
				EconomyType.PriceSpike => flag ? "Ценовой всплеск" : "Price Spike", 
				EconomyType.Clearance => flag ? "Ликвидация" : "Clearance", 
				EconomyType.BoomerangMarket => flag ? "Бумеранг Рынка" : "Boomerang Market", 
				EconomyType.SilentDip => flag ? "Тихое падение" : "Silent Dip", 
				EconomyType.LuxuryOnly => flag ? "Только Люкс" : "Luxury Only", 
				EconomyType.EarlyBubble => flag ? "Ранняя надутость" : "Early Bubble", 
				EconomyType.LateDeflation => flag ? "Поздняя дефляция" : "Late Deflation", 
				EconomyType.PriceSlalom => flag ? "Ценовой слалом" : "Price Slalom", 
				EconomyType.FalseDemand => flag ? "Фальшивый спрос" : "False Demand", 
				EconomyType.UndergroundTrade => flag ? "Подпольная торговля" : "Underground Trade", 
				EconomyType.CrystalCrash => flag ? "Хрустальный краш" : "Crystal Crash", 
				EconomyType.GhostRush => flag ? "Призрачная гонка" : "Ghost Rush", 
				_ => "???", 
			};
		}

		public static string GetEconomyFlavor()
		{
			bool flag = REPOConfig.UILanguage.Value == "Russian";
			if (CurrentCustomEconomy != null)
			{
				if (!flag || string.IsNullOrWhiteSpace(CurrentCustomEconomy.desc_ru))
				{
					return CurrentCustomEconomy.desc_en;
				}
				return CurrentCustomEconomy.desc_ru;
			}
			if (REPOConfig.EnableCustomEvents.Value)
			{
				CustomEconomyData customEconomyData = CustomEconomyLoader.CustomEvents.FirstOrDefault((CustomEconomyData e) => e.id == CurrentCustomEconomy?.id);
				if (customEconomyData != null)
				{
					if (!flag || string.IsNullOrWhiteSpace(customEconomyData.desc_ru))
					{
						return customEconomyData.desc_en;
					}
					return customEconomyData.desc_ru;
				}
			}
			return CurrentEconomy switch
			{
				EconomyType.Stable => flag ? "Экономика по умолчанию" : "Economy by default", 
				EconomyType.Deflation => flag ? "Краш рынка" : "Market Crash", 
				EconomyType.Inflation => flag ? "Момент разбогатеть!" : "Moment to Get Rich!", 
				EconomyType.Chaos => flag ? "Финансовый хаос..." : "Financial chaos...", 
				EconomyType.FreezeMarket => flag ? "Экономика заморожена :(" : "Economy frozen :(", 
				EconomyType.BlackMarketSurge => flag ? "Цены взлетели на черном рынке..." : "Values have become more expensive...", 
				EconomyType.Overload => flag ? "50/50" : "50/50", 
				EconomyType.RareBoom => flag ? "Ценности резко подорожали!" : "Values are suddenly in price!", 
				EconomyType.CommonCrash => flag ? "Ценности обесценились!" : "Values are devalued!", 
				EconomyType.LegendaryOnlyMatters => flag ? "Ценятся только легенды..." : "Only the best makes sense...", 
				EconomyType.EchoMarket => flag ? "Цены скачут как сумасшедшие..." : "Prices are jumping like crazy...", 
				EconomyType.ReverseInflation => flag ? "Бюджет важнее богатства..." : "Budget is better than wealth...", 
				EconomyType.LuxuryHunt => flag ? "Роскошь в моде! Всё подорожало" : "Values are much more expensive!", 
				EconomyType.DumpsterDive => flag ? "Даже мусор стал дорогим!" : "Everything has become expensive!", 
				EconomyType.ExtraProfit => flag ? "Сегодня можно продать выгоднее!" : "Today you can sell more profitably!", 
				EconomyType.ScamSeason => flag ? "Цены падают... :(" : "Prices are falling... :(", 
				EconomyType.SuddenDrop => flag ? "Почти всё обесценилось!" : "Almost everything has depreciated!", 
				EconomyType.TreasureRush => flag ? "Каждая ценность — сокровище!" : "Every value is — treasure!", 
				EconomyType.ZeroGravity => flag ? "Цены нестабильны..." : "Everything is unstable...", 
				EconomyType.Turbulence => flag ? "Цены ведут себя непредсказуемо..." : "Prices behave unpredictably...", 
				EconomyType.BubbleBurst => flag ? "Рынок рос... пока не лопнул" : "The market was booming... until it wasn’t", 
				EconomyType.CollectorsFrenzy => flag ? "Всё ценится больше, чем должно!" : "Everything is worth more than it should be", 
				EconomyType.PanicSale => flag ? "Игроки распродают всё за копейки!" : "Players are panic-selling everything for pennies!", 
				EconomyType.EconomicTwister => flag ? "Каждая ценность получает случайную цену!" : "Every item gets a completely random value", 
				EconomyType.TaxAudit => flag ? "Налоговая проверила ваши ценности" : "The Tax Department has reviewed your valuables", 
				EconomyType.CrashAndBurn => flag ? "Рынок рушится — готовьтесь к убыткам" : "The market is collapsing — brace for losses", 
				EconomyType.GoldenHour => flag ? "Идеальное время для продажи!" : "A perfect time to sell — prices are booming!", 
				EconomyType.CrystalBubble => flag ? "Эйфория на рынке! Цены взлетели..." : "Market euphoria! Prices are sky-high… for now", 
				EconomyType.CoinDecay => flag ? "Всё кажется обесцененным. Продавать или ждать?" : "Everything feels worthless. Time to sell or hold?", 
				EconomyType.EchoCrash => flag ? "Эхо-удары дестабилизируют рынок!" : "Residual shockwaves shake the market unpredictably", 
				EconomyType.SpeculationBubble => flag ? "Цены растут без причин... Пузырь вот-вот лопнет!" : "Prices are inflating without logic... Bubble may burst any time!", 
				EconomyType.ColdStorage => flag ? "Ничего не продаётся... Всё заморожено" : "Nothing sells well. Prices are frozen under market value", 
				EconomyType.PriceWhirlwind => flag ? "Цены крутятся в вихре нестабильности!" : "An unstable market surge throws prices into a whirlwind!", 
				EconomyType.ExperimentalPricing => flag ? "Цены нестабильны из-за рыночных экспериментов" : "Prices fluctuate wildly due to market experiments", 
				EconomyType.ShadowMarket => flag ? "Теневой рынок обесценивает большинство ценностей" : "A secret market drains value from most valuables", 
				EconomyType.AuctionFever => flag ? "Аукционы взвинтили цены до небес!" : "A bidding war is driving prices through the roof!", 
				EconomyType.MemoryMarket => flag ? "Цены как в прошлом... но не совсем" : "Prices mirror the past — but with a twist", 
				EconomyType.LoopbackSpike => flag ? "История повторяется, но куда жёстче" : "History repeats with extreme volatility", 
				EconomyType.GlitchedGoldrush => flag ? "Что-то сломалось... но ты богатеешь" : "Something’s broken… but you’re getting rich", 
				EconomyType.MarketEclipse => flag ? "Экономическое затмение... всё стоит на месте" : "An economic blackout... almost no movement", 
				EconomyType.JackpotMirage => flag ? "Всё выглядит дорого... но ты уверен?" : "Everything looks like gold... but some of it’s fool’s gold", 
				EconomyType.CollectorsVoid => flag ? "Ценности исчезли... всё стало мусором" : "All value is lost — nothing is collectible anymore", 
				EconomyType.VolatileExperiment => flag ? "Экономический эксперимент... полный хаос" : "A dangerous economic experiment — chaos reigns", 
				EconomyType.CleanSweep => flag ? "Затишье... почти ничего не изменилось" : "A calm period — nothing to fear, nothing to gain", 
				EconomyType.ValueVortex => flag ? "Вихрь ценностей — всё непредсказуемо" : "A swirling mess of prices — unpredictable and wild", 
				EconomyType.TemporalSurge => flag ? "Цены колеблются с импульсом времени" : "Prices shift with a pulse of time itself", 
				EconomyType.EchoOfWealth => flag ? "Цены отражают прошлые уровни… с искажением?" : "Prices mimic those from two levels ago?", 
				EconomyType.ArtifactBloat => flag ? "Старый хлам внезапно стал ценным!" : "Old junk is now gold!", 
				EconomyType.MarketDrain => flag ? "Цены медленно утекают в бездну" : "All prices slowly drain into the void", 
				EconomyType.InversionProtocol => flag ? "Низкая цена — высокая ценность, и наоборот" : "Low-value becomes high-value. High-value drops", 
				EconomyType.SyntheticDemand => flag ? "Искусственный спрос вызывает всплеск цен" : "Artificial demand spikes at random", 
				EconomyType.TaxFrenzy => flag ? "Цены упали из-за налогов" : "Tax rates hit hard! Prices plummet", 
				EconomyType.AssetDump => flag ? "Всe сливают активы" : "Everyone's dumping assets!", 
				EconomyType.SmugglersSurge => flag ? "Дорогие вещи рвутся в цене, остальное теряет смысл" : "Expensive items skyrocket, cheap ones tank", 
				EconomyType.CollectorsCraze => flag ? "Только редкие предметы в цене — остальное бесполезно" : "Rare collectibles soar — the rest is junk", 
				EconomyType.MarketKraken => flag ? "Биржа сошла с ума! 30% предметов получат *х4* цену!" : "The market goes wild! 30% of valuables get ×4 boost!", 
				EconomyType.MarketBoom => flag ? "Цены резко растут по всему рынку!" : "Prices surge across the entire market!", 
				EconomyType.PriceLockdown => flag ? "Правительство замораживает все цены..." : "All prices are frozen by decree", 
				EconomyType.WildSpeculation => flag ? "Спекулянты творят хаос: всё летит вверх и вниз!" : "Speculators drive prices wildly up and down!", 
				EconomyType.SilentAuction => flag ? "Аукционы без торговцев — цены неопределённы" : "Auctions run in silence, prices unclear", 
				EconomyType.FlashCrash => flag ? "Мгновенное обрушение цен по всем активам!" : "Instant crash wiping out asset values!", 
				EconomyType.CryptoSurge => flag ? "Криптовалюты захлестнул рост!" : "Cryptocurrencies push the market sky-high!", 
				EconomyType.ResourceRush => flag ? "Дефицит ресурсов: цены на всё растут" : "Resource scarcity drives prices up", 
				EconomyType.DemandSpike => flag ? "Взрывной спрос на товары!" : "Explosive demand floods the market!", 
				EconomyType.SupplyShortage => flag ? "Серьёзный дефицит поставок" : "Severe supply shortages cripple prices", 
				EconomyType.ConsumerConfidence => flag ? "Потребители необоснованно оптимистичны!" : "Consumers irrationally confident!", 
				EconomyType.MarketMeltup => flag ? "Цены тают вверх: никто не может остановиться" : "A melt-up as prices climb uncontrollably!", 
				EconomyType.BargainHunt => flag ? "Ищем редкие скидки: одни вещи падают, другие растут" : "Hunting bargains—some crash, others spike", 
				EconomyType.MarketRebound => flag ? "После обрушения рынок быстро возвращается к росту!" : "After a crash, the market swiftly rebounds!", 
				EconomyType.PriceCascade => flag ? "Цены обваливаются каскадом, но могут отскочить" : "Prices cascade downward, but may bounce back", 
				EconomyType.BullRun => flag ? "Бычий рынок: цены мчатся наверх!" : "A bull run—prices charge skyward!", 
				EconomyType.BearTrap => flag ? "Медвежья ловушка: временный рост перед падением…" : "A bear trap—brief gains before a fall…", 
				EconomyType.PanicBuying => flag ? "Игроки скупают всё подряд—запасы тают!" : "Players panic-buy—supplies vanish!", 
				EconomyType.SupplyGlut => flag ? "Перепроизводство: цены тонут из-за избытка" : "Oversupply—prices sink under glut", 
				EconomyType.SpeculatorFrenzy => flag ? "Спекулянты безудержно качают цены—хаос!" : "Speculators push prices to chaotic extremes!", 
				EconomyType.ValueStabilizer => flag ? "Регуляторные меры удерживают цены в узких рамках" : "Regulatory measures keep prices in check", 
				EconomyType.MarketMirroring => flag ? "Рынок повторяет своё предыдущее состояние" : "The market mirrors its previous level", 
				EconomyType.InflationSpike => flag ? "Кратковременный скачок инфляции!" : "A sudden spike in inflation!", 
				EconomyType.DeflationDip => flag ? "Резкое провал цен в дефляционную яму" : "Prices plunge into a deflationary dip", 
				EconomyType.EconomicEquilibrium => flag ? "Баланс между спросом и предложением—стабильность" : "A perfect balance of supply and demand", 
				EconomyType.PriceSurge => flag ? "Внезапный взлёт цен: все товары подорожали на 20–40%!" : "Sudden price surge—everything jumps 20–40%!", 
				EconomyType.BargainBlitz => flag ? "Молниеносные скидки: всё дешевеет на 30–10%!" : "Flash discounts—prices drop 30–10% instantly!", 
				EconomyType.CollectorCarnival => flag ? "Коллекционные редкости ×2, остальные −10%" : "Collectibles ×2, others −10%", 
				EconomyType.GhostPrices => flag ? "Цены скачут “призрачно”: разброс −25…+25%" : "Ghostly prices—random offset ±25%", 
				EconomyType.BarterBonanza => flag ? "Бартер в моде: дешёвые падают, дорогие растут" : "Barter bonanza—low items down, high items up", 
				EconomyType.SeasonalShift => flag ? "Сезонная коррекция: +15% к низким, −5% к высоким ценам" : "Seasonal shift—min +15%, max −5%", 
				EconomyType.BlackoutSale => flag ? "Чёрная распродажа: всё обесценивается −50…−30%" : "Blackout sale—prices slashed −50…−30%", 
				EconomyType.InflationEbb => flag ? "Инфляция утихла: все цены снижаются на 10–20%" : "Inflation ebb—prices fall 10–20%", 
				EconomyType.FoolsGold => flag ? "Невнятный бум: часть товаров +50%, остальные −10%" : "Fool’s Gold—some +50%, others −10%", 
				EconomyType.HoardersHavoc => flag ? "Накопители скупают всё: дешёвые −40%, дорогие +10%" : "Hoarder's Havoc—cheap −40%, expensive +10%", 
				EconomyType.PennyPinch => flag ? "Жёсткое удешевление: все цены −60…−40%" : "Penny Pinch—prices slump −60…−40%", 
				EconomyType.Trendsetter => flag ? "Топовые товары дорожают: +30…+60%!" : "Trendsetter—premium items surge +30…+60%!", 
				EconomyType.PriceSpike => flag ? "Цены внезапно подскакивают!" : "Prices suddenly spike across the board!", 
				EconomyType.Clearance => flag ? "Обвальная распродажа: всё падает в цене!" : "Massive clearance cuts values everywhere!", 
				EconomyType.BoomerangMarket => flag ? "Цены возвращаются — но не туда!" : "Values swing back—but unpredictably!", 
				EconomyType.SilentDip => flag ? "Незаметный спад..." : "Quiet dip... nothing sells well", 
				EconomyType.LuxuryOnly => flag ? "Ценятся только предметы класса люкс" : "Only luxury items hold value now", 
				EconomyType.EarlyBubble => flag ? "Рынок перегрет с самого начала!" : "A bubble forms early—brace for boom", 
				EconomyType.LateDeflation => flag ? "Цены падают ближе к концу..." : "Late-stage deflation drains the market", 
				EconomyType.PriceSlalom => flag ? "Рынок скользит как на лыжах" : "A slalom of ups and downs", 
				EconomyType.FalseDemand => flag ? "Спекулятивный всплеск спроса!" : "Artificial demand inflates prices!", 
				EconomyType.UndergroundTrade => flag ? "Ценности утекли в тень..." : "Trade continues in the shadows", 
				EconomyType.CrystalCrash => flag ? "Пузырь лопнул — рынок в стеклах" : "The bubble shatters into a crystal crash", 
				EconomyType.GhostRush => flag ? "Цены словно мертвые души — летают вверх!" : "Phantom value rushes sweep the market!", 
				_ => "???", 
			};
		}

		public static Color GetEconomyColor()
		{
			//IL_01e7: 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_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: 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_0213: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_023d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025d: 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_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_0282: Unknown result type (might be due to invalid IL or missing references)
			//IL_0287: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: 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_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0314: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: 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_0348: Unknown result type (might be due to invalid IL or missing references)
			//IL_035d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0377: Unknown result type (might be due to invalid IL or missing references)
			//IL_037c: 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_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b6: 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_03c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_03df: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0432: Unknown result type (might be due to invalid IL or missing references)
			//IL_0447: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_0466: Unknown result type (might be due to invalid IL or missing references)
			//IL_047b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_049a: Unknown result type (might be due to invalid IL or missing references)
			//IL_04af: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_04c9: 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_04e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_04fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0502: Unknown result type (might be due to invalid IL or missing references)
			//IL_0517: Unknown result type (might be due to invalid IL or missing references)
			//IL_051c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0531: Unknown result type (might be due to invalid IL or missing references)
			//IL_0536: Unknown result type (might be due to invalid IL or missing references)
			//IL_054b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0550: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Unknown result type (might be due to invalid IL or missing references)
			//IL_056a: Unknown result type (might be due to invalid IL or missing references)
			//IL_057f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0584: Unknown result type (might be due to invalid IL or missing references)
			//IL_0599: Unknown result type (might be due to invalid IL or missing references)
			//IL_059e: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_05d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0601: Unknown result type (might be due to invalid IL or missing references)
			//IL_0606: Unknown result type (might be due to invalid IL or missing references)
			//IL_061b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0620: Unknown result type (might be due to invalid IL or missing references)
			//IL_0635: Unknown result type (might be due to invalid IL or missing references)
			//IL_063a: Unknown result type (might be due to invalid IL or missing references)
			//IL_064f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0654: Unknown result type (might be due to invalid IL or missing references)
			//IL_0669: Unknown result type (might be due to invalid IL or missing references)
			//IL_066e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0683: Unknown result type (might be due to invalid IL or missing references)
			//IL_0688: Unknown result type (might be due to invalid IL or missing references)
			//IL_068e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0693: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_06dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_06fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0710: Unknown result type (might be due to invalid IL or missing references)
			//IL_0715: Unknown result type (might be due to invalid IL or missing references)
			//IL_072a: Unknown result type (might be due to invalid IL or missing references)
			//IL_072f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0744: Unknown result type (might be due to invalid IL or missing references)
			//IL_0749: Unknown result type (might be due to invalid IL or missing references)
			//IL_075e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0763: Unknown result type (might be due to invalid IL or missing references)
			//IL_0778: Unknown result type (might be due to invalid IL or missing references)
			//IL_077d: 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_0797: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_07b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_07c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_07cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_07ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0814: Unknown result type (might be due to invalid IL or missing references)
			//IL_0819: Unknown result type (might be due to invalid IL or missing references)
			//IL_082e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0833: Unknown result type (might be due to invalid IL or missing references)
			//IL_0848: Unknown result type (might be due to invalid IL or missing references)
			//IL_084d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0862: Unknown result type (might be due to invalid IL or missing references)
			//IL_0867: Unknown result type (might be due to invalid IL or missing references)
			//IL_087c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0881: Unknown result type (might be due to invalid IL or missing references)
			//IL_0896: Unknown result type (might be due to invalid IL or missing references)
			//IL_089b: 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_08b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_08ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_08cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0903: Unknown result type (might be due to invalid IL or missing references)
			//IL_0918: Unknown result type (might be due to invalid IL or missing references)
			//IL_091d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0932: Unknown result type (might be due to invalid IL or missing references)
			//IL_0937: Unknown result type (might be due to invalid IL or missing references)
			//IL_094c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0951: Unknown result type (might be due to invalid IL or missing references)
			//IL_0966: Unknown result type (might be due to invalid IL or missing references)
			//IL_096b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0980: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_099a: Unknown result type (might be due to invalid IL or missing references)
			//IL_099f: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_09b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a1c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a21: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a36: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a50: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a55: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a6f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a84: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a89: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0abd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aec: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b06: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b25: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b6b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b70: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b82: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b87: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bc7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bd4: 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.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, Random.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), 
				_ => Color.gray, 
			});
		}

		public static void ResetEconomy()
		{
			HasEconomy = false;
			MinPercent = 0f;
			MaxPercent = 0f;
			CurrentEconomy = EconomyType.Stable;
			ValuablePatch.ResetKraken();
			Logger.LogInfo((object)"[Economy] The economy has been reset. Ready for a new race.");
		}
	}
	public static class UILocalization
	{
		public static string Get(string key)
		{
			bool flag = REPOConfig.UILanguage.Value == "Russian";
			return key switch
			{
				"UI_Event" => flag ? "Экономика" : "Economy", 
				"UI_Range" => flag ? "Диапазон" : "Range", 
				"UI_Level" => flag ? "Уровень" : "Level", 
				_ => key, 
			};
		}
	}
}