Decompiled source of REPOConomyPlus v1.4.6

plugins/REPOConomyPlus.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
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 REPOConomyMod;
using REPOConomyPlus;
using UnityEngine;
using UnityEngine.AI;
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("REPOConomyPlus")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("REPOConomyPlus")]
[assembly: AssemblyTitle("REPOConomyPlus")]
[assembly: AssemblyVersion("1.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace REPOConomyPlus
{
	public static class LevelScalingImprovements
	{
		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		public static class Patch_LevelGenerator_TileGeneration_Transpiler
		{
			private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
				//IL_01e7: Expected O, but got Unknown
				//IL_0203: Unknown result type (might be due to invalid IL or missing references)
				//IL_020d: Expected O, but got Unknown
				//IL_0227: Unknown result type (might be due to invalid IL or missing references)
				//IL_0231: Expected O, but got Unknown
				//IL_0246: Unknown result type (might be due to invalid IL or missing references)
				//IL_0250: Expected O, but got Unknown
				//IL_026c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0276: Expected O, but got Unknown
				//IL_0290: Unknown result type (might be due to invalid IL or missing references)
				//IL_029a: Expected O, but got Unknown
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				if (list.Count <= 20)
				{
					REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Less than 20 instructions found - cannot patch!");
					return list;
				}
				int num = -1;
				int num2 = -1;
				for (int i = 3; i < list.Count - 1; i++)
				{
					if (list[i].opcode == OpCodes.Ldfld && list[i].operand is FieldInfo fieldInfo && fieldInfo.Name == "ModuleAmount" && i + 1 < list.Count && list[i + 1].opcode == OpCodes.Ldc_I4_3)
					{
						num = i - 3;
						REPOConomyPlugin.Logger.LogInfo((object)$"[Transpiler] Found ModuleAmount insert point at index {num}");
						break;
					}
				}
				for (int j = 1; j < list.Count - 4; j++)
				{
					if (list[j].opcode == OpCodes.Ldarg_0 && j + 1 < list.Count && list[j + 1].opcode == OpCodes.Ldc_I4_M1 && j + 4 < list.Count && list[j + 4].opcode == OpCodes.Ldfld && list[j + 4].operand is FieldInfo fieldInfo2 && fieldInfo2.Name == "ExtractionAmount")
					{
						num2 = j - 1;
						REPOConomyPlugin.Logger.LogInfo((object)$"[Transpiler] Found ExtractionAmount insert point at index {num2}");
						break;
					}
				}
				if (num == -1)
				{
					REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Failed to find ModuleAmount insertion point!");
					return list;
				}
				if (num2 == -1)
				{
					REPOConomyPlugin.Logger.LogError((object)"[Transpiler] Failed to find ExtractionAmount insertion point!");
					return list;
				}
				List<CodeInstruction> list2 = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldloc_1, (object)null),
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelScalingImprovements), "GetNewModuleCount", (Type[])null, (Type[])null)),
					new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ModuleAmount"))
				};
				list.InsertRange(num, list2);
				List<CodeInstruction> collection = new List<CodeInstruction>
				{
					new CodeInstruction(OpCodes.Ldloc_1, (object)null),
					new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(LevelScalingImprovements), "GetNewExtractionCount", (Type[])null, (Type[])null)),
					new CodeInstruction(OpCodes.Stfld, (object)AccessTools.Field(typeof(LevelGenerator), "ExtractionAmount"))
				};
				list.InsertRange(num2 + list2.Count, collection);
				REPOConomyPlugin.Logger.LogInfo((object)"[Transpiler] Successfully patched TileGeneration!");
				return list;
			}
		}

		private static int GetVanillaModuleAmount(int levelsCompleted)
		{
			int num = Mathf.Min(5 + levelsCompleted, 10);
			if (levelsCompleted >= 10)
			{
				num += Mathf.Min(levelsCompleted - 9, 5);
			}
			return num;
		}

		private static int GetVanillaExtractionAmount(int levelsCompleted)
		{
			int vanillaModuleAmount = GetVanillaModuleAmount(levelsCompleted);
			if (vanillaModuleAmount >= 15)
			{
				return 4;
			}
			if (vanillaModuleAmount >= 10)
			{
				return 3;
			}
			if (vanillaModuleAmount >= 8)
			{
				return 2;
			}
			if (vanillaModuleAmount >= 6)
			{
				return 1;
			}
			return 0;
		}

		public static int GetScaledModuleAmount(int levelsCompleted)
		{
			if (!REPOConfig.EnableLevelScaling.Value)
			{
				return GetVanillaModuleAmount(levelsCompleted);
			}
			int num = Mathf.Min(levelsCompleted, REPOConfig.LevelScalingMaxModulesLevel.Value);
			int value = REPOConfig.LevelScalingModulesInterval.Value;
			float num2 = REPOConfig.LevelScalingModulesPerInterval.Value;
			if (REPOConfig.EnableMultiplicativeScaling.Value)
			{
				int num3 = Mathf.FloorToInt((float)(num + 1) / (float)value);
				int num4 = 0;
				for (int i = 0; i < num3; i++)
				{
					num4 += (int)Mathf.Pow(num2, (float)i);
				}
				return REPOConfig.LevelScalingMinModules.Value + num4;
			}
			return REPOConfig.LevelScalingMinModules.Value + Mathf.FloorToInt((float)(num + 1) / (float)value) * (int)num2;
		}

		public static int GetScaledExtractionAmount(int levelsCompleted)
		{
			if (!REPOConfig.EnableLevelScaling.Value)
			{
				return GetVanillaExtractionAmount(levelsCompleted);
			}
			int value = REPOConfig.LevelScalingExtractionsInterval.Value;
			int value2 = REPOConfig.LevelScalingExtractionsPerInterval.Value;
			if (REPOConfig.EnableMultiplicativeScaling.Value)
			{
				int num = (levelsCompleted + 1) / value;
				int num2 = 0;
				for (int i = 0; i < num; i++)
				{
					num2 += (int)Mathf.Pow((float)value2, (float)i);
				}
				return Mathf.Min(REPOConfig.LevelScalingBaseExtractions.Value + num2, REPOConfig.LevelScalingMaxExtractions.Value);
			}
			return Mathf.Min(REPOConfig.LevelScalingBaseExtractions.Value + (levelsCompleted + 1) / value * value2, REPOConfig.LevelScalingMaxExtractions.Value);
		}

		public static float GetScaledHaulMultiplier(int levelsCompleted)
		{
			if (!REPOConfig.EnableLevelScaling.Value)
			{
				return 0.7f;
			}
			int num = Mathf.Min(levelsCompleted, REPOConfig.LevelScalingMaxHaulLevel.Value);
			if (REPOConfig.EnableMultiplicativeScaling.Value)
			{
				return Mathf.Min(REPOConfig.LevelScalingBaseHaulMultiplier.Value * Mathf.Pow(1f + REPOConfig.LevelScalingHaulIncreasePerLevel.Value, (float)num), REPOConfig.LevelScalingMaxHaulMultiplier.Value);
			}
			return Mathf.Min(REPOConfig.LevelScalingBaseHaulMultiplier.Value + (float)num * REPOConfig.LevelScalingHaulIncreasePerLevel.Value, REPOConfig.LevelScalingMaxHaulMultiplier.Value);
		}

		private static int GetNewModuleCount()
		{
			if ((Object)(object)RunManager.instance == (Object)null)
			{
				return 6;
			}
			if (SemiFunc.RunIsArena() || SemiFunc.RunIsShop() || SemiFunc.MenuLevel() || SemiFunc.RunIsLobby())
			{
				return 6;
			}
			int levelsCompleted = RunManager.instance.levelsCompleted;
			int scaledModuleAmount = GetScaledModuleAmount(levelsCompleted);
			REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] New ModuleCount: {scaledModuleAmount} for level {levelsCompleted + 1}");
			return scaledModuleAmount;
		}

		private static int GetNewExtractionCount()
		{
			if ((Object)(object)RunManager.instance == (Object)null)
			{
				return 1;
			}
			if (SemiFunc.RunIsArena() || SemiFunc.RunIsShop() || SemiFunc.MenuLevel() || SemiFunc.RunIsLobby())
			{
				return 0;
			}
			int levelsCompleted = RunManager.instance.levelsCompleted;
			int scaledExtractionAmount = GetScaledExtractionAmount(levelsCompleted);
			REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] New ExtractionCount: {scaledExtractionAmount} for level {levelsCompleted + 1}");
			return scaledExtractionAmount;
		}
	}
	[HarmonyPatch(typeof(RoundDirector), "StartRoundLogic")]
	public static class Patch_RoundDirector_StartRoundLogic
	{
		public static bool IsHaulScaled;

		private static void Prefix(RoundDirector __instance, ref int value)
		{
			if (SemiFunc.IsMasterClientOrSingleplayer() && !((Object)(object)RunManager.instance == (Object)null) && !((Object)(object)__instance == (Object)null) && !SemiFunc.RunIsArena() && !SemiFunc.RunIsShop() && !SemiFunc.MenuLevel() && !SemiFunc.RunIsLobby())
			{
				if (IsHaulScaled)
				{
					REPOConomyPlugin.Logger.LogInfo((object)"[LevelScaling] Haul already scaled, skipping double apply.");
				}
				else if (REPOConfig.EnableLevelScaling.Value)
				{
					float scaledHaulMultiplier = LevelScalingImprovements.GetScaledHaulMultiplier(RunManager.instance.levelsCompleted);
					float num = value;
					value = Mathf.RoundToInt(num * (scaledHaulMultiplier / 0.7f));
					IsHaulScaled = true;
					REPOConomyPlugin.Logger.LogInfo((object)$"[LevelScaling] Haul goal scaled: {value} (original: {num}, multiplier: {scaledHaulMultiplier:F2})");
				}
			}
		}
	}
}
namespace REPOConomyMod
{
	[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;

		public static bool ShowChancesInLevel;

		private bool economyResetPending = true;

		private bool showGUI;

		private float displayTimer = 20f;

		private string lastSceneType = "";

		private Vector2 scrollPosition = Vector2.zero;

		private float scrollSpeed = 100f;

		private float autoScrollTimer;

		private float autoScrollDelay = 1.5f;

		private bool autoScrollActive;

		private float autoScrollSpeed = 50f;

		private float cachedContentHeight;

		private float cachedScrollableHeight;

		private float fadeAlpha;

		private float targetFadeAlpha;

		private float glowPulse;

		private Texture2D bgTexture;

		private Texture2D gradientTexture;

		private Texture2D glowTexture;

		private Texture2D separatorTexture;

		private GUIStyle noScrollbarStyle;

		private void Awake()
		{
			Instance = this;
			InitializeTextures();
			InitializeStyles();
		}

		private void InitializeStyles()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			noScrollbarStyle = new GUIStyle();
		}

		private void InitializeTextures()
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			bgTexture = MakeTexture(2, 2, new Color(0.05f, 0.05f, 0.08f, 0.95f));
			gradientTexture = MakeGradientTexture();
			glowTexture = MakeGlowTexture();
			separatorTexture = MakeTexture(2, 2, new Color(0.3f, 0.6f, 1f, 0.3f));
		}

		private Texture2D MakeTexture(int width, int height, Color col)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			Color[] array = (Color[])(object)new Color[width * height];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = col;
			}
			Texture2D val = new Texture2D(width, height);
			val.SetPixels(array);
			val.Apply();
			return val;
		}

		private Texture2D MakeGradientTexture()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			int num = 256;
			Texture2D val = new Texture2D(1, num);
			for (int i = 0; i < num; i++)
			{
				float num2 = (float)i / (float)num;
				Color val2 = Color.Lerp(new Color(0.1f, 0.15f, 0.25f, 0.9f), new Color(0.05f, 0.05f, 0.08f, 0.95f), num2);
				val.SetPixel(0, i, val2);
			}
			val.Apply();
			return val;
		}

		private Texture2D MakeGlowTexture()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			int num = 64;
			Texture2D val = new Texture2D(num, num);
			for (int i = 0; i < num; i++)
			{
				for (int j = 0; j < num; j++)
				{
					float num2 = ((float)j - (float)num / 2f) / ((float)num / 2f);
					float num3 = ((float)i - (float)num / 2f) / ((float)num / 2f);
					float num4 = Mathf.Sqrt(num2 * num2 + num3 * num3);
					float num5 = Mathf.Max(0f, 1f - num4) * 0.5f;
					val.SetPixel(j, i, new Color(0.3f, 0.6f, 1f, num5));
				}
			}
			val.Apply();
			return val;
		}

		private void Update()
		{
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			fadeAlpha = Mathf.Lerp(fadeAlpha, targetFadeAlpha, Time.deltaTime * 8f);
			glowPulse = Mathf.Sin(Time.time * 2f) * 0.3f + 0.7f;
			if (Input.GetKeyDown(REPOConfig.UIToggleHotkey.Value))
			{
				showGUI = !showGUI;
				targetFadeAlpha = (showGUI ? 1f : 0f);
				displayTimer = 20f;
				scrollPosition = Vector2.zero;
				if (showGUI)
				{
					autoScrollTimer = 0f;
					autoScrollActive = false;
				}
				else
				{
					autoScrollTimer = 0f;
					autoScrollActive = false;
				}
			}
			string currentSceneType = GetCurrentSceneType();
			if (currentSceneType != lastSceneType)
			{
				lastSceneType = currentSceneType;
				switch (currentSceneType)
				{
				case "Level":
					economyResetPending = true;
					UIShownOnce = false;
					showGUI = false;
					targetFadeAlpha = 0f;
					autoScrollTimer = 0f;
					autoScrollActive = false;
					break;
				case "Shop":
					showGUI = false;
					targetFadeAlpha = 0f;
					autoScrollTimer = 0f;
					autoScrollActive = false;
					break;
				}
			}
			bool flag = economyResetPending;
			if (flag)
			{
				bool flag2 = ((currentSceneType == "Level" || currentSceneType == "Lobby") ? true : false);
				flag = flag2;
			}
			if (flag)
			{
				REPOConomyPlugin.ResetEconomy();
				economyResetPending = false;
			}
			if (!showGUI || (!REPOConomyPlugin.HasEconomy && !(currentSceneType == "Lobby")))
			{
				return;
			}
			displayTimer -= Time.deltaTime;
			if (displayTimer <= 0f)
			{
				showGUI = false;
				targetFadeAlpha = 0f;
				autoScrollTimer = 0f;
				autoScrollActive = false;
			}
			bool flag3 = false;
			float num = Mathf.Max(0f, cachedContentHeight - cachedScrollableHeight);
			if (Input.GetKey((KeyCode)274))
			{
				scrollPosition.y += scrollSpeed * Time.deltaTime;
				scrollPosition.y = Mathf.Min(scrollPosition.y, num);
				flag3 = true;
				autoScrollTimer = 0f;
				autoScrollActive = false;
			}
			if (Input.GetKey((KeyCode)273))
			{
				scrollPosition.y -= scrollSpeed * Time.deltaTime;
				scrollPosition.y = Mathf.Max(0f, scrollPosition.y);
				flag3 = true;
				autoScrollTimer = 0f;
				autoScrollActive = false;
			}
			if (flag3)
			{
				return;
			}
			if (!autoScrollActive)
			{
				autoScrollTimer += Time.deltaTime;
				if (autoScrollTimer >= autoScrollDelay)
				{
					autoScrollActive = true;
				}
				return;
			}
			scrollPosition.y += autoScrollSpeed * Time.deltaTime;
			scrollPosition.y = Mathf.Min(scrollPosition.y, num);
			if (scrollPosition.y >= num)
			{
				autoScrollActive = false;
			}
		}

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

		public void ResetGUI()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			showGUI = true;
			targetFadeAlpha = 1f;
			displayTimer = 20f;
			scrollPosition = Vector2.zero;
			autoScrollTimer = 0f;
			autoScrollActive = false;
		}

		public void ShowGUI()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			showGUI = true;
			targetFadeAlpha = 1f;
			displayTimer = 20f;
			scrollPosition = Vector2.zero;
			autoScrollTimer = 0f;
			autoScrollActive = false;
		}

		private void OnGUI()
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			if (!(fadeAlpha < 0.01f) && showGUI && (REPOConomyPlugin.HasEconomy || SemiFunc.RunIsLobby()) && (SemiFunc.RunIsLevel() || SemiFunc.RunIsLobby()))
			{
				Color color = GUI.color;
				GUI.color = new Color(1f, 1f, 1f, fadeAlpha);
				int currentLevel = REPOConomyPlugin.GetCurrentLevel();
				float num = (float)Screen.width / 2f;
				float num2 = (float)Screen.height * 0.12f;
				float num3 = Mathf.Min((float)Screen.width * 0.45f, 700f);
				float num4 = 500f;
				Rect val = default(Rect);
				((Rect)(ref val))..ctor(num - num3 / 2f, num2, num3, num4);
				DrawGlowEffect(val);
				DrawModernBackground(val);
				DrawHeaderSection(val);
				DrawContentSection(val);
				DrawFooterSection(val, currentLevel);
				GUI.color = color;
			}
		}

		private void DrawGlowEffect(Rect rect)
		{
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			float num = 30f * glowPulse;
			Rect val = new Rect(((Rect)(ref rect)).x - num, ((Rect)(ref rect)).y - num, ((Rect)(ref rect)).width + num * 2f, ((Rect)(ref rect)).height + num * 2f);
			GUI.color = new Color(0.3f, 0.6f, 1f, 0.15f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)glowTexture, (ScaleMode)0);
			GUI.color = Color.white;
		}

		private void DrawModernBackground(Rect rect)
		{
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			Rect val = new Rect(((Rect)(ref rect)).x - 2f, ((Rect)(ref rect)).y - 2f, ((Rect)(ref rect)).width + 4f, ((Rect)(ref rect)).height + 4f);
			GUI.color = new Color(0.3f, 0.6f, 1f, 0.4f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			GUI.color = new Color(1f, 1f, 1f, fadeAlpha);
			GUI.DrawTexture(rect, (Texture)(object)gradientTexture, (ScaleMode)0);
			DrawBorder(rect, new Color(0.2f, 0.4f, 0.8f, 0.6f * fadeAlpha), 1f);
		}

		private void DrawBorder(Rect rect, Color color, float thickness)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			GUI.color = color;
			GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, ((Rect)(ref rect)).width, thickness), (Texture)(object)Texture2D.whiteTexture);
			GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y + ((Rect)(ref rect)).height - thickness, ((Rect)(ref rect)).width, thickness), (Texture)(object)Texture2D.whiteTexture);
			GUI.DrawTexture(new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture);
			GUI.DrawTexture(new Rect(((Rect)(ref rect)).x + ((Rect)(ref rect)).width - thickness, ((Rect)(ref rect)).y, thickness, ((Rect)(ref rect)).height), (Texture)(object)Texture2D.whiteTexture);
			GUI.color = Color.white;
		}

		private void DrawHeaderSection(Rect mainRect)
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Expected O, but got Unknown
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01de: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Expected O, but got Unknown
			//IL_0259: 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_02ae: Unknown result type (might be due to invalid IL or missing references)
			bool flag = REPOConfig.UILanguage.Value == "Russian";
			KeyCode value = REPOConfig.UIToggleHotkey.Value;
			string text = ((object)(KeyCode)(ref value)).ToString();
			string currentSceneType = GetCurrentSceneType();
			string text2 = ((!(currentSceneType == "Lobby") && (!(currentSceneType == "Level") || !ShowChancesInLevel)) ? (flag ? "АКТИВНЫЕ СОБЫТИЯ" : "ACTIVE EVENTS") : (flag ? "ШАНСЫ ВЫПАДЕНИЯ СОБЫТИЙ" : "EVENT DROP CHANCES"));
			Rect val = new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y, ((Rect)(ref mainRect)).width, 60f);
			GUI.color = new Color(0.15f, 0.25f, 0.4f, 0.5f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			GUI.color = Color.white;
			GUIStyle val2 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 28,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)4
			};
			val2.normal.textColor = new Color(0.7f, 0.9f, 1f, fadeAlpha);
			GUIStyle val3 = val2;
			GUI.color = new Color(0f, 0f, 0f, 0.5f * fadeAlpha);
			GUI.Label(new Rect(((Rect)(ref mainRect)).x + 2f, ((Rect)(ref mainRect)).y + 12f, ((Rect)(ref mainRect)).width, 40f), text2, val3);
			GUI.color = new Color(1f, 1f, 1f, fadeAlpha);
			GUI.Label(new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 10f, ((Rect)(ref mainRect)).width, 40f), text2, val3);
			GUIStyle val4 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 12,
				alignment = (TextAnchor)4
			};
			val4.normal.textColor = new Color(0.6f, 0.8f, 1f, 0.7f * fadeAlpha);
			GUIStyle val5 = val4;
			string text3 = (flag ? ("Нажмите [" + text + "] для переключения") : ("Press [" + text + "] to toggle"));
			GUI.Label(new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 40f, ((Rect)(ref mainRect)).width, 20f), text3, val5);
			Rect val6 = new Rect(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + 58f, ((Rect)(ref mainRect)).width, 2f);
			GUI.color = new Color(0.3f, 0.6f, 1f, 0.6f * fadeAlpha * glowPulse);
			GUI.DrawTexture(val6, (Texture)(object)Texture2D.whiteTexture);
		}

		private void DrawContentSection(Rect mainRect)
		{
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Rect)(ref mainRect)).x + 15f, ((Rect)(ref mainRect)).y + 70f, ((Rect)(ref mainRect)).width - 30f, ((Rect)(ref mainRect)).height - 130f);
			cachedScrollableHeight = ((Rect)(ref val)).height;
			string currentSceneType = GetCurrentSceneType();
			cachedContentHeight = CalculateActualContentHeight(((Rect)(ref val)).width - 20f, currentSceneType);
			Rect val2 = default(Rect);
			((Rect)(ref val2))..ctor(0f, 0f, ((Rect)(ref val)).width - 20f, cachedContentHeight);
			GUI.color = new Color(0.08f, 0.08f, 0.12f, 0.6f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			GUI.color = Color.white;
			scrollPosition = GUI.BeginScrollView(val, scrollPosition, val2, false, false, GUIStyle.none, GUIStyle.none);
			float yOffset = 10f;
			if (currentSceneType == "Lobby" || (currentSceneType == "Level" && ShowChancesInLevel))
			{
				yOffset = DrawChancesContent(val2, yOffset);
			}
			else
			{
				yOffset = DrawActiveEventsContent(val2, yOffset);
			}
			GUI.EndScrollView();
			if (cachedContentHeight > cachedScrollableHeight)
			{
				DrawScrollIndicator(val);
			}
		}

		private void DrawScrollIndicator(Rect area)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Max(1f, cachedContentHeight - cachedScrollableHeight);
			float num2 = scrollPosition.y / num;
			float num3 = 40f;
			float num4 = ((Rect)(ref area)).y + num2 * (((Rect)(ref area)).height - num3);
			Rect val = new Rect(((Rect)(ref area)).x + ((Rect)(ref area)).width - 6f, num4, 4f, num3);
			GUI.color = new Color(0.3f, 0.6f, 1f, 0.7f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = Color.white;
		}

		private float CalculateActualContentHeight(float contentWidth, string sceneType)
		{
			float num = 10f;
			_ = REPOConfig.UILanguage.Value == "Russian";
			if (sceneType == "Lobby" || (sceneType == "Level" && ShowChancesInLevel))
			{
				if (REPOConfig.EnableSharedPool.Value)
				{
					num += 35f;
					Dictionary<EventType, float> dictionary = new Dictionary<EventType, float>();
					foreach (EventType value in Enum.GetValues(typeof(EventType)))
					{
						dictionary[value] = REPOEventManager.GetSharedPoolWeight(value);
					}
					num += (float)(dictionary.Count * 32);
					num += 15f;
				}
				else
				{
					EventCategory[] array = new EventCategory[4]
					{
						EventCategory.LootModifier,
						EventCategory.EnemyModifier,
						EventCategory.PlayerModifier,
						EventCategory.EnvironmentModifier
					};
					foreach (EventCategory category in array)
					{
						List<GameEvent> list = REPOEventManager.AllEvents.Where((GameEvent e) => e.category == category && REPOConfig.ModifierEnables["Enable " + e.id].Value).ToList();
						if (list.Count == 0)
						{
							continue;
						}
						num += 35f;
						Dictionary<EventType, float> dictionary2 = new Dictionary<EventType, float>();
						foreach (GameEvent item in list)
						{
							EventType eventType2 = item.eventType;
							if (!dictionary2.ContainsKey(eventType2))
							{
								dictionary2[eventType2] = 0f;
							}
							dictionary2[eventType2] += REPOEventManager.GetEventWeight(eventType2);
						}
						num += (float)(dictionary2.Count * 32);
						num += 10f;
					}
				}
			}
			else
			{
				num += 35f;
				num += 90f;
				if (REPOEventManager.ActiveEvents.Count > 0)
				{
					num += 35f;
					num += (float)(REPOEventManager.ActiveEvents.Count * 68);
					num += 10f;
				}
				if (sceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.EnableLevelScaling.Value)
				{
					num += 35f;
					num += 110f;
				}
				if (sceneType == "Level" && (Object)(object)RunManager.instance != (Object)null)
				{
					int level = RunManager.instance.levelsCompleted + 1;
					float num2 = CalculateScaling(level, REPOConfig.EnableEnemyHPScaling.Value, REPOConfig.EnemyHPStartLevel.Value, REPOConfig.EnemyHPMultiplier.Value, REPOConfig.EnemyHPUseExponentialScaling.Value, REPOConfig.EnemyHPMaxLevel.Value);
					float num3 = CalculateScaling(level, REPOConfig.EnableEnemyCapScaling.Value, REPOConfig.EnemyCapStartLevel.Value, REPOConfig.EnemyCapMultiplier.Value, REPOConfig.EnemyCapUseExponentialScaling.Value, REPOConfig.EnemyCapMaxLevel.Value);
					float num4 = CalculateScaling(level, REPOConfig.EnableMapValueScaling.Value, REPOConfig.MapValueStartLevel.Value, REPOConfig.MapValueMultiplier.Value, REPOConfig.MapValueUseExponentialScaling.Value, REPOConfig.MapValueMaxLevel.Value);
					if (num2 > 1f || num3 > 1f || num4 > 1f)
					{
						num += 35f;
						float num5 = 10f;
						if (num2 > 1f)
						{
							num5 += 25f;
						}
						if (num3 > 1f)
						{
							num5 += 25f;
						}
						if (num4 > 1f)
						{
							num5 += 25f;
						}
						num += num5 + 20f;
					}
				}
			}
			return num + 20f;
		}

		private float DrawChancesContent(Rect viewRect, float yOffset)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			bool isRu = REPOConfig.UILanguage.Value == "Russian";
			yOffset = ((!REPOConfig.EnableSharedPool.Value) ? DrawCategoryChances(viewRect, yOffset, isRu) : DrawSharedPoolChances(viewRect, yOffset, isRu));
			return yOffset;
		}

		private float DrawSharedPoolChances(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0104: Unknown result type (might be due to invalid IL or missing references)
			yOffset = DrawModernCategory(viewRect, yOffset, isRu ? "ОБЩИЙ ПУЛ" : "SHARED POOL", new Color(1f, 0.8f, 0.2f, fadeAlpha));
			Dictionary<EventType, float> dictionary = new Dictionary<EventType, float>();
			foreach (EventType value in Enum.GetValues(typeof(EventType)))
			{
				dictionary[value] = REPOEventManager.GetSharedPoolWeight(value);
			}
			float num = dictionary.Values.Sum();
			foreach (KeyValuePair<EventType, float> item in dictionary.OrderBy((KeyValuePair<EventType, float> k) => (int)k.Key))
			{
				EventType key = item.Key;
				float chance = item.Value / num * 100f;
				string eventIcon = GetEventIcon(key);
				string eventTypeName = GetEventTypeName(key, isRu);
				yOffset = DrawModernChanceItem(viewRect, yOffset, eventIcon, eventTypeName, chance, REPOEventManager.GetEventColor(key));
			}
			return yOffset + 15f;
		}

		private float DrawCategoryChances(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0160: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			EventCategory[] array = new EventCategory[4]
			{
				EventCategory.LootModifier,
				EventCategory.EnemyModifier,
				EventCategory.PlayerModifier,
				EventCategory.EnvironmentModifier
			};
			foreach (EventCategory category in array)
			{
				List<GameEvent> list = REPOEventManager.AllEvents.Where((GameEvent e) => e.category == category && REPOConfig.ModifierEnables["Enable " + e.id].Value).ToList();
				if (list.Count == 0)
				{
					continue;
				}
				string categoryName = GetCategoryName(category, isRu);
				yOffset = DrawModernCategory(viewRect, yOffset, categoryName, GetCategoryColor(category));
				Dictionary<EventType, float> dictionary = new Dictionary<EventType, float>();
				foreach (GameEvent item in list)
				{
					EventType eventType = item.eventType;
					if (!dictionary.ContainsKey(eventType))
					{
						dictionary[eventType] = 0f;
					}
					dictionary[eventType] += REPOEventManager.GetEventWeight(eventType);
				}
				float num = dictionary.Values.Sum();
				foreach (KeyValuePair<EventType, float> item2 in dictionary.OrderBy((KeyValuePair<EventType, float> k) => (int)k.Key))
				{
					EventType key = item2.Key;
					float chance = item2.Value / num * 100f;
					string eventIcon = GetEventIcon(key);
					string eventTypeName = GetEventTypeName(key, isRu);
					yOffset = DrawModernChanceItem(viewRect, yOffset, eventIcon, eventTypeName, chance, REPOEventManager.GetEventColor(key));
				}
				yOffset += 10f;
			}
			return yOffset;
		}

		private float DrawActiveEventsContent(Rect viewRect, float yOffset)
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			bool isRu = REPOConfig.UILanguage.Value == "Russian";
			string currentSceneType = GetCurrentSceneType();
			yOffset = DrawEconomySection(viewRect, yOffset, isRu);
			yOffset = DrawModifiersSection(viewRect, yOffset, isRu);
			if (currentSceneType == "Level" && (Object)(object)RunManager.instance != (Object)null && REPOConfig.EnableLevelScaling.Value)
			{
				yOffset = DrawLevelScalingSection(viewRect, yOffset, isRu);
			}
			if (currentSceneType == "Level" && (Object)(object)RunManager.instance != (Object)null)
			{
				yOffset = DrawMapScalingSection(viewRect, yOffset, isRu);
			}
			return yOffset;
		}

		private float DrawEconomySection(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Expected O, but got Unknown
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0166: Expected O, but got Unknown
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: 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_01fb: Expected O, but got Unknown
			//IL_0227: Unknown result type (might be due to invalid IL or missing references)
			string economyName = REPOConomyPlugin.GetEconomyName();
			string economyFlavor = REPOConomyPlugin.GetEconomyFlavor();
			string text = REPOConomyPlugin.MinPercent.ToString("+#0.##;-#0.##;0");
			string text2 = REPOConomyPlugin.MaxPercent.ToString("+#0.##;-#0.##;0");
			yOffset = DrawModernCategory(viewRect, yOffset, isRu ? "ЭКОНОМИКА" : "ECONOMY", new Color(0.2f, 0.8f, 0.4f, fadeAlpha));
			Rect rect = default(Rect);
			((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 80f);
			DrawModernCard(rect, REPOConomyPlugin.CurrentEconomyColor);
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = 20,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)1
			};
			val.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha);
			GUIStyle val2 = val;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 10f, ((Rect)(ref rect)).width - 20f, 25f), economyName ?? "", val2);
			GUIStyle val3 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 16,
				alignment = (TextAnchor)1
			};
			val3.normal.textColor = new Color(0.8f, 0.9f, 1f, fadeAlpha);
			GUIStyle val4 = val3;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 35f, ((Rect)(ref rect)).width - 20f, 20f), text + "% — " + text2 + "%", val4);
			GUIStyle val5 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 12,
				alignment = (TextAnchor)1
			};
			val5.normal.textColor = new Color(0.7f, 0.7f, 0.7f, fadeAlpha);
			val5.wordWrap = true;
			GUIStyle val6 = val5;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 10f, ((Rect)(ref rect)).y + 55f, ((Rect)(ref rect)).width - 20f, 20f), economyFlavor, val6);
			return yOffset + 90f;
		}

		private float DrawModifiersSection(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			int count = REPOEventManager.ActiveEvents.Count;
			if (count == 0)
			{
				return yOffset;
			}
			int count2 = REPOEventManager.ForcedEvents.Count;
			int num = count - count2;
			string text = (isRu ? "МОДИФИКАТОРЫ" : "MODIFIERS");
			if (count2 > 0)
			{
				text += (isRu ? $" ({num} выбрано, {count2} принудительно)" : $" ({num} selected, {count2} forced)");
			}
			yOffset = DrawModernCategory(viewRect, yOffset, text, new Color(0.8f, 0.3f, 1f, fadeAlpha));
			foreach (GameEvent activeEvent in REPOEventManager.ActiveEvents)
			{
				bool isForced = REPOEventManager.ForcedEvents.Contains(activeEvent);
				yOffset = DrawModifierCard(viewRect, yOffset, activeEvent, isRu, isForced);
			}
			return yOffset + 10f;
		}

		private float DrawModifierCard(Rect viewRect, float yOffset, GameEvent evt, bool isRu, bool isForced = false)
		{
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Expected O, but got Unknown
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0138: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Expected O, but got Unknown
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			string text = evt.GetName();
			string description = evt.GetDescription();
			if (isForced)
			{
				text = text ?? "";
			}
			float num = 60f;
			Rect rect = default(Rect);
			((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num);
			if (!isForced)
			{
				_ = evt.color;
			}
			else
			{
				new Color(evt.color.r * 0.7f, evt.color.g * 0.7f, evt.color.b * 0.7f, evt.color.a);
			}
			DrawModernCard(rect, evt.color);
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = 16,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)0
			};
			val.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha);
			GUIStyle val2 = val;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, ((Rect)(ref rect)).y + 8f, ((Rect)(ref rect)).width - 30f, 25f), text, val2);
			GUIStyle val3 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 12,
				alignment = (TextAnchor)0
			};
			val3.normal.textColor = new Color(0.8f, 0.8f, 0.8f, fadeAlpha);
			val3.wordWrap = true;
			GUIStyle val4 = val3;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, ((Rect)(ref rect)).y + 30f, ((Rect)(ref rect)).width - 30f, 26f), description, val4);
			return yOffset + num + 8f;
		}

		private float DrawLevelScalingSection(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fe: Unknown result type (might be due to invalid IL or missing references)
			yOffset = DrawModernCategory(viewRect, yOffset, isRu ? "СКЕЙЛИНГ УРОВНЕЙ" : "LEVEL SCALING", new Color(0.2f, 0.6f, 1f, fadeAlpha));
			int levelsCompleted = RunManager.instance.levelsCompleted;
			int scaledModuleAmount = LevelScalingImprovements.GetScaledModuleAmount(levelsCompleted);
			int scaledExtractionAmount = LevelScalingImprovements.GetScaledExtractionAmount(levelsCompleted);
			float scaledHaulMultiplier = LevelScalingImprovements.GetScaledHaulMultiplier(levelsCompleted);
			Rect rect = default(Rect);
			((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 100f);
			DrawModernCard(rect, new Color(0.2f, 0.6f, 1f, 0.3f));
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = 14,
				alignment = (TextAnchor)0
			};
			val.normal.textColor = new Color(0.9f, 0.9f, 1f, fadeAlpha);
			GUIStyle val2 = val;
			float num = ((Rect)(ref rect)).y + 10f;
			float num2 = 20f;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), string.Format("\ud83d\udcca {0}: {1}", isRu ? "Уровень" : "Level", levelsCompleted + 1), val2);
			num += num2;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), string.Format("\ud83d\udd27 {0}: {1}", isRu ? "Модули" : "Modules", scaledModuleAmount), val2);
			num += num2;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), string.Format("\ud83d\udeaa {0}: {1}", isRu ? "Экстракции" : "Extractions", scaledExtractionAmount), val2);
			num += num2;
			GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num, ((Rect)(ref rect)).width - 30f, num2), string.Format("\ud83d\udcb0 {0}: {1:F2}x", isRu ? "Хаул" : "Haul", scaledHaulMultiplier), val2);
			return yOffset + 110f;
		}

		private float DrawMapScalingSection(Rect viewRect, float yOffset, bool isRu)
		{
			//IL_00db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_016d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Expected O, but got Unknown
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			int level = RunManager.instance.levelsCompleted + 1;
			float num = CalculateScaling(level, REPOConfig.EnableEnemyHPScaling.Value, REPOConfig.EnemyHPStartLevel.Value, REPOConfig.EnemyHPMultiplier.Value, REPOConfig.EnemyHPUseExponentialScaling.Value, REPOConfig.EnemyHPMaxLevel.Value);
			float num2 = CalculateScaling(level, REPOConfig.EnableEnemyCapScaling.Value, REPOConfig.EnemyCapStartLevel.Value, REPOConfig.EnemyCapMultiplier.Value, REPOConfig.EnemyCapUseExponentialScaling.Value, REPOConfig.EnemyCapMaxLevel.Value);
			float num3 = CalculateScaling(level, REPOConfig.EnableMapValueScaling.Value, REPOConfig.MapValueStartLevel.Value, REPOConfig.MapValueMultiplier.Value, REPOConfig.MapValueUseExponentialScaling.Value, REPOConfig.MapValueMaxLevel.Value);
			if (!(num > 1f) && !(num2 > 1f) && !(num3 > 1f))
			{
				return yOffset;
			}
			yOffset = DrawModernCategory(viewRect, yOffset, isRu ? "СКЕЙЛИНГ КАРТЫ" : "MAP SCALING", new Color(1f, 0.4f, 0.4f, fadeAlpha));
			float num4 = 0f;
			if (num > 1f)
			{
				num4 += 25f;
			}
			if (num2 > 1f)
			{
				num4 += 25f;
			}
			if (num3 > 1f)
			{
				num4 += 25f;
			}
			Rect rect = default(Rect);
			((Rect)(ref rect))..ctor(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, num4 + 10f);
			DrawModernCard(rect, new Color(1f, 0.4f, 0.4f, 0.2f));
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = 13,
				alignment = (TextAnchor)0
			};
			val.normal.textColor = new Color(1f, 0.9f, 0.9f, fadeAlpha);
			GUIStyle val2 = val;
			float num5 = ((Rect)(ref rect)).y + 8f;
			if (num > 1f)
			{
				GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), string.Format("\ud83d\udc79 {0}: x{1:F2} (+{2:F0}%)", isRu ? "HP врагов" : "Enemy HP", num, (num - 1f) * 100f), val2);
				num5 += 25f;
			}
			if (num2 > 1f)
			{
				GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), string.Format("\ud83d\udc79 {0}: x{1:F2} (+{2:F0}%)", isRu ? "Лимит врагов" : "Enemy Cap", num2, (num2 - 1f) * 100f), val2);
				num5 += 25f;
			}
			if (num3 > 1f)
			{
				GUI.Label(new Rect(((Rect)(ref rect)).x + 15f, num5, ((Rect)(ref rect)).width - 30f, 22f), string.Format("\ud83d\udc8e {0}: x{1:F2} (+{2:F0}%)", isRu ? "Стоимость карты" : "Map Value", num3, (num3 - 1f) * 100f), val2);
			}
			return yOffset + num4 + 20f;
		}

		private float CalculateScaling(int level, bool enabled, int startLevel, float multiplier, bool exponential, int maxLevel)
		{
			if (!enabled || level < startLevel)
			{
				return 1f;
			}
			int num = Mathf.Min(level, maxLevel);
			if (exponential)
			{
				return Mathf.Pow(multiplier, (float)(num - startLevel + 1));
			}
			return 1f + (float)(num - startLevel) * (multiplier - 1f);
		}

		private void DrawModernCard(Rect rect, Color accentColor)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			Rect val = new Rect(((Rect)(ref rect)).x + 3f, ((Rect)(ref rect)).y + 3f, ((Rect)(ref rect)).width, ((Rect)(ref rect)).height);
			GUI.color = new Color(0f, 0f, 0f, 0.3f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			GUI.color = new Color(0.1f, 0.12f, 0.15f, 0.9f * fadeAlpha);
			GUI.DrawTexture(rect, (Texture)(object)bgTexture);
			Rect val2 = new Rect(((Rect)(ref rect)).x, ((Rect)(ref rect)).y, 4f, ((Rect)(ref rect)).height);
			GUI.color = new Color(accentColor.r, accentColor.g, accentColor.b, 0.8f * fadeAlpha);
			GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture);
			DrawBorder(rect, new Color(0.3f, 0.3f, 0.4f, 0.5f * fadeAlpha), 1f);
			GUI.color = Color.white;
		}

		private float DrawModernCategory(Rect viewRect, float yOffset, string title, Color color)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			GUIStyle val = new GUIStyle(GUI.skin.label)
			{
				fontSize = 18,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)0
			};
			val.normal.textColor = new Color(color.r, color.g, color.b, fadeAlpha);
			GUIStyle val2 = val;
			GUI.color = new Color(color.r, color.g, color.b, 0.3f * fadeAlpha);
			GUI.Label(new Rect(12f, yOffset + 2f, ((Rect)(ref viewRect)).width - 20f, 25f), title, val2);
			GUI.color = Color.white;
			GUI.Label(new Rect(10f, yOffset, ((Rect)(ref viewRect)).width - 20f, 25f), title, val2);
			Rect val3 = new Rect(10f, yOffset + 27f, ((Rect)(ref viewRect)).width - 20f, 2f);
			GUI.color = new Color(color.r, color.g, color.b, 0.4f * fadeAlpha);
			GUI.DrawTexture(val3, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = Color.white;
			return yOffset + 35f;
		}

		private float DrawModernChanceItem(Rect viewRect, float yOffset, string icon, string name, float chance, Color color)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0103: Expected O, but got Unknown
			//IL_0103: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_0157: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_016b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0178: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Expected O, but got Unknown
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Expected O, but got Unknown
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(15f, yOffset, ((Rect)(ref viewRect)).width - 30f, 28f);
			GUI.color = new Color(0.08f, 0.1f, 0.12f, 0.7f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			float num = (((Rect)(ref viewRect)).width - 30f) * (chance / 100f);
			Rect val2 = new Rect(15f, yOffset, num, 28f);
			GUI.color = new Color(color.r * 0.3f, color.g * 0.3f, color.b * 0.3f, 0.4f * fadeAlpha);
			GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture);
			GUIStyle val3 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 16,
				alignment = (TextAnchor)3
			};
			val3.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha);
			GUIStyle val4 = val3;
			GUI.color = Color.white;
			GUI.Label(new Rect(((Rect)(ref val)).x + 8f, ((Rect)(ref val)).y, 30f, ((Rect)(ref val)).height), icon, val4);
			GUIStyle val5 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 14,
				alignment = (TextAnchor)3
			};
			val5.normal.textColor = new Color(color.r, color.g, color.b, fadeAlpha);
			GUIStyle val6 = val5;
			GUI.Label(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y, ((Rect)(ref val)).width - 80f, ((Rect)(ref val)).height), name, val6);
			GUIStyle val7 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 14,
				fontStyle = (FontStyle)1,
				alignment = (TextAnchor)5
			};
			val7.normal.textColor = new Color(1f, 1f, 1f, fadeAlpha);
			GUIStyle val8 = val7;
			GUI.Label(new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width - 10f, ((Rect)(ref val)).height), $"{chance:F1}%", val8);
			DrawBorder(val, new Color(0.2f, 0.2f, 0.3f, 0.4f * fadeAlpha), 1f);
			return yOffset + 32f;
		}

		private void DrawFooterSection(Rect mainRect, int level)
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0125: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015b: Expected O, but got Unknown
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			bool num = REPOConfig.UILanguage.Value == "Russian";
			Rect val = default(Rect);
			((Rect)(ref val))..ctor(((Rect)(ref mainRect)).x, ((Rect)(ref mainRect)).y + ((Rect)(ref mainRect)).height - 50f, ((Rect)(ref mainRect)).width, 50f);
			GUI.color = new Color(0.12f, 0.15f, 0.2f, 0.8f * fadeAlpha);
			GUI.DrawTexture(val, (Texture)(object)bgTexture);
			Rect val2 = new Rect(((Rect)(ref val)).x, ((Rect)(ref val)).y, ((Rect)(ref val)).width, 1f);
			GUI.color = new Color(0.3f, 0.6f, 1f, 0.5f * fadeAlpha);
			GUI.DrawTexture(val2, (Texture)(object)Texture2D.whiteTexture);
			GUI.color = Color.white;
			string text = (num ? "Сложность" : "Difficulty");
			string text2 = (num ? "Уровень" : "Level");
			string text3 = (num ? "Игроки" : "Players");
			string text4 = "Seed";
			REPODifficultyManager.GetDifficultyColor();
			string difficultyText = REPODifficultyManager.GetDifficultyText();
			string currentSeed = REPOSeedManager.CurrentSeed;
			GUIStyle val3 = new GUIStyle(GUI.skin.label)
			{
				fontSize = 14,
				alignment = (TextAnchor)4
			};
			val3.normal.textColor = new Color(0.8f, 0.9f, 1f, fadeAlpha);
			GUIStyle val4 = val3;
			string text5 = $"{text}: {difficultyText} ({REPODifficultyManager.CurrentDifficulty:F1}/{REPOConfig.DifficultyMaxCap.Value}) | {text2}: {level} | {text4}: {currentSeed} | {text3}: {GameDirector.instance.PlayerList.Count}";
			GUI.Label(new Rect(((Rect)(ref val)).x + 10f, ((Rect)(ref val)).y + 15f, ((Rect)(ref val)).width - 20f, 30f), text5, val4);
		}

		private string GetEventIcon(EventType type)
		{
			return type switch
			{
				EventType.VeryGood => "\ud83d\udfe2", 
				EventType.Good => "\ud83d\udfe1", 
				EventType.Neutral => "⚪", 
				EventType.Bad => "\ud83d\udfe0", 
				EventType.VeryBad => "\ud83d\udd34", 
				_ => "⚫", 
			};
		}

		private string GetEventTypeName(EventType type, bool isRu)
		{
			return type switch
			{
				EventType.VeryGood => isRu ? "Очень Хорошо" : "Very Good", 
				EventType.Good => isRu ? "Хорошо" : "Good", 
				EventType.Neutral => isRu ? "Нейтрально" : "Neutral", 
				EventType.Bad => isRu ? "Плохо" : "Bad", 
				EventType.VeryBad => isRu ? "Очень Плохо" : "Very Bad", 
				_ => "Unknown", 
			};
		}

		private string GetCategoryName(EventCategory category, bool isRu)
		{
			return category switch
			{
				EventCategory.LootModifier => isRu ? "Лут" : "Loot", 
				EventCategory.EnemyModifier => isRu ? "Враги" : "Enemy", 
				EventCategory.PlayerModifier => isRu ? "Игрок" : "Player", 
				EventCategory.EnvironmentModifier => isRu ? "Окружение" : "Environment", 
				_ => "Unknown", 
			};
		}

		private Color GetCategoryColor(EventCategory category)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			return (Color)(category switch
			{
				EventCategory.LootModifier => new Color(1f, 0.8f, 0.2f), 
				EventCategory.EnemyModifier => new Color(1f, 0.3f, 0.3f), 
				EventCategory.PlayerModifier => new Color(0.3f, 0.7f, 1f), 
				EventCategory.EnvironmentModifier => new Color(0.5f, 1f, 0.5f), 
				_ => Color.white, 
			});
		}
	}
	[HarmonyPatch(typeof(EnemyDirector))]
	public static class EnemyDirectorSeededPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPrefix]
		public static void AwakePrefix()
		{
			REPOSeedManager.ResetEnemyRandom();
		}

		[HarmonyPatch("Start")]
		[HarmonyPrefix]
		public static void StartPrefix()
		{
			Random.InitState(REPOSeedManager.EnemyNext());
		}

		[HarmonyPatch("PickEnemies")]
		[HarmonyPrefix]
		public static bool PickEnemiesPrefix(EnemyDirector __instance, List<EnemySetup> _enemiesList)
		{
			Random.InitState(REPOSeedManager.EnemyNext());
			List<EnemySetup> list = AccessTools.Field(typeof(EnemyDirector), "enemyList").GetValue(__instance) as List<EnemySetup>;
			List<EnemySetup> list2 = AccessTools.Field(typeof(EnemyDirector), "enemyListCurrent").GetValue(__instance) as List<EnemySetup>;
			int num = DataDirector.instance.SettingValueFetch((Setting)31);
			ListExtension.Shuffle<EnemySetup>((IList<EnemySetup>)_enemiesList);
			EnemySetup val = null;
			float num2 = -1f;
			foreach (EnemySetup _enemies in _enemiesList)
			{
				if ((_enemies.levelsCompletedCondition && (RunManager.instance.levelsCompleted < _enemies.levelsCompletedMin || (_enemies.levelsCompletedMax != 0 && RunManager.instance.levelsCompleted > _enemies.levelsCompletedMax))) || num < _enemies.runsPlayed)
				{
					continue;
				}
				int num3 = 0;
				foreach (EnemySetup item in RunManager.instance.enemiesSpawned)
				{
					if ((Object)(object)item == (Object)(object)_enemies)
					{
						num3++;
					}
				}
				int num4 = 0;
				foreach (EnemySetup item2 in list)
				{
					if ((Object)(object)item2 == (Object)(object)_enemies)
					{
						num4++;
					}
				}
				float num5 = 100f;
				if (Object.op_Implicit((Object)(object)_enemies.rarityPreset))
				{
					num5 = _enemies.rarityPreset.chance;
				}
				float num6 = Mathf.Max(1f, num5 - 30f * (float)num3 - 10f * (float)num4);
				float num7 = Random.Range(0f, num6);
				if (num7 > num2)
				{
					val = _enemies;
					num2 = num7;
				}
			}
			if ((Object)(object)val != (Object)null)
			{
				list2.Add(val);
				list.Add(val);
			}
			return false;
		}
	}
	[HarmonyPatch(typeof(EnemyParent))]
	public static class EnemyParentSeededPatch
	{
		[HarmonyPatch("Awake")]
		[HarmonyPrefix]
		public static void StartPrefix(EnemyParent __instance)
		{
			int value = REPOSeedManager.ValuableNext();
			if (!REPOSeedManager.EnemyOrbSeeds.ContainsKey(__instance))
			{
				REPOSeedManager.EnemyOrbSeeds.Add(__instance, value);
			}
		}

		[HarmonyPatch("Despawn")]
		[HarmonyPrefix]
		public static void DespawnPrefix(EnemyParent __instance)
		{
			if (REPOSeedManager.EnemyOrbSeeds.TryGetValue(__instance, out var value))
			{
				REPOSeedManager.ScheduledOrbSeed = value;
			}
		}
	}
	public static class EnemyScaling
	{
		[HarmonyPatch(typeof(EnemyHealth), "OnSpawn")]
		public static class Patch_EnemyHealth_OnSpawn
		{
			private static Dictionary<EnemyHealth, int> originalHealthValues = new Dictionary<EnemyHealth, int>();

			private static readonly FieldInfo FI_healthCurrent = AccessTools.Field(typeof(EnemyHealth), "healthCurrent");

			public static void Reset()
			{
				originalHealthValues.Clear();
				REPOConomyPlugin.Logger.LogInfo((object)"[EnemyScaling] Dictionary cleared");
			}

			private static void Postfix(EnemyHealth __instance)
			{
				if (!SemiFunc.IsMasterClientOrSingleplayer() || !REPOConfig.EnableEnemyHPScaling.Value || (Object)(object)RunManager.instance == (Object)null)
				{
					return;
				}
				int num = RunManager.instance.levelsCompleted + 1;
				int value = REPOConfig.EnemyHPStartLevel.Value;
				int value2 = REPOConfig.EnemyHPScalingLevelCap.Value;
				int num2 = Mathf.Min(num, value2);
				if (num2 >= value)
				{
					if (!originalHealthValues.ContainsKey(__instance))
					{
						originalHealthValues[__instance] = __instance.health;
						REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Saved original HP: {__instance.health} for enemy");
					}
					int num3 = originalHealthValues[__instance];
					float num4 = ((!REPOConfig.EnemyHPUseExponentialScaling.Value) ? (1f + (float)(num2 - value) * (REPOConfig.EnemyHPMultiplier.Value - 1f)) : Mathf.Pow(REPOConfig.EnemyHPMultiplier.Value, (float)(num2 - value + 1)));
					int num5 = (__instance.health = Mathf.RoundToInt((float)num3 * num4));
					FI_healthCurrent.SetValue(__instance, num5);
					REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy HP scaled: {num5} (original: {num3}, multiplier: {num4:F3}, level: {num}, effective: {num2})");
				}
			}
		}

		[HarmonyPatch(typeof(EnemyDirector), "AmountSetup")]
		public static class Patch_EnemyDirector_AmountSetup
		{
			private static void Postfix(EnemyDirector __instance)
			{
				if (!SemiFunc.IsMasterClientOrSingleplayer() || !REPOConfig.EnableEnemyCapScaling.Value || (Object)(object)RunManager.instance == (Object)null)
				{
					return;
				}
				int num = RunManager.instance.levelsCompleted + 1;
				int value = REPOConfig.EnemyCapStartLevel.Value;
				int value2 = REPOConfig.EnemyCapScalingLevelCap.Value;
				int num2 = Mathf.Min(num, value2);
				if (num2 < value)
				{
					return;
				}
				int num3 = (int)FI_totalAmount.GetValue(__instance);
				float num4 = ((!REPOConfig.EnemyCapUseExponentialScaling.Value) ? (1f + (float)(num2 - value) * (REPOConfig.EnemyCapMultiplier.Value - 1f)) : Mathf.Pow(REPOConfig.EnemyCapMultiplier.Value, (float)(num2 - value + 1)));
				int num5 = Mathf.RoundToInt((float)num3 * num4);
				FI_totalAmount.SetValue(__instance, num5);
				List<EnemySetup> list = (List<EnemySetup>)AccessTools.Field(typeof(EnemyDirector), "enemyList").GetValue(__instance);
				int count = list.Count;
				int num6 = num5 - num3;
				if (count > 0)
				{
					for (int i = 0; i < num6; i++)
					{
						int index = REPOSeedManager.Range(0, count);
						list.Add(list[index]);
					}
				}
				REPOConomyPlugin.Logger.LogInfo((object)$"[EnemyScaling] Enemy cap scaled: {num5} (original: {num3}, multiplier: {num4:F3}, level: {num}, effective: {num2}), enemyList: {count} -> {list.Count}");
			}
		}

		private static readonly FieldInfo FI_totalAmount = AccessTools.Field(typeof(EnemyDirector), "totalAmount");
	}
	public static class ItemBundlesCompat
	{
		private static bool? _isInstalled;

		private static object _itemBundlesInstance;

		private static FieldInfo _itemDictionaryShopField;

		private static FieldInfo _blacklistField;

		public static bool IsInstalled
		{
			get
			{
				if (!_isInstalled.HasValue)
				{
					_isInstalled = Chainloader.PluginInfos.ContainsKey("SeroRonin.ItemBundles");
					if (_isInstalled.Value)
					{
						InitializeReflection();
					}
				}
				return _isInstalled.Value;
			}
		}

		private static void InitializeReflection()
		{
			try
			{
				Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "ItemBundles");
				if (assembly != null)
				{
					Type type = assembly.GetType("ItemBundles.ItemBundles");
					if (type != null)
					{
						_itemBundlesInstance = AccessTools.Property(type, "Instance").GetValue(null);
						_itemDictionaryShopField = AccessTools.Field(type, "itemDictionaryShop");
						_blacklistField = AccessTools.Field(type, "itemDictionaryShopBlacklist");
						REPOConomyPlugin.Logger.LogInfo((object)"[ItemBundlesCompat] Compatibility initialized successfully.");
					}
				}
			}
			catch (Exception ex)
			{
				REPOConomyPlugin.Logger.LogError((object)("[ItemBundlesCompat] Init failed: " + ex.Message));
				_isInstalled = false;
			}
		}

		public static Dictionary<string, Item> GetShopItems()
		{
			if (!IsInstalled || _itemBundlesInstance == null)
			{
				return StatsManager.instance.itemDictionary;
			}
			try
			{
				Dictionary<string, Item> dictionary = _itemDictionaryShopField.GetValue(_itemBundlesInstance) as Dictionary<string, Item>;
				if (dictionary == null || dictionary.Count == 0)
				{
					REPOConomyPlugin.Logger.LogInfo((object)"[ItemBundlesCompat] Dictionary empty, populating manually...");
					dictionary = PopulateManually();
				}
				return dictionary;
			}
			catch (Exception arg)
			{
				REPOConomyPlugin.Logger.LogError((object)$"[ItemBundlesCompat] Error getting items: {arg}");
				return StatsManager.instance.itemDictionary;
			}
		}

		private static Dictionary<string, Item> PopulateManually()
		{
			Dictionary<string, Item> dictionary = new Dictionary<string, Item>();
			Dictionary<string, Item> obj = _blacklistField.GetValue(_itemBundlesInstance) as Dictionary<string, Item>;
			List<string> list = obj?.Keys.ToList() ?? new List<string>();
			List<Item> list2 = obj?.Values.ToList() ?? new List<Item>();
			foreach (KeyValuePair<string, Item> item in StatsManager.instance.itemDictionary)
			{
				if (!list.Contains(item.Key) && !list2.Contains(item.Value))
				{
					dictionary.Add(item.Key, item.Value);
				}
			}
			return dictionary;
		}
	}
	[HarmonyPatch(typeof(LevelGenerator))]
	public static class LevelGeneratorSeededPatch
	{
		[HarmonyPatch("Generate")]
		[HarmonyPrefix]
		public static void GeneratePrefix()
		{
			REPOSeedManager.ResetLevelRandom();
			REPOSeedManager.ResetTruckRandom();
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static void StartRoomGenerationPrefix()
		{
			Random.InitState(REPOSeedManager.LevelNext());
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static void TileGenerationPrefix()
		{
			Random.InitState(REPOSeedManager.LevelNext());
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static void ModuleGenerationPrefix()
		{
			Random.InitState(REPOSeedManager.LevelNext());
		}

		[HarmonyPatch("PlayerSpawn")]
		[HarmonyPrefix]
		public static void PlayerSpawnPrefix()
		{
			Random.InitState(REPOSeedManager.LevelNext());
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static void EnemySetupPrefix()
		{
			Random.InitState(REPOSeedManager.EnemyNext());
		}
	}
	public static class MoreUpgradesCompat
	{
		private static bool? _isInstalled;

		private static object _muPluginInstance;

		private static FieldInfo _upgradeItemsField;

		private static FieldInfo _playerUpgradeField;

		private static MethodInfo _getConfigMethod;

		private static MethodInfo _apiMultiplierMethod;

		public static bool IsInstalled
		{
			get
			{
				if (!_isInstalled.HasValue)
				{
					_isInstalled = Chainloader.PluginInfos.ContainsKey("bulletbot.moreupgrades");
					if (_isInstalled.Value)
					{
						InitializeReflection();
					}
				}
				return _isInstalled.Value;
			}
		}

		private static void InitializeReflection()
		{
			try
			{
				Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "MoreUpgrades");
				if (assembly != null)
				{
					Type type = assembly.GetType("MoreUpgrades.Plugin");
					if (type != null)
					{
						_muPluginInstance = AccessTools.Field(type, "instance").GetValue(null);
						_upgradeItemsField = AccessTools.Field(type, "upgradeItems");
					}
					Type type2 = assembly.GetType("MoreUpgrades.Classes.UpgradeItem");
					if (type2 != null)
					{
						_playerUpgradeField = AccessTools.Field(type2, "playerUpgrade");
						_getConfigMethod = AccessTools.Method(type2, "GetConfig", new Type[1] { typeof(string) }, new Type[1] { typeof(bool) });
					}
					Type type3 = assembly.GetType("MoreUpgrades.Classes.MoreUpgradesAPI");
					if (type3 != null)
					{
						_apiMultiplierMethod = AccessTools.Method(type3, "ItemValueMultiplier", new Type[1] { typeof(Item) }, (Type[])null);
					}
					REPOConomyPlugin.Logger.LogInfo((object)"[MoreUpgradesCompat] Compatibility initialized.");
				}
			}
			catch (Exception ex)
			{
				REPOConomyPlugin.Logger.LogError((object)("[MoreUpgradesCompat] Init failed: " + ex.Message));
				_isInstalled = false;
			}
		}

		public static IEnumerable<Item> FilterDisabledItems(IEnumerable<Item> incomingItems)
		{
			if (!IsInstalled || _muPluginInstance == null || _upgradeItemsField == null)
			{
				return incomingItems;
			}
			try
			{
				if (!(_upgradeItemsField.GetValue(_muPluginInstance) is IList list) || list.Count == 0)
				{
					return incomingItems;
				}
				HashSet<Item> disabledItems = new HashSet<Item>();
				foreach (object item in list)
				{
					if (item == null)
					{
						continue;
					}
					object value = _playerUpgradeField.GetValue(item);
					if (value == null)
					{
						continue;
					}
					FieldInfo fieldInfo = AccessTools.Field(value.GetType(), "Item");
					Item val = null;
					if (fieldInfo != null)
					{
						object? value2 = fieldInfo.GetValue(value);
						val = (Item)((value2 is Item) ? value2 : null);
					}
					else
					{
						PropertyInfo propertyInfo = AccessTools.Property(value.GetType(), "Item");
						if (propertyInfo != null)
						{
							object? value3 = propertyInfo.GetValue(value);
							val = (Item)((value3 is Item) ? value3 : null);
						}
					}
					if ((Object)(object)val == (Object)null || !(_getConfigMethod != null))
					{
						continue;
					}
					try
					{
						if (!(bool)_getConfigMethod.Invoke(item, new object[1] { "Enabled" }))
						{
							disabledItems.Add(val);
						}
					}
					catch
					{
					}
				}
				return incomingItems.Where((Item x) => !disabledItems.Contains(x));
			}
			catch (Exception arg)
			{
				REPOConomyPlugin.Logger.LogError((object)$"[MoreUpgradesCompat] Filter error: {arg}");
				return incomingItems;
			}
		}

		public static float GetItemPriceMultiplier(Item item, float globalDefault)
		{
			if (!IsInstalled || _apiMultiplierMethod == null)
			{
				return globalDefault;
			}
			try
			{
				return (float)_apiMultiplierMethod.Invoke(null, new object[1] { item });
			}
			catch
			{
				return globalDefault;
			}
		}
	}
	public static class PocketCartPlusCompat
	{
		private static bool? _isInstalled;

		private static FieldInfo _randField;

		private static object _pluginInstance;

		public static bool IsInstalled
		{
			get
			{
				if (!_isInstalled.HasValue)
				{
					_isInstalled = Chainloader.PluginInfos.ContainsKey("com.github.darmuh.PocketCartPlus");
					if (_isInstalled.Value)
					{
						InitializeReflection();
					}
				}
				return _isInstalled.Value;
			}
		}

		private static void InitializeReflection()
		{
			try
			{
				Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "com.github.darmuh.PocketCartPlus");
				if (assembly != null)
				{
					Type type = assembly.GetType("PocketCartPlus.Plugin");
					if (type != null)
					{
						_randField = AccessTools.Field(type, "Rand");
					}
					REPOConomyPlugin.Logger.LogInfo((object)"[PocketCartPlusCompat] Compatibility initialized.");
				}
			}
			catch (Exception ex)
			{
				REPOConomyPlugin.Logger.LogError((object)("[PocketCartPlusCompat] Init failed: " + ex.Message));
				_isInstalled = false;
			}
		}

		public static void ReseedRandom(int seed)
		{
			if (!IsInstalled || _randField == null)
			{
				return;
			}
			try
			{
				Random value = new Random(seed);
				_randField.SetValue(null, value);
				REPOConomyPlugin.Logger.LogInfo((object)$"[PocketCartPlusCompat] Reseeded with {seed}");
			}
			catch (Exception arg)
			{
				REPOConomyPlugin.Logger.LogError((object)$"[PocketCartPlusCompat] Reseed error: {arg}");
			}
		}
	}
	public static class REPOConfig
	{
		public static ConfigEntry<bool> EnableEnemyHPScaling;

		public static ConfigEntry<int> EnemyHPStartLevel;

		public static ConfigEntry<float> EnemyHPMultiplier;

		public static ConfigEntry<bool> EnemyHPUseExponentialScaling;

		public static ConfigEntry<int> EnemyHPMaxLevel;

		public static ConfigEntry<int> EnemyHPScalingLevelCap;

		public static ConfigEntry<bool> EnableEnemyCapScaling;

		public static ConfigEntry<int> EnemyCapStartLevel;

		public static ConfigEntry<float> EnemyCapMultiplier;

		public static ConfigEntry<bool> EnemyCapUseExponentialScaling;

		public static ConfigEntry<int> EnemyCapMaxLevel;

		public static ConfigEntry<int> EnemyCapScalingLevelCap;

		public static ConfigEntry<bool> EnableMapValueScaling;

		public static ConfigEntry<int> MapValueStartLevel;

		public static ConfigEntry<float> MapValueMultiplier;

		public static ConfigEntry<bool> MapValueUseExponentialScaling;

		public static ConfigEntry<int> MapValueMaxLevel;

		public static ConfigEntry<int> MapValueScalingLevelCap;

		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 ConfigEntry<float> DifficultyPerLevel;

		public static ConfigEntry<float> DifficultyPerPlayer;

		public static ConfigEntry<float> DifficultyPerValuable;

		public static ConfigEntry<float> DifficultyMaxCap;

		public static ConfigEntry<int> ModifierStartLevel;

		public static ConfigEntry<int> MinModifierCount;

		public static ConfigEntry<int> MaxModifierCount;

		public static ConfigEntry<bool> EnableLootModifiers;

		public static ConfigEntry<bool> EnableEnemyModifiers;

		public static ConfigEntry<bool> EnablePlayerModifiers;

		public static ConfigEntry<bool> EnableEnvironmentModifiers;

		public static ConfigEntry<bool> EnableSharedPool;

		public static ConfigEntry<float> GlobalUpgradesMultiplier;

		public static ConfigEntry<KeyCode> PlayerRevivalHotkey;

		public static ConfigEntry<KeyCode> UIToggleHotkey;

		public static ConfigEntry<bool> UIAutoShowOnLevelStart;

		public static ConfigEntry<bool> EnableLevelScaling;

		public static ConfigEntry<bool> EnableMultiplicativeScaling;

		public static ConfigEntry<int> LevelScalingMinModules;

		public static ConfigEntry<int> LevelScalingMaxModulesLevel;

		public static ConfigEntry<int> LevelScalingModulesInterval;

		public static ConfigEntry<int> LevelScalingModulesPerInterval;

		public static ConfigEntry<int> LevelScalingBaseExtractions;

		public static ConfigEntry<int> LevelScalingExtractionsInterval;

		public static ConfigEntry<int> LevelScalingExtractionsPerInterval;

		public static ConfigEntry<int> LevelScalingMaxExtractions;

		public static ConfigEntry<float> LevelScalingBaseHaulMultiplier;

		public static ConfigEntry<float> LevelScalingHaulIncreasePerLevel;

		public static ConfigEntry<int> LevelScalingMaxHaulLevel;

		public static ConfigEntry<float> LevelScalingMaxHaulMultiplier;

		public static Dictionary<string, ConfigEntry<bool>> EconomyEnables = new Dictionary<string, ConfigEntry<bool>>();

		public static Dictionary<string, ConfigEntry<bool>> ModifierEnables = new Dictionary<string, ConfigEntry<bool>>();

		public static ConfigEntry<bool> RandomizeSeedEachLevel;

		public static ConfigEntry<bool> UseCustomSeed;

		public static ConfigEntry<string> CustomSeedValue;

		public static ConfigEntry<bool> UseLevelBasedSeed;

		public static ConfigEntry<bool> ForceScaleInCart;

		public static ConfigEntry<string> ScaleInCartSettings;

		public static ConfigEntry<bool> ForceExtractionShrink;

		public static ConfigEntry<string> ExtractionShrinkSettings;

		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
			//IL_0346: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: Expected O, but got Unknown
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b3: Expected O, but got Unknown
			//IL_03e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Expected O, but got Unknown
			//IL_042d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0437: Expected O, but got Unknown
			//IL_045e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Expected O, but got Unknown
			//IL_04a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04b0: Expected O, but got Unknown
			//IL_04de: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e8: Expected O, but got Unknown
			//IL_052a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0534: Expected O, but got Unknown
			//IL_055b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0565: Expected O, but got Unknown
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Expected O, but got Unknown
			//IL_05db: Unknown result type (might be due to invalid IL or missing references)
			//IL_05e5: Expected O, but got Unknown
			//IL_0627: Unknown result type (might be due to invalid IL or missing references)
			//IL_0631: Expected O, but got Unknown
			//IL_0658: Unknown result type (might be due to invalid IL or missing references)
			//IL_0662: Expected O, but got Unknown
			//IL_06bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_06c5: Expected O, but got Unknown
			//IL_06ec: Unknown result type (might be due to invalid IL or missing references)
			//IL_06f6: Expected O, but got Unknown
			//IL_0719: Unknown result type (might be due to invalid IL or missing references)
			//IL_0723: Expected O, but got Unknown
			//IL_0745: Unknown result type (might be due to invalid IL or missing references)
			//IL_074f: Expected O, but got Unknown
			//IL_0772: Unknown result type (might be due to invalid IL or missing references)
			//IL_077c: Expected O, but got Unknown
			//IL_07a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_07aa: Expected O, but got Unknown
			//IL_07ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_07d8: Expected O, but got Unknown
			//IL_07fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0804: Expected O, but got Unknown
			//IL_0832: Unknown result type (might be due to invalid IL or missing references)
			//IL_083c: Expected O, but got Unknown
			//IL_086a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0874: Expected O, but got Unknown
			//IL_0898: Unknown result type (might be due to invalid IL or missing references)
			//IL_08a2: Expected O, but got Unknown
			//IL_08d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08da: Expected O, but got Unknown
			//IL_0908: Unknown result type (might be due to invalid IL or missing references)
			//IL_0912: Expected O, but got Unknown
			//IL_0940: Unknown result type (might be due to invalid IL or missing references)
			//IL_094a: Expected O, but got Unknown
			//IL_0978: Unknown result type (might be due to invalid IL or missing references)
			//IL_0982: Expected O, but got Unknown
			//IL_09b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_09ba: Expected O, but got Unknown
			//IL_09e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_09f2: Expected O, but got Unknown
			//IL_0a0f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a19: Expected O, but got Unknown
			//IL_0ab0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aba: Expected O, but got Unknown
			//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ae6: Expected O, but got Unknown
			//IL_0b08: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b12: 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", 2f, 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", 10000f, new ConfigDescription("Maximum increase limit (for example: +10000%).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(0f, 10000f), Array.Empty<object>()));
			EventStartLevel = config.Bind<int>("Economy", "EconomyStartLevel", 2, new ConfigDescription("At what level will random economy start (1–12). 1 = immediately, 2 = from the second level, etc.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 12), Array.Empty<object>()));
			ForceStableEconomy = config.Bind<bool>("Economy", "NoRandomEconomy", false, "Force enable a stable economy (without random economy).");
			DisableVanillaEvents = config.Bind<bool>("Economy", "DisableVanillaEconomy", false, "If true, disables all built-in vanilla random economies. Only custom economies will be used, if EnableCustomEconomies enabled.");
			EnableCustomEvents = config.Bind<bool>("Economy", "EnableCustomEconomies", true, "Enable loading of custom economy events from JSON files to appear in-game.");
			UseEventChance = config.Bind<bool>("EconomyChance", "UseEconomyChance", true, "Enable the random economy drop system based on chance.");
			EventChance = config.Bind<int>("EconomyChance", "EconomyChance", 50, new ConfigDescription("Chance (1–100) for an random economy to occur instead of a stable economy.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 100), Array.Empty<object>()));
			UseCustomEventChance = config.Bind<bool>("CustomEconomyChance", "UseCustomEconomyChance", true, "Enable a separate chance check for custom random economy (only applies if UseEventsChance is true). If this feature is disabled, there will be a 50/50 chance of either a vanilla economy or a custom economy occurring.");
			CustomEventChance = config.Bind<int>("CustomEconomyChance", "CustomEconomyChance", 50, new ConfigDescription("Chance (1–100%) for custom economy to occur instead of vanilla economy if UseCustomEconomyChance is enabled.", (AcceptableValueBase)(object)new AcceptableValueRange<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>()));
			UIToggleHotkey = config.Bind<KeyCode>("UI Settings", "UIToggleHotkey", (KeyCode)103, new ConfigDescription("Hotkey to toggle the economy UI on/off.", (AcceptableValueBase)null, Array.Empty<object>()));
			UIAutoShowOnLevelStart = config.Bind<bool>("UI Settings", "UIAutoShowOnLevelStart", true, "Automatically show UI when entering a level.");
			EnableEnemyHPScaling = config.Bind<bool>("Enemy HP Scaling", "EnableEnemyHPScaling", true, "Enable enemy HP scaling per level.");
			EnemyHPStartLevel = config.Bind<int>("Enemy HP Scaling", "StartLevel", 3, new ConfigDescription("Level at which enemy HP scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()));
			EnemyHPMultiplier = config.Bind<float>("Enemy HP Scaling", "Multiplier", 1.02f, new ConfigDescription("Enemy HP multiplier per level (1.02 = +2% per level).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>()));
			EnemyHPUseExponentialScaling = config.Bind<bool>("Enemy HP Scaling", "UseExponentialScaling", false, "Use exponential scaling (pow) instead of linear scaling for enemy HP.");
			EnemyHPMaxLevel = config.Bind<int>("Enemy HP Scaling", "MaxLevel", 100, new ConfigDescription("Maximum level for enemy HP scaling. Scaling stops increasing beyond this level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			EnemyHPScalingLevelCap = config.Bind<int>("Enemy HP Scaling", "LevelCap", 100, new ConfigDescription("Level at which enemy HP scaling stops.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			EnableEnemyCapScaling = config.Bind<bool>("Enemy Cap Scaling", "EnableEnemyCapScaling", true, "Enable max enemy cap scaling per level.");
			EnemyCapStartLevel = config.Bind<int>("Enemy Cap Scaling", "StartLevel", 4, new ConfigDescription("Level at which enemy cap scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()));
			EnemyCapMultiplier = config.Bind<float>("Enemy Cap Scaling", "Multiplier", 1.03f, new ConfigDescription("Max enemy cap multiplier per level (1.05 = +5 per level).", (AcceptableValueBase)(object)new AcceptableValueRange<float>(1f, 2f), Array.Empty<object>()));
			EnemyCapUseExponentialScaling = config.Bind<bool>("Enemy Cap Scaling", "UseExponentialScaling", false, "Use exponential scaling (pow) instead of linear scaling for enemy cap.");
			EnemyCapMaxLevel = config.Bind<int>("Enemy Cap Scaling", "MaxLevel", 100, new ConfigDescription("Maximum level for enemy cap scaling. Scaling stops increasing beyond this level.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			EnemyCapScalingLevelCap = config.Bind<int>("Enemy Cap Scaling", "LevelCap", 100, new ConfigDescription("Level at which enemy cap scaling stops.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 1000), Array.Empty<object>()));
			EnableMapValueScaling = config.Bind<bool>("Map Value Scaling", "EnableMapValueScaling", true, "Enable total map value scaling per level.");
			MapValueStartLevel = config.Bind<int>("Map Value Scaling", "StartLevel", 2, new ConfigDescription("Level at which map value scaling starts.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 50), Array.Empty<object>()));
			MapValueMultip