Decompiled source of CalciumCards v1.0.3

CalciumCards.dll

Decompiled 5 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using Calcium.Effects;
using Calcium.MonoBehaviours;
using CalciumCards.Card;
using CalciumCards.Cards;
using DrawNCards;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using PCE.Extensions;
using PCE.MonoBehaviours;
using Photon.Pun;
using SoundImplementation;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;
using WillsWackyManagers.UnityTools;
using WillsWackyManagers.Utils;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("CalciumCards")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("CalciumCards")]
[assembly: AssemblyTitle("CalciumCards")]
[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 PCE.Extensions
{
	[Serializable]
	public class BlockAdditionalData
	{
		public float discombobulateRange;

		public float discombobulateDuration;

		public float timeOfLastSuccessfulBlock;

		public BlockAdditionalData()
		{
			discombobulateRange = 0f;
			discombobulateDuration = 0f;
			timeOfLastSuccessfulBlock = -100f;
		}
	}
	public static class BlockExtension
	{
		public static readonly ConditionalWeakTable<Block, BlockAdditionalData> data = new ConditionalWeakTable<Block, BlockAdditionalData>();

		public static BlockAdditionalData GetAdditionalData(this Block block)
		{
			return data.GetOrCreateValue(block);
		}

		public static void AddData(this Block block, BlockAdditionalData value)
		{
			try
			{
				data.Add(block, value);
			}
			catch (Exception)
			{
			}
		}
	}
}
namespace PCE.MonoBehaviours
{
	public class DiscombobulateEffect : ReversibleEffect
	{
		private float startTime;

		private float duration;

		private float movementspeedMultiplier = 1f;

		private Color color;

		private ColorFlash colorEffect;

		public override void OnAwake()
		{
			ResetTimer();
		}

		public override void OnStart()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			colorEffect = ((Component)base.player).gameObject.AddComponent<ColorFlash>();
			colorEffect.SetColor(color);
			colorEffect.SetNumberOfFlashes(int.MaxValue);
			colorEffect.SetDuration(0.25f);
			colorEffect.SetDelayBetweenFlashes(0.25f);
			base.characterStatModifiersModifier.movementSpeed_mult = movementspeedMultiplier;
		}

		public override void OnUpdate()
		{
			if (Time.time - startTime >= duration)
			{
				Object.Destroy((Object)(object)this);
			}
		}

		public override void OnOnDestroy()
		{
			if ((Object)(object)colorEffect != (Object)null)
			{
				Object.Destroy((Object)(object)colorEffect);
			}
		}

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

		public void SetDuration(float duration)
		{
			this.duration = duration;
		}

		public void SetMovementSpeedMultiplier(float mult)
		{
			movementspeedMultiplier = mult;
		}

		public void SetColor(Color color)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			this.color = color;
		}
	}
}
namespace Calcium.MonoBehaviours
{
	public class RepeatShotSpawner : MonoBehaviour
	{
		private bool hasFired = false;

		public void Initialize(Gun gun, int repeatCount, float delay)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: 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)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Expected O, but got Unknown
			//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			if (!hasFired && !Object.op_Implicit((Object)(object)((Component)this).GetComponent<RepeatedBulletMarker>()))
			{
				hasFired = true;
				Vector3 position = ((Component)this).transform.position;
				Quaternion rotation = ((Component)this).transform.rotation;
				ProjectileHit component = ((Component)this).GetComponent<ProjectileHit>();
				if (Object.op_Implicit((Object)(object)component) && !((Object)(object)component.ownPlayer == (Object)null))
				{
					GameObject val = new GameObject("RepeatShotHelper");
					RepeatShotHelper repeatShotHelper = val.AddComponent<RepeatShotHelper>();
					repeatShotHelper.FireRepeatedShotAfterDelay(gun, component.ownPlayer.playerID, ((Object)((Component)this).gameObject).name.Replace("(Clone)", "").Trim(), position, rotation, repeatCount, delay);
				}
			}
		}
	}
	public class RepeatShotHelper : MonoBehaviour
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass1_0
		{
			public int playerID;

			public Func<Player, bool> <>9__0;

			internal bool <RepeatCoroutine>b__0(Player p)
			{
				return p.playerID == playerID;
			}
		}

		[CompilerGenerated]
		private sealed class <RepeatCoroutine>d__1 : IEnumerator<object>, IEnumerator, IDisposable
		{
			private int <>1__state;

			private object <>2__current;

			public Gun gun;

			public int playerID;

			public string prefabName;

			public Vector3 pos;

			public Quaternion rot;

			public int repeatCount;

			public float delay;

			public RepeatShotHelper <>4__this;

			private <>c__DisplayClass1_0 <>8__1;

			private int <i>5__2;

			private Player <localPlayer>5__3;

			private float <seed>5__4;

			private GameObject <clone>5__5;

			private ProjectileHit <hit>5__6;

			private RayCastTrail <trail>5__7;

			private PhotonView <pv>5__8;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <RepeatCoroutine>d__1(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<localPlayer>5__3 = null;
				<clone>5__5 = null;
				<hit>5__6 = null;
				<trail>5__7 = null;
				<pv>5__8 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_021a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0224: Expected O, but got Unknown
				//IL_0067: Unknown result type (might be due to invalid IL or missing references)
				//IL_0071: Expected O, but got Unknown
				//IL_0109: Unknown result type (might be due to invalid IL or missing references)
				//IL_010f: 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_0195: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass1_0();
					<>8__1.playerID = playerID;
					<i>5__2 = 0;
					break;
				case 1:
					<>1__state = -1;
					<localPlayer>5__3 = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == <>8__1.playerID));
					if ((Object)(object)<localPlayer>5__3 == (Object)null || !<localPlayer>5__3.data.view.IsMine)
					{
						goto IL_02c4;
					}
					<seed>5__4 = Random.value;
					<clone>5__5 = PhotonNetwork.Instantiate(prefabName, pos, rot, (byte)0, (object[])null);
					<clone>5__5.AddComponent<RepeatedBulletMarker>();
					<hit>5__6 = <clone>5__5.GetComponent<ProjectileHit>();
					<trail>5__7 = <clone>5__5.GetComponent<RayCastTrail>();
					if ((Object)(object)<hit>5__6 != (Object)null)
					{
						((Behaviour)<hit>5__6).enabled = false;
					}
					if ((Object)(object)<trail>5__7 != (Object)null)
					{
						((Behaviour)<trail>5__7).enabled = false;
					}
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 2;
					return true;
				case 2:
					<>1__state = -1;
					<pv>5__8 = <clone>5__5.GetComponent<PhotonView>();
					if ((Object)(object)<pv>5__8 != (Object)null)
					{
						<pv>5__8.RPC("RPCA_Init_noAmmoUse", (RpcTarget)0, new object[4] { <>8__1.playerID, 1, 1f, <seed>5__4 });
					}
					<>2__current = (object)new WaitForEndOfFrame();
					<>1__state = 3;
					return true;
				case 3:
					{
						<>1__state = -1;
						if ((Object)(object)<hit>5__6 != (Object)null)
						{
							((Behaviour)<hit>5__6).enabled = true;
							if ((Object)(object)<hit>5__6.ownPlayer == (Object)null)
							{
								<hit>5__6.ownPlayer = <localPlayer>5__3;
							}
						}
						if ((Object)(object)<trail>5__7 != (Object)null)
						{
							((Behaviour)<trail>5__7).enabled = true;
						}
						<localPlayer>5__3 = null;
						<clone>5__5 = null;
						<hit>5__6 = null;
						<trail>5__7 = null;
						<pv>5__8 = null;
						goto IL_02c4;
					}
					IL_02c4:
					<i>5__2++;
					break;
				}
				if (<i>5__2 < repeatCount)
				{
					<>2__current = (object)new WaitForSeconds(delay);
					<>1__state = 1;
					return true;
				}
				Object.Destroy((Object)(object)((Component)<>4__this).gameObject);
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		public void FireRepeatedShotAfterDelay(Gun gun, int playerID, string prefabName, Vector3 pos, Quaternion rot, int repeatCount, float delay)
		{
			//IL_0006: 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)
			((MonoBehaviour)this).StartCoroutine(RepeatCoroutine(gun, playerID, prefabName, pos, rot, repeatCount, delay));
		}

		[IteratorStateMachine(typeof(<RepeatCoroutine>d__1))]
		private IEnumerator RepeatCoroutine(Gun gun, int playerID, string prefabName, Vector3 pos, Quaternion rot, int repeatCount, float delay)
		{
			//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_002d: Unknown result type (might be due to invalid IL or missing references)
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <RepeatCoroutine>d__1(0)
			{
				<>4__this = this,
				gun = gun,
				playerID = playerID,
				prefabName = prefabName,
				pos = pos,
				rot = rot,
				repeatCount = repeatCount,
				delay = delay
			};
		}
	}
	public class RepeatShotCardHook : MonoBehaviour
	{
		public int repeatCount = 0;

		public float repeatDelay = 0f;

		private bool initialized = false;

		public void Init(Gun gun)
		{
			Gun gun2 = gun;
			if (initialized)
			{
				return;
			}
			initialized = true;
			Gun obj = gun2;
			obj.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(obj.ShootPojectileAction, (Action<GameObject>)delegate(GameObject bullet)
			{
				if (!((Object)(object)bullet == (Object)null) && !((Object)(object)bullet.GetComponent<RepeatShotSpawner>() != (Object)null))
				{
					RepeatShotSpawner repeatShotSpawner = bullet.AddComponent<RepeatShotSpawner>();
					repeatShotSpawner.Initialize(gun2, repeatCount, repeatDelay);
				}
			});
		}
	}
	public class RepeatedBulletMarker : MonoBehaviour
	{
	}
	public class TeammateScaling : MonoBehaviour
	{
		private Player player;

		private Gun gun;

		private Block block;

		private int lastTeammateCount = -1;

		private float lastAppliedDamageMult = 1f;

		private float lastAppliedBlockMult = 1f;

		private int baseDraws = -1;

		private int lastDrawBonus = 0;

		private void Start()
		{
			player = ((Component)this).GetComponentInParent<Player>();
			gun = player?.data?.weaponHandler?.gun;
			block = player?.data?.block;
			if ((Object)(object)player != (Object)null)
			{
				baseDraws = DrawNCards.GetPickerDraws(player.playerID);
			}
		}

		private void Update()
		{
			if ((Object)(object)player == (Object)null || (Object)(object)gun == (Object)null || (Object)(object)block == (Object)null || baseDraws < 0)
			{
				return;
			}
			int num = PlayerManager.instance.GetPlayersInTeam(player.teamID).Count((Player p) => (Object)(object)p != (Object)null && (Object)(object)p != (Object)(object)player);
			if (num != lastTeammateCount)
			{
				Gun obj = gun;
				obj.damage /= lastAppliedDamageMult;
				Block obj2 = block;
				obj2.cooldown /= lastAppliedBlockMult;
				lastAppliedDamageMult = Mathf.Pow(1.15f, (float)num);
				lastAppliedBlockMult = 1f / lastAppliedDamageMult;
				Gun obj3 = gun;
				obj3.damage *= lastAppliedDamageMult;
				Block obj4 = block;
				obj4.cooldown *= lastAppliedBlockMult;
				int num2 = Mathf.Min(num, 5);
				if (num2 != lastDrawBonus)
				{
					DrawNCards.SetPickerDraws(player.playerID, baseDraws + num2);
					lastDrawBonus = num2;
				}
				lastTeammateCount = num;
			}
		}

		private void OnDestroy()
		{
			if ((Object)(object)player != (Object)null && baseDraws >= 0)
			{
				DrawNCards.SetPickerDraws(player.playerID, baseDraws);
			}
		}
	}
}
namespace Calcium.Effects
{
	public class MasochismEffect : WasHitEffect
	{
		private bool MasoCooldown = false;

		private Player player;

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

		public override void WasDealtDamage(Vector2 damage, bool selfDamage)
		{
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			if (MasoCooldown || (Object)(object)player == (Object)null)
			{
				return;
			}
			Gun gun = player.data.weaponHandler.gun;
			GunAmmo gunAmmo = ((Component)gun).GetComponentInChildren<GunAmmo>();
			if ((Object)(object)gun == (Object)null || (Object)(object)gunAmmo == (Object)null)
			{
				return;
			}
			Gun obj = gun;
			obj.damage *= 1.25f;
			Gun obj2 = gun;
			obj2.attackSpeed *= 0.75f;
			GunAmmo obj3 = gunAmmo;
			obj3.reloadTime *= 0.75f;
			PlayerSkinHandler componentInChildren = ((Component)player.data.healthHandler).GetComponentInChildren<PlayerSkinHandler>();
			if (componentInChildren != null)
			{
				componentInChildren.BlinkColor(Color.magenta);
			}
			MasoCooldown = true;
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 5f, (Action)delegate
			{
				if (!((Object)(object)gun == (Object)null) && !((Object)(object)gunAmmo == (Object)null))
				{
					Gun obj4 = gun;
					obj4.damage /= 1.25f;
					Gun obj5 = gun;
					obj5.attackSpeed /= 0.75f;
					GunAmmo obj6 = gunAmmo;
					obj6.reloadTime /= 0.75f;
				}
			});
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 3f, (Action)delegate
			{
				MasoCooldown = false;
			});
		}

		public void Destroy()
		{
			Object.Destroy((Object)(object)this);
		}
	}
	public class TeleportEffect : ReversibleEffect
	{
		private Player player;

		public int teleports = 0;

		private float teleportCD = 0.1f;

		public override void OnStart()
		{
			player = ((Component)this).GetComponent<Player>();
		}

		public override void OnUpdate()
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null)
			{
				return;
			}
			teleportCD -= Time.deltaTime;
			if (teleportCD <= 0f && teleports > 0)
			{
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(Random.Range(-12f, 12f), Random.Range(-12f, 12f), 0f);
				Transform transform = ((Component)player).transform;
				transform.position += val;
				PlayerCollision componentInParent = ((Component)player).GetComponentInParent<PlayerCollision>();
				if (componentInParent != null)
				{
					componentInParent.IgnoreWallForFrames(2);
				}
				ExtensionMethods.SetFieldValue((object)player.data.playerVel, "velocity", (object)Vector2.zero);
				teleports--;
				teleportCD = 0.3f;
			}
			else if (teleports <= 0)
			{
				Object.Destroy((Object)(object)this);
			}
		}
	}
	public class ApplyTeleportEffect : HitEffect
	{
		public int teleportsToAdd = 0;

		public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
		{
			if (!((Object)(object)damagedPlayer == (Object)null) && !damagedPlayer.data.dead)
			{
				TeleportEffect teleportEffect = ((Component)damagedPlayer).gameObject.GetComponent<TeleportEffect>();
				if ((Object)(object)teleportEffect == (Object)null)
				{
					teleportEffect = ((Component)damagedPlayer).gameObject.AddComponent<TeleportEffect>();
				}
				teleportEffect.teleports += teleportsToAdd;
			}
		}
	}
}
namespace CalciumCards
{
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInPlugin("com.Tree.rounds.CalciumCards", "CalciumCards", "0.1.0")]
	[BepInProcess("Rounds.exe")]
	public class CalciumCards : BaseUnityPlugin
	{
		private const string ModId = "com.Tree.rounds.CalciumCards";

		private const string ModName = "CalciumCards";

		public const string Version = "0.1.0";

		public const string ModInitials = "CC";

		private static readonly AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("calciumisgoodforthebones", typeof(CalciumCards).Assembly);

		public static GameObject Flashbang = Bundle.LoadAsset<GameObject>("C_Flashbang");

		public static GameObject OccultTransfer = Bundle.LoadAsset<GameObject>("C_OccultTransfer");

		public static GameObject Goblin = Bundle.LoadAsset<GameObject>("C_Goblin");

		public static GameObject Rebirth = Bundle.LoadAsset<GameObject>("C_Rebirth");

		public static GameObject Masochism = Bundle.LoadAsset<GameObject>("C_Masochism");

		public static GameObject Duplication = Bundle.LoadAsset<GameObject>("C_Duplication");

		public static GameObject EchoBullet = Bundle.LoadAsset<GameObject>("C_EchoBullet");

		public static GameObject OccultCalamity = Bundle.LoadAsset<GameObject>("C_OccultCataclysm");

		public static GameObject DisplaceBullet = Bundle.LoadAsset<GameObject>("C_DisplaceBullet");

		public static GameObject CalciumComrades = Bundle.LoadAsset<GameObject>("C_CalciumComrades");

		public static CalciumCards instance { get; private set; }

		private void Awake()
		{
		}

		private void Start()
		{
			instance = this;
			CustomCard.BuildCard<Flashbang>();
			CustomCard.BuildCard<Goblin>();
			CustomCard.BuildCard<OccultTransfer>();
			CustomCard.BuildCard<Rebirth>();
			CustomCard.BuildCard<Masochism>();
			CustomCard.BuildCard<Duplication>();
			CustomCard.BuildCard<EchoingBullets>();
			CustomCard.BuildCard<OccultCalamity>();
			CustomCard.BuildCard<CalciumComrades>();
			CustomCard.BuildCard<DisplaceBullet>();
		}
	}
}
namespace CalciumCards.Card
{
	internal class OccultTransfer : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
		{
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
			cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { CurseManager.instance.curseInteractionCategory };
			gun.damage = 1.1f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Player player2 = player;
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)CalciumCards.instance, 0.5f, (Action)delegate
			{
				CardInfo[] allCursesOnPlayer = CurseManager.instance.GetAllCursesOnPlayer(player2);
				CardInfo val = allCursesOnPlayer[Random.Range(0, allCursesOnPlayer.Count())];
				Cards.instance.RemoveCardFromPlayer(player2, val, (SelectionType)3);
				Player[] array = PlayerManager.instance.players.Where((Player person) => person.teamID != player2.teamID).ToArray();
				Player val2 = array[Random.Range(0, array.Count())];
				Cards.instance.AddCardToPlayer(val2, val, false, "", 2f, 2f, true);
				CardBarUtils.instance.ShowAtEndOfPhase(val2, val);
			});
		}

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

		protected override string GetTitle()
		{
			return "Occult Transfer";
		}

		protected override string GetDescription()
		{
			return "Give a curse to another player";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.OccultTransfer;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: 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)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[2]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "DMG",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Curse",
					amount = "-1",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)0;
		}

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

		public override bool GetEnabled()
		{
			return true;
		}
	}
}
namespace CalciumCards.Cards
{
	internal class CalciumComrades : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = false;
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			((Component)player).gameObject.AddComponent<TeammateScaling>();
		}

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

		protected override string GetTitle()
		{
			return "Calcium Comrades";
		}

		protected override string GetDescription()
		{
			return "For each teammate you gain";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.CalciumComrades;
		}

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

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Draw Size",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "DMG",
					amount = "+15%",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Block cooldown",
					amount = "-15%",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)3;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class DisplaceBullet : CustomCard
	{
		public int teleportsOnHit = 1;

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			ApplyTeleportEffect orAddComponent = ExtensionMethods.GetOrAddComponent<ApplyTeleportEffect>(((Component)player).gameObject, false);
			orAddComponent.teleportsToAdd += teleportsOnHit;
		}

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

		protected override string GetTitle()
		{
			return "Displacer Bullet";
		}

		protected override string GetDescription()
		{
			return "Bullets make targets teleport on hit";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.DisplaceBullet;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: 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)
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Displacement",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = true,
					stat = "DMG",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload time",
					amount = "+0.25s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)1;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class Duplication : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = true;
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Player player2 = player;
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)CalciumCards.instance, 0.5f, (Action)delegate
			{
				int num = 0;
				while (num <= 10)
				{
					int index = Random.Range(0, player2.data.currentCards.Count);
					CardInfo val = player2.data.currentCards[index];
					num++;
					if (Cards.instance.PlayerIsAllowedCard(player2, val) && !(val.cardName == "Duplication") && !((Object)(object)val == (Object)(object)base.cardInfo))
					{
						Cards.instance.AddCardToPlayer(player2, val, false, "", 0f, 0f, true);
						CardBarUtils.instance.ShowAtEndOfPhase(player2, val);
						break;
					}
				}
			});
		}

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

		protected override string GetDescription()
		{
			return "Make a copy of a random card you own";
		}

		protected override CardInfoStat[] GetStats()
		{
			return null;
		}

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

		protected override GameObject GetCardArt()
		{
			return CalciumCards.Duplication;
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)8;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class EchoingBullets : CustomCard
	{
		public int repeatCount = 1;

		public float repeatDelay = 1.25f;

		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers)
		{
			gun.reloadTimeAdd = 0.25f;
			gun.attackSpeed = 1.25f;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			RepeatShotCardHook repeatShotCardHook = ((Component)gun).gameObject.GetComponent<RepeatShotCardHook>();
			if (!Object.op_Implicit((Object)(object)repeatShotCardHook))
			{
				repeatShotCardHook = ((Component)gun).gameObject.AddComponent<RepeatShotCardHook>();
			}
			repeatShotCardHook.repeatCount += repeatCount;
			if (repeatShotCardHook.repeatDelay == 0f)
			{
				repeatShotCardHook.repeatDelay = repeatDelay;
			}
			else
			{
				repeatShotCardHook.repeatDelay = Mathf.Min(repeatShotCardHook.repeatDelay, repeatDelay);
			}
			repeatShotCardHook.Init(gun);
		}

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

		protected override string GetTitle()
		{
			return "Echoing Bullet";
		}

		protected override string GetDescription()
		{
			return "Bullets repeat after a short delay";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.EchoBullet;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: 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)
			return (Rarity)2;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Repetition",
					amount = "+1",
					simepleAmount = (SimpleAmount)0
				},
				new CardInfoStat
				{
					positive = false,
					stat = "ATKSPD",
					amount = "",
					simepleAmount = (SimpleAmount)6
				},
				new CardInfoStat
				{
					positive = false,
					stat = "Reload time",
					amount = "+0.25s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)1;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class Flashbang : CustomCard
	{
		private class DiscombobSpawner : MonoBehaviour
		{
			private void Start()
			{
				//IL_003e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0068: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)((Component)this).gameObject.GetComponent<SpawnedAttack>().spawner != (Object)null)
				{
					((Component)this).gameObject.transform.localScale = new Vector3(1f, 1f, 1f) * (((Component)((Component)this).gameObject.GetComponent<SpawnedAttack>().spawner).GetComponent<Block>().GetAdditionalData().discombobulateRange / rangePerCard);
					((Component)this).gameObject.AddComponent<RemoveAfterSeconds>().seconds = 5f;
					ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "inited", (object)false);
					typeof(LineEffect).InvokeMember("Init", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, ((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), new object[0]);
					((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().radius = rangePerCard - 1.4f;
					ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "startWidth", (object)0.5f);
					((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().Play();
				}
			}
		}

		private static float rangePerCard = 5f;

		private static float durationPerCard = 2f;

		private static GameObject discombobVisual_ = null;

		private static GameObject discombobVisual
		{
			get
			{
				//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
				//IL_0104: 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_014f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0154: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)discombobVisual_ != (Object)null)
				{
					return discombobVisual_;
				}
				IEnumerable<CardInfo> first = ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList();
				List<CardInfo> second = (List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
				discombobVisual_ = Object.Instantiate<GameObject>(((Component)(from card in first.Concat(second).ToList()
					where card.cardName.ToLower() == "overpower"
					select card).First()).GetComponent<CharacterStatModifiers>().AddObjectToPlayer.GetComponent<SpawnObjects>().objectToSpawn[0], new Vector3(0f, 100000f, 0f), Quaternion.identity);
				((Object)discombobVisual_).name = "E_Discombobulate";
				Object.DontDestroyOnLoad((Object)(object)discombobVisual_);
				ParticleSystem[] componentsInChildren = discombobVisual_.GetComponentsInChildren<ParticleSystem>();
				for (int i = 0; i < componentsInChildren.Length; i++)
				{
					componentsInChildren[i].startColor = Color.yellow;
				}
				((Component)discombobVisual_.transform.GetChild(1)).GetComponent<LineEffect>().colorOverTime.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1]
				{
					new GradientColorKey(Color.white, 0f)
				};
				Object.Destroy((Object)(object)((Component)discombobVisual_.transform.GetChild(2)).gameObject);
				((Component)discombobVisual_.transform.GetChild(1)).GetComponent<LineEffect>().offsetMultiplier = 0f;
				((Component)discombobVisual_.transform.GetChild(1)).GetComponent<LineEffect>().playOnAwake = true;
				Object.Destroy((Object)(object)discombobVisual_.GetComponent<FollowPlayer>());
				discombobVisual_.GetComponent<DelayEvent>().time = 0f;
				Object.Destroy((Object)(object)discombobVisual_.GetComponent<SoundUnityEventPlayer>());
				Object.Destroy((Object)(object)discombobVisual_.GetComponent<Explosion>());
				Object.Destroy((Object)(object)discombobVisual_.GetComponent<Explosion_Overpower>());
				Object.Destroy((Object)(object)discombobVisual_.GetComponent<RemoveAfterSeconds>());
				discombobVisual_.AddComponent<DiscombobSpawner>();
				return discombobVisual_;
			}
			set
			{
			}
		}

		private static void makeHierarchyHidden(GameObject obj)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			((Object)obj.gameObject).hideFlags = (HideFlags)61;
			foreach (object item in obj.transform)
			{
				makeHierarchyHidden(((Component)(Transform)item).gameObject);
			}
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			if (block.GetAdditionalData().discombobulateRange == 0f)
			{
				block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, new Action<BlockTriggerType>(GetDoBlockAction(player, block).Invoke));
				block.objectsToSpawn.Add(discombobVisual);
			}
			block.cdAdd += 0.25f;
			block.GetAdditionalData().discombobulateRange += rangePerCard;
			block.GetAdditionalData().discombobulateDuration += durationPerCard;
		}

		public Action<BlockTriggerType> GetDoBlockAction(Player player, Block block)
		{
			Block block2 = block;
			Player player2 = player;
			return delegate(BlockTriggerType trigger)
			{
				//IL_0001: Unknown result type (might be due to invalid IL or missing references)
				//IL_0003: Invalid comparison between Unknown and I4
				//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_0025: 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_005c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0061: Unknown result type (might be due to invalid IL or missing references)
				//IL_008d: Unknown result type (might be due to invalid IL or missing references)
				//IL_0092: Unknown result type (might be due to invalid IL or missing references)
				if ((int)trigger != 1)
				{
					Vector2 val = Vector2.op_Implicit(((Component)block2).transform.position);
					Player[] array = PlayerManager.instance.players.ToArray();
					for (int i = 0; i < array.Length; i++)
					{
						if (array[i].playerID != player2.playerID && Vector2.Distance(val, Vector2.op_Implicit(((Component)array[i]).transform.position)) < block2.GetAdditionalData().discombobulateRange && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player2).transform.position), array[i]).canSee)
						{
							NetworkingManager.RPC(typeof(Flashbang), "OnDiscombobulateActivate", new object[2]
							{
								array[i].playerID,
								block2.GetAdditionalData().discombobulateDuration
							});
						}
					}
				}
			};
		}

		public override void OnRemoveCard()
		{
		}

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

		protected override string GetDescription()
		{
			return "Blocking triggers a flashbang, inverting nearby enemies movement.";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.Flashbang;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: 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)
			return (Rarity)1;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Block Cooldown",
					amount = "+0.25s",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)3;
		}

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

		[UnboundRPC]
		public static void OnDiscombobulateActivate(int playerID, float duration)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			DiscombobulateEffect orAddComponent = ExtensionMethods.GetOrAddComponent<DiscombobulateEffect>(((Component)(Player)typeof(PlayerManager).InvokeMember("GetPlayerWithID", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, PlayerManager.instance, new object[1] { playerID })).gameObject, false);
			orAddComponent.SetDuration(duration);
			orAddComponent.SetMovementSpeedMultiplier(-1f);
			orAddComponent.ResetTimer();
		}
	}
	internal class Goblin : CustomCard, IConditionalCard, ISaveableCard
	{
		internal static CardInfo card;

		public CardInfo Card
		{
			get
			{
				return card;
			}
			set
			{
				if (!Object.op_Implicit((Object)(object)card))
				{
					card = value;
				}
			}
		}

		public bool Condition(Player player, CardInfo card)
		{
			if ((Object)(object)card != (Object)(object)Goblin.card)
			{
				return true;
			}
			if (!Object.op_Implicit((Object)(object)player))
			{
				return true;
			}
			if (DrawNCards.GetPickerDraws(player.playerID) > 10)
			{
				return false;
			}
			return true;
		}

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

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			DrawNCards.SetPickerDraws(player.playerID, DrawNCards.GetPickerDraws(player.playerID) + 4);
		}

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

		public override void OnReassignCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			DrawNCards.SetPickerDraws(player.playerID, DrawNCards.GetPickerDraws(player.playerID) + 4);
		}

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

		protected override string GetDescription()
		{
			return "There'll never be enough.";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.Goblin;
		}

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

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Draw Size",
					amount = "+4",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)2;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class Masochism : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			((Component)player).gameObject.AddComponent<MasochismEffect>();
		}

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

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

		protected override string GetDescription()
		{
			return "Embrace the pain.                               Temporarily increased stats upon taking damage, 3s Cooldown.";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.Masochism;
		}

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

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Expected O, but got Unknown
			//IL_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: 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)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[3]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "DMG",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = true,
					stat = "ATKSPD",
					amount = "",
					simepleAmount = (SimpleAmount)2
				},
				new CardInfoStat
				{
					positive = true,
					stat = "Reload time",
					amount = "",
					simepleAmount = (SimpleAmount)6
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)4;
		}

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

		public override bool GetEnabled()
		{
			return true;
		}
	}
	internal class OccultCalamity : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = false;
			CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
		}

		public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
		{
			Player player2 = player;
			int num = 5;
			foreach (Player item in PlayerManager.instance.players.Where((Player p) => p.teamID != player2.teamID))
			{
				for (int i = 0; i < num; i++)
				{
					CardInfo val = CurseManager.instance.RandomCurse(item);
					if ((Object)(object)val != (Object)null)
					{
						Cards.instance.AddCardToPlayer(item, val, false, "", 0f, 0f, true);
					}
				}
			}
		}

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

		protected override string GetTitle()
		{
			return "Occult Calamity";
		}

		protected override string GetDescription()
		{
			return "Curses for all but you >:)";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.OccultCalamity;
		}

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

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Curses to others",
					amount = "+5",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)0;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class Rebirth : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
			cardInfo.allowMultiple = false;
			statModifiers.health = 0.5f;
		}

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

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

		protected override string GetTitle()
		{
			return "From The Ashes";
		}

		protected override string GetDescription()
		{
			return "Respawn on death twice";
		}

		protected override GameObject GetCardArt()
		{
			return CalciumCards.Rebirth;
		}

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

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = false,
					stat = "Health",
					amount = "",
					simepleAmount = (SimpleAmount)7
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)2;
		}

		public override string GetModName()
		{
			return "CC";
		}
	}
	internal class Template : CustomCard
	{
		public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
		{
		}

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

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

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

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

		protected override GameObject GetCardArt()
		{
			return null;
		}

		protected override Rarity GetRarity()
		{
			//IL_0002: 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)
			return (Rarity)0;
		}

		protected override CardInfoStat[] GetStats()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
			return (CardInfoStat[])(object)new CardInfoStat[1]
			{
				new CardInfoStat
				{
					positive = true,
					stat = "Effect",
					amount = "No",
					simepleAmount = (SimpleAmount)0
				}
			};
		}

		protected override CardThemeColorType GetTheme()
		{
			//IL_0002: 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)
			return (CardThemeColorType)7;
		}

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