Decompiled source of NullManager v1.2.1

NullManager.dll

Decompiled 7 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using CardChoiceSpawnUniqueCardPatch;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using GameSaver.Util;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Utils;
using Photon.Pun;
using RarityLib.Utils;
using TMPro;
using TabInfo.Utils;
using UnboundLib;
using UnboundLib.GameModes;
using UnboundLib.Utils;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(/*Could not decode attribute arguments.*/)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Nullmanager
{
	[HarmonyPatch]
	internal class AddNullToPlayerPatch : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public CardInfo card;

			public Player player;

			internal void <Add>b__0(Action<NullCardInfo, Player> c)
			{
				try
				{
					c.Invoke((NullCardInfo)(object)card, player);
				}
				catch (Object)
				{
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0 : Object
		{
			public NullCardInfo card;

			public Player playerToUpgrade;

			internal void <RPC>b__0(Action<NullCardInfo, Player> c)
			{
				try
				{
					c.Invoke(card, playerToUpgrade);
				}
				catch (Object)
				{
				}
			}
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static bool Add(Player player, CardInfo card, bool reassign, string twoLetterCode, float forceDisplay, float forceDisplayDelay, bool addToCardBar)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
			CS$<>8__locals0.card = card;
			CS$<>8__locals0.player = player;
			NullCardInfo nullCardInfo = CS$<>8__locals0.card as NullCardInfo;
			if (nullCardInfo != null)
			{
				if (nullCardInfo.randomCard)
				{
					nullCardInfo = NullManager.instance.GetRandomNullWithRarity(CS$<>8__locals0.player, ((CardInfo)nullCardInfo).rarity);
				}
				if (PhotonNetwork.OfflineMode)
				{
					CS$<>8__locals0.card = (CardInfo)(object)NullManager.instance.GetNullCardInfo(((Object)nullCardInfo.NulledSorce).name, CS$<>8__locals0.player);
					CS$<>8__locals0.player.data.currentCards.Add(CS$<>8__locals0.card);
					NullManager.instance.callbacks.ForEach((Action<Action<NullCardInfo, Player>>)delegate(Action<NullCardInfo, Player> c)
					{
						try
						{
							c.Invoke((NullCardInfo)(object)CS$<>8__locals0.card, CS$<>8__locals0.player);
						}
						catch (Object)
						{
						}
					});
					if (addToCardBar)
					{
						Cards.SilentAddToCardBar(CS$<>8__locals0.player.playerID, CS$<>8__locals0.card, twoLetterCode, forceDisplay, forceDisplayDelay);
					}
				}
				else if (PhotonNetwork.IsMasterClient)
				{
					if (addToCardBar)
					{
						NetworkingManager.RPC(typeof(Cards), "RPCA_AssignCard", (object[])(object)new Object[6]
						{
							(Object)String.Concat("___NULL___", ((Object)nullCardInfo.NulledSorce).name),
							(object)CS$<>8__locals0.player.playerID,
							(object)reassign,
							(Object)twoLetterCode,
							(object)forceDisplay,
							(object)forceDisplayDelay
						});
					}
					else
					{
						NetworkingManager.RPC(typeof(Cards), "RPCA_AssignCardWithoutCardBar", (object[])(object)new Object[6]
						{
							(Object)String.Concat("___NULL___", ((Object)nullCardInfo.NulledSorce).name),
							(object)CS$<>8__locals0.player.playerID,
							(object)reassign,
							(Object)twoLetterCode,
							(object)forceDisplay,
							(object)forceDisplayDelay
						});
					}
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPrefix]
		public static bool RPC(string cardObjectName, int playerID, bool reassign, string twoLetterCode, float forceDisplay, float forceDisplayDelay, bool addToCardBar)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			if (cardObjectName.StartsWith("___NULL___"))
			{
				<>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0();
				CS$<>8__locals0.playerToUpgrade = (Player)ExtensionMethods.InvokeMethod((object)PlayerManager.instance, "GetPlayerWithID", (object[])(object)new Object[1] { (object)playerID });
				CS$<>8__locals0.card = NullManager.instance.GetNullCardInfo(cardObjectName.Substring(10), CS$<>8__locals0.playerToUpgrade);
				CS$<>8__locals0.playerToUpgrade.data.currentCards.Add((CardInfo)(object)CS$<>8__locals0.card);
				NullManager.instance.callbacks.ForEach((Action<Action<NullCardInfo, Player>>)delegate(Action<NullCardInfo, Player> c)
				{
					try
					{
						c.Invoke(CS$<>8__locals0.card, CS$<>8__locals0.playerToUpgrade);
					}
					catch (Object)
					{
					}
				});
				if (addToCardBar)
				{
					Cards.SilentAddToCardBar(CS$<>8__locals0.playerToUpgrade.playerID, (CardInfo)(object)CS$<>8__locals0.card, twoLetterCode, forceDisplay, forceDisplayDelay);
				}
				return false;
			}
			return true;
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		public static void GetCardInfoWithName(string cardName, ref CardInfo __result)
		{
			if ((Object)(object)__result == (Object)null && cardName.StartsWith("___NULL___"))
			{
				__result = (CardInfo)(object)NullManager.instance.GetNullCardInfo(cardName.Substring(10), -1);
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class ApplyCardStatsPatch : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public NullCardInfo nullCard;

			public Player ___playerToUpgrade;

			public NullCardInfo nullCard2;

			internal void <Postfix>b__0(Action<NullCardInfo, Player> c)
			{
				try
				{
					c.Invoke(nullCard, ___playerToUpgrade);
				}
				catch (Object)
				{
				}
			}

			internal void <Postfix>b__1(Action<NullCardInfo, Player> c)
			{
				try
				{
					c.Invoke(nullCard2, ___playerToUpgrade);
				}
				catch (Object)
				{
				}
			}
		}

		private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
		{
			//IL_0043: 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)
			<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
			CS$<>8__locals0.___playerToUpgrade = ___playerToUpgrade;
			CardInfo component = ((Component)__instance).GetComponent<CardInfo>();
			CS$<>8__locals0.nullCard = component as NullCardInfo;
			if (CS$<>8__locals0.nullCard != null)
			{
				CS$<>8__locals0.___playerToUpgrade.data.stats.AjustNulls(-NullManager.instance.GetNullValue(((CardInfo)CS$<>8__locals0.nullCard).rarity));
				NullManager.instance.callbacks.ForEach((Action<Action<NullCardInfo, Player>>)delegate(Action<NullCardInfo, Player> c)
				{
					try
					{
						c.Invoke(CS$<>8__locals0.nullCard, CS$<>8__locals0.___playerToUpgrade);
					}
					catch (Object)
					{
					}
				});
			}
			component = ((Component)__instance).GetComponent<CardInfo>().sourceCard;
			CS$<>8__locals0.nullCard2 = component as NullCardInfo;
			if (CS$<>8__locals0.nullCard2 == null)
			{
				return;
			}
			CS$<>8__locals0.___playerToUpgrade.data.stats.AjustNulls(-NullManager.instance.GetNullValue(((CardInfo)CS$<>8__locals0.nullCard2).rarity));
			NullManager.instance.callbacks.ForEach((Action<Action<NullCardInfo, Player>>)delegate(Action<NullCardInfo, Player> c)
			{
				try
				{
					c.Invoke(CS$<>8__locals0.nullCard2, CS$<>8__locals0.___playerToUpgrade);
				}
				catch (Object)
				{
				}
			});
		}
	}
	public class GameSaverPatch : Object
	{
		public static void Patch()
		{
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Expected O, but got Unknown
			Main.harmony.Patch((MethodBase)(object)typeof(PlayerData).GetConstructor((Type[])(object)new Type[7]
			{
				typeof(String),
				typeof(Int32),
				typeof(List<CardInfo>),
				typeof(Int32),
				typeof(Int32),
				typeof(Boolean),
				typeof(UInt64)
			}), (HarmonyMethod)null, new HarmonyMethod(typeof(GameSaverPatch).GetMethod("Constructor")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static void Constructor(List<CardInfo> cards, PlayerData __instance)
		{
			for (int i = 0; i < cards.Count; i++)
			{
				if (cards[i] is NullCardInfo nullCardInfo)
				{
					__instance.serializedCards[i] = String.Concat("___NULL___", ((Object)nullCardInfo.NulledSorce).name);
				}
			}
		}
	}
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Root.Null", "NullManager", "1.2.1")]
	[BepInProcess("Rounds.exe")]
	public class Main : BaseUnityPlugin
	{
		private const string ModId = "com.Root.Null";

		private const string ModName = "NullManager";

		public const string Version = "1.2.1";

		internal static AssetBundle Assets;

		internal static Harmony harmony;

		[field: CompilerGenerated]
		public static Main instance
		{
			[CompilerGenerated]
			get;
			[CompilerGenerated]
			private set;
		}

		private void Awake()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			harmony = new Harmony("com.Root.Null");
			harmony.PatchAll();
			instance = this;
			Assets = AssetUtils.LoadAssetBundleFromResources("nullassets", typeof(Main).Assembly);
			NullManager.instance = Assets.LoadAsset<GameObject>("NullManger").GetComponent<NullManager>();
			PhotonNetwork.PrefabPool.RegisterPrefab(((Object)NullManager.instance.NullCard).name, NullManager.instance.NullCard);
		}

		private void Start()
		{
			List<BaseUnityPlugin> obj = (List<BaseUnityPlugin>)typeof(Chainloader).GetField("_plugins", (BindingFlags)40).GetValue((object)null);
			if (obj.Exists((Predicate<BaseUnityPlugin>)((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "com.willuwontu.rounds.tabinfo")))
			{
				TabinfoInterface.Setup();
			}
			if (obj.Exists((Predicate<BaseUnityPlugin>)((BaseUnityPlugin plugin) => plugin.Info.Metadata.GUID == "ot.dan.rounds.gamesaver")))
			{
				GameSaverPatch.Patch();
			}
			NullManager.instance.SetUp();
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)RestNulls);
		}

		[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
		internal IEnumerator RestNulls(object _)
		{
			PlayerManager.instance.players.ForEach((Action<Player>)delegate(Player p)
			{
				p.data.stats.GetNullData().nulls = 0;
			});
			yield break;
		}
	}
	public class NullCard : MonoBehaviour, IPunInstantiateMagicCallback
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public object[] data;

			public NullCard <>4__this;

			public Action<TextMeshProUGUI> <>9__4;

			internal bool <OnPhotonInstantiate>b__0(Player p)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Invalid comparison between I4 and Unknown
				return p.playerID == (int)(Int32)data[2];
			}

			internal void <OnPhotonInstantiate>b__1()
			{
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Expected O, but got Unknown
				<>c__DisplayClass0_1 CS$<>8__locals0 = new <>c__DisplayClass0_1
				{
					CS$<>8__locals1 = this
				};
				Object.DestroyImmediate((Object)(object)((Component)((Component)<>4__this).gameObject.transform.GetChild(0)).gameObject);
				((Component)<>4__this).gameObject.SetActive(false);
				CS$<>8__locals0.temp = Object.Instantiate<GameObject>(((Component)((NullCardInfo)(object)((Component)<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce).gameObject, ((Component)<>4__this).transform);
				CS$<>8__locals0.temp.GetComponent<CardInfo>().cardDestription = "";
				CS$<>8__locals0.temp.GetComponent<CardInfo>().cardStats = ((Component)<>4__this).GetComponent<CardInfo>().sourceCard.cardStats;
				((Component)<>4__this).gameObject.SetActive(true);
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Main.instance, 4, (Action)delegate
				{
					for (int i = 0; i < CS$<>8__locals0.temp.transform.childCount; i++)
					{
						CS$<>8__locals0.temp.transform.GetChild(i).SetParent(((Component)CS$<>8__locals0.CS$<>8__locals1.<>4__this).transform, false);
					}
					Object.DestroyImmediate((Object)(object)CS$<>8__locals0.temp);
					Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)CS$<>8__locals0.CS$<>8__locals1.<>4__this).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
					{
						image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
						image.type = (Type)2;
					});
					Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)CS$<>8__locals0.CS$<>8__locals1.<>4__this).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
					{
						if (((TMP_Text)text).text == ((NullCardInfo)(object)((Component)CS$<>8__locals0.CS$<>8__locals1.<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce.cardName.ToUpper())
						{
							((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
						}
					});
				});
			}

			internal void <OnPhotonInstantiate>b__4(TextMeshProUGUI text)
			{
				if (((TMP_Text)text).text == ((NullCardInfo)(object)((Component)<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce.cardName.ToUpper())
				{
					((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
				}
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_1 : Object
		{
			public GameObject temp;

			public <>c__DisplayClass0_0 CS$<>8__locals1;

			internal void <OnPhotonInstantiate>b__2()
			{
				for (int i = 0; i < temp.transform.childCount; i++)
				{
					temp.transform.GetChild(i).SetParent(((Component)CS$<>8__locals1.<>4__this).transform, false);
				}
				Object.DestroyImmediate((Object)(object)temp);
				Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)CS$<>8__locals1.<>4__this).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
				{
					image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
					image.type = (Type)2;
				});
				Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)CS$<>8__locals1.<>4__this).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
				{
					if (((TMP_Text)text).text == ((NullCardInfo)(object)((Component)CS$<>8__locals1.<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce.cardName.ToUpper())
					{
						((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
					}
				});
			}
		}

		public void OnPhotonInstantiate(PhotonMessageInfo info)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Expected O, but got Unknown
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c0: Expected O, but got Unknown
			<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
			CS$<>8__locals0.<>4__this = this;
			CS$<>8__locals0.data = info.photonView.InstantiationData;
			((Component)this).transform.localScale = (Vector3)CS$<>8__locals0.data[0];
			((Component)this).GetComponent<CardInfo>().sourceCard = (CardInfo)(object)NullManager.instance.GetNullCardInfo((string)(String)CS$<>8__locals0.data[1], PlayerManager.instance.players.Find((Predicate<Player>)((Player p) => p.playerID == (int)(Int32)CS$<>8__locals0.data[2])));
			((Component)this).GetComponent<CardInfo>().cardBase = ((Component)this).GetComponent<CardInfo>().sourceCard.cardBase;
			((Component)this).GetComponent<CardInfo>().rarity = ((Component)this).GetComponent<CardInfo>().sourceCard.rarity;
			ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Main.instance, 2, (Action)delegate
			{
				//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d5: Expected O, but got Unknown
				<>c__DisplayClass0_1 CS$<>8__locals1 = new <>c__DisplayClass0_1
				{
					CS$<>8__locals1 = CS$<>8__locals0
				};
				Object.DestroyImmediate((Object)(object)((Component)((Component)CS$<>8__locals0.<>4__this).gameObject.transform.GetChild(0)).gameObject);
				((Component)CS$<>8__locals0.<>4__this).gameObject.SetActive(false);
				CS$<>8__locals1.temp = Object.Instantiate<GameObject>(((Component)((NullCardInfo)(object)((Component)CS$<>8__locals0.<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce).gameObject, ((Component)CS$<>8__locals0.<>4__this).transform);
				CS$<>8__locals1.temp.GetComponent<CardInfo>().cardDestription = "";
				CS$<>8__locals1.temp.GetComponent<CardInfo>().cardStats = ((Component)CS$<>8__locals0.<>4__this).GetComponent<CardInfo>().sourceCard.cardStats;
				((Component)CS$<>8__locals0.<>4__this).gameObject.SetActive(true);
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Main.instance, 4, (Action)delegate
				{
					for (int i = 0; i < CS$<>8__locals1.temp.transform.childCount; i++)
					{
						CS$<>8__locals1.temp.transform.GetChild(i).SetParent(((Component)CS$<>8__locals1.CS$<>8__locals1.<>4__this).transform, false);
					}
					Object.DestroyImmediate((Object)(object)CS$<>8__locals1.temp);
					Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)CS$<>8__locals1.CS$<>8__locals1.<>4__this).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
					{
						image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
						image.type = (Type)2;
					});
					Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)CS$<>8__locals1.CS$<>8__locals1.<>4__this).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
					{
						if (((TMP_Text)text).text == ((NullCardInfo)(object)((Component)CS$<>8__locals1.CS$<>8__locals1.<>4__this).GetComponent<CardInfo>().sourceCard).NulledSorce.cardName.ToUpper())
						{
							((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
						}
					});
				});
			});
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class NullCardBar : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public CardInfo card;

			public Action<TextMeshProUGUI> <>9__2;

			internal void <Prefix>b__0()
			{
				if ((Object)(object)card != (Object)null)
				{
					Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)card).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
					{
						image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
						image.type = (Type)2;
					});
				}
				Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)card).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
				{
					if (((TMP_Text)text).text == card.cardName.ToUpper())
					{
						((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
					}
				});
				((TMP_Text)((Component)card).GetComponentInChildren<CardVisuals>().nameText).text = ((TMP_Text)((Component)card).GetComponentInChildren<CardVisuals>().nameText).text.Substring(2);
			}

			internal void <Prefix>b__2(TextMeshProUGUI text)
			{
				if (((TMP_Text)text).text == card.cardName.ToUpper())
				{
					((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
				}
			}
		}

		private static bool Prefix(CardInfo cardToSpawn, Vector3 pos, ref GameObject __result)
		{
			//IL_0013: Unknown result type (might be due to invalid IL or missing references)
			//IL_0019: Expected O, but got Unknown
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Expected O, but got Unknown
			if (cardToSpawn is NullCardInfo nullCardInfo)
			{
				<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
				GameObject val = new GameObject();
				NullCardInfo nullCardInfo2 = NullManager.instance.GetNullCardInfo(((Object)nullCardInfo.NulledSorce).name, nullCardInfo.PlayerId);
				val.SetActive(false);
				Debug.Log((object)".Instantiate");
				__result = Object.Instantiate<GameObject>(((Component)(CardInfo)typeof(CardChoiceSpawnUniqueCardPatch).GetField("NullCard", (BindingFlags)40).GetValue((object)null)).gameObject, pos, Quaternion.identity, val.transform);
				CS$<>8__locals0.card = __result.GetComponent<CardInfo>();
				Object.DestroyImmediate((Object)(object)CS$<>8__locals0.card);
				CS$<>8__locals0.card = CopyComponent<CardInfo>((CardInfo)(object)nullCardInfo2, __result);
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Main.instance, 2, (Action)delegate
				{
					if ((Object)(object)CS$<>8__locals0.card != (Object)null)
					{
						Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)CS$<>8__locals0.card).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
						{
							image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
							image.type = (Type)2;
						});
					}
					Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)CS$<>8__locals0.card).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
					{
						if (((TMP_Text)text).text == CS$<>8__locals0.card.cardName.ToUpper())
						{
							((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
						}
					});
					((TMP_Text)((Component)CS$<>8__locals0.card).GetComponentInChildren<CardVisuals>().nameText).text = ((TMP_Text)((Component)CS$<>8__locals0.card).GetComponentInChildren<CardVisuals>().nameText).text.Substring(2);
				});
				Debug.Log((object)"sanity check");
				__result.transform.SetParent((Transform)null, true);
				Object.Destroy((Object)(object)val);
				__result.GetComponentInChildren<CardVisuals>().firstValueToSet = true;
				return false;
			}
			return true;
		}

		private static T CopyComponent<T>(T original, GameObject destination) where T : Component
		{
			Type type = ((Object)original).GetType();
			Component val = destination.AddComponent(type);
			FieldInfo[] fields = type.GetFields();
			foreach (FieldInfo val2 in fields)
			{
				val2.SetValue((object)val, val2.GetValue((object)original));
			}
			return (T)(object)((val is T) ? val : null);
		}
	}
	public class NullCardInfo : CardInfo
	{
		public CardInfo NulledSorce;

		public int PlayerId;

		internal bool randomCard;
	}
	[Serializable]
	public class CharacterStatModifiersnullData : Object
	{
		public int nulls;

		public CharacterStatModifiersnullData()
		{
			nulls = 0;
		}

		public void Reset()
		{
		}
	}
	public static class CharacterStatModifiersExtension : Object
	{
		public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersnullData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersnullData>();

		internal static CharacterStatModifiersnullData GetNullData(this CharacterStatModifiers characterstats)
		{
			return data.GetOrCreateValue(characterstats);
		}

		public static void AjustNulls(this CharacterStatModifiers characterstats, int value)
		{
			characterstats.GetNullData().nulls = Mathf.Clamp(characterstats.GetNullData().nulls + value, 0, 1000000);
		}

		public static int GetNulls(this CharacterStatModifiers characterstats)
		{
			return characterstats.GetNullData().nulls;
		}

		internal static void AddData(this CharacterStatModifiers characterstats, CharacterStatModifiersnullData value)
		{
			try
			{
				data.Add(characterstats, value);
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class CharacterStatModifiersPatchResetStats : Object
	{
		private static void Prefix(CharacterStatModifiers __instance)
		{
			__instance.GetNullData().Reset();
		}
	}
	[Serializable]
	public class CardInfoAdditionalData : Object
	{
		public bool isAntiCard;

		public bool nullAble;

		public bool needsNull;

		public CardInfoAdditionalData()
		{
			isAntiCard = false;
			nullAble = true;
			needsNull = false;
		}
	}
	public static class CardInfoExtension : Object
	{
		public static readonly ConditionalWeakTable<CardInfo, CardInfoAdditionalData> data = new ConditionalWeakTable<CardInfo, CardInfoAdditionalData>();

		internal static CardInfoAdditionalData GetNullData(this CardInfo cardInfo)
		{
			return data.GetOrCreateValue(cardInfo);
		}

		public static CardInfo SetAntiCard(this CardInfo cardInfo)
		{
			cardInfo.GetNullData().isAntiCard = true;
			return cardInfo;
		}

		public static bool IsAntiCard(this CardInfo cardInfo)
		{
			return cardInfo.GetNullData().isAntiCard;
		}

		public static CardInfo MarkUnNullable(this CardInfo cardInfo)
		{
			cardInfo.GetNullData().nullAble = false;
			return cardInfo;
		}

		public static bool IsNullable(this CardInfo cardInfo)
		{
			return cardInfo.GetNullData().nullAble;
		}

		public static CardInfo NeedsNull(this CardInfo cardInfo)
		{
			cardInfo.GetNullData().needsNull = true;
			return cardInfo;
		}

		public static void AddData(this CardInfo cardInfo, CardInfoAdditionalData value)
		{
			try
			{
				data.Add(cardInfo, value);
			}
			catch (Exception)
			{
			}
		}
	}
	public static class PlayerExtensions : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public Rarity rarity;

			internal bool <GetNullCount>b__1(CardInfo c)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				if (c is NullCardInfo nullCardInfo)
				{
					return nullCardInfo.NulledSorce.rarity == rarity;
				}
				return false;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0 : Object
		{
			public Rarity rarity;

			internal bool <GetNullValue>b__2(CardInfo c)
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				//IL_0016: Unknown result type (might be due to invalid IL or missing references)
				if (c is NullCardInfo nullCardInfo)
				{
					return nullCardInfo.NulledSorce.rarity == rarity;
				}
				return false;
			}
		}

		public static int GetNullCount(this Player player, Rarity rarity = -1)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
			CS$<>8__locals0.rarity = rarity;
			if ((int)CS$<>8__locals0.rarity == -1)
			{
				return Enumerable.Count<CardInfo>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo c) => c is NullCardInfo)));
			}
			return Enumerable.Count<CardInfo>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo c) => c is NullCardInfo nullCardInfo && nullCardInfo.NulledSorce.rarity == CS$<>8__locals0.rarity)));
		}

		public static int GetNullValue(this Player player, Rarity rarity = -1)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Invalid comparison between Unknown and I4
			<>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0();
			CS$<>8__locals0.rarity = rarity;
			if ((int)CS$<>8__locals0.rarity == -1)
			{
				return Enumerable.Sum(Enumerable.Select<CardInfo, int>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo c) => c is NullCardInfo)), (Func<CardInfo, int>)((CardInfo c) => NullManager.instance.GetNullValue(c.rarity))));
			}
			return Enumerable.Sum(Enumerable.Select<CardInfo, int>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo c) => c is NullCardInfo nullCardInfo && nullCardInfo.NulledSorce.rarity == CS$<>8__locals0.rarity)), (Func<CardInfo, int>)((CardInfo c) => NullManager.instance.GetNullValue(c.rarity))));
		}
	}
	public class NullManager : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass11_0 : Object
		{
			public Rarity rarity;

			public Player player;

			internal bool <GetRandomNullWithRarity>b__0(Card cardData)
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				if (cardData.enabled && cardData.cardInfo.rarity == rarity)
				{
					return Cards.instance.PlayerIsAllowedCard(player, cardData.cardInfo);
				}
				return false;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass9_0 : Object
		{
			public List<CardInfoStat> list;

			public Action<CardInfoStat> <>9__2;

			public Action<CardInfoStat> <>9__3;

			internal void <GetNullCardInfo>b__0(CardInfoStat[] stats)
			{
				Enumerable.ToList<CardInfoStat>((IEnumerable<CardInfoStat>)(object)stats).ForEach((Action<CardInfoStat>)delegate(CardInfoStat stat)
				{
					list.Add(stat);
				});
			}

			internal void <GetNullCardInfo>b__2(CardInfoStat stat)
			{
				list.Add(stat);
			}

			internal void <GetNullCardInfo>b__1(CardInfoStat[] stats)
			{
				Enumerable.ToList<CardInfoStat>((IEnumerable<CardInfoStat>)(object)stats).ForEach((Action<CardInfoStat>)delegate(CardInfoStat stat)
				{
					list.Add(stat);
				});
			}

			internal void <GetNullCardInfo>b__3(CardInfoStat stat)
			{
				list.Add(stat);
			}
		}

		public static NullManager instance;

		public GameObject AntiCardBase;

		public GameObject NullCard;

		private Dictionary<int, Dictionary<string, NullCardInfo>> nullDic = new Dictionary<int, Dictionary<string, NullCardInfo>>();

		private Dictionary<int, Dictionary<string, CardInfoStat[]>> NullStats = new Dictionary<int, Dictionary<string, CardInfoStat[]>>();

		private Dictionary<int, Dictionary<Rarity, Dictionary<string, CardInfoStat[]>>> NullRarityStats = new Dictionary<int, Dictionary<Rarity, Dictionary<string, CardInfoStat[]>>>();

		internal List<Action<NullCardInfo, Player>> callbacks = new List<Action<NullCardInfo, Player>>();

		internal void SetUp()
		{
			Enumerable.ToList<Rarity>(RarityUtils.Rarities.Values).ForEach((Action<Rarity>)([CompilerGenerated] (Rarity rarity) =>
			{
				//IL_000e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0013: Unknown result type (might be due to invalid IL or missing references)
				NullCardInfo nullCardInfo = ((Component)this).gameObject.AddComponent<NullCardInfo>();
				((CardInfo)nullCardInfo).rarity = rarity.value;
				((Object)nullCardInfo).name = "[]";
				((CardInfo)nullCardInfo).cardDestription = "Adds a random nulled card of this rarity to a player";
				nullCardInfo.randomCard = true;
				((CardInfo)nullCardInfo).categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("nullCard") };
				((CardInfo)nullCardInfo).blacklistedCategories = (CardCategory[])(object)new CardCategory[0];
				Cards.instance.AddHiddenCard((CardInfo)(object)nullCardInfo);
			}));
		}

		public int GetNullValue(Rarity rarity)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			return (int)(1f / RarityUtils.GetRarityData(rarity).relativeRarity);
		}

		public NullCardInfo GetNullCardInfo(string card, int player)
		{
			//IL_0122: Unknown result type (might be due to invalid IL or missing references)
			//IL_013e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0143: Unknown result type (might be due to invalid IL or missing references)
			//IL_014a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: 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_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_016a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0185: Expected O, but got Unknown
			//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass9_0 CS$<>8__locals0 = new <>c__DisplayClass9_0();
			if (!nullDic.ContainsKey(player))
			{
				nullDic[player] = new Dictionary<string, NullCardInfo>();
			}
			Dictionary<string, NullCardInfo> val = nullDic[player];
			if (!val.ContainsKey(card))
			{
				NullCardInfo nullCardInfo = ((Component)this).gameObject.AddComponent<NullCardInfo>();
				nullCardInfo.NulledSorce = ((DefaultPool)PhotonNetwork.PrefabPool).ResourceCache[card].GetComponent<CardInfo>();
				nullCardInfo.PlayerId = player;
				((CardInfo)nullCardInfo).cardName = String.Concat("[]", nullCardInfo.NulledSorce.cardName);
				((CardInfo)nullCardInfo).rarity = nullCardInfo.NulledSorce.rarity;
				((CardInfo)nullCardInfo).blacklistedCategories = (CardCategory[])(object)new CardCategory[0];
				((CardInfo)(object)nullCardInfo).GetNullData().isAntiCard = false;
				((CardInfo)nullCardInfo).sourceCard = (CardInfo)(object)nullCardInfo;
				((CardInfo)nullCardInfo).categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("nullCard") };
				((CardInfo)nullCardInfo).cardBase = nullCardInfo.NulledSorce.cardBase;
				((CardInfo)nullCardInfo).colorTheme = nullCardInfo.NulledSorce.colorTheme;
				((CardInfo)nullCardInfo).cardArt = nullCardInfo.NulledSorce.cardArt;
				val[card] = nullCardInfo;
			}
			int nullValue = GetNullValue(val[card].NulledSorce.rarity);
			CS$<>8__locals0.list = new List<CardInfoStat>();
			CS$<>8__locals0.list.Add(new CardInfoStat
			{
				positive = true,
				stat = String.Concat("null", (nullValue == 1) ? "" : "s"),
				amount = String.Format("- <b>{0}</b> ", (object)nullValue)
			});
			if (NullStats.ContainsKey(player))
			{
				Enumerable.ToList<CardInfoStat[]>((IEnumerable<CardInfoStat[]>)(object)NullStats[player].Values).ForEach((Action<CardInfoStat[]>)delegate(CardInfoStat[] stats)
				{
					Enumerable.ToList<CardInfoStat>((IEnumerable<CardInfoStat>)(object)stats).ForEach((Action<CardInfoStat>)delegate(CardInfoStat stat)
					{
						CS$<>8__locals0.list.Add(stat);
					});
				});
			}
			if (NullRarityStats.ContainsKey(player) && NullRarityStats[player].ContainsKey(val[card].NulledSorce.rarity))
			{
				Enumerable.ToList<CardInfoStat[]>((IEnumerable<CardInfoStat[]>)(object)NullRarityStats[player][val[card].NulledSorce.rarity].Values).ForEach((Action<CardInfoStat[]>)delegate(CardInfoStat[] stats)
				{
					Enumerable.ToList<CardInfoStat>((IEnumerable<CardInfoStat>)(object)stats).ForEach((Action<CardInfoStat>)delegate(CardInfoStat stat)
					{
						CS$<>8__locals0.list.Add(stat);
					});
				});
			}
			((CardInfo)val[card]).cardStats = CS$<>8__locals0.list.ToArray();
			return val[card];
		}

		public NullCardInfo GetNullCardInfo(string card, Player player)
		{
			return GetNullCardInfo(card, player.playerID);
		}

		public NullCardInfo GetRandomNullWithRarity(Player player, Rarity rarity)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			<>c__DisplayClass11_0 CS$<>8__locals0 = new <>c__DisplayClass11_0();
			CS$<>8__locals0.rarity = rarity;
			CS$<>8__locals0.player = player;
			List<string> val = Enumerable.ToList<string>(Enumerable.Select<Card, string>(Enumerable.Where<Card>((IEnumerable<Card>)(object)Enumerable.ToArray<Card>((IEnumerable<Card>)(object)CardManager.cards.Values), (Func<Card, bool>)((Card cardData) => cardData.enabled && cardData.cardInfo.rarity == CS$<>8__locals0.rarity && Cards.instance.PlayerIsAllowedCard(CS$<>8__locals0.player, cardData.cardInfo))), (Func<Card, string>)((Card card) => ((Object)card.cardInfo).name)));
			if (val.Count == 0)
			{
				val.Add("__NULL__  ");
			}
			ExtensionMethods.Shuffle<string>((IList<string>)(object)val);
			return GetNullCardInfo(val[0], CS$<>8__locals0.player);
		}

		public void RegesterOnAddCallback(Action<NullCardInfo, Player> action)
		{
			callbacks.Add(action);
		}

		public void SetAdditionalNullStats(Player player, string key, CardInfoStat[] stats)
		{
			if (!NullStats.ContainsKey(player.playerID))
			{
				NullStats[player.playerID] = new Dictionary<string, CardInfoStat[]>();
			}
			NullStats[player.playerID][key] = stats;
		}

		public void SetRarityNullStats(Player player, Rarity rarity, string key, CardInfoStat[] stats)
		{
			//IL_003a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			if (!NullRarityStats.ContainsKey(player.playerID))
			{
				NullRarityStats[player.playerID] = new Dictionary<Rarity, Dictionary<string, CardInfoStat[]>>();
			}
			if (!NullRarityStats[player.playerID].ContainsKey(rarity))
			{
				NullRarityStats[player.playerID][rarity] = new Dictionary<string, CardInfoStat[]>();
			}
			NullRarityStats[player.playerID][rarity][key] = stats;
		}
	}
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	internal class SpawnNulls : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass0_0 : Object
		{
			public GameObject old;

			internal void <Postfix>b__0()
			{
				PhotonNetwork.Destroy(old);
			}
		}

		[HarmonyPriority(0)]
		private static void Postfix(List<GameObject> ___spawnedCards, int ___pickrID, ref GameObject __result)
		{
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Expected O, but got Unknown
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
			Player playerWithID = GetPlayerWithID(___pickrID);
			if ((Object)(object)playerWithID != (Object)null && !__result.GetComponent<CardInfo>().sourceCard.GetNullData().isAntiCard && __result.GetComponent<CardInfo>().sourceCard.GetNullData().nullAble && nullTotal(___spawnedCards) < playerWithID.data.stats.GetNullData().nulls)
			{
				<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
				CS$<>8__locals0.old = __result;
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Main.instance, 3, (Action)delegate
				{
					PhotonNetwork.Destroy(CS$<>8__locals0.old);
				});
				__result = PhotonNetwork.Instantiate(((Object)NullManager.instance.NullCard).name, __result.transform.position, __result.transform.rotation, (byte)0, (object[])(object)new Object[3]
				{
					(object)__result.transform.localScale,
					(Object)((Object)__result.GetComponent<CardInfo>().sourceCard).name,
					(object)___pickrID
				});
				((Object)__result).name = ((Object)CS$<>8__locals0.old).name;
			}
		}

		private static int nullTotal(List<GameObject> spawnedCards)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			if (spawnedCards == null)
			{
				return 0;
			}
			try
			{
				int num = 0;
				Enumerator<GameObject> enumerator = spawnedCards.GetEnumerator();
				try
				{
					while (enumerator.MoveNext())
					{
						if (enumerator.Current.GetComponent<CardInfo>().sourceCard is NullCardInfo nullCardInfo)
						{
							num += NullManager.instance.GetNullValue(nullCardInfo.NulledSorce.rarity);
						}
					}
				}
				finally
				{
					((IDisposable)enumerator).Dispose();
				}
				return num;
			}
			catch (Object)
			{
				return 0;
			}
		}

		internal static Player GetPlayerWithID(int playerID)
		{
			for (int i = 0; i < PlayerManager.instance.players.Count; i++)
			{
				if (PlayerManager.instance.players[i].playerID == playerID)
				{
					return PlayerManager.instance.players[i];
				}
			}
			return null;
		}

		[HarmonyPatch(/*Could not decode attribute arguments.*/)]
		[HarmonyPostfix]
		private static void PatchAllowed(Player player, CardInfo card, ref bool __result)
		{
			if ((Object)(object)player == (Object)null || (Object)(object)card == (Object)null)
			{
				return;
			}
			if (__result && card.GetNullData().isAntiCard)
			{
				if (CardChoice.instance.IsPicking && player.playerID == CardChoice.instance.pickrID && nullTotal((List<GameObject>)ExtensionMethods.GetFieldValue((object)CardChoice.instance, "spawnedCards")) < player.data.stats.GetNullData().nulls)
				{
					__result = true;
					return;
				}
				__result = false;
			}
			if (__result && card.GetNullData().needsNull)
			{
				if (player.data.stats.GetNullData().nulls > 0 || player.GetNullCount((Rarity)(-1)) > 0)
				{
					__result = true;
				}
				else
				{
					__result = false;
				}
			}
		}
	}
	public class TabinfoInterface : Object
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0 : Object
		{
			public GameObject cardObj;

			public CardInfo card;

			public Action<TextMeshProUGUI> <>9__3;

			internal void <Prefix>b__0()
			{
				//IL_000b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0015: Unknown result type (might be due to invalid IL or missing references)
				cardObj.transform.localScale = Vector3.one * 25f;
			}

			internal void <Prefix>b__1()
			{
				if ((Object)(object)card != (Object)null)
				{
					Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)card).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
					{
						image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
						image.type = (Type)2;
					});
				}
				Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)card).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
				{
					if (((TMP_Text)text).text == card.cardName.ToUpper())
					{
						((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
					}
				});
			}

			internal void <Prefix>b__3(TextMeshProUGUI text)
			{
				if (((TMP_Text)text).text == card.cardName.ToUpper())
				{
					((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
				}
			}
		}

		public static void Setup()
		{
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			TabInfoManager.RegisterStat(TabInfoManager.RegisterCategory("null", 7), "Nulls", (Func<Player, bool>)((Player p) => p.data.stats.GetNullData().nulls > 0), (Func<Player, string>)((Player p) => String.Format("{0}", (object)p.data.stats.GetNullData().nulls)));
			Main.harmony.Patch((MethodBase)(object)typeof(PlayerCardButton).GetMethod("OnPointerEnter"), new HarmonyMethod(typeof(TabinfoInterface).GetMethod("Prefix")), (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null, (HarmonyMethod)null);
		}

		public static bool Prefix(PlayerCardButton __instance, PointerEventData eventData)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0075: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Expected O, but got Unknown
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_0188: 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_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Expected O, but got Unknown
			//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Expected O, but got Unknown
			if (__instance.card is NullCardInfo nullCardInfo)
			{
				<>c__DisplayClass1_0 CS$<>8__locals0 = new <>c__DisplayClass1_0();
				GameObject val = (GameObject)ExtensionMethods.GetFieldValue((object)__instance, "displayedCard");
				if ((Object)(object)val != (Object)null)
				{
					Object.Destroy((Object)(object)val);
				}
				val = Object.Instantiate<GameObject>((GameObject)typeof(TabInfoManager).GetField("cardHolderTemplate", (BindingFlags)40).GetValue((object)null), ((GameObject)typeof(TabInfoManager).GetField("canvas", (BindingFlags)40).GetValue((object)null)).transform);
				val.transform.position = ((Component)__instance).gameObject.transform.position;
				val.SetActive(false);
				CS$<>8__locals0.cardObj = Object.Instantiate<GameObject>(((Component)nullCardInfo.NulledSorce).gameObject, val.transform);
				CS$<>8__locals0.card = CS$<>8__locals0.cardObj.GetComponent<CardInfo>();
				Object.DestroyImmediate((Object)(object)CS$<>8__locals0.card);
				CS$<>8__locals0.card = CopyComponent<CardInfo>((CardInfo)(object)nullCardInfo, CS$<>8__locals0.cardObj);
				val.SetActive(true);
				CS$<>8__locals0.cardObj.GetComponentInChildren<CardVisuals>().firstValueToSet = true;
				CS$<>8__locals0.cardObj.transform.localPosition = Vector3.zero;
				Collider2D[] componentsInChildren = val.GetComponentsInChildren<Collider2D>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					((Behaviour)componentsInChildren[i]).enabled = false;
				}
				CS$<>8__locals0.cardObj.GetComponentInChildren<Canvas>().sortingLayerName = "MostFront";
				((Behaviour)CS$<>8__locals0.cardObj.GetComponentInChildren<GraphicRaycaster>()).enabled = false;
				((Behaviour)CS$<>8__locals0.cardObj.GetComponentInChildren<SetScaleToZero>()).enabled = false;
				((Component)CS$<>8__locals0.cardObj.GetComponentInChildren<SetScaleToZero>()).transform.localScale = Vector3.one * 1.15f;
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)__instance, 1, (Action)delegate
				{
					//IL_000b: Unknown result type (might be due to invalid IL or missing references)
					//IL_0015: Unknown result type (might be due to invalid IL or missing references)
					CS$<>8__locals0.cardObj.transform.localScale = Vector3.one * 25f;
				});
				ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)__instance, 2, (Action)delegate
				{
					if ((Object)(object)CS$<>8__locals0.card != (Object)null)
					{
						Enumerable.ToList<Image>((IEnumerable<Image>)(object)((Component)CS$<>8__locals0.card).GetComponentsInChildren<Image>()).ForEach((Action<Image>)delegate(Image image)
						{
							image.sprite = Main.Assets.LoadAsset<Sprite>("missing_texture");
							image.type = (Type)2;
						});
					}
					Enumerable.ToList<TextMeshProUGUI>((IEnumerable<TextMeshProUGUI>)(object)((Component)CS$<>8__locals0.card).GetComponentsInChildren<TextMeshProUGUI>()).ForEach((Action<TextMeshProUGUI>)delegate(TextMeshProUGUI text)
					{
						if (((TMP_Text)text).text == CS$<>8__locals0.card.cardName.ToUpper())
						{
							((TMP_Text)text).font = Main.Assets.LoadAsset<TMP_FontAsset>("Nightmare");
						}
					});
				});
				ExtensionMethods.SetFieldValue((object)__instance, "displayedCard", (object)val);
				return false;
			}
			return true;
		}

		private static GameObject Instantiate(GameObject cardHolderTemplate, Transform transform)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			throw new NotImplementedException();
		}

		private static T CopyComponent<T>(T original, GameObject destination) where T : Component
		{
			Type type = ((Object)original).GetType();
			Component val = destination.AddComponent(type);
			FieldInfo[] fields = type.GetFields();
			foreach (FieldInfo val2 in fields)
			{
				val2.SetValue((object)val, val2.GetValue((object)original));
			}
			return (T)(object)((val is T) ? val : null);
		}
	}
}