Decompiled source of OwlCards v0.2.0

OwlCards.dll

Decompiled 7 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using ModdingUtils.Extensions;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using OwlCards.Cards;
using OwlCards.Dependencies;
using OwlCards.Extensions;
using OwlCards.Logic;
using OwlCards.UI;
using Photon.Pun;
using RarityLib.Utils;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using WillsWackyManagers.Utils;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("OwlCards")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+fc086dec194f0693ae7cefabacd57ffa2f7ccd16")]
[assembly: AssemblyProduct("OwlCards")]
[assembly: AssemblyTitle("OwlCards")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace OwlCards
{
	internal static class OptionMenu
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__0_0;

			public static UnityAction<float> <>9__1_1;

			public static UnityAction<float> <>9__1_2;

			public static UnityAction<float> <>9__1_3;

			public static UnityAction<float> <>9__1_4;

			public static UnityAction<bool> <>9__1_0;

			public static UnityAction<float> <>9__1_5;

			internal void <CreateMenu>b__0_0()
			{
			}

			internal void <CreateMenuUI>b__1_1(float newValue)
			{
				OwlCards.instance.soulGainedPerRound.Value = newValue;
			}

			internal void <CreateMenuUI>b__1_2(float newValue)
			{
				OwlCards.instance.soulGainedPerPointWon.Value = newValue;
			}

			internal void <CreateMenuUI>b__1_3(float newValue)
			{
				OwlCards.instance.soulOnGameStart.Value = newValue;
			}

			internal void <CreateMenuUI>b__1_4(float newValue)
			{
				OwlCards.instance.rerollSoulCost.Value = newValue;
			}

			internal void <CreateMenuUI>b__1_0(bool newValue)
			{
				OwlCards.instance.bExtraPickActive.Value = newValue;
			}

			internal void <CreateMenuUI>b__1_5(float newValue)
			{
				OwlCards.instance.extraPickSoulCost.Value = newValue;
			}
		}

		public static void CreateMenu()
		{
			//IL_0019: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			object obj = <>c.<>9__0_0;
			if (obj == null)
			{
				UnityAction val = delegate
				{
				};
				<>c.<>9__0_0 = val;
				obj = (object)val;
			}
			Unbound.RegisterMenu("OwlCards", (UnityAction)obj, (Action<GameObject>)CreateMenuUI, (GameObject)null, false);
		}

		private static void CreateMenuUI(GameObject menu)
		{
			TextMeshProUGUI val = default(TextMeshProUGUI);
			MenuHandler.CreateText("OwlCards Options", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			Slider val2 = default(Slider);
			MenuHandler.CreateSlider("Soul points passively earned per round (not applied to round winner)", menu, 30, 0f, 2f, OwlCards.instance.soulGainedPerRound.Value, (UnityAction<float>)delegate(float newValue)
			{
				OwlCards.instance.soulGainedPerRound.Value = newValue;
			}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateSlider("Extra soul gained per point won (not applied to round winner)", menu, 30, 0f, 1f, OwlCards.instance.soulGainedPerPointWon.Value, (UnityAction<float>)delegate(float newValue)
			{
				OwlCards.instance.soulGainedPerPointWon.Value = newValue;
			}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateSlider("Starting Soul", menu, 30, 0f, 5f, OwlCards.instance.soulOnGameStart.Value, (UnityAction<float>)delegate(float newValue)
			{
				OwlCards.instance.soulOnGameStart.Value = newValue;
			}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateSlider("Cost of reroll (block button)", menu, 30, 0.5f, 3f, OwlCards.instance.rerollSoulCost.Value, (UnityAction<float>)delegate(float newValue)
			{
				OwlCards.instance.rerollSoulCost.Value = newValue;
			}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateToggle(OwlCards.instance.bExtraPickActive.Value, "Allow extra pick option", menu, (UnityAction<bool>)delegate(bool newValue)
			{
				OwlCards.instance.bExtraPickActive.Value = newValue;
			}, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
			MenuHandler.CreateSlider("Cost of extra pick (fire button)", menu, 30, 1f, 10f, OwlCards.instance.extraPickSoulCost.Value, (UnityAction<float>)delegate(float newValue)
			{
				OwlCards.instance.extraPickSoulCost.Value = newValue;
			}, ref val2, true, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
		}
	}
	[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.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.HibouGlorieux.Rounds.OwlCards", "OwlCards", "0.1.0")]
	[BepInProcess("Rounds.exe")]
	public class OwlCards : BaseUnityPlugin
	{
		private const string ModId = "com.HibouGlorieux.Rounds.OwlCards";

		public const string ModName = "OwlCards";

		public const string Version = "0.1.0";

		public const string ModInitials = "OWL";

		private const string LogPrefix = "OwlCards: ";

		public readonly AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("owlcards", typeof(OwlCards).Assembly);

		public ConfigEntry<float> soulOnGameStart;

		public ConfigEntry<float> soulGainedPerRound;

		public ConfigEntry<float> soulGainedPerPointWon;

		public ConfigEntry<float> rerollSoulCost;

		public ConfigEntry<float> extraPickSoulCost;

		public ConfigEntry<bool> bExtraPickActive;

		private List<int[]> pointWinnersID = new List<int[]>();

		public static OwlCards instance { get; private set; }

		public bool bCurseActivated { get; private set; }

		private void Awake()
		{
			//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			bCurseActivated = Chainloader.PluginInfos.ContainsKey("com.willuwontu.rounds.managers");
			soulGainedPerRound = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulGainedPerRound", 0.5f, "How much soul resource is earned passively each round");
			soulGainedPerPointWon = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulGainedPerPointWon", 0.25f, "How much soul resource is earned passively each round");
			soulOnGameStart = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulOnGameStart", 1f, "How much soul you have when a game starts");
			rerollSoulCost = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "rerollSoulCost", 1f, "how much soul does it cost to reroll");
			extraPickSoulCost = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "extraPickSoulCost", 4f, "how much soul does it cost to do an extra pick");
			bExtraPickActive = ((BaseUnityPlugin)this).Config.Bind<bool>("OwlCards", "bExtraPickActive", true, "Enable extra roll");
			new Harmony("com.HibouGlorieux.Rounds.OwlCards").PatchAll();
		}

		private void Start()
		{
			BuildCards();
			Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)OwlCardValidation);
			OptionMenu.CreateMenu();
			((Component)this).gameObject.AddComponent<Reroll>();
			((Component)this).gameObject.AddComponent<Manager>();
			Unbound.RegisterHandshake("com.HibouGlorieux.Rounds.OwlCards", (Action)OnHandshakeCompleted);
			GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)UpdatePlayerResourcesRoundEnd);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)TrackPointWinners);
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart, 600);
		}

		private IEnumerator OnGameStart(IGameModeHandler gm)
		{
			OwlCardCategory.InitializeRarityCategories();
			Card[] array = CardManager.cards.Values.ToArray();
			foreach (Card val in array)
			{
				if (!val.cardInfo.categories.Contains(OwlCardCategory.rarityCategories[val.cardInfo.rarity]))
				{
					val.cardInfo.categories = val.cardInfo.categories.Append(OwlCardCategory.rarityCategories[val.cardInfo.rarity]).ToArray();
				}
			}
			yield break;
		}

		private void OnHandshakeCompleted()
		{
			if (PhotonNetwork.IsMasterClient)
			{
				NetworkingManager.RPC_Others(typeof(OwlCards), "SyncSettings", new object[1] { new float[5] { soulGainedPerRound.Value, soulGainedPerPointWon.Value, soulOnGameStart.Value, rerollSoulCost.Value, extraPickSoulCost.Value } });
			}
		}

		[UnboundRPC]
		private static void SyncSettings(float[] settings)
		{
			instance.soulGainedPerRound.Value = settings[0];
			instance.soulGainedPerPointWon.Value = settings[1];
			instance.soulOnGameStart.Value = settings[2];
			instance.rerollSoulCost.Value = settings[3];
			instance.extraPickSoulCost.Value = settings[4];
		}

		private IEnumerator TrackPointWinners(IGameModeHandler gm)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				pointWinnersID.Add((int[])gm.GetPointWinners().Clone());
			}
			yield break;
		}

		private bool OwlCardValidation(Player player, CardInfo cardInfo)
		{
			if (cardInfo.categories.Contains(OwlCardCategory.modCategory) && AOwlCard.conditions.ContainsKey(cardInfo.cardName))
			{
				return AOwlCard.conditions[cardInfo.cardName](player.data.stats.GetAdditionalData().Soul);
			}
			return true;
		}

		private void BuildCards()
		{
			CustomCard.BuildCard<SoulLeech>();
			CustomCard.BuildCard<FeedMe>();
			CustomCard.BuildCard<LastHitter>();
			CustomCard.BuildCard<Resolution>();
			CustomCard.BuildCard<FunKiller>();
			CustomCard.BuildCard<CorruptedPower>();
			CustomCard.BuildCard<Dedication>();
			CustomCard.BuildCard<Bargain>();
			CustomCard.BuildCard<OpenBar>();
			CustomCard.BuildCard<Pious>();
		}

		private IEnumerator UpdatePlayerResourcesRoundEnd(IGameModeHandler gm)
		{
			if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
			{
				yield break;
			}
			int[] roundWinners = gm.GetRoundWinners();
			Dictionary<int, float> dictionary = new Dictionary<int, float>();
			Player[] array = PlayerManager.instance.players.ToArray();
			foreach (Player val in array)
			{
				if (!roundWinners.Contains(val.playerID))
				{
					dictionary.Add(val.playerID, val.data.stats.GetAdditionalData().Soul + soulGainedPerRound.Value);
				}
			}
			pointWinnersID.RemoveAt(pointWinnersID.Count - 1);
			float num = 0f;
			foreach (int[] item in pointWinnersID)
			{
				foreach (int num2 in item)
				{
					if (!roundWinners.Contains(num2))
					{
						Player playerWithID = Utils.GetPlayerWithID(num2);
						if (dictionary.ContainsKey(playerWithID.playerID))
						{
							dictionary[playerWithID.playerID] += soulGainedPerPointWon.Value;
						}
						else
						{
							dictionary.Add(playerWithID.playerID, playerWithID.data.stats.GetAdditionalData().Soul + soulGainedPerPointWon.Value);
						}
						num += soulGainedPerPointWon.Value;
					}
				}
			}
			KeyValuePair<int, float>[] source = dictionary.ToArray();
			int[] playersIDs = source.Select((KeyValuePair<int, float> p) => p.Key).ToArray();
			float[] newSoulValues = source.Select((KeyValuePair<int, float> p) => p.Value).ToArray();
			OwlCardsData.UpdateSoul(playersIDs, newSoulValues);
			pointWinnersID.Clear();
			Log("End of round total points earned with Points won: " + num);
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart);
			GameModeManager.RemoveHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)UpdatePlayerResourcesRoundEnd);
			GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)TrackPointWinners);
		}

		public static void Log(string msg)
		{
		}
	}
	internal class OwlCardsException : Exception
	{
		public OwlCardsException(string msg)
			: base(msg)
		{
		}
	}
	internal class Reroll : MonoBehaviour
	{
		public static Reroll instance;

		public Dictionary<int, List<(int drawsUntilTriggered, CardCategory[] blacklist)>> customDraws = new Dictionary<int, List<(int, CardCategory[])>>();

		public void AddCustomDraw(int playerID, int drawsUntilTriggered, CardCategory[] blacklist)
		{
			if (customDraws.ContainsKey(playerID))
			{
				customDraws[playerID].Add((drawsUntilTriggered, blacklist));
				return;
			}
			List<(int, CardCategory[])> value = new List<(int, CardCategory[])>();
			customDraws.Add(playerID, value);
			customDraws[playerID].Add((drawsUntilTriggered, blacklist));
		}

		private void Start()
		{
			instance = this;
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)CheckRerolls, 600);
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)OnGameEnd);
		}

		private IEnumerator OnGameStart(IGameModeHandler gm)
		{
			customDraws.Clear();
			yield break;
		}

		private IEnumerator OnGameEnd(IGameModeHandler gm)
		{
			customDraws.Clear();
			yield break;
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)CheckRerolls);
		}

		private void Update()
		{
			if (EscapeMenuHandler.isEscMenu)
			{
				return;
			}
			int pickrID = CardChoice.instance.pickrID;
			if (pickrID == -1)
			{
				return;
			}
			bool num = (bool)AccessTools.Field(typeof(CardChoice), "isPlaying").GetValue(CardChoice.instance);
			float soul = Utils.GetPlayerWithID(pickrID).data.stats.GetAdditionalData().Soul;
			if (num || !(soul >= OwlCards.instance.rerollSoulCost.Value))
			{
				return;
			}
			PlayerActions[] actionsFromPlayer = PlayerManager.instance.GetActionsFromPlayer(CardChoice.instance.pickrID);
			if (actionsFromPlayer == null)
			{
				return;
			}
			for (int i = 0; i < actionsFromPlayer.Length; i++)
			{
				if (actionsFromPlayer[i] != null)
				{
					if (((OneAxisInputControl)actionsFromPlayer[i].Block).WasPressed)
					{
						RerollCards(pickrID, OwlCards.instance.rerollSoulCost.Value);
						break;
					}
					List<GameObject> list = AccessTools.FieldRefAccess<CardChoice, List<GameObject>>("spawnedCards").Invoke(CardChoice.instance);
					if (OwlCards.instance.bExtraPickActive.Value && ((OneAxisInputControl)actionsFromPlayer[i].Fire).WasPressed && soul >= OwlCards.instance.extraPickSoulCost.Value && list.Count > 1 && (!OwlCards.instance.bCurseActivated || !CurseHandler.IsPickingCurse()))
					{
						OwlCardsData.UpdateSoul(pickrID, Utils.GetPlayerWithID(pickrID).data.stats.GetAdditionalData().Soul - OwlCards.instance.extraPickSoulCost.Value);
						int index = (int)AccessTools.Field(typeof(CardChoice), "currentlySelectedCard").GetValue(CardChoice.instance);
						DoExtraPickRequest(pickrID, list[index]);
						break;
					}
				}
			}
		}

		[UnboundRPC]
		private static void UpdateRerollValue_RPC(int[] playerIDs, int[] newValues)
		{
			for (int i = 0; i < playerIDs.Length; i++)
			{
				int playerID = playerIDs[i];
				int num = newValues[i];
				OwlCardsData additionalData = Utils.GetPlayerWithID(playerID).data.stats.GetAdditionalData();
				AccessTools.Field(typeof(OwlCardsData), "_rerolls").SetValue(additionalData, num);
			}
		}

		private IEnumerator ReplaceCards()
		{
			FieldInfo isPlayingField = AccessTools.Field(typeof(CardChoice), "isPlaying");
			isPlayingField.SetValue(CardChoice.instance, true);
			FieldRef<object, List<GameObject>> val = AccessTools.FieldRefAccess<List<GameObject>>(typeof(CardChoice), "spawnedCards");
			List<GameObject> spawnedCards = val.Invoke((object)CardChoice.instance);
			for (int j = 0; j < spawnedCards.Count; j++)
			{
				spawnedCards[j].GetComponentInChildren<CardVisuals>().Pick();
				yield return (object)new WaitForSecondsRealtime(0.1f);
			}
			spawnedCards.Clear();
			yield return (object)new WaitForSecondsRealtime(0.2f);
			MethodInfo spawnUniqueCardMethod = AccessTools.Method(typeof(CardChoice), "SpawnUniqueCard", (Type[])null, (Type[])null);
			FieldRef<object, Transform[]> val2 = AccessTools.FieldRefAccess<Transform[]>(typeof(CardChoice), "children");
			Transform[] children = val2.Invoke((object)CardChoice.instance);
			for (int j = 0; j < children.Length; j++)
			{
				GameObject item = (GameObject)spawnUniqueCardMethod.Invoke(CardChoice.instance, new object[2]
				{
					((Component)children[j]).transform.position,
					((Component)children[j]).transform.rotation
				});
				spawnedCards.Add(item);
				spawnedCards[j].AddComponent<PublicInt>().theInt = j;
				yield return (object)new WaitForSecondsRealtime(0.1f);
			}
			isPlayingField.SetValue(CardChoice.instance, false);
		}

		private IEnumerator DoExtraPickClients(int[] cardIDs, int targetCardID, int theInt, int pickId)
		{
			FieldInfo isPlayingField = AccessTools.Field(typeof(CardChoice), "isPlaying");
			isPlayingField.SetValue(CardChoice.instance, true);
			GameObject pickedCard = ((Component)PhotonNetwork.GetPhotonView(targetCardID)).gameObject;
			FieldRef<object, List<GameObject>> val = AccessTools.FieldRefAccess<List<GameObject>>(typeof(CardChoice), "spawnedCards");
			List<GameObject> spawnedCards = val.Invoke((object)CardChoice.instance);
			MethodInfo methodInfo = AccessTools.Method(typeof(CardChoice), "CardFromIDs", (Type[])null, (Type[])null);
			if (Utils.GetPlayerWithID(pickId).data.view.IsMine)
			{
				spawnedCards.Clear();
				spawnedCards.AddRange((List<GameObject>)methodInfo.Invoke(CardChoice.instance, new object[1] { cardIDs }));
			}
			Vector3 startPos = pickedCard.transform.position;
			Vector3 endPos = ((Component)CardChoiceVisuals.instance).transform.position;
			float c3 = 0f;
			while (c3 < 1f)
			{
				CardChoiceVisuals.instance.framesToSnap = 1;
				Vector3 position = Vector3.LerpUnclamped(startPos, endPos, c3);
				pickedCard.transform.position = position;
				((Component)CardChoice.instance).transform.GetChild(theInt).position = position;
				c3 += Time.deltaTime * 4f;
				yield return null;
			}
			pickedCard.GetComponentInChildren<CardVisuals>().Leave();
			if (Utils.GetPlayerWithID(pickId).data.view.IsMine)
			{
				spawnedCards.Remove(pickedCard);
			}
			AnimationCurve softCurve = AnimationCurve.EaseInOut(0f, 0f, 1f, 1f);
			Vector3 startPos2 = ((Component)((Component)CardChoice.instance).transform.GetChild(theInt)).transform.position;
			Vector3 endPos2 = startPos;
			c3 = 0f;
			while (c3 < 1f)
			{
				Vector3 position2 = Vector3.LerpUnclamped(startPos2, endPos2, softCurve.Evaluate(c3));
				((Component)CardChoice.instance).transform.GetChild(theInt).position = position2;
				c3 += Time.deltaTime * 4f * 1.5f;
				yield return null;
			}
			isPlayingField.SetValue(CardChoice.instance, false);
		}

		[UnboundRPC]
		private static void ExtraPick_RPC(int[] cardIDs, int targetCardID, int theInt, int pickId)
		{
			IEnumerator enumerator = instance.DoExtraPickClients(cardIDs, targetCardID, theInt, pickId);
			((MonoBehaviour)instance).StartCoroutine(enumerator);
		}

		private void DoExtraPickRequest(int pickrID, GameObject pickedCard)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			PickerType val = (PickerType)AccessTools.Field(typeof(CardChoice), "pickerType").GetValue(CardChoice.instance);
			pickedCard.GetComponentInChildren<ApplyCardStats>().Pick(pickrID, false, val);
			_ = pickedCard.GetComponent<PhotonView>().ViewID;
			_ = pickedCard.GetComponent<PublicInt>().theInt;
			int[] array = (int[])AccessTools.Method(typeof(CardChoice), "CardIDs", (Type[])null, (Type[])null).Invoke(CardChoice.instance, new object[0]);
			NetworkingManager.RPC(typeof(Reroll), "ExtraPick_RPC", new object[4]
			{
				array,
				pickedCard.GetComponent<PhotonView>().ViewID,
				pickedCard.GetComponent<PublicInt>().theInt,
				pickrID
			});
		}

		private void PickCard(GameObject cardToPick)
		{
			CardChoice.instance.Pick(cardToPick, (Object)(object)cardToPick == (Object)null);
			CardChoice.instance.pickrID = -1;
		}

		public void AddReroll(int[] playersIDs, int[] newRerollsValue = null)
		{
			if (newRerollsValue == null)
			{
				newRerollsValue = new int[playersIDs.Length];
				for (int i = 0; i < newRerollsValue.Length; i++)
				{
					CharacterStatModifiers stats = Utils.GetPlayerWithID(playersIDs[i]).data.stats;
					newRerollsValue[i] = stats.GetAdditionalData().Rerolls + 1;
				}
			}
			object[] array = new object[2] { playersIDs, newRerollsValue };
			UpdateRerollValue_RPC(playersIDs, newRerollsValue);
			if (!PhotonNetwork.OfflineMode)
			{
				NetworkingManager.RPC_Others(typeof(Reroll), "UpdateRerollValue_RPC", array);
			}
		}

		public void Add1Reroll(int playerID)
		{
			AddReroll(new int[1] { playerID });
		}

		private void RerollCards(int pickrID, float soulUsed, GameObject cardToPick = null)
		{
			OwlCardsData.UpdateSoul(pickrID, Utils.GetPlayerWithID(pickrID).data.stats.GetAdditionalData().Soul - soulUsed);
			if (Object.op_Implicit((Object)(object)cardToPick))
			{
				PickCard(cardToPick);
			}
			else
			{
				((MonoBehaviour)this).StartCoroutine(ReplaceCards());
			}
		}

		private IEnumerator CheckRerolls(IGameModeHandler gm)
		{
			OwlCards.Log("CheckRerolls called !");
			int pickrID = -1;
			List<CardCategory> blacklist = new List<CardCategory>();
			Player chosenPlayer = null;
			Player[] array = PlayerManager.instance.players.ToArray();
			foreach (Player val in array)
			{
				if (val.data.stats.GetAdditionalData().Rerolls <= 0)
				{
					continue;
				}
				pickrID = val.playerID;
				chosenPlayer = val;
				if (!customDraws.ContainsKey(pickrID))
				{
					break;
				}
				List<(int, CardCategory[])> list = customDraws[pickrID];
				int num = 1;
				int num2 = -1;
				for (int k = 0; k < list.Count; k++)
				{
					if (list[k].Item1 <= 0 && list[k].Item1 < num)
					{
						num2 = k;
						num = list[k].Item1;
					}
					list[k] = (list[k].Item1 - 1, list[k].Item2);
				}
				if (num2 != -1)
				{
					blacklist = list[num2].Item2.ToList();
					list.RemoveAt(num2);
				}
				break;
			}
			if (pickrID == -1 || (Object)(object)chosenPlayer == (Object)null)
			{
				yield break;
			}
			OwlCardsData data = OwlCardsData.GetData(pickrID);
			AccessTools.Field(typeof(OwlCardsData), "_rerolls").SetValue(data, data.Rerolls - 1);
			if (blacklist.Count > 0)
			{
				CharacterStatModifiersExtension.GetAdditionalData(chosenPlayer.data.stats).blacklistedCategories.AddRange(blacklist);
			}
			yield return GameModeManager.TriggerHook("PlayerPickStart");
			CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count)
				where PlayerManager.instance.players[i].playerID == pickrID
				select i).First(), true);
			yield return CardChoice.instance.DoPick(1, pickrID, (PickerType)1);
			foreach (CardCategory item in blacklist)
			{
				CharacterStatModifiersExtension.GetAdditionalData(chosenPlayer.data.stats).blacklistedCategories.Remove(item);
			}
			array = PlayerManager.instance.players.ToArray();
			foreach (Player val2 in array)
			{
				if (val2.data.stats.GetAdditionalData().Rerolls > 0)
				{
					_ = val2.playerID;
					break;
				}
			}
			yield return (object)new WaitForSecondsRealtime(0.1f);
			yield return GameModeManager.TriggerHook("PlayerPickEnd");
			yield return (object)new WaitForSecondsRealtime(0.1f);
		}
	}
	internal class Utils
	{
		public static Player GetPlayerWithID(int playerID)
		{
			List<Player> players = PlayerManager.instance.players;
			for (int i = 0; i < players.Count; i++)
			{
				if (players[i].playerID == playerID)
				{
					return players[i];
				}
			}
			return null;
		}

		public static int[] GetOtherPlayersIDs(int myPlayerID)
		{
			int[] array = new int[PlayerManager.instance.players.Count - 1];
			int num = 0;
			Player[] array2 = PlayerManager.instance.players.ToArray();
			foreach (Player val in array2)
			{
				if (val.playerID != myPlayerID)
				{
					array[num++] = val.playerID;
				}
			}
			return array;
		}
	}
}
namespace OwlCards.UI
{
	internal class Manager : MonoBehaviour
	{
		public static Manager instance;

		private GameObject canvas;

		private GameObject soulFill;

		private int playerSoulFillID = -1;

		private Dictionary<int, GameObject> soulCounters = new Dictionary<int, GameObject>();

		private List<Action<float>> handlers = new List<Action<float>>();

		private void Awake()
		{
			instance = this;
		}

		private void Start()
		{
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)BuildUI);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ClearUI);
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
		}

		private IEnumerator OnPlayerPickEnd(IGameModeHandler gm)
		{
			playerSoulFillID = -1;
			soulFill.SetActive(false);
			yield break;
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
			GameModeManager.RemoveHook("GameStart", (Func<IGameModeHandler, IEnumerator>)BuildUI);
			GameModeManager.RemoveHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ClearUI);
		}

		private IEnumerator BuildUI(IGameModeHandler handler)
		{
			BuildCanvas();
			BuildFillUI();
			BuildSoulCounters();
			yield break;
		}

		private IEnumerator ClearUI(IGameModeHandler handler)
		{
			RemoveCanvas();
			yield break;
		}

		public void BuildCanvas()
		{
			GameObject val = OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_Canvas");
			GameObject val2 = GameObject.Find("UI_Game");
			canvas = Object.Instantiate<GameObject>(val, val2.transform);
		}

		public void UpdateFillUI(float soulValue)
		{
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			//IL_0146: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0179: Unknown result type (might be due to invalid IL or missing references)
			//IL_018d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_0322: Unknown result type (might be due to invalid IL or missing references)
			//IL_031f: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0350: 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_02eb: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)soulFill))
			{
				Transform child = soulFill.transform.GetChild(0);
				Image component = ((Component)child.GetChild(0)).GetComponent<Image>();
				((Component)child.GetChild(1)).GetComponent<Text>().text = string.Format(soulValue.ToString("G3") + " Soul");
				component.fillAmount = ((soulValue > 1f) ? (soulValue - Mathf.Floor(soulValue)) : soulValue);
				Image component2 = ((Component)child).GetComponent<Image>();
				((Graphic)component2).color = Color.white;
				component.fillOrigin = 0;
				if (soulValue < 0f)
				{
					component.fillOrigin = 1;
					((Graphic)component).color = Color.red;
					component.fillAmount = Mathf.Clamp(Mathf.Abs(soulValue), 0f, 1f);
				}
				if (soulValue > 0f)
				{
					((Graphic)component).color = new Color(0f, 1f, 0.38f, 1f);
				}
				if (soulValue > 1f)
				{
					((Graphic)component2).color = ((Graphic)component).color;
					((Graphic)component).color = new Color(0f, 1f, 0.82f, 1f);
				}
				if (soulValue > 2f)
				{
					((Graphic)component2).color = ((Graphic)component).color;
					((Graphic)component).color = new Color(0f, 0.27f, 1f, 1f);
				}
				if (soulValue > 3f)
				{
					((Graphic)component2).color = ((Graphic)component).color;
					((Graphic)component).color = new Color(0.63f, 0f, 1f, 1f);
				}
				if (soulValue > 4f)
				{
					((Graphic)component2).color = ((Graphic)component).color;
					((Graphic)component).color = new Color(1f, 0.58f, 0f, 1f);
				}
				Color val = default(Color);
				((Color)(ref val))..ctor(0.42f, 0.42f, 0.42f, 1f);
				Color val2 = default(Color);
				((Color)(ref val2))..ctor(0.22f, 0.91f, 0.91f, 1f);
				Color val3 = default(Color);
				((Color)(ref val3))..ctor(1f, 0.51f, 0.33f, 1f);
				Color val4 = default(Color);
				((Color)(ref val4))..ctor(0.43f, 0.31f, 0.49f, 1f);
				string text = "Press <color=blue>Block</color> to reroll cards\n <i>(costs " + OwlCards.instance.rerollSoulCost.Value.ToString("G3") + " soul)</i>";
				string text2 = "Press <color=red>Fire</color> to pick an extra card\n <i>(costs " + OwlCards.instance.extraPickSoulCost.Value.ToString("G3") + " soul)</i>";
				if (OwlCards.instance.bCurseActivated && CurseHandler.IsPickingCurse())
				{
					((Graphic)((Component)soulFill.transform.GetChild(1)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.rerollSoulCost.Value) ? val : val4);
					((Graphic)((Component)soulFill.transform.GetChild(2)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.extraPickSoulCost.Value) ? val : val4);
				}
				else
				{
					((Graphic)((Component)soulFill.transform.GetChild(1)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.rerollSoulCost.Value) ? val : val2);
					((Graphic)((Component)soulFill.transform.GetChild(2)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.extraPickSoulCost.Value) ? val : val3);
				}
				((Component)soulFill.transform.GetChild(1)).GetComponentInChildren<Text>().text = text;
				((Component)soulFill.transform.GetChild(2)).GetComponentInChildren<Text>().text = text2;
			}
		}

		public void BuildFillUI()
		{
			if (!Object.op_Implicit((Object)(object)soulFill))
			{
				playerSoulFillID = -1;
				GameObject val = OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_SoulFill");
				if (!Object.op_Implicit((Object)(object)canvas))
				{
					BuildCanvas();
				}
				soulFill = Object.Instantiate<GameObject>(val, canvas.transform);
				soulFill.SetActive(false);
				if (!OwlCards.instance.bExtraPickActive.Value)
				{
					((Component)soulFill.transform.GetChild(2)).gameObject.SetActive(false);
				}
			}
		}

		private void Update()
		{
			if (Object.op_Implicit((Object)(object)soulFill) && CardChoice.instance.pickrID != -1 && playerSoulFillID != CardChoice.instance.pickrID)
			{
				playerSoulFillID = CardChoice.instance.pickrID;
				UpdateFillUI(OwlCardsData.GetData(playerSoulFillID).Soul);
			}
			if (Object.op_Implicit((Object)(object)soulFill) && playerSoulFillID != -1)
			{
				soulFill.SetActive(!EscapeMenuHandler.isEscMenu);
			}
		}

		public void BuildSoulCounters()
		{
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			//IL_0118: Unknown result type (might be due to invalid IL or missing references)
			//IL_012f: Unknown result type (might be due to invalid IL or missing references)
			//IL_015e: Unknown result type (might be due to invalid IL or missing references)
			int num = 0;
			if (!Object.op_Implicit((Object)(object)canvas))
			{
				BuildCanvas();
			}
			Player[] array = PlayerManager.instance.players.ToArray();
			foreach (Player val in array)
			{
				GameObject obj = GameObject.Find("CardViz");
				Transform child = obj.transform.GetChild(3 + num);
				GameObject val2 = Object.Instantiate<GameObject>(OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_SoulCounter"), canvas.transform);
				int playerID = val.playerID;
				soulCounters[playerID] = val2;
				Action<float> action = delegate(float x)
				{
					OnSoulValueChanged(playerID, x);
				};
				handlers.Add(action);
				val.data.stats.GetAdditionalData().soulChanged += action;
				val2.GetComponent<Text>().text = string.Format(val.data.stats.GetAdditionalData().Soul.ToString("F2"));
				Vector3 localPosition = val2.transform.localPosition;
				Canvas component = ((Component)obj.transform.parent).GetComponent<Canvas>();
				localPosition.y = child.localPosition.y * component.scaleFactor / canvas.GetComponent<Canvas>().scaleFactor;
				val2.transform.localPosition = localPosition;
				num++;
			}
		}

		public void OnSoulValueChanged(int playerID, float newValue)
		{
			soulCounters[playerID].GetComponent<Text>().text = string.Format(newValue.ToString("F2"));
			if (playerID == playerSoulFillID && soulFill.activeSelf)
			{
				UpdateFillUI(newValue);
			}
		}

		public void RemoveCounters()
		{
			int[] array = soulCounters.Keys.ToArray();
			foreach (int num in array)
			{
				Utils.GetPlayerWithID(num).data.stats.GetAdditionalData().soulChanged -= handlers[num];
				Object.Destroy((Object)(object)soulCounters[num]);
			}
			handlers.Clear();
			soulCounters.Clear();
		}

		public void RemoveCanvas()
		{
			RemoveFill();
			RemoveCounters();
			if (Object.op_Implicit((Object)(object)canvas))
			{
				Object.Destroy((Object)(object)canvas);
			}
			canvas = null;
		}

		public void RemoveFill()
		{
			if (Object.op_Implicit((Object)(object)soulFill))
			{
				playerSoulFillID = -1;
				Object.Destroy((Object)(object)soulFill);
				soulFill = null;
			}
		}
	}
}
namespace OwlCards.Logic
{
	internal class FeedMe_Logic : WasHitEffect
	{
		private Player player;

		private void Start()
		{
			player = ((Component)this).GetComponent<Player>();
		}

		public override void WasDealtDamage(Vector2 damage, bool selfDamage)
		{
			if (!selfDamage)
			{
				float num = Mathf.Min(((Vector2)(ref damage)).magnitude, player.data.health) / 1000f;
				float newSoulValue = player.data.stats.GetAdditionalData().Soul + num;
				OwlCardsData.UpdateSoul(player.playerID, newSoulValue);
			}
		}
	}
	[DisallowMultipleComponent]
	internal class LastHitter_Logic : DealtDamageEffect
	{
		private Player owner;

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
		{
			if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer) && ((Vector2)(ref damage)).magnitude > damagedPlayer.data.health)
			{
				((MonoBehaviour)this).StartCoroutine("CheckIfPlayerDied", (object)damagedPlayer);
			}
		}

		private IEnumerator CheckIfPlayerDied(Player damagedPlayer)
		{
			yield return (object)new WaitForEndOfFrame();
			if (damagedPlayer.data.dead)
			{
				float num = owner.data.stats.GetAdditionalData().Soul + 0.25f;
				OwlCardsData.UpdateSoul(new int[1] { owner.playerID }, new float[1] { num });
			}
		}

		private void Start()
		{
			owner = ((Component)this).GetComponent<Player>();
		}
	}
	[DisallowMultipleComponent]
	internal class SoulExhaustion_Logic : HitEffect
	{
		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
		{
			if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer))
			{
				float soul = damagedPlayer.data.stats.GetAdditionalData().Soul;
				float slowValue = SoulExhaustion.GetSlowValue(soul);
				OwlCards.Log("Applying slow value: " + slowValue + " with soulValue: " + soul);
				damagedPlayer.data.stats.RPCA_AddSlow(slowValue, false);
			}
		}
	}
	[DisallowMultipleComponent]
	internal class SoulLeech_Logic : DealtDamageEffect
	{
		private Player player;

		private Dictionary<int, float> soulLeftToStealThisPoint = new Dictionary<int, float>();

		private void Start()
		{
			player = ((Component)this).GetComponent<Player>();
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetStats);
		}

		private IEnumerator ResetStats(IGameModeHandler gm)
		{
			soulLeftToStealThisPoint.Clear();
			yield break;
		}

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
		{
			if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer))
			{
				if (!soulLeftToStealThisPoint.ContainsKey(damagedPlayer.playerID))
				{
					soulLeftToStealThisPoint.Add(damagedPlayer.playerID, 0.15f);
				}
				float num = soulLeftToStealThisPoint[damagedPlayer.playerID];
				if (!(num <= 0f))
				{
					float num2 = ((Vector2)(ref damage)).magnitude / damagedPlayer.data.maxHealth / 5f;
					num2 = Mathf.Min(num2, num);
					int[] playersIDs = new int[2] { player.playerID, damagedPlayer.playerID };
					float[] newSoulValues = new float[2]
					{
						player.data.stats.GetAdditionalData().Soul + num2,
						player.data.stats.GetAdditionalData().Soul - num2
					};
					OwlCardsData.UpdateSoul(playersIDs, newSoulValues);
					soulLeftToStealThisPoint[damagedPlayer.playerID] -= num2;
					OwlCards.Log("Stole: " + num2 + " steal from playerID: " + damagedPlayer.playerID + " to me: " + player.playerID);
				}
			}
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetStats);
		}
	}
}
namespace OwlCards.Extensions
{
	[Serializable]
	public class OwlCardsData
	{
		private float _soul;

		private int _rerolls;

		public float Soul
		{
			get
			{
				return _soul;
			}
			private set
			{
				if (_soul != value)
				{
					_soul = value;
					this.soulChanged?.Invoke(value);
				}
			}
		}

		public int Rerolls => _rerolls;

		public event Action<float> soulChanged;

		[UnboundRPC]
		private static void UpdateSoul_RPC(int[] playersIDs, float[] newSoulValues)
		{
			for (int i = 0; i < playersIDs.Length; i++)
			{
				int playerID = playersIDs[i];
				float soul = newSoulValues[i];
				GetData(playerID).Soul = soul;
			}
		}

		public static void UpdateSoul(int[] playersIDs, float[] newSoulValues)
		{
			object[] array = new object[2] { playersIDs, newSoulValues };
			UpdateSoul_RPC(playersIDs, newSoulValues);
			if (!PhotonNetwork.OfflineMode)
			{
				NetworkingManager.RPC_Others(typeof(OwlCardsData), "UpdateSoul_RPC", array);
			}
		}

		public static void UpdateSoul(int playerID, float newSoulValue)
		{
			UpdateSoul(new int[1] { playerID }, new float[1] { newSoulValue });
		}

		public static OwlCardsData GetData(int playerID)
		{
			return GetData(Utils.GetPlayerWithID(playerID));
		}

		public static OwlCardsData GetData(Player player)
		{
			return player.data.stats.GetAdditionalData();
		}

		public OwlCardsData()
		{
			_soul = OwlCards.instance.soulOnGameStart.Value;
			_rerolls = 0;
		}
	}
	public static class CharacterStatModifiersExtension
	{
		public static readonly ConditionalWeakTable<CharacterStatModifiers, OwlCardsData> data = new ConditionalWeakTable<CharacterStatModifiers, OwlCardsData>();

		public static OwlCardsData GetAdditionalData(this CharacterStatModifiers statModifiers)
		{
			return data.GetOrCreateValue(statModifiers);
		}

		public static void AddData(this CharacterStatModifiers statModifiers, OwlCardsData value)
		{
			try
			{
				data.Add(statModifiers, value);
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
	internal class CharacterStatModifiersPatchResetStats
	{
		private static void Prefix(CharacterStatModifiers __instance)
		{
			OwlCardsData additionalData = __instance.GetAdditionalData();
			if (additionalData.Soul != OwlCards.instance.soulOnGameStart.Value)
			{
				AccessTools.PropertySetter(typeof(OwlCardsData), "Soul").Invoke(additionalData, new object[1] { OwlCards.instance.soulOnGameStart.Value });
			}
			AccessTools.Field(typeof(OwlCardsData), "_rerolls").SetValue(additionalData, 0);
		}
	}
}
namespace OwlCards.Dependencies
{
	internal class CurseHandler
	{
		public static bool IsPickingCurse()
		{
			return CurseManager.instance.CursePick;
		}
	}
}
namespace OwlCards.Cards
{
	internal abstract class AOwlCard : CustomCard
	{
		public static Dictionary<string, Func<float, bool>> conditions = new Dictionary<string, Func<float, bool>>();

		public abstract void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block);

		public sealed override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { OwlCardCategory.modCategory };
			SetupCard_child(cardInfo, gun, cardStats, statModifiers, block);
		}

		protected string RarityToColorString(Rarity rarity)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//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_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			Rarity rarityData = RarityUtils.GetRarityData(rarity);
			if (rarity == Rarities.Common)
			{
				return rarityData.name;
			}
			Color color = rarityData.color;
			int num = (int)(255f * color.r);
			int num2 = (int)(255f * color.g);
			int num3 = (int)(255f * color.b);
			return "<#" + num.ToString("X2") + num2.ToString("X2") + num3.ToString("X2") + ">" + rarityData.name + "</color>";
		}

		protected GameObject GetCardArt(string name)
		{
			try
			{
				return OwlCards.instance.Bundle.LoadAsset<GameObject>(name);
			}
			catch
			{
				return null;
			}
		}

		protected override GameObject GetCardArt()
		{
			return null;
		}

		public override string GetModName()
		{
			return "OWL";
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal static class OwlCardCategory
	{
		public static CardCategory modCategory = CustomCardCategories.instance.CardCategory("__pack-OWL");

		public static CardCategory soulCondition = CustomCardCategories.instance.CardCategory("OwlCards-SoulCondition");

		public static Dictionary<Rarity, CardCategory> rarityCategories = new Dictionary<Rarity, CardCategory>();

		public static void InitializeRarityCategories()
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			if (rarityCategories.Count == 0)
			{
				Rarity[] array = RarityUtils.Rarities.Values.ToArray();
				foreach (Rarity val in array)
				{
					rarityCategories.Add(val.value, CustomCardCategories.instance.CardCategory("__rarity-" + val.name));
				}
			}
		}

		public static CardCategory[] GetRarityCategoryAndLower(Rarity rarity, bool bGetReverseArray)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return GetRarityCategories((Rarity)0, rarity, bGetReverseArray);
		}

		public static CardCategory[] GetRarityCategoryAndHigher(Rarity rarity, bool bGetReverseArray)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return GetRarityCategories(rarity, Rarities.Divine, bGetReverseArray);
		}

		public static CardCategory[] GetRarityCategories(Rarity lowestRarity, Rarity highestRarity, bool bGetReverseArray)
		{
			//IL_0007: 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)
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			CardCategory[] array = (CardCategory[])(object)new CardCategory[0];
			float relativeRarity = RarityUtils.GetRarityData(lowestRarity).relativeRarity;
			float relativeRarity2 = RarityUtils.GetRarityData(highestRarity).relativeRarity;
			if (relativeRarity < relativeRarity2)
			{
				throw new OwlCardsException("GetRarityCategories called with invalid low/high parameters");
			}
			foreach (KeyValuePair<Rarity, CardCategory> rarityCategory in rarityCategories)
			{
				rarityCategory.Deconstruct(out var key, out var value);
				Rarity val = key;
				CardCategory element = value;
				float relativeRarity3 = RarityUtils.GetRarityData(val).relativeRarity;
				if (relativeRarity3 <= relativeRarity && relativeRarity3 >= relativeRarity2)
				{
					if (!bGetReverseArray)
					{
						array = array.Append(element).ToArray();
					}
				}
				else if (bGetReverseArray)
				{
					array = array.Append(element).ToArray();
				}
			}
			return array;
		}
	}
	internal class Bargain : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 2f;
			if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
			{
				cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
			}
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul - 3f);
			}
			CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Exotic).calculatedRarity), 1000);
			Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
			CardBarUtils.instance.ShowAtEndOfPhase(player, randomCardWithCondition);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Bargain";
		}

		protected override string GetDescription()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return "You trade part of your soul for a random " + RarityToColorString(Rarities.Exotic) + " or rarer card";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Soul",
					amount = "-2",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Bargain");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Uncommon;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class CorruptedPower : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = delegate
			{
				//IL_0014: Unknown result type (might be due to invalid IL or missing references)
				//IL_0019: Unknown result type (might be due to invalid IL or missing references)
				foreach (CardInfo item in Cards.active)
				{
					if (item.rarity == Rarities.Epic)
					{
						return true;
					}
				}
				return false;
			};
			if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
			{
				cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
			}
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				int[] otherPlayersIDs = Utils.GetOtherPlayersIDs(player.playerID);
				Reroll.instance.AddReroll(otherPlayersIDs);
			}
			CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Epic).calculatedRarity), 1000);
			Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
			CardBarUtils.instance.ShowAtEndOfPhase(player, randomCardWithCondition);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Corrupted Power";
		}

		protected override string GetDescription()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return "Acquire a random " + RarityToColorString(Rarities.Epic) + " or rarer card";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Pick for everyone else",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_CorruptedPower");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Rare;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class Dedication : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul + 1f);
			}
			CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => cardInfo.rarity == Rarities.Common), 1000);
			Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
			CardBarUtils.instance.ShowAtEndOfPhase(player, randomCardWithCondition);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Dedication";
		}

		protected override string GetDescription()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return "Gives you a random " + RarityToColorString(Rarities.Common) + " card";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Soul",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Dedication");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Uncommon;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class FeedMe : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.5f;
			cardInfo.allowMultiple = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				ExtensionMethods.GetOrAddComponent<FeedMe_Logic>(((Component)player).gameObject, false);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			FeedMe_Logic component = ((Component)player).gameObject.GetComponent<FeedMe_Logic>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Object.Destroy((Object)(object)component);
			}
		}

		protected override string GetTitle()
		{
			return "Feed Me";
		}

		protected override string GetDescription()
		{
			return "Learn how to assimilate bullets that hit you to strengthen your soul";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+50%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_FeedMe");
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)8;
		}
	}
	internal class FunKiller : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 1.5f && PlayerManager.instance.players.Count > 3;
			if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
			{
				cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
			}
			cardInfo.allowMultiple = false;
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				int[] array = new int[PlayerManager.instance.players.Count];
				float[] array2 = new float[PlayerManager.instance.players.Count];
				for (int i = 0; i < array.Length; i++)
				{
					int playerID = PlayerManager.instance.players[i].playerID;
					float soul = OwlCardsData.GetData(playerID).Soul;
					soul = ((playerID != player.playerID) ? (soul - 0.5f) : (soul - 2f));
					array[i] = playerID;
					array2[i] = soul;
				}
				OwlCardsData.UpdateSoul(array, array2);
				Reroll.instance.Add1Reroll(player.playerID);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Fun Killer";
		}

		protected override string GetDescription()
		{
			return "Reroll your cards and drain everyone's soul.";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Soul",
					amount = "-1.5",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Others' Souls",
					amount = "-0.5",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	[Description("LastHitter")]
	internal class LastHitter : AOwlCard
	{
		public const float soulGainedPerKill = 0.25f;

		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.damage = 1.25f;
			gun.reloadTime = 1.25f;
			gun.ammo = -1;
			cardInfo.allowMultiple = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				ExtensionMethods.GetOrAddComponent<LastHitter_Logic>(((Component)player).gameObject, false);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			LastHitter_Logic component = ((Component)player).gameObject.GetComponent<LastHitter_Logic>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Object.Destroy((Object)(object)component);
			}
		}

		protected override string GetTitle()
		{
			return "Last Hitter";
		}

		protected override string GetDescription()
		{
			return "Earn some Soul whenever you make a kill";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0099: 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_00af: 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_00b7: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+25%",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Ammo",
					amount = "-1",
					simepleAmount = (SimpleAmount)6
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Projectile Size",
					amount = "Smaller",
					simepleAmount = (SimpleAmount)9
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload",
					amount = "+25%",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)0;
		}
	}
	internal class OpenBar : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				int[] otherPlayersIDs = Utils.GetOtherPlayersIDs(player.playerID);
				float[] array = new float[otherPlayersIDs.Length];
				for (int i = 0; i < otherPlayersIDs.Length; i++)
				{
					array[i] = OwlCardsData.GetData(otherPlayersIDs[i]).Soul + 1f;
				}
				OwlCardsData.UpdateSoul(otherPlayersIDs, array);
			}
			CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Rare).calculatedRarity), 1000);
			Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
			CardBarUtils.instance.ShowAtEndOfPhase(player, randomCardWithCondition);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "OpenBar";
		}

		protected override string GetDescription()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			return "You get a random " + RarityToColorString(Rarities.Rare) + " or rarer card";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Others Soul",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_OpenBar");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Uncommon;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class Pious : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 3f;
			if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
			{
				cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
			}
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_003a: 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)
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul - 3f);
				Reroll.instance.Add1Reroll(player.playerID);
			}
			CardCategory[] rarityCategories = OwlCardCategory.GetRarityCategories(Rarities.Exotic, Rarities.Rare, bGetReverseArray: true);
			Reroll.instance.AddCustomDraw(player.playerID, 0, rarityCategories);
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Pious";
		}

		protected override string GetDescription()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			return "You get to pick a card among " + RarityToColorString(Rarities.Exotic) + " or " + RarityToColorString(Rarities.Rare) + " cards";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Soul",
					amount = "-3",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Pious");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Rare;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class Resolution : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 5f;
			statModifiers.health = 1.1f;
			statModifiers.secondsToTakeDamageOver = 1f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul + 0.5f);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Resolution";
		}

		protected override string GetDescription()
		{
			return "";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Expected O, but got Unknown
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0091: 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_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b6: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[4]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+5",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Decay",
					amount = "+1s",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Soul",
					amount = "+0.5",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Resolution");
		}

		protected override Rarity GetRarity()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Common;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)2;
		}
	}
	internal class Soul : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => false;
			if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
			{
				cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
			}
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				float soul = player.data.stats.GetAdditionalData().Soul;
				OwlCardsData.UpdateSoul(new int[1] { player.playerID }, new float[1] { soul + 1f });
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Soul";
		}

		protected override string GetDescription()
		{
			return "";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Soul",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Soul");
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	[Description("SoulExhaustion")]
	internal class SoulExhaustion : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.projectileSpeed = 1.15f;
			gun.attackSpeed = 1.25f;
			cardInfo.allowMultiple = false;
		}

		public static float GetSlowValue(float soulValue)
		{
			return Mathf.Lerp(1f, 0.2f, (soulValue - 1.5f) / 5f);
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				ExtensionMethods.GetOrAddComponent<SoulExhaustion_Logic>(((Component)player).gameObject, false);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SoulExhaustion_Logic component = ((Component)player).gameObject.GetComponent<SoulExhaustion_Logic>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Object.Destroy((Object)(object)component);
			}
		}

		protected override string GetTitle()
		{
			return "Soul Exhaustion";
		}

		protected override string GetDescription()
		{
			return "Your bullets exhaust your target, slowing them down the less Soul they have.";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Projectile Speed",
					amount = "+15%",
					simepleAmount = (SimpleAmount)1
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Attack Speed",
					amount = "+25%",
					simepleAmount = (SimpleAmount)1
				}
			};
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)7;
		}
	}
	internal class SoulLeech : AOwlCard
	{
		public const float rerollLeeched = 0.1f;

		public const float maxLeechPerRoundPerPlayer = 0.15f;

		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.lifeSteal = 0.2f;
			gun.damage = 0.85f;
			cardInfo.allowMultiple = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				ExtensionMethods.GetOrAddComponent<SoulLeech_Logic>(((Component)player).gameObject, false);
			}
		}

		private void MyCustomDamageDealt(Vector2 whatIsThisIDontEvenKnow, bool bThisIsABoolean)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SoulLeech_Logic component = ((Component)player).GetComponent<SoulLeech_Logic>();
			if (Object.op_Implicit((Object)(object)component))
			{
				Object.Destroy((Object)(object)component);
			}
		}

		protected override string GetTitle()
		{
			return "Soul Leech";
		}

		protected override string GetDescription()
		{
			return "Your bullets steal Soul";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			//IL_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Lifesteal",
					amount = "+20%",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Damage",
					amount = "-15%",
					simepleAmount = (SimpleAmount)5
				}
			};
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)1;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)6;
		}
	}
	internal class Soulless : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(new int[1] { player.playerID }, new float[1]);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Soulless";
		}

		protected override string GetDescription()
		{
			return "";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Soul",
					amount = "0",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_Soulless");
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
	internal class SoulRejuvenation : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.regen = 8f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}

		protected override string GetTitle()
		{
			return "Soul Rejuvenation";
		}

		protected override string GetDescription()
		{
			return "What doesn't kill grows your soul";
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: 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_0032: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Regen",
					amount = "+8",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override GameObject GetCardArt()
		{
			return GetCardArt("C_SoulRejuvenation");
		}

		protected override Rarity GetRarity()
		{
			return (Rarity)0;
		}

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)3;
		}
	}
}