Decompiled source of Valheim Ascended v0.2.9

plugins\ValheimAscended.dll

Decompiled 2 days 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 System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Rendering;
using UnityEngine.UI;
using ValheimAscended.Abilities;
using ValheimAscended.Attributes;
using ValheimAscended.Classes;
using ValheimAscended.Commands;
using ValheimAscended.Config;
using ValheimAscended.Core;
using ValheimAscended.Enchanting;
using ValheimAscended.NPCs;
using ValheimAscended.Patches;
using ValheimAscended.Progression;
using ValheimAscended.Shipwright;
using ValheimAscended.Smithing;
using ValheimAscended.Talents;
using ValheimAscended.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyCompany("ValheimAscended")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ValheimAscended")]
[assembly: AssemblyTitle("ValheimAscended")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[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 ValheimAscended
{
	[BepInPlugin("com.valheimascended.mod", "Valheim Ascended", "0.2.9")]
	[BepInProcess("valheim.exe")]
	public class Plugin : BaseUnityPlugin
	{
		public const string PluginGUID = "com.valheimascended.mod";

		public const string PluginName = "Valheim Ascended";

		public const string PluginVersion = "0.2.9";

		public static ManualLogSource Log;

		private readonly Harmony _harmony = new Harmony("com.valheimascended.mod");

		private void Awake()
		{
			//IL_0507: Unknown result type (might be due to invalid IL or missing references)
			//IL_050e: Expected O, but got Unknown
			//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			//IL_0495: Unknown result type (might be due to invalid IL or missing references)
			//IL_049c: Expected O, but got Unknown
			//IL_0141: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Expected O, but got Unknown
			//IL_043c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0443: Expected O, but got Unknown
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b8: Expected O, but got Unknown
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Expected O, but got Unknown
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Expected O, but got Unknown
			//IL_0274: Unknown result type (might be due to invalid IL or missing references)
			//IL_027b: Expected O, but got Unknown
			//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f1: Expected O, but got Unknown
			//IL_0307: Unknown result type (might be due to invalid IL or missing references)
			//IL_030e: Expected O, but got Unknown
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_032b: Expected O, but got Unknown
			//IL_034d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Expected O, but got Unknown
			//IL_036a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Expected O, but got Unknown
			Log = ((BaseUnityPlugin)this).Logger;
			Log.LogInfo((object)"Valheim Ascended v0.2.9 loading...");
			ModConfig.Init(((BaseUnityPlugin)this).Config);
			MilestoneDefs.InitBossTalentPoints();
			AttributeSystem.Init();
			RenownSystem.Init();
			ClassSystem.Init();
			AbilitySystem.Init();
			TalentEffectRegistry.Init();
			TalentTreeLoader.LoadAll();
			ShipModSystem.Init();
			ShipMaterials.Init();
			CastawaySystem.Init();
			IconLoader.Init();
			UIScale.Init();
			UIFontScale.Init();
			_harmony.PatchAll();
			Log.LogInfo((object)"[VA] PatchAll completed.");
			VanillaKeybinds.Init();
			MethodInfo methodInfo = typeof(Character).Assembly.GetType("SE_Cooldown")?.GetMethod("UpdateStatusEffect", BindingFlags.Instance | BindingFlags.Public);
			if (methodInfo != null)
			{
				HarmonyMethod val = new HarmonyMethod(typeof(CooldownPatch).GetMethod("OnCooldownUpdate", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
				_harmony.Patch((MethodBase)methodInfo, val, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				Log.LogInfo((object)"SE_Cooldown found — INT cooldown reduction patch applied.");
			}
			else
			{
				Log.LogInfo((object)"SE_Cooldown not found in this Valheim version — CDR patch skipped.");
			}
			MethodInfo method = typeof(Humanoid).GetMethod("GetAttackDrawPercentage", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (method != null)
			{
				HarmonyMethod val2 = new HarmonyMethod(typeof(DrawSpeedPatch).GetMethod("OnGetAttackDrawPercentage", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
				_harmony.Patch((MethodBase)method, (HarmonyMethod)null, val2, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				Log.LogInfo((object)"Humanoid.GetAttackDrawPercentage found — DrawSpeed talent patch applied.");
			}
			else
			{
				Log.LogWarning((object)"Humanoid.GetAttackDrawPercentage not found — DrawSpeed talent bonus is display-only.");
			}
			MethodInfo method2 = typeof(ItemData).GetMethod("GetWeaponLoadingTime", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (method2 != null)
			{
				HarmonyMethod val3 = new HarmonyMethod(typeof(ReloadSpeedPatch).GetMethod("OnGetWeaponLoadingTime", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
				_harmony.Patch((MethodBase)method2, (HarmonyMethod)null, val3, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
				Log.LogInfo((object)"ItemDrop.ItemData.GetWeaponLoadingTime found — Crossbow reload speed patch applied.");
			}
			else
			{
				Log.LogWarning((object)"GetWeaponLoadingTime not found — Crossbow Specialization reload speed is display-only.");
			}
			Type type = typeof(Character).Assembly.GetType("Humanoid");
			MethodInfo methodInfo2 = type?.GetMethod("BlockAttack", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
			if (methodInfo2 != null)
			{
				HarmonyMethod val4 = new HarmonyMethod(typeof(TalentPatch).GetMethod("OnBlockAttackPrefix", BindingFlags.Static | BindingFlags.Public));
				HarmonyMethod val5 = new HarmonyMethod(typeof(TalentPatch).GetMethod("OnBlockAttack", BindingFlags.Static | BindingFlags.Public));
				HarmonyMethod val6 = new HarmonyMethod(typeof(TalentPatch).GetMethod("BlockAttackParryWindowTranspiler", BindingFlags.Static | BindingFlags.Public));
				_harmony.Patch((MethodBase)methodInfo2, val4, val5, val6, (HarmonyMethod)null, (HarmonyMethod)null);
				Log.LogInfo((object)"Humanoid.BlockAttack found — parry detection + window transpile patches applied.");
			}
			else
			{
				Log.LogWarning((object)"Humanoid.BlockAttack not found — war_be1 Blood Rage will not fire.");
			}
			try
			{
				MethodInfo methodInfo3 = type?.GetMethod("StartAttack", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				if (methodInfo3 != null)
				{
					HarmonyMethod val7 = new HarmonyMethod(typeof(DualWieldPatch).GetMethod("OnStartAttackPrefix", BindingFlags.Static | BindingFlags.Public));
					HarmonyMethod val8 = new HarmonyMethod(typeof(DualWieldPatch).GetMethod("OnStartAttackPostfix", BindingFlags.Static | BindingFlags.Public));
					HarmonyMethod val9 = new HarmonyMethod(typeof(AbilitySystem).GetMethod("OnSiegeStartAttackPrefix", BindingFlags.Static | BindingFlags.Public));
					val9.priority = 601;
					HarmonyMethod val10 = new HarmonyMethod(typeof(AbilitySystem).GetMethod("OnSiegeStartAttackPostfix", BindingFlags.Static | BindingFlags.Public));
					HarmonyMethod val11 = new HarmonyMethod(typeof(TalentPatch).GetMethod("OnMageStartAttackPrefix", BindingFlags.Static | BindingFlags.Public));
					val11.priority = 602;
					_harmony.Patch((MethodBase)methodInfo3, val7, val8, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					_harmony.Patch((MethodBase)methodInfo3, val9, val10, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					_harmony.Patch((MethodBase)methodInfo3, val11, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					Log.LogInfo((object)"Humanoid.StartAttack found — dual-wield + siege + mage patches applied.");
				}
				else
				{
					Log.LogWarning((object)"Humanoid.StartAttack not found — dual-wield animations disabled.");
				}
			}
			catch (Exception ex)
			{
				Log.LogWarning((object)("Humanoid.StartAttack patch failed: " + ex.Message));
			}
			try
			{
				MethodInfo methodInfo4 = typeof(SmokeRenderer)?.GetMethod("LateUpdate", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				if (methodInfo4 != null)
				{
					HarmonyMethod val12 = new HarmonyMethod(typeof(Plugin).GetMethod("SmokeRendererFinalizer", BindingFlags.Static | BindingFlags.Public));
					_harmony.Patch((MethodBase)methodInfo4, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, val12, (HarmonyMethod)null);
				}
			}
			catch (Exception)
			{
			}
			try
			{
				MethodInfo method3 = typeof(EnemyHud).GetMethod("UpdateHuds", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
				if (method3 != null)
				{
					HarmonyMethod val13 = new HarmonyMethod(typeof(EnemyHudPatch).GetMethod("Prefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
					_harmony.Patch((MethodBase)method3, val13, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					Log.LogInfo((object)"EnemyHud.UpdateHuds found — Eagle Eye patch applied.");
				}
				else
				{
					Log.LogWarning((object)"EnemyHud.UpdateHuds not found — Eagle Eye talent has no effect.");
				}
			}
			catch (Exception ex3)
			{
				Log.LogWarning((object)("Eagle Eye patch failed: " + ex3.Message));
			}
			HarmonyMethod val14 = new HarmonyMethod(typeof(Plugin).GetMethod("OnTerrainDamagePrefix", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic));
			string[] array = new string[5] { "Destructible", "MineRock", "MineRock5", "TreeBase", "TreeLog" };
			foreach (string text in array)
			{
				try
				{
					Type type2 = typeof(Character).Assembly.GetType(text);
					if (type2 == null)
					{
						Log.LogWarning((object)(text + " type not found — terrain damage patch skipped."));
						continue;
					}
					MethodInfo method4 = type2.GetMethod("Damage", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic);
					if (method4 == null)
					{
						Log.LogWarning((object)(text + ".Damage not found — terrain damage patch skipped."));
						continue;
					}
					_harmony.Patch((MethodBase)method4, val14, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
					Log.LogInfo((object)(text + ".Damage found — terrain damage patch applied."));
				}
				catch (Exception ex4)
				{
					Log.LogWarning((object)(text + ".Damage patch failed: " + ex4.Message));
				}
			}
			Log.LogInfo((object)"Valheim Ascended loaded.");
		}

		public static void OnTerrainDamagePrefix(HitData hit)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (hit.m_damage.m_chop <= 0f && hit.m_damage.m_pickaxe <= 0f)
			{
				return;
			}
			Player localPlayer = Player.m_localPlayer;
			if (!((Object)(object)localPlayer == (Object)null) && !(hit.m_attacker != ((Character)localPlayer).GetZDOID()))
			{
				PlayerData orCreate = RenownSystem.GetOrCreate(localPlayer);
				if (orCreate != null)
				{
					float num = 1f + (float)orCreate.TotalSTR * ModConfig.StrTerrainDamagePerPoint.Value + SmithingData.GetRefineStat("RefineTerrainDmg");
					hit.m_damage.m_chop *= num;
					hit.m_damage.m_pickaxe *= num;
				}
			}
		}

		public static Exception SmokeRendererFinalizer(Exception __exception)
		{
			if (__exception is IndexOutOfRangeException)
			{
				return null;
			}
			return __exception;
		}

		private void OnDestroy()
		{
			_harmony.UnpatchSelf();
		}
	}
}
namespace ValheimAscended.UI
{
	[HarmonyPatch]
	internal static class AbilityBar
	{
		private struct BarSkinDef
		{
			public string BackId;

			public string FrontId;

			public Vector2 ImageSize;

			public Vector2[] SlotCenters;

			public int[] SlotMapping;
		}

		private class OverchargeChannelWisp : MonoBehaviour
		{
			private Vector3 _start;

			private Vector3 _target;

			private Color _col;

			private float _alpha;

			private float _age;

			private const float Duration = 0.55f;

			public void Init(Vector3 start, Vector3 target, Color col, float alpha)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0002: Unknown result type (might be due to invalid IL or missing references)
				//IL_0008: Unknown result type (might be due to invalid IL or missing references)
				//IL_0009: 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_0010: Unknown result type (might be due to invalid IL or missing references)
				_start = start;
				_target = target;
				_col = col;
				_alpha = alpha;
			}

			private void Update()
			{
				//IL_0029: Unknown result type (might be due to invalid IL or missing references)
				//IL_002f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0066: Unknown result type (might be due to invalid IL or missing references)
				//IL_007c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_0086: 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_00c0: 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)
				_age += Time.deltaTime;
				float num = Mathf.Clamp01(_age / 0.55f);
				float num2 = num * num;
				Vector3 val = Vector3.Lerp(_start, _target, num2);
				float num3 = _alpha * (1f - num);
				LineRenderer component = ((Component)this).GetComponent<LineRenderer>();
				if ((Object)(object)component != (Object)null)
				{
					Vector3 val2 = Vector3.Lerp(_start, _target, Mathf.Max(0f, num2 - 0.15f));
					component.SetPosition(0, val2);
					component.SetPosition(1, val);
					component.startColor = new Color(_col.r, _col.g, _col.b, num3 * 0.3f);
					component.endColor = new Color(_col.r, _col.g, _col.b, num3);
				}
				if (num >= 1f)
				{
					Object.Destroy((Object)(object)((Component)this).gameObject);
				}
			}
		}

		[CompilerGenerated]
		private static class <>O
		{
			public static Action <0>__RefreshKeyLabels;

			public static UnityAction <1>__CloseDrawer;
		}

		private static bool _built;

		private static GameObject _root;

		private const int TotalSlots = 5;

		private static readonly Image[] _cdOverlay = (Image[])(object)new Image[5];

		private static readonly Text[] _nameLabels = (Text[])(object)new Text[5];

		private static readonly Text[] _cdLabels = (Text[])(object)new Text[5];

		private static readonly GameObject[] _slotGOs = (GameObject[])(object)new GameObject[5];

		private static readonly Image[] _slotIcons = (Image[])(object)new Image[5];

		private static readonly float[] _flashTimers = new float[5];

		private const float FlashDuration = 0.8f;

		private static GameObject _skinBackGO;

		private static GameObject _skinFrontGO;

		private static string _activeSkin = "";

		private static GameObject _drawer;

		private static Transform _drawerContent;

		private static int _drawerSlot = -1;

		private static Text _drawerEmpty;

		private static int _tooltipSlot = -1;

		private static bool _tooltipShiftState;

		private static GameObject _castbarGO;

		private static RectTransform _castbarRT;

		private static RectTransform _castFillRT;

		private static Text _castLabel;

		private static GameObject _castbarAnchorGO;

		private static readonly GameObject[][] _surgePipRoots = new GameObject[5][];

		private static readonly Image[][] _surgePipFills = new Image[5][];

		private static readonly GameObject[][] _tempestPipRoots = new GameObject[5][];

		private static readonly Image[][] _tempestPipFills = new Image[5][];

		private static readonly GameObject[] _durationTimerRoots = (GameObject[])(object)new GameObject[5];

		private static readonly Image[] _durationTimerFills = (Image[])(object)new Image[5];

		private static readonly GameObject[] _wardHPRoots = (GameObject[])(object)new GameObject[5];

		private static readonly Image[] _wardHPFills = (Image[])(object)new Image[5];

		private static bool _overchargeHolding;

		private static int _overchargeSlot = -1;

		private static float _overchargeStartTime;

		private static readonly bool[] _foodKeyWasDown = new bool[3];

		private static readonly bool[] _meadKeyWasDown = new bool[2];

		private static GameObject _quickSlotRoot;

		private static GameObject _quickRow;

		private static Image _quickRowBgImg;

		private static readonly GameObject[] _foodMirrorRoots = (GameObject[])(object)new GameObject[3];

		private static readonly Image[] _foodMirrorBgs = (Image[])(object)new Image[3];

		private static readonly Image[] _foodMirrorIcons = (Image[])(object)new Image[3];

		private static readonly Text[] _foodMirrorCounts = (Text[])(object)new Text[3];

		private static readonly Text[] _foodMirrorKeys = (Text[])(object)new Text[3];

		private static readonly GameObject[] _meadMirrorRoots = (GameObject[])(object)new GameObject[2];

		private static readonly Image[] _meadMirrorBgs = (Image[])(object)new Image[2];

		private static readonly Image[] _meadMirrorIcons = (Image[])(object)new Image[2];

		private static readonly Text[] _meadMirrorCounts = (Text[])(object)new Text[2];

		private static readonly Text[] _meadMirrorKeys = (Text[])(object)new Text[2];

		private static Sprite _mirrorEquippedSprite;

		private static readonly HashSet<string> _overchargeWithTargeting = new HashSet<string> { "ball_lightning", "blizzard", "eruption", "flame_wall", "lightning_storm", "blink", "frost_nova", "meteor" };

		private static float _overchargeEitrDrained;

		private const float OverchargeFullDuration = 2f;

		private static GameObject _overchargeChannelGO;

		private static Light _overchargeChannelLight;

		private static float _overchargeChannelWispTimer;

		private static Color _overchargeChannelBaseColor;

		private static Color _overchargeChannelFullColor;

		private const float OverchargeChannelChestHeight = 1f;

		private static readonly GameObject[] _overchargeBarRoots = (GameObject[])(object)new GameObject[5];

		private static readonly Image[] _overchargeBarFills = (Image[])(object)new Image[5];

		private static GameObject[] _resonancePipRoots;

		private static Image[] _resonancePipFills;

		private static GameObject _resonancePipContainer;

		private static GameObject[] _zealPipRoots;

		private static Image[] _zealPipFills;

		private static GameObject _zealPipContainer;

		private static GameObject[] _judgmentPipRoots;

		private static Image[] _judgmentPipFills;

		private static GameObject _judgmentPipContainer;

		private static GameObject[] _arsenalHitPipRoots;

		private static Image[] _arsenalHitPipFills;

		private static GameObject[] _arsenalStrikePipRoots;

		private static Image[] _arsenalStrikePipFills;

		private static GameObject _arsenalPipContainer;

		private static GameObject _siegeBoltContainer;

		private static Image[] _siegeBoltImages;

		private static GameObject _tailwindBarContainer;

		private static RectTransform _tailwindBarFill;

		private static Image _tailwindBarFillImg;

		private static readonly string[] _mouseSlotLabels = new string[2] { "LMB", "RMB" };

		private static Text[] _keyLabels = (Text[])(object)new Text[5];

		private static bool _keybindEventsHooked;

		private static readonly Dictionary<string, BarSkinDef> _barSkins = new Dictionary<string, BarSkinDef>
		{
			{
				"bar_3slot",
				new BarSkinDef
				{
					BackId = "bar_3slot_back",
					FrontId = "bar_3slot_front",
					ImageSize = new Vector2(486f, 114f),
					SlotCenters = (Vector2[])(object)new Vector2[3]
					{
						new Vector2(156f, 56f),
						new Vector2(243f, 56f),
						new Vector2(331f, 56f)
					}
				}
			},
			{
				"bar_3slot_mage",
				new BarSkinDef
				{
					BackId = "bar_3slot_back",
					FrontId = "bar_3slot_front",
					ImageSize = new Vector2(486f, 114f),
					SlotCenters = (Vector2[])(object)new Vector2[3]
					{
						new Vector2(156f, 56f),
						new Vector2(243f, 56f),
						new Vector2(331f, 56f)
					},
					SlotMapping = new int[3] { 0, 3, 4 }
				}
			},
			{
				"bar_4slot",
				new BarSkinDef
				{
					BackId = "bar_4slot_back",
					FrontId = "bar_4slot_front",
					ImageSize = new Vector2(554f, 125f),
					SlotCenters = (Vector2[])(object)new Vector2[4]
					{
						new Vector2(154f, 63f),
						new Vector2(235f, 63f),
						new Vector2(317f, 63f),
						new Vector2(396f, 63f)
					},
					SlotMapping = new int[4] { 0, 1, 2, 4 }
				}
			},
			{
				"bar_5slot",
				new BarSkinDef
				{
					BackId = "bar_5slot_back",
					FrontId = "bar_5slot_front",
					ImageSize = new Vector2(610f, 119f),
					SlotCenters = (Vector2[])(object)new Vector2[5]
					{
						new Vector2(134f, 57f),
						new Vector2(213f, 57f),
						new Vector2(293f, 57f),
						new Vector2(374f, 57f),
						new Vector2(455f, 57f)
					}
				}
			}
		};

		private static bool _isMage;

		private static bool _spellbladeActive;

		private const float SlotSize = 64f;

		private const float SlotPad = 8f;

		private const float SlotStep = 72f;

		private static readonly float BarWidth3 = 224f;

		private static readonly float BarWidth4 = 296f;

		private static readonly float BarWidth5 = 368f;

		private const float BarHeight = 74f;

		private const float QSize = 38f;

		private const float QGap = 4f;

		private const float QGroupGap = 12f;

		private const float QPadX = 18f;

		private const float QPadY = 8f;

		private static RectTransform _barRT;

		private static Image _barBgImg;

		private static readonly Color SurgePipBorder = new Color(0.5f, 0.7f, 1f, 0.9f);

		private static readonly Color SurgePipBg = new Color(0.05f, 0.05f, 0.1f, 0.85f);

		private static readonly Color SurgePipFill = new Color(0.4f, 0.7f, 1f, 1f);

		private static readonly Color SurgePipEmpty = new Color(0.15f, 0.15f, 0.2f, 0.6f);

		private static readonly Color TempestPipBorder = new Color(0.3f, 0.75f, 1f, 0.9f);

		private static readonly Color TempestPipBg = new Color(0.05f, 0.08f, 0.12f, 0.85f);

		private static readonly Color TempestPipFill = new Color(0.3f, 0.75f, 1f, 1f);

		private static readonly Color TempestPipEmpty = new Color(0.15f, 0.15f, 0.2f, 0.6f);

		private static readonly Vector2[] _drawerSlotCenters = (Vector2[])(object)new Vector2[9]
		{
			new Vector2(31f, 70f),
			new Vector2(75f, 70f),
			new Vector2(120f, 70f),
			new Vector2(31f, 116f),
			new Vector2(75f, 116f),
			new Vector2(120f, 116f),
			new Vector2(31f, 161f),
			new Vector2(75f, 161f),
			new Vector2(120f, 161f)
		};

		private static readonly Vector2[] _drawerSizes = (Vector2[])(object)new Vector2[3]
		{
			new Vector2(152f, 112f),
			new Vector2(152f, 159f),
			new Vector2(152f, 203f)
		};

		private static GameObject _drawerBlocker;

		private static Font _font;

		private static Sprite _filledSprite;

		private static KeyboardShortcut? GetSlotShortcut(int slot)
		{
			//IL_0027: 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_0063: Unknown result type (might be due to invalid IL or missing references)
			return slot switch
			{
				0 => ModConfig.KeybindAbility1?.Value, 
				1 => ModConfig.KeybindAbility2?.Value, 
				2 => ModConfig.KeybindAbility3?.Value, 
				_ => null, 
			};
		}

		private static bool SlotKeyDown(int slot)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002c: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut? slotShortcut = GetSlotShortcut(slot);
			if (!slotShortcut.HasValue)
			{
				return false;
			}
			KeyboardShortcut value = slotShortcut.Value;
			if ((int)((KeyboardShortcut)(ref value)).MainKey == 0)
			{
				return false;
			}
			value = slotShortcut.Value;
			return ((KeyboardShortcut)(ref value)).IsDown();
		}

		private static bool QuickKeyEdge(ConfigEntry<KeyboardShortcut> entry, ref bool wasDown)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			bool flag = false;
			if (entry != null)
			{
				KeyboardShortcut value = entry.Value;
				if ((int)((KeyboardShortcut)(ref value)).MainKey != 0)
				{
					flag = ((KeyboardShortcut)(ref value)).IsDown();
				}
			}
			bool result = flag && !wasDown;
			wasDown = flag;
			return result;
		}

		private static void PollQuickSlotHotkeys()
		{
			if ((!((Object)(object)Chat.instance != (Object)null) || !Chat.instance.HasFocus()) && !Console.IsVisible())
			{
				if (QuickKeyEdge(ModConfig.KeybindFoodSlot1, ref _foodKeyWasDown[0]))
				{
					HandleQuickFood(0);
				}
				if (QuickKeyEdge(ModConfig.KeybindFoodSlot2, ref _foodKeyWasDown[1]))
				{
					HandleQuickFood(1);
				}
				if (QuickKeyEdge(ModConfig.KeybindFoodSlot3, ref _foodKeyWasDown[2]))
				{
					HandleQuickFood(2);
				}
				if (QuickKeyEdge(ModConfig.KeybindMeadSlot1, ref _meadKeyWasDown[0]))
				{
					HandleQuickMead(0);
				}
				if (QuickKeyEdge(ModConfig.KeybindMeadSlot2, ref _meadKeyWasDown[1]))
				{
					HandleQuickMead(1);
				}
			}
		}

		private static void HandleQuickFood(int slotIdx)
		{
			if (QuickSlotSystem.ConsumeFood(slotIdx))
			{
				EquipmentPanel.RefreshQuickSlots();
			}
		}

		private static void HandleQuickMead(int slotIdx)
		{
			if (QuickSlotSystem.ConsumeMead(slotIdx))
			{
				EquipmentPanel.RefreshQuickSlots();
			}
		}

		private static bool SlotKeyUp(int slot)
		{
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			KeyboardShortcut? slotShortcut = GetSlotShortcut(slot);
			if (!slotShortcut.HasValue)
			{
				return false;
			}
			KeyboardShortcut value = slotShortcut.Value;
			if ((int)((KeyboardShortcut)(ref value)).MainKey == 0)
			{
				return false;
			}
			value = slotShortcut.Value;
			if (Input.GetKeyUp(((KeyboardShortcut)(ref value)).MainKey))
			{
				return true;
			}
			return false;
		}

		private static string SlotKeyLabel(int slot)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			if (slot >= 3)
			{
				KeyCode currentKeyCode = VanillaKeybinds.GetCurrentKeyCode((slot == 3) ? "Attack" : "Block");
				if ((int)currentKeyCode != 0)
				{
					return KeyDisplayName(currentKeyCode);
				}
				return _mouseSlotLabels[slot - 3];
			}
			KeyboardShortcut? slotShortcut = GetSlotShortcut(slot);
			if (slotShortcut.HasValue)
			{
				KeyboardShortcut value = slotShortcut.Value;
				if ((int)((KeyboardShortcut)(ref value)).MainKey != 0)
				{
					return FormatShortcut(slotShortcut.Value);
				}
			}
			return "?";
		}

		private static string FormatShortcut(KeyboardShortcut ks)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: 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)
			StringBuilder stringBuilder = new StringBuilder();
			foreach (KeyCode modifier in ((KeyboardShortcut)(ref ks)).Modifiers)
			{
				if (stringBuilder.Length > 0)
				{
					stringBuilder.Append("+");
				}
				stringBuilder.Append(KeyDisplayName(modifier));
			}
			if (stringBuilder.Length > 0)
			{
				stringBuilder.Append("+");
			}
			stringBuilder.Append(KeyDisplayName(((KeyboardShortcut)(ref ks)).MainKey));
			return stringBuilder.ToString();
		}

		private static string KeyDisplayName(KeyCode k)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Invalid comparison between Unknown and I4
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected I4, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Expected I4, but got Unknown
			if ((int)k != 96)
			{
				switch (k - 303)
				{
				default:
					return (k - 323) switch
					{
						0 => "M1", 
						1 => "M2", 
						2 => "M3", 
						_ => ((object)(KeyCode)(ref k)).ToString(), 
					};
				case 2:
				case 3:
					return "Ctrl";
				case 0:
				case 1:
					return "Shift";
				case 4:
				case 5:
					return "Alt";
				}
			}
			return "`";
		}

		private static void RefreshKeyLabels()
		{
			for (int i = 0; i < _keyLabels.Length; i++)
			{
				if (!((Object)(object)_keyLabels[i] == (Object)null))
				{
					_keyLabels[i].text = SlotKeyLabel(i);
				}
			}
		}

		private static void HookKeybindChangeEvents()
		{
			if (!_keybindEventsHooked)
			{
				_keybindEventsHooked = true;
				ModConfig.KeybindAbility1.SettingChanged += delegate
				{
					RefreshKeyLabels();
				};
				ModConfig.KeybindAbility2.SettingChanged += delegate
				{
					RefreshKeyLabels();
				};
				ModConfig.KeybindAbility3.SettingChanged += delegate
				{
					RefreshKeyLabels();
				};
				KeybindRegistry.OnAnyBindingChanged += RefreshKeyLabels;
			}
		}

		public static void ResolveOverchargeForActivation(int slot)
		{
			if (!_overchargeHolding || _overchargeSlot != slot)
			{
				AbilitySystem.IsOvercharged = false;
				EndOverchargeChannelVfx();
				return;
			}
			AbilitySystem.IsOvercharged = (Time.time - _overchargeStartTime) / 2f >= 0.95f;
			_overchargeHolding = false;
			_overchargeSlot = -1;
			EndOverchargeChannelVfx();
		}

		public static void Cleanup()
		{
			_built = false;
			_isMage = false;
			_spellbladeActive = false;
			_drawerSlot = -1;
			_tooltipSlot = -1;
			_overchargeHolding = false;
			_overchargeSlot = -1;
			EndOverchargeChannelVfx();
			_activeSkin = "";
			_skinBackGO = null;
			_skinFrontGO = null;
			if ((Object)(object)_root != (Object)null)
			{
				Object.Destroy((Object)(object)_root);
				_root = null;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(InventoryGui), "Show")]
		private static void OnInventoryShow()
		{
			//IL_002b: 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)
			CloseDrawer();
			if ((Object)(object)_barBgImg != (Object)null)
			{
				((Graphic)_barBgImg).color = new Color(0.07f, 0.07f, 0.07f, 0.88f);
			}
			if ((Object)(object)_quickRowBgImg != (Object)null)
			{
				((Graphic)_quickRowBgImg).color = new Color(0.05f, 0.05f, 0.08f, 0.75f);
			}
			if ((Object)(object)_castbarAnchorGO != (Object)null)
			{
				_castbarAnchorGO.SetActive(true);
			}
			_activeSkin = "";
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(InventoryGui), "Hide")]
		private static void OnInventoryHide()
		{
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			CloseDrawer();
			HideTooltip();
			if ((Object)(object)_barBgImg != (Object)null)
			{
				((Graphic)_barBgImg).color = Color.clear;
			}
			if ((Object)(object)_quickRowBgImg != (Object)null)
			{
				((Graphic)_quickRowBgImg).color = Color.clear;
			}
			if ((Object)(object)_castbarAnchorGO != (Object)null)
			{
				_castbarAnchorGO.SetActive(false);
			}
		}

		private static string GetBarSkinId(PlayerClass cls, string subclass)
		{
			switch (cls)
			{
			case PlayerClass.None:
				return "";
			case PlayerClass.Mage:
				if (string.IsNullOrEmpty(subclass))
				{
					return "bar_3slot_mage";
				}
				if (!TalentBonuses.Has("mag_cap1"))
				{
					return "bar_5slot";
				}
				return "bar_4slot";
			default:
				return "bar_3slot";
			}
		}

		private static void ApplyBarSkin(string skinId, string subclass)
		{
			//IL_0084: 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)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0167: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Expected O, but got Unknown
			//IL_0191: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ee: Expected O, but got Unknown
			//IL_030e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0319: Unknown result type (might be due to invalid IL or missing references)
			//IL_0324: Unknown result type (might be due to invalid IL or missing references)
			//IL_0329: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0331: Unknown result type (might be due to invalid IL or missing references)
			//IL_034a: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_skinBackGO != (Object)null)
			{
				Object.Destroy((Object)(object)_skinBackGO);
				_skinBackGO = null;
			}
			if ((Object)(object)_skinFrontGO != (Object)null)
			{
				Object.Destroy((Object)(object)_skinFrontGO);
				_skinFrontGO = null;
			}
			_activeSkin = skinId;
			if (string.IsNullOrEmpty(skinId) || !_barSkins.TryGetValue(skinId, out var value))
			{
				if ((Object)(object)_barRT != (Object)null)
				{
					_barRT.sizeDelta = new Vector2(_isMage ? BarWidth5 : BarWidth3, 74f);
				}
				for (int i = 0; i < 3; i++)
				{
					if (!((Object)(object)_slotGOs[i] == (Object)null))
					{
						RectTransform component = _slotGOs[i].GetComponent<RectTransform>();
						component.anchoredPosition = new Vector2(8f + (float)i * 72f, -8f);
						component.sizeDelta = new Vector2(64f, 64f);
					}
				}
				if ((Object)(object)_barBgImg != (Object)null)
				{
					((Graphic)_barBgImg).color = Color.clear;
				}
				return;
			}
			Sprite panelIcon = IconLoader.GetPanelIcon(value.BackId);
			Sprite panelIcon2 = IconLoader.GetPanelIcon(value.FrontId);
			if ((Object)(object)panelIcon == (Object)null || (Object)(object)panelIcon2 == (Object)null)
			{
				return;
			}
			_barRT.sizeDelta = value.ImageSize;
			if ((Object)(object)_barBgImg != (Object)null)
			{
				((Graphic)_barBgImg).color = Color.clear;
			}
			_skinBackGO = new GameObject("SkinBack");
			_skinBackGO.transform.SetParent((Transform)(object)_barRT, false);
			RectTransform obj = _skinBackGO.AddComponent<RectTransform>();
			obj.anchorMin = Vector2.zero;
			obj.anchorMax = Vector2.one;
			Vector2 offsetMin = (obj.offsetMax = Vector2.zero);
			obj.offsetMin = offsetMin;
			Image obj2 = _skinBackGO.AddComponent<Image>();
			obj2.sprite = panelIcon;
			((Graphic)obj2).color = Color.white;
			((Graphic)obj2).raycastTarget = false;
			_skinBackGO.transform.SetAsFirstSibling();
			bool[] array = new bool[5];
			for (int j = 0; j < value.SlotCenters.Length; j++)
			{
				int num = ((value.SlotMapping != null && j < value.SlotMapping.Length) ? value.SlotMapping[j] : j);
				if (num < 5 && !((Object)(object)_slotGOs[num] == (Object)null))
				{
					_slotGOs[num].SetActive(true);
					array[num] = true;
					RectTransform component2 = _slotGOs[num].GetComponent<RectTransform>();
					float num2 = value.SlotCenters[j].x - 32f;
					float num3 = 0f - (value.SlotCenters[j].y - 32f);
					component2.anchoredPosition = new Vector2(num2, num3);
				}
			}
			for (int k = 0; k < 5; k++)
			{
				if (!array[k] && (Object)(object)_slotGOs[k] != (Object)null)
				{
					_slotGOs[k].SetActive(false);
				}
			}
			_skinFrontGO = new GameObject("SkinFront");
			_skinFrontGO.transform.SetParent((Transform)(object)_barRT, false);
			RectTransform obj3 = _skinFrontGO.AddComponent<RectTransform>();
			obj3.anchorMin = Vector2.zero;
			obj3.anchorMax = Vector2.one;
			offsetMin = (obj3.offsetMax = Vector2.zero);
			obj3.offsetMin = offsetMin;
			Image obj4 = _skinFrontGO.AddComponent<Image>();
			obj4.sprite = panelIcon2;
			((Graphic)obj4).color = Color.white;
			((Graphic)obj4).raycastTarget = false;
			_skinFrontGO.transform.SetAsLastSibling();
		}

		private static void RefreshMageSlots(Player player)
		{
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			bool isMage = _isMage;
			_isMage = ClassSystem.GetClass(player) == PlayerClass.Mage;
			if (_isMage == isMage || !string.IsNullOrEmpty(_activeSkin))
			{
				return;
			}
			bool flag = (_spellbladeActive = _isMage && TalentBonuses.Has("mag_cap1"));
			if ((Object)(object)_slotGOs[3] != (Object)null)
			{
				_slotGOs[3].SetActive(_isMage && !flag);
			}
			if ((Object)(object)_slotGOs[4] != (Object)null)
			{
				_slotGOs[4].SetActive(_isMage);
				if (_isMage && flag)
				{
					_slotGOs[4].GetComponent<RectTransform>().anchoredPosition = new Vector2(224f, -8f);
				}
			}
			float num = ((!_isMage) ? BarWidth3 : (flag ? BarWidth4 : BarWidth5));
			if ((Object)(object)_barRT != (Object)null)
			{
				_barRT.sizeDelta = new Vector2(num, 74f);
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Hud), "Awake")]
		private static void OnHudAwake()
		{
			if (!_built)
			{
				Build();
			}
		}

		public static void FlashSlot(int slot)
		{
			if (slot >= 0 && slot < 5)
			{
				_flashTimers[slot] = 0.8f;
			}
		}

		[HarmonyPostfix]
		[HarmonyPatch(typeof(Hud), "Update")]
		private static void OnHudUpdate()
		{
			//IL_0e3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e45: Invalid comparison between Unknown and I4
			//IL_07dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e6c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e73: Invalid comparison between Unknown and I4
			//IL_0e7c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e82: Invalid comparison between Unknown and I4
			Player localPlayer = Player.m_localPlayer;
			if ((Object)(object)localPlayer == (Object)null || !_built)
			{
				if ((Object)(object)_root != (Object)null)
				{
					_root.SetActive(false);
				}
				if ((Object)(object)_quickRow != (Object)null)
				{
					_quickRow.SetActive(false);
				}
			}
			else
			{
				if ((Object)(object)_root == (Object)null)
				{
					return;
				}
				float deltaTime = Time.deltaTime;
				for (int i = 0; i < 5; i++)
				{
					if (_flashTimers[i] > 0f)
					{
						_flashTimers[i] = Mathf.Max(0f, _flashTimers[i] - deltaTime);
					}
				}
				bool flag = !((Character)localPlayer).IsDead();
				if (flag)
				{
					PlayerData orCreate = RenownSystem.GetOrCreate(localPlayer);
					if (orCreate == null)
					{
						flag = false;
					}
					else
					{
						bool flag2 = AbilitySystem.GetUnlockedAbilities(orCreate).Count > 0;
						bool flag3 = false;
						if (!flag2)
						{
							for (int j = 0; j < orCreate.AbilitySlots.Length; j++)
							{
								if (!string.IsNullOrEmpty(orCreate.AbilitySlots[j]))
								{
									flag3 = true;
									break;
								}
							}
						}
						if (!flag2 && !flag3)
						{
							flag = false;
						}
					}
				}
				_root.SetActive(flag);
				PollQuickSlotHotkeys();
				RefreshQuickSlotMirrors();
				AbilitySystem.Tick(Time.deltaTime);
				BossKillPatch.Tick();
				if (!flag)
				{
					return;
				}
				RefreshMageSlots(localPlayer);
				CastbarSystem.Tick(Time.deltaTime);
				RefreshCooldowns(localPlayer);
				RefreshCastbar();
				UpdateTooltipPosition();
				if (AbilitySystem.IsFrozenGraspTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelFrozenGraspTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int k = 0; k < 3; k++)
					{
						if (SlotKeyUp(k))
						{
							AbilitySystem.ConfirmFrozenGraspTargeting(k, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsDisengageTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelDisengageTargeting();
						return;
					}
					for (int l = 0; l < 3; l++)
					{
						if (SlotKeyUp(l))
						{
							AbilitySystem.ConfirmDisengageTargeting(l, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsBallLightningTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelBallLightningTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int m = 0; m < 3; m++)
					{
						if (SlotKeyUp(m))
						{
							AbilitySystem.ConfirmBallLightningTargeting(m, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsPiercingShotTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelPiercingShotTargeting();
						return;
					}
					for (int n = 0; n < 3; n++)
					{
						if (SlotKeyUp(n))
						{
							AbilitySystem.ConfirmPiercingShotTargeting(n, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsShadowAnchorTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelShadowAnchorTargeting();
						return;
					}
					for (int num = 0; num < 3; num++)
					{
						if (SlotKeyUp(num))
						{
							AbilitySystem.ConfirmShadowAnchorTargeting(num, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsShadowStrikeTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelShadowStrikeTargeting();
						return;
					}
					for (int num2 = 0; num2 < 3; num2++)
					{
						if (SlotKeyUp(num2))
						{
							AbilitySystem.ConfirmShadowStrikeTargeting(num2, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsBladeDanceTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelBladeDanceTargeting();
						return;
					}
					for (int num3 = 0; num3 < 3; num3++)
					{
						if (SlotKeyUp(num3))
						{
							AbilitySystem.ConfirmBladeDanceTargeting(num3, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsBladeBarrageTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelBladeBarrageTargeting();
						return;
					}
					for (int num4 = 0; num4 < 3; num4++)
					{
						if (SlotKeyUp(num4))
						{
							AbilitySystem.ConfirmBladeBarrageTargeting(num4, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsThrowingKnivesTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelThrowingKnivesTargeting();
						return;
					}
					for (int num5 = 0; num5 < 3; num5++)
					{
						if (SlotKeyUp(num5))
						{
							AbilitySystem.ConfirmThrowingKnivesTargeting(num5, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsGroundSlamTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelGroundSlamTargeting();
						return;
					}
					for (int num6 = 0; num6 < 3; num6++)
					{
						if (SlotKeyUp(num6))
						{
							AbilitySystem.ConfirmGroundSlamTargeting(num6, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsChargeTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelChargeTargeting();
						return;
					}
					for (int num7 = 0; num7 < 3; num7++)
					{
						if (SlotKeyUp(num7))
						{
							AbilitySystem.ConfirmChargeTargeting(num7, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsWarCryTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelWarCryTargeting();
						return;
					}
					for (int num8 = 0; num8 < 3; num8++)
					{
						if (SlotKeyUp(num8))
						{
							AbilitySystem.ConfirmWarCryTargeting(num8, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsWarStompTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelWarStompTargeting();
						return;
					}
					for (int num9 = 0; num9 < 3; num9++)
					{
						if (SlotKeyUp(num9))
						{
							AbilitySystem.ConfirmWarStompTargeting(num9, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsWhirlwindTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelWhirlwindTargeting();
						return;
					}
					for (int num10 = 0; num10 < 3; num10++)
					{
						if (SlotKeyUp(num10))
						{
							AbilitySystem.ConfirmWhirlwindTargeting(num10, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsRainTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelRainTargeting();
						return;
					}
					for (int num11 = 0; num11 < 3; num11++)
					{
						if (SlotKeyUp(num11))
						{
							AbilitySystem.ConfirmRainTargeting(num11, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsBlizzardTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelBlizzardTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num12 = 0; num12 < 3; num12++)
					{
						if (SlotKeyUp(num12))
						{
							AbilitySystem.ConfirmBlizzardTargeting(num12, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsEruptionTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelEruptionTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num13 = 0; num13 < 3; num13++)
					{
						if (SlotKeyUp(num13))
						{
							AbilitySystem.ConfirmEruptionTargeting(num13, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsMeteorTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelMeteorTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num14 = 0; num14 < 3; num14++)
					{
						if (SlotKeyUp(num14))
						{
							AbilitySystem.ConfirmMeteorTargeting(num14, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsFlameWallTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelFlameWallTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num15 = 0; num15 < 3; num15++)
					{
						if (SlotKeyUp(num15))
						{
							AbilitySystem.ConfirmFlameWallTargeting(num15, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsLightningStormTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelLightningStormTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num16 = 0; num16 < 3; num16++)
					{
						if (SlotKeyUp(num16))
						{
							AbilitySystem.ConfirmLightningStormTargeting(num16, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsBlinkTargeting)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelBlinkTargeting();
						CancelOverchargeChannel();
						return;
					}
					for (int num17 = 0; num17 < 3; num17++)
					{
						if (SlotKeyUp(num17))
						{
							AbilitySystem.ConfirmBlinkTargeting(num17, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.IsPaladinIndicatorActive)
				{
					if (Input.GetMouseButtonDown(0) || Input.GetMouseButtonDown(1) || !CanFire(localPlayer))
					{
						AbilitySystem.CancelPaladinIndicator();
						return;
					}
					for (int num18 = 0; num18 < 3; num18++)
					{
						if (SlotKeyUp(num18))
						{
							AbilitySystem.ConfirmPaladinIndicator(num18, localPlayer);
							break;
						}
					}
					return;
				}
				if (AbilitySystem.WhirlwindActive)
				{
					for (int num19 = 0; num19 < 3; num19++)
					{
						if (SlotKeyDown(num19))
						{
							AbilityDef slotAbility = AbilitySystem.GetSlotAbility(num19, localPlayer);
							if (slotAbility != null && slotAbility.Id == "whirlwind")
							{
								AbilitySystem.EndWhirlwind();
								FloatingText.Show("Whirlwind ended!", Color.gray, "ww_end", 0f);
								return;
							}
						}
					}
				}
				if (!CanFire(localPlayer))
				{
					return;
				}
				for (int num20 = 0; num20 < 3; num20++)
				{
					if (!SlotKeyDown(num20))
					{
						continue;
					}
					AbilityDef slotAbility2 = AbilitySystem.GetSlotAbility(num20, localPlayer);
					if (AbilitySystem.HasOverchargeRecall(num20))
					{
						AbilitySystem.TryActivate(num20, localPlayer);
						continue;
					}
					if (slotAbility2 != null && slotAbility2.Id == "rain_of_arrows")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginRainTargeting(num20, localPlayer);
						}
						continue;
					}
					bool num21 = (slotAbility2 != null && slotAbility2.Id == "surge" && AbilitySystem.IsSurgeActive) || (slotAbility2 != null && slotAbility2.Id == "ice_block" && AbilitySystem.IceBlockActive);
					bool flag4 = slotAbility2 != null && Traverse.Create((object)localPlayer).Field("m_eitr").GetValue<float>() >= slotAbility2.EitrCost;
					if (!num21 && slotAbility2 != null && TalentBonuses.Has("mag_cap3") && AbilitySystem.GetOverchargeCategory(slotAbility2.Id) != null && AbilitySystem.GetCooldownRemaining(num20) <= 0f && flag4)
					{
						_overchargeHolding = true;
						_overchargeSlot = num20;
						_overchargeStartTime = Time.time;
						_overchargeEitrDrained = 0f;
						StartOverchargeChannelVfx(num20);
						if (!_overchargeWithTargeting.Contains(slotAbility2.Id))
						{
							continue;
						}
					}
					if (slotAbility2 != null && slotAbility2.Id == "frost_nova")
					{
						AbilitySystem.BeginFrozenGraspTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "blizzard")
					{
						AbilitySystem.BeginBlizzardTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "eruption")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginEruptionTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "meteor")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginMeteorTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "flame_wall")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginFlameWallTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "lightning_storm")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginLightningStormTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "blink")
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							AbilitySystem.BeginBlinkTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "disengage")
					{
						AbilitySystem.BeginDisengageTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "chain_lightning")
					{
						AbilitySystem.TryActivate(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "piercing_shot")
					{
						AbilitySystem.BeginPiercingShotTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "ball_lightning")
					{
						AbilitySystem.BeginBallLightningTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "shadowstrike")
					{
						AbilitySystem.BeginShadowStrikeTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "blade_dance")
					{
						AbilitySystem.BeginBladeDanceTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "blade_barrage")
					{
						AbilitySystem.BeginBladeBarrageTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "shadow_tether")
					{
						AbilitySystem.BeginThrowingKnivesTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "ground_slam")
					{
						AbilitySystem.BeginGroundSlamTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "charge")
					{
						AbilitySystem.BeginChargeTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "war_cry")
					{
						AbilitySystem.BeginWarCryTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "war_stomp")
					{
						AbilitySystem.BeginWarStompTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "whirlwind")
					{
						AbilitySystem.BeginWhirlwindTargeting(num20, localPlayer);
					}
					else if (slotAbility2 != null && (slotAbility2.Id == "holy_strike" || slotAbility2.Id == "consecration" || slotAbility2.Id == "divine_judgement" || slotAbility2.Id == "frost_reaping" || slotAbility2.Id == "healing_light" || slotAbility2.Id == "sanctified_barrage" || slotAbility2.Id == "absolution" || slotAbility2.Id == "divine_shield" || slotAbility2.Id == "radiant_aura"))
					{
						AbilitySystem.BeginPaladinIndicator(num20, localPlayer);
					}
					else if (slotAbility2 != null && slotAbility2.Id == "shadow_anchor")
					{
						if (AbilitySystem.ShadowAnchorActive)
						{
							AbilitySystem.ReactivateShadowAnchorPublic(localPlayer);
						}
						else
						{
							AbilitySystem.BeginShadowAnchorTargeting(num20, localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.Id == "surge" && AbilitySystem.IsSurgeActive)
					{
						if (AbilitySystem.IsSurgeRecastActive)
						{
							AbilitySystem.TryActivateSurgeRecast(localPlayer);
						}
					}
					else if (slotAbility2 != null && slotAbility2.EitrCost > 0f && TalentBonuses.Has("mag_cap3") && AbilitySystem.GetOverchargeCategory(slotAbility2.Id) != null && AbilitySystem.GetCooldownRemaining(num20) <= 0f)
					{
						if (AbilitySystem.CheckEitr(slotAbility2, localPlayer))
						{
							_overchargeHolding = true;
							_overchargeSlot = num20;
							_overchargeStartTime = Time.time;
							_overchargeEitrDrained = 0f;
							StartOverchargeChannelVfx(num20);
						}
					}
					else
					{
						AbilitySystem.TryActivate(num20, localPlayer);
					}
				}
				if (_isMage)
				{
					ItemData currentWeapon = ((Humanoid)localPlayer).GetCurrentWeapon();
					bool flag5 = currentWeapon != null && ((int)currentWeapon.m_shared.m_itemType == 19 || (Object)(object)currentWeapon.m_shared.m_buildPieces != (Object)null);
					bool flag6 = currentWeapon != null && ((int)currentWeapon.m_shared.m_skillType == 12 || (int)currentWeapon.m_shared.m_skillType == 7);
					bool flag7 = Input.GetKey((KeyCode)308) || Input.GetKey((KeyCode)307);
					if (ZInput.GetButton("Block") && !flag5 && !((Character)localPlayer).InPlaceMode() && !InventoryGui.IsVisible() && !Menu.IsVisible() && !Minimap.IsOpen())
					{
						if (!AbilitySystem.MageBlockActive)
						{
							AbilitySystem.MageBlockActive = true;
							AbilitySystem.MageBlockStartTime = Time.time;
							VfxHelper.BroadcastBuffVfx("spell_barrier", active: true);
						}
					}
					else if (AbilitySystem.MageBlockActive)
					{
						AbilitySystem.MageBlockActive = false;
						VfxHelper.BroadcastBuffVfx("spell_barrier", active: false);
					}
					if (!flag5 && !(flag6 && flag7) && !((Character)localPlayer).InPlaceMode() && !TalentBonuses.Has("mag_cap1") && ZInput.GetButtonDown("Attack"))
					{
						if (flag6)
						{
							Traverse obj = Traverse.Create((object)localPlayer);
							obj.Field("m_attack").SetValue((object)false);
							obj.Field("m_attackHold").SetValue((object)false);
							Traverse obj2 = obj.Field("m_currentAttack");
							if (obj2 != null)
							{
								obj2.SetValue((object)null);
							}
						}
						AbilitySystem.TryActivate(3, localPlayer);
					}
				}
				if (!_overchargeHolding || _overchargeSlot < 0)
				{
					return;
				}
				_ = Time.time;
				_ = _overchargeStartTime;
				AbilityDef slotAbility3 = AbilitySystem.GetSlotAbility(_overchargeSlot, localPlayer);
				if (slotAbility3 != null && slotAbility3.EitrCost > 0f)
				{
					float num22 = slotAbility3.EitrCost / 2f * Time.deltaTime;
					float value = Traverse.Create((object)localPlayer).Field("m_eitr").GetValue<float>();
					float num23 = value - slotAbility3.EitrCost;
					if (!(num23 <= 0f))
					{
						float num24 = Mathf.Min(num22, num23);
						Traverse.Create((object)localPlayer).Field("m_eitr").SetValue((object)(value - num24));
						_overchargeEitrDrained += num24;
					}
				}
				bool flag8 = false;
				if (_overchargeSlot < 3)
				{
					flag8 = SlotKeyUp(_overchargeSlot);
				}
				else if (_overchargeSlot == 3)
				{
					flag8 = ZInput.GetButtonUp("Attack");
				}
				if (flag8)
				{
					int overchargeSlot = _overchargeSlot;
					AbilityDef slotAbility4 = AbilitySystem.GetSlotAbility(overchargeSlot, localPlayer);
					if (slotAbility4 != null && _overchargeWithTargeting.Contains(slotAbility4.Id))
					{
						_overchargeHolding = false;
						_overchargeSlot = -1;
						EndOverchargeChannelVfx();
					}
					else
					{
						AbilitySystem.TryActivate(overchargeSlot, localPlayer);
					}
				}
			}
		}

		private static bool CanFire(Player player)
		{
			if (CastbarSystem.IsCasting && !CastbarSystem.IsCharging)
			{
				return false;
			}
			if (InventoryGui.IsVisible())
			{
				return false;
			}
			if ((Object)(object)Chat.instance != (Object)null && Chat.instance.HasFocus())
			{
				return false;
			}
			if (Console.IsVisible())
			{
				return false;
			}
			return true;
		}

		private static void Build()
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0055: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Unknown result type (might be due to invalid IL or missing references)
			_built = true;
			_root = new GameObject("VA_AbilityBar");
			Object.DontDestroyOnLoad((Object)(object)_root);
			Canvas obj = _root.AddComponent<Canvas>();
			obj.renderMode = (RenderMode)0;
			obj.sortingOrder = 1400;
			CanvasScaler obj2 = _root.AddComponent<CanvasScaler>();
			obj2.uiScaleMode = (ScaleMode)1;
			obj2.referenceResolution = new Vector2(1920f, 1080f);
			_root.AddComponent<GraphicRaycaster>();
			_root.transform.localScale = Vector3.one * 0.875f;
			_root.SetActive(false);
			BuildBar(_root.transform);
			BuildCastbar(_root.transform);
			BuildDrawer(_root.transform);
			BuildQuickSlotMirrors(_root.transform);
			HookKeybindChangeEvents();
		}

		private static void BuildQuickSlotMirrors(Transform unusedCanvas)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_004f: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b3: Expected O, but got Unknown
			//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			_quickSlotRoot = new GameObject("VA_QuickSlotMirrorsRoot");
			Object.DontDestroyOnLoad((Object)(object)_quickSlotRoot);
			Canvas obj = _quickSlotRoot.AddComponent<Canvas>();
			obj.renderMode = (RenderMode)0;
			obj.sortingOrder = 1399;
			CanvasScaler obj2 = _quickSlotRoot.AddComponent<CanvasScaler>();
			obj2.uiScaleMode = (ScaleMode)1;
			obj2.referenceResolution = new Vector2(1920f, 1080f);
			_quickSlotRoot.AddComponent<GraphicRaycaster>();
			_quickSlotRoot.transform.localScale = Vector3.one * 0.875f;
			float num = 122f;
			float num2 = 80f;
			float num3 = num + 12f + num2 + 36f;
			float num4 = 54f;
			_quickRow = new GameObject("VA_QuickSlotMirrors");
			_quickRow.transform.SetParent(_quickSlotRoot.transform, false);
			_quickRow.SetActive(false);
			RectTransform val = _quickRow.AddComponent<RectTransform>();
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0f);
			val.anchorMax = val2;
			val.anchorMin = val2;
			val.pivot = new Vector2(0.5f, 0f);
			val.anchoredPosition = new Vector2(0f, 200f);
			val.sizeDelta = new Vector2(num3, num4);
			_quickRowBgImg = _quickRow.AddComponent<Image>();
			((Graphic)_quickRowBgImg).color = Color.clear;
			((Graphic)_quickRowBgImg).raycastTarget = true;
			HudDrag hudDrag = _quickRow.AddComponent<HudDrag>();
			hudDrag.Target = val;
			hudDrag.PanelId = "hud_quickslots";
			UIScale.Register(val, ScaleGroup.QuickSlots);
			_mirrorEquippedSprite = IconLoader.GetEquipIcon("equipped_bg");
			float num5 = 18f;
			for (int i = 0; i < 3; i++)
			{
				float x = num5 + (float)i * 42f;
				BuildMirrorSlot(_quickRow.transform, isFood: true, i, x);
			}
			float num6 = num5 + num + 12f;
			for (int j = 0; j < 2; j++)
			{
				float x2 = num6 + (float)j * 42f;
				BuildMirrorSlot(_quickRow.transform, isFood: false, j, x2);
			}
		}

		private static void BuildMirrorSlot(Transform parent, bool isFood, int index, float x)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0162: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			//IL_018c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0212: Unknown result type (might be due to invalid IL or missing references)
			//IL_0221: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_0249: Unknown result type (might be due to invalid IL or missing references)
			//IL_025e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_029c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_030c: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject(string.Format("QM_{0}_{1}", isFood ? "food" : "mead", index));
			val.transform.SetParent(parent, false);
			RectTransform obj = val.AddComponent<RectTransform>();
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0f, 0f);
			obj.anchorMax = val2;
			obj.anchorMin = val2;
			obj.pivot = new Vector2(0f, 0f);
			obj.anchoredPosition = new Vector2(x, 8f);
			obj.sizeDelta = new Vector2(38f, 38f);
			Image val3 = val.AddComponent<Image>();
			((Graphic)val3).color = new Color(0.08f, 0.08f, 0.08f, 0.85f);
			((Graphic)val3).raycastTarget = false;
			GameObject val4 = new GameObject("Icon");
			val4.transform.SetParent(val.transform, false);
			RectTransform obj2 = val4.AddComponent<RectTransform>();
			obj2.anchorMin = new Vector2(0.1f, 0.1f);
			obj2.anchorMax = new Vector2(0.9f, 0.9f);
			val2 = (obj2.offsetMin = (obj2.offsetMax = Vector2.zero));
			Image val6 = val4.AddComponent<Image>();
			((Behaviour)val6).enabled = false;
			((Graphic)val6).raycastTarget = false;
			GameObject val7 = new GameObject("Count");
			val7.transform.SetParent(val.transform, false);
			RectTransform obj3 = val7.AddComponent<RectTransform>();
			obj3.anchorMin = new Vector2(0f, 0f);
			obj3.anchorMax = new Vector2(1f, 0f);
			obj3.pivot = new Vector2(1f, 0f);
			obj3.anchoredPosition = new Vector2(-2f, 1f);
			obj3.sizeDelta = new Vector2(0f, 11f);
			Text val8 = val7.AddComponent<Text>();
			val8.font = Font.CreateDynamicFontFromOSFont("Arial", 10);
			val8.fontSize = 10;
			((Graphic)val8).color = Color.white;
			val8.alignment = (TextAnchor)8;
			((Graphic)val8).raycastTarget = false;
			((Shadow)val7.AddComponent<Outline>()).effectColor = new Color(0f, 0f, 0f, 1f);
			GameObject val9 = new GameObject("Key");
			val9.transform.SetParent(val.transform, false);
			RectTransform obj4 = val9.AddComponent<RectTransform>();
			obj4.anchorMin = new Vector2(0f, 1f);
			obj4.anchorMax = new Vector2(0f, 1f);
			obj4.pivot = new Vector2(0f, 1f);
			obj4.anchoredPosition = new Vector2(2f, -1f);
			obj4.sizeDelta = new Vector2(36f, 10f);
			Text val10 = val9.AddComponent<Text>();
			val10.font = Font.CreateDynamicFontFromOSFont("Arial", 8);
			val10.fontSize = 8;
			((Graphic)val10).color = new Color(0.95f, 0.85f, 0.45f);
			val10.alignment = (TextAnchor)0;
			((Graphic)val10).raycastTarget = false;
			((Shadow)val9.AddComponent<Outline>()).effectColor = new Color(0f, 0f, 0f, 1f);
			if (isFood)
			{
				_foodMirrorRoots[index] = val;
				_foodMirrorBgs[index] = val3;
				_foodMirrorIcons[index] = val6;
				_foodMirrorCounts[index] = val8;
				_foodMirrorKeys[index] = val10;
			}
			else
			{
				_meadMirrorRoots[index] = val;
				_meadMirrorBgs[index] = val3;
				_meadMirrorIcons[index] = val6;
				_meadMirrorCounts[index] = val8;
				_meadMirrorKeys[index] = val10;
			}
		}

		private static string FormatQuickKey(ConfigEntry<KeyboardShortcut> entry)
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			if (entry == null)
			{
				return "";
			}
			return KeybindRegistry.FormatShortcut(entry.Value);
		}

		private static void RefreshQuickSlotMirrors()
		{
			if ((Object)(object)_quickRow == (Object)null)
			{
				return;
			}
			Player localPlayer = Player.m_localPlayer;
			bool flag = (Object)(object)localPlayer != (Object)null && !((Character)localPlayer).IsDead();
			bool flag2 = false;
			for (int i = 0; i < 3; i++)
			{
				if (flag2)
				{
					break;
				}
				if (QuickSlotSystem.FoodInv.GetItemAt(i, 0) != null)
				{
					flag2 = true;
				}
			}
			for (int j = 0; j < 2; j++)
			{
				if (flag2)
				{
					break;
				}
				if (QuickSlotSystem.MeadInv.GetItemAt(j, 0) != null)
				{
					flag2 = true;
				}
			}
			_quickRow.SetActive(flag && flag2);
			if (flag && flag2)
			{
				for (int k = 0; k < 3; k++)
				{
					UpdateMirrorSlot(_foodMirrorRoots[k], _foodMirrorBgs[k], _foodMirrorIcons[k], _foodMirrorCounts[k], _foodMirrorKeys[k], QuickSlotSystem.FoodInv.GetItemAt(k, 0), GetFoodEntry(k));
				}
				for (int l = 0; l < 2; l++)
				{
					UpdateMirrorSlot(_meadMirrorRoots[l], _meadMirrorBgs[l], _meadMirrorIcons[l], _meadMirrorCounts[l], _meadMirrorKeys[l], QuickSlotSystem.MeadInv.GetItemAt(l, 0), GetMeadEntry(l));
				}
			}
		}

		private static ConfigEntry<KeyboardShortcut> GetFoodEntry(int idx)
		{
			return (ConfigEntry<KeyboardShortcut>)(idx switch
			{
				0 => ModConfig.KeybindFoodSlot1, 
				1 => ModConfig.KeybindFoodSlot2, 
				2 => ModConfig.KeybindFoodSlot3, 
				_ => null, 
			});
		}

		private static ConfigEntry<KeyboardShortcut> GetMeadEntry(int idx)
		{
			return (ConfigEntry<KeyboardShortcut>)(idx switch
			{
				0 => ModConfig.KeybindMeadSlot1, 
				1 => ModConfig.KeybindMeadSlot2, 
				_ => null, 
			});
		}

		private static void UpdateMirrorSlot(GameObject slotRoot, Image bgImg, Image iconImg, Text countText, Text keyText, ItemData item, ConfigEntry<KeyboardShortcut> keyEntry)
		{
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)slotRoot == (Object)null || (Object)(object)iconImg == (Object)null)
			{
				return;
			}
			bool flag = item != null && item.m_shared != null && item.m_shared.m_icons != null && item.m_shared.m_icons.Length != 0;
			slotRoot.SetActive(flag);
			if (flag)
			{
				if ((Object)(object)bgImg != (Object)null && (Object)(object)_mirrorEquippedSprite != (Object)null)
				{
					bgImg.sprite = _mirrorEquippedSprite;
					((Graphic)bgImg).color = Color.white;
				}
				iconImg.sprite = item.m_shared.m_icons[0];
				((Behaviour)iconImg).enabled = true;
				countText.text = ((item.m_stack > 1) ? item.m_stack.ToString() : "");
				keyText.text = FormatQuickKey(keyEntry);
			}
		}

		private static void BuildBar(Transform canvas)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0044: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Expected O, but got Unknown
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: Unknown result type (might be due to invalid IL or missing references)
			//IL_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_0189: 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_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0210: Unknown result type (might be due to invalid IL or missing references)
			//IL_0211: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_0226: Unknown result type (might be due to invalid IL or missing references)
			//IL_024e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0268: Unknown result type (might be due to invalid IL or missing references)
			//IL_0273: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			//IL_0284: Unknown result type (might be due to invalid IL or missing references)
			//IL_028a: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_0316: Unknown result type (might be due to invalid IL or missing references)
			//IL_0355: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0413: Unknown result type (might be due to invalid IL or missing references)
			//IL_0418: Unknown result type (might be due to invalid IL or missing references)
			//IL_042b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0446: Unknown result type (might be due to invalid IL or missing references)
			//IL_0461: Unknown result type (might be due to invalid IL or missing references)
			//IL_046c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0480: Unknown result type (might be due to invalid IL or missing references)
			//IL_048a: Expected O, but got Unknown
			//IL_0491: Unknown result type (might be due to invalid IL or missing references)
			//IL_0496: Unknown result type (might be due to invalid IL or missing references)
			//IL_0498: Unknown result type (might be due to invalid IL or missing references)
			//IL_049f: Expected O, but got Unknown
			//IL_04c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_04cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d3: Expected O, but got Unknown
			GameObject val = new GameObject("Bar");
			val.transform.SetParent(canvas, false);
			_barRT = val.AddComponent<RectTransform>();
			RectTransform barRT = _barRT;
			RectTransform barRT2 = _barRT;
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0f);
			barRT2.anchorMax = val2;
			barRT.anchorMin = val2;
			_barRT.pivot = new Vector2(0.5f, 0f);
			_barRT.anchoredPosition = new Vector2(400f, 90f);
			_barRT.sizeDelta = new Vector2(BarWidth3, 74f);
			_barBgImg = val.AddComponent<Image>();
			((Graphic)_barBgImg).color = Color.clear;
			((Graphic)_barBgImg).raycastTarget = true;
			UIScale.Register(_barRT, ScaleGroup.AbilityBar);
			HudDrag hudDrag = val.AddComponent<HudDrag>();
			hudDrag.Target = _barRT;
			hudDrag.PanelId = "hud_abilities";
			Transform transform = val.transform;
			for (int i = 0; i < 5; i++)
			{
				int capture = i;
				float num = 8f + (float)i * 72f;
				GameObject val3 = new GameObject($"Slot{i}");
				val3.transform.SetParent(transform, false);
				RectTransform obj = val3.AddComponent<RectTransform>();
				((Vector2)(ref val2))..ctor(0f, 1f);
				obj.anchorMax = val2;
				obj.anchorMin = val2;
				obj.pivot = new Vector2(0f, 1f);
				obj.anchoredPosition = new Vector2(num, -8f);
				obj.sizeDelta = new Vector2(64f, 64f);
				((Graphic)val3.AddComponent<Image>()).color = new Color(0.14f, 0.14f, 0.14f, 1f);
				_slotGOs[i] = val3;
				if (i >= 3)
				{
					val3.SetActive(false);
				}
				Transform transform2 = val3.transform;
				GameObject val4 = new GameObject("Icon");
				val4.transform.SetParent(transform2, false);
				RectTransform obj2 = val4.AddComponent<RectTransform>();
				obj2.anchorMin = Vector2.zero;
				obj2.anchorMax = Vector2.one;
				val2 = (obj2.offsetMin = (obj2.offsetMax = Vector2.zero));
				Image val6 = val4.AddComponent<Image>();
				((Graphic)val6).color = Color.white;
				val6.preserveAspect = true;
				((Behaviour)val6).enabled = false;
				_slotIcons[i] = val6;
				GameObject val7 = new GameObject("CD");
				val7.transform.SetParent(transform2, false);
				RectTransform obj3 = val7.AddComponent<RectTransform>();
				obj3.anchorMin = Vector2.zero;
				obj3.anchorMax = Vector2.one;
				val2 = (obj3.offsetMin = (obj3.offsetMax = Vector2.zero));
				Image val9 = val7.AddComponent<Image>();
				((Graphic)val9).color = new Color(0.15f, 0.15f, 0.15f, 0.7f);
				val9.type = (Type)3;
				val9.fillMethod = (FillMethod)4;
				val9.fillOrigin = 2;
				val9.fillClockwise = false;
				val9.fillAmount = 0f;
				val9.sprite = CreateFilledSprite();
				_cdOverlay[i] = val9;
				_nameLabels[i] = MakeTxt(transform2, $"Name{i}", "Empty", 8, Color.gray, 2f, -2f, 60f, 26f, (TextAnchor)1);
				_cdLabels[i] = MakeTxt(transform2, $"CD{i}", "", 9, Color.white, 0f, -24f, 64f, 16f, (TextAnchor)4);
				int size = ((i >= 3) ? 7 : 9);
				Text val10 = MakeTxt(transform2, $"Key{i}", SlotKeyLabel(i), size, new Color(0.9f, 0.8f, 0.2f), 0f, -50f, 64f, 14f, (TextAnchor)4);
				Outline obj4 = ((Component)val10).gameObject.AddComponent<Outline>();
				((Shadow)obj4).effectColor = Color.black;
				((Shadow)obj4).effectDistance = new Vector2(1f, -1f);
				_keyLabels[i] = val10;
				Button obj5 = val3.AddComponent<Button>();
				((Selectable)obj5).targetGraphic = (Graphic)(object)val3.GetComponent<Image>();
				ColorBlock colors = ((Selectable)obj5).colors;
				((ColorBlock)(ref colors)).normalColor = new Color(0.14f, 0.14f, 0.14f);
				((ColorBlock)(ref colors)).highlightedColor = new Color(0.22f, 0.22f, 0.22f);
				((ColorBlock)(ref colors)).pressedColor = new Color(0.08f, 0.08f, 0.08f);
				((Selectable)obj5).colors = colors;
				((UnityEvent)obj5.onClick).AddListener((UnityAction)delegate
				{
					OpenDrawer(capture);
				});
				EventTrigger obj6 = val3.AddComponent<EventTrigger>();
				Entry val11 = new Entry
				{
					eventID = (EventTriggerType)0
				};
				((UnityEvent<BaseEventData>)(object)val11.callback).AddListener((UnityAction<BaseEventData>)delegate
				{
					ShowSlotTooltip(capture);
				});
				obj6.triggers.Add(val11);
				Entry val12 = new Entry
				{
					eventID = (EventTriggerType)1
				};
				((UnityEvent<BaseEventData>)(object)val12.callback).AddListener((UnityAction<BaseEventData>)delegate
				{
					HideTooltip();
				});
				obj6.triggers.Add(val12);
				BuildSurgePips(transform2, capture);
				BuildTempestPips(transform2, capture);
				BuildDurationTimer(transform2, capture);
				BuildWardHPBar(transform2, capture);
				BuildOverchargeBar(transform, capture);
			}
			BuildResonancePips(val.transform);
			BuildZealPips(val.transform);
			BuildJudgmentPips(val.transform);
			BuildArsenalPips(val.transform);
			BuildSiegeBolts(val.transform);
			BuildTailwindBar(val.transform);
		}

		private static void BuildSurgePips(Transform slotTransform, int slotIndex)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_0073: 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_00e9: Expected O, but got Unknown
			//IL_0116: Unknown result type (might be due to invalid IL or missing references)
			//IL_011d: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: 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_0161: Unknown result type (might be due to invalid IL or missing references)
			//IL_017a: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: 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_01c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0208: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			//IL_022f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0236: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("SurgePips");
			val.transform.SetParent(slotTransform, false);
			RectTransform obj = val.AddComponent<RectTransform>();
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0f);
			obj.anchorMax = val2;
			obj.anchorMin = val2;
			obj.pivot = new Vector2(0.5f, 1f);
			obj.anchoredPosition = new Vector2(0f, -2f);
			obj.sizeDelta = new Vector2(64f, 12f);
			val.SetActive(false);
			_surgePipRoots[slotIndex] = (GameObject[])(object)new GameObject[3];
			_surgePipFills[slotIndex] = (Image[])(object)new Image[3];
			float num = 8f;
			float num2 = 4f;
			float num3 = (0f - (3f * num + 2f * num2)) / 2f + num / 2f;
			for (int i = 0; i < 3; i++)
			{
				GameObject val3 = new GameObject($"Pip{i}");
				val3.transform.SetParent(val.transform, false);
				RectTransform obj2 = val3.AddComponent<RectTransform>();
				((Vector2)(ref val2))..ctor(0.5f, 0.5f);
				obj2.anchorMax = val2;
				obj2.anchorMin = val2;
				obj2.pivot = new Vector2(0.5f, 0.5f);
				obj2.anchoredPosition = new Vector2(num3 + (float)i * (num + num2), 0f);
				obj2.sizeDelta = new Vector2(num + 2f, num + 2f);
				((Transform)obj2).localRotation = Quaternion.Euler(0f, 0f, 45f);
				((Graphic)val3.AddComponent<Image>()).color = SurgePipBorder;
				_surgePipRoots[slotIndex][i] = val3;
				GameObject val4 = new GameObject("Bg");
				val4.transform.SetParent(val3.transform, false);
				RectTransform obj3 = val4.AddComponent<RectTransform>();
				obj3.anchorMin = Vector2.zero;
				obj3.anchorMax = Vector2.one;
				obj3.offsetMin = new Vector2(1f, 1f);
				obj3.offsetMax = new Vector2(-1f, -1f);
				((Graphic)val4.AddComponent<Image>()).color = SurgePipBg;
				GameObject val5 = new GameObject("Fill");
				val5.transform.SetParent(val3.transform, false);
				RectTransform obj4 = val5.AddComponent<RectTransform>();
				obj4.anchorMin = Vector2.zero;
				obj4.anchorMax = Vector2.one;
				obj4.offsetMin = new Vector2(1.5f, 1.5f);
				obj4.offsetMax = new Vector2(-1.5f, -1.5f);
				Image val6 = val5.AddComponent<Image>();
				((Graphic)val6).color = SurgePipFill;
				((Behaviour)val6).enabled = false;
				_surgePipFills[slotIndex][i] = val6;
			}
		}

		private static void BuildTempestPips(Transform slotTransform, int slotIndex)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Expected O, but got Unknown
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ec: Expected O, but got Unknown
			//IL_0119: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: 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_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_021b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0233: Unknown result type (might be due to invalid IL or missing references)
			//IL_023a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_025a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0281: Unknown result type (might be due to invalid IL or missing references)
			int tempestMaxStrikesPublic = AbilitySystem.TempestMaxStrikesPublic;
			GameObject val = new GameObject("TempestPips");
			val.transform.SetParent(slotTransform, false);
			RectTransform obj = val.AddComponent<RectTransform>();
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0f);
			obj.anchorMax = val2;
			obj.anchorMin = val2;
			obj.pivot = new Vector2(0.5f, 1f);
			obj.anchoredPosition = new Vector2(0f, -2f);
			obj.sizeDelta = new Vector2(64f, 12f);
			val.SetActive(false);
			_tempestPipRoots[slotIndex] = (GameObject[])(object)new GameObject[tempestMaxStrikesPublic];
			_tempestPipFills[slotIndex] = (Image[])(object)new Image[tempestMaxStrikesPublic];
			float num = 8f;
			float num2 = 4f;
			float num3 = (0f - ((float)tempestMaxStrikesPublic * num + (float)(tempestMaxStrikesPublic - 1) * num2)) / 2f + num / 2f;
			for (int i = 0; i < tempestMaxStrikesPublic; i++)
			{
				GameObject val3 = new GameObject($"Pip{i}");
				val3.transform.SetParent(val.transform, false);
				RectTransform obj2 = val3.AddComponent<RectTransform>();
				((Vector2)(ref val2))..ctor(0.5f, 0.5f);
				obj2.anchorMax = val2;
				obj2.anchorMin = val2;
				obj2.pivot = new Vector2(0.5f, 0.5f);
				obj2.anchoredPosition = new Vector2(num3 + (float)i * (num + num2), 0f);
				obj2.sizeDelta = new Vector2(num + 2f, num + 2f);
				((Transform)obj2).localRotation = Quaternion.Euler(0f, 0f, 45f);
				((Graphic)val3.AddComponent<Image>()).color = TempestPipBorder;
				_tempestPipRoots[slotIndex][i] = val3;
				GameObject val4 = new GameObject("Bg");
				val4.transform.SetParent(val3.transform, false);
				RectTransform obj3 = val4.AddComponent<RectTransform>();
				obj3.anchorMin = Vector2.zero;
				obj3.anchorMax = Vector2.one;
				obj3.offsetMin = new Vector2(1f, 1f);
				obj3.offsetMax = new Vector2(-1f, -1f);
				((Graphic)val4.AddComponent<Image>()).color = TempestPipBg;
				GameObject val5 = new GameObject("Fill");
				val5.transform.SetParent(val3.transform, false);
				RectTransform obj4 = val5.AddComponent<RectTransform>();
				obj4.anchorMin = Vector2.zero;
				obj4.anchorMax = Vector2.one;
				obj4.offsetMin = new Vector2(1.5f, 1.5f);
				obj4.offsetMax = new Vector2(-1.5f, -1.5f);
				Image val6 = val5.AddComponent<Image>();
				((Graphic)val6).color = TempestPipFill;
				((Behaviour)val6).enabled = false;
				_tempestPipFills[slotIndex][i] = val6;
			}
		}

		private static void BuildDurationTimer(Transform slotTransform, int slotIndex)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("DurationTimer");
			val.transform.SetParent(slotTransform, false);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 0f);
			obj.anchoredPosition = new Vector2(0f, 2f);
			obj.sizeDelta = new Vector2(0f, 4f);
			((Graphic)val.AddComponent<Image>()).color = new Color(0.05f, 0.05f, 0.12f, 0.8f);
			val.SetActive(false);
			_durationTimerRoots[slotIndex] = val;
			GameObject val2 = new GameObject("Fill");
			val2.transform.SetParent(val.transform, false);
			RectTransform obj2 = val2.AddComponent<RectTransform>();
			obj2.anchorMin = Vector2.zero;
			obj2.anchorMax = Vector2.one;
			obj2.offsetMin = new Vector2(1f, 1f);
			obj2.offsetMax = new Vector2(-1f, -1f);
			Image val3 = val2.AddComponent<Image>();
			((Graphic)val3).color = new Color(0.3f, 0.5f, 1f, 0.9f);
			_durationTimerFills[slotIndex] = val3;
		}

		private static void BuildWardHPBar(Transform slotTransform, int slotIndex)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("WardHP");
			val.transform.SetParent(slotTransform, false);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.anchorMin = new Vector2(0f, 1f);
			obj.anchorMax = new Vector2(1f, 1f);
			obj.pivot = new Vector2(0.5f, 0f);
			obj.anchoredPosition = new Vector2(0f, 7f);
			obj.sizeDelta = new Vector2(0f, 6f);
			((Graphic)val.AddComponent<Image>()).color = new Color(0.05f, 0.05f, 0.12f, 0.8f);
			val.SetActive(false);
			_wardHPRoots[slotIndex] = val;
			GameObject val2 = new GameObject("Fill");
			val2.transform.SetParent(val.transform, false);
			RectTransform obj2 = val2.AddComponent<RectTransform>();
			obj2.anchorMin = Vector2.zero;
			obj2.anchorMax = Vector2.one;
			obj2.offsetMin = new Vector2(1f, 1f);
			obj2.offsetMax = new Vector2(-1f, -1f);
			Image val3 = val2.AddComponent<Image>();
			((Graphic)val3).color = new Color(0.3f, 0.6f, 1f, 0.95f);
			_wardHPFills[slotIndex] = val3;
		}

		private static void BuildOverchargeBar(Transform barTransform, int slotIndex)
		{
			//IL_0014: Unknown result type (might be due to invalid