Decompiled source of ForseakynStudiosMemes v0.5.1

FSMemes.dll

Decompiled 5 months ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using CardThemeLib;
using ExitGames.Client.Photon;
using FSMemesPlugin;
using FSMemesPlugin.Cards;
using FSMemesPlugin.Extensions;
using FSMemesPlugin.MonoBehaviours;
using FSMemesPlugin.Networking;
using FSMemesPlugin.Utils;
using FSMemesPlugins.Utils;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.Utils;
using ModsPlus;
using Nullmanager;
using Photon.Pun;
using Photon.Realtime;
using RarityLib.Utils;
using Sonigon;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;

[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("FSMemes")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+4be65213b1d800bb605366de8ca92ad5feda0a05")]
[assembly: AssemblyProduct("FSMemes")]
[assembly: AssemblyTitle("FSMemes")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace FSMemesPlugins.Utils
{
	public class KillsManager : MonoBehaviour
	{
		public List<Player> killed = new List<Player>();

		public static KillsManager instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			else if ((Object)(object)instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)this);
			}
		}

		private void Start()
		{
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)GameStart);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)GameEnd);
			GameModeManager.AddHook("RoundStart", (Func<IGameModeHandler, IEnumerator>)RoundStart);
			GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)RoundEnd);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
		}

		public bool KillPlayer(Player player, Player damagingPlayer = null)
		{
			if (killed.Contains(player))
			{
				return false;
			}
			killed.Add(player);
			player.data.stats.GetAdditionalData().totalDeaths++;
			player.data.stats.GetAdditionalData().deathsInRound++;
			player.data.stats.GetAdditionalData().lastKilledBy = damagingPlayer;
			player.data.stats.GetAdditionalData().killingSpree = 0;
			if ((Object)(object)damagingPlayer == (Object)null)
			{
				return true;
			}
			damagingPlayer.data.stats.GetAdditionalData().totalKills++;
			damagingPlayer.data.stats.GetAdditionalData().killingSpree++;
			damagingPlayer.data.stats.GetAdditionalData().killsInRound++;
			switch (damagingPlayer.data.stats.GetAdditionalData().killingSpree)
			{
			case 2:
				SoundManager.Instance.Play(Assets.DoubleKillSound, SoundManager.Instance.GetTransform());
				break;
			case 3:
				SoundManager.Instance.Play(Assets.MultiKillSound, SoundManager.Instance.GetTransform());
				break;
			case 4:
				SoundManager.Instance.Play(Assets.MegaKillSound, SoundManager.Instance.GetTransform());
				break;
			case 5:
				SoundManager.Instance.Play(Assets.UltraKillSound, SoundManager.Instance.GetTransform());
				break;
			case 6:
				SoundManager.Instance.Play(Assets.MonsterKillSound, SoundManager.Instance.GetTransform());
				break;
			case 7:
				SoundManager.Instance.Play(Assets.LudicrousKillSound, SoundManager.Instance.GetTransform());
				break;
			case 8:
				SoundManager.Instance.Play(Assets.HolyShitSound, SoundManager.Instance.GetTransform());
				break;
			case 9:
				SoundManager.Instance.Play(Assets.UnstoppableSound, SoundManager.Instance.GetTransform());
				break;
			default:
				SoundManager.Instance.Play(Assets.GodLikeSound, SoundManager.Instance.GetTransform());
				break;
			case 1:
				break;
			}
			return true;
		}

		private IEnumerator GameStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator GameEnd(IGameModeHandler gm)
		{
			foreach (Player player in PlayerManager.instance.players)
			{
				if (player.data.stats.GetAdditionalData().deathsInRound == 0 && player.data.stats.GetAdditionalData().killsInRound == PlayerManager.instance.players.Count() * 2)
				{
					SoundManager.Instance.Play(Assets.DominatingSound, SoundManager.Instance.GetTransform());
				}
				else if (player.data.stats.GetAdditionalData().deathsInRound == 0)
				{
					SoundManager.Instance.Play(Assets.FlawlessVictorySound, SoundManager.Instance.GetTransform());
				}
				player.data.stats.GetAdditionalData().deathsInRound = 0;
				player.data.stats.GetAdditionalData().killsInRound = 0;
			}
			yield break;
		}

		private IEnumerator RoundStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator RoundEnd(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PointStart(IGameModeHandler gm)
		{
			killed = new List<Player>();
			yield break;
		}

		private IEnumerator PointEnd(IGameModeHandler gm)
		{
			yield break;
		}
	}
}
namespace FSMemes.Patches
{
	[Serializable]
	[HarmonyPatch(typeof(HealthHandler), "DoDamage")]
	internal class HealtHandlerPatchDoDamage
	{
		private static void Prefix(HealthHandler __instance, ref Vector2 damage, Vector2 position, Color blinkColor, GameObject damagingWeapon, Player damagingPlayer, bool healthRemoval, ref bool lethal, bool ignoreBlock)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			Player player = val.player;
			if (!val.isPlaying || val.dead || __instance.isRespawning)
			{
				return;
			}
			float num = val.health - ((Vector2)(ref damage)).magnitude;
			if (!lethal)
			{
				num = Mathf.Clamp(val.health, 1f, val.maxHealth);
			}
			if ((Object)(object)damagingPlayer == (Object)null || player.playerID == damagingPlayer.playerID)
			{
				if (num <= 0f)
				{
					SoundManager.Instance.Play(Assets.SadTromboneSound, SoundManager.Instance.GetTransform());
				}
				else
				{
					SoundManager.Instance.Play(Assets.DohSound, SoundManager.Instance.GetTransform());
				}
			}
			if (num <= 0f)
			{
				KillsManager.instance.KillPlayer(player, damagingPlayer);
			}
		}
	}
}
namespace FSMemesPlugin
{
	internal class Assets
	{
		private static AssetBundle Bundle;

		public static GameObject PewCardArt;

		public static GameObject MorePewCardArt;

		public static GameObject UltimatePewCardArt;

		public static GameObject InfinitePewCardArt;

		public static GameObject NoMoreHealingCardArt;

		public static GameObject SwitchCardArt;

		public static GameObject CopyCardArt;

		public static GameObject DeLegendarizerCardArt;

		public static GameObject ShuffleChaosCardArt;

		public static GameObject RankUpCardArt;

		public static GameObject RankDownCardArt;

		public static GameObject RouletteCardArt;

		public static SoundEvent DangerAlarmSound;

		public static SoundEvent ZzzSound;

		public static SoundEvent PussySound;

		public static SoundEvent OhnonononoSound;

		public static SoundEvent PewSound;

		public static SoundEvent DoItKillMeNowSound;

		public static SoundEvent NeeeSound;

		public static SoundEvent SadTromboneSound;

		public static SoundEvent DohSound;

		public static SoundEvent SucksToBeYouSound;

		public static SoundEvent ImBackSound;

		public static SoundEvent LegendarySound;

		public static SoundEvent AwesomeSound;

		public static SoundEvent DoubleKillSound;

		public static SoundEvent MultiKillSound;

		public static SoundEvent MegaKillSound;

		public static SoundEvent UltraKillSound;

		public static SoundEvent MonsterKillSound;

		public static SoundEvent LudicrousKillSound;

		public static SoundEvent HolyShitSound;

		public static SoundEvent KillingSpreeSound;

		public static SoundEvent RampageSound;

		public static SoundEvent DominatingSound;

		public static SoundEvent UnstoppableSound;

		public static SoundEvent GodLikeSound;

		public static SoundEvent WhickedSickSound;

		public static SoundEvent FlawlessVictorySound;

		public static event Action OnFinishedLoadingAssets;

		public static IEnumerator LoadAssets()
		{
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "fsmassets");
			FSMemes.LOGGER.LogInfo((object)("Started loading AssetsBundle from '" + text + "'"));
			Bundle = AssetBundle.LoadFromFile(text);
			if ((Object)(object)Bundle == (Object)null)
			{
				FSMemes.LOGGER.LogError((object)("AssetBundle '" + text + "' not found in assembly manifest"));
				yield break;
			}
			PewCardArt = Bundle.LoadAsset<GameObject>("C_Pew");
			MorePewCardArt = Bundle.LoadAsset<GameObject>("C_MorePew");
			UltimatePewCardArt = Bundle.LoadAsset<GameObject>("C_UltimatePew");
			InfinitePewCardArt = Bundle.LoadAsset<GameObject>("C_InfinitePew");
			NoMoreHealingCardArt = Bundle.LoadAsset<GameObject>("C_NoMoreHealing");
			SwitchCardArt = Bundle.LoadAsset<GameObject>("C_Switch");
			CopyCardArt = Bundle.LoadAsset<GameObject>("C_Copy");
			DeLegendarizerCardArt = Bundle.LoadAsset<GameObject>("C_DeLegendarizer");
			ShuffleChaosCardArt = Bundle.LoadAsset<GameObject>("C_ShuffleChaos");
			RankUpCardArt = Bundle.LoadAsset<GameObject>("C_RankUp");
			RankDownCardArt = Bundle.LoadAsset<GameObject>("C_RankDown");
			RouletteCardArt = Bundle.LoadAsset<GameObject>("C_Roulette");
			DangerAlarmSound = Bundle.LoadAsset<SoundEvent>("DangerAlarm_SE");
			ZzzSound = Bundle.LoadAsset<SoundEvent>("Zzz_SE");
			PussySound = Bundle.LoadAsset<SoundEvent>("Pussy_SE");
			OhnonononoSound = Bundle.LoadAsset<SoundEvent>("Ohnononono_SE");
			PewSound = Bundle.LoadAsset<SoundEvent>("Pew_SE");
			DoItKillMeNowSound = Bundle.LoadAsset<SoundEvent>("DoItKillMeNow_SE");
			NeeeSound = Bundle.LoadAsset<SoundEvent>("Neee_SE");
			SadTromboneSound = Bundle.LoadAsset<SoundEvent>("SadTrombone_SE");
			DohSound = Bundle.LoadAsset<SoundEvent>("Doh_SE");
			SucksToBeYouSound = Bundle.LoadAsset<SoundEvent>("SucksToBeYou_SE");
			ImBackSound = Bundle.LoadAsset<SoundEvent>("ImBack_SE");
			LegendarySound = Bundle.LoadAsset<SoundEvent>("Legendary_SE");
			AwesomeSound = Bundle.LoadAsset<SoundEvent>("Awesome_SE");
			DoubleKillSound = Bundle.LoadAsset<SoundEvent>("DoubleKill_SE");
			MultiKillSound = Bundle.LoadAsset<SoundEvent>("MultiKill_SE");
			MegaKillSound = Bundle.LoadAsset<SoundEvent>("MegaKill_SE");
			UltraKillSound = Bundle.LoadAsset<SoundEvent>("UltraKill_SE");
			MonsterKillSound = Bundle.LoadAsset<SoundEvent>("MonsterKill_SE");
			LudicrousKillSound = Bundle.LoadAsset<SoundEvent>("LudicrousKill_SE");
			HolyShitSound = Bundle.LoadAsset<SoundEvent>("HolyShit_SE");
			KillingSpreeSound = Bundle.LoadAsset<SoundEvent>("KillingSpree_SE");
			RampageSound = Bundle.LoadAsset<SoundEvent>("Rampage_SE");
			DominatingSound = Bundle.LoadAsset<SoundEvent>("Dominating_SE");
			UnstoppableSound = Bundle.LoadAsset<SoundEvent>("Unstoppable_SE");
			GodLikeSound = Bundle.LoadAsset<SoundEvent>("GodLike_SE");
			WhickedSickSound = Bundle.LoadAsset<SoundEvent>("WhickedSick_SE");
			FlawlessVictorySound = Bundle.LoadAsset<SoundEvent>("FlawlessVictory_SE");
			FSMemes.LOGGER.LogInfo((object)("Finished loading AssetsBundle from '" + text + "'"));
			Assets.OnFinishedLoadingAssets?.Invoke();
		}
	}
	[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.forseakynstudios.rounds.memes", "ForseakynStudiosMemes", "0.5.1")]
	[BepInProcess("Rounds.exe")]
	public class FSMemes : BaseUnityPlugin
	{
		private const string modId = "com.forseakynstudios.rounds.memes";

		private const string modName = "ForseakynStudiosMemes";

		public const string modInitials = "FSM";

		internal static CardThemeColorType cardThemeColor;

		public static ManualLogSource LOGGER => ((BaseUnityPlugin)instance).Logger;

		public static FSMemes instance { get; set; }

		private void Awake()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: 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_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			instance = this;
			Assets.OnFinishedLoadingAssets += OnAssetsLoaded;
			((MonoBehaviour)Unbound.Instance).StartCoroutine(Assets.LoadAssets());
			cardThemeColor = CardThemeLib.instance.CreateOrGetType("WackyYellow", new CardThemeColor
			{
				bgColor = new Color(0.95f, 0.82f, 0.4f),
				targetColor = new Color(0.85f, 0.72f, 0.3f)
			});
			ExtensionMethods.GetOrAddComponent<KillsManager>(((Component)this).gameObject, false);
			ExtensionMethods.GetOrAddComponent<RarityCardManager>(((Component)this).gameObject, false);
			ExtensionMethods.GetOrAddComponent<SwapCardManager>(((Component)this).gameObject, false);
			ExtensionMethods.GetOrAddComponent<SettingCoordinator>(((Component)this).gameObject, false);
			GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)GameStart);
			GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)GameEnd);
			GameModeManager.AddHook("RoundStart", (Func<IGameModeHandler, IEnumerator>)RoundStart);
			GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)RoundEnd);
			GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
			GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
			GameModeManager.AddHook("PickStart", (Func<IGameModeHandler, IEnumerator>)PickStart);
			GameModeManager.AddHook("PickEnd", (Func<IGameModeHandler, IEnumerator>)PickEnd);
			GameModeManager.AddHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)PlayerPickStart);
			GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)PlayerPickEnd);
		}

		private void Start()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			new Harmony("com.forseakynstudios.rounds.memes").PatchAll();
		}

		private void OnAssetsLoaded()
		{
			LOGGER.LogInfo((object)"Assets done loading, register cards");
			RegisterPrefabs();
			RegisterCards();
		}

		private void RegisterPrefabs()
		{
		}

		private void RegisterCards()
		{
			CardsRegistry.RegisterCard<PewCard>();
			CardsRegistry.RegisterCard<MorePewCard>();
			CardsRegistry.RegisterCard<UltimatePewCard>();
			CardsRegistry.RegisterCard<InfinitePewCard>();
			CardsRegistry.RegisterCard<NoMoreHealingCard>();
			CardsRegistry.RegisterCard<SwitchCard>();
			CardsRegistry.RegisterCard<CopyCard>();
			CardsRegistry.RegisterCard<DeLegendarizerCard>();
			CardsRegistry.RegisterCard<ShuffleChaosCard>();
			CardsRegistry.RegisterCard<RankUpCard>();
			CardsRegistry.RegisterCard<RankDownCard>();
			CardsRegistry.RegisterCard<RouletteCard>();
		}

		private IEnumerator GameStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator GameEnd(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator RoundStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator RoundEnd(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PointStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PointEnd(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PickStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PickEnd(IGameModeHandler gm)
		{
			if (SwapCardManager.instance.copyCards)
			{
				((MonoBehaviour)this).StartCoroutine(SwapCardManager.instance.CopyCardsOfPlayer());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !SwapCardManager.instance.copyCards));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties[(object)"Copy Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
			}
			if (SwapCardManager.instance.swapAllCards)
			{
				((MonoBehaviour)this).StartCoroutine(SwapCardManager.instance.SwapCardsWithPlayer());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !SwapCardManager.instance.swapAllCards));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties2 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties2[(object)"Swap All Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties2, (Hashtable)null, (WebFlags)null);
			}
			if (SwapCardManager.instance.swapOneCard)
			{
				((MonoBehaviour)this).StartCoroutine(SwapCardManager.instance.SwapOneCardAllPlayers());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !SwapCardManager.instance.swapOneCard));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties3 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties3[(object)"Swap One Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties3, (Hashtable)null, (WebFlags)null);
			}
			if (SwapCardManager.instance.shuffleChaos)
			{
				((MonoBehaviour)this).StartCoroutine(SwapCardManager.instance.ShuffleAllCards());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !SwapCardManager.instance.shuffleChaos));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties4 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties4[(object)"Shuffle Chaos Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties4, (Hashtable)null, (WebFlags)null);
			}
			if (RarityCardManager.instance.deLegendarize)
			{
				((MonoBehaviour)this).StartCoroutine(RarityCardManager.instance.DeLegendarizer());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !RarityCardManager.instance.deLegendarize));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties5 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties5[(object)"De-Legendarizer Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties5, (Hashtable)null, (WebFlags)null);
			}
			if (RarityCardManager.instance.rankUp)
			{
				((MonoBehaviour)this).StartCoroutine(RarityCardManager.instance.RankUp());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !RarityCardManager.instance.rankUp));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties6 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties6[(object)"Rank Up Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties6, (Hashtable)null, (WebFlags)null);
			}
			if (RarityCardManager.instance.rankDown)
			{
				((MonoBehaviour)this).StartCoroutine(RarityCardManager.instance.RankDown());
			}
			yield return (object)new WaitUntil((Func<bool>)(() => !RarityCardManager.instance.rankDown));
			if (!PhotonNetwork.OfflineMode)
			{
				Hashtable customProperties7 = PhotonNetwork.LocalPlayer.CustomProperties;
				customProperties7[(object)"Rank Down Sync Stats"] = false;
				PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties7, (Hashtable)null, (WebFlags)null);
			}
		}

		private IEnumerator PlayerPickStart(IGameModeHandler gm)
		{
			yield break;
		}

		private IEnumerator PlayerPickEnd(IGameModeHandler gm)
		{
			yield break;
		}

		internal void OnHandShakeCompleted()
		{
			if (PhotonNetwork.IsMasterClient)
			{
				for (int i = 0; i < 1; i++)
				{
					NetworkingManager.RPC(typeof(FSMemes), "RPCA_SyncSettings", new object[0]);
					RPCA_SyncSettings();
				}
			}
		}

		[UnboundRPC]
		private static void RPCA_SyncSettings()
		{
			Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
			customProperties[(object)"FSM Settings"] = true;
			PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
		}
	}
}
namespace FSMemesPlugin.Utils
{
	public static class CardsRegistry
	{
		private static Dictionary<Type, CardInfo> storedCardInfo = new Dictionary<Type, CardInfo>();

		public static void RegisterCard<T>() where T : CustomCard
		{
			CustomCard.BuildCard<T>((Action<CardInfo>)StoreCard<T>);
		}

		private static void StoreCard<T>(CardInfo card) where T : CustomCard
		{
			if (((Component)card).GetComponent<ISaveableCard>() != null)
			{
				ISaveableCard component = ((Component)card).GetComponent<ISaveableCard>();
				if (component != null)
				{
					component.CardInfo = card;
				}
			}
			storedCardInfo.Add(typeof(T), card);
		}

		public static CardInfo GetCard<T>() where T : CustomCard
		{
			if (storedCardInfo.TryGetValue(typeof(T), out CardInfo value))
			{
				return value;
			}
			return null;
		}
	}
	public interface ISaveableCard
	{
		CardInfo CardInfo { get; set; }
	}
	public class RarityCardManager : MonoBehaviour
	{
		public List<Player> rankUpPlayers = new List<Player>();

		public List<Player> rankDownPlayers = new List<Player>();

		public bool deLegendarize;

		public bool rankDown;

		public bool rankUp;

		public CardInfo deLegendarizerCard;

		public CardInfo rankDownCard;

		public CardInfo rankUpCard;

		private Random random = new Random();

		public static RarityCardManager instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			else if ((Object)(object)instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)this);
			}
		}

		public IEnumerator DeLegendarizer()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				foreach (Player player in PlayerManager.instance.players)
				{
					CardInfo[] array = (from cardData in player.data.currentCards.ToArray()
						where (int)cardData.rarity > 2
						select cardData).ToArray();
					FSMemes.LOGGER.LogInfo((object)$"Player {player.playerID} has a total of {array.Count()} legendary cards.");
					if (array.Count() > 0)
					{
						for (int i = 0; i < array.Count(); i++)
						{
							FSMemes.LOGGER.LogInfo((object)$"Player {player.playerID} removing card '{array[i].cardName}'.");
						}
						Cards.instance.RemoveCardsFromPlayer(player, array, (SelectionType)0);
						yield return WaitFor.Frames(40);
					}
				}
			}
			deLegendarize = false;
			yield return WaitFor.Synchronization("De-Legendarizer Sync Stats");
			yield return null;
		}

		public IEnumerator RankUp()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				Player[] players = rankUpPlayers.ToArray();
				for (int i = 0; i < players.Count(); i++)
				{
					yield return WaitFor.Frames(40);
					List<CardInfo> allCards = (from cardData in CardManager.cards.Values.ToArray()
						where cardData.enabled && !cardData.cardInfo.categories.Contains(CustomCardCategories.instance.CardCategory("CardManipulation")) && !cardData.cardInfo.categories.Contains(CustomCardCategories.instance.CardCategory("AIMinion")) && !(cardData.cardInfo.cardName.ToLower() == "shuffle")
						select cardData into card
						select card.cardInfo).ToList();
					CardInfo[] cardList = players[i].data.currentCards.ToArray();
					Cards.instance.RemoveAllCardsFromPlayer(players[i], true);
					yield return WaitFor.Frames(40);
					FSMemes.LOGGER.LogInfo((object)$"Player {players[i].playerID} has a total of {cardList.Count()} to increase.");
					for (int j = 0; j < cardList.Count(); j++)
					{
						CardInfo val = cardList[j];
						if (!val.categories.Contains(CustomCardCategories.instance.CardCategory("NoRemove")) && (int)val.rarity <= 2 && (Object)(object)val != (Object)(object)rankUpCard)
						{
							Rarity rarity = IncreaseCardRarity(val);
							CardInfo[] array = allCards.Where((CardInfo cardInfo) => cardInfo.rarity == rarity && Cards.instance.PlayerIsAllowedCard(players[i], cardInfo)).ToArray();
							if (array.Count() > 0)
							{
								CardInfo val2 = array[random.Next(array.Count())];
								FSMemes.LOGGER.LogInfo((object)$"Player {players[i].playerID} replacing '{val.cardName}' with '{val2.cardName}'.");
								Cards.instance.AddCardToPlayer(players[i], val2, false, "", 0f, 0f, true);
								yield return WaitFor.Frames(40);
							}
							else
							{
								FSMemes.LOGGER.LogInfo((object)$"Player {players[i].playerID} card '{val.cardName}' cannot find a new replacement, re-assinging this one.");
								Cards.instance.AddCardToPlayer(players[i], val, false, "", 0f, 0f, true);
								yield return WaitFor.Frames(40);
							}
						}
						else
						{
							FSMemes.LOGGER.LogInfo((object)$"Player {players[i].playerID} card '{val.cardName}' cannot be replaced.");
							Cards.instance.AddCardToPlayer(players[i], val, false, "", 0f, 0f, true);
							yield return WaitFor.Frames(40);
						}
					}
				}
			}
			rankUpPlayers = new List<Player>();
			rankUp = false;
			yield return WaitFor.Synchronization("Rank Up Sync Stats");
			yield return null;
		}

		public IEnumerator RankDown()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				Player[] players = rankDownPlayers.ToArray();
				for (int i = 0; i < players.Count(); i++)
				{
					yield return WaitFor.Frames(40);
					Player enemy = PlayerManager.instance.GetRandomEnemy(players[i]);
					int num = 0;
					while (enemy.data.currentCards.Count() == 0 && num < 5)
					{
						num++;
						enemy = PlayerManager.instance.GetRandomEnemy(players[i]);
					}
					if ((Object)(object)enemy == (Object)null || enemy.data.currentCards.Count() == 0)
					{
						continue;
					}
					List<CardInfo> allCards = (from cardData in CardManager.cards.Values.ToArray()
						where cardData.enabled && !cardData.cardInfo.categories.Contains(CustomCardCategories.instance.CardCategory("CardManipulation")) && !cardData.cardInfo.categories.Contains(CustomCardCategories.instance.CardCategory("AIMinion")) && !(cardData.cardInfo.cardName.ToLower() == "shuffle")
						select cardData into card
						select card.cardInfo).ToList();
					CardInfo[] cardList = enemy.data.currentCards.ToArray();
					Cards.instance.RemoveAllCardsFromPlayer(enemy, true);
					yield return WaitFor.Frames(40);
					FSMemes.LOGGER.LogInfo((object)$"Player {enemy.playerID} has a total of {cardList.Count()} cards and a total of {allCards.Count()} cards to pick from.");
					for (int j = 0; j < cardList.Count(); j++)
					{
						CardInfo val = cardList[j];
						if (!val.categories.Contains(CustomCardCategories.instance.CardCategory("NoRemove")) && (int)val.rarity > 0)
						{
							Rarity rarity = DecreaseCardRarity(val);
							CardInfo[] array = allCards.Where((CardInfo cardInfo) => cardInfo.rarity == rarity && Cards.instance.PlayerIsAllowedCard(enemy, cardInfo)).ToArray();
							if (array.Count() > 0)
							{
								CardInfo val2 = array[random.Next(array.Count())];
								FSMemes.LOGGER.LogInfo((object)$"Player {enemy.playerID} replacing '{val.cardName}' with '{val2.cardName}'.");
								Cards.instance.AddCardToPlayer(enemy, val2, false, "", 0f, 0f, true);
								yield return WaitFor.Frames(40);
							}
							else
							{
								FSMemes.LOGGER.LogInfo((object)$"Player {enemy.playerID} card '{val.cardName}' cannot find a new replacement, re-assinging this one.");
								Cards.instance.AddCardToPlayer(enemy, val, false, "", 0f, 0f, true);
								yield return WaitFor.Frames(40);
							}
						}
						else
						{
							FSMemes.LOGGER.LogInfo((object)$"Player {enemy.playerID} card '{val.cardName}' cannot be replaced.");
							Cards.instance.AddCardToPlayer(enemy, val, false, "", 0f, 0f, true);
							yield return WaitFor.Frames(40);
						}
					}
				}
			}
			rankDownPlayers = new List<Player>();
			rankDown = false;
			yield return WaitFor.Synchronization("Rank Down Sync Stats");
			yield return null;
		}

		private Rarity IncreaseCardRarity(CardInfo cardInfo)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_0019: Expected I4, but got Unknown
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			Rarity rarity = cardInfo.rarity;
			return (Rarity)((int)rarity switch
			{
				0 => 1, 
				1 => 2, 
				2 => RarityUtils.GetRarity("Legendary"), 
				_ => 0, 
			});
		}

		private Rarity DecreaseCardRarity(CardInfo cardInfo)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: 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_0009: Invalid comparison between Unknown and I4
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_000d: Invalid comparison between Unknown and I4
			Rarity rarity = cardInfo.rarity;
			if ((int)rarity > 1)
			{
				if ((int)rarity == 2)
				{
					return (Rarity)1;
				}
				return (Rarity)2;
			}
			return (Rarity)0;
		}
	}
	public class SwapCardManager : MonoBehaviour
	{
		public List<Player> copyPlayers = new List<Player>();

		public List<Player> swapPlayers = new List<Player>();

		public Player shufflePlayer;

		public bool copyCards;

		public bool swapAllCards;

		public bool swapOneCard;

		public bool shuffleChaos;

		public CardInfo copyCard;

		public CardInfo switchCard;

		public CardInfo rouletteCard;

		public CardInfo shuffleChaosCard;

		private Random random = new Random();

		public static SwapCardManager instance { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			else if ((Object)(object)instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)this);
			}
		}

		public IEnumerator CopyCardsOfPlayer()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				Player[] arrayPlayer = copyPlayers.ToArray();
				for (int i = 0; i < arrayPlayer.Count(); i++)
				{
					yield return WaitFor.Frames(40);
					Player enemy = PlayerManager.instance.GetRandomEnemy(arrayPlayer[i]);
					int num = 0;
					while (enemy.data.currentCards.Count() == 0 && num < 5)
					{
						num++;
						enemy = PlayerManager.instance.GetRandomEnemy(arrayPlayer[i]);
					}
					if ((Object)(object)enemy != (Object)null)
					{
						Cards.instance.RemoveAllCardsFromPlayer(arrayPlayer[i], true);
						yield return WaitFor.Frames(40);
						FSMemes.LOGGER.LogInfo((object)$"Player {arrayPlayer[i].playerID} copying all cards of player {enemy.playerID}.");
						CardInfo[] enemyCardList = enemy.data.currentCards.ToArray();
						for (int j = 0; j < enemyCardList.Count(); j++)
						{
							Cards.instance.AddCardToPlayer(arrayPlayer[i], enemyCardList[j], false, "", 0f, 0f, true);
							yield return WaitFor.Frames(40);
						}
						Cards.instance.AddCardToPlayer(arrayPlayer[i], copyCard, true, "", 2f, 2f, true);
						yield return WaitFor.Frames(40);
					}
				}
			}
			copyPlayers = new List<Player>();
			copyCards = false;
			yield return WaitFor.Synchronization("Copy Sync Stats");
			yield return null;
		}

		public IEnumerator SwapCardsWithPlayer()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				Player[] arrayPlayer = swapPlayers.ToArray();
				for (int i = 0; i < arrayPlayer.Count(); i++)
				{
					yield return WaitFor.Frames(40);
					Player enemy = PlayerManager.instance.GetRandomEnemy(arrayPlayer[i]);
					int num = 0;
					while (enemy.data.currentCards.Count() == 0 && num < 5)
					{
						num++;
						enemy = PlayerManager.instance.GetRandomEnemy(arrayPlayer[i]);
					}
					if (!((Object)(object)enemy != (Object)null))
					{
						continue;
					}
					CardInfo[] enemyCardList = enemy.data.currentCards.ToArray();
					CardInfo[] playerCardList = arrayPlayer[i].data.currentCards.ToArray();
					FSMemes.LOGGER.LogInfo((object)$"Player {arrayPlayer[i].playerID} replacing all cards with player {enemy.playerID}.");
					Cards.instance.RemoveAllCardsFromPlayer(enemy, true);
					Cards.instance.RemoveAllCardsFromPlayer(arrayPlayer[i], true);
					yield return WaitFor.Frames(40);
					for (int k = 0; k < playerCardList.Count(); k++)
					{
						if ((Object)(object)playerCardList[k] != (Object)(object)switchCard)
						{
							Cards.instance.AddCardToPlayer(enemy, playerCardList[k], false, "", 0f, 0f, true);
							yield return WaitFor.Frames(40);
						}
					}
					for (int k = 0; k < enemyCardList.Count(); k++)
					{
						Cards.instance.AddCardToPlayer(arrayPlayer[i], enemyCardList[k], false, "", 0f, 0f, true);
						yield return WaitFor.Frames(40);
					}
					Cards.instance.AddCardToPlayer(arrayPlayer[i], switchCard, true, "", 2f, 2f, true);
					yield return WaitFor.Frames(40);
				}
			}
			swapPlayers = new List<Player>();
			swapAllCards = false;
			yield return WaitFor.Synchronization("Swap All Sync Stats");
			yield return null;
		}

		public IEnumerator SwapOneCardAllPlayers()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				FSMemes.LOGGER.LogInfo((object)"Swap one card of each player.");
				List<CardInfo> cardList = new List<CardInfo>();
				List<Player> playerList = new List<Player>();
				foreach (Player player in PlayerManager.instance.players)
				{
					yield return WaitFor.Frames(40);
					CardInfo[] array = (from cardData in player.data.currentCards.ToArray()
						where !cardData.categories.Contains(CustomCardCategories.instance.CardCategory("CardManipulation")) && !cardData.categories.Contains(CustomCardCategories.instance.CardCategory("NoRemove")) && !cardData.categories.Contains(CustomCardCategories.instance.CardCategory("AIMinion")) && !(cardData.cardName.ToLower() == "shuffle")
						select cardData).ToArray();
					if (array.Count() > 0)
					{
						CardInfo randomCard2 = array[Random.Range(0, array.Count() - 1)];
						cardList.Add(randomCard2);
						playerList.Add(player);
						Cards.instance.RemoveCardFromPlayer(player, randomCard2, (SelectionType)3);
						yield return WaitFor.Frames(40);
						FSMemes.LOGGER.LogInfo((object)$"Player {player.playerID} removed card '{randomCard2.cardName}'.");
					}
				}
				int i;
				for (i = 0; i < playerList.Count(); i++)
				{
					List<CardInfo> list = cardList.Where((CardInfo card) => (Object)(object)card != (Object)(object)cardList[i]).ToList();
					CardInfo randomCard2 = ((list.Count() > 1) ? list[Random.Range(0, list.Count() - 1)] : list[0]);
					Cards.instance.AddCardToPlayer(playerList[i], randomCard2, false, "", 0f, 0f, true);
					yield return WaitFor.Frames(40);
					cardList.Remove(randomCard2);
					FSMemes.LOGGER.LogInfo((object)$"Player {playerList[i].playerID} received card '{randomCard2.cardName}'.");
				}
			}
			swapOneCard = false;
			yield return WaitFor.Synchronization("Swap One Sync Stats");
			yield return null;
		}

		public IEnumerator ShuffleAllCards()
		{
			if (PhotonNetwork.LocalPlayer.IsMasterClient || PhotonNetwork.OfflineMode)
			{
				List<CardInfo> allCards = new List<CardInfo>();
				List<int> playerCardCount = new List<int>();
				foreach (Player player2 in PlayerManager.instance.players)
				{
					yield return WaitFor.Frames(40);
					CardInfo[] array = player2.data.currentCards.ToArray();
					for (int i = 0; i < array.Count(); i++)
					{
						allCards.Add(array[i]);
					}
					playerCardCount.Add(player2.data.currentCards.Count());
					if (player2.playerID == shufflePlayer.playerID)
					{
						allCards.Remove(shuffleChaosCard);
						playerCardCount[player2.playerID]--;
					}
					Cards.instance.RemoveAllCardsFromPlayer(player2, true);
					yield return WaitFor.Frames(40);
				}
				FSMemes.LOGGER.LogInfo((object)$"Shuffle a total of {allCards.Count()} cards between {PlayerManager.instance.players.Count()} players.");
				int shuffleRounds = 0;
				bool shuffleFinished = false;
				while (!shuffleFinished)
				{
					shuffleRounds++;
					foreach (Player player2 in PlayerManager.instance.players)
					{
						FSMemes.LOGGER.LogInfo((object)$"Player {player2.playerID} has {playerCardCount[player2.playerID]} cardslots left.");
						if (playerCardCount[player2.playerID] <= 0)
						{
							continue;
						}
						int num = 0;
						while (num < 50)
						{
							num++;
							CardInfo randomCard = allCards[random.Next(allCards.Count())];
							if (Cards.instance.PlayerIsAllowedCard(player2, randomCard))
							{
								FSMemes.LOGGER.LogInfo((object)$"Player {player2.playerID} gets '{randomCard.cardName}' card.");
								Cards.instance.AddCardToPlayer(player2, randomCard, false, "", 0f, 0f, true);
								yield return WaitFor.Frames(40);
								allCards.Remove(randomCard);
								playerCardCount[player2.playerID]--;
								break;
							}
						}
					}
					if (allCards.Count() <= 0 || shuffleRounds > 500)
					{
						shuffleFinished = true;
					}
				}
				Cards.instance.AddCardToPlayer(shufflePlayer, shuffleChaosCard, false, "", 2f, 2f, true);
				yield return WaitFor.Frames(40);
			}
			shuffleChaos = false;
			shufflePlayer = null;
			yield return WaitFor.Synchronization("Shuffle Chaos Sync Stats");
			yield return null;
		}
	}
	internal static class WaitFor
	{
		public static IEnumerator Frames(int frameCount)
		{
			if (frameCount <= 0)
			{
				throw new ArgumentOutOfRangeException("frameCount", "Cannot wait for less that 1 frame");
			}
			while (frameCount > 0)
			{
				frameCount--;
				yield return null;
			}
		}

		public static IEnumerator Synchronization(string syncProperty)
		{
			Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
			customProperties[(object)syncProperty] = true;
			PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
			bool inSync = false;
			while (!inSync && !PhotonNetwork.OfflineMode)
			{
				inSync = true;
				foreach (Player value2 in PhotonNetwork.CurrentRoom.Players.Values)
				{
					if (((Dictionary<object, object>)(object)value2.CustomProperties).TryGetValue((object)syncProperty, out object value))
					{
						if (!(bool)value)
						{
							inSync = false;
						}
					}
					else
					{
						inSync = false;
					}
				}
				yield return null;
			}
			yield return Frames(10);
			customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
			customProperties[(object)syncProperty] = false;
			PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
			yield return Frames(10);
		}
	}
}
namespace FSMemesPlugin.Patches
{
	[HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")]
	internal class ApplyCardStats_ApplyStatsPatch
	{
		private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
		{
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: 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_00ca: Invalid comparison between Unknown and I4
			try
			{
				if (((Component)__instance).GetComponent<CardInfo>() is NullCardInfo || ((Component)__instance).GetComponent<CardInfo>().sourceCard is NullCardInfo)
				{
					SoundManager.Instance.Play(Assets.NeeeSound, SoundManager.Instance.GetTransform());
				}
				else if (((Component)__instance).GetComponent<CardInfo>().rarity == RarityUtils.GetRarity("Legendary"))
				{
					SoundManager.Instance.Play(Assets.LegendarySound, SoundManager.Instance.GetTransform());
				}
				else if (((Component)__instance).GetComponent<CardInfo>().cardName == "Nothing" || ((Component)__instance).GetComponent<CardInfo>().cardName == "Zero Point")
				{
					SoundManager.Instance.Play(Assets.SucksToBeYouSound, SoundManager.Instance.GetTransform());
				}
				else if ((int)((Component)__instance).GetComponent<CardInfo>().rarity > 2)
				{
					SoundManager.Instance.Play(Assets.AwesomeSound, SoundManager.Instance.GetTransform());
				}
				else if (((Component)__instance).GetComponent<CharacterStatModifiers>().regen > 0f || ((Component)__instance).GetComponent<CharacterStatModifiers>().lifeSteal > 0f)
				{
					SoundManager.Instance.Play(Assets.PussySound, SoundManager.Instance.GetTransform());
				}
				else if (((Component)__instance).GetComponent<Gun>().damage > 2f)
				{
					SoundManager.Instance.Play(Assets.OhnonononoSound, SoundManager.Instance.GetTransform());
				}
			}
			catch
			{
			}
		}
	}
	[HarmonyPatch(typeof(DeathEffect), "PlayDeath")]
	internal class DeathEffect_PlayDeathPatch
	{
		private static void Postfix(DeathEffect __instance, Color color, PlayerVelocity playerRig, Vector2 vel, int playerIDToRevive)
		{
			if (playerIDToRevive != -1)
			{
				SoundManager.Instance.Play(Assets.ImBackSound, SoundManager.Instance.GetTransform());
			}
		}
	}
}
namespace FSMemesPlugin.Networking
{
	internal class SettingCoordinator : MonoBehaviourPunCallbacks
	{
		internal const string SettingsPropertyName = "FSM Settings";

		internal const string EnforceCardSyncProperty = "Enforce Card Sync Stats";

		internal const string CopySyncProperty = "Copy Sync Stats";

		internal const string DeLegendarizerSyncProperty = "De-Legendarizer Sync Stats";

		internal const string ShuffleChaosSyncProperty = "Shuffle Chaos Sync Stats";

		internal const string SwapAllSyncProperty = "Swap All Sync Stats";

		internal const string SwapOneSyncProperty = "Swap One Sync Stats";

		internal const string RankUpSyncProperty = "Rank Up Sync Stats";

		internal const string RankDownSyncProperty = "Rank Down Sync Stats";

		public static SettingCoordinator instance;

		internal bool Synced { get; private set; }

		private void Awake()
		{
			if ((Object)(object)instance == (Object)null)
			{
				instance = this;
			}
			else if ((Object)(object)instance != (Object)(object)this)
			{
				Object.DestroyImmediate((Object)(object)instance);
			}
		}

		private void Start()
		{
			Synced = false;
		}

		public override void OnJoinedRoom()
		{
			Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties;
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Enforce Card Sync Stats"))
			{
				customProperties[(object)"Enforce Card Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Copy Sync Stats"))
			{
				customProperties[(object)"Copy Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"De-Legendarizer Sync Stats"))
			{
				customProperties[(object)"De-Legendarizer Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Shuffle Chaos Sync Stats"))
			{
				customProperties[(object)"Shuffle Chaos Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Swap All Sync Stats"))
			{
				customProperties[(object)"Swap All Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Swap One Sync Stats"))
			{
				customProperties[(object)"Swap One Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Rank Up Sync Stats"))
			{
				customProperties[(object)"Rank Up Sync Stats"] = false;
			}
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)"Rank Down Sync Stats"))
			{
				customProperties[(object)"Rank Down Sync Stats"] = false;
			}
			PhotonNetwork.LocalPlayer.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
			FSMemes.instance.OnHandShakeCompleted();
		}

		public override void OnPlayerEnteredRoom(Player newPlayer)
		{
			FSMemes.instance.OnHandShakeCompleted();
		}

		public override void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps)
		{
			if (!((Dictionary<object, object>)(object)changedProps).ContainsKey((object)"FSM Settings"))
			{
				return;
			}
			Synced = true;
			foreach (Player value2 in PhotonNetwork.CurrentRoom.Players.Values)
			{
				if (((Dictionary<object, object>)(object)value2.CustomProperties).TryGetValue((object)"FSM Settings", out object value))
				{
					if (!(bool)value)
					{
						Synced = false;
					}
				}
				else
				{
					Synced = false;
				}
			}
			if (!Synced)
			{
				FSMemes.instance.OnHandShakeCompleted();
			}
		}
	}
}
namespace FSMemesPlugin.MonoBehaviours
{
	public class PewSound : CardEffect
	{
		private float soundLastPlayed = Time.time;

		public override void OnShoot(GameObject projectile)
		{
			if (Time.time >= soundLastPlayed + 0.15f)
			{
				soundLastPlayed = Time.time;
				SoundManager.Instance.Play(Assets.PewSound, projectile.transform);
			}
		}
	}
}
namespace FSMemesPlugin.Extensions
{
	[Serializable]
	public class CharacterStatModifiersAdditionalData
	{
		public int totalKills;

		public int totalDeaths;

		public int killingSpree;

		public int killsInRound;

		public int deathsInRound;

		public Player lastKilledBy;

		public CharacterStatModifiersAdditionalData()
		{
			totalKills = 0;
			totalDeaths = 0;
			killingSpree = 0;
			killsInRound = 0;
			deathsInRound = 0;
			lastKilledBy = null;
		}
	}
	public static class CharacterStatModifiersExtension
	{
		public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>();

		public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers characterstats)
		{
			return data.GetOrCreateValue(characterstats);
		}

		public static void AddData(this CharacterStatModifiers characterstats, CharacterStatModifiersAdditionalData value)
		{
			try
			{
				data.Add(characterstats, value);
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
	internal class CharacterStatModifiersPatchResetStats
	{
		private static void Prefix(CharacterStatModifiers __instance)
		{
			__instance.GetAdditionalData().totalKills = 0;
			__instance.GetAdditionalData().totalDeaths = 0;
			__instance.GetAdditionalData().killingSpree = 0;
			__instance.GetAdditionalData().killsInRound = 0;
			__instance.GetAdditionalData().deathsInRound = 0;
			__instance.GetAdditionalData().lastKilledBy = null;
		}
	}
	public static class PlayerManagerExtension
	{
		public static Player GetRandomEnemy(this PlayerManager playerManager, Player player)
		{
			if (playerManager.players.Count == 1)
			{
				return null;
			}
			List<Player> list = new List<Player>(playerManager.players);
			Player[] playersInTeam = playerManager.GetPlayersInTeam(player.teamID);
			foreach (Player item in playersInTeam)
			{
				list.Remove(item);
			}
			return list[Random.Range(0, list.Count)];
		}
	}
}
namespace FSMemesPlugin.Cards
{
	internal class CopyCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return SwapCardManager.instance.copyCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)SwapCardManager.instance.copyCard))
				{
					SwapCardManager.instance.copyCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Copy";
				val.Description = "Why build your own strategy when you can steal someone else's? Copy an entire card set from a random player and make it your own!";
				val.ModName = "FSM";
				val.Art = Assets.CopyCardArt;
				val.Rarity = (Rarity)1;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SwapCardManager.instance.copyCards = true;
			SwapCardManager.instance.copyPlayers.Add(player);
		}
	}
	internal class DeLegendarizerCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return RarityCardManager.instance.deLegendarizerCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)RarityCardManager.instance.deLegendarizerCard))
				{
					RarityCardManager.instance.deLegendarizerCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "De-Legendarizer";
				val.Description = "Legendaries? Not on my watch! Instantly erase all legendary cards from every player.";
				val.ModName = "FSM";
				val.Art = Assets.DeLegendarizerCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			RarityCardManager.instance.deLegendarize = true;
		}
	}
	internal class InfinitePewCard : CustomEffectCard<PewSound>
	{
		public override CardDetails<PewSound> Details
		{
			get
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: 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_009f: Expected O, but got Unknown
				CardDetails<PewSound> val = new CardDetails<PewSound>();
				val.Title = "Infinite Pew";
				val.Description = "Why stop firing when you can keep going... forever?";
				val.ModName = "FSM";
				val.Art = Assets.InfinitePewCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[2]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Ammo",
						amount = "Infinite",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Damage",
						amount = "-95%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.attackSpeed = 0.06f;
			gun.damage = 0.05f;
			gun.reloadTime = 0f;
		}
	}
	internal class MorePewCard : CustomEffectCard<PewSound>
	{
		public override CardDetails<PewSound> Details
		{
			get
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: 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_009f: Expected O, but got Unknown
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Expected O, but got Unknown
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Expected O, but got Unknown
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Expected O, but got Unknown
				CardDetails<PewSound> val = new CardDetails<PewSound>();
				val.Title = "More Pew";
				val.Description = "Double the pew, double the fun.";
				val.ModName = "FSM";
				val.Art = Assets.MorePewCardArt;
				val.Rarity = (Rarity)1;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[5]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Attackspeed",
						amount = "+100%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "Ammo",
						amount = "+10",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "Burst",
						amount = "+2",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Damage",
						amount = "-30%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Reload",
						amount = "+25%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.attackSpeedMultiplier = 0.5f;
			gun.ammo = 10;
			gun.numberOfProjectiles = 2;
			gun.damage = 0.7f;
			gun.reloadTime = 1.25f;
		}
	}
	internal class NoMoreHealingCard : SimpleCard
	{
		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: 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_009f: Expected O, but got Unknown
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "No More Healing";
				val.Description = "Say goodbye to second chances for everyone!";
				val.ModName = "FSM";
				val.Art = Assets.NoMoreHealingCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[3]
				{
					new CardInfoStat
					{
						positive = false,
						stat = "Regen",
						amount = "Reset",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Lifesteal",
						amount = "Reset",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Respawns",
						amount = "Reset",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = false;
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			foreach (Player player2 in PlayerManager.instance.players)
			{
				player2.data.healthHandler.regeneration = 0f;
				player2.data.stats.regen = 0f;
				player2.data.stats.lifeSteal = 0f;
				player2.data.stats.respawns = 0;
				player2.data.stats.secondsToTakeDamageOver = 0f;
			}
		}

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class PewCard : CustomEffectCard<PewSound>
	{
		public override CardDetails<PewSound> Details
		{
			get
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: 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_009f: Expected O, but got Unknown
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Expected O, but got Unknown
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Expected O, but got Unknown
				CardDetails<PewSound> val = new CardDetails<PewSound>();
				val.Title = "Pew";
				val.Description = "Not flashy, not fancy—just pure pew.";
				val.ModName = "FSM";
				val.Art = Assets.PewCardArt;
				val.Rarity = (Rarity)1;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[4]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Attackspeed",
						amount = "+10%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "Ammo",
						amount = "+3",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Damage",
						amount = "-10%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Reload",
						amount = "+10%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.attackSpeedMultiplier = 0.9f;
			gun.ammo = 3;
			gun.damage = 0.9f;
			gun.reloadTime = 1.1f;
		}
	}
	internal class RankDownCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return RarityCardManager.instance.rankDownCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)RarityCardManager.instance.rankDownCard))
				{
					RarityCardManager.instance.rankDownCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Rank Down!";
				val.Description = "Time to bring someone back to reality! A random player's cards all drop in rarity — legendaries become epic, epics become rare, and so on. Enjoy your downgrade!";
				val.ModName = "FSM";
				val.Art = Assets.RankDownCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			RarityCardManager.instance.rankDown = true;
			RarityCardManager.instance.rankDownPlayers.Add(player);
		}
	}
	internal class RankUpCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return RarityCardManager.instance.rankUpCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)RarityCardManager.instance.rankUpCard))
				{
					RarityCardManager.instance.rankUpCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Rank Up!";
				val.Description = "Why settle for average when you can be legendary? All your cards get a rarity upgrade - common becomes uncommon, uncommon becomes rare, ...well, you get the idea!";
				val.ModName = "FSM";
				val.Art = Assets.RankUpCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			RarityCardManager.instance.rankUp = true;
			RarityCardManager.instance.rankUpPlayers.Add(player);
		}
	}
	internal class RouletteCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return SwapCardManager.instance.rouletteCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)SwapCardManager.instance.rouletteCard))
				{
					SwapCardManager.instance.rouletteCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Card Roulette";
				val.Description = "Feeling lucky? All players randomly swap one of their cards with another random player. Hope you get something good!";
				val.ModName = "FSM";
				val.Art = Assets.RouletteCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SwapCardManager.instance.swapOneCard = true;
		}
	}
	internal class ShuffleChaosCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return SwapCardManager.instance.shuffleChaosCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)SwapCardManager.instance.shuffleChaosCard))
				{
					SwapCardManager.instance.shuffleChaosCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Shuffle Chaos";
				val.Description = "Why stick to your own cards when you can mix things up? Every player’s cards get shuffled and randomly reassigned. Who knows what you’ll end up with?";
				val.ModName = "FSM";
				val.Art = Assets.ShuffleChaosCardArt;
				val.Rarity = (Rarity)1;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SwapCardManager.instance.shuffleChaos = true;
			SwapCardManager.instance.shufflePlayer = player;
		}
	}
	internal class SwitchCard : SimpleCard, ISaveableCard
	{
		public CardInfo CardInfo
		{
			get
			{
				return SwapCardManager.instance.switchCard;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)SwapCardManager.instance.switchCard))
				{
					SwapCardManager.instance.switchCard = value;
				}
			}
		}

		public override CardDetails Details
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0006: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Switch";
				val.Description = "Feeling lucky? Swap all your cards with a random player! Maybe you’ll win big... or regret everything.";
				val.ModName = "FSM";
				val.Art = Assets.SwitchCardArt;
				val.Rarity = (Rarity)1;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[0];
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CustomCardCategories.instance.CardCategory("CardManipulation") };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			SwapCardManager.instance.swapAllCards = true;
			SwapCardManager.instance.swapPlayers.Add(player);
		}
	}
	internal class UltimatePewCard : CustomEffectCard<PewSound>
	{
		public override CardDetails<PewSound> Details
		{
			get
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				//IL_004e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0055: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_006b: Unknown result type (might be due to invalid IL or missing references)
				//IL_006d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0073: Expected O, but got Unknown
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_007a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0081: Unknown result type (might be due to invalid IL or missing references)
				//IL_008c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0097: 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_009f: Expected O, but got Unknown
				//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cb: Expected O, but got Unknown
				//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f7: Expected O, but got Unknown
				//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
				//IL_0105: Unknown result type (might be due to invalid IL or missing references)
				//IL_0110: Unknown result type (might be due to invalid IL or missing references)
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_011d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Expected O, but got Unknown
				CardDetails<PewSound> val = new CardDetails<PewSound>();
				val.Title = "Ultimate Pew";
				val.Description = "Loud, flashy, and ridiculously powerful—because sometimes, you just need to PEW PEW PEW PEW PEW!";
				val.ModName = "FSM";
				val.Art = Assets.UltimatePewCardArt;
				val.Rarity = (Rarity)2;
				val.Theme = (CardThemeColorType)1;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[5]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Attackspeed",
						amount = "+1000%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "Ammo",
						amount = "+100",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Damage",
						amount = "-80%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Reload",
						amount = "+3s",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Spread",
						amount = "+15%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.attackSpeed = 0.3f;
			gun.ammo = 100;
			gun.damage = 0.2f;
			gun.reloadTimeAdd = 3f;
			gun.spread = 0.15f;
		}
	}
}