Decompiled source of Nivalis Hacks v1.0.0

XenoBreach.dll

Decompiled 2 hours ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Core.Logging.Interpolation;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using HarmonyLib;
using Il2CppInterop.Runtime;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Microsoft.CodeAnalysis;
using Nivalis;
using Nivalis.GhostSystem.Ai;
using Nivalis.GhostSystem.CustomerLoop;
using Nivalis.InventorySystem;
using Nivalis.Locale;
using TMPro;
using UnityEngine;
using UnityEngine.InputSystem;
using UnityEngine.InputSystem.Controls;
using UnityEngine.InputSystem.Utilities;
using UnityEngine.Rendering;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
[assembly: AssemblyCompany("XenoBreach")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("XenoBreach")]
[assembly: AssemblyTitle("XenoBreach")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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 XenoBreach
{
	internal static class AccessKey
	{
		public static int Due;

		public static bool Burned => Due > 0;

		private static int Base => Mathf.Max(1, Plugin.KeyCost.Value);

		public static string Prompt => $"<color=#FF4740>ACCESS KEY BURNED</color>  ·  NEW KEY ${Due:N0}";

		public static void Burn(int flagged)
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			Due = (Base << Mathf.Clamp(flagged, 0, 5)) / ((!Shop.Has("cap1")) ? 1 : 2);
			ManualLogSource l = Plugin.L;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(51, 2, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[key] burned, new key $");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(Due);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(flagged);
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" venue(s) already flagged)");
			}
			l.LogInfo(val);
		}

		public static string Buy()
		{
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: Expected O, but got Unknown
			if (!Burned)
			{
				return "NO|Your key works fine.";
			}
			int num = Due * 100;
			int num2 = 0;
			try
			{
				PlayerInventory inventory = S.Get<PlayerManager>().LocalPlayer.Inventory;
				num2 = inventory.Money;
				if (num2 < num)
				{
					return $"NO|A new key is ${Due:N0}. You have ${num2 / 100:N0}.";
				}
				inventory.ChangeMoneyWithoutReceipt(-num);
				if (inventory.Money == num2)
				{
					inventory.TakeMoney(num);
				}
				if (inventory.Money >= num2)
				{
					return "NO|The payment didn't go through.";
				}
			}
			catch (Exception ex)
			{
				return "NO|" + ex.Message;
			}
			int due = Due;
			Due = 0;
			ManualLogSource l = Plugin.L;
			bool flag = default(bool);
			BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(26, 1, ref flag);
			if (flag)
			{
				((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[key] new key bought for $");
				((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(due);
			}
			l.LogInfo(val);
			Synth.Play(Synth.Granted, 0.6f);
			return $"OK|New access key generated for ${due:N0}. You're back in.";
		}
	}
	internal static class Bridge
	{
		private static bool _looked;

		private static FieldInfo _phoneOpen;

		private static FieldInfo _venueBanner;

		private static MethodInfo _notify;

		private static MethodInfo _text;

		private static readonly List<InputAction> _blocked = new List<InputAction>();

		private static PlayerObjectHolder _holder;

		private static float _nextHolder;

		public static bool PhoneOpen
		{
			get
			{
				Look();
				try
				{
					return _phoneOpen != null && (bool)_phoneOpen.GetValue(null);
				}
				catch
				{
					return false;
				}
			}
		}

		public static bool HoldingObject
		{
			get
			{
				try
				{
					if ((Object)(object)_holder == (Object)null && Time.unscaledTime >= _nextHolder)
					{
						_nextHolder = Time.unscaledTime + 2f;
						Object obj = Object.FindObjectOfType(Il2CppType.Of<PlayerObjectHolder>());
						_holder = ((obj != null) ? ((Il2CppObjectBase)obj).TryCast<PlayerObjectHolder>() : null);
					}
					return (Object)(object)_holder != (Object)null && _holder.IsHoldingObject;
				}
				catch
				{
					return false;
				}
			}
		}

		public static bool GameUiOpen
		{
			get
			{
				try
				{
					UIManager val = S.Get<UIManager>();
					return (Object)(object)val != (Object)null && val.IsPointerRequired;
				}
				catch
				{
					return false;
				}
			}
		}

		private static void Look()
		{
			//IL_014e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0154: Expected O, but got Unknown
			if (_looked)
			{
				return;
			}
			_looked = true;
			try
			{
				Assembly assembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault((Assembly a) => a.GetName().Name == "NivalisPhone");
				if (assembly == null)
				{
					Plugin.L.LogInfo((object)"[bridge] Nivalis Phone not found: alerts show on screen only");
					return;
				}
				_phoneOpen = assembly.GetType("NivalisPhone.PhoneUI")?.GetField("IsOpen", BindingFlags.Static | BindingFlags.Public);
				_venueBanner = assembly.GetType("NivalisPhone.PhoneApi")?.GetField("VenueBanner", BindingFlags.Static | BindingFlags.Public);
				_notify = assembly.GetType("NivalisPhone.Notify")?.GetMethod("Push", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic, null, new Type[4]
				{
					typeof(string),
					typeof(string),
					typeof(string),
					typeof(Color)
				}, null);
				_text = assembly.GetType("NivalisPhone.PhoneApi")?.GetMethod("Text", BindingFlags.Static | BindingFlags.Public, null, new Type[2]
				{
					typeof(string),
					typeof(string[])
				}, null);
				ManualLogSource l = Plugin.L;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(64, 3, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[bridge] phone found: open-state ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(_phoneOpen != null);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", notifications ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(_notify != null);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", venue banner ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<bool>(_venueBanner != null);
				}
				l.LogInfo(val);
			}
			catch (Exception ex)
			{
				Plugin.L.LogWarning((object)("Phone link: " + ex.Message));
			}
		}

		public static void Notify(string app, string title, string body, Color c)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			Look();
			try
			{
				_notify?.Invoke(null, new object[4] { app, title, body, c });
			}
			catch
			{
			}
		}

		public static bool Text(string from, string[] lines)
		{
			Look();
			if (_text == null)
			{
				return false;
			}
			try
			{
				_text.Invoke(null, new object[2] { from, lines });
				return true;
			}
			catch (Exception ex)
			{
				Plugin.L.LogWarning((object)("Phone text: " + ex.Message));
				return false;
			}
		}

		public static void VenueBanner(string s)
		{
			Look();
			try
			{
				if (_venueBanner != null && (string)_venueBanner.GetValue(null) != s)
				{
					_venueBanner.SetValue(null, s);
				}
			}
			catch
			{
			}
		}

		public static void Block(bool on, bool full)
		{
			Unblock();
			if (!on)
			{
				return;
			}
			try
			{
				PlayerInputManager obj = S.Get<PlayerInputManager>();
				GameControls val = ((obj != null) ? obj.Input : null);
				if (val == null)
				{
					return;
				}
				List<InputAction> list = new List<InputAction>();
				if (full)
				{
					list.AddRange((IEnumerable<InputAction>)(object)new InputAction[16]
					{
						val.m_GameplayControls_Move, val.m_GameplayControls_Look, val.m_GameplayControls_Sprint, val.m_GameplayControls_InGameMenu, val.m_GameplayControls_Pause, val.m_GameplayControls_Inventory, val.m_GameplayControls_Journal, val.m_GameplayControls_Map, val.m_GameplayControls_ShoppingList, val.m_GameplayControls_PlacementMode,
						val.m_GameplayControls_Interact, val.m_GameplayControls_PickUp, val.m_GameplayControls_Place, val.m_GameplayControls_Throw, val.m_GameplayControls_Store, val.m_GameplayControls_ShowMore
					});
				}
				foreach (InputAction item in list)
				{
					if (item != null && item.enabled)
					{
						item.Disable();
						_blocked.Add(item);
					}
				}
			}
			catch (Exception ex)
			{
				Plugin.L.LogWarning((object)("Input block: " + ex.Message));
			}
		}

		public static void Unblock()
		{
			foreach (InputAction item in _blocked)
			{
				try
				{
					item.Enable();
				}
				catch
				{
				}
			}
			_blocked.Clear();
		}

		public static void LogBindings()
		{
			try
			{
				PlayerInputManager obj = S.Get<PlayerInputManager>();
				GameControls val = ((obj != null) ? obj.Input : null);
				if (val == null)
				{
					return;
				}
				(string, InputAction)[] array = new(string, InputAction)[6]
				{
					("Scan", val.m_GameplayControls_Scan),
					("Store", val.m_GameplayControls_Store),
					("PickUp", val.m_GameplayControls_PickUp),
					("Interact", val.m_GameplayControls_Interact),
					("Throw", val.m_GameplayControls_Throw),
					("Place", val.m_GameplayControls_Place)
				};
				for (int i = 0; i < array.Length; i++)
				{
					var (text, val2) = array[i];
					if (val2 != null)
					{
						ReadOnlyArray<InputBinding> bindings = val2.bindings;
						List<string> list = new List<string>();
						for (int j = 0; j < bindings.Count; j++)
						{
							list.Add(bindings[j].effectivePath);
						}
						Plugin.L.LogInfo((object)("[bridge] game '" + text + "' is bound to: " + string.Join(", ", list)));
					}
				}
			}
			catch
			{
			}
		}
	}
	internal static class ComboScreen
	{
		private enum Phase
		{
			Boot,
			Count,
			Play,
			Won,
			Lost
		}

		private class Arrow
		{
			public int Dir;

			public int Col;

			public Vector2 P;

			public Vector2 V;

			public bool Popped;

			public float PoppedAt;

			public RectTransform R;

			public Image Glow;

			public Image Rim;

			public Image Cap;

			public Image A;

			public Image B;

			public RectTransform Icon;
		}

		private const float W = 660f;

		private const float H = 540f;

		private const float ArenaX = 34f;

		private const float ArenaY = 92f;

		private const float ArenaW = 592f;

		private const float ArenaH = 300f;

		private const float Tok = 54f;

		private static readonly int[] TierLen = new int[4] { 8, 9, 10, 12 };

		private static readonly float[] TierTime = new float[4] { 0f, 0.3f, 0.6f, 1f };

		private static readonly float[] TierSpeed = new float[4] { 1f, 1.1f, 1.22f, 1.38f };

		private const float SearchBonus = 1f;

		private static int _tier;

		private static int Len = 8;

		private static RectTransform _holder;

		private static RectTransform _root;

		private static RectTransform _main;

		private static RectTransform _boot;

		private static RectTransform _arena;

		private static TextMeshProUGUI _count;

		private static TextMeshProUGUI _status;

		private static TextMeshProUGUI _bootText;

		private static TextMeshProUGUI _cash;

		private static TextMeshProUGUI _timeTxt;

		private static TextMeshProUGUI _leftTxt;

		private static TextMeshProUGUI _hexTxt;

		private static Image _timer;

		private static Image _flash;

		private static Image _arenaFrame;

		private static Image _arenaGlow;

		private static readonly List<Arrow> _arrows = new List<Arrow>();

		private static readonly List<(Image img, float at, Color c)> _bursts = new List<(Image, float, Color)>();

		private static int _popped;

		private static int _payout;

		private static bool _forgiven;

		private static float _phaseAt;

		private static float _startPlay;

		private static float _hexAt;

		private static Phase _phase;

		private static Target _t;

		private static Color G => Fx.G;

		private static float TimeLimit => Mathf.Max(1f, Plugin.ComboSeconds.Value + TierTime[_tier] + 1f + (Shop.Has("ppl1") ? 1f : 0f));

		public static bool IsOpen => (Object)(object)_holder != (Object)null;

		public static void Open(Target t)
		{
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0191: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Expected O, but got Unknown
			if (!((Object)(object)_holder != (Object)null) && !((Object)(object)Scan.Root == (Object)null) && (Practice.Is(t) || Loot.Available(t)))
			{
				_t = t;
				if (!Practice.Is(t))
				{
					Loot.Use(t);
				}
				_tier = Mathf.Clamp(Rarity.Of(t), 0, 3);
				Len = TierLen[_tier];
				_arrows.Clear();
				_bursts.Clear();
				_popped = 0;
				_forgiven = false;
				try
				{
					_holder = Ui.Rect("XB_ComboHolder", (Transform)(object)Scan.Root);
					Ui.Stretch(_holder);
					_root = Fx.Panel(_holder, "XB_Combo", 660f, 540f);
					Build();
					Fx.Crt(_root);
					_count = Fx.Countdown(_root);
					_flash = Ui.Img((Transform)(object)_root, "Flash", new Color(1f, 1f, 1f, 0f));
					Ui.Stretch(((Graphic)_flash).rectTransform);
				}
				catch (Exception ex)
				{
					Plugin.L.LogError((object)("Combo build failed: " + ex));
					Close();
					return;
				}
				Bridge.Block(on: true, full: true);
				SetPhase(Phase.Boot);
				Synth.Play(Synth.Glitch, 0.6f);
				ManualLogSource l = Plugin.L;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(27, 2, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[people] skim on ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(t.Who);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(Len);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" arrows)");
				}
				l.LogInfo(val);
			}
		}

		private static TextMeshProUGUI Txt(Transform p, string s, float size, Color c, TextAlignmentOptions a = (TextAlignmentOptions)514)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return Ui.Text(p, s, size, c, a);
		}

		private static void Build()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_011e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_0192: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ef: 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_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_027a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0289: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0300: Unknown result type (might be due to invalid IL or missing references)
			//IL_0342: 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_0427: Unknown result type (might be due to invalid IL or missing references)
			//IL_0468: Unknown result type (might be due to invalid IL or missing references)
			//IL_0472: Unknown result type (might be due to invalid IL or missing references)
			//IL_047c: Unknown result type (might be due to invalid IL or missing references)
			//IL_048b: Unknown result type (might be due to invalid IL or missing references)
			//IL_04d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_04e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_04f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0549: Unknown result type (might be due to invalid IL or missing references)
			//IL_0587: Unknown result type (might be due to invalid IL or missing references)
			//IL_0591: Unknown result type (might be due to invalid IL or missing references)
			//IL_059b: Unknown result type (might be due to invalid IL or missing references)
			//IL_05aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_05f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0600: Unknown result type (might be due to invalid IL or missing references)
			//IL_060a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0619: Unknown result type (might be due to invalid IL or missing references)
			//IL_0661: Unknown result type (might be due to invalid IL or missing references)
			//IL_066b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0675: Unknown result type (might be due to invalid IL or missing references)
			//IL_0684: Unknown result type (might be due to invalid IL or missing references)
			//IL_073d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0774: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c67: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c71: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c80: Unknown result type (might be due to invalid IL or missing references)
			//IL_0caf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cc9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cdf: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ce9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d4a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da1: Unknown result type (might be due to invalid IL or missing references)
			//IL_083a: Unknown result type (might be due to invalid IL or missing references)
			//IL_083f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0880: Unknown result type (might be due to invalid IL or missing references)
			//IL_0886: Unknown result type (might be due to invalid IL or missing references)
			//IL_089a: Unknown result type (might be due to invalid IL or missing references)
			//IL_089f: Unknown result type (might be due to invalid IL or missing references)
			//IL_08d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_08e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_08f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0909: Unknown result type (might be due to invalid IL or missing references)
			//IL_0913: Unknown result type (might be due to invalid IL or missing references)
			//IL_092b: Unknown result type (might be due to invalid IL or missing references)
			//IL_097e: Unknown result type (might be due to invalid IL or missing references)
			//IL_09c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a19: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a33: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a3e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a49: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a56: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a99: Unknown result type (might be due to invalid IL or missing references)
			//IL_0aa0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ab8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ad0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0af6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b24: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b62: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b77: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b90: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e01: Unknown result type (might be due to invalid IL or missing references)
			_boot = Ui.Rect("Boot", (Transform)(object)_root);
			Ui.Stretch(_boot);
			TextMeshProUGUI obj = Txt((Transform)(object)_boot, "XENO", 56f, G, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)obj).rectTransform, 0f, 170f, 660f, 66f);
			((TMP_Text)obj).characterSpacing = 22f;
			_bootText = Txt((Transform)(object)_boot, "", 13f, Fx.GMid, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)_bootText).rectTransform, 0f, 250f, 660f, 60f);
			_main = Ui.Rect("Main", (Transform)(object)_root);
			Ui.Stretch(_main);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "HeadBar", new Color(G.r, G.g, G.b, 0.08f))).rectTransform, 0f, 0f, 660f, 46f);
			TextMeshProUGUI obj2 = Txt((Transform)(object)_main, "XENO  //  WALLET SKIM", 17f, G, (TextAlignmentOptions)4097);
			Ui.PlaceTL(((TMP_Text)obj2).rectTransform, 24f, 0f, 300f, 46f);
			((TMP_Text)obj2).characterSpacing = 3f;
			Color val = Rarity.ColorOf(_t);
			Ui.PlaceTL(((TMP_Text)Txt((Transform)(object)_main, $"MARK  {_t.Who}  ·  {_t.Age}  ·  <color={Fx.Hex(val)}>{Rarity.NameOf(_t)}</color>", 13f, Fx.GMid, (TextAlignmentOptions)4100)).rectTransform, 276f, 0f, 360f, 46f);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Rule", new Color(G.r, G.g, G.b, 0.5f))).rectTransform, 0f, 46f, 660f, 1f);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Accent", val)).rectTransform, 0f, 46f, 160f, 3f);
			Image obj3 = Ui.Img((Transform)(object)_main, "AccentGlow", new Color(val.r, val.g, val.b, 0.35f));
			obj3.sprite = Fx.Soft;
			Ui.PlaceTL(((Graphic)obj3).rectTransform, -20f, 34f, 200f, 26f);
			_hexTxt = Txt((Transform)(object)_main, "", 10f, Fx.GDim, (TextAlignmentOptions)257);
			Ui.PlaceTL(((TMP_Text)_hexTxt).rectTransform, 24f, 54f, 612f, 14f);
			Ui.PlaceTL(((TMP_Text)Txt((Transform)(object)_main, $"{_t.Group}  ·  EST. TAKE ${People.Lo(_t)}-{People.Hi(_t)}  ·  POP EVERY ARROW, ANY ORDER", 11f, Fx.GMid, (TextAlignmentOptions)4097)).rectTransform, 34f, 68f, 472f, 18f);
			_leftTxt = Txt((Transform)(object)_main, "", 13f, G, (TextAlignmentOptions)4100);
			Ui.PlaceTL(((TMP_Text)_leftTxt).rectTransform, 486f, 66f, 140f, 22f);
			_arenaGlow = Ui.Img((Transform)(object)_main, "ArenaGlow", new Color(G.r, G.g, G.b, 0.1f));
			_arenaGlow.sprite = Fx.Soft;
			Ui.PlaceTL(((Graphic)_arenaGlow).rectTransform, 8f, 66f, 644f, 352f);
			_arenaFrame = Ui.Img((Transform)(object)_main, "ArenaFrame", new Color(G.r, G.g, G.b, 0.55f));
			Ui.PlaceTL(((Graphic)_arenaFrame).rectTransform, 31f, 89f, 598f, 306f);
			Image val2 = Ui.Img((Transform)(object)_main, "Arena", new Color(0.01f, 0.03f, 0.02f, 1f));
			Ui.PlaceTL(((Graphic)val2).rectTransform, 34f, 92f, 592f, 300f);
			for (float num = 37f; num < 592f; num += 37f)
			{
				Ui.PlaceTL(((Graphic)Ui.Img(((Component)val2).transform, "Grid", new Color(G.r, G.g, G.b, 0.05f))).rectTransform, num, 0f, 1f, 300f);
			}
			for (float num2 = 37.5f; num2 < 300f; num2 += 37.5f)
			{
				Ui.PlaceTL(((Graphic)Ui.Img(((Component)val2).transform, "Grid", new Color(G.r, G.g, G.b, 0.05f))).rectTransform, 0f, num2, 592f, 1f);
			}
			Ui.Stretch(((TMP_Text)Txt(((Component)val2).transform, "+", 28f, new Color(G.r, G.g, G.b, 0.12f), (TextAlignmentOptions)514)).rectTransform);
			(int, int)[] array = new(int, int)[4]
			{
				(0, 0),
				(1, 0),
				(0, 1),
				(1, 1)
			};
			for (int i = 0; i < array.Length; i++)
			{
				(int, int) tuple = array[i];
				int item = tuple.Item1;
				int item2 = tuple.Item2;
				float num3 = 23f + (float)item * 598f;
				float num4 = 81f + (float)item2 * 306f;
				Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Brk", G)).rectTransform, num3, num4 + (float)((item2 != 0) ? 14 : 0), 16f, 2f);
				Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Brk", G)).rectTransform, num3 + (float)((item != 0) ? 14 : 0), num4, 2f, 16f);
			}
			_arena = ((Graphic)val2).rectTransform;
			float num5 = 105f * TierSpeed[_tier] * (Shop.Has("ppl4") ? 0.75f : 1f);
			Vector2 val3 = default(Vector2);
			for (int j = 0; j < Len; j++)
			{
				Arrow arrow = new Arrow
				{
					Dir = ((j < 4) ? j : Random.Range(0, 4)),
					Col = Random.Range(0, 5)
				};
				arrow.P = new Vector2(Random.Range(54f, 538f), Random.Range(54f, 246f));
				float num6 = Random.Range(20f, 70f) * ((float)Math.PI / 180f) + (float)Random.Range(0, 4) * (float)Math.PI / 2f;
				arrow.V = new Vector2(Mathf.Cos(num6), Mathf.Sin(num6)) * num5 * Random.Range(0.85f, 1.15f);
				arrow.R = Ui.Rect("Arrow", (Transform)(object)_arena);
				RectTransform r = arrow.R;
				RectTransform r2 = arrow.R;
				((Vector2)(ref val3))..ctor(0f, 1f);
				r2.anchorMax = val3;
				r.anchorMin = val3;
				arrow.R.pivot = new Vector2(0.5f, 0.5f);
				arrow.R.sizeDelta = Vector2.one * 54f;
				arrow.Glow = Ui.Img((Transform)(object)arrow.R, "Glow", Color.clear);
				arrow.Glow.sprite = Fx.Soft;
				Ui.Stretch(((Graphic)arrow.Glow).rectTransform, -22f, -22f, -22f, -22f);
				arrow.Rim = Ui.Img((Transform)(object)arrow.R, "Rim", Color.white);
				Ui.Stretch(((Graphic)arrow.Rim).rectTransform);
				arrow.Cap = Ui.Img((Transform)(object)arrow.R, "Cap", Color.black);
				Ui.Stretch(((Graphic)arrow.Cap).rectTransform, 3f, 3f, 3f, 3f);
				RectTransform rectTransform = ((Graphic)Ui.Img(((Component)arrow.Cap).transform, "Shine", new Color(1f, 1f, 1f, 0.08f))).rectTransform;
				rectTransform.anchorMin = new Vector2(0f, 0.55f);
				rectTransform.anchorMax = Vector2.one;
				val3 = (rectTransform.offsetMin = (rectTransform.offsetMax = Vector2.zero));
				arrow.Icon = Ui.Rect("Icon", ((Component)arrow.Cap).transform);
				RectTransform icon = arrow.Icon;
				RectTransform icon2 = arrow.Icon;
				((Vector2)(ref val3))..ctor(0.5f, 0.5f);
				icon2.anchorMax = val3;
				icon.anchorMin = val3;
				arrow.Icon.sizeDelta = new Vector2(40f, 40f);
				arrow.A = Ui.Img((Transform)(object)arrow.Icon, "A", Color.white);
				RectTransform rectTransform2 = ((Graphic)arrow.A).rectTransform;
				rectTransform2.sizeDelta = new Vector2(24f, 6f);
				rectTransform2.anchoredPosition = new Vector2(-7f, 3f);
				((Transform)rectTransform2).localEulerAngles = new Vector3(0f, 0f, 45f);
				arrow.B = Ui.Img((Transform)(object)arrow.Icon, "B", Color.white);
				RectTransform rectTransform3 = ((Graphic)arrow.B).rectTransform;
				rectTransform3.sizeDelta = new Vector2(24f, 6f);
				rectTransform3.anchoredPosition = new Vector2(7f, 3f);
				((Transform)rectTransform3).localEulerAngles = new Vector3(0f, 0f, -45f);
				((Transform)arrow.Icon).localEulerAngles = new Vector3(0f, 0f, (float)arrow.Dir * 90f);
				Ui.Stretch(((TMP_Text)Txt(((Component)arrow.Cap).transform, "WASD"[arrow.Dir].ToString(), 9f, new Color(1f, 1f, 1f, 0.45f), (TextAlignmentOptions)1028)).rectTransform, 0f, 0f, 4f, 2f);
				_arrows.Add(arrow);
			}
			float num7 = 410f;
			Image obj4 = Ui.Img((Transform)(object)_main, "Track", new Color(G.r, G.g, G.b, 0.1f));
			Ui.PlaceTL(((Graphic)obj4).rectTransform, 34f, num7, 512f, 10f);
			_timer = Ui.Img(((Component)obj4).transform, "Fill", G);
			RectTransform rectTransform4 = ((Graphic)_timer).rectTransform;
			rectTransform4.anchorMin = Vector2.zero;
			rectTransform4.anchorMax = Vector2.one;
			rectTransform4.offsetMin = Vector2.zero;
			rectTransform4.offsetMax = Vector2.zero;
			_timeTxt = Txt((Transform)(object)_main, "", 14f, G, (TextAlignmentOptions)4100);
			Ui.PlaceTL(((TMP_Text)_timeTxt).rectTransform, 550f, num7 - 6f, 76f, 22f);
			_status = Txt((Transform)(object)_main, "", 18f, G, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)_status).rectTransform, 0f, num7 + 22f, 660f, 26f);
			((TMP_Text)_status).characterSpacing = 3f;
			_cash = Txt((Transform)(object)_main, "", 36f, G, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)_cash).rectTransform, 0f, num7 + 50f, 660f, 46f);
			TextMeshProUGUI obj5 = Txt((Transform)(object)_main, (Pad.Using ? "D-PAD  OR  Y X A B" : "W / A / S / D  OR  ARROW KEYS") + "  ·  NO ARROW LEFT FOR THAT KEY = THEY NOTICE", 11f, Fx.GMid, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)obj5).rectTransform, 0f, 510f, 660f, 18f);
			((TMP_Text)obj5).characterSpacing = 2f;
			((Component)_main).gameObject.SetActive(false);
			Paint(0f);
		}

		private static void SetPhase(Phase p)
		{
			_phase = p;
			_phaseAt = Time.unscaledTime;
		}

		private static int Pressed(Keyboard kb)
		{
			if (((ButtonControl)kb[(Key)37]).wasPressedThisFrame || ((ButtonControl)kb[(Key)63]).wasPressedThisFrame)
			{
				return 0;
			}
			if (((ButtonControl)kb[(Key)15]).wasPressedThisFrame || ((ButtonControl)kb[(Key)61]).wasPressedThisFrame)
			{
				return 1;
			}
			if (((ButtonControl)kb[(Key)33]).wasPressedThisFrame || ((ButtonControl)kb[(Key)64]).wasPressedThisFrame)
			{
				return 2;
			}
			if (((ButtonControl)kb[(Key)18]).wasPressedThisFrame || ((ButtonControl)kb[(Key)62]).wasPressedThisFrame)
			{
				return 3;
			}
			int num = Pad.Dir();
			if (num >= 0)
			{
				return num;
			}
			return Pad.Face();
		}

		private static void Move(float dt)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_019f: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0245: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: 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_025b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0263: 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_026a: Unknown result type (might be due to invalid IL or missing references)
			//IL_026f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0209: 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_0215: Unknown result type (might be due to invalid IL or missing references)
			//IL_021d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0224: 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_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			float num = 27f;
			foreach (Arrow arrow3 in _arrows)
			{
				if (!arrow3.Popped)
				{
					arrow3.P += arrow3.V * dt;
					if (arrow3.P.x < num)
					{
						arrow3.P.x = num;
						arrow3.V.x = Mathf.Abs(arrow3.V.x);
					}
					if (arrow3.P.x > 592f - num)
					{
						arrow3.P.x = 592f - num;
						arrow3.V.x = 0f - Mathf.Abs(arrow3.V.x);
					}
					if (arrow3.P.y < num)
					{
						arrow3.P.y = num;
						arrow3.V.y = Mathf.Abs(arrow3.V.y);
					}
					if (arrow3.P.y > 300f - num)
					{
						arrow3.P.y = 300f - num;
						arrow3.V.y = 0f - Mathf.Abs(arrow3.V.y);
					}
				}
			}
			float num2 = 51.3f;
			for (int i = 0; i < _arrows.Count; i++)
			{
				Arrow arrow = _arrows[i];
				if (arrow.Popped)
				{
					continue;
				}
				for (int j = i + 1; j < _arrows.Count; j++)
				{
					Arrow arrow2 = _arrows[j];
					if (arrow2.Popped)
					{
						continue;
					}
					Vector2 val = arrow2.P - arrow.P;
					float magnitude = ((Vector2)(ref val)).magnitude;
					if (!(magnitude >= num2) && !(magnitude < 0.001f))
					{
						Vector2 val2 = val / magnitude;
						float num3 = Vector2.Dot(arrow.V - arrow2.V, val2);
						if (num3 > 0f)
						{
							arrow.V -= num3 * val2;
							arrow2.V += num3 * val2;
						}
						Vector2 val3 = val2 * (num2 - magnitude) * 0.5f;
						arrow.P -= val3;
						arrow2.P += val3;
					}
				}
			}
		}

		private static void Paint(float dt)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: 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_0397: Unknown result type (might be due to invalid IL or missing references)
			//IL_0389: Unknown result type (might be due to invalid IL or missing references)
			//IL_013d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0171: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: 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_02a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02db: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_039c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_018f: Unknown result type (might be due to invalid IL or missing references)
			//IL_019b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019c: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			float unscaledTime = Time.unscaledTime;
			foreach (Arrow arrow in _arrows)
			{
				arrow.R.anchoredPosition = new Vector2(arrow.P.x, 0f - arrow.P.y);
				Color val = ((_phase == Phase.Won) ? Fx.OlyCycle(unscaledTime * 3f + (float)arrow.Col) : Fx.Oly(arrow.Col));
				if (arrow.Popped)
				{
					float num = Mathf.Clamp01((unscaledTime - arrow.PoppedAt) / 0.25f);
					((Transform)arrow.R).localScale = Vector3.one * (1.35f - 0.35f * num);
					((Graphic)arrow.Cap).color = val;
					((Graphic)arrow.Rim).color = Color.Lerp(Color.white, val, num);
					Image a = arrow.A;
					Color color = (((Graphic)arrow.B).color = Color.white);
					((Graphic)a).color = color;
					((Graphic)arrow.Glow).color = new Color(val.r, val.g, val.b, (_phase == Phase.Won) ? 0.8f : 0.55f);
				}
				else
				{
					((Transform)arrow.R).localScale = Vector3.one;
					((Graphic)arrow.Rim).color = G;
					((Graphic)arrow.Cap).color = new Color(0.02f, 0.09f, 0.04f, 1f);
					Image a2 = arrow.A;
					Color color = (((Graphic)arrow.B).color = ((_phase == Phase.Lost) ? Fx.Bad : G));
					((Graphic)a2).color = color;
					((Graphic)arrow.Glow).color = new Color(G.r, G.g, G.b, 0.22f + 0.08f * Mathf.Sin(unscaledTime * 8f + arrow.P.x * 0.05f));
				}
			}
			for (int num2 = _bursts.Count - 1; num2 >= 0; num2--)
			{
				(Image img, float at, Color c) tuple = _bursts[num2];
				Image item = tuple.img;
				float item2 = tuple.at;
				Color item3 = tuple.c;
				float num3 = (unscaledTime - item2) / 0.45f;
				if (num3 >= 1f || (Object)(object)item == (Object)null)
				{
					try
					{
						if ((Object)(object)item != (Object)null)
						{
							Object.Destroy((Object)(object)((Component)item).gameObject);
						}
					}
					catch
					{
					}
					_bursts.RemoveAt(num2);
				}
				else
				{
					((Graphic)item).rectTransform.sizeDelta = Vector2.one * 54f * (1f + 2.2f * num3);
					((Graphic)item).color = new Color(item3.r, item3.g, item3.b, 0.7f * (1f - num3));
				}
			}
			((TMP_Text)_leftTxt).text = $"<color={Fx.Hex(Fx.Oly(_popped))}>{_popped}</color> / {Len} POPPED";
			Color val3 = ((_phase == Phase.Won) ? Fx.OlyCycle(unscaledTime * 3f) : G);
			((Graphic)_arenaFrame).color = new Color(val3.r, val3.g, val3.b, 0.55f);
			((Graphic)_arenaGlow).color = new Color(val3.r, val3.g, val3.b, (_phase == Phase.Won) ? 0.3f : 0.1f);
		}

		private static void Pop(Arrow a)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: 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)
			a.Popped = true;
			a.PoppedAt = Time.unscaledTime;
			a.Col = _popped % 5;
			((Transform)a.R).SetAsLastSibling();
			Color val = Fx.Oly(a.Col);
			Image val2 = Ui.Img((Transform)(object)_arena, "Burst", val);
			val2.sprite = Fx.Soft;
			RectTransform rectTransform = ((Graphic)val2).rectTransform;
			Vector2 val3 = default(Vector2);
			((Vector2)(ref val3))..ctor(0f, 1f);
			rectTransform.anchorMax = val3;
			rectTransform.anchorMin = val3;
			rectTransform.pivot = new Vector2(0.5f, 0.5f);
			rectTransform.anchoredPosition = a.R.anchoredPosition;
			rectTransform.sizeDelta = Vector2.one * 54f;
			_bursts.Add((val2, Time.unscaledTime, val));
			_popped++;
			if (_popped < Len)
			{
				Synth.Play(Synth.Piano[Mathf.Min(_popped - 1, Synth.Piano.Length - 1)], 0.9f);
			}
			((Graphic)_flash).color = new Color(val.r, val.g, val.b, 0.08f);
		}

		public static void Tick()
		{
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0252: Unknown result type (might be due to invalid IL or missing references)
			//IL_0261: Unknown result type (might be due to invalid IL or missing references)
			//IL_0266: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0292: Unknown result type (might be due to invalid IL or missing references)
			//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0578: Unknown result type (might be due to invalid IL or missing references)
			//IL_05a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_05ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_05bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_059c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0431: Unknown result type (might be due to invalid IL or missing references)
			//IL_0454: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_holder == (Object)null)
			{
				return;
			}
			Fx.CrtTick(_root);
			if (((Graphic)_flash).color.a > 0f)
			{
				Color color = ((Graphic)_flash).color;
				color.a = Mathf.Max(0f, color.a - Time.unscaledDeltaTime * 1.5f);
				((Graphic)_flash).color = color;
			}
			if (Time.unscaledTime > _hexAt && (Object)(object)_hexTxt != (Object)null)
			{
				_hexAt = Time.unscaledTime + 0.12f;
				StringBuilder stringBuilder = new StringBuilder();
				for (int i = 0; i < 20; i++)
				{
					stringBuilder.Append(Random.Range(0, 256).ToString("X2")).Append(' ');
				}
				((TMP_Text)_hexTxt).text = stringBuilder.ToString();
			}
			float num = Time.unscaledTime - _phaseAt;
			float unscaledDeltaTime = Time.unscaledDeltaTime;
			Keyboard current = Keyboard.current;
			switch (_phase)
			{
			case Phase.Boot:
				((TMP_Text)_bootText).text = ((num < 0.25f) ? "pinging device ..." : ((num < 0.5f) ? "pinging device ... found\nopening wallet session ..." : "pinging device ... found\nopening wallet session ... ok\nhandshake keys loose"));
				if (num > 0.8f)
				{
					((Component)_boot).gameObject.SetActive(false);
					((Component)_main).gameObject.SetActive(true);
					SetPhase(Phase.Count);
				}
				break;
			case Phase.Count:
			{
				int num5 = Mathf.CeilToInt(3f - (num - unscaledDeltaTime));
				int num6 = Mathf.CeilToInt(3f - num);
				if (num6 != num5 && num6 >= 0)
				{
					Synth.Play((num6 == 0) ? Synth.Exec : Synth.Key, 0.8f);
				}
				((TMP_Text)_status).text = "GET READY";
				((Graphic)_status).color = Fx.GMid;
				Move(unscaledDeltaTime * 0.35f);
				Paint(unscaledDeltaTime);
				if (Fx.CountdownTick(_count, num))
				{
					SetPhase(Phase.Play);
					_startPlay = Time.unscaledTime;
					((TMP_Text)_status).text = "";
				}
				break;
			}
			case Phase.Play:
			{
				float num3 = TimeLimit - (Time.unscaledTime - _startPlay);
				((Graphic)_timer).rectTransform.anchorMax = new Vector2(Mathf.Clamp01(num3 / TimeLimit), 1f);
				((Graphic)_timer).color = Color.Lerp(Fx.Bad, G, Mathf.Clamp01(num3 / TimeLimit * 1.6f));
				((Graphic)_timeTxt).color = ((Graphic)_timer).color;
				((TMP_Text)_timeTxt).text = $"{Mathf.Max(0f, num3):0.00}s";
				Move(unscaledDeltaTime);
				if (num3 <= 0f)
				{
					Fail("TOO SLOW  -  THEY NOTICED");
					Paint(unscaledDeltaTime);
					break;
				}
				if (current != null || Gamepad.current != null)
				{
					int num4 = ((current != null) ? Pressed(current) : Pad.Dir());
					if (num4 >= 0)
					{
						Arrow arrow = null;
						foreach (Arrow arrow2 in _arrows)
						{
							if (!arrow2.Popped && arrow2.Dir == num4)
							{
								arrow = arrow2;
								break;
							}
						}
						if (arrow != null)
						{
							Pop(arrow);
							if (_popped >= Len)
							{
								_payout = Loot.Roll(_t);
								((TMP_Text)_status).text = "WALLET OPEN  -  TRANSFERRING";
								((Graphic)_status).color = G;
								((Graphic)_flash).color = new Color(1f, 1f, 1f, 0.25f);
								Synth.Play(Synth.PianoRun);
								SetPhase(Phase.Won);
							}
						}
						else if (Shop.Has("ppl2") && !_forgiven)
						{
							_forgiven = true;
							((TMP_Text)_status).text = "ERROR CORRECTED  -  NO MORE SLIPS";
							((Graphic)_status).color = new Color(1f, 0.85f, 0.3f);
							((Graphic)_flash).color = new Color(1f, 0.85f, 0.3f, 0.3f);
							Synth.Play(Synth.Glitch, 0.6f);
						}
						else
						{
							Fail("NO ARROW LEFT FOR THAT KEY  -  THEY NOTICED");
						}
					}
				}
				Paint(unscaledDeltaTime);
				break;
			}
			case Phase.Won:
			{
				float num2 = Mathf.Clamp01(num / 1.1f);
				((TMP_Text)_cash).text = $"+${Mathf.RoundToInt((float)_payout * (1f - Mathf.Pow(1f - num2, 3f)))}";
				((Graphic)_cash).color = Fx.OlyCycle(Time.unscaledTime * 2.5f);
				Paint(unscaledDeltaTime);
				if (num > 1.8f)
				{
					Target t2 = _t;
					int payout = _payout;
					Close();
					if (Practice.Is(t2))
					{
						Practice.Won(t2);
					}
					else
					{
						Loot.Give(t2, payout);
					}
				}
				break;
			}
			case Phase.Lost:
				Paint(unscaledDeltaTime);
				if (Mathf.Repeat(num, 0.3f) < 0.15f)
				{
					((Graphic)_flash).color = new Color(Fx.Bad.r, Fx.Bad.g, Fx.Bad.b, 0.22f);
				}
				if ((Object)(object)_holder != (Object)null)
				{
					_holder.anchoredPosition = ((num < 0.45f) ? (Random.insideUnitCircle * 9f * (1f - num / 0.45f)) : Vector2.zero);
				}
				if (num > 1.8f)
				{
					Target t = _t;
					Close();
					if (Practice.Is(t))
					{
						Practice.Lost(t);
					}
					else
					{
						Investigation.Report(t, t.Who + " caught you skimming their phone.");
					}
				}
				break;
			}
		}

		private static void Fail(string why)
		{
			//IL_0010: 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)
			((TMP_Text)_status).text = why;
			((Graphic)_status).color = Fx.Bad;
			Synth.Play(Synth.Denied, 0.8f);
			Synth.Play(Synth.Alarm, 0.5f);
			((Graphic)_flash).color = new Color(Fx.Bad.r, Fx.Bad.g, Fx.Bad.b, 0.45f);
			SetPhase(Phase.Lost);
		}

		public static void Close()
		{
			if ((Object)(object)_holder == (Object)null)
			{
				return;
			}
			try
			{
				Object.Destroy((Object)(object)((Component)_holder).gameObject);
			}
			catch
			{
			}
			_holder = null;
			_root = null;
			_arrows.Clear();
			_bursts.Clear();
			Bridge.Unblock();
			Cursor.lockState = (CursorLockMode)1;
			Cursor.visible = false;
			try
			{
				UIManager obj2 = S.Get<UIManager>();
				if (obj2 != null)
				{
					obj2.UpdateCursorState();
				}
			}
			catch
			{
			}
		}
	}
	internal static class Cones
	{
		private static Material _mat;

		private static readonly Dictionary<string, MeshRenderer> _cones = new Dictionary<string, MeshRenderer>();

		private static bool _shown;

		private static Material Mat()
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Expected O, but got Unknown
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)_mat != (Object)null)
			{
				return _mat;
			}
			Shader val = Shader.Find("Hidden/Internal-Colored");
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			_mat = new Material(val)
			{
				hideFlags = (HideFlags)32
			};
			_mat.SetInt("_Cull", 0);
			_mat.SetInt("_ZWrite", 0);
			_mat.SetInt("_ZTest", 4);
			_mat.SetInt("_SrcBlend", 5);
			_mat.SetInt("_DstBlend", 1);
			_mat.renderQueue = 3050;
			_mat.color = new Color(1f, 0.25f, 0.2f, 0.07f);
			return _mat;
		}

		private static MeshRenderer Make(Target t)
		{
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0128: Unknown result type (might be due to invalid IL or missing references)
			//IL_0164: Unknown result type (might be due to invalid IL or missing references)
			//IL_0169: Unknown result type (might be due to invalid IL or missing references)
			//IL_01db: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Expected O, but got Unknown
			//IL_020a: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_021c: Unknown result type (might be due to invalid IL or missing references)
			Material val = Mat();
			if ((Object)(object)val == (Object)null)
			{
				return null;
			}
			Transform val2 = null;
			try
			{
				val2 = (((Object)(object)t.Cam.spotlight != (Object)null) ? ((Component)t.Cam.spotlight).transform : (((Object)(object)t.Cam.pivotY != (Object)null) ? t.Cam.pivotY : ((Component)t.Cam).transform));
			}
			catch
			{
			}
			if ((Object)(object)val2 == (Object)null)
			{
				return null;
			}
			float num = 12f;
			float num2 = 35f;
			try
			{
				if (t.Cam.detectionRange > 1f)
				{
					num = t.Cam.detectionRange;
				}
				if (t.Cam.detectionAngle > 1f)
				{
					num2 = t.Cam.detectionAngle;
				}
			}
			catch
			{
			}
			float num3 = Mathf.Clamp((num2 > 90f) ? (num2 * 0.5f) : num2, 5f, 70f);
			float num4 = num * Mathf.Tan(num3 * ((float)Math.PI / 180f));
			Vector3[] array = (Vector3[])(object)new Vector3[20];
			int[] array2 = new int[108];
			array[0] = Vector3.zero;
			array[19] = new Vector3(0f, 0f, num);
			for (int i = 0; i < 18; i++)
			{
				float num5 = (float)i / 18f * (float)Math.PI * 2f;
				array[i + 1] = new Vector3(Mathf.Cos(num5) * num4, Mathf.Sin(num5) * num4, num);
			}
			for (int j = 0; j < 18; j++)
			{
				int num6 = j + 1;
				int num7 = (j + 1) % 18 + 1;
				array2[j * 6] = 0;
				array2[j * 6 + 1] = num6;
				array2[j * 6 + 2] = num7;
				array2[j * 6 + 3] = 19;
				array2[j * 6 + 4] = num7;
				array2[j * 6 + 5] = num6;
			}
			Mesh val3 = new Mesh();
			val3.vertices = Il2CppStructArray<Vector3>.op_Implicit(array);
			val3.triangles = Il2CppStructArray<int>.op_Implicit(array2);
			val3.RecalculateBounds();
			GameObject val4 = new GameObject("XB_Cone");
			val4.transform.SetParent(val2, false);
			val4.AddComponent<MeshFilter>().sharedMesh = val3;
			MeshRenderer obj3 = val4.AddComponent<MeshRenderer>();
			((Renderer)obj3).sharedMaterial = val;
			((Renderer)obj3).shadowCastingMode = (ShadowCastingMode)0;
			((Renderer)obj3).receiveShadows = false;
			return obj3;
		}

		public static void Tick()
		{
			//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			if (!Scan.Holding || !Shop.Has("scan2") || !Security.Curfew)
			{
				if (!_shown)
				{
					return;
				}
				foreach (MeshRenderer value2 in _cones.Values)
				{
					if ((Object)(object)value2 != (Object)null)
					{
						((Renderer)value2).enabled = false;
					}
				}
				_shown = false;
				return;
			}
			_shown = true;
			Camera main = Camera.main;
			if ((Object)(object)main == (Object)null)
			{
				return;
			}
			float num = Plugin.ScanRange.Value * 1.5f;
			foreach (Target target in Security.Targets)
			{
				if ((Object)(object)target.Cam == (Object)null)
				{
					continue;
				}
				bool flag = Security.Live(target) && Vector3.Distance(((Component)main).transform.position, target.Point) < num;
				_cones.TryGetValue(target.Id, out var value);
				if (flag && (Object)(object)value == (Object)null)
				{
					try
					{
						value = Make(target);
					}
					catch (Exception ex)
					{
						Plugin.L.LogWarning((object)("Cone: " + ex.Message));
					}
					if ((Object)(object)value != (Object)null)
					{
						_cones[target.Id] = value;
					}
				}
				if ((Object)(object)value != (Object)null)
				{
					((Renderer)value).enabled = flag;
				}
			}
		}

		public static void Reset()
		{
			_cones.Clear();
			_shown = false;
		}
	}
	internal static class Fx
	{
		public static readonly Color G = new Color(0.28f, 1f, 0.45f);

		public static readonly Color GMid = new Color(0.14f, 0.62f, 0.27f);

		public static readonly Color GDim = new Color(0.06f, 0.3f, 0.13f);

		public static readonly Color[] Olympic = (Color[])(object)new Color[5]
		{
			new Color(0f, 0.45f, 1f),
			new Color(1f, 0.8f, 0f),
			new Color(1f, 1f, 1f),
			new Color(0f, 1f, 0.3f),
			new Color(1f, 0.08f, 0.22f)
		};

		public static readonly Color Black = new Color(0.005f, 0.012f, 0.008f, 0.995f);

		public static readonly Color Bad = new Color(1f, 0.25f, 0.22f);

		public static readonly Color Warn = new Color(0.85f, 0.95f, 0.3f);

		private static Sprite _soft;

		private static Sprite _disc;

		private static Sprite _ring;

		private static Texture2D _vig;

		public static Sprite Soft => _soft ?? (_soft = Spr(Tex(64, delegate(float u, float v)
		{
			float num = Mathf.Sqrt(u * u + v * v);
			return Mathf.Pow(Mathf.Clamp01(1f - num), 2.2f);
		})));

		public static Sprite Disc => _disc ?? (_disc = Spr(Tex(64, delegate(float u, float v)
		{
			float num = Mathf.Sqrt(u * u + v * v);
			return (1f - num) * 32f;
		})));

		public static Sprite Ring => _ring ?? (_ring = Spr(Tex(64, delegate(float u, float v)
		{
			float num = Mathf.Sqrt(u * u + v * v);
			return 1f - Mathf.Abs(num - 0.86f) * 18f;
		})));

		public static Texture2D Vignette => _vig ?? (_vig = Tex(64, (float u, float v) => Mathf.Pow(Mathf.Clamp01((Mathf.Max(Mathf.Abs(u), Mathf.Abs(v)) - 0.55f) / 0.45f), 1.6f) * 0.85f));

		public static Color Oly(int i)
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			return Olympic[(i % 5 + 5) % 5];
		}

		public static Color OlyCycle(float t)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Repeat(t, 5f);
			int num2 = (int)num;
			return Color.Lerp(Oly(num2), Oly(num2 + 1), num - (float)num2);
		}

		private static Texture2D Tex(int n, Func<float, float, float> alpha)
		{
			//IL_0004: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D(n, n, (TextureFormat)4, false)
			{
				wrapMode = (TextureWrapMode)1,
				filterMode = (FilterMode)1
			};
			Color[] array = (Color[])(object)new Color[n * n];
			for (int i = 0; i < n; i++)
			{
				for (int j = 0; j < n; j++)
				{
					float arg = ((float)j + 0.5f) / (float)n * 2f - 1f;
					float arg2 = ((float)i + 0.5f) / (float)n * 2f - 1f;
					array[i * n + j] = new Color(1f, 1f, 1f, Mathf.Clamp01(alpha(arg, arg2)));
				}
			}
			val.SetPixels(Il2CppStructArray<Color>.op_Implicit(array));
			val.Apply();
			((Object)val).hideFlags = (HideFlags)32;
			return val;
		}

		private static Sprite Spr(Texture2D t)
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			Sprite obj = Sprite.Create(t, new Rect(0f, 0f, (float)((Texture)t).width, (float)((Texture)t).height), new Vector2(0.5f, 0.5f), 100f);
			((Object)obj).hideFlags = (HideFlags)32;
			return obj;
		}

		public static Image Spot(Transform p, string name, Sprite s, Color c, float size)
		{
			//IL_0002: 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)
			Image obj = Ui.Img(p, name, c);
			obj.sprite = s;
			((Graphic)obj).rectTransform.sizeDelta = new Vector2(size, size);
			return obj;
		}

		public static RectTransform Panel(RectTransform parent, string name, float w, float h)
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004a: 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_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_0135: 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_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0294: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: Unknown result type (might be due to invalid IL or missing references)
			RectTransform val = Ui.Rect(name, (Transform)(object)parent);
			Vector2 val2 = default(Vector2);
			((Vector2)(ref val2))..ctor(0.5f, 0.5f);
			val.anchorMax = val2;
			val.anchorMin = val2;
			val.pivot = new Vector2(0.5f, 0.5f);
			val.sizeDelta = new Vector2(w, h);
			val.anchoredPosition = Vector2.zero;
			RectTransform rectTransform = ((Graphic)Ui.Img((Transform)(object)val, "Dim", new Color(0f, 0f, 0f, 0.6f))).rectTransform;
			((Vector2)(ref val2))..ctor(0.5f, 0.5f);
			rectTransform.anchorMax = val2;
			rectTransform.anchorMin = val2;
			rectTransform.sizeDelta = new Vector2(6000f, 4000f);
			Image obj = Ui.Img((Transform)(object)val, "Halo", new Color(G.r, G.g, G.b, 0.1f));
			obj.sprite = Soft;
			Ui.Stretch(((Graphic)obj).rectTransform, -60f, -60f, -60f, -60f);
			Ui.Stretch(((Graphic)Ui.Img((Transform)(object)val, "Outer", new Color(G.r, G.g, G.b, 0.35f))).rectTransform, -6f, -6f, -6f, -6f);
			Ui.Stretch(((Graphic)Ui.Img((Transform)(object)val, "Gap", Black)).rectTransform, -4f, -4f, -4f, -4f);
			Ui.Stretch(((Graphic)Ui.Img((Transform)(object)val, "Inner", new Color(G.r, G.g, G.b, 0.7f))).rectTransform, -1.5f, -1.5f, -1.5f, -1.5f);
			Ui.Stretch(((Graphic)Ui.Img((Transform)(object)val, "Bg", Black)).rectTransform);
			(float, float)[] array = new(float, float)[4]
			{
				(0f, 0f),
				(1f, 0f),
				(0f, 1f),
				(1f, 1f)
			};
			for (int i = 0; i < array.Length; i++)
			{
				(float, float) tuple = array[i];
				float item = tuple.Item1;
				float item2 = tuple.Item2;
				for (int j = 0; j < 2; j++)
				{
					RectTransform rectTransform2 = ((Graphic)Ui.Img((Transform)(object)val, "Bracket", G)).rectTransform;
					((Vector2)(ref val2))..ctor(item, item2);
					rectTransform2.anchorMax = val2;
					rectTransform2.anchorMin = val2;
					rectTransform2.pivot = new Vector2(item, item2);
					rectTransform2.sizeDelta = ((j == 0) ? new Vector2(26f, 3f) : new Vector2(3f, 26f));
					rectTransform2.anchoredPosition = new Vector2((float)((item == 0f) ? (-9) : 9), (float)((item2 == 0f) ? (-9) : 9));
				}
			}
			return val;
		}

		public static RawImage Crt(RectTransform panel)
		{
			//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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Expected O, but got Unknown
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
			RawImage val = ((Component)Ui.Rect("Scan", (Transform)(object)panel)).gameObject.AddComponent<RawImage>();
			((Graphic)val).raycastTarget = false;
			Ui.Stretch(((Graphic)val).rectTransform);
			Texture2D val2 = new Texture2D(1, 3, (TextureFormat)4, false)
			{
				filterMode = (FilterMode)0,
				wrapMode = (TextureWrapMode)0
			};
			val2.SetPixels(Il2CppStructArray<Color>.op_Implicit((Color[])(object)new Color[3]
			{
				new Color(0f, 0f, 0f, 0.32f),
				Color.clear,
				Color.clear
			}));
			val2.Apply();
			((Object)val2).hideFlags = (HideFlags)32;
			val.texture = (Texture)(object)val2;
			val.uvRect = new Rect(0f, 0f, 1f, panel.sizeDelta.y / 3f);
			RawImage obj = ((Component)Ui.Rect("Vignette", (Transform)(object)panel)).gameObject.AddComponent<RawImage>();
			((Graphic)obj).raycastTarget = false;
			obj.texture = (Texture)(object)Vignette;
			((Graphic)obj).color = Color.black;
			Ui.Stretch(((Graphic)obj).rectTransform);
			Image obj2 = Ui.Img((Transform)(object)panel, "Roll", new Color(G.r, G.g, G.b, 0.05f));
			obj2.sprite = Soft;
			RectTransform rectTransform = ((Graphic)obj2).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 1f);
			rectTransform.anchorMax = new Vector2(1f, 1f);
			rectTransform.pivot = new Vector2(0.5f, 1f);
			rectTransform.sizeDelta = new Vector2(0f, 70f);
			return val;
		}

		public static void CrtTick(RectTransform panel)
		{
			//IL_0016: 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_00af: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Transform val = ((Transform)panel).Find("Roll");
				if ((Object)(object)val != (Object)null)
				{
					float y = panel.sizeDelta.y;
					((Component)val).GetComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f - Mathf.Repeat(Time.unscaledTime * 90f, y + 70f));
				}
				Transform obj = ((Transform)panel).Find("Halo");
				Image val2 = ((obj != null) ? ((Component)obj).GetComponent<Image>() : null);
				if ((Object)(object)val2 != (Object)null)
				{
					((Graphic)val2).color = new Color(G.r, G.g, G.b, 0.08f + 0.03f * Mathf.PerlinNoise(Time.unscaledTime * 3f, 0.7f));
				}
			}
			catch
			{
			}
		}

		public static TextMeshProUGUI Countdown(RectTransform panel)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			TextMeshProUGUI obj = Ui.Text((Transform)(object)panel, "", 120f, G, (TextAlignmentOptions)514);
			Ui.Stretch(((TMP_Text)obj).rectTransform);
			((Component)obj).gameObject.SetActive(false);
			return obj;
		}

		public static bool CountdownTick(TextMeshProUGUI t, float age, float len = 3f)
		{
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			if (age >= len + 0.35f)
			{
				((Component)t).gameObject.SetActive(false);
				return true;
			}
			((Component)t).gameObject.SetActive(true);
			int num = Mathf.CeilToInt(len - age);
			float num2 = 1f - Mathf.Repeat(age, 1f);
			((TMP_Text)t).text = ((age >= len) ? "GO" : num.ToString());
			((TMP_Text)t).fontSize = ((age >= len) ? 90f : (90f + 50f * num2));
			((Graphic)t).color = new Color(G.r, G.g, G.b, (age >= len) ? (1f - (age - len) / 0.35f) : (0.35f + 0.65f * num2));
			return false;
		}

		public static string Hex(Color c)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			return "#" + ((int)(Mathf.Clamp01(c.r) * 255f)).ToString("X2") + ((int)(Mathf.Clamp01(c.g) * 255f)).ToString("X2") + ((int)(Mathf.Clamp01(c.b) * 255f)).ToString("X2");
		}
	}
	internal static class InfectScreen
	{
		private enum Phase
		{
			Boot,
			Count,
			Play,
			Won,
			Lost
		}

		private class Sweeper
		{
			public float x;

			public float y;

			public int vx;

			public int vy;

			public Image Core;

			public Image Glow;

			public Image Ring;
		}

		private const int N = 32;

		private const float W = 560f;

		private const float H = 760f;

		private const float Board = 448f;

		private const float BoardX = 56f;

		private const float BoardY = 168f;

		private const float Cell = 14f;

		private static readonly Color32 CleanA = new Color32((byte)8, (byte)16, (byte)24, byte.MaxValue);

		private static readonly Color32 CleanB = new Color32((byte)10, (byte)19, (byte)28, byte.MaxValue);

		private static readonly Color32 TrailC = new Color32((byte)170, byte.MaxValue, (byte)140, byte.MaxValue);

		private static readonly Color Virus = new Color(0.25f, 1f, 0.45f);

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

		private static readonly int[] TierSweepers = new int[4] { 1, 2, 2, 3 };

		private static readonly float[] TierSweepStep = new float[4] { 0.075f, 0.07f, 0.058f, 0.05f };

		private static readonly int[] TierTarget = new int[4] { 60, 65, 70, 75 };

		private static readonly float[] TierTime = new float[4] { 55f, 58f, 62f, 70f };

		private static RectTransform _root;

		private static RectTransform _shake;

		private static RectTransform _boot;

		private static RectTransform _main;

		private static Image _flash;

		private static Image _bootBar;

		private static Image _head;

		private static Image _headGlow;

		private static Image _timeFill;

		private static Image _pctFill;

		private static Image _goalMark;

		private static RawImage _boardImg;

		private static Texture2D _tex;

		private static TextMeshProUGUI _bootText;

		private static TextMeshProUGUI _status;

		private static TextMeshProUGUI _hexTxt;

		private static TextMeshProUGUI _count;

		private static TextMeshProUGUI _pctTxt;

		private static TextMeshProUGUI _timeTxt;

		private static Target _t;

		private static Phase _phase;

		private static float _phaseAt;

		private static float _lastStep;

		private static float _lastSweep;

		private static float _left;

		private static float _limit;

		private static float _hexAt;

		private static int _tier;

		private static int _target;

		private static byte[,] _g;

		private static float[,] _fresh;

		private static byte[,] _ci;

		private static int _loop = 0;

		private static float _blipAt;

		private static float _warnAt;

		private static Image _frame;

		private static Image _frameGlow;

		private static Image _sweepLine;

		private static readonly List<(Image img, float at, Color c, float size)> _bursts = new List<(Image, float, Color, float)>();

		private static int _hx;

		private static int _hy;

		private static int _dx;

		private static int _dy;

		private static bool _drawing;

		private static bool _shieldUsed;

		private static readonly List<(int x, int y)> _trail = new List<(int, int)>();

		private static readonly List<Sweeper> _sweepers = new List<Sweeper>();

		private static readonly Color32[] _px = (Color32[])(object)new Color32[1024];

		private static readonly string[] BootLines = new string[6] { "XENO SEC-OS  build 4.11", "attaching to video node .......... ok", "mapping frame buffer ............. ok", "antivirus present ................ !", "seeding worm ..................... ok", "ready." };

		private static Color G => Fx.G;

		public static bool IsOpen => (Object)(object)_root != (Object)null;

		private static float StepTime => 0.055f;

		private static float SweepStep => TierSweepStep[_tier] * (Shop.Has("cam1") ? 1.25f : 1f);

		public static void Open(Target t)
		{
			//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Expected O, but got Unknown
			if (!((Object)(object)_root != (Object)null) && !((Object)(object)Scan.Root == (Object)null))
			{
				_t = t;
				_tier = Mathf.Clamp(Rarity.Of(t), 0, 3);
				_target = TierTarget[_tier];
				_limit = (_left = TierTime[_tier]);
				try
				{
					NewBoard();
					_shake = Ui.Rect("XB_InfectHolder", (Transform)(object)Scan.Root);
					Ui.Stretch(_shake);
					_root = Fx.Panel(_shake, "XB_Infect", 560f, 760f);
					Build();
					Fx.Crt(_root);
					_count = Fx.Countdown(_root);
					_flash = Ui.Img((Transform)(object)_root, "Flash", new Color(1f, 1f, 1f, 0f));
					Ui.Stretch(((Graphic)_flash).rectTransform);
				}
				catch (Exception ex)
				{
					Plugin.L.LogError((object)("Infect build failed: " + ex));
					Close();
					Scan.Toast("<color=#FF4740>BREACH TOOL CRASHED</color>  ·  check the log");
					return;
				}
				Bridge.Block(on: true, full: true);
				SetPhase(Phase.Boot);
				Synth.Play(Synth.Glitch, 0.6f);
				ManualLogSource l = Plugin.L;
				bool flag = default(bool);
				BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(43, 4, ref flag);
				if (flag)
				{
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("[breach] infect on ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(t.Label);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" (");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(Rarity.CamNames[_tier]);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", target ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(_target);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral("%, ");
					((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(_sweepers.Count);
					((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" sweepers)");
				}
				l.LogInfo(val);
			}
		}

		private static void NewBoard()
		{
			_g = new byte[32, 32];
			_fresh = new float[32, 32];
			_ci = new byte[32, 32];
			_loop = 0;
			for (int i = 0; i < 32; i++)
			{
				for (int j = 0; j < 32; j++)
				{
					bool flag = i == 0 || j == 0 || i == 31 || j == 31;
					_g[i, j] = (flag ? ((byte)1) : ((byte)0));
					_ci[i, j] = 3;
					_fresh[i, j] = -9f;
				}
			}
			if (Shop.Has("cam4"))
			{
				bool flag2 = Random.value < 0.5f;
				bool flag3 = Random.value < 0.5f;
				for (int k = 1; k <= 9; k++)
				{
					for (int l = 1; l <= 8; l++)
					{
						int num = (flag2 ? k : (31 - k));
						int num2 = (flag3 ? l : (31 - l));
						_g[num, num2] = 1;
						_ci[num, num2] = 2;
					}
				}
			}
			_hx = 16;
			_hy = 0;
			_dx = 0;
			_dy = 0;
			_drawing = false;
			_shieldUsed = false;
			_trail.Clear();
			_sweepers.Clear();
			for (int m = 0; m < TierSweepers[_tier]; m++)
			{
				_sweepers.Add(new Sweeper
				{
					x = Random.Range(10, 21),
					y = Random.Range(16, 26),
					vx = ((!(Random.value < 0.5f)) ? 1 : (-1)),
					vy = ((!(Random.value < 0.5f)) ? 1 : (-1))
				});
			}
		}

		private static int InfectedPct()
		{
			int num = 0;
			int num2 = 900;
			for (int i = 1; i < 31; i++)
			{
				for (int j = 1; j < 31; j++)
				{
					if (_g[i, j] == 1)
					{
						num++;
					}
				}
			}
			return Mathf.FloorToInt((float)num * 100f / (float)num2);
		}

		private static void CloseLoop()
		{
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_036d: Unknown result type (might be due to invalid IL or missing references)
			//IL_038c: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0297: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_02de: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0306: Unknown result type (might be due to invalid IL or missing references)
			float unscaledTime = Time.unscaledTime;
			byte b = (byte)_loop;
			foreach (var (num, num2) in _trail)
			{
				_g[num, num2] = 1;
				_fresh[num, num2] = unscaledTime;
				_ci[num, num2] = b;
			}
			_trail.Clear();
			_drawing = false;
			bool[,] array = new bool[32, 32];
			Queue<(int, int)> queue = new Queue<(int, int)>();
			foreach (Sweeper sweeper in _sweepers)
			{
				int num3 = Mathf.Clamp(Mathf.RoundToInt(sweeper.x), 0, 31);
				int num4 = Mathf.Clamp(Mathf.RoundToInt(sweeper.y), 0, 31);
				if (_g[num3, num4] == 0 && !array[num3, num4])
				{
					array[num3, num4] = true;
					queue.Enqueue((num3, num4));
				}
			}
			while (queue.Count > 0)
			{
				(int, int) tuple2 = queue.Dequeue();
				int item = tuple2.Item1;
				int item2 = tuple2.Item2;
				(int, int)[] array2 = new(int, int)[4]
				{
					(1, 0),
					(-1, 0),
					(0, 1),
					(0, -1)
				};
				for (int i = 0; i < array2.Length; i++)
				{
					(int, int) tuple3 = array2[i];
					int item3 = tuple3.Item1;
					int item4 = tuple3.Item2;
					int num5 = item + item3;
					int num6 = item2 + item4;
					if (num5 >= 0 && num6 >= 0 && num5 < 32 && num6 < 32 && !array[num5, num6] && _g[num5, num6] == 0)
					{
						array[num5, num6] = true;
						queue.Enqueue((num5, num6));
					}
				}
			}
			int num7 = 0;
			for (int j = 0; j < 32; j++)
			{
				for (int k = 0; k < 32; k++)
				{
					if (_g[j, k] == 0 && !array[j, k])
					{
						_g[j, k] = 1;
						_fresh[j, k] = unscaledTime;
						_ci[j, k] = b;
						num7++;
					}
				}
			}
			Color val = Fx.Oly(_loop);
			try
			{
				Image val2 = Ui.Img((Transform)(object)_main, "Burst", val);
				val2.sprite = Fx.Soft;
				RectTransform rectTransform = ((Graphic)val2).rectTransform;
				Vector2 anchorMin = (rectTransform.anchorMax = new Vector2(0f, 1f));
				rectTransform.anchorMin = anchorMin;
				rectTransform.pivot = new Vector2(0.5f, 0.5f);
				rectTransform.anchoredPosition = Pos(_hx, _hy);
				_bursts.Add((val2, unscaledTime, val, 14f * (4f + Mathf.Sqrt((float)num7) * 0.8f)));
			}
			catch
			{
			}
			Synth.Play(Synth.Corrupt[Mathf.Clamp(num7 / 60, 0, Synth.Corrupt.Length - 1)], 0.9f);
			if (num7 > 0)
			{
				((Graphic)_flash).color = new Color(val.r, val.g, val.b, Mathf.Clamp((float)num7 / 300f, 0.08f, 0.3f));
			}
			_loop = (_loop + 1) % 5;
			_sweepers.RemoveAll(delegate(Sweeper s)
			{
				int num8 = Mathf.Clamp(Mathf.RoundToInt(s.x), 0, 31);
				int num9 = Mathf.Clamp(Mathf.RoundToInt(s.y), 0, 31);
				if (_g[num8, num9] != 1)
				{
					return false;
				}
				try
				{
					Object.Destroy((Object)(object)((Component)s.Core).gameObject);
					Object.Destroy((Object)(object)((Component)s.Glow).gameObject);
					Object.Destroy((Object)(object)((Component)s.Ring).gameObject);
				}
				catch
				{
				}
				return true;
			});
			if (InfectedPct() >= _target)
			{
				((TMP_Text)_status).text = "FRAME BUFFER CORRUPTED  -  FEED KILLED";
				((Graphic)_status).color = G;
				Synth.Play(Synth.Granted, 0.8f);
				SetPhase(Phase.Won);
			}
		}

		private static void Purge(string why)
		{
			//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c0: Unknown result type (might be due to invalid IL or missing references)
			if (Shop.Has("cam2") && !_shieldUsed)
			{
				_shieldUsed = true;
				if (_trail.Count > 0)
				{
					var (hx, hy) = _trail[0];
					foreach (var (num, num2) in _trail)
					{
						_g[num, num2] = 0;
					}
					_hx = hx;
					_hy = hy;
				}
				(int, int)[] array = new(int, int)[4]
				{
					(1, 0),
					(-1, 0),
					(0, 1),
					(0, -1)
				};
				for (int i = 0; i < array.Length; i++)
				{
					(int, int) tuple3 = array[i];
					int item = tuple3.Item1;
					int item2 = tuple3.Item2;
					int num3 = _hx + item;
					int num4 = _hy + item2;
					if (num3 >= 0 && num4 >= 0 && num3 < 32 && num4 < 32 && _g[num3, num4] == 1)
					{
						_hx = num3;
						_hy = num4;
						break;
					}
				}
				_trail.Clear();
				_drawing = false;
				_dx = (_dy = 0);
				((Graphic)_flash).color = new Color(1f, 0.85f, 0.3f, 0.4f);
				Synth.Play(Synth.Denied, 0.5f);
				((TMP_Text)_status).text = "SHIELD ABSORBED THE PURGE";
				((Graphic)_status).color = new Color(1f, 0.85f, 0.3f);
			}
			else
			{
				Synth.Play(Synth.Purged, 0.9f);
				Synth.Play(Synth.Alarm, 0.6f);
				((TMP_Text)_status).text = why;
				((Graphic)_status).color = Fx.Bad;
				((Graphic)_flash).color = new Color(Fx.Bad.r, Fx.Bad.g, Fx.Bad.b, 0.5f);
				SetPhase(Phase.Lost);
			}
		}

		private static void Steer(Keyboard kb)
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			int num2 = 0;
			if (kb != null)
			{
				if (((ButtonControl)kb[(Key)63]).isPressed || ((ButtonControl)kb[(Key)37]).isPressed)
				{
					num2 = 1;
				}
				else if (((ButtonControl)kb[(Key)64]).isPressed || ((ButtonControl)kb[(Key)33]).isPressed)
				{
					num2 = -1;
				}
				else if (((ButtonControl)kb[(Key)61]).isPressed || ((ButtonControl)kb[(Key)15]).isPressed)
				{
					num = -1;
				}
				else if (((ButtonControl)kb[(Key)62]).isPressed || ((ButtonControl)kb[(Key)18]).isPressed)
				{
					num = 1;
				}
			}
			Gamepad current = Gamepad.current;
			if (num == 0 && num2 == 0 && current != null)
			{
				Vector2 val = ((InputControl<Vector2>)(object)current.dpad).ReadValue() + ((InputControl<Vector2>)(object)current.leftStick).ReadValue();
				if (((Vector2)(ref val)).sqrMagnitude > 0.3f)
				{
					if (Mathf.Abs(val.x) > Mathf.Abs(val.y))
					{
						num = (int)Mathf.Sign(val.x);
					}
					else
					{
						num2 = (int)Mathf.Sign(val.y);
					}
				}
			}
			_dx = num;
			_dy = num2;
		}

		private static void StepWorm()
		{
			if (_dx == 0 && _dy == 0)
			{
				return;
			}
			int num = _hx + _dx;
			int num2 = _hy + _dy;
			if (num < 0 || num2 < 0 || num >= 32 || num2 >= 32)
			{
				return;
			}
			switch (_g[num, num2])
			{
			case 2:
				break;
			case 0:
				_g[num, num2] = 2;
				_trail.Add((num, num2));
				_drawing = true;
				_hx = num;
				_hy = num2;
				if (Time.unscaledTime - _blipAt > 0.05f)
				{
					_blipAt = Time.unscaledTime;
					Synth.Play(Synth.Blip, 0.35f);
				}
				if (SweeperAt(num, num2))
				{
					Purge("ANTIVIRUS CAUGHT THE WORM  -  TRACED");
				}
				break;
			default:
				_hx = num;
				_hy = num2;
				if (_drawing)
				{
					CloseLoop();
				}
				break;
			}
		}

		private static bool SweeperAt(int x, int y)
		{
			foreach (Sweeper sweeper in _sweepers)
			{
				if (Mathf.RoundToInt(sweeper.x) == x && Mathf.RoundToInt(sweeper.y) == y)
				{
					return true;
				}
			}
			return false;
		}

		private static void StepSweepers()
		{
			foreach (Sweeper sweeper in _sweepers)
			{
				int num = Mathf.RoundToInt(sweeper.x);
				int num2 = Mathf.RoundToInt(sweeper.y);
				if (_g[Mathf.Clamp(num + sweeper.vx, 0, 31), num2] == 1)
				{
					sweeper.vx = -sweeper.vx;
				}
				if (_g[num, Mathf.Clamp(num2 + sweeper.vy, 0, 31)] == 1)
				{
					sweeper.vy = -sweeper.vy;
				}
				if (_g[Mathf.Clamp(num + sweeper.vx, 0, 31), Mathf.Clamp(num2 + sweeper.vy, 0, 31)] == 1)
				{
					sweeper.vx = -sweeper.vx;
					sweeper.vy = -sweeper.vy;
				}
				int num3 = Mathf.Clamp(num + sweeper.vx, 0, 31);
				int num4 = Mathf.Clamp(num2 + sweeper.vy, 0, 31);
				if (_g[num3, num4] == 1)
				{
					continue;
				}
				sweeper.x = num3;
				sweeper.y = num4;
				if (_drawing && Time.unscaledTime - _warnAt > 0.35f)
				{
					foreach (var (num5, num6) in _trail)
					{
						if (Mathf.Abs(num5 - num3) + Mathf.Abs(num6 - num4) <= 3)
						{
							_warnAt = Time.unscaledTime;
							Synth.Play(Synth.Key, 0.7f);
							break;
						}
					}
				}
				if (_g[num3, num4] == 2 || (_drawing && num3 == _hx && num4 == _hy))
				{
					Purge("ANTIVIRUS HIT YOUR TRAIL  -  VIRUS PURGED");
					break;
				}
			}
		}

		private static TextMeshProUGUI Txt(Transform p, string s, float size, Color c, TextAlignmentOptions a = (TextAlignmentOptions)514)
		{
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0004: Unknown result type (might be due to invalid IL or missing references)
			return Ui.Text(p, s, size, c, a);
		}

		private static void Build()
		{
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: 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_0120: Unknown result type (might be due to invalid IL or missing references)
			//IL_0144: Unknown result type (might be due to invalid IL or missing references)
			//IL_0159: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0183: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0223: Unknown result type (might be due to invalid IL or missing references)
			//IL_022d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0246: Unknown result type (might be due to invalid IL or missing references)
			//IL_027d: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_031e: Unknown result type (might be due to invalid IL or missing references)
			//IL_035f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0396: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_03aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
			//IL_041e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0494: Unknown result type (might be due to invalid IL or missing references)
			//IL_04db: Unknown result type (might be due to invalid IL or missing references)
			//IL_0519: Unknown result type (might be due to invalid IL or missing references)
			//IL_0523: Unknown result type (might be due to invalid IL or missing references)
			//IL_052d: Unknown result type (might be due to invalid IL or missing references)
			//IL_053c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0570: Unknown result type (might be due to invalid IL or missing references)
			//IL_058a: Unknown result type (might be due to invalid IL or missing references)
			//IL_059f: Unknown result type (might be due to invalid IL or missing references)
			//IL_05b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_05c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_05dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0607: Unknown result type (might be due to invalid IL or missing references)
			//IL_0623: Unknown result type (might be due to invalid IL or missing references)
			//IL_0637: Unknown result type (might be due to invalid IL or missing references)
			//IL_0650: Unknown result type (might be due to invalid IL or missing references)
			//IL_0691: Unknown result type (might be due to invalid IL or missing references)
			//IL_069b: Unknown result type (might be due to invalid IL or missing references)
			//IL_06a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_06b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_06e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0701: Unknown result type (might be due to invalid IL or missing references)
			//IL_070c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0717: Unknown result type (might be due to invalid IL or missing references)
			//IL_0721: Unknown result type (might be due to invalid IL or missing references)
			//IL_073a: Unknown result type (might be due to invalid IL or missing references)
			//IL_079e: Unknown result type (might be due to invalid IL or missing references)
			//IL_07e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_07f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_07fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_080c: Unknown result type (might be due to invalid IL or missing references)
			//IL_08c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_093c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0941: Unknown result type (might be due to invalid IL or missing references)
			//IL_0985: Unknown result type (might be due to invalid IL or missing references)
			//IL_098a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0991: Unknown result type (might be due to invalid IL or missing references)
			//IL_099d: Expected O, but got Unknown
			//IL_08fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_09d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a22: Unknown result type (might be due to invalid IL or missing references)
			//IL_0a81: Unknown result type (might be due to invalid IL or missing references)
			//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b28: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b32: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b3c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0b75: Unknown result type (might be due to invalid IL or missing references)
			//IL_0ba1: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bab: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bb5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bcb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0bf7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c01: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c0b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cd0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0cf8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d02: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d0c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d20: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d48: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d52: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d5c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c54: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c59: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c5a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c61: Unknown result type (might be due to invalid IL or missing references)
			//IL_0c72: Unknown result type (might be due to invalid IL or missing references)
			//IL_0d9e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0da5: Unknown result type (might be due to invalid IL or missing references)
			//IL_0db6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0dda: Unknown result type (might be due to invalid IL or missing references)
			//IL_0e47: Unknown result type (might be due to invalid IL or missing references)
			_boot = Ui.Rect("Boot", (Transform)(object)_root);
			Ui.Stretch(_boot);
			TextMeshProUGUI obj = Txt((Transform)(object)_boot, "XENO", 64f, G, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)obj).rectTransform, 0f, 200f, 560f, 76f);
			((TMP_Text)obj).characterSpacing = 22f;
			TextMeshProUGUI obj2 = Txt((Transform)(object)_boot, "VIDEO NODE INFECTION KIT", 13f, Fx.GMid, (TextAlignmentOptions)514);
			Ui.PlaceTL(((TMP_Text)obj2).rectTransform, 0f, 278f, 560f, 20f);
			((TMP_Text)obj2).characterSpacing = 6f;
			Image obj3 = Ui.Img((Transform)(object)_boot, "Track", new Color(G.r, G.g, G.b, 0.08f));
			Ui.PlaceTL(((Graphic)obj3).rectTransform, 90f, 320f, 380f, 10f);
			_bootBar = Ui.Img(((Component)obj3).transform, "Fill", G);
			RectTransform rectTransform = ((Graphic)_bootBar).rectTransform;
			rectTransform.anchorMin = new Vector2(0f, 0f);
			rectTransform.anchorMax = new Vector2(0f, 1f);
			rectTransform.pivot = new Vector2(0f, 0.5f);
			rectTransform.sizeDelta = new Vector2(0f, -2f);
			rectTransform.anchoredPosition = new Vector2(1f, 0f);
			_bootText = Txt((Transform)(object)_boot, "", 13f, Fx.GMid, (TextAlignmentOptions)257);
			Ui.PlaceTL(((TMP_Text)_bootText).rectTransform, 90f, 346f, 380f, 160f);
			_main = Ui.Rect("Main", (Transform)(object)_root);
			Ui.Stretch(_main);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "HeadBar", new Color(G.r, G.g, G.b, 0.08f))).rectTransform, 0f, 0f, 560f, 46f);
			TextMeshProUGUI obj4 = Txt((Transform)(object)_main, "XENO  //  PLANT VIRUS", 17f, G, (TextAlignmentOptions)4097);
			Ui.PlaceTL(((TMP_Text)obj4).rectTransform, 24f, 0f, 300f, 46f);
			((TMP_Text)obj4).characterSpacing = 3f;
			Color c = Rarity.Colors[_tier];
			Ui.PlaceTL(((TMP_Text)Txt((Transform)(object)_main, $"{(_t.IsDrone ? "DRONE" : "CAMERA")}  {_t.Label}  ·  <color={Fx.Hex(c)}>{Rarity.CamNames[_tier]}</color>", 13f, Fx.GMid, (TextAlignmentOptions)4100)).rectTransform, 216f, 0f, 320f, 46f);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Rule", new Color(G.r, G.g, G.b, 0.5f))).rectTransform, 0f, 46f, 560f, 1f);
			Ui.PlaceTL(((Graphic)Ui.Img((Transform)(object)_main, "Accent", c)).rectTransform, 0f, 46f, 160f, 3f);
			_hexTxt = Txt((Transform)(object)_main, "", 10f, Fx.GDim, (TextAlignmentOptions)257);
			Ui.PlaceTL(((TMP_Text)_hexTxt).rectTransform, 24f, 54f, 512f, 14f);
			TextMeshProUGUI obj5 = Txt((Transform)(object)_main, $"CORRUPT {_target}% OF THE FEED", 20f, G, (TextAlignmentOptions)257);
			Ui.PlaceTL(((TMP_Text)obj5).rectTransform, 28f, 74f, 504f, 26f);
			((TMP_Text)obj5).characterSpacing = 3f;
			TextMeshProUGUI obj6 = Txt((Transform)(object)_main, "LEAVE THE INFECTION TO DRAW  ·  CLOSE THE LOOP TO CORRUPT  ·  DON'T LET THE ANTIVIRUS TOUCH YOUR TRAIL", 10f, Fx.GMid, (TextAlignmentOptions)257);
			Ui.PlaceTL(((TMP_Text)obj6).rectTransform, 28f, 100f, 504f, 28f);
			((TMP_Text)obj6).enableWordWrapping = true;
			Image obj7 = Ui.Img((Transform)(object)_main, "PctTrack", new Color(G.r, G.g, G.b, 0.08f));
			Ui.PlaceTL(((Graphic)obj7).rectTransform, 28f, 132f, 410f, 10f);
			_pctFill = Ui.Img(((Component)obj7).transform, "Fill", Virus);
			RectTransform rectTransform2 = ((Graphic)_pctFill).rectTransform;
			rectTransform2.anchorMin = Vector2.zero;
			rectTransform2.anchorMax = new Vector2(0f, 1f);
			rectTransform2.offsetMin = new Vector2(1f, 1f);
			rectTransform2.offsetMax = new Vector2(-1f, -1f);
			_goalMark = Ui.Img(((Component)obj7).transform, "Goal", Color.white);
			RectTransform rectTransform3 = ((Graphic)_goalMark).rectTransform;
			rectTransform3.anchorMin = new Vector2((float)_target / 100f, 0f);
			rectTransform3.anchorMax = new Vector2((float)_target / 100f, 1f);
			rectTransform3.sizeDelta = new Vector2(2f, 8f);
			_pctTxt = Txt((Transform)(object)_main, "", 13f, Virus, (TextAlignmentOptions)4100);
			Ui.P