Decompiled source of ForseakynStudiosCards v1.4.0

FSCards.dll

Decompiled 2 weeks 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 CardThemeLib;
using FSCardsPlugin;
using FSCardsPlugin.Cards;
using FSCardsPlugin.Extensions;
using FSCardsPlugin.MonoBehaviours;
using FSCardsPlugin.Utils;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using ModdingUtils.AIMinion.Extensions;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RarityLib.Utils;
using Sonigon;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnityEngine;
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("FSCards")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+d2f7582159bbce0e5063f03119710ff7b95e250a")]
[assembly: AssemblyProduct("FSCards")]
[assembly: AssemblyTitle("FSCards")]
[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 FSCardsPlugins.Patches
{
	[HarmonyPatch(typeof(DeathEffect))]
	internal class DeathEffect_Patch
	{
		[HarmonyPostfix]
		[HarmonyPatch("PlayDeath")]
		private static void AdjustedRespawnTime(DeathEffect __instance, Color color, PlayerVelocity playerRig, Vector2 vel, int playerIDToRevive)
		{
			//IL_0013: 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_007c: Unknown result type (might be due to invalid IL or missing references)
			if (playerIDToRevive == -1)
			{
				return;
			}
			Player player = ((CharacterData)ExtensionMethods.GetFieldValue((object)playerRig, "data")).player;
			if (player.data.stats.GetAdditionalData().useNewRespawnTime)
			{
				float newRespawnTime = player.data.stats.GetAdditionalData().newRespawnTime;
				ExtensionMethods.SetFieldValue((object)__instance, "respawnTime", (object)newRespawnTime);
				ParticleSystem[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<ParticleSystem>();
				foreach (ParticleSystem obj in componentsInChildren)
				{
					obj.playbackSpeed = 2.53f / newRespawnTime;
					MainModule main = obj.main;
					((MainModule)(ref main)).simulationSpeed = 2.53f / newRespawnTime;
				}
				((Component)__instance).gameObject.GetComponent<RemoveAfterSeconds>().seconds = 2f * newRespawnTime;
			}
		}
	}
	[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
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			//IL_0140: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_0094: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_022b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0230: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_024f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0254: Unknown result type (might be due to invalid IL or missing references)
			//IL_03a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_03ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0347: Unknown result type (might be due to invalid IL or missing references)
			//IL_0361: Unknown result type (might be due to invalid IL or missing references)
			//IL_0366: Unknown result type (might be due to invalid IL or missing references)
			//IL_0373: Unknown result type (might be due to invalid IL or missing references)
			//IL_037b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0380: Unknown result type (might be due to invalid IL or missing references)
			//IL_044c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0451: Unknown result type (might be due to invalid IL or missing references)
			CharacterData val = (CharacterData)Traverse.Create((object)__instance).Field("data").GetValue();
			Player player = val.player;
			if (!val.isPlaying || val.dead || __instance.isRespawning)
			{
				return;
			}
			if (player.data.stats.GetAdditionalData().firstDamage && (Object)(object)damagingPlayer != (Object)null && (Object)(object)((Component)damagingPlayer).GetComponentInChildren<DivineSmiteEffect>() != (Object)null)
			{
				FSCards.LOGGER.LogInfo((object)"firstDamage");
				player.data.stats.GetAdditionalData().firstDamage = false;
				damage *= 1.5f;
				if (player.data.health <= ((Vector2)(ref damage)).magnitude)
				{
					lethal = true;
				}
				((Component)damagingPlayer).GetComponentInChildren<DivineSmiteEffect>().CastDivineSword(player);
			}
			if (player.data.stats.GetAdditionalData().firstHit)
			{
				FSCards.LOGGER.LogInfo((object)"firstHit");
				player.data.stats.GetAdditionalData().firstHit = false;
				if (player.data.stats.GetAdditionalData().firstHitdmgReduction > 0f)
				{
					damage /= player.data.stats.GetAdditionalData().firstHitdmgReduction;
				}
				if (lethal)
				{
					lethal = false;
				}
			}
			if (player.data.stats.GetAdditionalData().useDmgReduction)
			{
				FSCards.LOGGER.LogInfo((object)"useDmgReduction");
				if (player.data.stats.GetAdditionalData().dmgReduction > 0f)
				{
					damage /= player.data.stats.GetAdditionalData().dmgReduction;
				}
				if (lethal)
				{
					lethal = false;
				}
			}
			if (player.data.stats.GetAdditionalData().useDmgReductionAmount)
			{
				FSCards.LOGGER.LogInfo((object)"useDmgReductionAmount");
				if (player.data.stats.GetAdditionalData().dmgReductionAmount > 0f)
				{
					if (((Vector2)(ref damage)).magnitude >= player.data.stats.GetAdditionalData().dmgReductionAmount)
					{
						damage -= Vector2.one * player.data.stats.GetAdditionalData().dmgReductionAmount;
						player.data.stats.GetAdditionalData().dmgReductionAmount = 0f;
						player.data.stats.GetAdditionalData().useDmgReductionAmount = false;
					}
					else
					{
						player.data.stats.GetAdditionalData().dmgReductionAmount -= ((Vector2)(ref damage)).magnitude;
						damage = Vector2.zero;
					}
					if (lethal)
					{
						lethal = false;
					}
				}
			}
			if (lethal && val.health < ((Vector2)(ref damage)).magnitude && val.stats.GetAdditionalData().remainingMulligans > 0)
			{
				FSCards.LOGGER.LogInfo((object)"remainingMulligans");
				lethal = false;
			}
			if (player.data.stats.GetAdditionalData().useDmgRebound && (Object)(object)damagingPlayer != (Object)null)
			{
				FSCards.LOGGER.LogInfo((object)"useDmgRebound");
				if (player.data.stats.GetAdditionalData().dmgRebound > 0f)
				{
					Vector2 val2 = damage * player.data.stats.GetAdditionalData().dmgRebound;
					((Damagable)damagingPlayer.data.healthHandler).TakeDamage(val2, Vector2.op_Implicit(((Component)damagingPlayer).transform.position), (GameObject)null, player, true, false);
				}
			}
			if (player.data.stats.GetAdditionalData().useDmgAbsorb && damage != Vector2.zero)
			{
				FSCards.LOGGER.LogInfo((object)"useDmgAbsorb");
				player.data.stats.GetAdditionalData().useDmgAbsorb = false;
				damage = Vector2.zero;
				lethal = false;
			}
			if ((Object)(object)((Component)player).GetComponentInChildren<ShieldAbsorbEffect>() != (Object)null && damage != Vector2.zero && (Object)(object)damagingPlayer != (Object)null)
			{
				FSCards.LOGGER.LogInfo((object)$"ShieldAbsorbEffect currentChance {((Component)player).GetComponent<ShieldAbsorbEffect>().currentChance}");
				if (((Component)player).GetComponentInChildren<ShieldAbsorbEffect>().currentChance <= 0.2f)
				{
					damage = Vector2.zero;
					lethal = false;
				}
				((Component)player).GetComponentInChildren<ShieldAbsorbEffect>().CalculateNextProbability();
			}
		}
	}
}
namespace FSCardsPlugin
{
	internal class Assets
	{
		private static AssetBundle Bundle;

		public static GameObject AragornArt;

		public static GameObject BalrogArt;

		public static GameObject EarendilArt;

		public static GameObject FangornArt;

		public static GameObject FrodoArt;

		public static GameObject GandalfArt;

		public static GameObject GimliArt;

		public static GameObject HelmsDeepArt;

		public static GameObject LegolasArt;

		public static GameObject MithrilArt;

		public static GameObject MordorArt;

		public static GameObject NazgulArt;

		public static GameObject PalantirArt;

		public static GameObject RivendellArt;

		public static GameObject SauronArt;

		public static GameObject TheOneRingArt;

		public static GameObject WarArt;

		public static GameObject FamineArt;

		public static GameObject PestilenceArt;

		public static GameObject DeathArt;

		public static GameObject CriticalHitArt;

		public static GameObject CriticalFailureArt;

		public static GameObject ArcaneBarrageArt;

		public static GameObject ArcaneOverflowArt;

		public static GameObject CelestialShieldArt;

		public static GameObject CursedRelicArt;

		public static GameObject DragonsBreathArt;

		public static GameObject ElementalInfusionArt;

		public static GameObject FrostNovaArt;

		public static GameObject RuneOfReboundArt;

		public static GameObject ShadowDaggerArt;

		public static GameObject StoneSkinArt;

		public static GameObject VampiricPactArt;

		public static GameObject FireBallArt;

		public static GameObject MageHandArt;

		public static GameObject BarbariansRageArt;

		public static GameObject EldritchBlastArt;

		public static GameObject HealingWordArt;

		public static GameObject SneakAttackArt;

		public static GameObject ArcaneShieldArt;

		public static GameObject DivineSmiteArt;

		public static GameObject ThunderwaveArt;

		public static GameObject PoisonCloudArt;

		public static GameObject FeyStepArt;

		public static GameObject WarlocksPactArt;

		public static GameObject ShieldOfFateArt;

		public static GameObject PactOfTheBladeArt;

		public static GameObject MeteorSwarmArt;

		public static GameObject PolymorphArt;

		public static GameObject SongOfRestArt;

		public static GameObject ArcaneRicochetArt;

		public static GameObject ChaosBoltArt;

		public static GameObject TrickstersGambitArt;

		public static GameObject ArcaneEchoArt;

		public static GameObject PhantomStrikeArt;

		public static GameObject RunicOverloadArt;

		public static GameObject ShadowstepArt;

		public static GameObject TitansMightArt;

		public static GameObject DualNatureArt;

		public static GameObject GollumArt;

		public static GameObject StoneHideArt;

		public static GameObject FeatherweightArt;

		public static GameObject TrickShotArt;

		public static GameObject BalrogEnergy;

		public static GameObject CurseOfMordor;

		public static GameObject MagicOrb;

		public static GameObject ScreenDarkness;

		public static GameObject WallsOfHelmsDeep;

		public static GameObject DeathAura;

		public static GameObject CelestialShield;

		public static GameObject ArcaneExplosion;

		public static GameObject FireBall;

		public static GameObject AreaFire;

		public static GameObject FrostNova;

		public static GameObject FireHit;

		public static GameObject IceHit;

		public static GameObject LightningHit;

		public static GameObject BloodHit;

		public static GameObject EldritchBlast;

		public static GameObject DivineSword;

		public static GameObject Thunderwave;

		public static GameObject PoisonCloud;

		public static GameObject Meteor;

		public static GameObject CustomExplosion;

		public static event Action OnFinishedLoadingAssets;

		public static IEnumerator LoadAssets()
		{
			string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "fscassets");
			FSCards.LOGGER.LogInfo((object)("Started loading AssetsBundle from '" + text + "'"));
			Bundle = AssetBundle.LoadFromFile(text);
			if ((Object)(object)Bundle == (Object)null)
			{
				FSCards.LOGGER.LogError((object)("AssetBundle '" + text + "' not found in assembly manifest"));
				yield break;
			}
			AragornArt = Bundle.LoadAsset<GameObject>("C_Aragorn");
			BalrogArt = Bundle.LoadAsset<GameObject>("C_Balrog");
			EarendilArt = Bundle.LoadAsset<GameObject>("C_Earendil");
			FangornArt = Bundle.LoadAsset<GameObject>("C_Fangorn");
			FrodoArt = Bundle.LoadAsset<GameObject>("C_Frodo");
			GandalfArt = Bundle.LoadAsset<GameObject>("C_Gandalf");
			GimliArt = Bundle.LoadAsset<GameObject>("C_Gimli");
			HelmsDeepArt = Bundle.LoadAsset<GameObject>("C_HelmsDeep");
			LegolasArt = Bundle.LoadAsset<GameObject>("C_Legolas");
			MithrilArt = Bundle.LoadAsset<GameObject>("C_Mithril");
			MordorArt = Bundle.LoadAsset<GameObject>("C_Mordor");
			NazgulArt = Bundle.LoadAsset<GameObject>("C_Nazgul");
			PalantirArt = Bundle.LoadAsset<GameObject>("C_Palantir");
			RivendellArt = Bundle.LoadAsset<GameObject>("C_Rivendell");
			SauronArt = Bundle.LoadAsset<GameObject>("C_Sauron");
			TheOneRingArt = Bundle.LoadAsset<GameObject>("C_TheOneRing");
			WarArt = Bundle.LoadAsset<GameObject>("C_War");
			FamineArt = Bundle.LoadAsset<GameObject>("C_Famine");
			PestilenceArt = Bundle.LoadAsset<GameObject>("C_Pestilence");
			DeathArt = Bundle.LoadAsset<GameObject>("C_Death");
			CriticalHitArt = Bundle.LoadAsset<GameObject>("C_CriticalHit");
			CriticalFailureArt = Bundle.LoadAsset<GameObject>("C_CriticalFailure");
			ArcaneBarrageArt = Bundle.LoadAsset<GameObject>("C_ArcaneBarrage");
			ArcaneOverflowArt = Bundle.LoadAsset<GameObject>("C_ArcaneOverflow");
			CelestialShieldArt = Bundle.LoadAsset<GameObject>("C_CelestialShield");
			CursedRelicArt = Bundle.LoadAsset<GameObject>("C_CursedRelic");
			DragonsBreathArt = Bundle.LoadAsset<GameObject>("C_DragonsBreath");
			ElementalInfusionArt = Bundle.LoadAsset<GameObject>("C_ElementalInfusion");
			FrostNovaArt = Bundle.LoadAsset<GameObject>("C_FrostNova");
			RuneOfReboundArt = Bundle.LoadAsset<GameObject>("C_RuneOfRebound");
			ShadowDaggerArt = Bundle.LoadAsset<GameObject>("C_ShadowDagger");
			StoneSkinArt = Bundle.LoadAsset<GameObject>("C_StoneSkin");
			VampiricPactArt = Bundle.LoadAsset<GameObject>("C_VampiricPact");
			FireBallArt = Bundle.LoadAsset<GameObject>("C_FireBall");
			MageHandArt = Bundle.LoadAsset<GameObject>("C_MageHand");
			BarbariansRageArt = Bundle.LoadAsset<GameObject>("C_BarbariansRage");
			EldritchBlastArt = Bundle.LoadAsset<GameObject>("C_EldritchBlast");
			HealingWordArt = Bundle.LoadAsset<GameObject>("C_HealingWord");
			SneakAttackArt = Bundle.LoadAsset<GameObject>("C_SneakAttack");
			ArcaneShieldArt = Bundle.LoadAsset<GameObject>("C_ArcaneShield");
			DivineSmiteArt = Bundle.LoadAsset<GameObject>("C_DivineSmite");
			ThunderwaveArt = Bundle.LoadAsset<GameObject>("C_Thunderwave");
			PoisonCloudArt = Bundle.LoadAsset<GameObject>("C_PoisonCloud");
			PolymorphArt = Bundle.LoadAsset<GameObject>("C_Polymorph");
			FeyStepArt = Bundle.LoadAsset<GameObject>("C_FeyStep");
			WarlocksPactArt = Bundle.LoadAsset<GameObject>("C_WarlocksPact");
			ShieldOfFateArt = Bundle.LoadAsset<GameObject>("C_ShieldOfFate");
			PactOfTheBladeArt = Bundle.LoadAsset<GameObject>("C_PactOfTheBlade");
			MeteorSwarmArt = Bundle.LoadAsset<GameObject>("C_MeteorSwarm");
			SongOfRestArt = Bundle.LoadAsset<GameObject>("C_SongOfRest");
			ArcaneRicochetArt = Bundle.LoadAsset<GameObject>("C_ArcaneRicochet");
			ChaosBoltArt = Bundle.LoadAsset<GameObject>("C_ChaosBolt");
			TrickstersGambitArt = Bundle.LoadAsset<GameObject>("C_TrickstersGambit");
			ArcaneEchoArt = Bundle.LoadAsset<GameObject>("C_ArcaneEcho");
			PhantomStrikeArt = Bundle.LoadAsset<GameObject>("C_PhantomStrike");
			RunicOverloadArt = Bundle.LoadAsset<GameObject>("C_RunicOverload");
			ShadowstepArt = Bundle.LoadAsset<GameObject>("C_Shadowstep");
			TitansMightArt = Bundle.LoadAsset<GameObject>("C_TitansMight");
			DualNatureArt = Bundle.LoadAsset<GameObject>("C_DualNature");
			GollumArt = Bundle.LoadAsset<GameObject>("C_Gollum");
			StoneHideArt = Bundle.LoadAsset<GameObject>("C_StoneHide");
			FeatherweightArt = Bundle.LoadAsset<GameObject>("C_Featherweight");
			TrickShotArt = Bundle.LoadAsset<GameObject>("C_TrickShot");
			BalrogEnergy = Bundle.LoadAsset<GameObject>("A_BalrogEnergy");
			CurseOfMordor = Bundle.LoadAsset<GameObject>("A_CurseOfMordor");
			MagicOrb = ((Component)Bundle.LoadAsset<GameObject>("A_MagicOrb").AddComponent<GuidedMagicOrb>()).gameObject;
			ScreenDarkness = ((Component)Bundle.LoadAsset<GameObject>("A_ScreenDarkness").AddComponent<ScreenDarknessEffect>()).gameObject;
			WallsOfHelmsDeep = Bundle.LoadAsset<GameObject>("A_WallsOfHelmsDeep");
			DeathAura = Bundle.LoadAsset<GameObject>("A_DeathAura");
			CelestialShield = Bundle.LoadAsset<GameObject>("A_CelestialShield");
			ArcaneExplosion = Bundle.LoadAsset<GameObject>("A_ArcaneExplosion");
			FireBall = Bundle.LoadAsset<GameObject>("A_FireBall");
			AreaFire = Bundle.LoadAsset<GameObject>("A_AreaFire");
			FrostNova = Bundle.LoadAsset<GameObject>("A_FrostNova");
			FireHit = Bundle.LoadAsset<GameObject>("A_FireHit");
			IceHit = Bundle.LoadAsset<GameObject>("A_IceHit");
			LightningHit = Bundle.LoadAsset<GameObject>("A_LightningHit");
			BloodHit = Bundle.LoadAsset<GameObject>("A_BloodHit");
			EldritchBlast = Bundle.LoadAsset<GameObject>("A_EldritchBlast");
			DivineSword = Bundle.LoadAsset<GameObject>("A_DivineSword");
			Thunderwave = Bundle.LoadAsset<GameObject>("A_Thunderwave");
			PoisonCloud = Bundle.LoadAsset<GameObject>("A_PoisonCloud");
			Meteor = ((Component)Bundle.LoadAsset<GameObject>("A_Meteor").AddComponent<Meteor>()).gameObject;
			CustomExplosion = Bundle.LoadAsset<GameObject>("A_CustomExplosion");
			FSCards.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.cards", "ForseakynStudiosCards", "1.3.1")]
	[BepInProcess("Rounds.exe")]
	internal class FSCards : BaseUnityPlugin
	{
		private const string ModId = "com.forseakynstudios.rounds.cards";

		private const string ModName = "ForseakynStudiosCards";

		public const string Version = "1.3.1";

		public const string ModInitials = "FSC";

		internal static CardThemeColorType CardThemeColor;

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

		public static FSCards 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)
			//IL_0079: 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("EarthyBrown", new CardThemeColor
			{
				bgColor = new Color(0.36f, 0.25f, 0.2f),
				targetColor = new Color(0.58f, 0.44f, 0.3f)
			});
			new Harmony("com.forseakynstudios.rounds.cards").PatchAll();
		}

		private void Start()
		{
		}

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

		private void RegisterPrefabs()
		{
		}

		private void RegisterCards()
		{
			CardsRegistry.RegisterCard<AragornCard>();
			CardsRegistry.RegisterCard<FrodoCard>();
			CardsRegistry.RegisterCard<GandalfCard>();
			CardsRegistry.RegisterCard<LegolasCard>();
			CardsRegistry.RegisterCard<GimliCard>();
			CardsRegistry.RegisterCard<SauronCard>();
			CardsRegistry.RegisterCard<RivendellCard>();
			CardsRegistry.RegisterCard<MordorCard>();
			CardsRegistry.RegisterCard<HelmsDeepCard>();
			CardsRegistry.RegisterCard<FangornCard>();
			CardsRegistry.RegisterCard<TheOneRingCard>();
			CardsRegistry.RegisterCard<MithrilCard>();
			CardsRegistry.RegisterCard<NazgulCard>();
			CardsRegistry.RegisterCard<PalantirCard>();
			CardsRegistry.RegisterCard<BalrogCard>();
			CardsRegistry.RegisterCard<EarendilCard>();
			CardsRegistry.RegisterCard<WarCard>();
			CardsRegistry.RegisterCard<FamineCard>();
			CardsRegistry.RegisterCard<PestilenceCard>();
			CardsRegistry.RegisterCard<DeathCard>();
			CardsRegistry.RegisterCard<ArcaneRicochetCard>();
			CardsRegistry.RegisterCard<ArcaneShieldCard>();
			CardsRegistry.RegisterCard<BarbariansRageCard>();
			CardsRegistry.RegisterCard<ChaosBoltCard>();
			CardsRegistry.RegisterCard<CriticalFailureCard>();
			CardsRegistry.RegisterCard<CriticalHitCard>();
			CardsRegistry.RegisterCard<DivineSmiteCard>();
			CardsRegistry.RegisterCard<EldritchBlastCard>();
			CardsRegistry.RegisterCard<FeyStepCard>();
			CardsRegistry.RegisterCard<FireBallCard>();
			CardsRegistry.RegisterCard<HealingWordCard>();
			CardsRegistry.RegisterCard<MageHandCard>();
			CardsRegistry.RegisterCard<MeteorSwarmCard>();
			CardsRegistry.RegisterCard<PactOfTheBladeCard>();
			CardsRegistry.RegisterCard<PoisonCloudCard>();
			CardsRegistry.RegisterCard<PolymorphCard>();
			CardsRegistry.RegisterCard<ShieldOfFateCard>();
			CardsRegistry.RegisterCard<SneakAttackCard>();
			CardsRegistry.RegisterCard<SongOfRestCard>();
			CardsRegistry.RegisterCard<ThunderwaveCard>();
			CardsRegistry.RegisterCard<TrickstersGambitCard>();
			CardsRegistry.RegisterCard<WarlocksPactCard>();
			CardsRegistry.RegisterCard<ArcaneBarrageCard>();
			CardsRegistry.RegisterCard<ArcaneOverflowCard>();
			CardsRegistry.RegisterCard<CelestialShieldCard>();
			CardsRegistry.RegisterCard<CursedRelicCard>();
			CardsRegistry.RegisterCard<DragonsBreathCard>();
			CardsRegistry.RegisterCard<ElementalInfusionCard>();
			CardsRegistry.RegisterCard<FrostNovaCard>();
			CardsRegistry.RegisterCard<RuneOfReboundCard>();
			CardsRegistry.RegisterCard<ShadowDaggerCard>();
			CardsRegistry.RegisterCard<StoneSkinCard>();
			CardsRegistry.RegisterCard<VampiricPactCard>();
			CardsRegistry.RegisterCard<ArcaneEchoCard>();
			CardsRegistry.RegisterCard<DualNatureCard>();
			CardsRegistry.RegisterCard<FeatherweightCard>();
			CardsRegistry.RegisterCard<PhantomStrikeCard>();
			CardsRegistry.RegisterCard<RunicOverloadCard>();
			CardsRegistry.RegisterCard<ShadowstepCard>();
			CardsRegistry.RegisterCard<StoneHideCard>();
			CardsRegistry.RegisterCard<TitansMightCard>();
			CardsRegistry.RegisterCard<TrickShotCard>();
		}
	}
}
namespace FSCardsPlugin.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
		{
			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 static class Colors
	{
		public enum HueColorNames
		{
			Lime,
			Purple,
			PurpleDark,
			White,
			GoldenHermes,
			Fire,
			Ice,
			Lightning,
			Shadow,
			Stone,
			FuryLight,
			Fury,
			FuryDark,
			Poison,
			MagicBlue
		}

		private static Hashtable hueColourValues = new Hashtable
		{
			{
				HueColorNames.Lime,
				(object)new Color(0.537f, 0.953f, 0.212f, 1f)
			},
			{
				HueColorNames.Purple,
				(object)new Color(0.616f, 0f, 1f, 1f)
			},
			{
				HueColorNames.PurpleDark,
				(object)new Color(0.373f, 0.271f, 0.525f, 1f)
			},
			{
				HueColorNames.White,
				(object)new Color(0f, 0f, 0f, 1f)
			},
			{
				HueColorNames.GoldenHermes,
				(object)new Color(1f, 1f, 0.733f, 1f)
			},
			{
				HueColorNames.Fire,
				(object)new Color(0.5f, 0f, 0f, 1f)
			},
			{
				HueColorNames.Ice,
				(object)new Color(0.725f, 0.91f, 0.918f, 1f)
			},
			{
				HueColorNames.Lightning,
				(object)new Color(0.0235f, 0.5569f, 0.9882f, 1f)
			},
			{
				HueColorNames.Shadow,
				(object)new Color(0.157f, 0.157f, 0.157f, 0.1f)
			},
			{
				HueColorNames.Stone,
				(object)new Color(0.725f, 0.69f, 0.643f, 1f)
			},
			{
				HueColorNames.FuryLight,
				(object)new Color(0.843f, 0f, 0.063f, 1f)
			},
			{
				HueColorNames.Fury,
				(object)new Color(0.702f, 0f, 0.082f, 1f)
			},
			{
				HueColorNames.FuryDark,
				(object)new Color(0.529f, 0f, 0.09f, 1f)
			},
			{
				HueColorNames.Poison,
				(object)new Color(0.608f, 0.663f, 0.404f, 1f)
			},
			{
				HueColorNames.MagicBlue,
				(object)new Color(0.075f, 0.055f, 0.596f, 1f)
			}
		};

		public static Color HueColourValue(HueColorNames color)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			return (Color)hueColourValues[color];
		}
	}
	internal static class FragmentationAssets
	{
		private static GameObject _setInactiveDelay;

		internal static GameObject setInactiveDelay
		{
			get
			{
				//IL_002b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0035: Expected O, but got Unknown
				if ((Object)(object)_setInactiveDelay != (Object)null)
				{
					return _setInactiveDelay;
				}
				_setInactiveDelay = new GameObject("SetFragmentationInactiveDelay", new Type[1] { typeof(SetFragmentInactiveDelay) });
				Object.DontDestroyOnLoad((Object)(object)_setInactiveDelay);
				return _setInactiveDelay;
			}
			set
			{
			}
		}

		internal static ObjectsToSpawn setInactiveDelayObjectToSpawn
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return new ObjectsToSpawn
				{
					AddToProjectile = setInactiveDelay
				};
			}
			set
			{
			}
		}
	}
	public class FragmentationHitSurfaceEffect : HitSurfaceEffect
	{
		private static readonly Random rng = new Random();

		private Player player;

		private Gun gun;

		public override void Hit(Vector2 position, Vector2 normal, Vector2 velocity)
		{
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: 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_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: 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_0079: 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_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			player = ((Component)this).gameObject.GetComponent<Player>();
			gun = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
			Gun newGun = (Gun)(object)((Component)player).gameObject.AddComponent<FragmentationGun>();
			SpawnBulletsEffect spawnBulletsEffect = ((Component)player).gameObject.AddComponent<SpawnBulletsEffect>();
			Vector2 val = Vector2.op_Implicit(Vector3.Cross(Vector3.forward, Vector2.op_Implicit(normal)));
			Vector2 normalized = ((Vector2)(ref val)).normalized;
			List<Vector3> positions = GetPositions(position, normal, normalized);
			List<Vector3> directions = GetDirections(position, positions);
			spawnBulletsEffect.SetPositions(positions);
			spawnBulletsEffect.SetDirections(directions);
			spawnBulletsEffect.SetNumBullets(5);
			spawnBulletsEffect.SetTimeBetweenShots(0f);
			spawnBulletsEffect.SetInitialDelay(0f);
			SpawnBulletsEffect.CopyGunStats(gun, newGun);
			newGun.spread = 0.2f;
			newGun.numberOfProjectiles = Mathf.RoundToInt((float)(gun.GetAdditionalData().fragmentationProjectiles / 5));
			newGun.projectiles = (from e in Enumerable.Range(0, newGun.numberOfProjectiles)
				from x in newGun.projectiles
				select x).ToList().Take(newGun.numberOfProjectiles).ToArray();
			newGun.damage = Mathf.Clamp(newGun.damage / 2f, 0.5f, float.MaxValue);
			newGun.projectileSpeed = Mathf.Clamp(((Vector2)(ref velocity)).magnitude / 100f, 0.1f, 1f);
			newGun.damageAfterDistanceMultiplier = 1f;
			newGun.objectsToSpawn = (ObjectsToSpawn[])(object)new ObjectsToSpawn[2]
			{
				FragmentationAssets.setInactiveDelayObjectToSpawn,
				PreventRecursion.stopRecursionObjectToSpawn
			};
			spawnBulletsEffect.SetGun(newGun);
		}

		private List<Vector3> GetPositions(Vector2 position, Vector2 normal, Vector2 parallel)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			for (int i = 0; i < 5; i++)
			{
				list.Add(Vector2.op_Implicit(position + 0.2f * normal + 0.1f * (float)Extensions.NextGaussianDouble(rng) * parallel));
			}
			return list;
		}

		private List<Vector3> GetDirections(Vector2 position, List<Vector3> shootPos)
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: 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)
			//IL_001e: 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_0024: 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)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			List<Vector3> list = new List<Vector3>();
			foreach (Vector3 shootPo in shootPos)
			{
				Vector2 val = Vector2.op_Implicit(shootPo) - position;
				list.Add(Vector2.op_Implicit(((Vector2)(ref val)).normalized));
			}
			return list;
		}

		private Vector2 RotateByAngle(float angle, Vector2 vector)
		{
			//IL_000f: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			float num = Mathf.Cos(angle);
			float num2 = Mathf.Sin(angle);
			return new Vector2(num * vector.x - num2 * vector.y, num2 * vector.x + num * vector.y);
		}

		private Vector2 Reflect(Vector2 normal, Vector2 vector)
		{
			//IL_0002: 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_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//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)
			Vector2 normalized = ((Vector2)(ref normal)).normalized;
			return vector - 2f * Vector2.Dot(vector, normalized) * normalized;
		}

		private Vector2 DiffuseReflection(Vector2 normal, Vector2 vector)
		{
			//IL_0005: 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_0029: 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_002b: 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)
			float num = 90f - Vector2.Angle(vector, normal) % 180f;
			return RotateByAngle(((float)rng.NextDouble() - 0.5f) * num, Reflect(normal, vector));
		}
	}
	public class FragmentationGun : Gun
	{
	}
	public class SetFragmentInactiveDelay : MonoBehaviour
	{
		private const float inactiveDelay = 0.2f;

		private void Start()
		{
			if (!((Object)(object)((Component)this).gameObject.transform.parent == (Object)null) && (Object)(object)((Component)((Component)this).gameObject.transform.parent).GetComponent<ProjectileHit>() != (Object)null)
			{
				ProjectileHitExtension.GetAdditionalData(((Component)((Component)this).gameObject.transform.parent).GetComponent<ProjectileHit>()).inactiveDelay = 0.2f;
			}
		}
	}
	public class PreventRecursion
	{
		private static GameObject _stopRecursion;

		internal static GameObject stopRecursion
		{
			get
			{
				//IL_0038: Unknown result type (might be due to invalid IL or missing references)
				//IL_0042: Expected O, but got Unknown
				if ((Object)(object)_stopRecursion != (Object)null)
				{
					return _stopRecursion;
				}
				_stopRecursion = new GameObject("StopRecursion", new Type[2]
				{
					typeof(StopRecursion),
					typeof(DestroyOnUnparentAfterInitialized)
				});
				Object.DontDestroyOnLoad((Object)(object)_stopRecursion);
				return _stopRecursion;
			}
			set
			{
			}
		}

		internal static ObjectsToSpawn stopRecursionObjectToSpawn
		{
			get
			{
				//IL_0000: Unknown result type (might be due to invalid IL or missing references)
				//IL_0005: Unknown result type (might be due to invalid IL or missing references)
				//IL_0011: Expected O, but got Unknown
				return new ObjectsToSpawn
				{
					AddToProjectile = stopRecursion
				};
			}
			set
			{
			}
		}
	}
	public class DestroyOnUnparentAfterInitialized : MonoBehaviour
	{
		private static bool initialized;

		private bool isOriginal;

		private void Start()
		{
			if (!initialized)
			{
				isOriginal = true;
			}
		}

		private void LateUpdate()
		{
			if (!isOriginal && (Object)(object)((Component)this).gameObject.transform.parent == (Object)null)
			{
				Object.Destroy((Object)(object)((Component)this).gameObject);
			}
		}
	}
}
namespace FSCardsPlugin.Patches
{
	[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
	internal class ProjectileHitPatchRPCA_DoHit
	{
		private static void Prefix(ProjectileHit __instance, Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID, int colliderID, ref bool wasBlocked)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0113: Unknown result type (might be due to invalid IL or missing references)
			HitInfo val = new HitInfo();
			val.point = hitPoint;
			val.normal = hitNormal;
			val.collider = null;
			if (viewID != -1)
			{
				PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
				val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>();
				val.transform = ((Component)photonView).transform;
			}
			else if (colliderID != -1)
			{
				val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID];
				val.transform = ((Component)val.collider).transform;
			}
			HealthHandler val2 = null;
			if (Object.op_Implicit((Object)(object)val.transform))
			{
				val2 = ((Component)val.transform).GetComponent<HealthHandler>();
			}
			if (!Object.op_Implicit((Object)(object)val2) || !Object.op_Implicit((Object)(object)((Component)val2).GetComponent<CharacterData>()) || !Object.op_Implicit((Object)(object)((Component)val2).GetComponent<Block>()))
			{
				return;
			}
			Block component = ((Component)val2).GetComponent<Block>();
			if (!((Object)(object)((Component)val2).GetComponentInChildren<StoneSkinEffect>() != (Object)null))
			{
				return;
			}
			if (((Component)val2).GetComponentInChildren<StoneSkinEffect>().currentChance <= 0.2f)
			{
				wasBlocked = true;
				CharacterData component2 = ((Component)val2).GetComponent<CharacterData>();
				if (component2.view.IsMine && !CharacterDataExtension.GetAdditionalData(component2).isAIMinion)
				{
					component.CallDoBlock(true, true, (BlockTriggerType)0, default(Vector3), false);
					((Component)val2).GetComponentInChildren<StoneSkinEffect>().ApplyFlash();
				}
			}
			((Component)val2).GetComponentInChildren<StoneSkinEffect>().CalculateNextProbability();
		}
	}
}
namespace FSCardsPlugin.MonoBehaviours
{
	internal class GuidedMagicOrb : MonoBehaviour
	{
		private MoveTransform move;

		private float updateDelay = 0.1f;

		private float startTime;

		private SyncProjectile sync;

		public int state;

		public bool detected;

		private FlickerEvent[] flicks;

		public float x;

		public float y;

		public float speedX;

		public float speedY;

		private void Start()
		{
			move = ((Component)this).GetComponentInParent<MoveTransform>();
			flicks = ((Component)this).GetComponentsInChildren<FlickerEvent>();
			sync = ((Component)this).GetComponentInParent<SyncProjectile>();
			sync.active = true;
			state = 0;
			x = move.velocity.x;
			y = move.velocity.y;
			ResetTimer();
			detected = false;
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}

		private void ResetTimer()
		{
			startTime = Time.time;
		}

		private void Update()
		{
			//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_034b: 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_0119: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_0129: 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_0170: Unknown result type (might be due to invalid IL or missing references)
			//IL_0180: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b7: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0204: Unknown result type (might be due to invalid IL or missing references)
			//IL_020f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_0225: Unknown result type (might be due to invalid IL or missing references)
			//IL_022a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0241: Unknown result type (might be due to invalid IL or missing references)
			//IL_024b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0260: Unknown result type (might be due to invalid IL or missing references)
			//IL_0265: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: Unknown result type (might be due to invalid IL or missing references)
			if (!(Time.time >= startTime + updateDelay) || !((Object)(object)((Component)this).gameObject.transform.parent != (Object)null))
			{
				return;
			}
			ResetTimer();
			if (state == 0)
			{
				state = 1;
				move.velocity.z = 0f;
				MoveTransform val = move;
				val.velocity.x = val.velocity.x * 1f;
				MoveTransform val2 = move;
				val2.velocity.y = val2.velocity.y * 1f;
			}
			else if (state == 1)
			{
				Player closestPlayer = PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position), true);
				Player ownPlayer = ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer;
				if (Object.op_Implicit((Object)(object)closestPlayer) && (Object)(object)closestPlayer != (Object)(object)ownPlayer && !closestPlayer.data.dead && ((Component)closestPlayer.data).gameObject.activeInHierarchy)
				{
					detected = true;
				}
				bool flag = Vector2.Distance(Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)closestPlayer).transform.position)) <= 20f;
				if (detected && flag)
				{
					updateDelay = 0.2f;
					state = 2;
					Vector3 val3 = ((Component)closestPlayer).transform.position + ((Component)this).transform.right * move.selectedSpread * Vector3.Distance(((Component)this).transform.position, ((Component)closestPlayer).transform.position);
					float num = Vector3.Angle(((Component)this).transform.root.forward, val3 - ((Component)this).transform.position);
					MoveTransform obj = move;
					obj.velocity -= move.velocity * num;
					MoveTransform obj2 = move;
					obj2.velocity -= move.velocity;
					MoveTransform obj3 = move;
					obj3.velocity += Vector3.ClampMagnitude(val3 - ((Component)this).transform.position, 900f) * TimeHandler.deltaTime * ((Vector3)(ref move.localForce)).magnitude;
					move.velocity.z = 0f;
					speedX = move.velocity.x;
					speedY = move.velocity.y;
					MoveTransform obj4 = move;
					obj4.simulateGravity--;
					MoveTransform val4 = move;
					val4.velocity.x = val4.velocity.x * 0.01f;
					MoveTransform val5 = move;
					val5.velocity.y = val5.velocity.y * 0.01f;
					for (int i = 0; i < flicks.Length; i++)
					{
						flicks[i].isOn = true;
					}
				}
			}
			else if (state == 2)
			{
				new Vector3(speedX, speedY);
				move.velocity.x = speedX * 9f;
				move.velocity.y = speedY * 9f;
				move.velocity.z = 0f;
				state = 3;
			}
			else if (state == 3)
			{
				updateDelay = 0.3f;
				move.simulateGravity = 1;
				move.velocity.z = 0f;
				state = 1;
				detected = false;
			}
		}
	}
	internal class ScreenDarknessEffect : MonoBehaviour
	{
		public Image image;

		public Transform target;

		private const float DARKNESS_RADIUS_MAX = 2f;

		private const float DARKNESS_RADIUS = 0.2f;

		private const float DARKNESS_SOFTNESS = 0.2f;

		private const float DARKNESS_ASPECTRATIO = 1.77f;

		private float Radius
		{
			get
			{
				return ((Graphic)image).material.GetFloat("_Radius");
			}
			set
			{
				((Graphic)image).material.SetFloat("_Radius", value);
			}
		}

		private Vector4 PlayerPos
		{
			get
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				return ((Graphic)image).material.GetVector("_PlayerPos");
			}
			set
			{
				//IL_0010: Unknown result type (might be due to invalid IL or missing references)
				((Graphic)image).material.SetVector("_PlayerPos", value);
			}
		}

		private void Start()
		{
			image = ((Component)this).GetComponentInChildren<Image>();
			((Graphic)image).material.SetFloat("_Radius", 0.2f);
			((Graphic)image).material.SetFloat("_Softness", 0.2f);
			((Graphic)image).material.SetFloat("_AspectRatio", 1.77f);
			((Graphic)image).raycastTarget = false;
		}

		public ScreenDarknessEffect Initialize(float rampUpTime, Transform target)
		{
			((MonoBehaviour)this).StopAllCoroutines();
			((MonoBehaviour)this).StartCoroutine(DoShow(rampUpTime));
			this.target = target;
			return this;
		}

		private void Update()
		{
			//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_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			if (Object.op_Implicit((Object)(object)target))
			{
				Vector3 val = Camera.main.WorldToViewportPoint(target.position);
				PlayerPos = new Vector4(val.x, val.y, 0f, 0f);
			}
		}

		public void Remove(float duration = 1f)
		{
			((MonoBehaviour)this).StopAllCoroutines();
			((MonoBehaviour)this).StartCoroutine(DoRemove(duration));
		}

		private IEnumerator DoShow(float duration)
		{
			Radius = 2f;
			float time = Time.time;
			while (Time.time - time <= duration)
			{
				float num = 1f - (Time.time - time) / duration;
				Radius = 0.2f * num;
				yield return null;
			}
			Radius = 0.2f;
		}

		private IEnumerator DoRemove(float duration)
		{
			Radius = 0.2f;
			float time = Time.time;
			while (Time.time - time <= duration)
			{
				float num = (Time.time - time) / duration;
				Radius = 2f * num;
				yield return null;
			}
			Radius = 2f;
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}
	}
	internal class ShakeEffect : ReversibleEffect
	{
		private Player playerToModify;

		internal float xshakemag = 0.04f;

		internal float yshakemag = 0.02f;

		private readonly Random rng = new Random();

		public override void OnAwake()
		{
			playerToModify = ((Component)this).gameObject.GetComponent<Player>();
		}

		public override void OnStart()
		{
		}

		public override void OnUpdate()
		{
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			float num = (float)Extensions.NextGaussianDouble(rng);
			float num2 = (float)Extensions.NextGaussianDouble(rng);
			Vector3 val = default(Vector3);
			((Vector3)(ref val))..ctor(xshakemag * num, yshakemag * num2, 0f);
			Transform transform = ((Component)playerToModify).transform;
			transform.position += val;
		}

		public override void OnOnDestroy()
		{
		}

		public void SetXMag(float xmag)
		{
			xshakemag = xmag;
		}

		public void SetYMag(float ymag)
		{
			yshakemag = ymag;
		}
	}
	public class SpawnBulletsEffect : MonoBehaviour
	{
		private float initialDelay = 1f;

		private int numBullets = 1;

		private int numShot;

		private Gun gunToShootFrom;

		private List<Vector3> directionsToShoot = new List<Vector3>();

		private List<Vector3> positionsToShootFrom = new List<Vector3>();

		private float timeBetweenShots;

		private float timeSinceLastShot;

		private GameObject newWeaponsBase;

		private Player player;

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

		private void Start()
		{
			ResetTimer();
			timeSinceLastShot += initialDelay;
		}

		private void Update()
		{
			if (numShot >= numBullets || (Object)(object)gunToShootFrom == (Object)null)
			{
				Object.Destroy((Object)(object)this);
			}
			else if (Time.time >= timeSinceLastShot + timeBetweenShots)
			{
				Shoot();
			}
		}

		private void OnDisable()
		{
			Object.Destroy((Object)(object)this);
		}

		private void OnDestroy()
		{
			Object.Destroy((Object)(object)newWeaponsBase);
		}

		private void Shoot()
		{
			//IL_006e: 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)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: 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_00e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_0156: Unknown result type (might be due to invalid IL or missing references)
			//IL_0130: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0174: Unknown result type (might be due to invalid IL or missing references)
			//IL_0176: Unknown result type (might be due to invalid IL or missing references)
			//IL_0177: Unknown result type (might be due to invalid IL or missing references)
			int num = (gunToShootFrom.lockGunToDefault ? 1 : (gunToShootFrom.numberOfProjectiles + Mathf.RoundToInt(gunToShootFrom.chargeNumberOfProjectilesTo * 0f)));
			for (int i = 0; i < gunToShootFrom.projectiles.Length; i++)
			{
				for (int j = 0; j < num; j++)
				{
					Vector3 val = ((directionsToShoot.Count != 0) ? directionsToShoot[numShot % directionsToShoot.Count] : Vector3.down);
					if (gunToShootFrom.spread != 0f)
					{
						float multiplySpread = gunToShootFrom.multiplySpread;
						float num2 = Random.Range(0f - gunToShootFrom.spread, gunToShootFrom.spread);
						num2 /= (1f + gunToShootFrom.projectileSpeed * 0.5f) * 0.5f;
						val += Vector3.Cross(val, Vector3.forward) * num2 * multiplySpread;
					}
					if ((bool)typeof(Gun).InvokeMember("CheckIsMine", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gunToShootFrom, new object[0]))
					{
						Vector3 val2 = ((positionsToShootFrom.Count != 0) ? positionsToShootFrom[numShot % positionsToShootFrom.Count] : Vector3.zero);
						GameObject val3 = PhotonNetwork.Instantiate(((Object)gunToShootFrom.projectiles[i].objectToSpawn.gameObject).name, val2, Quaternion.LookRotation(val), (byte)0, (object[])null);
						if (PhotonNetwork.OfflineMode)
						{
							RPCA_Shoot(val3.GetComponent<PhotonView>().ViewID, num, 1f, Random.Range(0f, 1f));
							continue;
						}
						((Component)this).gameObject.GetComponent<PhotonView>().RPC("RPCA_Shoot", (RpcTarget)0, new object[4]
						{
							val3.GetComponent<PhotonView>().ViewID,
							num,
							1f,
							Random.Range(0f, 1f)
						});
					}
				}
			}
			ResetTimer();
		}

		[PunRPC]
		private void RPCA_Shoot(int bulletViewID, int numProj, float dmgM, float seed)
		{
			GameObject gameObject = ((Component)PhotonView.Find(bulletViewID)).gameObject;
			gunToShootFrom.BulletInit(gameObject, numProj, dmgM, seed, true);
			numShot++;
		}

		public void SetGun(Gun gun)
		{
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0068: Expected O, but got Unknown
			newWeaponsBase = Object.Instantiate<GameObject>(((Component)((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>()).gameObject, new Vector3(500f, 500f, -100f), Quaternion.identity);
			Object.DontDestroyOnLoad((Object)(object)newWeaponsBase);
			foreach (Transform item in newWeaponsBase.transform)
			{
				Transform val = item;
				if ((Object)(object)((Component)val).GetComponentInChildren<Renderer>() != (Object)null)
				{
					Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>();
					for (int i = 0; i < componentsInChildren.Length; i++)
					{
						componentsInChildren[i].enabled = false;
					}
				}
			}
			gunToShootFrom = newWeaponsBase.GetComponent<Gun>();
			CopyGunStats(gun, gunToShootFrom);
		}

		public void SetNumBullets(int num)
		{
			numBullets = num;
		}

		public void SetPosition(Vector3 pos)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			positionsToShootFrom = new List<Vector3> { pos };
		}

		public void SetDirection(Vector3 dir)
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			directionsToShoot = new List<Vector3> { dir };
		}

		public void SetPositions(List<Vector3> pos)
		{
			positionsToShootFrom = pos;
		}

		public void SetDirections(List<Vector3> dir)
		{
			directionsToShoot = dir;
		}

		public void SetTimeBetweenShots(float delay)
		{
			timeBetweenShots = delay;
		}

		public void SetInitialDelay(float delay)
		{
			initialDelay = delay;
		}

		private void ResetTimer()
		{
			timeSinceLastShot = Time.time;
		}

		public static void CopyGunStats(Gun copyFromGun, Gun copyToGun)
		{
			//IL_0206: Unknown result type (might be due to invalid IL or missing references)
			//IL_020b: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			copyToGun.ammo = copyFromGun.ammo;
			copyToGun.ammoReg = copyFromGun.ammoReg;
			copyToGun.attackID = copyFromGun.attackID;
			copyToGun.attackSpeed = copyFromGun.attackSpeed;
			copyToGun.attackSpeedMultiplier = copyFromGun.attackSpeedMultiplier;
			copyToGun.bodyRecoil = copyFromGun.bodyRecoil;
			copyToGun.bulletDamageMultiplier = copyFromGun.bulletDamageMultiplier;
			copyToGun.bulletPortal = copyFromGun.bulletPortal;
			copyToGun.bursts = copyFromGun.bursts;
			copyToGun.chargeDamageMultiplier = copyFromGun.chargeDamageMultiplier;
			copyToGun.chargeEvenSpreadTo = copyFromGun.chargeEvenSpreadTo;
			copyToGun.chargeNumberOfProjectilesTo = copyFromGun.chargeNumberOfProjectilesTo;
			copyToGun.chargeRecoilTo = copyFromGun.chargeRecoilTo;
			copyToGun.chargeSpeedTo = copyFromGun.chargeSpeedTo;
			copyToGun.chargeSpreadTo = copyFromGun.chargeSpreadTo;
			copyToGun.cos = copyFromGun.cos;
			copyToGun.currentCharge = copyFromGun.currentCharge;
			copyToGun.damage = copyFromGun.damage;
			copyToGun.damageAfterDistanceMultiplier = copyFromGun.damageAfterDistanceMultiplier;
			copyToGun.defaultCooldown = copyFromGun.defaultCooldown;
			copyToGun.dmgMOnBounce = copyFromGun.dmgMOnBounce;
			copyToGun.dontAllowAutoFire = copyFromGun.dontAllowAutoFire;
			copyToGun.drag = copyFromGun.drag;
			copyToGun.dragMinSpeed = copyFromGun.dragMinSpeed;
			copyToGun.evenSpread = copyFromGun.evenSpread;
			copyToGun.explodeNearEnemyDamage = copyFromGun.explodeNearEnemyDamage;
			copyToGun.explodeNearEnemyRange = copyFromGun.explodeNearEnemyRange;
			copyToGun.forceSpecificAttackSpeed = copyFromGun.forceSpecificAttackSpeed;
			copyToGun.forceSpecificShake = copyFromGun.forceSpecificShake;
			copyToGun.gravity = copyFromGun.gravity;
			copyToGun.hitMovementMultiplier = copyFromGun.hitMovementMultiplier;
			copyToGun.ignoreWalls = copyFromGun.ignoreWalls;
			copyToGun.isProjectileGun = copyFromGun.isProjectileGun;
			copyToGun.isReloading = copyFromGun.isReloading;
			copyToGun.knockback = copyFromGun.knockback;
			copyToGun.lockGunToDefault = copyFromGun.lockGunToDefault;
			copyToGun.multiplySpread = copyFromGun.multiplySpread;
			copyToGun.numberOfProjectiles = copyFromGun.numberOfProjectiles;
			copyToGun.objectsToSpawn = copyFromGun.objectsToSpawn;
			copyToGun.overheatMultiplier = copyFromGun.overheatMultiplier;
			copyToGun.percentageDamage = copyFromGun.percentageDamage;
			copyToGun.player = copyFromGun.player;
			copyToGun.projectielSimulatonSpeed = copyFromGun.projectielSimulatonSpeed;
			copyToGun.projectileColor = copyFromGun.projectileColor;
			copyToGun.projectiles = copyFromGun.projectiles;
			copyToGun.projectileSize = copyFromGun.projectileSize;
			copyToGun.projectileSpeed = copyFromGun.projectileSpeed;
			copyToGun.randomBounces = copyFromGun.randomBounces;
			copyToGun.recoil = copyFromGun.recoil;
			copyToGun.recoilMuiltiplier = copyFromGun.recoilMuiltiplier;
			copyToGun.reflects = copyFromGun.reflects;
			copyToGun.reloadTime = copyFromGun.reloadTime;
			copyToGun.reloadTimeAdd = copyFromGun.reloadTimeAdd;
			copyToGun.shake = copyFromGun.shake;
			copyToGun.shakeM = copyFromGun.shakeM;
			copyToGun.ShootPojectileAction = copyFromGun.ShootPojectileAction;
			((Weapon)copyToGun).sinceAttack = ((Weapon)copyFromGun).sinceAttack;
			copyToGun.size = copyFromGun.size;
			copyToGun.slow = copyFromGun.slow;
			copyToGun.smartBounce = copyFromGun.smartBounce;
			copyToGun.spawnSkelletonSquare = copyFromGun.spawnSkelletonSquare;
			copyToGun.speedMOnBounce = copyFromGun.speedMOnBounce;
			copyToGun.spread = copyFromGun.spread;
			copyToGun.teleport = copyFromGun.teleport;
			copyToGun.timeBetweenBullets = copyFromGun.timeBetweenBullets;
			copyToGun.timeToReachFullMovementMultiplier = copyFromGun.timeToReachFullMovementMultiplier;
			copyToGun.unblockable = copyFromGun.unblockable;
			copyToGun.useCharge = copyFromGun.useCharge;
			copyToGun.waveMovement = copyFromGun.waveMovement;
			Traverse.Create((object)copyToGun).Field("attackAction").SetValue((object)(Action)Traverse.Create((object)copyFromGun).Field("attackAction").GetValue());
			Traverse.Create((object)copyToGun).Field("gunID").SetValue((object)(int)Traverse.Create((object)copyFromGun).Field("gunID").GetValue());
			Traverse.Create((object)copyToGun).Field("spreadOfLastBullet").SetValue((object)(float)Traverse.Create((object)copyFromGun).Field("spreadOfLastBullet").GetValue());
			Traverse.Create((object)copyToGun).Field("forceShootDir").SetValue((object)(Vector3)Traverse.Create((object)copyFromGun).Field("forceShootDir").GetValue());
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
}
namespace FSCardsPlugin.Extensions
{
	[Serializable]
	public class CharacterStatModifiersAdditionalData
	{
		public bool useNewRespawnTime;

		public float newRespawnTime;

		public bool firstHit;

		public float firstHitdmgReduction;

		public int remainingMulligans;

		public bool useDmgReduction;

		public float dmgReduction;

		public bool useDmgReductionAmount;

		public float dmgReductionAmount;

		public bool useDmgRebound;

		public float dmgRebound;

		public bool useDmgAbsorb;

		public bool firstDamage;

		public CharacterStatModifiersAdditionalData()
		{
			useNewRespawnTime = false;
			newRespawnTime = 0f;
			firstHit = false;
			firstHitdmgReduction = 0f;
			remainingMulligans = 0;
			useDmgReduction = false;
			dmgReduction = 0f;
			useDmgReductionAmount = false;
			dmgReductionAmount = 0f;
			useDmgRebound = false;
			dmgRebound = 0f;
			useDmgAbsorb = false;
			firstDamage = true;
		}
	}
	public static class CharacterStatModifiersExtension
	{
		public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>();

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

		public static void AddData(this CharacterStatModifiers statModifiers, CharacterStatModifiersAdditionalData value)
		{
			try
			{
				data.Add(statModifiers, value);
			}
			catch (Exception)
			{
			}
		}
	}
	[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
	internal class CharacterStatModifiersPatchResetStats
	{
		private static void Prefix(CharacterStatModifiers __instance)
		{
			__instance.GetAdditionalData().useNewRespawnTime = false;
			__instance.GetAdditionalData().newRespawnTime = 0f;
			__instance.GetAdditionalData().firstHit = false;
			__instance.GetAdditionalData().firstHitdmgReduction = 0f;
			__instance.GetAdditionalData().remainingMulligans = 0;
			__instance.GetAdditionalData().useDmgReduction = false;
			__instance.GetAdditionalData().dmgReduction = 0f;
			__instance.GetAdditionalData().useDmgReductionAmount = false;
			__instance.GetAdditionalData().dmgReductionAmount = 0f;
			__instance.GetAdditionalData().useDmgRebound = false;
			__instance.GetAdditionalData().dmgRebound = 0f;
			__instance.GetAdditionalData().useDmgAbsorb = false;
			__instance.GetAdditionalData().firstDamage = true;
		}
	}
	[Serializable]
	public class GunAdditionalData
	{
		public int fragmentationProjectiles;

		public GunAdditionalData()
		{
			fragmentationProjectiles = 0;
		}
	}
	public static class GunExtension
	{
		[HarmonyPatch(typeof(Gun), "ResetStats")]
		private class GunPatchResetStats
		{
			private static void Prefix(Gun __instance)
			{
				__instance.GetAdditionalData().fragmentationProjectiles = 0;
			}
		}

		public static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>();

		public static GunAdditionalData GetAdditionalData(this Gun gun)
		{
			return data.GetOrCreateValue(gun);
		}

		public static void AddData(this Gun gun, GunAdditionalData value)
		{
			try
			{
				data.Add(gun, value);
			}
			catch (Exception)
			{
			}
		}
	}
	internal static class PlayerManagerExtensions
	{
		public static Player GetPlayerWithID(this PlayerManager instance, int playerID)
		{
			return ((IEnumerable<Player>)instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == playerID));
		}

		public static void ForEachPlayer(this PlayerManager instance, Action<Player> action)
		{
			foreach (Player player in instance.players)
			{
				action(player);
			}
		}
	}
}
namespace FSCardsPlugin.Cards
{
	internal class ArcaneBarrageCard : 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_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Arcane Barrage";
				val.Description = "Unleash a magical storm of projectiles.";
				val.ModName = "FSC";
				val.Art = Assets.ArcaneBarrageArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[3]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Projectiles",
						amount = "+6",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "DMG",
						amount = "-30%",
						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)
		{
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			cardInfo.allowMultiple = false;
			gun.projectileSpeed = 1.2f;
			gun.projectileSize = 0.8f;
			gun.numberOfProjectiles = 6;
			gun.spread = 0.2f;
			gun.damage = 0.7f;
			gun.projectileColor = Colors.HueColourValue(Colors.HueColorNames.Purple);
		}

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

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ArcaneEchoCard : CustomEffectCard<ArcaneEchoEffect>
	{
		public override CardDetails<ArcaneEchoEffect> Details
		{
			get
			{
				//IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				CardDetails<ArcaneEchoEffect> val = new CardDetails<ArcaneEchoEffect>();
				val.Title = "Arcane Echo";
				val.Description = "Magic reverberates, bringing the past into the present.";
				val.ModName = "FSC";
				val.Art = Assets.ArcaneEchoArt;
				val.Rarity = (Rarity)2;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[1]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Duplicate bullet",
						amount = "+1",
						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)
		{
		}

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ArcaneEchoEffect : CardEffect
	{
		private int shotsFired;

		public override IEnumerator OnPointStart(IGameModeHandler gameModeHandler)
		{
			shotsFired = 0;
			yield break;
		}

		public override IEnumerator OnShootCoroutine(GameObject projectile)
		{
			shotsFired++;
			if (shotsFired % 3 == 0)
			{
				Vector2 position = new Vector2(((CardEffect)this).gun.shootPosition.position.x, ((CardEffect)this).gun.shootPosition.position.y);
				Quaternion rotation = new Quaternion(((CardEffect)this).gun.shootPosition.rotation.x, ((CardEffect)this).gun.shootPosition.rotation.y, ((CardEffect)this).gun.shootPosition.rotation.z, ((CardEffect)this).gun.shootPosition.rotation.w);
				yield return (object)new WaitForSeconds(1f);
				FSCards.LOGGER.LogInfo((object)$"Fire additional bullet ({position}), ({rotation})!");
				InitBullet(((CardEffect)this).gun.projectiles[0].objectToSpawn.gameObject, position, rotation);
			}
		}

		public void InitBullet(GameObject prefab, Vector2 position, Quaternion rotation)
		{
			//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_000c: Unknown result type (might be due to invalid IL or missing references)
			PhotonNetwork.Instantiate(((Object)prefab).name, Vector2.op_Implicit(position), rotation, (byte)0, (object[])null).GetComponent<PhotonView>().RPC("RPCA_Init_noAmmoUse", (RpcTarget)0, new object[4]
			{
				((Weapon)((CardEffect)this).gun).holdable.holder.view.OwnerActorNr,
				1,
				((CardEffect)this).gun.bulletDamageMultiplier,
				1f
			});
		}
	}
	internal class ArcaneOverflowCard : 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_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Arcane Overflow";
				val.Description = "Magic floods your power, but weakens your body.";
				val.ModName = "FSC";
				val.Art = Assets.ArcaneOverflowArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[3]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "DMG",
						amount = "+15%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "Projectilespeed",
						amount = "+30%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Health",
						amount = "-10%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_0045: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Expected O, but got Unknown
			gun.projectileSpeed = 1.3f;
			gun.damage = 1.15f;
			statModifiers.health = 0.9f;
			gun.projectileColor = Colors.HueColourValue(Colors.HueColorNames.Purple);
			ObjectsToSpawn val = new ObjectsToSpawn
			{
				effect = Assets.ArcaneExplosion,
				spawnOn = (SpawnOn)0,
				direction = (Direction)0,
				scaleStacks = true,
				scaleStackM = 0.7f,
				scaleFromDamage = 0.5f
			};
			gun.objectsToSpawn = (ObjectsToSpawn[])(object)new ObjectsToSpawn[1] { val };
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			gun.projectileSize /= 2f;
		}

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class CelestialShieldCard : CustomEffectCard<CelestialShieldEffect>
	{
		public override CardDetails<CelestialShieldEffect> Details
		{
			get
			{
				//IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				CardDetails<CelestialShieldEffect> val = new CardDetails<CelestialShieldEffect>();
				val.Title = "Celestial Shield";
				val.Description = "A magical shield that protects you, but with limitations.";
				val.ModName = "FSC";
				val.Art = Assets.CelestialShieldArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[2]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Block efficiency",
						amount = "+20%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "DMG",
						amount = "-15%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

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

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

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class CelestialShieldEffect : CardEffect
	{
		private float startTime = Time.time;

		private float duration = 5f;

		private bool isActive;

		private GameObject gameObject;

		public void Update()
		{
			if (isActive && (Time.time >= startTime + duration || !((CardEffect)this).characterStats.GetAdditionalData().useDmgReductionAmount))
			{
				isActive = false;
				((CardEffect)this).characterStats.GetAdditionalData().useDmgReductionAmount = false;
				((CardEffect)this).characterStats.GetAdditionalData().dmgReductionAmount = 0f;
				if ((Object)(object)gameObject != (Object)null)
				{
					Object.Destroy((Object)(object)gameObject);
				}
			}
		}

		public override void OnBlock(BlockTriggerType blockTriggerType)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			if ((int)blockTriggerType == 0)
			{
				((CardEffect)this).characterStats.GetAdditionalData().useDmgReductionAmount = true;
				((CardEffect)this).characterStats.GetAdditionalData().dmgReductionAmount = ((CardEffect)this).player.data.maxHealth * 0.1f;
				startTime = Time.time;
				isActive = true;
				if ((Object)(object)gameObject != (Object)null)
				{
					Object.Destroy((Object)(object)gameObject);
				}
				gameObject = Object.Instantiate<GameObject>(Assets.CelestialShield, ((Component)((CardEffect)this).player).transform);
				gameObject.transform.localPosition = new Vector3(0f, 1.5f, 0f);
				gameObject.transform.SetParent((Transform)null, true);
			}
		}
	}
	internal class CursedRelicCard : CustomEffectCard<CursedRelicEffect>
	{
		public override CardDetails<CursedRelicEffect> Details
		{
			get
			{
				//IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				CardDetails<CursedRelicEffect> val = new CardDetails<CursedRelicEffect>();
				val.Title = "Cursed Relic";
				val.Description = "A cursed artifact offers great power at a heavy price.";
				val.ModName = "FSC";
				val.Art = Assets.CursedRelicArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[2]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "DMG",
						amount = "+40%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Curse",
						amount = "+1",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

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

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

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class CursedRelicEffect : CardEffect
	{
		public override void OnShoot(GameObject projectile)
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = Vector2.one * (((CardEffect)this).player.data.maxHealth * 0.02f);
			((Damagable)((CardEffect)this).player.data.healthHandler).TakeDamage(val, Vector2.op_Implicit(((Component)((CardEffect)this).player).transform.position), (GameObject)null, ((CardEffect)this).player, true, true);
		}
	}
	internal class ArcaneRicochetCard : 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_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Arcane Ricochet";
				val.Description = "Your magic defies physics, bouncing unpredictably with increasing force.";
				val.ModName = "FSC";
				val.Art = Assets.ArcaneRicochetArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[2]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Bounces",
						amount = "+2",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = true,
						stat = "DMG per bounce",
						amount = "+15%",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.reflects = 2;
			gun.dmgMOnBounce = 1.15f;
		}

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

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ArcaneShieldCard : CustomEffectCard<ArcaneFieldEffect>
	{
		public override CardDetails<ArcaneFieldEffect> Details
		{
			get
			{
				//IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				CardDetails<ArcaneFieldEffect> val = new CardDetails<ArcaneFieldEffect>();
				val.Title = "Arcane Shield";
				val.Description = "A shimmering field of arcane energy protects you.";
				val.ModName = "FSC";
				val.Art = Assets.ArcaneShieldArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[1]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Block",
						amount = "-1s",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			block.cdAdd -= 1f;
		}

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ArcaneFieldEffect : CardEffect
	{
		private ColorFlash colorFlash;

		private float startTime = Time.time;

		private readonly float duration = 5f;

		public void Update()
		{
			if (Time.time >= startTime + duration)
			{
				RemoveEffect();
			}
		}

		public override void OnBlock(BlockTriggerType blockTriggerType)
		{
			ApplyEffect();
		}

		public override void OnBlockProjectile(GameObject projectile, Vector3 forward, Vector3 hitPosition)
		{
			((CardEffect)this).player.data.healthHandler.Heal(((CardEffect)this).player.data.maxHealth * 0.15f);
		}

		private void ApplyEffect()
		{
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			((CardEffect)this).characterStats.GetAdditionalData().useDmgReduction = true;
			((CardEffect)this).characterStats.GetAdditionalData().dmgReduction = 1.15f;
			colorFlash = ExtensionMethods.GetOrAddComponent<ColorFlash>(((Component)((CardEffect)this).player).gameObject, false);
			colorFlash.SetNumberOfFlashes(1);
			colorFlash.SetDuration(0.25f);
			colorFlash.SetDelayBetweenFlashes(0.25f);
			colorFlash.SetColorMin(Colors.HueColourValue(Colors.HueColorNames.MagicBlue));
			colorFlash.SetColorMax(Colors.HueColourValue(Colors.HueColorNames.MagicBlue));
			startTime = Time.time;
		}

		private void RemoveEffect()
		{
			((CardEffect)this).characterStats.GetAdditionalData().useDmgReduction = false;
			((CardEffect)this).characterStats.GetAdditionalData().dmgReduction = 0f;
		}
	}
	internal class BarbariansRageCard : 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_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				//IL_0079: Unknown result type (might be due to invalid IL or missing references)
				//IL_007e: 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_0090: Unknown result type (might be due to invalid IL or missing references)
				//IL_009b: Unknown result type (might be due to invalid IL or missing references)
				//IL_009d: Unknown result type (might be due to invalid IL or missing references)
				//IL_00a3: Expected O, but got Unknown
				//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
				//IL_00aa: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
				//IL_00cf: Expected O, but got Unknown
				CardDetails val = new CardDetails();
				val.Title = "Barbarian's Rage";
				val.Description = "Let the fury of battle consume you.";
				val.ModName = "FSC";
				val.Art = Assets.BarbariansRageArt;
				val.Rarity = (Rarity)1;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[3]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "DMG",
						amount = "+30%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Recoil",
						amount = "+20%",
						simepleAmount = (SimpleAmount)0
					},
					new CardInfoStat
					{
						positive = false,
						stat = "Block",
						amount = "+2s",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			gun.damage = 1.3f;
			gun.recoilMuiltiplier = 1.2f;
			block.autoBlock = false;
			block.cdAdd = 2f;
		}

		protected override void Added(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			//IL_0053: 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_0102: Unknown result type (might be due to invalid IL or missing references)
			HealthBasedEffect obj = ((Component)player).gameObject.AddComponent<HealthBasedEffect>();
			((ReversibleEffect)obj).gunStatModifier.damage_mult = 1.1f;
			((ReversibleEffect)obj).gunStatModifier.attackSpeed_mult = 1.1f;
			((ReversibleEffect)obj).characterStatModifiersModifier.movementSpeed_mult = 1.1f;
			obj.SetPercThresholdMax(0.75f);
			obj.SetPercThresholdMin(0.5f);
			obj.SetColor(Colors.HueColourValue(Colors.HueColorNames.FuryLight));
			HealthBasedEffect obj2 = ((Component)player).gameObject.AddComponent<HealthBasedEffect>();
			((ReversibleEffect)obj2).gunStatModifier.damage_mult = 1.2f;
			((ReversibleEffect)obj2).gunStatModifier.attackSpeed_mult = 1.2f;
			((ReversibleEffect)obj2).characterStatModifiersModifier.movementSpeed_mult = 1.2f;
			obj2.SetPercThresholdMax(0.5f);
			obj2.SetPercThresholdMin(0.25f);
			obj2.SetColor(Colors.HueColourValue(Colors.HueColorNames.Fury));
			HealthBasedEffect obj3 = ((Component)player).gameObject.AddComponent<HealthBasedEffect>();
			((ReversibleEffect)obj3).gunStatModifier.damage_mult = 1.3f;
			((ReversibleEffect)obj3).gunStatModifier.attackSpeed_mult = 1.3f;
			((ReversibleEffect)obj3).characterStatModifiersModifier.movementSpeed_mult = 1.3f;
			obj3.SetPercThresholdMax(0.25f);
			obj3.SetColor(Colors.HueColourValue(Colors.HueColorNames.FuryDark));
		}

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ChaosBoltCard : CustomEffectCard<ChangeElementOnBounceEffect>
	{
		public override CardDetails<ChangeElementOnBounceEffect> Details
		{
			get
			{
				//IL_003a: 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_0052: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0064: Unknown result type (might be due to invalid IL or missing references)
				//IL_006f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Unknown result type (might be due to invalid IL or missing references)
				//IL_0077: Expected O, but got Unknown
				CardDetails<ChangeElementOnBounceEffect> val = new CardDetails<ChangeElementOnBounceEffect>();
				val.Title = "Chaos Bolt";
				val.Description = "Unleash pure chaos! Your spell changes its nature with every ricochet.";
				val.ModName = "FSC";
				val.Art = Assets.ChaosBoltArt;
				val.Rarity = (Rarity)2;
				val.Theme = FSCards.CardThemeColor;
				val.Stats = (CardInfoStat[])(object)new CardInfoStat[1]
				{
					new CardInfoStat
					{
						positive = true,
						stat = "Bounces",
						amount = "+3",
						simepleAmount = (SimpleAmount)0
					}
				};
				return val;
			}
		}

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

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

		protected override void Removed(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
		}
	}
	internal class ChangeElementOnBounceEffect : CardEffect
	{
		public override void OnShoot(GameObject projectile)
		{
			ExtensionMethods.GetOrAddComponent<ChangeElementOnBounce>(projectile.gameObject, false);
		}

		public override void OnBulletHit(GameObject projectile, HitInfo hit)
		{
			ChangeElementOnBounce component = projectile.GetComponent<ChangeElementOnBounce>();
			if ((Object)(object)component != (Object)null)
			{
				component.ApplyElementEffect(hit);
			}
		}
	}
	internal class ChangeElementOnBounce : MonoBehaviour
	{
		private ProjectileHit projectileHit;

		private SpawnedAttack spawnedAttack;

		private int reflects;

		private ElementType currentElementType;

		private readonly List<ElementType> elements = new List<ElementType>
		{
			ElementType.Fire,
			ElementType.Ice,
			ElementType.Lightning
		};

		private void Start()
		{
			projectileHit = ((Component)this).GetComponent<ProjectileHit>();
			spawnedAttack = ((Component)this).GetComponent<SpawnedAttack>();
			ChangeElement();
		}

		public void ApplyElementEffect(HitInfo hit)
		{
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: 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_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_0