Decompiled source of OwlCards v0.4.2

OwlCards.dll

Decompiled 3 weeks 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 DrawNCards;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using OwlCards.Cards;
using OwlCards.Cards.Curses;
using OwlCards.Dependencies;
using OwlCards.Extensions;
using OwlCards.Logic;
using OwlCards.UI;
using Photon.Pun;
using RarityBundle;
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;

[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+169f5da340e05e29404e8579424c06f5eb2326f9")]
[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", 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.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.HibouGlorieux.Rounds.OwlCards", "OwlCards", "0.4.2")]
	[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.4.2";

		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_010a: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			bCurseActivated = Chainloader.PluginInfos.TryGetValue("com.willuwontu.rounds.managers", out var value);
			if (bCurseActivated)
			{
				CurseHandler.Init(value);
			}
			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();
				}
			}
			int numDraws = DrawNCards.NumDraws;
			numDraws += ((soulOnGameStart.Value > 2f) ? 1 : 0);
			numDraws += ((soulOnGameStart.Value > 4f) ? 1 : 0);
			foreach (Player player in PlayerManager.instance.players)
			{
				DrawNCards.SetPickerDraws(player.playerID, numDraws);
			}
			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.soulCondition))
			{
				if (AOwlCard.conditions.ContainsKey(cardInfo.cardName))
				{
					return AOwlCard.conditions[cardInfo.cardName](player.data.stats.GetAdditionalData().Soul);
				}
				Log("conditionw without category found for card: " + ((Object)cardInfo).name);
			}
			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>();
			CustomCard.BuildCard<CorruptedFaith>();
			CustomCard.BuildCard<AssertDominance>();
			CustomCard.BuildCard<Transcendence>();
			CustomCard.BuildCard<BirdOfPrey>();
			CustomCard.BuildCard<SharpClaws>();
			CustomCard.BuildCard<SoulStealer>();
			if (bCurseActivated)
			{
				CustomCard.BuildCard<WeakenedSoul>((Action<CardInfo>)delegate(CardInfo cardInfo)
				{
					CurseHandler.RegisterCurse(cardInfo);
				});
				CustomCard.BuildCard<Burden>((Action<CardInfo>)delegate(CardInfo cardInfo)
				{
					CurseHandler.RegisterCurse(cardInfo);
				});
				CustomCard.BuildCard<Giveaway>();
				CustomCard.BuildCard<Envy>();
				CustomCard.BuildCard<Apostate>();
				CustomCard.BuildCard<BadFaith>();
			}
		}

		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)
			{
				for (int i = 0; i < item.Length; i++)
				{
					Player playerWithID = Utils.GetPlayerWithID(item[i]);
					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;
			float soulConsumptionFactor = OwlCardsData.GetData(pickrID).soulConsumptionFactor;
			if (num || !(soul >= OwlCards.instance.rerollSoulCost.Value * soulConsumptionFactor))
			{
				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 * soulConsumptionFactor);
						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 * soulConsumptionFactor && list.Count > 1 && (!OwlCards.instance.bCurseActivated || !CurseHandler.IsPickingCurse))
					{
						OwlCardsData.RequestUpdateSoul(new int[1] { pickrID }, new float[1] { (0f - OwlCards.instance.extraPickSoulCost.Value) * soulConsumptionFactor });
						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.RequestUpdateSoul(new int[1] { pickrID }, new float[1] { 0f - 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;
		}

		public static int[] GetOpponentsPlayersIDs(int playerID)
		{
			List<int> list = new List<int>();
			Player playerWithID = GetPlayerWithID(playerID);
			foreach (Player player in PlayerManager.instance.players)
			{
				if (player.teamID != playerWithID.teamID)
				{
					list.Add(player.teamID);
				}
			}
			return list.ToArray();
		}
	}
}
namespace OwlCards.UI
{
	internal class Manager : MonoBehaviour
	{
		public static Manager instance;

		private GameObject canvas;

		private GameObject soulFill;

		private int playerSoulFillID = -1;

		private bool bIsPicking;

		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("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickStart);
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
		}

		private IEnumerator OnPlayerPickStart(IGameModeHandler gm)
		{
			bIsPicking = true;
			yield break;
		}

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

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickStart);
			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_00a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0114: Unknown result type (might be due to invalid IL or missing references)
			//IL_012d: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0165: Unknown result type (might be due to invalid IL or missing references)
			//IL_0184: Unknown result type (might be due to invalid IL or missing references)
			//IL_019d: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_032a: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03da: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Unknown result type (might be due to invalid IL or missing references)
			//IL_0364: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)soulFill))
			{
				return;
			}
			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);
			float soulConsumptionFactor = OwlCardsData.GetData(Utils.GetPlayerWithID(playerSoulFillID)).soulConsumptionFactor;
			string text = "Press <color=blue>Block</color> to reroll cards\n <i>(costs " + (OwlCards.instance.rerollSoulCost.Value * soulConsumptionFactor).ToString("G3") + " soul)</i>";
			string text2 = "Press <color=red>Fire</color> to pick an extra card\n <i>(costs " + (OwlCards.instance.extraPickSoulCost.Value * soulConsumptionFactor).ToString("G3") + " soul)</i>";
			if (OwlCardsData.GetData(playerSoulFillID).soulConsumptionFactor > 1f)
			{
				((Graphic)((Component)soulFill.transform.GetChild(1)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.rerollSoulCost.Value * soulConsumptionFactor) ? val : val4);
				((Graphic)((Component)soulFill.transform.GetChild(2)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.extraPickSoulCost.Value * soulConsumptionFactor) ? val : val4);
			}
			else
			{
				((Graphic)((Component)soulFill.transform.GetChild(1)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.rerollSoulCost.Value * soulConsumptionFactor) ? val : val2);
				((Graphic)((Component)soulFill.transform.GetChild(2)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.extraPickSoulCost.Value * soulConsumptionFactor) ? val : val3);
			}
			((Component)soulFill.transform.GetChild(1)).GetComponentInChildren<Text>().text = text;
			((Component)soulFill.transform.GetChild(2)).GetComponentInChildren<Text>().text = text2;
			Func<string> func = delegate
			{
				if (soulValue < 0f)
				{
					return "<color=#FF2D2D>-2</color>";
				}
				if (soulValue < 2f)
				{
					return "+0";
				}
				return (soulValue < 4f) ? "<color=#0DFF24>+1</color>" : "<color=#0DFF24>+2</color>";
			};
			((Component)soulFill.transform.GetChild(3).GetChild(0)).GetComponent<Text>().text = func() + " hand size";
		}

		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 (bIsPicking)
			{
				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;
				OwlCards.Log("earned " + num + " with FeedMe");
				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 : HitEffect
	{
		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, SoulLeech.maxLeechPerRoundPerPlayer);
				}
				if (!(soulLeftToStealThisPoint[damagedPlayer.playerID] <= 0f))
				{
					float rerollLeeched = SoulLeech.rerollLeeched;
					int[] playersIDs = new int[2] { player.playerID, damagedPlayer.playerID };
					float[] newSoulValues = new float[2]
					{
						OwlCardsData.GetData(player.playerID).Soul + rerollLeeched,
						OwlCardsData.GetData(damagedPlayer.playerID).Soul - rerollLeeched
					};
					OwlCardsData.UpdateSoul(playersIDs, newSoulValues);
					soulLeftToStealThisPoint[damagedPlayer.playerID] -= rerollLeeched;
					OwlCards.Log("Stole: " + rerollLeeched + " steal from playerID: " + damagedPlayer.playerID + " to me: " + player.playerID);
				}
			}
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetStats);
		}
	}
	internal class SoulStealer_Logic : MonoBehaviour
	{
		private Player owner;

		private List<Player> playerTouched = new List<Player>();

		private bool bActive;

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

		private IEnumerator OnPointStart(IGameModeHandler gm)
		{
			playerTouched = new List<Player>();
			bActive = true;
			yield break;
		}

		private IEnumerator OnPointEnd(IGameModeHandler gm)
		{
			bActive = false;
			yield break;
		}

		private void OnDestroy()
		{
			GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)OnPointStart);
			GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)OnPointEnd);
		}

		private bool CanStealPlayer(Player otherPlayer)
		{
			return !playerTouched.Contains(otherPlayer);
		}

		private IEnumerator ClearPlayer(Player player)
		{
			yield return (object)new WaitForSeconds(SoulStealer.delayBetweenSteal);
			playerTouched.Remove(player);
		}

		private void Update()
		{
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			if (!bActive || EscapeMenuHandler.isEscMenu)
			{
				return;
			}
			Player[] array = PlayerManager.instance.players.ToArray();
			foreach (Player val in array)
			{
				if (val.teamID != owner.teamID)
				{
					Vector3 val2 = ((Component)val).transform.position - ((Component)owner).transform.position;
					if (((Vector3)(ref val2)).magnitude <= SoulStealer.baseRadius * ((Component)owner).transform.localScale.x && CanStealPlayer(val))
					{
						OwlCards.Log("touched player !" + val.playerID);
						playerTouched.Add(val);
						((MonoBehaviour)this).StartCoroutine(ClearPlayer(val));
						int[] playersIDs = new int[2] { owner.playerID, val.playerID };
						float[] diff = new float[2]
						{
							SoulStealer.amountOfStealToSteal,
							0f - SoulStealer.amountOfStealToSteal
						};
						OwlCardsData.RequestUpdateSoul(playersIDs, diff);
						NetworkingManager.RPC(typeof(SoulStealer_Logic), "AddSoulStoleEffect_RPC", new object[1] { val.playerID });
					}
				}
			}
		}

		[UnboundRPC]
		private static void AddSoulStoleEffect_RPC(int playerID)
		{
			((Component)Utils.GetPlayerWithID(playerID)).gameObject.AddComponent<SoulStoleEffect>();
		}
	}
	internal class SoulStoleEffect : ReversibleEffect
	{
		private ReversibleColorEffect colorEffect;

		private float currentSlow = SoulStealer.baseSlow;

		private float slowDurationLeft = SoulStealer.slowDuration;

		private float effectDurationLeft = SoulStealer.delayBetweenSteal;

		public override void OnOnEnable()
		{
		}

		public override void OnStart()
		{
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			base.characterStatModifiersModifier.movementSpeed_mult = 1f - currentSlow;
			base.characterStatModifiersModifier.jump_mult = 1f - currentSlow;
			colorEffect = ((Component)base.player).gameObject.AddComponent<ReversibleColorEffect>();
			((ColorEffect)colorEffect).SetColor(Color.Lerp(new Color(1f, 1f, 1f, 1f), ((ColorEffect)colorEffect).GetOriginalColorMax(), 0f));
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)OnPointEnd);
		}

		private IEnumerator OnPointEnd(IGameModeHandler gm)
		{
			effectDurationLeft = -1f;
			((ReversibleEffect)this).ClearModifiers(true);
			Object.Destroy((Object)(object)this);
			yield break;
		}

		public override void OnUpdate()
		{
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			if (!EscapeMenuHandler.isEscMenu)
			{
				slowDurationLeft -= Time.deltaTime;
				effectDurationLeft -= Time.deltaTime;
				if (effectDurationLeft <= 0f)
				{
					Object.Destroy((Object)(object)this);
				}
				if (slowDurationLeft > 0f)
				{
					((ReversibleEffect)this).ClearModifiers(true);
					float num = slowDurationLeft / SoulStealer.slowDuration;
					base.characterStatModifiersModifier.movementSpeed_mult = 1f - currentSlow * num;
					base.characterStatModifiersModifier.jump_mult = 1f - currentSlow * num;
					((ReversibleEffect)this).ApplyModifiers();
					((ColorEffect)colorEffect).SetColor(Color.Lerp(((ColorEffect)colorEffect).GetOriginalColorMax(), Color.white, Mathf.Max(num, 0.3f)));
					((ColorEffect)colorEffect).ApplyColor();
				}
				else
				{
					((ReversibleEffect)this).ClearModifiers(true);
				}
			}
		}

		public override void OnOnDestroy()
		{
			((ColorEffect)colorEffect).Destroy();
		}
	}
}
namespace OwlCards.Extensions
{
	[Serializable]
	public class OwlCardsData
	{
		private float _soul;

		public float soulConsumptionFactor;

		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 num = playersIDs[i];
				float newSoulValue = newSoulValues[i];
				OwlCardsData data = GetData(num);
				float oldSoulValue = data.Soul;
				data.Soul = newSoulValue;
				if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
				{
					continue;
				}
				OwlCards.Log("Checking if handsize must be updated");
				int newDrawValue;
				int num2 = (newDrawValue = DrawNCards.GetPickerDraws(num));
				Action<int, int> obj = delegate(int bound, int handSizeChange)
				{
					if (oldSoulValue < (float)bound && newSoulValue >= (float)bound)
					{
						newDrawValue += handSizeChange;
					}
					if (oldSoulValue >= (float)bound && newSoulValue < (float)bound)
					{
						newDrawValue -= handSizeChange;
					}
				};
				obj(0, 2);
				obj(2, 1);
				obj(4, 1);
				newDrawValue = Mathf.Clamp(newDrawValue, 1, 30);
				if (num2 != newDrawValue)
				{
					OwlCards.Log("updated hand size with old value being: " + num2);
					DrawNCards.RPCA_SetPickerDraws(num, newDrawValue);
					DrawNCards.SetPickerDraws(num, newDrawValue);
					OwlCards.Log("updated hand size with NEW value being: " + newDrawValue);
				}
			}
		}

		public static void UpdateSoul(int[] playersIDs, float[] newSoulValues)
		{
			if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
			{
				OwlCards.Log("UpdateSoul called from client instead of masterClient !");
				return;
			}
			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 RequestUpdateSoul(int[] playersIDs, float[] diff)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				UpdateSoul(playersIDs, GetUpdatedSoulValueFromDiff(playersIDs, diff));
				return;
			}
			NetworkingManager.RPC_Others(typeof(OwlCardsData), "RequestUpdateSoul_RPC", new object[2] { playersIDs, diff });
		}

		private static float[] GetUpdatedSoulValueFromDiff(int[] playersIDs, float[] diff)
		{
			float[] array = new float[playersIDs.Length];
			for (int i = 0; i < array.Length; i++)
			{
				array[i] = GetData(playersIDs[i]).Soul + diff[i];
			}
			return array;
		}

		[UnboundRPC]
		private static void RequestUpdateSoul_RPC(int[] playersIDs, float[] diff)
		{
			if (PhotonNetwork.IsMasterClient)
			{
				UpdateSoul(playersIDs, GetUpdatedSoulValueFromDiff(playersIDs, diff));
			}
		}

		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;
			soulConsumptionFactor = 1f;
		}
	}
	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);
			additionalData.soulConsumptionFactor = 1f;
		}
	}
}
namespace OwlCards.Dependencies
{
	internal class CurseHandler
	{
		private static object _curseManagerInstance;

		private static MethodInfo _curseCategoryMethod;

		private static MethodInfo _curseColor;

		private static MethodInfo _isPickingCurse;

		private static MethodInfo _cursePlayer;

		private static MethodInfo _getRaw;

		private static MethodInfo _curseSpawnerCategoryMethod;

		private static MethodInfo _registerCurseMethod;

		public static CardCategory CurseCategory => (CardCategory)_curseCategoryMethod.Invoke(_curseManagerInstance, new object[0]);

		public static CardCategory CurseSpawnerCategory => (CardCategory)_curseSpawnerCategoryMethod.Invoke(_curseManagerInstance, new object[0]);

		public static CardThemeColorType CursedPink => (CardThemeColorType)_curseColor.Invoke(null, new object[0]);

		public static bool IsPickingCurse => (bool)_isPickingCurse.Invoke(_curseManagerInstance, new object[0]);

		public static bool bCurseAvailable => ((CardInfo[])_getRaw.Invoke(_curseManagerInstance, new object[1] { false })).Count() > 0;

		public static void Init(PluginInfo pluginInfo)
		{
			Assembly assembly = ((object)pluginInfo.Instance).GetType().Assembly;
			Type type = assembly.GetType("WillsWackyManagers.Utils.CurseManager");
			PropertyInfo? property = type.GetProperty("instance", BindingFlags.Static | BindingFlags.Public);
			Type type2 = assembly.GetType("WillsWackyManagers.Utils.CurseManager+CurseThemes");
			_curseManagerInstance = property.GetValue(null);
			_curseCategoryMethod = AccessTools.PropertyGetter(type, "curseCategory");
			_curseColor = AccessTools.PropertyGetter(type2, "CursedPink");
			_isPickingCurse = AccessTools.PropertyGetter(type, "CursePick");
			_cursePlayer = AccessTools.Method(type, "CursePlayer", new Type[2]
			{
				typeof(Player),
				typeof(Action<CardInfo>)
			}, (Type[])null);
			_getRaw = AccessTools.Method(type, "GetRaw", (Type[])null, (Type[])null);
			_curseSpawnerCategoryMethod = AccessTools.PropertyGetter(type, "curseSpawnerCategory");
			_registerCurseMethod = AccessTools.Method(type, "RegisterCurse", (Type[])null, (Type[])null);
		}

		public static void CursePlayer(Player player, Action<CardInfo> callback)
		{
			_cursePlayer.Invoke(_curseManagerInstance, new object[2] { player, callback });
		}

		public static void RegisterCurse(CardInfo curse)
		{
			_registerCurseMethod.Invoke(_curseManagerInstance, new object[1] { curse });
		}
	}
}
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 AssertDominance : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.health = 1.4f;
			gun.damage = 1.4f;
			gun.knockback = 2f;
			gun.reloadTime = 0.75f;
			statModifiers.movementSpeed = 1.25f;
			statModifiers.sizeMultiplier = 1.25f;
		}

		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[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
				float[] array = new float[opponentsPlayersIDs.Length];
				for (int i = 0; i < opponentsPlayersIDs.Length; i++)
				{
					array[i] = OwlCardsData.GetData(opponentsPlayersIDs[i]).Soul - 2f;
				}
				OwlCardsData.UpdateSoul(opponentsPlayersIDs, array);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				int[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
				float[] array = new float[opponentsPlayersIDs.Length];
				for (int i = 0; i < opponentsPlayersIDs.Length; i++)
				{
					array[i] = OwlCardsData.GetData(opponentsPlayersIDs[i]).Soul + 2f;
				}
				OwlCardsData.UpdateSoul(opponentsPlayersIDs, array);
			}
		}

		protected override string GetTitle()
		{
			return "Assert Dominance";
		}

		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
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0106: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Expected O, but got Unknown
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_013a: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[7]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Knockback",
					amount = "+100%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Damage",
					amount = "+40%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Health",
					amount = "+40%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Move speed",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload speed",
					amount = "-25%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Foes' Soul",
					amount = "-2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Size",
					amount = "+25%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

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

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

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)6;
		}
	}
	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 BirdOfPrey : AOwlCard
	{
		public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			statModifiers.attackSpeedMultiplier = 1.15f;
			statModifiers.movementSpeed = 1.15f;
			gun.ammo = 2;
			gun.reloadTime = 1.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.playerID).Soul + 0.5f);
			}
		}

		public override void OnRemoveCard(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.playerID).Soul - 0.5f);
			}
		}

		protected override string GetTitle()
		{
			return "Bird Of Prey";
		}

		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
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e2: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[5]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Attack speed",
					amount = "+15%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Ammo",
					amount = "+2",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Move speed",
					amount = "+15%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload time",
					amount = "+10%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Soul",
					amount = "+0.5",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

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

		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)1;
		}
	}
	internal class CorruptedFaith : 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();
			}
			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)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player.playerID).Soul - 2f);
				Reroll.instance.Add1Reroll(player.playerID);
			}
			int[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
			foreach (int num in opponentsPlayersIDs)
			{
				DrawNCards.SetPickerDraws(num, DrawNCards.GetPickerDraws(num) - 1);
			}
		}

		public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			int[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
			for (int i = 0; i < opponentsPlayersIDs.Length; i++)
			{
				DrawNCards.SetPickerDraws(opponentsPlayersIDs[i], DrawNCards.GetPickerDraws(player.playerID) + 1);
			}
		}

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

		protected override string GetDescription()
		{
			return "Reroll your hand and cripple your foes";
		}

		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 = "Foes' hand size",
					amount = "-1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Soul",
					amount = "-2",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

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

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

		protected override CardThemeColorType GetTheme()
		{
			return (CardThemeColorType)4;
		}
	}
	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[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
				Reroll.instance.AddReroll(opponentsPlayersIDs);
			}
			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.Legendary).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.Legendary) + " 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 to foes",
					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)
		{
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
			{
				OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul - 1f);
			}
		}

		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.Common;
		}

		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()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Rare;
		}

		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 hand 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()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			return Rarities.Scarce;
		}

		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 GameObject GetCardArt()
		{
			return GetCardArt("C_LastHitter");
		}

		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)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[] opponentsPlayersIDs = Utils.GetOpponentsPlayersIDs(player.playerID);
				float[] array = new float[opponentsPlayersIDs.Length];
				for (int i = 0; i < opponentsPlayersIDs.Length; i++)
				{
					array[i] = OwlCardsData.GetData(opponentsPlayersIDs[i]).Soul + 1f;
				}
				OwlCardsData.UpdateSoul(opponentsPlayersIDs, 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 = "Foes' 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.Exotic;
		}

		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